claytonrcarter and Smit Barmase
2ba25b5c94
editor: Support rewrap in block comments ( #34418 )
...
This updates `editor: rewrap` to work within doc comments, based on the
code that extends such comments on newline. I added some tests, and I've
tested it out in JS, C and PHP. (Though PHP depends on
https://github.com/zed-extensions/php/pull/40 )
Closes #19794
Closes #18221
**Caveat:**
~~This will not rewrap an existing single-line block comment, such as
the one provided in #18221:~~ this will now rewrap as expected
```c
/* we can triangulate any convex polygon by picking a vertex and connecting it to the next two vertices; we first read two vertices, and then, for every subsequent vertex, we can form a triangle by connecting it to the first and previous vertex */
```
However, it will rewrap a similar comment if it is shaped like a doc
comment. In other words, this will rewrap as expected:
```c
/*
* we can triangulate any convex polygon by picking a vertex and connecting it to the next two vertices; we first read two vertices, and then, for every subsequent vertex, we can form a triangle by connecting it to the first and previous vertex
*/
```
This seems like a reasonable improvement and limitation to me,
especially as a first step.
cc @smitbarmase because I think that you've been making a lot of the
`newline` and `rewrap` changes recently. (Thank you for those, by the
way!)
Release Notes:
- Added support for rewrap in block comments.
---------
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com >
2025-09-01 20:00:01 +00:00
..
2025-09-01 18:57:15 +00:00
2025-08-25 16:04:44 -06:00
2025-08-20 14:07:37 +02:00
2025-08-20 14:07:37 +02:00
2025-08-26 13:55:09 +00:00
2025-09-01 18:57:15 +00:00
2025-09-01 18:57:15 +00:00
2025-08-30 03:03:47 +00:00
2025-09-01 18:57:15 +00:00
2025-08-25 17:21:20 +00:00
2025-08-28 12:00:44 +00:00
2025-08-19 21:26:17 +02:00
2025-08-13 13:25:52 -06:00
2025-08-20 12:20:13 +02:00
2025-08-27 23:24:19 +00:00
2025-08-28 13:32:30 -06:00
2025-08-27 23:24:19 +00:00
2025-08-31 19:52:43 -04:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-08-29 18:13:06 -04:00
2025-08-27 23:24:19 +00:00
2025-08-22 03:48:47 -04:00
2025-08-29 16:56:10 -04:00
2025-08-20 12:20:13 +02:00
2025-09-01 08:33:59 +00:00
2025-08-29 16:56:10 -04:00
2025-08-22 11:45:47 -04:00
2025-08-29 17:08:42 +03:00
2025-08-29 16:56:10 -04:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-08-22 13:16:42 +00:00
2025-08-31 18:51:17 -04:00
2025-08-21 19:59:42 -04:00
2025-08-19 21:26:17 +02:00
2025-08-29 16:56:10 -04:00
2025-08-28 07:53:32 +00:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-08-28 14:40:43 +00:00
2025-09-01 10:49:09 +02:00
2025-08-29 17:08:42 +03:00
2025-08-27 03:24:50 +08:00
2025-08-22 11:45:47 -04:00
2025-08-22 11:45:47 -04:00
2025-09-01 20:00:01 +00:00
2025-08-20 20:14:30 +02:00
2025-08-19 20:33:44 +00:00
2025-08-20 12:05:58 +02:00
2025-08-16 19:00:31 +00:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-08-26 15:30:26 +02:00
2025-08-21 19:59:42 -04:00
2025-08-29 16:56:10 -04:00
2025-08-19 21:26:17 +02:00
2025-08-28 13:32:30 -06:00
2025-08-19 13:27:24 +00:00
2025-08-20 20:14:30 +02:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-28 12:00:44 +00:00
2025-09-01 15:33:11 -04:00
2025-08-29 16:56:10 -04:00
2025-08-21 17:19:57 +00:00
2025-08-19 13:27:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-28 07:53:32 +00:00
2025-08-29 16:56:10 -04:00
2025-08-24 11:01:42 +00:00
2025-08-18 21:54:35 +00:00
2025-08-19 20:33:44 +00:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-18 21:54:35 +00:00
2025-08-27 12:53:07 +00:00
2025-08-31 18:51:17 -04:00
2025-08-19 13:27:24 +00:00
2025-08-29 12:23:45 +00:00
2025-08-29 17:08:42 +03:00
2025-08-21 15:56:16 +02:00
2025-08-29 17:08:42 +03:00
2025-08-26 12:55:40 -03:00
2025-08-31 11:43:24 +03:00
2025-08-20 12:20:13 +02:00
2025-08-28 12:00:44 +00:00
2025-08-24 09:59:32 +03:00
2025-08-19 20:33:44 +00:00
2025-08-19 13:27:24 +00:00
2025-08-26 00:27:52 +00:00
2025-08-28 12:00:44 +00:00
2025-08-28 12:00:44 +00:00
2025-08-29 16:56:10 -04:00
2025-08-20 12:20:13 +02:00
2025-08-29 17:18:52 -07:00
2025-08-20 12:20:13 +02:00
2025-08-19 21:26:17 +02:00
2025-08-29 17:18:52 -07:00
2025-08-29 16:56:10 -04:00
2025-08-29 14:07:27 -03:00
2025-08-20 12:20:13 +02:00
2025-08-28 14:40:43 +00:00
2025-08-29 17:18:52 -07:00
2025-08-19 13:27:24 +00:00
2025-08-29 17:18:52 -07:00
2025-08-29 17:08:42 +03:00
2025-08-29 16:56:10 -04:00
2025-08-20 12:05:58 +02:00
2025-08-19 13:27:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-21 06:48:04 +00:00
2025-08-28 03:51:22 +00:00
2025-08-29 03:50:24 +00:00
2025-08-20 12:20:13 +02:00
2025-08-19 13:27:24 +00:00
2025-08-30 17:59:04 +00:00
2025-08-20 12:20:13 +02:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-19 21:26:17 +02:00
2025-08-19 21:26:17 +02:00
2025-08-19 13:27:24 +00:00
2025-08-26 00:27:52 +00:00
2025-08-20 12:20:13 +02:00
2025-08-19 20:33:44 +00:00
2025-08-18 21:54:35 +00:00
2025-08-19 21:26:17 +02:00
2025-08-29 16:17:22 -04:00
2025-08-19 21:26:17 +02:00
2025-08-19 20:33:44 +00:00
2025-08-21 19:59:42 -04:00
2025-08-28 21:07:02 +00:00
2025-08-28 14:40:43 +00:00
2025-08-20 14:35:59 +00:00
2025-08-19 21:26:17 +02:00
2025-08-15 15:37:52 -04:00
2025-08-29 16:56:10 -04:00
2025-09-01 11:21:55 +03:00
2025-08-19 21:26:17 +02:00
2025-08-29 16:56:10 -04:00
2025-08-20 12:20:13 +02:00
2025-08-31 18:24:00 -06:00
2025-08-21 09:37:45 +00:00
2025-08-28 08:40:43 +00:00
2025-08-20 12:20:13 +02:00
2025-08-28 13:32:30 -06:00
2025-08-15 13:54:24 +03:00
2025-08-29 16:56:10 -04:00
2025-08-29 16:56:10 -04:00
2025-08-25 14:28:11 -04:00
2025-08-20 12:20:13 +02:00
2025-08-19 20:33:44 +00:00
2025-08-30 13:13:23 +00:00
2025-08-29 16:56:10 -04:00
2025-08-26 21:08:45 +00:00
2025-09-01 08:33:59 +00:00
2025-08-26 16:59:12 -03:00
2025-08-31 07:23:21 +00:00
2025-08-20 12:20:13 +02:00
2025-08-20 12:20:13 +02:00
2025-08-29 16:56:10 -04:00