Commit Graph
136 Commits
Author SHA1 Message Date
Julia a979e32127 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
Julia 40ce099780 Use originating language server to resolve additional completion edits 2023-08-15 16:34:15 -04:00
Kirill Bulatov 27bf01c3a8 Strip off inlay hints data that should be resolved 2023-08-14 22:50:55 +03:00
Kirill Bulatov c732aa1617 Do not resolve completions if extra edits are available 2023-07-12 20:28:16 +03:00
Kirill Bulatov 6d96c6ef51 Draft the postfix completions support 2023-07-12 18:32:03 +03:00
Kirill Bulatov 1936bdebb3 Use less padding for typescript parameter hints 2023-07-06 11:16:39 +03:00
Kirill Bulatov 667b70afde Move hint settings on the language level 2023-06-29 22:39:18 +03:00
Antonio Scandurra f77b680db9 Account for inlay biases when clipping a point 2023-06-29 22:25:50 +03:00
Kirill Bulatov 31f0f9f7b1 Forbid extra inlay updates 2023-06-29 22:25:49 +03:00
Kirill Bulatov 8acc5cf8f4 Deserialize more LSP inlay hint information 2023-06-29 22:25:49 +03:00
Kirill Bulatov f155f5ded7 Better rpc inlay hint handling 2023-06-29 22:25:49 +03:00
Kirill BulatovandAntonio Scandurra 5fadbf77d4 Implement InlayHint sync method and fix the bugs
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:48 +03:00
Kirill Bulatov d506522eef Correctly pass inlay hints 2023-06-29 22:25:48 +03:00
Kirill Bulatov 4c3c0eb796 Draft the hint render data flow 2023-06-29 22:25:48 +03:00
Kirill Bulatov 6e3d1b962a Draft the initial protobuf changes 2023-06-29 22:25:48 +03:00
Kirill Bulatov 8a3b515f56 Initial protocol check commit 2023-06-29 22:25:48 +03:00
Max Brunsfeld 11dbbcc9dd Respect LSP goToTypeDefinition server capability 2023-06-08 11:33:09 -07:00
Max Brunsfeld 72372ddf0e Highlight hover code blocks as LSP's own language by default
The elixir LSP does not include a language name on its elixir code blocks.
2023-06-07 10:01:19 -07:00
Max Brunsfeld fccbac4887 Handle LSP codeActions capability set to false 2023-06-06 17:13:59 -07:00
Max Brunsfeld 788f97ec68 Add support for folder-specific settings (#2537)
This PR allows you to customize Zed's settings within a particular
folder by creating a `.zed/settings.json` file within that folder.

Todo

* [x] respect folder-specific settings for local projects
* [x] respect folder-specific settings in remote projects
* [x] pass a path when retrieving editor/language settings
* [x] pass a path when retrieving copilot settings
* [ ] update the `Setting` trait to make it clear which types of
settings are locally overridable

Release Notes:

* Added support for folder-specific settings. You can customize Zed's
settings within a particular folder by creating a `.zed` directory and a
`.zed/settings.json` file within that folder.
2023-05-31 16:27:08 -07:00
Max Brunsfeld 0dd7694ff5 Make language_settings take a language, not a language name 2023-05-31 15:10:30 -07:00
Max Brunsfeld 03a351fb26 Make language settings accessors take an arc dyn file 2023-05-31 14:57:04 -07:00
Max Brunsfeld 89446c7fd4 Start work on respecting project-specific settings 2023-05-29 14:25:49 -07:00
Kirill Bulatov fdad1adaf6 Update LSP to the newest version 2023-05-28 21:55:08 +03:00
Kirill BulatovandAntonio Scandurra e2ff829f98 Use Transaction instead of ProjectTransaction
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-05-25 16:12:14 +03:00
Kirill Bulatov aa58d0fd77 Do not send edits over the wire 2023-05-25 12:55:44 +03:00
Kirill Bulatov 58a56bdda2 Always use server formatting settings 2023-05-25 09:45:50 +03:00
Kirill Bulatov b9dabb165e Use formatting options 2023-05-25 09:45:50 +03:00
Kirill Bulatov 3327e8a6dd Support remote sessions 2023-05-25 09:45:50 +03:00
Kirill Bulatov f6d7b3d2e8 Send and handle OnTypeFormatting LSP request 2023-05-25 09:45:50 +03:00
Max Brunsfeld d298ce3fd3 Render more markdown features in hover popover 2023-04-26 15:33:10 -07:00
Max Brunsfeld 4dd917c123 Introduce a LanguageServerId wrapper type
Clarify the meaning of all the usizes in use in all of these
struct fields an method signatures.
2023-04-20 08:58:41 -07:00
Julia ba7233f265 Incomplete refactor to allow for multiple adapters per language 2023-04-20 08:58:39 -07:00
Max Brunsfeld bd7d50f339 Fix 'invalid insertion' panic when following
Wait for the necessary buffer operations to arrive before attempting to
set selections and scroll top.
2023-04-18 16:13:18 -07:00
Antonio Scandurra 5898600239 Use LspCommand to handle code actions 2023-04-11 15:12:58 +02:00
Antonio Scandurra 651a83977e 🔥 2023-04-11 14:53:08 +02:00
Antonio Scandurra ac532cb6fa Use LspCommand to handle completions 2023-04-11 14:52:07 +02:00
Max Brunsfeld 25e3c4e586 Fix leak when project is unshared while LSP handler waits for edits 2023-04-10 17:03:58 -07:00
Antonio Scandurra 016343e65d Merge branch 'main' into randomized-tests-operation-script 2023-04-10 08:45:22 +02:00
Max Brunsfeld f95732e981 Fix bug where guest would drop BufferSaved messages while opening the buffer 2023-04-03 16:23:44 -07:00
7a629769b7 Re-request incomplete remote buffers when syncing buffers
Any buffers we requested but that haven't been fully sent will cause
outstainding open requests to hang. If we re-request them, any
waiting open requests will resume when the requested buffers finish
being created.

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-01-04 16:00:43 -07:00
Antonio Scandurra 05e99eb67e Introduce an epoch to ConnectionId and PeerId 2022-12-14 15:55:56 +01:00
Julia 8c75df30cb Wrap a bunch of traits for Unclipped<T> 2022-11-21 15:58:44 -05:00
JuliaandMax Brunsfeld 1c84e77c37 Start adding concept of Unclipped text coordinates
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-11-21 15:48:25 -05:00
Julia bb32599ded Clamp for all UTF-16 to offset conversions which used to use ToOffset 2022-11-21 14:25:01 -05:00
Max Brunsfeld 6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Antonio Scandurra 9c9bf07e40 Create buffers for remote collaborators out of band
Previously, we would use `Project::serialize_buffer_for_peer` and
`Project::deserialize_buffer` respectively in the host and in the
guest to create a new buffer or just send its ID if the host thought
the buffer had already been sent.

These methods would be called as part of other methods, such as
`Project::open_buffer_by_id` or `Project::open_buffer_for_symbol`.
However, if any of the tasks driving the futures that eventually
called `Project::deserialize_buffer` were dropped after the host
responded with the buffer state but (crucially) before the guest
deserialized it and registered it, there could be a situation where
the host thought the guest had the buffer (thus sending them just the
buffer id) and the guest would wait indefinitely.

Given how crucial this interaction is, this commit switches to creating
remote buffers for peers out of band. The host will push buffers to guests,
who will always refer to buffers via IDs and wait for the host to send them,
as opposed to including the buffer's payload as part of some other operation.
2022-08-17 11:55:36 +02:00
ForLoveOfCatsandMikayla 8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
ForLoveOfCats d474e1e1f4 Deduplicate some lsp_command code 2022-07-29 18:04:14 -04:00