Max Brunsfeld and Nathan Sobo
c9d9e90b95
Avoid panic when language server is dropped before being initialized in tests
...
Co-authored-by: Nathan Sobo <nathan@zed.dev >
2022-05-09 18:05:10 -07:00
Antonio Scandurra
fdfcbaa63b
Return None when prepare rename is not available on language server
2022-04-22 15:43:23 +02:00
Nathan Sobo and Antonio Scandurra
66bcacd9cb
Introduce structured logging
...
We're enabling the log crate feature everywhere, but only using it on the server for now.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-04-08 10:06:51 -06:00
Nathan Sobo and Antonio Scandurra
c6d6346c14
Don't starve UI thread when rapidly receiving LSP messages
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-04-07 08:30:42 -06:00
Max Brunsfeld and Antonio Scandurra
f27f8a5c9e
Allow applying code actions that use commands
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-04-01 10:16:26 -07:00
Max Brunsfeld
df45c44872
Let fake and real LanguageServer access AsyncAppContext in handler callbacks
...
Also, reimplement FakeLanguageServer by wrapping LanguageServer, instead of
duplicating its functionality differently.
2022-03-31 21:57:00 -07:00
Max Brunsfeld and Keith Simmons
d97a956050
Hard-code LSP formatting options for now
...
This is needed for auto-formatting to work properly in TypeScript and JSON
Co-Authored-By: Keith Simmons <keith@zed.dev >
2022-03-30 17:08:40 -07:00
Keith Simmons and Max Brunsfeld
801cdde8a7
Test language server restart works as expected
...
Co-authored-by: Max Brunsfeld <max@zed.dev >
2022-03-30 13:08:36 -07:00
Keith Simmons
598d2433bf
Add restart-lsp keybinding
2022-03-29 17:24:23 -07:00
Antonio Scandurra
0995424cf7
Fix warnings
2022-03-28 11:05:55 +02:00
Antonio Scandurra
fb4f218382
Allow returning futures in fake language server request handlers
2022-03-28 10:44:32 +02:00
Max Brunsfeld
839a7f8782
Start work on relaying settings to language servers
2022-03-11 17:36:27 -08:00
Max Brunsfeld
906e647702
Allow registering handlers for typed LSP requests
2022-03-11 13:19:10 -08:00
Max Brunsfeld
780c0207c2
Add API for handling custom requests from the language server
2022-03-11 11:44:02 -08:00
Max Brunsfeld
7f3b4aa41e
Merge branch 'main' into settings-file
2022-03-11 10:04:17 -08:00
Max Brunsfeld
73f2271071
For single-file worktrees start LSP with parent dir as CWD
2022-03-10 16:06:12 -08:00
Antonio Scandurra
7498e16311
Display language server name in status bar
2022-03-10 16:48:43 +01:00
Antonio Scandurra
180c7dabff
Split language server initialization from construction
...
This gives clients a chance to register to notifications.
2022-03-09 12:31:21 +01:00
Max Brunsfeld
bfc721db27
Assign buffer's completion triggers from LSP capabilities
...
Also, make LanguageServer::new() async. The future resolves
once the server is initialized.
2022-03-08 17:41:52 -08:00
Antonio Scandurra
aa62426ee8
Support formatting in fake LSP capabilities
2022-03-04 11:24:18 +01:00
Max Brunsfeld
ee589d9cf7
Avoid infinite loop when a language server fails to start
2022-03-03 18:13:38 -08:00
Max Brunsfeld
3a1a9ecb45
Disable doctests for all libraries
...
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00
Max Brunsfeld
5072109d9d
Make fake language servers have full capabilities
2022-03-03 15:42:29 -08:00
Max Brunsfeld and Nathan Sobo
5868120184
Enable formatting feature of JSON language server
...
The feature doesn't work yet because the JSON language server
only supports *range* formatting, not document formatting.
We need to adjust our code to inspect the server's capabilities
and send range formatting requests instead when needed.
We're going to hold off on doing this right now, because it
will create merge conflicts with the `preserve-worktrees`
branch (#525 )
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-03 14:16:58 -08:00
Max Brunsfeld and Nathan Sobo
b5800767f1
Add JSON language server
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-03 13:29:25 -08:00
Antonio Scandurra
acb9d5158a
Fix warnings
2022-03-02 12:45:49 +01:00
Max Brunsfeld and Nathan Sobo
0b1ef30f94
Fix remaining language server hangs on shutdown
...
* Use fork of async-pipe library that handles closed pipes correctly.
* Clear response handlers map when terminating output task, so as
to wake any pending request futures.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-01 15:54:59 -08:00
Max Brunsfeld
42166fbd55
Prevent hangs in lsp requests made while server is shutting down
...
* Avoid postage::oneshot, since receiver is not woken when sender is dropped.
* Clear the response channels when an IO task exits.
2022-03-01 13:36:49 -08:00
Max Brunsfeld
1f98014888
Clean up tasks properly when dropping a FakeLanguageServer
...
* Make sure the fake's IO tasks are stopped
* Ensure that the fake's stdout is closed, so that the corresponding language
server's IO tasks are woken up and halted.
2022-03-01 13:26:59 -08:00
Antonio Scandurra
79568c471a
Pass a reference to TestAppContext in tests
...
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Max Brunsfeld and Antonio Scandurra
868e66f385
Eliminate RwLock around LanguageServer's outbound message channel
...
We observed a deadlock when quitting zed. The main thread was attempting
to acquire a write lock to this outbound message sender. We weren't able
to understand exactly how this occurred, but we removed the use of a
lock there, so this shouldn't happen anymore.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-02-25 10:04:57 -08:00
Antonio Scandurra
8ee20849d1
Fix warning
2022-02-24 09:52:25 +01:00
Antonio Scandurra
919a280fab
Pass an AsyncAppContext to fake language server request handlers
2022-02-23 16:14:36 +01:00
Antonio Scandurra
d30399e056
Remove unused method
2022-02-21 17:31:43 +01:00
Antonio Scandurra and Nathan Sobo
6149e8c4cb
Remove rust-analyzer smoke test
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-21 17:28:55 +01:00
Antonio Scandurra
c0d1e77c21
Fix warnings
2022-02-17 17:26:03 +01:00
Antonio Scandurra
0b5c6ea0fd
Wait for version before returning code actions
2022-02-17 14:46:26 +01:00
Max Brunsfeld and Nathan Sobo
529e18978e
Remove unnecessary waiting during completion RPC requests
...
Also, add completion requests to the randomized collaboration integration test,
to demonstrate that this is valid.
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-16 17:23:16 -08:00
Max Brunsfeld and Nathan Sobo
f3e70f32ac
Allow FakeLanguageServer handlers to handle multiple requests
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-16 16:19:27 -08:00
Max Brunsfeld and Nathan Sobo
90e4622ec7
Allow multiple fake language servers to be started for a given project
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-16 16:10:36 -08:00
Max Brunsfeld
7c1cc69cd3
Reduce logging in lsp tests
2022-02-11 16:37:50 -08:00
c574e7eba7
Restructure fake language server to setup request handlers in advance
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-11 15:08:56 -08:00
Antonio Scandurra and Nathan Sobo
85cdfddb31
Fetch code actions on cursor movement instead of on-demand
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-11 14:41:19 +01:00
Max Brunsfeld
0be3b9e3be
Silence warnings
2022-02-09 13:00:09 -08:00
Max Brunsfeld
a0aeddfc57
Fix unused import warnings
2022-02-08 16:27:33 -08:00
Max Brunsfeld and Nathan Sobo
c477ca9308
Give the editor a handle to the project, not a weak handle to the workspace
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-08 15:48:44 -08:00
Max Brunsfeld
1e18742c9d
Merge branch 'main' into assists
2022-02-08 12:41:57 -08:00
Max Brunsfeld and Nathan Sobo
c60eabc117
Run multiple iterations of all integration tests
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-07 15:11:41 -08:00
Antonio Scandurra
1ae79902e9
WIP: Start on applying code actions
2022-02-07 12:20:03 +01:00
Max Brunsfeld and Nathan Sobo
c0e51a467e
Start work on code actions
...
Just print out the returned code actions for now
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-02-04 17:45:00 -08:00