ZIm/crates/languages/src
Ashish Bhate 1d26a27afa
go: Fix tree-sitter query for outlines (#24861)
Closes #14497

Release Notes:
- Fixed outline view for Go to correctly indent types and show missing
variables.
----
This PR fixes the tree-sitter query for outlines for Go code. It
correctly indents "grouped" `type` declarations. It also fixes missing
variables for "grouped" `var` declarations.

### Before: 
1. Incorrectly indented types from `G` to `K` and `aliasInt`
2. Missing vars `M` and `N` in outline 

![Screenshot_20250214_175404](https://github.com/user-attachments/assets/7c1142bd-fe60-4c65-9fa2-3bae4eb43d63)

### After:
1. Types no longer indented incorrectly
2. Missing vars `M` and `N` appear in the outline, as expected

![Screenshot_20250214_175431](https://github.com/user-attachments/assets/61010273-e98d-425d-93ad-17f04bd83b54)

### Caveats:
1. This fix comes from an hour or so of reading about tree-sitter and
its query syntax. I'm not an expert.
2. I'm not sure how to test this. I've done manual testing and it
appears to works as expected without an regressions.
2025-02-14 11:45:43 -08:00
..
bash Allow auto-indenting with syntax errors when using regex-based indent matches to improve bash auto-indent behavior (#24160) 2025-02-03 21:34:37 -06:00
c Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
cpp Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
css Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00
diff Improve diff syntax highlighting queries (#21740) 2024-12-12 15:18:36 -08:00
gitcommit Rework shared commit editors (#24274) 2025-02-05 15:36:24 +00:00
go go: Fix tree-sitter query for outlines (#24861) 2025-02-14 11:45:43 -08:00
gomod Add "tool" support to go.mod (#22995) 2025-01-15 17:44:28 +02:00
gowork File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
javascript Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
jsdoc Add language icons to the language selector (#21298) 2024-12-02 15:01:09 -03:00
json Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00
jsonc Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00
markdown Correctly handle [[ autoclosing in Markdown (#24662) 2025-02-11 13:06:45 -05:00
markdown-inline Hide Markdown-Inline language from users with a new 'hidden' flag on language configs (#17104) 2024-08-29 11:23:33 -07:00
python Refine syntax highlighting for Python docstrings (#20898) 2025-01-28 10:23:43 +01:00
regex Add language icons to the language selector (#21298) 2024-12-02 15:01:09 -03:00
rust Fix rust runnable is not detected if comment is after #[test] attribute (#22823) 2025-01-08 12:51:23 +00:00
tsx Use standard injection.language and injection.content captures (#22268) 2025-01-07 18:17:49 +00:00
typescript Improve TypeScript highlights (#18525) 2025-01-10 22:00:28 +00:00
yaml Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00
bash.rs Allow auto-indenting with syntax errors when using regex-based indent matches to improve bash auto-indent behavior (#24160) 2025-02-03 21:34:37 -06:00
c.rs Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
css.rs Enable CSS, JSON, Python, and Tailwind to lookup LSP installed in PATH (#22037) 2025-02-04 14:50:49 -05:00
go.rs Add support for Go fuzz tests (#24107) 2025-02-03 11:33:58 +01:00
json.rs Enable CSS, JSON, Python, and Tailwind to lookup LSP installed in PATH (#22037) 2025-02-04 14:50:49 -05:00
lib.rs zeta: Send up diagnostics with prediction requests (#24384) 2025-02-06 18:07:26 +00:00
python.rs Enable CSS, JSON, Python, and Tailwind to lookup LSP installed in PATH (#22037) 2025-02-04 14:50:49 -05:00
rust.rs project: Fine-grained language server management (#24038) 2025-02-14 15:41:49 +01:00
tailwind.rs Enable CSS, JSON, Python, and Tailwind to lookup LSP installed in PATH (#22037) 2025-02-04 14:50:49 -05:00
typescript.rs Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
vtsls.rs Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
yaml.rs Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00