-
Notifications
You must be signed in to change notification settings - Fork 132
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
Unique command names #279
Unique command names #279
Conversation
Paul had suggested the unique ID (maybe even just an incrementing integer) be generated by the client and passed to the server to prefix/suffix, which I'm open to as an alternative, or perhaps we use the |
For that second option to work, would the server then just keep track of what uuid was used to call it the first time, or is there some other way we'd register the setting? |
Correct the value would be passed to the server during initialization, it would have the same effect, just maybe feel a little cleaner without the long root folder URI, the client would likely keep the ID as the key to it's map (which as of writing is the workspace folder URI). |
Co-authored-by: Audrey Eschright <audrey@hashicorp.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this and for discovering this issue early before the release! 😅
Besides my comments inline I would have one more question about the format - was there a particular reason behind <static-prefix>.<command>.<instance-specific-prefix>
?
I don't have a strong opinion on the order, just genuinely curious if this was motivated by anything on the client side or in the LSP?
FINAL DECISION: going with an optional prefix for multi server uniqueness
|
Add explicit test with commandPrefix Add doc on new setting
Co-authored-by: Radek Simko <radek.simko@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This PR ensures the uniqueness of the exported commands across different language servers (with a
terraform-ls.
prefix, this is a common practice) and an additional<commandPrefix>.
, this latter ensures multiple instances of the language server can run side by side, it will become the clients responsibility to send requests with the correct command name, thecommandPrefix
is only enabled if specified in theinitializationOptions
for the server.Closes #278