aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp
Commit message (Collapse)AuthorAge
* Support LSP diagnostic tags (#9780)Michael Davis2024-03-02
|
* Use a hook for resolving completion itemsMichael Davis2024-02-23
| | | | | | Previously we used the IdleTimeout event to trigger LSP `completion/resolveItem` requests. We can now refactor this to use an event system hook instead and lower the timeout.
* fix lsp config reload (#9415)kyfanc2024-02-13
| | | | | | | | `syn_loader` was replaced rather than interior value being replace, old value was still being referenced and not updated after `:config-refresh`. By using `ArcSwap` like for `config`, each `.load()` call will return the most updated value. Co-authored-by: kyfan <kyfan@email>
* Add required-root-patterns for situational lsp activation (#8696)ontley2024-02-12
| | | | | | | | | | | | | | | | | | | * Added required-root-patterns for situational lsp activation using globbing * Replaced filter_map with flatten * updated book to include required-root-patterns option * fixed wrong function name for path * Added globset to helix-core. Moved globset building to config parsing. * Normalize implements AsRef * cargo fmt * Revert "cargo fmt" This reverts commit ca8ce123e8d77d2ae8ed84d5273a9b554101b0db.
* build(deps): bump tokio from 1.35.1 to 1.36.0 (#9540)dependabot[bot]2024-02-12
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.35.1 to 1.36.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.35.1...tokio-1.36.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* make path changes LSP spec conform (#8949)Pascal Kuthe2024-01-28
| | | | | | | | | | | | | | | | | Currently, helix implements operations which change the paths of files incorrectly and inconsistently. This PR ensures that we do the following whenever a buffer is renamed (`:move` and workspace edits) * always send did_open/did_close notifications * send will_rename/did_rename requests correctly * send them to all LSP servers not just those that are active for a buffer * also send these requests for paths that are not yet open in a buffer (if triggered from workspace edit). * only send these if the server registered interests in the path * autodetect language, indent, line ending, .. This PR also centralizes the infrastructure for path setting and therefore `:w <path>` benefits from similar fixed (but without didRename)
* Improve error handling for `which::which` failuresMichael Davis2024-01-24
| | | | Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
* Re-export `which` from `helix-stdx::env`Michael Davis2024-01-24
| | | | | | | | | | We use `which::which` in many crates, so `which` was a separate dependency across all of them. We can centralize `which` into the stdx crate so it's easy for all crates to depend on it. I also moved the rest of `helix-view/src/env.rs` into helix-stdx's `env` module since it only contained a thin wrapper around `which` and `std::env`.
* refactor completion and signature help using hooksPascal Kuthe2024-01-23
|
* Create helix-stdx crate for stdlib extensionsMichael Davis2024-01-18
| | | | | | | | | | | | | helix-stdx is meant to carry extensions to the stdlib or low-level dependencies that are useful in all other crates. This commit starts with all of the path functions from helix-core and the CWD tracking that lived in helix-loader. The CWD tracking in helix-loader was previously unable to call the canonicalization functions in helix-core. Switching to our custom canonicalization code should make no noticeable difference though since `std::env::current_dir` returns a canonicalized path with symlinks resolved (at least on unix).
* feat(lsp): implement show document request (#8865)Matouš Dzivjak2024-01-17
| | | | | | | | | | | | | | | | | | | | | | * feat(lsp): implement show document request Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument) LSP server-sent request. This PR builds on top of helix-editor#5820, moves the external-URL opening functionality into shared crate-level function that returns a callback that is now used by both the `open_file` command as well as the window.showDocument handler if the URL is marked as external. * add return * use vertical split * refactor --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Exit a language server if it sends a message with invalid json (#9332)Ben Dennis2024-01-17
| | | | | | | | | | | | | | | | | | | | | | | * Keep lsp event listener thread alive when malformed json is encountered from the lsp server * Update unexpected error flow in recv() to close outstanding requests and close the language server * Log malformed notifications as info instead of error * Make close_language_server a nested function inside recv, similar to what's done in send * Update malformed notification log text * Clean up new log text a bit * Initialize recv_buffer closer to where it's used * Use "exit" instead of "close" * Remove whitespace * Remove the need for a helper method to exit the language server * Match on Unhandled error explicitly and keep catch-all error case around
* Avoid crashing with 2 instances of the same LSP (#9134)Gabriel Lopes Rodrigues2024-01-02
|
* build(deps): bump lsp-types from 0.94.1 to 0.95.0 (#9117)dependabot[bot]2023-12-19
| | | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* when text document sync capability is only kind send didSave without text ↵Gabriel Dinner-David2023-12-17
| | | | | (#9101) see https://github.com/microsoft/language-server-protocol/issues/288 for details
* build(deps): bump tokio from 1.34.0 to 1.35.0 (#9057)dependabot[bot]2023-12-12
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* use workspace inheritance for common version (#8925)Skyler Hawthorne2023-12-05
|
* build(deps): bump globset from 0.4.13 to 0.4.14 (#8926)dependabot[bot]2023-11-28
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* set Cargo feature resolver to v2 (#8917)Fomalhaut Weisszwerg2023-11-27
| | | | | | | | | | | | | | | | | | | * fix: version of Cargo feature resolver. This commit solve the ambiguity to determin the version of resolver. To get more detail, see the following two documents: - https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions - https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html * unified: Rust edition in all workspaces. Now, the Rust 2021 is available in all workspaces. * fined up: Cargo.toml by using workspace inheritance. To get more detail of the `workspace.package` table, see a following document: - https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table
* update which crate to 5.0.0 (#8902)Davide Ferrero2023-11-25
| | | | | * update which crate to 5.0.0 * update which crate to 5.0.0
* build(deps): bump tokio from 1.33.0 to 1.34.0 (#8811)dependabot[bot]2023-11-14
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add command to move files with LSP support (#8584)Yomain2023-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added rename command * Added an error if the new path already exists * Fixed wrong command name being used * fixed clippy suggestions * removed didRenameFiles call, fixed early return due to path Err * added ':rnm' alias to ':rename' * code cleanup * formatting * removed debug line * cargo fmt * Improved new buffer error message Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Removed unnecessary path normalizing Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * Update helix-term/src/commands/typed.rs Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de> * feat: change `rename` command to `move` * feat: add multi lsp support when moving files * feat: allow lsp calls with a custom timeout * feat: sending lsp file_changed event once file has moved --------- Co-authored-by: ontley <theontley@gmail.com> Co-authored-by: ontley <67148677+ontley@users.noreply.github.com> Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* build(deps): bump tokio from 1.32.0 to 1.33.0 (#8501)dependabot[bot]2023-10-10
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* LSP: Fix codeAction/resolve server capability check (#8421)Michael Davis2023-10-02
| | | | Previously we accidentally checked the server's _completion_ resolve capability rather than the code action resolve capability.
* fix multicursor snippet placeholder directions (#8423)Pascal Kuthe2023-09-30
|
* Filter out language servers which fail to spawn (#8374)woojiq2023-09-26
|
* build(deps): bump tokio from 1.31.0 to 1.32.0 (#8105)dependabot[bot]2023-08-29
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.31.0 to 1.32.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.31.0...tokio-1.32.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump tokio from 1.29.1 to 1.31.0 (#7944)dependabot[bot]2023-08-15
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.29.1 to 1.31.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...tokio-1.31.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump globset from 0.4.12 to 0.4.13 (#7864)dependabot[bot]2023-08-08
| | | | | | | | | | | | | | | | Bumps [globset](https://github.com/BurntSushi/ripgrep) from 0.4.12 to 0.4.13. - [Release notes](https://github.com/BurntSushi/ripgrep/releases) - [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md) - [Commits](https://github.com/BurntSushi/ripgrep/compare/globset-0.4.12...globset-0.4.13) --- updated-dependencies: - dependency-name: globset dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump globset from 0.4.11 to 0.4.12 (#7795)dependabot[bot]2023-08-01
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Reformat with nightly rustfmt for better let-else formatting (#7721)Philipp Mildenberger2023-07-27
|
* Drop mut from variable to silence linter (#7704)Jonas Tepe2023-07-22
|
* Add support for LSP DidChangeWatchedFiles (#7665)Ryan Fowler2023-07-21
| | | | | | | | | | | | | | | | | | | * Add initial support for LSP DidChangeWatchedFiles * Move file event Handler to helix-lsp * Simplify file event handling * Refactor file event handling * Block on future within LSP file event handler * Fully qualify uses of the file_event::Handler type * Rename ops field to options * Revert newline removal from helix-view/Cargo.toml * Ensure file event Handler is cleaned up when lsp client is shutdown
* feat: resolve code action (#7677)sigmaSd2023-07-21
|
* Fix crash when cwd is deleted (#7185)Yomain2023-07-11
|
* build(deps): bump tokio from 1.28.2 to 1.29.1 (#7528)dependabot[bot]2023-07-04
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* LSP: Forcefully shutdown uninitialized servers (#7449)Michael Davis2023-06-29
| | | | | | | | | | | | | | | | | | The LSP spec has this to say about initialize: > Until the server has responded to the `initialize` request with an > `InitializeResult`, the client must not send any additional requests > or notifications to the server. (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize) The spec is not really explicit about how to handle this scenario. Before a client sends the 'initialize' request we are allowed to send an 'exit' notification, but after 'initialize' we can't send any requests (like shutdown) or notifications (like exit). So my intepretation is that we should forcefully close the server in this state. This matches the behavior of Neovim's built-in LSP client: https://github.com/neovim/neovim/blob/5ceb2238d3685255cd517ca87fd7edae9ed88811/runtime/lua/vim/lsp.lua#L1610-L1628
* map positions through changes in O(N)Pascal Kuthe2023-06-25
|
* Rebase cleanup/fixes and use lsp::CompletionItem in item_to_transaction directlyPhilipp Mildenberger2023-05-18
|
* Remove TODO comment in helix_lsp::Registry::restart and add doc-comment on ↵Philipp Mildenberger2023-05-18
| | | | top of function instead
* Reorder id generation for Clients to stay close to the old behaviorPhilipp Mildenberger2023-05-18
|
* Reduce boilerplate by 'use lsp::*' in Client::supports_feature, and remove ↵Philipp Mildenberger2023-05-18
| | | | TODO comment
* Fix lsp_restart across multiple different document scopes (language servers ↵Philipp Mildenberger2023-05-18
| | | | weren't restarted, if not of the same scope id), and fix some smaller rebase issues
* Filter language servers also by capabilities in ↵Philipp Mildenberger2023-05-18
| | | | | | | | | `doc.language_servers_with_feature` * Add `helix_lsp::client::Client::supports_feature(&self, LanguageServerFeature)` * Extend `doc.language_servers_with_feature` to use this method as filter as well * Add macro `language_server_with_feature!` to reduce boilerplate for non-mergeable language server requests (like goto-definition) * Refactored most of the `find_map` code to use the either the macro or filter directly via `doc.language_servers_with_feature`
* Refactor doc language servers to a HashMap, and the config to use a Vec to ↵Philipp Mildenberger2023-05-18
| | | | retain order
* Refactored doc.language_servers and doc.language_servers_with_feature to ↵Philipp Mildenberger2023-05-18
| | | | | | return an iterator and refactor LanguageServerFeature handling to a HashMap (language server name maps to features) Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
* str instead of StringPhilipp Mildenberger2023-05-18
|
* Adds support for multiple language servers per language.Philipp Mildenberger2023-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Language Servers are now configured in a separate table in `languages.toml`: ```toml [langauge-server.mylang-lsp] command = "mylang-lsp" args = ["--stdio"] config = { provideFormatter = true } [language-server.efm-lsp-prettier] command = "efm-langserver" [language-server.efm-lsp-prettier.config] documentFormatting = true languages = { typescript = [ { formatCommand ="prettier --stdin-filepath ${INPUT}", formatStdin = true } ] } ``` The language server for a language is configured like this (`typescript-language-server` is configured by default): ```toml [[language]] name = "typescript" language-servers = [ { name = "efm-lsp-prettier", only-features = [ "format" ] }, "typescript-language-server" ] ``` or equivalent: ```toml [[language]] name = "typescript" language-servers = [ { name = "typescript-language-server", except-features = [ "format" ] }, "efm-lsp-prettier" ] ``` Each requested LSP feature is priorized in the order of the `language-servers` array. For example the first `goto-definition` supported language server (in this case `typescript-language-server`) will be taken for the relevant LSP request (command `goto_definition`). If no `except-features` or `only-features` is given all features for the language server are enabled, as long as the language server supports these. If it doesn't the next language server which supports the feature is tried. The list of supported features are: - `format` - `goto-definition` - `goto-declaration` - `goto-type-definition` - `goto-reference` - `goto-implementation` - `signature-help` - `hover` - `document-highlight` - `completion` - `code-action` - `workspace-command` - `document-symbols` - `workspace-symbols` - `diagnostics` - `rename-symbol` - `inlay-hints` Another side-effect/difference that comes with this PR, is that only one language server instance is started if different languages use the same language server.
* build(deps): bump tokio from 1.27.0 to 1.28.0 (#6935)dependabot[bot]2023-05-02
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.27.0 to 1.28.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.27.0...tokio-1.28.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump tokio-stream from 0.1.12 to 0.1.14 (#6934)dependabot[bot]2023-05-02
| | | | | | | | | | | | | | | | Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.12 to 0.1.14. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Changelog](https://github.com/tokio-rs/tokio/blob/tokio-0.1.14/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.12...tokio-0.1.14) --- updated-dependencies: - dependency-name: tokio-stream dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>