Commit Graph
83 Commits
Author SHA1 Message Date
Max Brunsfeld 03d7035630 Avoid spurious highlight runs in Language::highlight_text 2022-04-22 13:13:54 -07:00
Max Brunsfeld f52050a9ec Use the 'jsonc' language id for all JSON files
This way, comments are allowed by the language server.
2022-04-21 12:08:16 -07:00
Keith Simmons 3e40b5bead dynamically inject theme names and language properties into schema 2022-04-07 18:15:02 -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
Keith SimmonsandMax Brunsfeld 564225c401 Provide diagnostic context to codeAction
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-31 15:39:52 -07:00
Max BrunsfeldandKeith Simmons cf9efd7005 Improve installation of npm-based language servers
* Use --prefix flag to guarantee that they are installed in .zed
* Use the @latest tag when available
* Extract helper functions

Co-authored-by: Keith Simmons <keith@zed.dev>
2022-03-30 16:48:59 -07:00
Max Brunsfeld 4805cfe48c Merge branch 'main' into typescript 2022-03-30 14:44:07 -07:00
Max Brunsfeld 3b4cab9094 Move all configuration of individual LSP servers to LspAdapter 2022-03-29 18:14:30 -07:00
Max Brunsfeld ebc711f9f5 Restructure fake language server setup
Replace FakeLanguageServerConfig with FakeLanguageServerAdapter
2022-03-29 17:55:57 -07:00
Keith Simmons 6d91fd078c Add restart-lsp keybinding 2022-03-29 17:24:23 -07:00
Max Brunsfeld 158d987965 Start work on allowing language servers to support multiple languages 2022-03-29 16:57:18 -07:00
Keith SimmonsandMax Brunsfeld 0e1d371a67 Add typescript language server
Currently not tested for tsx files

Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-29 13:42:21 -07:00
Max Brunsfeld a8600e76a3 Make language's language server config non-optional 2022-03-28 18:14:49 -07:00
Max Brunsfeld 4d456d3847 Remove duplication in build_language_registry 2022-03-28 18:01:29 -07:00
Max Brunsfeld 325e6c31ae Autoclose brackets before a language-specific set of characters
Fixes #588
2022-03-14 15:17:40 -07:00
Max Brunsfeld b33a049958 Merge branch 'main' into settings-file 2022-03-13 10:43:23 -07:00
Max Brunsfeld 20fed599b2 Start work on relaying settings to language servers 2022-03-11 17:36:27 -08:00
Max Brunsfeld 7a68b2d371 Provide JSON language server with settings schema 2022-03-11 11:46:22 -08:00
Nathan Sobo ac1eb19f83 Start on text highlight support 2022-03-09 20:51:35 -07:00
Antonio Scandurra 7546ede288 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 4cb4b99c56 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
5cc5fa2f93 Populate environment from shell
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 16:39:50 -08:00
Max Brunsfeld 19658139b1 Avoid infinite loop when a language server fails to start 2022-03-03 18:13:38 -08:00
Max Brunsfeld 78d96a05fc Make fake language servers have full capabilities 2022-03-03 15:42:29 -08:00
Max BrunsfeldandNathan Sobo 9999862016 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 BrunsfeldandNathan Sobo 0582c557e3 Add JSON language server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 13:29:25 -08:00
Antonio Scandurra 9e173564e9 Pass an AsyncAppContext to fake language server request handlers 2022-02-23 16:14:36 +01:00
64098247cb Allow languages to be registered at any time
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-22 10:35:20 -08:00
Antonio ScandurraandNathan Sobo fad335b2ba Don't serialize the full LSP symbol when collaborating
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 18:08:43 +01:00
Antonio Scandurra 8a8ae0fbcd Rename CompletionLabel to CodeLabel and add Project::symbols
This only works locally for now and we haven't implemented the
`RustLsp::label_for_symbol` method yet.
2022-02-22 10:01:08 +01:00
Nathan Sobo 99594333a5 Log an error instead of panicking when there's no LSP download dir 2022-02-21 17:44:00 -07:00
Max BrunsfeldandNathan Sobo 03ec6e11b7 Assign language server download directory on startup
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 16:23:38 -08:00
Max BrunsfeldandNathan Sobo 79910ba931 Show more information in lsp status bar item
* Distinguish between checking for updates and downloading
* Show dismissable error message when downloading failed and there
  is no cached server.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 16:11:51 -08:00
Max BrunsfeldandNathan Sobo ededfff3a8 Download language servers on-demand
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 13:54:52 -08:00
Antonio ScandurraandNathan Sobo aee479d615 Show message indicating when we're downloading language servers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 17:25:52 +01:00
Antonio Scandurra 793d9e8bba Download rust-analyzer from GitHub 2022-02-21 16:15:54 +01:00
Antonio Scandurra fafe521e9f Introduce LspPostProcessor::download_language_server 2022-02-21 09:46:18 +01:00
Antonio Scandurra 1ca50d0134 Make language server initialization asynchronous 2022-02-21 09:39:28 +01:00
Antonio Scandurra b8523509da Revert "WIP: avoid code-signing rust-analyzer to prevent proc macro errors"
This reverts commit fc3bccc1a1.
2022-02-21 08:13:05 +01:00
Antonio Scandurra fc3bccc1a1 WIP: avoid code-signing rust-analyzer to prevent proc macro errors
If this works, I think we should set the permissions asynchronously,
maybe as part of starting the language server, so that we avoid doing
synchronous I/O.
2022-02-20 12:14:43 +01:00
Antonio Scandurra 30e4ea1a4c Fix warnings 2022-02-17 17:26:03 +01:00
Max BrunsfeldandNathan Sobo 41ba980c9b 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 BrunsfeldandNathan Sobo c4dff12d69 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 8b1fb9a2cc Fix unused import warnings 2022-02-08 16:27:33 -08:00
Max BrunsfeldandNathan Sobo 6731d92f60 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 BrunsfeldandNathan Sobo 4900019e9b Add a ToPointUtf16 trait in text and multibuffer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-04 17:35:37 -08:00
Max Brunsfeld 3dfff3866a Add integration test for getting and resolving completions 2022-02-03 15:24:16 -08:00
Antonio Scandurra d246a39b57 Syntax highlight even when the label doesn't contain a detail 2022-02-03 09:57:04 +01:00
Max Brunsfeld 439d12cb85 Start work on syntax highlighting completions 2022-02-02 18:14:30 -08:00
Max Brunsfeld bbdf62f263 Introduce Language::highlight_text method 2022-02-02 17:01:48 -08:00