aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/lib.rs
Commit message (Collapse)AuthorAge
* allow specifying environment for language servers in language.toml (#4004)TotalKrill2022-12-09
| | | | | Signed-off-by: Stephen Wakely <fungus.humungus@gmail.com> Co-authored-by: Stephen Wakely <fungus.humungus@gmail.com> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Apply completion edits to all cursors (#4496)Michael Davis2022-12-06
| | | | | | | | Completion edits - either basic `insert_text` strings or structured `text_edit`s - are assumed by the LSP spec to apply to the current cursor (or at least the trigger point). We can use the range (if any) and text given by the Language Server to create a transaction that changes all ranges in the current selection though, allowing auto- complete to affect multiple cursors.
* feat(lsp): add support for lsp Diagnostic{}.data (#4935)sigmaSd2022-12-02
|
* Handle language server termination (#4797)Michael Davis2022-11-19
| | | | | | | | | | | | | This change handles a language server exiting. This was a UX sore-spot: if a language server crashed, Helix did not recognize the exit and continued to send requests to it. All requests would timeout since they would not receive responses. This would also hold-up Helix closing itself down since it would try to gracefully shutdown the server which is implemented in the LSP spec as a request. We could attempt to automatically restart the language server on crash. I left this for future work since that change will need to be slightly complicated: it will need to cover the case of a language server repeatedly crashing.
* Find workspace from document path (#3553)ath32022-10-03
|
* [lsp-restart]: call the force_shutdown method for the old_client (#3972)Alexis Kalabura2022-10-03
| | | | | | | * [lsp-restart]: call the shutdown_and_exit method for the old_client * change shutdown_and_exit to force_shutdown * remove extra log
* diff full-doc LSP edits (#4041)Kirawi2022-10-02
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* add :lsp-restart command (#3435)Filipe Azevedo2022-09-20
|
* diagnostics: Use Vec<Tag> instead of Option<Vec<Tag>>Blaž Hrastnik2022-09-20
|
* Track source and tags in diagnostics (#3898)Luke Cycon2022-09-20
|
* Remove LspNotDefined, instead return an Option<>Blaž Hrastnik2022-09-07
|
* lsp: Don't log "LSP not defined" errors in the logfileBlaž Hrastnik2022-09-03
|
* Change default formatter for any language (#2942)PiergiorgioZagaria2022-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change default formatter for any language * Fix clippy error * Close stdin for Stdio formatters * Better indentation and pattern matching * Return Result<Option<...>> for fn format instead of Option * Remove unwrap for stdin * Handle FormatterErrors instead of Result<Option<...>> * Use Transaction instead of LspFormatting * Use Transaction directly in Document::format * Perform stdin type formatting asynchronously * Rename formatter.type values to kebab-case * Debug format for displaying io::ErrorKind (msrv fix) * Solve conflict? * Use only stdio type formatters * Remove FormatterType enum * Remove old comment * Check if the formatter exited correctly * Add formatter configuration to the book * Avoid allocations when writing to stdin and formatting errors * Remove unused import Co-authored-by: Gokul Soumya <gokulps15@gmail.com>
* Suport diagnostic code (#3096)Erasin2022-07-26
| | | | | | | * add code for diagnostic. This PR provides a solution to resolve #2994. missing Code Actions for lsp * remote unused import
* embed jsonrpc types from jsonrpc-core crate (#2801)Michael Davis2022-06-18
| | | | | | | | | | | | | | We should not depend on jsonrpc-core anymore: * The project just announced it's no longer actively maintained[^1], preferring their new implementation in `jsonrpsee`. * The types are too strict: we would benefit from removing some `#[serde(deny_unknown_fields)]` annotations to allow language servers that disrespect the spec[^2]. * We don't use much of the project. Just the types out of core. These are easy to embed directly into the `helix-lsp` crate. [^1]: https://github.com/paritytech/jsonrpc/pull/674 [^2]: https://github.com/helix-editor/helix/issues/2786
* fix: lsp: Sort edits by start range, Omnisharp sends them in reverseBlaž Hrastnik2022-06-02
|
* Don't panic on LSP parsing errorsBlaž Hrastnik2022-05-11
| | | | | | This made sense initially when the implementation was still new (so we got user reports more frequently), but a parsing error now generally signifies a language server isn't properly implementing the spec.
* configurable lsp request timeout (#2405)EmmChriss2022-05-11
|
* fix typos (#2304)chunghha2022-04-27
|
* prevent panic when receiving malformed LSP PublishDiagnostic (#2160)Michael Davis2022-04-18
| | | | | | | | | | | Instead of panicing we can discard the malformed diagnostic. This `.parse()` fails commonly when a non-conformant language server gives a diagnostic with a location that breaks the spec: { "character": 0, "line": -1 } can currently be returned by ElixirLS and the python LS. Other messages in this block are discarded but this one feels special enough to log.
* Send active diagnostics to LSP when requesting code actions. (#2005)Robin Jadoul2022-04-17
| | | | | | | | | | | * Send active diagnostics to LSP when requesting code actions. This allows for e.g. clangd to properly send the quickfix code actions corresponding to those diagnostics as options. The LSP spec v3.16.0 introduced an opaque `data` member that would allow the server to persist arbitrary data between the diagnostic and the code actions request, but this is not supported yet by this commit. * Reuse existing range_to_lsp_range functionality
* lsp: Implement support for workspace_folders (currently just one)Blaž Hrastnik2022-04-01
| | | | Refs #1898
* Implement LSP `workspace/configuration` and ↵Triton1712022-02-28
| | | | | | | | | | | | | `workspace/didChangeConfiguration` (#1684) * Implement LSP `workspace/configuration` request * Implement LSP `workspace/didChangeConfiguration` notification. * Simplify retrieval of LSP configuration * Implement suggestions from PR discussion Co-authored-by: Triton171 <triton0171@gmail.com>
* Optimize lsp_pos_to_pos (#1423)Kirawi2022-01-03
| | | lines().count() is slow compared to len_lines()
* Detect workspace root using language markers (#1370)Alexis Mousset2021-12-31
| | | | | | | | | | | | | | | | * Detect workspace root using language markers * Avoid allocating root_markers * Update helix-core/src/lib.rs Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> * Update helix-core/src/lib.rs Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com> Co-authored-by: Blaž Hrastnik <blaz@mxxn.io> Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com>
* LSP code action commands (#1304)Matouš Dzivjak2021-12-21
| | | | | | | | | * feat(lsp): codeAction commands * Don't block on command call * Fix lifetime of command execution * Fix lint issues
* lsp: Don't panic if init failsBlaž Hrastnik2021-12-03
| | | | | | We correctly filter out the language server inside Document to ignore it if the capabilities are missing, so this way it'll simply ignore the errored out LSP rather than panicking.
* Allow `language.config` (in languages.toml) to be passed in as a toml object ↵Midnight Exigent2021-10-08
| | | | | | | | | | | | | (#807) * allow language.config (in languages.toml) to be passed in as a toml object * Change config field for languages from json string to toml object * remove indents on languages.toml config * fix: remove patch version from serde_json import in helix-core * Use same tree-sitter-zig as upstream/master
* log errors produced when trying to initialize the LSP (#746)Kirawi2021-09-15
|
* lsp: Don't send notifications until initialize completesBlaž Hrastnik2021-09-06
| | | | Then send open events for all documents with the LSP attached.
* lsp: Outdated commentBlaž Hrastnik2021-09-06
|
* lsp: Delay requests & notifications until initialization is completeBlaž Hrastnik2021-09-06
|
* lsp: Refactor capabilities as an async OnceCellBlaž Hrastnik2021-09-06
| | | | First step in making LSP init asynchronous
* Added option to provide a custom config file to the lsp. (#460)Cor Peters2021-07-18
| | | | | | | | | | | | | | | | | * Added option to provide a custom config file to the lsp. * Simplified lsp loading routine with anyhow * Moved config to language.toml * Fixed test case * Cargo fmt * Revert now-useless changes * Renamed custom_config to config Co-authored-by: Cor <prive@corpeters.nl>
* Make formatting happen asynchronously.Joe Neeman2021-06-30
|
* Address nightly clippy warningsBlaž Hrastnik2021-06-27
|
* Add progress spinners to status linewojciechkepka2021-06-21
|
* Handle language server shutdown with timeoutwojciechkepka2021-06-19
|
* Add unique id to each lsp client/server pairwojciechkepka2021-06-18
|
* Add `MethodCall`, `ProgressStatus`, `LspProgressMap`wojciechkepka2021-06-18
|
* add symbol picker (#230)Robin2021-06-12
| | | | | | | | | * add symbol picker use the lsp document_symbol request * fix errors from merging in master * add docs for symbol picker
* lsp: Check bounds when converting lsp positions (#204)Wojciech Kępka2021-06-12
| | | | | | | | | * lsp: Make position conversion funcs return `Option` * Add tests * Fixes * Revert pos_to_lsp_pos to panic
* lsp: Display LSP progress messages (#216)Wojciech Kępka2021-06-11
|
* Derive debug without featureIvan Tham2021-06-10
| | | | Note that this also removed those `finish_non_exhaustive()`.
* Implement Debug for data structure as a featurenotoria2021-06-10
|
* helix-lsp cleanupEgor Karavaev2021-06-08
|
* Don't panic on LSP not startingEgor Karavaev2021-06-08
|
* Remove select_all implementationEgor Karavaev2021-06-04
|
* Add :fmt (formats the whole file).Blaž Hrastnik2021-05-12
|
* LintBlaž Hrastnik2021-05-09
|