zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.43k stars 3.01k forks source link

Outline Panel for Markdown Files erroneously shows keys of JSON as entries in the outline #15122

Open rowillia opened 3 months ago

rowillia commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

  1. Open up docs/src/languages/go.md in the Zed repo in Zed
  2. Open up the outline panel

Also: Note that I would expect the outline view to follow the same hierarchy as the document (e.g. Inline Hints would be nested under Go)

Environment

Zed: v0.145.1 (Zed) OS: macOS 14.5.0 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-07-24 at 4 57 06 PM

If applicable, attach your Zed.log file to this issue.

Zed.log


jansol commented 3 months ago

The JSON keys showing up actually is the correct behaviour I believe -- there is valid JSON embedded in the Markdown document which gets picked up by the markdown tree-sitter embedding rules. However, comparing to the outline of zed's settings file, the hierarchy of JSON keys looks broken here. "hints" should be at the top and the rest until "rangeVariableTypes" should be indented under it..

JosephTLyons commented 3 months ago

I agree with @jansol - Zed is pretty aware of code embedded in markdown, so it treats it as such. I'll leave this issue open regardless because of issues mentioned by Jansol.

cc: @SomeoneToIgnore