Commit Graph
3306 Commits
Author SHA1 Message Date
Max Brunsfeld 0596c2f103 Format let-else statements 2023-08-25 10:11:32 -07:00
Kirill Bulatov 02560f7a1a Add hover tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 595c32b583 Be more lenient with hint resolution, always return some hint 2023-08-25 14:26:17 +03:00
Kirill Bulatov 6b7c2f1dc0 Fix resolve status conversion 2023-08-25 14:26:17 +03:00
Kirill Bulatov 05b8754d9f Propagate inlay background highlights to data storage 2023-08-25 14:26:17 +03:00
Kirill Bulatov a2a60c6d84 Properly resolve inlay label parts' locations and buffers 2023-08-25 14:26:17 +03:00
Kirill Bulatov de60646f8f Send inlay hint resolve requests 2023-08-25 14:26:17 +03:00
Kirill Bulatov 64aaa33e08 Store inlay hint resolve data 2023-08-25 14:26:17 +03:00
Kirill Bulatov e4f42bd33d Revert "Strip off inlay hints data that should be resolved"
Without holding all hints in host's cache, this is impossile.
Currenly, we keep hint caches separate and isolated, so this will not
work when we actually resolve.
2023-08-25 14:26:17 +03:00
Joseph T. Lyons 94ab92968d Merge branch 'main' into add-setting-to-automatically-enable-virtual-environment 2023-08-25 01:50:57 -04:00
Joseph T. Lyons 708cdd345f WIP 2023-08-25 01:50:54 -04:00
Max BrunsfeldandMikayla d5b7254ce0 Ensure collaborators cursor colors are the same in channel buffers as in projects
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-24 11:31:41 -07:00
Max BrunsfeldandMikayla bc402040ce Start work on showing consistent replica ids for channel buffers
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-23 18:37:01 -07:00
Joseph T. Lyons 8026edceb7 Shorten setting name 2023-08-23 04:07:10 -04:00
Joseph T. Lyons dfa179521c WIP 2023-08-23 04:04:36 -04:00
Julia 228326d9ec Only generate workspace/configuration for relevant adapter 2023-08-22 23:36:04 -04:00
Joseph T. LyonsandJulia da4fd139ca WIP
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-22 15:29:25 -04:00
Piotr OsiewiczandJulia Risley 97573a1995 Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 12:23:30 +03:00
Piotr OsiewiczandJulia Risley 9a197a63f8 Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 10:35:20 +02:00
Kirill BulatovandJulia Risley 4eea7de73f Respect completion resolve server capabilities
Only query for additional edits if the server supports it

Co-Authored-By: Julia Risley <julia@zed.dev>
2023-08-18 16:55:47 +03:00
Julia ca3fdfc6b6 Utilize LSP completion itemDefaults a bit
Tailwind likes to throw a lot of completion data at us, this gets it to
send less. Previously it would respond to a completion with 2.5 MB JSON
blob, now it is more like 0.8 MB.

Relies on a local copy of lsp-types with the `itemDefaults` field added.
I don't have write perms to push to our fork of the crate atm, sorry :)
2023-08-17 21:57:39 -04:00
Mikayla a37da1b636 Merge branch 'main' into project_search_design 2023-08-17 01:56:05 -07:00
Julia be8b778229 Register initial request handlers before launching server 2023-08-16 21:25:17 -04:00
Kirill Bulatov 08fcb3f10e Use InlayHint instead of Inlay where appropriate 2023-08-16 23:38:11 +03:00
KCaverlyandPiotr 9d4fe6b926 fix semantic search panic which is created via incompatible build_search_query path
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 15:50:54 +01:00
Julia db37d194d7 Use originating language server to resolve additional completion edits 2023-08-15 16:34:15 -04:00
Julia cae21a6758 Add support for querying multiple language servers for completions 2023-08-15 12:48:30 -04:00
Kirill Bulatov 0aa34790e5 Strip off inlay hints data that should be resolved 2023-08-14 22:50:55 +03:00
Nathan Sobo f01d3b87e0 Remove more window id usage 2023-08-08 11:20:09 -06:00
Max BrunsfeldandNathan b6d577584f Make LspAdapter::process_diagnostics synchronous
Co-authored-by: Nathan <nathan@zed.dev>
2023-08-07 13:53:41 -07:00
Max Brunsfeld a318f5465e Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
Kirill Bulatov 598996eaf3 Make project search includes and excludes more user-friendly
Allow search results that start with the include/exclude path part
2023-07-28 12:56:44 +03:00
Max Brunsfeld 4f2579494c More git status optimizations (#2779)
Follow-up to https://github.com/zed-industries/zed/pull/2777
Refs https://github.com/zed-industries/community/issues/1770

In this PR, I reworked the way that git statuses are retrieved. In a
huge repository like `WebKit`, the really slow part of computing a list
of git statuses is the *unstaged* portion of the diff. For the *staged*
diff, `git` can avoid comparing the contents of unchanged directories,
because the index contains hashes of every tree. But for the *unstaged*
portion, Git needs to compare every file in the worktree against the
index. In the common case, when there are no changes, it's enough to
check the `mtime` of every file (because the index stores the mtimes of
files when they are added). But this still requires an `lstat` call to
retrieve each file's metadata.

I realized that this is redundant work, because the worktree is
*already* calling `lstat` on every file, and caching their metadata. So
in this PR, I've changed the `Repository` API so that there are separate
methods for retrieving a file's *staged* and *unstaged* statuses. The
*staged* statuses are retrieved in one giant batch, like before, to
reduce our git calls (which also have an inherent cost). But the
`unstaged` statuses are retrieved one-by-one, after we load files'
mtimes. Often, all that's required is an index lookup, and an mtime
comparison.

With this optimization, it once again becomes pretty responsive to open
`WebKit` or `chromium` in Zed.

Release Notes:

- Optimized the loading of project file when working in very large git
repositories
2023-07-24 11:23:32 -07:00
Kirill Bulatov 58c3c412d1 Focus project panel on directory select 2023-07-23 00:12:25 +03:00
Max Brunsfeld bf9410bbb7 Optimize full file status via passing in known file mtime 2023-07-22 11:53:26 -07:00
Max Brunsfeld 143e0d5e8b Compute unstaged git status separately, to take advantage of our cached file mtimes 2023-07-21 17:58:43 -07:00
Max Brunsfeld da4f477e1f Only fetch statuses for changed paths 2023-07-21 17:08:31 -07:00
Max Brunsfeld 956a700cb8 Don't call git status when ignored files change 2023-07-21 17:05:42 -07:00
Max Brunsfeld 3146f7052a Retrieve git statuses in one batch when scanning dirs 2023-07-21 13:50:54 -07:00
Kirill Bulatov f35133a0d6 Properly open project directories 2023-07-18 22:59:41 +03:00
Kirill Bulatov 699c5ceb68 Ignore empty hover contents, trim final hover label text 2023-07-18 22:53:44 +03:00
Piotr Osiewicz a6c08cfa79 Remove dbg! calls 2023-07-17 13:03:57 +02:00
Piotr Osiewicz b61f6bc0ae Merge branch 'main' into piotr/z-2588-php 2023-07-17 11:47:08 +02:00
Piotr Osiewicz 9560f20af8 Add scaffolding of php language server 2023-07-17 11:43:32 +02:00
Max Brunsfeld 7614c594fc Perform only one git statuses call when reloading a git repo after it changes 2023-07-14 14:29:22 -07:00
Max Brunsfeld 5046491590 Find the layer with the smallest enclosing node in language_scope_at 2023-07-14 09:11:56 -07:00
Kirill Bulatov 5d8950e027 Allow all completions with preresolved additional text edits (#2711)
Deals with https://github.com/zed-industries/community/issues/752
Deals with https://github.com/zed-industries/community/issues/566

Currently, when converting from LSP to Zed objects, completions with
non-empty `additional_text_edits` are filtered out.
Later, all other completions form a list and the selected one gets the
`Editor::confirm_completion` call, which always queries an LSP
completion resolve request to get the `additional_text_edits` field.

Otherwise, `additional_text_edits` field is ignored entirely for the
rest of the completion lifetime — and we always pass the selected
completion through the resolve request.

The PR changes the logic, removing the `additional_text_edits` filtering
and instead of resolving every completion, now we check for
`additional_text_edits` in the completion before resolving: resolve
happens only if the data is absent.

Generally, feels like resolve has to happen before the completion
selection: LSP servers may send us markdown for completion documentation
preview pop ups and similar extra info.
Also, the server may lack resolve capabilities entirely, always sending
the request seems dangerous.
For now, the PR does not attempt to change either.

Release Notes:

- Brings rust-analyzer's postfix completions and others completions with
preresolved additional text edits
2023-07-12 22:10:18 +03:00
Kirill BulatovandMax Brunsfeld a05c1daacd Force resolve all completions, to ensure their edits are up-to-date
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-12 21:10:01 +03:00
Kirill Bulatov 65b409547a Do not resolve completions if extra edits are available 2023-07-12 20:28:16 +03:00
Kirill Bulatov 1181f12b44 Draft the postfix completions support 2023-07-12 18:32:03 +03:00