zed/crates/editor/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
..
display_map sum_tree: Store context on cursor (#34904) 2025-07-22 18:20:48 +02:00
git sum_tree: Store context on cursor (#34904) 2025-07-22 18:20:48 +02:00
scroll Reduce number of snapshots and notifies during editor scrolling (#34228) 2025-07-11 17:34:45 +00:00
test language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
actions.rs Add an editor: diff clipboard with selection action (#33283) 2025-07-23 02:39:32 +00:00
blink_manager.rs Remove unneeded anonymous lifetimes from gpui::Context (#27686) 2025-03-28 19:26:30 +00:00
clangd_ext.rs Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00
code_completion_tests.rs editor: Utilize filter_text from language server for filter_range (#33155) 2025-06-21 19:47:16 +05:30
code_context_menus.rs editor: Fix cursor doesn’t move up and down on arrow keys when no completions are shown (#34678) 2025-07-18 06:07:52 +05:30
display_map.rs editor: Improve minimap performance (#33067) 2025-07-15 00:29:27 +03:00
editor.rs language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
editor_settings.rs Allow disabling snippet completion by setting snippet_sort_order to none (#34565) 2025-07-17 16:22:26 +05:30
editor_settings_controls.rs Migrate to schemars version 1.0 (#33635) 2025-06-30 21:07:28 +00:00
editor_tests.rs language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
element.rs Add an editor: diff clipboard with selection action (#33283) 2025-07-23 02:39:32 +00:00
git.rs Project Diff 2 (#23891) 2025-02-03 13:18:50 -07:00
highlight_matching_bracket.rs debugger: Parse and highlight text with ANSI escape sequences (#32915) 2025-06-17 23:39:31 -04:00
hover_links.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
hover_popover.rs editor: Fix diagnostic popovers not being scrollable (#33581) 2025-07-08 16:14:22 +03:00
indent_guides.rs Fix editor rendering slowness with large folds (#31569) 2025-05-28 23:05:06 +00:00
inlay_hint_cache.rs Fix document colors issues with other inlays and multi buffers (#33598) 2025-06-28 21:10:49 +00:00
inline_completion_tests.rs Restore scroll after undo edit prediction (#31162) 2025-05-22 09:16:11 +00:00
items.rs Recall empty, unsaved buffers on app load (#33475) 2025-07-11 22:23:04 +00:00
jsx_tag_auto_close.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
linked_editing_ranges.rs editor: Fix extra characters were being written at the end of an HTML tag (#28529) 2025-04-11 00:17:34 +05:30
lsp_colors.rs Further improve color inlay hints in multi buffers (#33642) 2025-06-30 09:18:43 +00:00
lsp_ext.rs Select applicable positions for lsp_ext methods more leniently (#32272) 2025-06-06 22:47:20 +00:00
mouse_context_menu.rs keymap_ui: Add context menu for table rows (#33747) 2025-07-02 03:06:45 +00:00
movement.rs Cleanup handling of surrounding word logic, fixing crash in editor::SelectAllMatches (#33353) 2025-06-24 23:18:35 -06:00
persistence.rs Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00:00
proposed_changes_editor.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
rust_analyzer_ext.rs Select applicable positions for lsp_ext methods more leniently (#32272) 2025-06-06 22:47:20 +00:00
scroll.rs editor: Ensure topmost buffer header can be properly folded (#34721) 2025-07-18 19:16:31 +02:00
selections_collection.rs Fix panic when editor::OpenSelectionsInMultibuffer only has pending selection (#32842) 2025-06-17 08:35:14 +00:00
signature_help.rs lsp: Complete overloaded signature help implementation (#33199) 2025-07-02 20:51:08 +03:00
tasks.rs Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
test.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00