Skip to content
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

Added some LSP servers and updated python's roots #7897

Merged
merged 4 commits into from
Aug 13, 2023
Merged

Added some LSP servers and updated python's roots #7897

merged 4 commits into from
Aug 13, 2023

Conversation

arenekosreal
Copy link
Contributor

@arenekosreal arenekosreal commented Aug 10, 2023

  • Added csharp-ls for C# LSP server
  • Added pyright for Python LSP server
  • Updated python's roots for better determination of project root
  • Added pylyzer for Python LSP server

Note: All LSP servers are not set to default, they are just for people who prefer them.

It may be prefered than pylsp by someone.
According to #5479, I don't
make it default for everyone. Just for people who need this.
Using some known filenames to detect correct project root.
languages.toml Outdated Show resolved Hide resolved
Co-authored-by: zetashift <rskaraya@gmail.com>
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Aug 13, 2023
@pascalkuthe pascalkuthe merged commit b0c270f into helix-editor:master Aug 13, 2023
@David-Else
Copy link
Contributor

@oyarsa @zhanghua000 If I don't add:

languages.toml

[language-server.pyright]
config = {}

with a pyproject.toml in my project root (other config files may also work)

[tool.pyright]
typeCheckingMode  = "strict"

Then pyright does not work, discussed in #5479 but not really resolved. I spent hours fiddling around with this and still don't really get it. Should we just add config = {} to the default or maybe there is something better? Anyone got this working as if with just adding language-servers = [ "pyright" ]?

@the-mikedavis
Copy link
Member

Yeah I think we should add config = {} to the pyright config. Without it pyright times out for nearly every request (#8020 (comment))

@David-Else
Copy link
Contributor

@the-mikedavis How is that done? Adding:

pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }

to the main languages.toml does not seem to work, would it be:

pyright = { command = "pyright-langserver", args = ["--stdio"] }
[language-server.pyright]
config = {}

@the-mikedavis
Copy link
Member

That first change works for me

diff --git a/languages.toml b/languages.toml
index 2477f1ad..011ab278 100644
--- a/languages.toml
+++ b/languages.toml
@@ -55,7 +55,7 @@ perlnavigator = { command = "perlnavigator", args= ["--stdio"] }
 prisma-language-server = { command = "prisma-language-server", args = ["--stdio"] }
 purescript-language-server = { command = "purescript-language-server", args = ["--stdio"] }
 pylsp = { command = "pylsp" }
-pyright = { command = "pyright-langserver", args = ["--stdio"] }
+pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }
 pylyzer = { command = "pylyzer", args = ["--server"] }
 qmlls = { command = "qmlls" }
 r = { command = "R", args = ["--no-echo", "-e", "languageserver::run()"] }

where I also have a .helix/languages.toml to select pyright:

[[language]]
name = "python"
language-servers = ["pyright"]

@David-Else
Copy link
Contributor

That first change works for me

diff --git a/languages.toml b/languages.toml
index 2477f1ad..011ab278 100644
--- a/languages.toml
+++ b/languages.toml
@@ -55,7 +55,7 @@ perlnavigator = { command = "perlnavigator", args= ["--stdio"] }
 prisma-language-server = { command = "prisma-language-server", args = ["--stdio"] }
 purescript-language-server = { command = "purescript-language-server", args = ["--stdio"] }
 pylsp = { command = "pylsp" }
-pyright = { command = "pyright-langserver", args = ["--stdio"] }
+pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }
 pylyzer = { command = "pylyzer", args = ["--server"] }
 qmlls = { command = "qmlls" }
 r = { command = "R", args = ["--no-echo", "-e", "languageserver::run()"] }

where I also have a .helix/languages.toml to select pyright:

[[language]]
name = "python"
language-servers = ["pyright"]

I had a typo, it does indeed work, and I have made a PR #8032

dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
* Add csharp-ls for possible c-sharp LSP

See https://github.com/razzmatazz/csharp-language-server for more info
about it.

* Add pyright for possible python LSP

It may be prefered than pylsp by someone.
According to helix-editor#5479, I don't
make it default for everyone. Just for people who need this.

* Update roots of python

Using some known filenames to detect correct project root.

* Add pylyzer for possible python LSP

Co-authored-by: zetashift <rskaraya@gmail.com>

---------

Co-authored-by: zetashift <rskaraya@gmail.com>
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Add csharp-ls for possible c-sharp LSP

See https://github.com/razzmatazz/csharp-language-server for more info
about it.

* Add pyright for possible python LSP

It may be prefered than pylsp by someone.
According to helix-editor#5479, I don't
make it default for everyone. Just for people who need this.

* Update roots of python

Using some known filenames to detect correct project root.

* Add pylyzer for possible python LSP

Co-authored-by: zetashift <rskaraya@gmail.com>

---------

Co-authored-by: zetashift <rskaraya@gmail.com>
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Add csharp-ls for possible c-sharp LSP

See https://github.com/razzmatazz/csharp-language-server for more info
about it.

* Add pyright for possible python LSP

It may be prefered than pylsp by someone.
According to helix-editor#5479, I don't
make it default for everyone. Just for people who need this.

* Update roots of python

Using some known filenames to detect correct project root.

* Add pylyzer for possible python LSP

Co-authored-by: zetashift <rskaraya@gmail.com>

---------

Co-authored-by: zetashift <rskaraya@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants