Commit Graph

122 Commits

Author SHA1 Message Date
Kirill Bulatov
bd97767c72 Run LSP response deserialization outside of main thread
Improves latency when big inlay hints LSP responses for ~8k line files

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-21 13:20:42 +03:00
Kirill Bulatov
77f5b5a80d React on message-less LSP requests properly
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-06-16 22:02:29 +03:00
Max Brunsfeld
a7f06f962b Enable type definition capability in fake LSPs in tests 2023-06-08 12:09:37 -07:00
Max Brunsfeld
66f215cd13 Restructure LSP log view to show log messages in addition to RPC trace 2023-06-07 16:51:09 -07:00
Max Brunsfeld
e8479f23f9 Improve log message on invalid LSP message from server's stdout 2023-06-06 17:13:59 -07:00
Kirill Bulatov
fdad1adaf6 Update LSP to the newest version 2023-05-28 21:55:08 +03:00
Max Brunsfeld
2db57b5139 Adjust diagnostic transformation test to not wait for two buffer notifications 2023-05-26 15:47:37 -07:00
Max Brunsfeld
ebbe52e6b0 🎨 Specify more dependencies at the workspace level 2023-04-24 17:41:55 -07:00
Max Brunsfeld
f3ada72785 Avoid accidentally dropping subscription when detaching it 2023-04-24 10:04:45 -07:00
Max Brunsfeld
2dd4920625 Add LanguageServer::on_io method, for observing JSON sent back and forth 2023-04-24 09:43:31 -07:00
Max Brunsfeld
abdccf7393 Use a workspace dependency for the futures crate 2023-04-24 09:43:31 -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
6156dbced0 Finish getting multiple diagnostics sources building and running 2023-04-20 08:58:41 -07:00
Julia
2a5c0fa5f8 Get ESLint to launch and provide diagnostics
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-04-20 08:58:41 -07:00
Antonio Scandurra
2c0a645f19 Provide workspace_folders capability when initializing LSP
This fixes the YAML language server which was erroring on startup
after adding the `did_change_watched_files` capability in #2258.
2023-04-03 20:12:26 +02:00
Mikayla Maki
81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Julia
cdde523ea4 Allow each language adapter to provide their own code action kinds array 2023-03-30 15:41:54 -04:00
Antonio Scandurra
5471217089 Use the same serde version across the entire workspace 2023-03-28 09:42:00 -07:00
Julia
c72d33e029 Initial impl of NodeRuntime w/JSON borked and a deadlock :)
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-27 00:00:16 -04:00
Julia
edd6c85af7 Initial running of servers on downloaded Node 2023-03-27 00:00:16 -04:00
Max Brunsfeld
cbeb6e692d Move postage crate version specification to workspace Cargo.toml 2023-03-21 11:26:13 -07:00
Max Brunsfeld
61172c8478 Notify language servers of FS changes 2023-03-21 11:26:13 -07:00
Antonio Scandurra
1af8f4be19 Deserialize Theme directly into the heap to avoid stack overflow
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-03-17 15:58:52 +01:00
Antonio Scandurra
221bb54e48 Introduce a new TryFutureExt::unwrap method 2023-03-10 11:41:13 +01:00
Max Brunsfeld
ff85bc6d42 Add setting for removing trailing whitespace on save 2023-02-28 21:52:00 -08:00
Antonio Scandurra
c3a88857f9 Always respond to language server, even when its requests are malformed
This was causing Pyright to get stuck waiting for a response when sending
us the `workspace/configuration` request. For some reason, after upgrading
to Pyright 1.1.293, `scopeUri` is being sent as an empty string sometimes,
which causes serde to error when trying to deserialize that request.

Co-Authored-By: Petros Amoiridis <petros@zed.dev>
2023-02-09 15:30:10 +01:00
Kay Simmons
4642817e72 Add lua syntax highlighting and lsp support 2023-02-05 23:21:29 -08:00
Mikayla Maki
d060114f00 Added complete scripts for generating third party license files 2023-01-23 12:47:12 -08:00
Antonio Scandurra
83c98ce049 Prevent making further requests after language server shut down
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2023-01-06 13:40:32 -07:00
Antonio Scandurra
c4680e66ff Fix error on clangd when compile-commands.json is present
The language server was failing because we were forgetting to provide
a `jsonrpc` field for responses to requests coming from the lsp.
2022-10-13 11:10:23 +02:00
ForLoveOfCats
8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
ForLoveOfCats
5149c15329 Add "go to type definition" action 2022-07-29 11:41:08 -04:00
Isaac Clayton
6585daccf9 Further unpropogate async 2022-07-07 16:16:58 +02:00
Isaac Clayton
7dd3114a7a Start switching JSON LSP adapter to plugin (take 2) 2022-07-07 15:16:59 +02:00
Keith Simmons
ebe733a393 Restart language server using original root path rather than the path of the buffer restarted from 2022-06-30 19:11:21 -07:00
Keith Simmons
db05e32389 Prevent creating extra language server instances if there already exists one for that workspace 2022-06-30 16:46:26 -07:00
Antonio Scandurra
ca1d0a6e59 Ignore tokens that were not created via WorkDoneProgressCreate
With the new version of rust-analyzer, we were seeing stray `WorkDoneProgress::End`
messages that create an imbalance in the `pending_diagnostic_updates` that never
resolves. This was causing the diagnostic status bar item to never update because
we wouldn't emit `DiskBasedDiagnosticsStarted` nor `DiskBasedDiagnosticsFinished`.

This commit fixes the above situation by only acknowledging progress report for tokens
that have explicitly been created via the `WorkDoneProgressCreate` request, as stated
by the protocol.

In addition to that, we are replacing the `pending_diagnostic_updates: isize` with
a `has_pending_diagnostic_updates: bool`. We added it at some point to prevent a similar
issue where we would observe begin/end reports in a seemingly random order, which would cause
us to permanently display a `checking...` message in the status bar. I believe this commit
fixes that as well because the `isize` was just a less general solution for the same
underlying issue. As the protocol states: "the token provided in the create request should
only be used once (e.g. only one begin, many report and one end notification should be sent
to it)."
2022-06-28 10:08:43 +02:00
Max Brunsfeld
11f73bfa4e Integrate pyright language server 2022-06-22 16:58:19 -07:00
Max Brunsfeld
e9d19457d6 Add failing test for replication of lsp statuses
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:27:08 -07:00
Keith Simmons
b014352740 Syntax highlighting working. Getting started on markdown support 2022-06-07 11:54:33 -07:00
Max Brunsfeld
724affc442 Upgrade deps to avoid multiple versions of transitive deps
* env_logger
* prost-build
* bindgen
2022-06-02 17:38:33 -07:00
Antonio Scandurra
339069b1d3 Cap MessageStream buffer size to 1MB
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Max Brunsfeld
3dee656490 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
f91fdd2ba0 Return None when prepare rename is not available on language server 2022-04-22 15:43:23 +02:00
Nathan Sobo
7e5a3f9f6b 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
80d55fd3d8 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
56523b5775 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
e987a8ba63 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
c280c85ce7 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
32d2e5952c Test language server restart works as expected
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-30 13:08:36 -07:00