Ekopalypse / NppLspClient

LSP client for Notepad++
MIT License
39 stars 3 forks source link

Help request #1

Closed donho closed 2 years ago

donho commented 2 years ago

Hi @Ekopalypse

It's a very good initiative this plugin. Could you provide me the language server that you use for your dev? Where can I download the binary of the server and how to test NppLspClient?

Thank you.

Ekopalypse commented 2 years ago

Hello @donho,

I mostly use gopls (golang language server) and pyls (python) for testing. pyls is the most forgiving, while gopls is more picky about "correct" messages. Unfortunately Jedi, a component that is used by pyls, is quite slow to provide a good user experience, this is where gopls can really shine.

Since I know you are a C++ developer, there is also a C/C++ language server from the Clang project called clangd that I tested.

To set up the servers, I followed the steps below.

pyls:

To configure the servers, open 'Plugins->NppLspClient->Open Configuration file'. Paste the following into it and change the executable configuration according to your needs.

# Example of a language server configuration
[lspservers.python]
mode = "io"
executable = 'C:\ProgramData\Python\Python310\Scripts\pylsp.exe'
args = '--check-parent-process --log-file C:\temp\log.txt -vvv'
auto_start_server = false

[lspservers.go]
mode = "io"
executable = 'C:\Users\YOUR_USERNAME\go\bin\gopls.exe'
auto_start_server = false

[lspservers."c++"]
mode = "io"
executable = 'C:\tools\clangd_13.0.0\bin\clangd.exe'
args = '--offset-encoding=utf-8 --pretty'
auto_start_server = false

[lspservers.c]
mode = "io"
executable = 'C:\tools\clangd_13.0.0\bin\clangd.exe'
args = '--offset-encoding=utf-8 --pretty'
auto_start_server = false

Restart Npp.

Open a source file and run Plugins->NppLspClient->toggle console and Plugins->NppLspClient->Start server for current language.

In the task manager you should see an Npp child-process of the language server you just started. Start typing and you should see completion/calltip hints and/or errors/warnings.

If you find a problem where it appears that Npp is hanging, terminate the language server process and Npp should return to normal. I have on rare occasions a race condition when reading/writing to/from stdin/stdout that I have not yet resolved.

If something is unclear or I can do something different, let me know.

By the way, another Npp user, Derek Brown alias kered13 has started here, another lsp plugin project quite simultaneously. This is being developed with C++. Perhaps this is also interesting for you?

donho commented 2 years ago

@Ekopalypse I will try to follow your instructions to have the test configuration. Thank you very much for your very detailed explanation and information.

asmwarrior commented 2 years ago

Some suggestion: 1, I think the methods in the comments should be put in the homepage markdown files. 2, I think you need to add some tags for your project ,such as notepad++ or similar like keywords.

Ekopalypse commented 2 years ago

@asmwarrior - Thank you for your interest. Are you referring to the instructions for installing/configuring a language server to be part of the homepage? If so, each language server has its own configuration parameters and needs to be installed differently. What do you mean by adding tags like Notepad++ to the project?

asmwarrior commented 2 years ago

@asmwarrior - Thank you for your interest. Are you referring to the instructions for installing/configuring a language server to be part of the homepage? If so, each language server has its own configuration parameters and needs to be installed differently.

Yes, I mean the how to configure this plugin to use the language servers. I know there are many language servers, maybe you can put some ones people used mostly.

What do you mean by adding tags like Notepad++ to the project?

Oh, sorry, I mean the topics, for example: notepad · GitHub Topics

Ekopalypse commented 2 years ago

Added tips.md