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

Generalize configSection to a list #561

Open
yav opened this issue Mar 14, 2024 · 4 comments
Open

Generalize configSection to a list #561

yav opened this issue Mar 14, 2024 · 4 comments

Comments

@yav
Copy link

yav commented Mar 14, 2024

As far as I understand, the current version supports either empty string here (give me all configuration), or a name, in which case you'd get one section.

I run into a situation where it would be convenient to request more than one section, even though this is probably not all that
common. Concretely, I was working on a plug-in that processes some C files, and I wanted to also be able to access the configuration of another C plugin (I know that's not going to work if the other plugin is not installed, but for my use case it is reasonable to assume that it is).

My request would be to either change the type to a list of Text, or if we want to be somewhat backward compatible, have a way to specify multiple sections in the string (e.g., ; separated).

@michaelpj
Copy link
Collaborator

I'm not that worried about backwards compatibility, but we need to think about how this works with lsp's config updates, since it mostly assumes that you have a single config object of some known type. I guess your config object just might depend on multiple config sections?

@yav
Copy link
Author

yav commented Mar 17, 2024

Yeah, my current workaround is to provide the empty string, so I get the configuration for all plugins, and I adjusted my configuration parsing code to extract the relevant sections.

I was envisioning something similar, except you'd get only the sections you subscribed to rather than all of them. This should be more efficient, but it might also help with resilience if some unused sections are malformed---we were running into issues on one of our devs' machines, where the configuration of an unrelated extension was causing the whole configuration to fail. The problem was something to do with unicode characters, and it wasn't clear if this was a problem with the LSP server (perhaps the handles are not set to the correct mode?) or that particular machine, as we didn't have time to investigate further. I'll file a separate issue if we do identify an LSP related problem.

@michaelpj
Copy link
Collaborator

Yikes. Generally speaking the whole configuration model is woefully under-specified, so I've been sort of assuming that people are just going to stick to a configuration section that they control. But evidently not!

@michaelpj
Copy link
Collaborator

I think this is probably not too difficult, so PRs welcome if I don't get to it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants