zed
zed copied to clipboard
Editor doesn't show errors that are past the end of a line
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
foo = []
for bar in foo
pass
foo = []
for bar in foo^
pass
The overview in the scrollbar shows the errors, even though they do not appear in the editor:
Both language servers correctly report the errors:
VS Code shows the errors correctly with the same language servers. Note how the errors are reported with the location past the end of the line:
Zed Version and System Specs
Zed: v0.166.1 (Zed) OS: macOS 15.2.0 Memory: 16 GiB Architecture: x86_64
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
No response
@CoderParth I don't have a ~/.local/share/zed/` directory. I'm also using pyright and Ruff as my language servers, not pylsp.
My language servers are correctly configured, as the errors are properly reported. Please see the screenshots I included.
You are seeing different errors because you are using pylsp, and it looks like Pyflakes is reporting the errors at the last character of the line (instead of past the end of the line). The bug here is that Zed is not showing errors in the editor if they occur past the end of the line.
For reference the textDocument/diagnostic response from the LSP RPC logs has the following:
result.items:
[
{
"range": { "start": { "line": 1, "character": 14 }, "end": { "line": 2, "character": 0 } },
"message": "Expected \":\"",
"severity": 1,
"source": "Pyright"
},
{
"range": { "start": { "line": 5, "character": 15 }, "end": { "line": 6, "character": 0 } },
"message": "Expected expression",
"severity": 1,
"source": "Pyright"
},
{
"range": { "start": { "line": 5, "character": 15 }, "end": { "line": 6, "character": 0 } },
"message": "Expected \":\"",
"severity": 1,
"source": "Pyright"
}
]
Which means the diagnostic underline is basically wrapping the \n newline as that's what's after the last character on a line and before the first one on the next line.
Hi there! 👋 We're working to clean up our issue tracker by closing older bugs that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and it will be kept open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, it will close automatically in 14 days. Thanks for your help!