Commit Graph

213 Commits

Author SHA1 Message Date
Antonio Scandurra
ab26a175a4 Opt into language-aware features when getting buffer chunks
We use chunks a lot to transform points and sync the various display maps,
and always querying tree-sitter or the LSP diagnostics in those cases is
unnecessarily expensive.
2022-02-03 11:21:30 +01:00
Antonio Scandurra
d246a39b57 Syntax highlight even when the label doesn't contain a detail 2022-02-03 09:57:04 +01:00
Max Brunsfeld
439d12cb85 Start work on syntax highlighting completions 2022-02-02 18:14:30 -08:00
Max Brunsfeld
45898daf83 Fix hang in editor completion unit test 2022-02-02 17:09:36 -08:00
Max Brunsfeld
bbdf62f263 Introduce Language::highlight_text method 2022-02-02 17:01:48 -08:00
Max Brunsfeld
88adddb324 Remove theme parameters from buffer/display map's chunks methods
Change Chunks to contain highlight ids instead of actual highlight
styles. Retrieve the actual highlight style from the theme in the
editor element layer.

This is to set us up to perform syntax highlighting in other code
paths where the theme is not available.
2022-02-02 16:33:04 -08:00
Antonio Scandurra
8149bcbb13 Improve formatting of function autocompletion labels in Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-02 18:43:55 +01:00
Antonio Scandurra
8d7815456c Don't apply completion's edit when it wouldn't change the buffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-02 18:00:30 +01:00
Antonio Scandurra
924eb622ae Wait for additional edits before pushing transaction in remote buffer 2022-02-02 17:01:23 +01:00
Antonio Scandurra
d765e75bad Apply additional edits for completion when the buffer is remote 2022-02-02 16:29:13 +01:00
Antonio Scandurra
91e5c2dfac Broadcast completion triggers to remote participants 2022-02-02 14:07:41 +01:00
Antonio Scandurra
ed549e352f Start on requesting completions for remote buffers 2022-02-02 12:22:47 +01:00
Max Brunsfeld
7270fd00ba Start work on handling snippet completions 2022-02-01 15:35:02 -08:00
Max Brunsfeld
1371a20e58 🎨 Return an option task from confirm_completion 2022-02-01 14:27:01 -08:00
Antonio Scandurra
6c7d2cf6b5 Apply additional edits when confirming a completion
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-01 17:38:11 +01:00
Antonio Scandurra
bcc57036a5 Fix warnings in language::FakeFile
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-01 16:59:03 +01:00
Antonio Scandurra
b89a39bcb3 Filter and sort suggestions in autocomplete
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-01 15:11:20 +01:00
Nathan Sobo
fde03b1b37 Make the anchor range inclusive on completions
This will help us to correctly interpolate the replacement range when we confirm before receiving new completions after typing with a completion open.
2022-01-31 18:26:26 -07:00
Max Brunsfeld
1d1f8df180 Trigger completion when typing words or trigger characters
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-31 17:07:24 -08:00
Max Brunsfeld
8d2b7ba032 Insert completion text on enter
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-31 13:46:50 -08:00
Nathan Sobo
ab6eb0a655 Start on completion rendering
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-31 12:19:17 -07:00
Nathan Sobo
0344c543af Return anchored completions from Buffer::completions
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-31 11:25:00 -07:00
Antonio Scandurra
03bcbdc33d WIP 2022-01-31 19:12:35 +01:00
Antonio Scandurra
bd2527e691 Use StringMatchCandidate::new to construct candidates more conveniently
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-31 19:11:13 +01:00
Antonio Scandurra
f055053fc9 Avoid grouping transactions created by different editors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:51:46 +01:00
Antonio Scandurra
121b45e249 Sanitize language server diagnostics coming from Rust
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-25 17:49:50 +01:00
Antonio Scandurra
96b66dcce1 Fix race condition when opening a buffer and getting a definition to it 2022-01-24 18:47:55 +01:00
Antonio Scandurra
245490f934 Implement Project::definition when the buffer is remote 2022-01-24 13:10:13 +01:00
Antonio Scandurra
f859d444ff Don't show conflict indicator on remote buffer after a reload 2022-01-24 10:17:36 +01:00
Antonio Scandurra
4372fe1ed0 Maintain remote buffers via UpdateBufferFile messages sent by host 2022-01-24 09:32:40 +01:00
Nathan Sobo
da13d028a3 Send File protos as part of Buffer protos
Use the File proto to build the File associated with the buffer rather than relying on the local entry.
2022-01-22 22:19:04 -07:00
Nathan Sobo
66fce5ec8e Introduce LocalFile trait
If you want to call `abs_path` or `load`, the file needs to be local. You call `as_local` which returns `Option<dyn LocalFile>` with those local-only methods. I think this makes it more explicit what works only locally vs everywhere.
2022-01-22 15:52:14 -07:00
Nathan Sobo
d192b6ebc7 Remove Worktree::abs_path
I'd like to only have methods related to absolute paths on local worktrees, because it's not really possible to implement them on remote worktrees since we don't know the full path being shared and wouldn't have anything to do with it anyway if we did.
2022-01-22 14:44:58 -07:00
Nathan Sobo
e2a2073bdb Remove worktree_path from File struct 2022-01-22 14:29:36 -07:00
Nathan Sobo
83418204b6 Assign diagnostics on buffer even if it doesn't have a language
This shouldn't be necessary in practice but makes testing easier.
2022-01-22 09:54:25 -07:00
Max Brunsfeld
bd49a02c92 Move buffers from worktree to project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-21 15:46:27 -08:00
Antonio Scandurra
71082d4cdc Return a Task<Result<()>> in {ItemView,Buffer,MultiBuffer}::save 2022-01-20 09:58:24 +01:00
Max Brunsfeld
f43dcd6763 Move logic for starting language servers to the project 2022-01-19 14:05:06 -08:00
Max Brunsfeld
ea69dcd42a Match on names only when outline query has no spaces
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 09:16:29 -08:00
Nathan Sobo
b52db22544 Only enable smart case if the query contains an uppercase character
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-14 09:16:09 -07:00
Nathan Sobo
f934370e7f Match full path when query contains spaces
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-14 09:02:04 -07:00
Antonio Scandurra
be24e58926 Associate StringMatchCandidate with an id
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-14 14:55:03 +01:00
Antonio Scandurra
a64ba8b687 Allow matching of context items in outline view 2022-01-14 11:09:02 +01:00
Antonio Scandurra
9c1f58ee89 Maintain order of outline items when filling out tree's missing parts 2022-01-14 09:12:30 +01:00
Max Brunsfeld
adeb7e6864 Incorporate syntax highlighting into symbol outline view
Still need to figure out how to style the fuzzy match characters
now that there's syntax highlighting. Right now, they are
underlined in red.
2022-01-13 18:10:02 -08:00
Max Brunsfeld
7913a1ea22 Include highlighting runs in Outline 2022-01-13 14:46:15 -08:00
Max Brunsfeld
3e1c559b2d Allow multiple disjoint nodes to be captured as matcheable in the outline query 2022-01-13 14:04:25 -08:00
Antonio Scandurra
055d48cfb2 Select the closest outline item when the outline view's query is empty
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:43:49 +01:00
Antonio Scandurra
2660d37ad8 Return Outline<Anchor> from MultiBuffer::outline
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-13 18:24:00 +01:00
Antonio Scandurra
e165f1e16c Use OutlineItem::depth to include ancestors of matching candidates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-13 16:59:52 +01:00