Allow setting root ClientConfig settings#2906
Conversation
|
Plugin-specific settings are not known or used by LSP, so I wonder what is the intention to make them writeable? Shouldn't they be read-only? |
|
What you mean? Settings like |
|
For example I would expect your
|
|
I'm not saying it can't be done differently but at the moment I have a case where in |
|
So with my use case, the value is not modified for the sake of LSP but another "downstream" code. I don't feel that being able to modify custom root properties is inherently wrong. That said, I'm not sure I like the |
|
So regardless of what we do, I'll keep existing code for now for backward compatibility. Don't want to break anything. But I've added a "normal" |
| raise AttributeError(name) | ||
|
|
||
| @property | ||
| def root_settings(self) -> Any: |
There was a problem hiding this comment.
This could be typed a bit more strictly as dict[str, Any], right?
|
I guess by returning a reference to the original dict, which is mutable of course, this |
I do want it mutable though. |
I've realized that the approach using
__getattr__fails horribly when trying to set the value (which I would like to do in some cases). Adding__setattr__is not really feasible or at least it would make things a lot more complicated...Just expose
all_settingsdirectly.I'm not convinced about the name. Perhaps should be
root_settingsor something else?