-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Python Auto-completion Setup #2293
Comments
If you haven't already, you'll need to install the python language server With that installed, auto-complete and other language server driven features like goto-definition should work without any extra configuration or commands. |
Thank you very much, that worked, is there anyway to fix error : W191, indentation contains tab |
I'm not too familiar with python but I think it comes from this PEP https://peps.python.org/pep-0008/#tabs-or-spaces Seems like the language server wants you to use spaces for indentation instead of tabs. |
Is there any way I can turn off the error messages, there are so many (E303, W141, my whole code is just underlined) if so how do I do it, because the tutorial given by the website "https://github.com/python-lsp/python-lsp-server" is not very clear, and I was unable to find a file called pycodestyle in my configs. |
Oh hmm, I'm not sure how configurable pylsp is for turning those of or tuning them. As far as I know, there isn't an option within Helix to disable diagnostics. |
If possible, I would recommend you use pyright instead of pylsp if you don't care about the linters. Pyright is much better in terms of autocompletion and correctness checks, but it doesn't have any style linting or code formatting (which you seem to not want anyway). If you have node.js installed, you can install pyright globally with
But there is also a wrapper package on pypi: https://pypi.org/project/pyright/ which I believe installs a per-project node.js. Then set up pyright like this: [[language]]
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py"]
shebangs = ["python"]
roots = ["pyproject.toml", "setup.py", "Poetry.lock"]
comment-token = "#"
language-server = { command = "pyright-langserver", args = ["--stdio"] }
auto-format = false
indent = { tab-width = 4, unit = " " }
config = {} You need to specify |
In the world of python it's up to you to select the correct LSP for your needs, This is not true in all languages. Dart, for example, works with Helix without any configuration. Install dart, install helix, it's working. The zero-conf nature in this case is due to Dart coming prepackaged with a configured LSP. |
Put the exact same thing inside my languages.toml and I still got the error: |
Yes, I would like to learn more as I am yet just a beginner, a newborn coming out of the computers womb, searching merely for just answers that cannot be obtained oh so easily |
@The-Rivers see #1898 for a possible work-around for your crash. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Sorry, completely new to this editor, and with the lack of videos on this fairly new text editor, I require some step by step and clear help on how to setup up Python Auto-completion on Mac M1 for Helix text editor. I tried copying from the repo area, but this led to nothing. Also, am I missing a command that I should type to toggle Auto-completion?
Thank you very much, and I look forward to using this text editor and being one of the first few people to get onto this!
The text was updated successfully, but these errors were encountered: