yang-lsp icon indicating copy to clipboard operation
yang-lsp copied to clipboard

Explicit documentation of LSP version and message support

Open esmasth opened this issue 1 year ago • 4 comments

There are initiatives now to integration this LSP server into editors such as Emacs/(Neo)Vim/Sublime/... and it is very helpful if the API support is documented explicitly.

esmasth avatar Apr 15 '24 08:04 esmasth

@dhuebner request your team's support here

An immediate help would be clarification on following

  • what LSP message content/trigger results in yang.settings file being read by the language server
  • what LSP message content/trigger results in all *.yang files in the workspace being read by the server

May I get a way to trigger LSP communication log for the VS Code client? I can provide the logs of communication triggered via the emacs lsp-mode or eglot lsp client frameworks, if differing from VS Code plugin logs.

esmasth avatar Apr 16 '24 09:04 esmasth

@esmasth Some things I recall from working with the vs-code extension:

  • In vs-code's extensions view you can see the extension details and its activation events. For Yangster thees are: onCommand:yang.diagram.open and onLanguage:yang. Where onLanguage means that the extension will be activated as soon as the user opens a *.yang file.
  • When the extension starts it will start the language server
  • Language server will start building the workspace (loading *.yang files)
  • Each time a preference value is needed the yang.settings preferences will be loaded by reading the yang.settings file
  • Regarding the Log. I think there is already an output channel connected to the Yang LSP in vs-code. It just doesn't log much, only errors I think. The output channel is only visible in vs-code after the first logging event.

To give you more exact answer for some of your questions I will need to do some code digging. I don't know when I will have time for that

dhuebner avatar Apr 17 '24 07:04 dhuebner

@dhuebner thanks for the initiation.

I think something goes sideways relatively in the other LSP client sequence that "Language server will start building the workspace (loading *.yang files)" does not work well with Emacs/Vim but works with VSCode/Sublime - precisely only the YANG files open as buffers in Emacs/Vim are passed on to the Language Server, and further yang.settings file is seemingly not accessed by the server, possibly related to how the workspace/project settings are sent over to the server.

Could we please have an option implemented in yang-vscode to log verbosely, as a cheaper alternate to code digging? Created TypeFox/yang-vscode#92 for LSP client side aspects - should there be a separate server ticket or can this ticket #241 itself be used for it?

esmasth avatar Apr 17 '24 07:04 esmasth

Could we please have an option implemented in yang-vscode to log verbosely, as a cheaper alternate to code digging? Created https://github.com/TypeFox/yang-vscode/issues/92 for LSP client side aspects

@dhuebner closed TypeFox/yang-vscode#92 with vscode-languageclient based tracing. Would still be helpful to have clarification and documentation via this ticket.

esmasth avatar Apr 26 '24 12:04 esmasth