Commit Graph
312 Commits
Author SHA1 Message Date
Kirill BulatovandJulia Risley dd1b645c63 React on message-less LSP requests properly
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-06-16 22:02:29 +03:00
Julia c8b86e2031 Setup C adapter with test binary 2023-06-15 12:18:34 -04:00
Julia 7353151a33 Many steps toward validating and reinstalling server after failure 2023-06-15 12:18:34 -04:00
Julia 6c5fd5f1a3 Detect LSP startup failure 2023-06-15 12:18:34 -04:00
Max Brunsfeld 7018e5cff4 Enable type definition capability in fake LSPs in tests 2023-06-08 12:09:37 -07:00
Max Brunsfeld 5603fbe39c Restructure LSP log view to show log messages in addition to RPC trace 2023-06-07 16:51:09 -07:00
Max Brunsfeld c4a91f9d58 Improve log message on invalid LSP message from server's stdout 2023-06-06 17:13:59 -07:00
Kirill Bulatov 99509fc6ed Update LSP to the newest version 2023-05-28 21:55:08 +03:00
Max Brunsfeld 208cf495f8 Adjust diagnostic transformation test to not wait for two buffer notifications 2023-05-26 15:47:37 -07:00
Max Brunsfeld ed0715fcae Avoid accidentally dropping subscription when detaching it 2023-04-24 10:04:45 -07:00
Max Brunsfeld d7e63c8012 Add LanguageServer::on_io method, for observing JSON sent back and forth 2023-04-24 09:43:31 -07:00
Max Brunsfeld d57a8d85f9 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 3321d699dc Finish getting multiple diagnostics sources building and running 2023-04-20 08:58:41 -07:00
JuliaandAntonio Scandurra ef288d90d9 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 ff50acaa64 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
Julia efde8aeb63 Allow each language adapter to provide their own code action kinds array 2023-03-30 15:41:54 -04:00
JuliaandAntonio Scandurra 5deac1d5b3 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 543aebed40 Initial running of servers on downloaded Node 2023-03-27 00:00:16 -04:00
Max Brunsfeld dcc9d282ec Notify language servers of FS changes 2023-03-21 11:26:13 -07:00
Antonio Scandurra fb8351563a Introduce a new TryFutureExt::unwrap method 2023-03-10 11:41:13 +01:00
Max Brunsfeld e0c9010104 Add setting for removing trailing whitespace on save 2023-02-28 21:52:00 -08:00
Antonio ScandurraandPetros Amoiridis fb600b950c 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 01c5809925 Add lua syntax highlighting and lsp support 2023-02-05 23:21:29 -08:00
Antonio ScandurraandNathan Sobo 1ecb8e7b2b 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 e2e3a266a5 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
ForLoveOfCatsandMikayla fbea44bc5c One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
ForLoveOfCats ef6efc9590 Add "go to type definition" action 2022-07-29 11:41:08 -04:00
Isaac Clayton 69b1324a93 Further unpropogate async 2022-07-07 16:16:58 +02:00
Isaac Clayton f3b8e93a8a Start switching JSON LSP adapter to plugin (take 2) 2022-07-07 15:16:59 +02:00
Keith Simmons c5e9c15115 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 d6fdc079a9 Prevent creating extra language server instances if there already exists one for that workspace 2022-06-30 16:46:26 -07:00
Antonio Scandurra 7787ac3b6c 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 7aeaeafd8d Integrate pyright language server 2022-06-22 16:58:19 -07:00
Max BrunsfeldandAntonio Scandurra c47abf1d47 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 2a50811651 Syntax highlighting working. Getting started on markdown support 2022-06-07 11:54:33 -07:00
Max BrunsfeldandNathan 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 SoboandAntonio 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 BrunsfeldandAntonio 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 BrunsfeldandKeith 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 SimmonsandMax 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