zed icon indicating copy to clipboard operation
zed copied to clipboard

Editor doesn't show errors that are past the end of a line

Open injust opened this issue 11 months ago • 3 comments

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:

image

Both language servers correctly report the errors:

image

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:

image

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

injust avatar Dec 28 '24 18:12 injust

@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.

injust avatar Dec 29 '24 03:12 injust

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.

notpeter avatar Sep 05 '25 18:09 notpeter

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!

github-actions[bot] avatar Nov 19 '25 09:11 github-actions[bot]