ZIm/crates/languages/src
claytonrcarter 1f4c9b9427
language: Update block_comment and documentation comment (#34861)
As suggested in https://github.com/zed-industries/zed/pull/34418, this
proposes various changes to language configs to make block comments and
doc-block-style comments more similar. In doing so, it introduces some
breaking changes into the extension schema.

This change is needed to support the changes I'm working on in #34418,
to be able to support `rewrap` in block comments like `/* really long
comment ... */`. As is, we can do this in C-style doc-block comments (eg
`/** ... */`) because of the config in `documentation`, but we can't do
this in regular block comments because we lack the info about what the
line prefix and indentation should be.

And while I was here, I did various other clean-ups, many of which feel
nice but are optional.

I would love special attention on the changes to the schema, version and
related changes; I'm totally unfamiliar with that part of Zed.

**Summary of changes**
- break: changes type of `block_comment` to same type as
`documentation_comment` (**this is the important change**)
- break: rename `documentation` to `documentation_comment` (optional,
but improves consistency w/ `line_comments` and `block_comment`)
- break/refactor?: removes some whitespace in the declaration of
`block_comment` delimiters (optional, may break things, need input; some
langs had no spaces, others did)
- refactor: change `tab_size` from `NonZeroU32` to just a `u32` (some
block comments don't seem to need/want indent past the initial
delimiter, so we need this be 0 sometimes)
- refactor: moves the `documentation_comment` declarations to appear
next to `block_comment`, rearranges the order of the fields in the TOML
for `documentation_comment`, rename backing `struct` (all optional)

**Future scope**
I believe that this will also allow us to extend regular block comments
on newline – as we do doc-block comments – but I haven't looked into
this yet. (eg, in JS try pressing enter in both of these: `/* */` and
`/** */`; the latter should extend w/ a `*` prefixed line, while the
former does not.)

Release Notes:

- BREAKING CHANGE: update extension schema version from 1 to 2, change
format of `block_comment` and rename `documentation_comment`

/cc @smitbarmase
2025-07-23 20:38:52 +05:30
..
bash Fix aggressive indent in shell scripts (#31973) 2025-06-03 10:50:58 -04:00
c language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
cpp language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
css language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
diff Improve diff syntax highlighting queries (#21740) 2024-12-12 15:18:36 -08:00
gitcommit git_ui: Fix list in git commit message (#33409) 2025-07-01 08:05:08 -04:00
go language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
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 language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
jsdoc Add JSDoc scope (#29476) 2025-06-06 08:31:59 -04:00
json debugger: Run debug scenarios from package.json (#32958) 2025-06-18 20:04:25 +02:00
jsonc Treat bun.lock as JSONC (#27359) 2025-03-24 09:46:23 -04:00
markdown language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
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 languages: Fix detents case line after typing : in Python (#34017) 2025-07-07 22:41:29 +05:30
regex Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
rust language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
tsx language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
typescript language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
yaml Fix yaml comment indent (#33882) 2025-07-03 23:57:57 +00:00
zed-keybind-context keymap_ui: Create language for Zed keybind context (#34558) 2025-07-16 17:00:47 +00:00
bash.rs Fix aggressive indent in shell scripts (#31973) 2025-06-03 10:50:58 -04:00
c.rs editor: Utilize filter_text from language server for filter_range (#33155) 2025-06-21 19:47:16 +05:30
css.rs Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
go.rs go: Support raw string subtest names (#34636) 2025-07-18 13:38:18 +02:00
json.rs keymap_ui: Auto complete action arguments (#34785) 2025-07-20 16:24:17 -04:00
lib.rs Fix Tailwind support for HTML/ERB files (#34743) 2025-07-19 11:06:35 -04:00
package_json.rs debugger: Fix issues with debugging scripts from package.json (#32995) 2025-06-19 14:33:24 +00:00
python.rs language: Add context-aware decrease indent for Python (#33370) 2025-06-26 11:11:03 +05:30
rust.rs debugger: Fix wrong cwd in Rust tests (#33788) 2025-07-02 17:36:35 +00:00
tailwind.rs Fix Tailwind support for HTML/ERB files (#34743) 2025-07-19 11:06:35 -04:00
typescript.rs languages: Add JS/TS generator functions to outline (#34388) 2025-07-14 07:26:17 -05:00
vtsls.rs editor: Utilize filter_text from language server for filter_range (#33155) 2025-06-21 19:47:16 +05:30
yaml.rs Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00