aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp
Commit message (Collapse)AuthorAge
* add option to enable/disable lsp snippetsPascal Kuthe2023-03-31
|
* Prefer utf-8 over utf-32Pascal Kuthe2023-03-31
| | | | | | | | Utf-8 support has been around for a while as an unstable feature but utf-32 is fairly new. A bunch of LS (like rust-analyzer) added this in a pinch, but it's pretty broken right now. The performance overhead is not very large (still a lot better than utf-16). We can switch back once the ecosystem has matured.
* implement proper lsp-workspace supportPascal Kuthe2023-03-29
| | | | | | fix typo Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
* add workspace config and manual LSP root managementPascal Kuthe2023-03-29
| | | | | | | | | | fixup documentation Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> fixup typo Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
* build(deps): bump tokio from 1.26.0 to 1.27.0 (#6461)dependabot[bot]2023-03-28
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.26.0...tokio-1.27.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>
* detailed snippet testsPascal Kuthe2023-03-22
|
* accept bracket snippet variables without defaultPascal Kuthe2023-03-22
|
* accept empty snippet regex replace elementsPascal Kuthe2023-03-22
|
* fix single-char variable namesPascal Kuthe2023-03-22
|
* do not fail snippet parsing when control chars are not explicitly escapedPascal Kuthe2023-03-22
|
* fix typoPascal Kuthe2023-03-16
| | | Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* allow empty placeholdersPascal Kuthe2023-03-16
|
* revamped snippet text element parsingPascal Kuthe2023-03-16
| | | | | | | | | | | | | | Snippet text elements can contain escape sequences that must be treated properly. Furthermore snippets must always escape certain characters (like `}` or `\`). The function has been updated to account for that. `text` is now also included with `anything` to match the grammar and can also match empty text. To avoid infinite loops the `non-empty` combinator has been added which is automatically used in the `one_or_more` and `zero_or more` combinator where the problemn would occur.
* always parse the entire snippetPascal Kuthe2023-03-16
| | | | | | Previously any remaining text of the snippet that could not be parsed was ignored. This commit adds the `parse_all` function which reports an error if any text was not consumed by the parser
* set WorkspaceEditCapabilities correctlyPascal Kuthe2023-03-16
|
* discard outdated diagnostics recived by the LSPascal Kuthe2023-03-16
|
* Check language server symbol renaming support before prompting (#6257)misiasty32023-03-13
| | | Co-authored-by: Poliorcetics <poliorcetics@users.noreply.github.com>
* LSP: No-op client/registerCapability requests (#6258)Michael Davis2023-03-13
|
* indent snippets to line indent instead of completion start (#6263)Pascal Kuthe2023-03-11
|
* Feat: LSP Type Hints (#5934)Poliorcetics2023-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * misc: missing inline, outdated link * doc: Add new theme keys and config option to book * fix: don't panic in Tree::try_get(view_id) Necessary for later, where we could be receiving an LSP response for a closed window, in which case we don't want to crash while checking for its existence * fix: reset idle timer on all mouse events * refacto: Introduce Overlay::new and InlineAnnotation::new * refacto: extract make_job_callback from Context::callback * feat: add LSP display_inlay_hint option to config * feat: communicate inlay hints support capabilities of helix to LSP server * feat: Add function to request range of inlay hint from LSP * feat: Save inlay hints in document, per view * feat: Update inlay hints on document changes * feat: Compute inlay hints on idle timeout * nit: Add todo's about inlay hints for later * fix: compute text annotations for current view in view.rs, not document.rs * doc: Improve Document::text_annotations() description * nit: getters don't use 'get_' in front * fix: Drop inlay hints annotations on config refresh if necessary * fix: padding theming for LSP inlay hints * fix: tracking of outdated inlay hints should not be dependant on document revision (because of undos and such) * fix: follow LSP spec and don't highlight padding as virtual text * config: add some LSP inlay hint configs
* treat replace/insertmode consistently, default to insertPascal Kuthe2023-03-10
|
* fix snippet bugs and multicursor completion edgecasesPascal Kuthe2023-03-10
| | | | | | | | | | | | | | | | Multicursor completions may overlap and therefore overlapping completions must be dropped to avoid crashes. Furthermore, multicursor edits might simply be out of range if the word before/after the cursor is shorter. This currently leads to crashes, instead these selections are now also removed for completions. This commit also significantly refactors snippet transaction generation so that tabstops behave correctly with the above rules. Furthermore, snippet tabstops need to be carefully mapped to ensure their position is correct and consistent with our selection semantics. Finally, we now keep a partially updated Rope while creating snippet transactions so that we can fill information into snippets that depends on the position in the document.
* avoid allocations during snippet renderingPascal Kuthe2023-03-10
|
* LSP: Support textDocument/prepareRename (#6103)Kyle Smith2023-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * LSP: Support textDocument/prepareRename 'textDocument/prepareRename' can be used by the client to ask the server the range of the symbol under the cursor which would be changed by a subsequent call to 'textDocument/rename' with that position. We can use this information to fill the prompt with an accurate prefill which can improve the UX for renaming symbols when the symbol doesn't align with the "word" textobject. (We currently use the "word" textobject as a default value for the prompt.) Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * clippy fixes * rustfmt * Update helix-term/src/commands/lsp.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Update helix-term/src/commands/lsp.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * fix clippy from suggestions * Update helix-term/src/commands/lsp.rs Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Handle snippets for LSPs not providing offsets for completionAndrii Grynenko2023-03-08
|
* Add nested placeholder parsing for LSP snippetsAndrii Grynenko2023-03-08
| | | | | And fix `text` over-parsing, inspired by https://github.com/neovim/neovim/blob/d18f8d5c2d82b209093b2feaa8921a4792b71d59/runtime/lua/vim/lsp/_snippet.lua
* Render every LSP snippets for every cursorAndrii Grynenko2023-03-08
| | | | | | | This refactors the snippet logic to be largely unaware of the rest of the document. The completion application logic is moved into generate_transaction_from_snippet which is extended to support dynamically computing replacement text.
* Correctly handle multiple cursors with LSP snippetsUrgau2023-03-08
|
* Delete snippet placeholders when accepting completionPascal Kuthe2023-03-08
| | | | | | | When accepting a snippet completion we automatically delete the placeholders for now as doing so manual is quite cumbersome. In the future we should keep these as a mark + virtual text that is automatically removed once the cursor moves there.
* Implement LSP snippet tabstops sorting and mergingUrgau2023-03-08
|
* LSP: Advertise snippet supportMichael Davis2023-03-08
|
* Apply snippets as transactionsMichael Davis2023-03-08
|
* Optimize LSP snippet parsingUrgau2023-03-08
|
* Add parser for LSP snippetMichael Davis2023-03-08
|
* Allow LSP server to be stopped (#5964)Davide Galassi2023-03-08
|
* build(deps): bump tokio from 1.25.0 to 1.26.0 (#6212)dependabot[bot]2023-03-07
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.25.0...tokio-1.26.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.11 to 0.1.12 (#6071)dependabot[bot]2023-02-21
| | | | | | | | | | | | | | | Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.11 to 0.1.12. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.11...tokio-stream-0.1.12) --- 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>
* LSP: Add request ID to request timeout message (#6010)Michael Davis2023-02-16
| | | | This improves error logging for requests - without the ID it's hard to know which request is the one that timed out.
* build(deps): bump tokio from 1.24.2 to 1.25.0 (#5974)dependabot[bot]2023-02-14
| | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.24.2 to 1.25.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/commits/tokio-1.25.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>
* feat(ui): deprecated completions (#5932)Matouš Dzivjak2023-02-13
| | | | | | | | | | | | | | | | | | * feat(ui): deprecated completions Mark deprecated completions using strike-through (CROSSED_OUT modifier). The deprection information is taken either from the `deprecated` field of the completion item or from the completion tags. The field seems to be the older way of passing the deprecated information and it was already marked as deprecated for Symbol. In completion item the field is still valid but it seems that the LSP is moving in the general direction of using tags for this kind of information and as such relying on tags as well seems reasonable and future-proof.
* Negotiate LSP Position Encoding (#5894)Pascal Kuthe2023-02-11
| | | | | | | So far LSP always required that `PositionEncoding.characters` is an UTF-16 offset. Now that LSP 3.17 is available in `lsp-types` request the server to send char offsets (UTF-32) or byte offsets (UTF-8) instead. For compatability with old servers, UTF-16 remains as the fallback as required by the standard.
* Fix new clippy lints (#5892)Pascal Kuthe2023-02-09
|
* properly handle LSP position encoding (#5711)Pascal Kuthe2023-02-09
| | | | | | | | | | | | | * properly handle LSP position encoding * add debug assertion to Transaction::change * Apply suggestions from code review Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Support goto-declaration LSP command (#5646)Ole Krüger2023-01-31
|
* build(deps): bump which from 4.3.0 to 4.4.0 (#5655)dependabot[bot]2023-01-23
| | | | | | | | | | | | | | | | | Bumps [which](https://github.com/harryfei/which-rs) from 4.3.0 to 4.4.0. - [Release notes](https://github.com/harryfei/which-rs/releases) - [Commits](https://github.com/harryfei/which-rs/compare/4.3.0...4.4.0) --- updated-dependencies: - dependency-name: which dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* jsonrpc: Skip serializing params if params are None (#5471)Michael Davis2023-01-10
| | | | | | | | | | | | | | | | The JSONRPC spec says: > If present, parameters for the rpc call MUST be provided as a > Structured value https://www.jsonrpc.org/specification#parameter_structures (Where a "Structured value" is elsewhere defined as either a map or array.) This change skips the serialization of the `params` field for JSONRPC method calls and notifications if the `params` field is the `None` variant. This fixes compatibility with LSP servers which adhere closely to that part of the spec: `ocamllsp` in the wild.
* build(deps): bump tokio from 1.23.1 to 1.24.1 (#5473)dependabot[bot]2023-01-10
| | | | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.1 to 1.24.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.23.1...tokio-1.24.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> 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.22.0 to 1.23.0 (#5137)dependabot[bot]2022-12-12
| | | | | | | | | | | | | | | | | Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.22.0...tokio-1.23.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* 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>
* feat(lsp): pass client_info on initialization (#4904)Matouš Dzivjak2022-12-09
| | | | Pass client name ('helix') and client version (version / git hash) to LSP server on initialization.