-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unexpected error in LSP server - Source: Ruff (Extension) #58
Comments
Do you mind trying with the latest version? Will re-open if you continue to see this! |
Thanks for getting back to me about this. Just tried out version 2022.2.0 - same issue unfortunately. |
Oh I'm wondering if this is: astral-sh/ruff-lsp#51 |
Do you mind trying out the latest version (which includes a fix for the aforementioned, possibly relevant issue)? |
Still the same issue... maybe it's because i use some other extensions for linting simultaneously... I'll do some tests later and get back to you. |
@charliermarsh if helpful, I am also seeing this. If I restart the ruff server, I get
I'm running docker on an M1 mac using an ARM native ubuntu image, which I imagine is the problem. @lasinludwig does that apply to you as well? |
I'm running it on a Windows machine without any docker stuff... Maybe it's something in my virtual environment? I tried disabling other linters I run - no effect. |
I can try getting a Windows VM going on my personal machine. (I don't have a Windows machine to test on, unfortunately.) @FrancescElies - have you been able to run the Ruff extension on Windows? Just want to check if this is an "all Windows" problem or something more specific. |
@charliermarsh it works on windows but keep in mind I am not a heavy user of vscode I just happen to have it installed because many of my colleagues use it for coding in python. |
@FrancescElies - Thanks, that's perfect -- I just wanted a quick sanity check to make sure it wasn't entirely busted. |
I have your exact issue with those specs and the latest |
I worked around the issue by downloading the ruff binary and pointing to it via the ruff path setting |
Thanks, that's too cumbersome for me as I am working in a docker container via the Dev Containers extension. I am resorting to the flake8 / isort extensions, hoping this bug will be eventually fixed properly. |
I gotchya. Same regarding devcontainer. We just added the binary to the container definition for what it’s worth. A quick fix. |
Sadly I haven't had a chance to dig into this. @messense - just tagging because this relates to packaging -- anything stand out to you about why folks are running into this? |
Looks to me that it somehow installed the x86_64 version of Ruff in a arm64 docker container. |
So the problem is that you can't build the aarch64 linux extension on a x86_64 linux. |
Oh interesting. Can that be solved by changing the host machine in the Action? |
We can fix it by installing dependencies via QEMU: #119 |
I just cut a new pre-release version with this fix. Do you mind trying it out in your setup? |
I am not noticing the issue anymore on my machine. |
Oh, stellar! Thanks @messense. |
...still the same problem for me... does this output help?
|
Hi there,
I always get the above error and when I try to save the file, all the code in the file gets deleted. The output logs are very long - here is just a little bit of it:
Traceback (most recent call last):
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\pygls\protocol.py", line 84, in decorator
self._execute_notification(user_func, *args, **kwargs)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\pygls\protocol.py", line 228, in _execute_notification
handler(*params)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 118, in did_change
diagnostics: list[Diagnostic] = _linting_helper(document)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 134, in _linting_helper
return _parse_output_using_regex(result.stdout) if result.stdout else []
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 172, in _parse_output_using_regex
start = Position(
^^^^^^^^^
File "", line 6, in init
__attr_validator_character(self, __attr_character, self.character)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\lsprotocol\validators.py", line 45, in uinteger_validator
raise ValueError(
ValueError: Position.character should be in range [0:2147483647], but was -1.
Failed to handle notification "textDocument/didSave": DidSaveTextDocumentParams(text_document=TextDocumentIdentifier(uri='file:///n%3A/Florian/Python/UTEC_Tools/modules/classes_data.py'), text=None)
Traceback (most recent call last):
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\pygls\protocol.py", line 316, in _handle_notification
self._execute_notification(handler, params)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\pygls\protocol.py", line 228, in _execute_notification
handler(*params)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 110, in did_save
diagnostics: list[Diagnostic] = _linting_helper(document)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 134, in _linting_helper
return _parse_output_using_regex(result.stdout) if result.stdout else []
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\tool\server.py", line 172, in _parse_output_using_regex
start = Position(
^^^^^^^^^
File "", line 6, in init
__attr_validator_character(self, __attr_character, self.character)
File "c:\Users\fl.vscode\extensions\charliermarsh.ruff-2022.0.22-win32-x64\bundled\libs\lsprotocol\validators.py", line 45, in uinteger_validator
raise ValueError(
ValueError: Position.character should be in range [0:2147483647], but was -1.
The text was updated successfully, but these errors were encountered: