Commit Graph
25009 Commits
Author SHA1 Message Date
Antonio Scandurra e260151c5f Report new_lines extent correctly when coalescing edits 2021-10-28 11:32:10 +02:00
Nathan SoboandMax Brunsfeld 85892ad428 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
61c1354415 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 7cd7d52899 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 10ad2d113c Fix bug in to_full_offset when Anchor::version != Content::version 2021-10-27 11:56:04 +02:00
Max BrunsfeldandNathan Sobo c6a85f0009 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 a827f6b6d7 Generalize AnchorRangeMultimap's 'intersecting ranges' API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-26 17:56:39 -07:00
Max Brunsfeld b5ebd4b53d Fix routing of diagnostics to buffers in worktree 2021-10-26 15:46:39 -07:00
Max Brunsfeld fef3c44f4a Allow retrieving a buffer's diagnostics 2021-10-26 15:46:08 -07:00
Max Brunsfeld 1fe81e3516 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 cfedba9f1c 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 499226ae78 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 35886ddcdb 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 3b6204c0ac Remove Anchor from protocol 2021-10-26 12:04:04 -06:00
Antonio Scandurra a6d95b9652 WIP 2021-10-26 19:42:40 +02:00
Antonio ScandurraandNathan Sobo 98f3a2eed2 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 165161687c Introduce Content::anchor_range_multimap 2021-10-26 14:28:02 +02:00
Antonio Scandurra 1c4b9c8142 Fix compilation errors 2021-10-26 14:27:00 +02:00
Max BrunsfeldandNathan Sobo 2cfdf3096e Start work on AnchorRangeMultimap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 21:42:55 -07:00
Max Brunsfeld 2be859951b Start work on a test for worktree handling LSP diagnostics 2021-10-25 21:42:55 -07:00
Max BrunsfeldandNathan Sobo ce1e13b397 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 5a0b7ea21f Merge remote-tracking branch 'origin/main' into lsp 2021-10-25 16:24:08 -07:00
Max BrunsfeldandNathan Sobo 952567f533 Add a fake lsp server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 15:28:40 -07:00
8679b37e20 Log unhandled notifications in LanguageServer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-25 19:46:33 +02:00
abc8cbbeb4 Get a basic end-to-end test for rust-analyzer integration working
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-25 18:11:52 +02:00
Antonio ScandurraandNathan Sobo 084858d069 Uncomment script/bundle lines
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-25 17:35:45 +02:00
Nathan Sobo 0beb4ffe93 Get language and project compiling 2021-10-25 09:26:36 -06:00
Antonio Scandurra a24f3a2676 Don't send notifications or requests until LSP is initialized 2021-10-25 12:29:28 +02:00
Antonio Scandurra 3354e4a5de Implement a more robust way of locating rust-analyzer
When bundled, we will retrieve it out of the `Resources` folder.
Locally, we're expected to run `script/download-rust-analyzer` and
put `vendor/bin` in our $PATH.
2021-10-25 11:02:35 +02:00
Nathan Sobo 27d84b4f56 Get buffer compiling with new SelectionSets based on AnchorRangeMap
One test is failing however.
2021-10-22 14:12:16 -06:00
Nathan Sobo 1d85cf2ef5 WIP: Start converting SelectionSet to use AnchorRangeMap 2021-10-22 13:19:19 -06:00
Nathan Sobo ddbc43beb3 Implement TryFrom<proto::SelectionSet> on SelectionSet
More prep work for changing the selection set representation.
2021-10-22 12:46:02 -06:00
Nathan Sobo df9dad2804 Simplify protocol messages related to selection sets
This prepares the way to switch to using AnchorRangeMaps to store and transmit selection sets.
2021-10-22 12:35:29 -06:00
Nathan Sobo f9abbd1900 Move SelectionSet and Into impl to selection module 2021-10-22 09:56:47 +02:00
Antonio Scandurra 21ebc7e859 WIP 2021-10-21 19:27:10 +02:00
f6b1cc5830 Start on integrating rust-analyzer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-10-21 16:26:37 +02:00
Max Brunsfeld c85de841c9 Merge pull request #213 from zed-industries/language-buffer
Extract Buffer's language-aware behavior into a new `language` crate
2021-10-21 13:22:04 +02:00
6d8aa9f7d8 Assign new file handles on buffers when their files change on disk
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-21 13:08:54 +02:00
8d2d3c0750 Update buffer's saved mtime when file is reloaded after on-disk change
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-21 12:05:44 +02:00
Max Brunsfeld 7a3a9575e2 Rename TextBuffer back to Buffer 2021-10-21 11:12:19 +02:00
Max Brunsfeld 3f96f0aa6f Remove unnecessary dependencies in buffer and language crates 2021-10-21 09:40:50 +02:00
Max Brunsfeld 34cda9fe9b Extract a language crate 2021-10-20 22:51:40 +02:00
Max Brunsfeld a0d4443c38 Re-enable randomized concurrent edits test 2021-10-20 21:44:26 +02:00
b84f5e3940 Extract a TextBuffer from Buffer, which has no tree or file
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-10-20 00:10:57 +02:00
Nathan Sobo 7e90519ffc Merge pull request #205 from zed-industries/autoindent
Autoindent
2021-10-19 14:23:04 +02:00
230307ce59 Insert an extra newline between brackets
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-10-19 13:17:16 +02:00
Nate Butler 0192dea583 Make light collab cursor not yellow for Nathan ;) 2021-10-17 18:28:05 +02:00
Nathan Sobo 1a48b3e5e6 Restore all active selections when undoing/redoing autoindent
In the unlikely event that we're handling autoindent requests from multiple editors, we undo/redo selections from both editors. This is somewhat imperfect but probably good enough and easier than performing auto-indents on a per-editor basis.
2021-10-11 17:22:18 -06:00
Max Brunsfeld 1d24ca172f Move selections explicitly when applying autoindents 2021-10-11 15:27:38 -07:00
Max Brunsfeld 83db3ac840 Add unit tests for selective indentation adjustment 2021-10-11 13:02:01 -07:00