LSP icon indicating copy to clipboard operation
LSP copied to clipboard

Merge client's and global `auto_complete_selector`

Open rchl opened this issue 1 year ago • 0 comments

When client specifies auto_complete_selector then it looks like currently it completely replaces the global auto_complete_selector:

https://github.com/sublimelsp/LSP/blob/c7d622c2890ee33ed66d349d58c69275b40be26d/plugin/session_view.py#L210-L220

Shouldn't there be a way to merge specified selector with the global one?

There are pros and cons of merging but I think it would make sense for the client to only care about special cases and still allow the global selectors to apply.

The example that made me file this is: I want to make LSP-typescript / LSP-vue provide completions within import paths (scope something like meta.import meta.string) but if I do that then now I also have to repeat global selectors and then the user potentially also has to override that setting manually to consider he's customizations to auto_complete_selector.

Implementation wise, the setting could optionally take an object with selector and strategy properties where stategy could be either replace or merge.

rchl avatar Nov 14 '24 08:11 rchl