Max Brunsfeld
f831277317
Upgrade tree-sitter to 0.20.1
2021-12-05 21:37:08 -08:00
Antonio Scandurra and Nathan Sobo
ca383df31e
Avoid allocating a Patch just to check if there are no edits
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-01 16:47:04 +01:00
Antonio Scandurra and Nathan Sobo
9fb5b384dc
Use the new buffer subscription API to keep DisplayMap in sync
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-01 16:08:53 +01:00
Antonio Scandurra and Nathan Sobo
137a1969bd
Introduce text::Buffer::subscribe
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-12-01 15:55:05 +01:00
Antonio Scandurra
8bb9cb3953
Bump FoldMap's version in FoldMap::sync (and not in DisplayMap)
2021-12-01 12:05:02 +01:00
Max Brunsfeld and Nathan Sobo
80a05508ba
WIP - maintain foldmap with Buffer::edits_since
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-30 17:23:02 -08:00
Max Brunsfeld
a0cb583fcb
Use &Snapshot directly instead of impl Into<Content<'a>>
...
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00
Nathan Sobo and Max Brunsfeld
93322a4858
Name the root file of every crate after the crate to ease navigation
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-11-30 12:46:39 -07:00
Nathan Sobo and Max Brunsfeld
811689d234
Rename buffer crate to text and name its entrypoint after the crate
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-11-30 12:26:12 -07:00
Antonio Scandurra
43583e1e80
Embed a plain text grammar and override settings for that too
2021-11-29 18:01:51 +01:00
Antonio Scandurra and Nathan Sobo
c9e4f7a7eb
Introduce a new Grammar struct and allow it to be optional
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-29 17:38:59 +01:00
Antonio Scandurra and Nathan Sobo
604fc600ac
Allow a single start/end bias per AnchorRangeMap
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-25 16:53:10 +01:00
Max Brunsfeld
468004c958
Implement toggle-comments
2021-11-23 14:13:28 -08:00
Nathan Sobo
d14fc2f6d9
Use uniform biases in AnchorMap, AnchorRangeMap
...
Specifying a different bias for every point makes the interface feel pretty unwieldy and we don't really use it.
2021-11-22 15:30:46 -07:00
Max Brunsfeld and Nathan Sobo
2eb364f8d6
Fix the bias of deserialized selection sets
...
Fixes #224
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-22 14:14:48 -08:00
Antonio Scandurra and Nathan Sobo
9b8b645b39
Switch to a dense representation for clock::Global
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-22 17:20:43 +01:00
Antonio Scandurra and Nathan Sobo
216f3a9751
Enhance keyboard navigation when showing next diagnostic
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-18 16:55:18 +01:00
Antonio Scandurra and Nathan Sobo
83baebd525
In a diagnostic group, mark the highest-severity diagnostic as primary
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-18 15:53:00 +01:00
Antonio Scandurra and Nathan Sobo
1ff989e634
Support highlighting in blocks
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-18 14:08:21 +01:00
Nathan Sobo and Max Brunsfeld
e0ba047955
Eliminate non-highlighted chunks APIs
...
Now we only have a single code path for chunks across all layers, but highlighting is optional and controlled by a flag.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-11-16 16:51:38 -08:00
Max Brunsfeld and Nathan Sobo
c965e1da25
Fix group_ids assertions in diagnostics test
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-15 14:18:58 -08:00
Antonio Scandurra
512280bfeb
Add text manipulation facilities to Rope for test purposes
2021-11-12 17:02:51 +01:00
Antonio Scandurra and Nathan Sobo
33e4f8f6c3
Allow querying a diagnostic group by its id
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-04 15:16:59 +01:00
Antonio Scandurra and Nathan Sobo
a8f60a10e1
Assign diagnostics a group_id based on their related_information
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-04 14:52:34 +01:00
Nathan Sobo
cdb530c692
Start on a test for grouped diagnostics
2021-11-03 18:47:18 -06:00
Max Brunsfeld
34954ab8b2
Extend empty diagnostic ranges at the ends of lines
2021-11-03 13:49:39 -07:00
Max Brunsfeld
06829caeab
In the status bar, show the diagnostic under the cursor
2021-11-03 12:33:16 -07:00
Antonio Scandurra and Max Brunsfeld
6c5de48e00
Avoid ending the pending selection until updating selections
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-11-03 19:07:06 +01:00
b09850a993
Make resolving selections generic
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-11-03 17:51:57 +01:00
Antonio Scandurra
3ea225fc3d
Fix test for disk-based diagnostics
2021-11-03 09:39:15 +01:00
Max Brunsfeld and Nathan Sobo
837244e938
Start language servers based on buffers' languages
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-02 17:41:01 -07:00
Max Brunsfeld
95e6765d21
Avoid using worktree handle in File's path methods
...
This avoids a circular model update that was happening
when trying to retrieve the absolute path from a buffer's
file while applying remote operations.
2021-11-02 14:33:55 -07:00
Max Brunsfeld and Nathan Sobo
355e2bf5c8
Deserialize buffer's diagnostics
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-02 12:29:03 -07:00
Max Brunsfeld
79a9be0c30
Avoid circular model update when sending diagnostics operations
2021-11-01 17:14:22 -07:00
Max Brunsfeld and Nathan Sobo
0a178d2d15
Replicate diagnostics to remote buffers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-01 15:28:37 -07:00
Max Brunsfeld and Nathan Sobo
7270358c7c
Move protobuf logic from buffer crate to language crate
...
This will enable us to add operations that only pertain to the language crate.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-01 14:05:19 -07:00
Max Brunsfeld
26680e30cc
Use Diagnostic struct in buffer's diagnostics multimap
2021-11-01 12:59:01 -07:00
a217f62a7d
Delay quit until language servers are gracefully shut down
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-11-01 11:57:31 -07:00
Antonio Scandurra
d941e129e7
Take a &clock::Global instead of cloning in edits_since
2021-11-01 10:48:20 +01:00
Antonio Scandurra
e7d5a2af4e
Always notify when receiving buffer operations
...
We had changed it to only emit a notification when the buffer was
actually edited, but we also want to notify when we receive non-edit
operations, such as a selection update.
2021-11-01 10:06:23 +01:00
Antonio Scandurra and Nathan Sobo
fda08984da
Extend empty diagnostic ranges by one character
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-10-29 19:09:19 +02:00
Antonio Scandurra and Nathan Sobo
8a5bee616d
Communicate with language servers in terms of UTF-16 coordinates
...
This required indexing UTF-16 positions in `Rope`. We tried opting
into the UTF-8 experimental support but it didn't seem to work
correctly and the standard is UTF-16 anyway.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-10-29 18:33:23 +02:00
Antonio Scandurra
701b86f493
Avoid unnecessary conversion to offsets in diagnostics_in_range
2021-10-29 14:41:41 +02:00
Max Brunsfeld
825fb94fc6
Merge branch 'anchor-map-selections' into lsp
2021-10-28 17:08:06 -07:00
Max Brunsfeld
5cb767e73b
Rename AnchorRangeSet::to_point_ranges -> point_ranges
2021-10-28 16:32:49 -07:00
Max Brunsfeld
769ad74a3d
Fix unit test for on-disk-changes to not rely on selection bias
2021-10-28 16:17:07 -07:00
Antonio Scandurra and Max Brunsfeld
6279e74712
Clip points coming from language server
...
This avoids panicking in Zed if the points they give us are invalid.
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-10-28 19:02:26 +02:00
Antonio Scandurra and Max Brunsfeld
204f8f3367
Ensure start endpoints always come before end endpoints
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-10-28 18:26:32 +02:00
Antonio Scandurra
35aff64b6b
Express multi-cursor edits using the new coordinate space
...
The language server expects that ranges further in the list of edits
account for the impact of prior changes in the edit list.
2021-10-28 13:40:55 +02:00
Antonio Scandurra
ff236917c4
Add a unit test for disk-based diagnostics
2021-10-28 11:37:24 +02:00