Commit Graph
4687 Commits
Author SHA1 Message Date
Max Brunsfeld 78d97a3db2 Use Diagnostic struct in buffer's diagnostics multimap 2021-11-01 12:59:01 -07:00
1aee7bdb1d 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
Max BrunsfeldandAntonio Scandurra b8994c2a89 Add a facility for delaying quit until critical tasks finish
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-01 11:57:31 -07:00
Antonio Scandurra 6e5ec2a00d Take a &clock::Global instead of cloning in edits_since 2021-11-01 10:48:20 +01:00
Antonio Scandurra 2919cbe9cb Try signing rust-analyzer in order to embed it in the app bundle 2021-11-01 10:30:10 +01:00
Antonio Scandurra f59be5fecf 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
Nathan Sobo 3228a55329 Fix test-support feature propagation for editor and workspace 2021-10-30 07:40:20 -06:00
Antonio ScandurraandNathan Sobo b571eae4f3 Extend empty diagnostic ranges by one character
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-29 19:09:19 +02:00
Antonio ScandurraandNathan Sobo 6212ebad9b 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 9c1b01521a Avoid unnecessary conversion to offsets in diagnostics_in_range 2021-10-29 14:41:41 +02:00
Antonio Scandurra 78c158e1a4 Support only UTF-8 for now when communicating with language server 2021-10-29 12:02:42 +02:00
Antonio Scandurra a82a12fd14 Bundle fat-binary for rust-analyzer 2021-10-29 11:41:07 +02:00
Max Brunsfeld 2cbb313467 Avoid panic when rust language isn't present (project unit tests) 2021-10-28 17:12:17 -07:00
Max Brunsfeld e1556893f7 Merge branch 'anchor-map-selections' into lsp 2021-10-28 17:08:06 -07:00
Max Brunsfeld 927118726c Merge pull request #216 from zed-industries/anchor-map-selections
Represent selection sets as anchor range maps
2021-10-28 17:07:45 -07:00
Max Brunsfeld 2952f2c905 🎨 anchor.rs 2021-10-28 16:48:07 -07:00
Max Brunsfeld acb29eb273 Ignore vendor/bin folder 2021-10-28 16:32:56 -07:00
Max Brunsfeld a1e576343e Rename AnchorRangeSet::to_point_ranges -> point_ranges 2021-10-28 16:32:49 -07:00
Max Brunsfeld 9bc08e446b Fix unit test for on-disk-changes to not rely on selection bias 2021-10-28 16:17:07 -07:00
Max Brunsfeld f3cd710f21 Create valid disjoint selection sets in selections_in_ranges 2021-10-28 16:04:16 -07:00
Max Brunsfeld efc85d1b75 Get the Editor crate compiling 2021-10-28 15:42:24 -07:00
Antonio ScandurraandMax Brunsfeld 9c74be3bf2 Start fixing compilation errors on Editor
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-28 19:36:43 +02:00
Antonio ScandurraandMax Brunsfeld ce8741977b 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 ScandurraandMax Brunsfeld d12387b753 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 50afb2d65f Remove stray println! statements in the LSP I/O code 2021-10-28 14:07:14 +02:00
Antonio Scandurra ee78d6f17b 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 7091e0c567 Add a unit test for disk-based diagnostics 2021-10-28 11:37:24 +02:00
Antonio Scandurra ac76706aa7 Sort LSP diagnostics by (start, end) 2021-10-28 11:36:33 +02:00
Antonio Scandurra fcb217b9e8 Report new_lines extent correctly when coalescing edits 2021-10-28 11:32:10 +02:00
Nathan SoboandMax Brunsfeld 9977248926 Adjust disk-based diagnostics based on edits since the last save
Still need to add tests... not sure if this is right yet.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-10-27 18:58:07 -06:00
0c10d6c82d Introduce FullOffset type
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-10-27 18:30:00 -06:00
Antonio Scandurra bc076c1cc1 Update display map snapshots when diagnostics are updated
This is similar to what we do when we receive new parse trees from
tree-sitter.
2021-10-27 12:42:16 +02:00
Antonio Scandurra a7a73a5b0b Fix bug in to_full_offset when Anchor::version != Content::version 2021-10-27 11:56:04 +02:00
Max BrunsfeldandNathan Sobo c539069cbb Include diagnostic info in HighlightedChunks iterator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 17:57:50 -07:00
Max BrunsfeldandNathan Sobo f1db618be2 Generalize AnchorRangeMultimap's 'intersecting ranges' API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 17:56:39 -07:00
Max Brunsfeld 79ba217485 Fix routing of diagnostics to buffers in worktree 2021-10-26 15:46:39 -07:00
Max Brunsfeld ef4fc42d93 Allow retrieving a buffer's diagnostics 2021-10-26 15:46:08 -07:00
Max Brunsfeld 5bfbeb55c0 Simplify buffer constructor methods
Don't expose the `buffer::History` to callers of `language::Buffer`
2021-10-26 14:26:47 -07:00
Max BrunsfeldandNathan Sobo 4069db4959 Allow underlines to have different color than the text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 12:46:46 -07:00
Max BrunsfeldandNathan Sobo 7d5425e142 Move lsp configuration into language crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 12:17:51 -07:00
Max BrunsfeldandNathan Sobo de8218314c Notify language server when saving a buffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 11:45:59 -07:00
Nathan Sobo 1a92a19954 Remove Anchor from protocol 2021-10-26 12:04:04 -06:00
Antonio Scandurra 0674e76864 WIP 2021-10-26 19:42:40 +02:00
Antonio ScandurraandNathan Sobo 60abc5f090 Take ToOffset instead of anchors in intersecting_point_ranges
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 17:04:12 +02:00
Antonio Scandurra e8a2885721 Introduce Content::anchor_range_multimap 2021-10-26 14:28:02 +02:00
Antonio Scandurra 5dc47c625e Fix compilation errors 2021-10-26 14:27:00 +02:00
Max BrunsfeldandNathan Sobo 64445c7d1c Start work on AnchorRangeMultimap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 21:42:55 -07:00
Max Brunsfeld 50c77daa0b Start work on a test for worktree handling LSP diagnostics 2021-10-25 21:42:55 -07:00
Max BrunsfeldandNathan Sobo c3ff489fee Handle initialize request internally in fake lsp server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 18:04:27 -07:00
Max Brunsfeld 6384950d56 Merge remote-tracking branch 'origin/main' into lsp 2021-10-25 16:24:08 -07:00