Bug 536820 - Changes to configuration of language server should be effective in real-time
Summary: Changes to configuration of language server should be effective in real-time
Status: UNCONFIRMED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LSP4E (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 536855
  Show dependency tree
 
Reported: 2018-07-09 04:45 EDT by Manish Khurana CLA
Modified: 2022-02-04 09:12 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manish Khurana CLA 2018-07-09 04:45:24 EDT
As we are implementing Language Server Protocol in Eclipse CDT, we added support of two language servers : ClangD and CQuery and we also provided a preference to pass command-line arguments to the language server. But the problem we are experiencing is that when a language server is already running and if the user changes the language server or add some command-line arguments to language server from the preference page, the changes does not take place in the real-time. For changes to be effective we have to restart Eclipse. It would be better if we could find a way to make these changes take place in real-time.
Comment 1 Mickael Istria CLA 2018-07-09 05:48:29 EDT
What you can try is:
1. In your plugin declaring the language server and the language server stream provider, add the preference listener to be notified of preference change.
2. In this preference listener, when preference change, retrieve all the instances of your specific StreamConnectionProvider (you'll need to store them on your side, by adding a line in the constructor registering the instances somewhere accessible to the preference listener); and call .stop() on all of them

As a result, after you stopped the StreamConnectionProviders, LSP4E should automatically restart them when needed. Is the .start() method uses the preference, then it will be restarted with the newer preferences.
Comment 2 Nathan Ridge CLA 2018-07-09 15:52:35 EDT
My intention was for this bug to track the following suggestion from the lsp4e-dev discussion [1]:

"You may need some extra API in LanguageServerAccessor to find the started instances of LS by LanguageServerDefinition, if so, patch would be welcome."

If no such change to lsp4e is needed, we can close this.

[1] http://dev.eclipse.org/mhonarc/lists/lsp4e-dev/msg00254.html
Comment 3 Mickael Istria CLA 2018-07-09 15:57:06 EDT
(In reply to Nathan Ridge from comment #2)
> If no such change to lsp4e is needed, we can close this.

Let's keep this open until an implementation is found. Maybe my proposal won't work and API will be needed; maybe it will work and no API is actually required...
But tracking this user-story still makes sense for LSP4E. We'll close it once we have a clear working answer and example (like CDT's one) of how to enable the required behavior.
Comment 4 Mickael Istria CLA 2021-11-16 15:56:00 EST
Eclipse LSP4E is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/lsp4e/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest LSP4E snapshots (from https://download.eclipse.org/lsp4e/snapshots )
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present with snapshots:
* Create a new issue at https://github.com/eclipse/lsp4e/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed soon. Then the Bugzilla component for LSP4E will be archived and made read-only.