Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding word_pattern configuration into nvim-lspconfig #2433

Open
hrsh7th opened this issue Feb 4, 2023 · 1 comment
Open

Consider adding word_pattern configuration into nvim-lspconfig #2433

hrsh7th opened this issue Feb 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@hrsh7th
Copy link
Sponsor

hrsh7th commented Feb 4, 2023

Language server

No response

Requested feature

This is a discussion, not a feature request.

I am a completion plugin developer.

The keyword_pattern is very important for completion.
However, keyword_pattern is actually not defined in LSP.

So how does the VSCode ecosystem handle it?

Here is the answer.

VSCode allows extensions to specify language-configuration.
(Probably to avoid regular expressions in the LSP spec.)

I think nvim-lspconfig could be considered a place for all VSCode extensions, for now.
(I don't think that's ideal, but at least I can say that's the way it is now.)

Based on those considerations, I thought we could consider managing keyword_pattern in lspconfig.

I can think of several functions that could use keyword_pattern, such as completion, renaming, etc.

While vim's iskeyword can handle this, it might be better if it could be set on a per-extension basis.
(For example, for the html language, \w+ is fine, but for emmet, \w+ is not sufficient.)

Translated with www.DeepL.com/Translator (free version)

Other clients which have this feature

vim-lsp

@hrsh7th hrsh7th added the enhancement New feature or request label Feb 4, 2023
@joeveiga
Copy link
Contributor

joeveiga commented Feb 11, 2023

Hey @hrsh7th !

What if we create a new repository to store those? Something like lsp-language-config.nvim perhaps. It looks like in the case of vscode, a language extension packages config, syntax, snippets, etc. all together. In the neovim ecosystem, all of those aspects are, for better or worse, split up into different plugins.

Having this separate new package would be useful for many plugins without the need to necessarily depend on lspconfig server setup related functionality. E.g. autoclose plugins, commenting, folding, etc.

Such a package could be fairly straightforward, maybe just "forking" the configs from vscode.

I could help with it if we think it could actually be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants