Urgau
ec6e575a40
Correctly handle multiple cursors with LSP snippets
2023-03-08 10:48:35 +09:00
Pascal Kuthe
ba24cfe912
Delete snippet placeholders when accepting completion
...
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.
2023-03-08 10:48:35 +09:00
Urgau
ded4381728
Implement LSP snippet tabstops sorting and merging
2023-03-08 10:48:35 +09:00
Michael Davis
d2af31b916
LSP: Advertise snippet support
2023-03-08 10:48:35 +09:00
Michael Davis
b9b1ec2208
Apply snippets as transactions
2023-03-08 10:48:35 +09:00
Urgau
e973b71c83
Optimize LSP snippet parsing
2023-03-08 10:48:35 +09:00
Michael Davis
9c12e0fb76
Add parser for LSP snippet
2023-03-08 10:48:35 +09:00
Davide Galassi
f976c004e2
Allow LSP server to be stopped ( #5964 )
2023-03-07 18:34:31 -06:00
dependabot[bot]
8228fb0cf7
build(deps): bump tokio from 1.25.0 to 1.26.0 ( #6212 )
...
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>
2023-03-07 09:53:10 +09:00
dependabot[bot]
8016dccd60
build(deps): bump tokio-stream from 0.1.11 to 0.1.12 ( #6071 )
...
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>
2023-02-20 18:19:36 -06:00
Michael Davis
0f64f31d8b
LSP: Add request ID to request timeout message ( #6010 )
...
This improves error logging for requests - without the ID it's hard to
know which request is the one that timed out.
2023-02-16 10:16:25 +09:00
dependabot[bot]
0a7c697dd7
build(deps): bump tokio from 1.24.2 to 1.25.0 ( #5974 )
...
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>
2023-02-13 18:28:21 -06:00
Matouš Dzivjak
2bebc5042e
feat(ui): deprecated completions ( #5932 )
...
* 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.
2023-02-13 11:44:31 +09:00
Pascal Kuthe
93c7afc4ed
Negotiate LSP Position Encoding ( #5894 )
...
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.
2023-02-11 15:50:01 +09:00
Pascal Kuthe
8a3ec443f1
Fix new clippy lints ( #5892 )
2023-02-09 16:27:08 -06:00
Pascal Kuthe
7ebcf4e919
properly handle LSP position encoding ( #5711 )
...
* 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>
2023-02-09 16:19:29 +09:00
Ole Krüger
4eca4b3079
Support goto-declaration LSP command ( #5646 )
2023-01-31 05:38:53 -05:00
dependabot[bot]
64ec0256d3
build(deps): bump which from 4.3.0 to 4.4.0 ( #5655 )
...
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>
2023-01-23 17:25:49 -06:00
Michael Davis
22298434f1
jsonrpc: Skip serializing params if params are None ( #5471 )
...
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.
2023-01-10 18:31:41 +09:00
dependabot[bot]
bbadf3e3de
build(deps): bump tokio from 1.23.1 to 1.24.1 ( #5473 )
...
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>
2023-01-10 08:07:27 +08:00
dependabot[bot]
fa436fa680
build(deps): bump tokio from 1.22.0 to 1.23.0 ( #5137 )
...
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>
2022-12-12 17:25:05 -06:00
TotalKrill
16e13b9789
allow specifying environment for language servers in language.toml ( #4004 )
...
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>
2022-12-08 22:09:23 -06:00
Matouš Dzivjak
8abed3bd78
feat(lsp): pass client_info on initialization ( #4904 )
...
Pass client name ('helix') and client version (version / git hash)
to LSP server on initialization.
2022-12-08 21:57:03 -06:00
Michael Davis
2077f5e26a
Apply completion edits to all cursors ( #4496 )
...
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.
2022-12-06 10:29:40 +09:00
sigmaSd
4960c41f18
feat(lsp): add support for lsp Diagnostic{}.data ( #4935 )
2022-12-02 10:18:45 +09:00
Michael Davis
e6dad960cf
Drain pending requests on language server termination ( #4852 )
...
This prevents a freeze while shutting down when using `efm-langserver`.
`efm-langserver` exits immediately after seeing a shutdown request,
without responding to the request. We block awaiting the reply to the
shutdown request which will never come, so we time out.
This change responds to any pending requests with `Err` saying that the
stream has been closed.
2022-11-24 11:07:42 +09:00
dependabot[bot]
642a961c03
build(deps): bump tokio from 1.21.2 to 1.22.0 ( #4846 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.21.2 to 1.22.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.2...tokio-1.22.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>
2022-11-22 13:24:37 -06:00
Michael Davis
9059c65a53
lsp: Check server provider capabilities ( #3554 )
...
Language Servers may signal that they do not support a method in
the initialization result (server capabilities). We can check these
when making LSP requests and hint in the status line when a method
is not supported by the server. This can also prevent crashes in
servers which assume that clients do not send requests for methods
which are disabled in the server capabilities.
There is an existing pattern the LSP client module where a method
returns `Option<impl Future<Output = Result<_>>>` with `None` signaling
no support in the server. This change extends this pattern to the rest
of the client functions. And we log an error to the statusline for
manually triggered LSP calls which return `None`.
2022-11-22 11:52:23 +09:00
Michael Davis
8be2d1dcbf
Handle language server termination ( #4797 )
...
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.
2022-11-19 13:14:36 +09:00
Michael Davis
89efb4f711
lsp: Resolve completion item asynchronously on idle-timeout ( #4781 )
...
d7d0d5ffb7
resolves completion items on
the idle-timeout event. The `Completion::resolve_completion_item`
function blocks on the LSP request though, which blocks the compositor
and in turn blocks the event loop. So until the language server returns
the resolved completion item, Helix is unable to respond to keypresses
or other LSP messages.
This is typically ok since the resolution request is fast but for some
language servers this can be problematic, and ideally we shouldn't be
blocking like this anyways.
When receiving a `completionItem/resolve` request, the Volar server
sends a `workspace/configuration` request to Helix and blocks itself
on the response, leading to a deadlock. Eventually the resolve request
times out within Helix but Helix is locked up and unresponsive in that
window.
This change resolves the completion item without blocking the
compositor.
2022-11-19 03:27:46 +09:00
Matthias Deiml
dee5b2a983
Add LSP workspace command picker ( #3140 )
...
* Add workspace command picker
* Make command typable
* Add optional argument to lsp-workspace-command
2022-11-09 18:17:09 +09:00
Blaž Hrastnik
13126823f8
lsp: Support insertReplace
...
Fixes #4473
2022-11-08 20:50:49 +09:00
Blaž Hrastnik
c2c1280f02
Resolve a bunch of upcoming clippy lints
2022-11-04 21:06:28 +09:00
dependabot[bot]
414214f883
build(deps): bump tokio-stream from 0.1.10 to 0.1.11 ( #4341 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 19:56:29 -05:00
ath3
7c9809eeb2
Find workspace from document path ( #3553 )
2022-10-04 00:02:49 +09:00
Alexis Kalabura
b9ff5d0e0a
[lsp-restart]: call the force_shutdown method for the old_client ( #3972 )
...
* [lsp-restart]: call the shutdown_and_exit method for the old_client
* change shutdown_and_exit to force_shutdown
* remove extra log
2022-10-03 23:54:46 +09:00
Kirawi
8c2cc43017
diff full-doc LSP edits ( #4041 )
...
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-10-02 14:23:23 -05:00
dependabot[bot]
d2bb7f5a09
build(deps): bump tokio-stream from 0.1.9 to 0.1.10 ( #3988 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 18:22:48 -05:00
Riccardo Binetti
888f4fef6f
Split helix_core::find_root and helix_loader::find_local_config_dirs ( #3929 )
...
* Split helix_core::find_root and helix_loader::find_local_config_dirs
The documentation of find_root described the following priority for
detecting a project root:
- Top-most folder containing a root marker in current git repository
- Git repository root if no marker detected
- Top-most folder containing a root marker if not git repository detected
- Current working directory as fallback
The commit contained in https://github.com/helix-editor/helix/pull/1249
extracted and changed the implementation of find_root in find_root_impl,
actually reversing its result order (since that is the order that made
sense for the local configuration merge, from innermost to outermost
ancestors).
Since the two uses of find_root_impl have different requirements (and
it's not a matter of reversing the order of results since, e.g., the top
repository dir should be used by find_root only if there's not marker in
other dirs), this PR splits the two implementations in two different
specialized functions.
In doing so, find_root_impl is removed and the implementation is moved
back in find_root, moving it closer to the documented behaviour thus
making it easier to verify it's actually correct
* helix-core: remove Option from find_root return type
It always returns some result, so Option is not needed
2022-09-23 17:04:07 +09:00
Filipe Azevedo
385ccdfc9c
add :lsp-restart command ( #3435 )
2022-09-20 16:44:36 +09:00
Blaž Hrastnik
1df32c917c
diagnostics: Use Vec<Tag> instead of Option<Vec<Tag>>
2022-09-20 16:28:00 +09:00
Luke Cycon
64b0745413
Track source and tags in diagnostics ( #3898 )
2022-09-20 16:21:15 +09:00
Blaž Hrastnik
a123fb6057
Remove LspNotDefined, instead return an Option<>
2022-09-07 16:42:33 +09:00
dependabot[bot]
f7c216d497
build(deps): bump tokio from 1.20.1 to 1.21.0 ( #3716 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.20.1 to 1.21.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.20.1...tokio-1.21.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>
2022-09-06 11:25:54 +09:00
Blaž Hrastnik
1caba2d3e8
lsp: Don't log "LSP not defined" errors in the logfile
2022-09-03 12:18:08 +09:00
Michael Davis
672ea98b05
Advertise WorkspaceSymbolClientCapabilities support ( #3361 )
2022-08-09 11:51:10 +09:00
PiergiorgioZagaria
219d2c2515
Change default formatter for any language ( #2942 )
...
* 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>
2022-08-04 13:01:48 +09:00
Erasin
42115d02bc
Suport diagnostic code ( #3096 )
...
* add code for diagnostic.
This PR provides a solution to resolve #2994 . missing Code Actions for lsp
* remote unused import
2022-07-26 10:26:50 +09:00
Gokul Soumya
791bf7e50a
Add lsp signature help ( #1755 )
...
* Add lsp signature help
* Do not move signature help popup on multiple triggers
* Highlight current parameter in signature help
* Auto close signature help
* Position signature help above to not block completion
* Update signature help on backspace/insert mode delete
* Add lsp.auto-signature-help config option
* Add serde default annotation for LspConfig
* Show LSP inactive message only if signature help is invoked manually
* Do not assume valid signature help response from LSP
Malformed LSP responses are common, and these should not crash the
editor.
* Check signature help capability before sending request
* Reuse Open enum for PositionBias in popup
* Close signature popup and exit insert mode on escape
* Add config to control signature help docs display
* Use new Margin api in signature help
* Invoke signature help on changing to insert mode
2022-07-19 11:28:24 +09:00
Gokul Soumya
21b66ba068
lsp: Add workspace/applyEdit to client capabilites ( #3012 )
...
The functionality already existed, but the capability wasn't being
reported correctly to the server:
230ba264bf/helix-term/src/application.rs (L716-L728)
2022-07-09 07:31:15 +09:00
lazytanuki
096abdd19b
feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight ( #2738 )
...
* feat: highlight symbol under cursor using LSP textDocument/documentHighlight
* fix: please clippy
* fix: shorter description and code style
2022-06-27 20:19:56 +09:00
Blaž Hrastnik
425de09d21
Fix tests again
2022-06-27 17:35:23 +09:00
Blaž Hrastnik
24f03097e3
Remove some more unwraps
2022-06-27 17:27:44 +09:00
Michael Davis
45ce1ebdb6
embed jsonrpc types from jsonrpc-core crate ( #2801 )
...
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
2022-06-18 12:59:57 +09:00
dependabot[bot]
9f8df05d96
build(deps): bump tokio-stream from 0.1.8 to 0.1.9 ( #2690 )
...
Bumps [tokio-stream](https://github.com/tokio-rs/tokio ) from 0.1.8 to 0.1.9.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.8...tokio-stream-0.1.9 )
---
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>
2022-06-07 14:51:36 +09:00
dependabot[bot]
5c7d9d6027
build(deps): bump tokio from 1.18.2 to 1.19.2 ( #2691 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.18.2 to 1.19.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/commits )
---
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>
2022-06-07 11:10:00 +05:30
farwyler
f92a25a856
Passing extra formatting options to LSPs ( #2635 )
...
* allows passing extra formatting options to LSPs
- adds optional field 'format' to [[language]] sections in 'languages.toml'
- passes specified options the LSPs via FormattingOptions
* cleaner conversion of formatting properties
* move formatting options inside lsp::Client
* cleans up formatting properties merge
2022-06-05 19:50:57 +09:00
Blaž Hrastnik
3d91c99c3e
fix: lsp: Sort edits by start range, Omnisharp sends them in reverse
2022-06-02 14:07:19 +09:00
Michael Davis
50dd11985c
prevent panic when handling an LSP response with no request ( #2475 )
...
A language server may push a response which doesn't belong to any
request. With this change, we discard the response rather than
crashing.
In the case of #2474 , the language server sends an error message
with a null request ID which should not ever exist in the
`pending_requests` HashMap.
closes #2474
2022-05-17 14:45:34 +09:00
Blaž Hrastnik
7ae6cad52e
Don't panic on LSP parsing errors
...
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.
2022-05-11 11:00:55 +09:00
EmmChriss
807cdc60bf
configurable lsp request timeout ( #2405 )
2022-05-11 09:54:35 +09:00
dependabot[bot]
fc35791af9
build(deps): bump tokio from 1.17.0 to 1.18.1 ( #2373 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.17.0...tokio-1.18.1 )
---
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>
2022-05-03 09:31:05 +09:00
chunghha
3a398eec56
fix typos ( #2304 )
2022-04-27 14:21:20 -05:00
matt rice
db47761154
register publish_diagnostics client capability ( #2241 )
2022-04-25 11:14:46 +09:00
ttys3
19d042dde6
chore(lsp): check rename capabilities before send rename action ( #2203 )
2022-04-23 17:09:16 +09:00
Michael Davis
449d1dfdfb
prevent panic when receiving malformed LSP PublishDiagnostic ( #2160 )
...
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.
2022-04-18 23:11:28 +08:00
Robin Jadoul
33b7483db5
Send active diagnostics to LSP when requesting code actions. ( #2005 )
...
* 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
2022-04-17 12:05:23 +09:00
dc8fef5dd3
Fixes #1991 LSP Auto-import ( #2088 )
2022-04-16 10:43:54 +09:00
dependabot[bot]
f3dcb4034f
build(deps): bump lsp-types from 0.92.1 to 0.93.0 ( #2084 )
...
Bumps [lsp-types](https://github.com/gluon-lang/lsp-types ) from 0.92.1 to 0.93.0.
- [Release notes](https://github.com/gluon-lang/lsp-types/releases )
- [Changelog](https://github.com/gluon-lang/lsp-types/blob/master/CHANGELOG.md )
- [Commits](https://github.com/gluon-lang/lsp-types/compare/v0.92.1...v0.93.0 )
---
updated-dependencies:
- dependency-name: lsp-types
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>
2022-04-12 12:12:30 +09:00
Blaž Hrastnik
8adf0c1b3a
lsp: Implement support for workspace_folders (currently just one)
...
Refs #1898
2022-04-01 11:20:41 +09:00
Blaž Hrastnik
84e799f0e4
fix: Some LSPs still want rootPath, so provide it
...
Refs #1898
2022-03-31 17:45:51 +09:00
Triton171
f044059a2a
Implement LSP workspace/configuration
and 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>
2022-02-28 17:57:22 +09:00
Blaž Hrastnik
9712bbb23b
Use which to resolve lsp/dap binaries
...
This resolves the following issue: https://github.com/helix-editor/helix/discussions/962#discussioncomment-1580046
2022-02-24 11:38:40 +09:00
dependabot[bot]
806cc1c3b1
build(deps): bump tokio from 1.16.1 to 1.17.0 ( #1691 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.16.1 to 1.17.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.16.1...tokio-1.17.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>
2022-02-22 12:29:19 +09:00
Blaž Hrastnik
bd549d8a20
Merge remote-tracking branch 'origin/master' into debug
2022-02-13 18:31:51 +09:00
Blaž Hrastnik
f88c077f99
Replace tendril with smartstring
...
Slightly smaller API surface, less dependencies.
2022-02-10 11:12:47 +09:00
dependabot[bot]
828d39e736
build(deps): bump lsp-types from 0.91.1 to 0.92.0 ( #1631 )
...
Bumps [lsp-types](https://github.com/gluon-lang/lsp-types ) from 0.91.1 to 0.92.0.
- [Release notes](https://github.com/gluon-lang/lsp-types/releases )
- [Changelog](https://github.com/gluon-lang/lsp-types/blob/master/CHANGELOG.md )
- [Commits](https://github.com/gluon-lang/lsp-types/compare/v0.91.1...v0.92.0 )
---
updated-dependencies:
- dependency-name: lsp-types
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>
2022-02-08 07:51:11 +08:00
dependabot[bot]
983a53bfb4
build(deps): bump tokio from 1.15.0 to 1.16.1 ( #1610 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.15.0 to 1.16.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.15.0...tokio-1.16.1 )
---
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>
2022-02-01 12:24:41 +09:00
Blaž Hrastnik
efaac6c5d3
Release 0.6
2022-01-04 18:54:37 +09:00
Kirawi
ea095ca5fb
Optimize lsp_pos_to_pos ( #1423 )
...
lines().count() is slow compared to len_lines()
2022-01-03 11:26:17 +09:00
Alexis Mousset
8a019b423f
Detect workspace root using language markers ( #1370 )
...
* 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>
2021-12-31 17:06:54 +09:00
Gabriel Berto
5d7b5db8ab
Resolve completion item ( #1315 )
...
Co-authored-by: Gabriel Berto <gabriel.berto@pottencial.com.br>
2021-12-25 19:00:57 +09:00
Matouš Dzivjak
75a8b789d2
LSP code action commands ( #1304 )
...
* feat(lsp): codeAction commands
* Don't block on command call
* Fix lifetime of command execution
* Fix lint issues
2021-12-21 18:21:45 +09:00
dependabot[bot]
614e0e0026
build(deps): bump tokio from 1.14.0 to 1.15.0 ( #1321 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.14.0...tokio-1.15.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>
2021-12-21 08:46:43 +09:00
Blaž Hrastnik
d31bef7fea
lsp: Don't panic if init fails
...
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.
2021-12-03 10:05:27 +09:00
Blaž Hrastnik
9ed930b233
Merge remote-tracking branch 'origin/master' into debug
2021-11-30 13:06:30 +09:00
dependabot[bot]
f24e5a3c41
build(deps): bump tokio from 1.13.1 to 1.14.0 ( #1146 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.13.1 to 1.14.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.13.1...tokio-1.14.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>
2021-11-23 10:07:59 +09:00
Blaž Hrastnik
d1854d8e6a
Merge remote-tracking branch 'origin/master' into debug
2021-11-21 20:06:45 +09:00
CossonLeo
29e6849413
Add LSP rename_symbol (space-r) ( #1011 )
...
improve apply_workspace_edit
2021-11-09 00:17:54 +09:00
Blaž Hrastnik
f2b709a3c3
Merge branch 'master' into debug
2021-11-07 00:28:19 +09:00
dependabot[bot]
44ff597841
build(deps): bump tokio-stream from 0.1.7 to 0.1.8 ( #953 )
...
Bumps [tokio-stream](https://github.com/tokio-rs/tokio ) from 0.1.7 to 0.1.8.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.7...tokio-stream-0.1.8 )
---
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>
2021-11-02 09:34:39 +09:00
dependabot[bot]
a13af476c1
build(deps): bump tokio from 1.12.0 to 1.13.0 ( #955 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.12.0...tokio-1.13.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>
2021-11-02 09:15:05 +09:00
Ivan Tham
49f6c2623f
Bump lsp-types to 0.91.0 ( #932 )
2021-10-29 12:00:18 +09:00
Blaž Hrastnik
a1b7f003a6
Include the missing dependency bump
2021-10-28 16:44:36 +09:00
Blaž Hrastnik
f3c7f20dbc
Release v0.5.0
2021-10-28 16:41:34 +09:00
Blaž Hrastnik
182a59b552
Update to rust 1.56 + 2021 edition
2021-10-22 12:15:18 +09:00
Blaž Hrastnik
0a6b60085a
Merge branch 'master' into debug
2021-10-17 13:51:56 +09:00
Dmitry Sharshakov
48cb81eff1
Merge branch 'master' into debug
2021-10-09 16:03:46 +03:00
Midnight Exigent
eedcea7e6b
Allow language.config
(in languages.toml) to be passed in as a toml object ( #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
2021-10-08 11:14:12 +09:00
dependabot[bot]
d68cff837f
build(deps): bump lsp-types from 0.89.2 to 0.90.0
...
Bumps [lsp-types](https://github.com/gluon-lang/lsp-types ) from 0.89.2 to 0.90.0.
- [Release notes](https://github.com/gluon-lang/lsp-types/releases )
- [Changelog](https://github.com/gluon-lang/lsp-types/blob/master/CHANGELOG.md )
- [Commits](https://github.com/gluon-lang/lsp-types/compare/v0.89.2...v0.90.0 )
---
updated-dependencies:
- dependency-name: lsp-types
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 08:29:14 +08:00
dependabot[bot]
466e69bbb9
build(deps): bump tokio from 1.11.0 to 1.12.0
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.11.0...tokio-1.12.0 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 08:28:52 +08:00
Dmitry Sharshakov
bf53aff27d
Merge branch 'master' into debug
2021-09-25 23:14:59 +03:00
Kirawi
ef532e0c0d
log errors produced when trying to initialize the LSP ( #746 )
2021-09-15 14:58:06 +09:00
Blaž Hrastnik
bb47a9a0b8
fix: Fix regression where formatting would fail on null response
2021-09-09 11:49:45 +09:00
Blaž Hrastnik
fd36fbdebf
Merge branch 'lsp-async-init'
2021-09-07 13:05:53 +09:00
dependabot[bot]
fde0a84bba
build(deps): bump tokio from 1.10.1 to 1.11.0 ( #723 )
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.10.1...tokio-1.11.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>
2021-09-07 09:15:31 +09:00
Blaž Hrastnik
be81f40df8
lsp: This doesn't need to be a mutable reference
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
37606bad47
lsp: doc.language_server() is None until initialize completes
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
46f3c69f06
lsp: Don't send notifications until initialize completes
...
Then send open events for all documents with the LSP attached.
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
2793ff3832
lsp: SyncKind::Full: we need to send the whole document on each change
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
48fd4843fc
lsp: Outdated comment
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
800d79b584
ls: Refactor textDocument/didSave in a similar vein
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
184637c55a
lsp: refactor format so we stop cloning the language_server
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
8744f367bd
wip
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
5a558e0d8e
lsp: Delay requests & notifications until initialization is complete
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
c3a58cdadd
lsp: Refactor capabilities as an async OnceCell
...
First step in making LSP init asynchronous
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
41f1e8e4fb
fix: lsp: Terminate transport on EOF
...
If stdout/stderr is closed, read_line will return 0 indicating EOF.
2021-09-06 15:25:46 +09:00
Blaž Hrastnik
fe17b99ab3
fix: lsp: Don't consume \n\n as a single newline
2021-09-06 15:25:08 +09:00
Blaž Hrastnik
57ed5180e0
lsp: Improve line ending handling when generating TextEdit
2021-09-06 11:00:33 +09:00
Dmitry Sharshakov
5b20f6020a
Merge remote-tracking branch 'origin/master' into debug
...
Contains type fix on helix-term/src/ui/editor.rs:752:13
2021-08-31 21:29:11 +03:00
dependabot[bot]
9d83a4483d
build(deps): bump tokio from 1.10.0 to 1.10.1
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.10.0...tokio-1.10.1 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 10:02:06 +09:00
Blaž Hrastnik
847d1fa496
fix: Work around crashes on LSPs that don't just emit JSON-RPC
2021-08-29 18:38:28 +09:00
Blaž Hrastnik
7eff905680
lsp: slightly refactor header parsing, add more logging
2021-08-29 12:40:21 +09:00
Dmitry Sharshakov
c7759a5aa0
Merge remote-tracking branch 'origin/master' into debug
2021-08-25 19:22:01 +03:00
Timothy DeHerrera
ed8c3e6574
don't panic on defunct lsp process ( #583 )
2021-08-23 18:04:22 +09:00
Blaž Hrastnik
d39baa3b4e
Start integrating into the editor's event loop
2021-08-20 13:48:32 +09:00
Blaž Hrastnik
3f62799656
Get cargo check to pass in the subcrate
2021-08-20 13:43:54 +09:00
Blaž Hrastnik
1caedc18ca
Release v0.4.1
2021-08-14 13:32:29 +09:00
Blaž Hrastnik
3de40de0a9
fix build...
2021-08-13 01:28:11 +09:00
Blaž Hrastnik
733ee06b7b
Release v0.4.0
2021-08-13 01:24:04 +09:00
Blaž Hrastnik
385a6b5a1a
lsp: Refactor duplex to avoid issues with select! + read_exact
...
read_exact isn't cancellation safe.
Fixes #504
2021-08-07 15:04:03 +09:00
Ivan Tham
821565e4ef
Add ctrl-z to suspend
2021-08-03 09:32:21 +09:00
dependabot[bot]
a6aad3122d
Bump tokio from 1.8.2 to 1.9.0
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.8.2...tokio-1.9.0 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:28:34 +08:00
dependabot[bot]
b581c185ba
Bump jsonrpc-core from 17.1.0 to 18.0.0
...
Bumps [jsonrpc-core](https://github.com/paritytech/jsonrpc ) from 17.1.0 to 18.0.0.
- [Release notes](https://github.com/paritytech/jsonrpc/releases )
- [Commits](https://github.com/paritytech/jsonrpc/compare/jsonrpc-core-17.1.0...v18.0.0 )
---
updated-dependencies:
- dependency-name: jsonrpc-core
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-27 09:26:37 +08:00
Grzegorz Baranski
48e344a2a8
feat: code actions - document edits ( #478 )
...
* wip: Code actions
* fix(term): use current macro instead Context::context
* feat(lsp): set code_action capabilities
* feat(term): set SPC-a to code_action
* feat(term): wip on applying code actions
* deps: `cargo update`
* feat(term): applying code actions edits
* fix(term): cleanup of apply_edit
* fix(term): applying edits as a whole thing instead one by one
* refactor(term): move apply_edits below
* fix(term): improve unimplemented messages for further investigation
* fix(term): change code action command comment
Co-authored-by: Ivan Tham <pickfire@riseup.net>
* fix(term): add matching `}`
* fix(term): cleanup, todo!() on workspace edit
* fix(term): remove unrelated workspace_symbol_picker
* fix(term): apply cargo-clippy suggestions
* fix(term): replace todo!'s with editor.set_error
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2021-07-24 10:26:43 +09:00
Cor Peters
0aa43902ca
Added option to provide a custom config file to the lsp. ( #460 )
...
* 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>
2021-07-18 16:56:25 +09:00
dependabot[bot]
c74198a3bf
Bump tokio-stream from 0.1.6 to 0.1.7
...
Bumps [tokio-stream](https://github.com/tokio-rs/tokio ) from 0.1.6 to 0.1.7.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.6...tokio-stream-0.1.7 )
---
updated-dependencies:
- dependency-name: tokio-stream
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-13 09:58:54 +09:00
dependabot[bot]
47a6882738
Bump tokio from 1.7.1 to 1.8.0
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.7.1...tokio-1.8.0 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-06 09:52:47 +09:00
Joe Neeman
c9be480bf8
Make formatting happen asynchronously.
2021-06-30 17:08:50 +09:00
Blaž Hrastnik
44566ea812
Release 0.3.0
2021-06-27 13:27:47 +09:00
Blaž Hrastnik
cad14c6b46
Address nightly clippy warnings
2021-06-27 13:27:47 +09:00
Blaž Hrastnik
a70de6e980
Merge pull request #224 from helix-editor/line_ending_detection
...
Line ending detection
2021-06-22 11:09:19 +09:00
dependabot[bot]
c704970fd7
Bump tokio from 1.6.1 to 1.7.1
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.6.1 to 1.7.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.6.1...tokio-1.7.1 )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 09:26:14 +09:00
wojciechkepka
cc357d5096
Add progress spinners to status line
2021-06-21 12:59:06 +09:00
Nathan Vegdahl
4efd6713c5
Work on moving code over to LineEnding instead of assuming '\n'.
...
Also some general cleanup and some minor fixes along the way.
2021-06-20 15:33:02 -07:00
wojciechkepka
dd0af78079
Fix unwraps in lsp::transport
2021-06-19 13:02:56 +09:00
wojciechkepka
c2aad859b1
Handle language server shutdown with timeout
2021-06-19 13:02:56 +09:00
Benoît CORTIER
03d1ca7b0a
cargo: add more metadata to manifests
2021-06-19 10:04:59 +09:00
Benoît CORTIER
b48054f3ee
cargo: add version to local dependencies
...
First step towards enabling us to publish on crates.io.
See: https://github.com/helix-editor/helix/issues/42
2021-06-19 10:04:59 +09:00
wojciechkepka
d095ec15d4
Reenable work_done_progress
capability
2021-06-18 17:42:38 +09:00