Commit graph

86 commits

Author SHA1 Message Date
w0rp
680ba68d81
#3599 - Use ale_root instead of ale_lsp_root
The `ale_lsp_root` setting is now deprecated, and `ale_root` should be
used instead. The setting will be used for both setting the root easily
for LSP linters, and for running other linters over whole projects.
2021-03-01 20:51:29 +00:00
Alex LaFroscia
d340710fcf
Support going to type definition with tsserver (#3545) 2021-02-20 16:09:28 +00:00
Dalius Dobravolskas
01800a23ad
Support for LSP/tsserver Code Actions (#3437)
* Added tsserver and LSP code action support.
* tsserver refactors support added.
* Handling special case when new text is added after new line symbol.
* ale#code_action#ApplyChanges simplified.
* Initial attempt on LSP Code Actions.
* workspace/executeCommand added.
* Some null checks added.
* Add last column to LSP Code Action message.
* Pass diagnostics to LSP code action.

Previously ApplyChanges code was applied from top-to-bottom that required 
extra parameters to track progress and there was bug. I have changed code
to bottom-to-top approach as that does not require those extra parameters
and solved the bug.

Tested with typescript-language-server and it is working.
2020-11-14 10:15:17 +00:00
w0rp
5bc49d2047
Fix #3183 - Escape filename characters from LSP/tsserver 2020-09-05 21:46:39 +01:00
w0rp
5eda1df0a9
Remove features deprecated in previous versions 2020-08-18 23:03:43 +01:00
w0rp
4df352eee5
Fix #3294 - Fix hover off by 1, handle LSP server crashes 2020-08-18 01:48:07 +01:00
w0rp
5c778e1ae7
Make it easier to run tests locally
Certain tests could break if you ran them separately from other tests.
They have been patched.

`run-tests` now has a `--fast` option which runs tests with only the
fastest Vim version ALE tests with, and the custom checks.
2020-08-16 21:20:08 +01:00
w0rp
9bdabce8df
Fix #2907 - Handle dictionaries for capabilities 2020-08-07 10:54:38 +01:00
Andre Souto
5e69aaf4c2 Adding support for LSP window/showMessage method (#2652)
* Added base handling for window/showMessage
* Ignoring severity log
* Code formatting
* Added user configurable severity
* Preferring ale#util#ShowMessage over echo'ing directly
* Using format similar to ale_echo_msg_format for consistency
* Updating docs
* Added LSP log config string; improved tests
* Use warning as fallback for incorrect user config
2019-10-18 16:17:54 +01:00
Jerko Steiner
3e8c8d3ccb Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709)
This commit adds support for renaming symbols in tsserver and with LSP tools, and for organising imports with tsserver. Completion results for symbols that can be imported are now suggested if enabled for tsserver completion done via ALE.
2019-09-12 21:53:23 +01:00
Nils Kuhnhenn
79d1b99067 Use JSON output for eslint and fix tsserver column 2019-06-02 14:39:03 +02:00
Martino Pilia
5542db1507
Support custom LSP notifications
Allow to send custom notification mesages, that expect no response from
the server.
2019-06-01 16:27:44 +02:00
Martino Pilia
3321685940
Refactor LSP custom request handling 2019-05-31 21:56:38 +02:00
Martino Pilia
7053d468cc
Add API for custom LSP requests
Implement a function `ale#lsp_linter#SendRequest` that allows to send
custom LSP requests to an enabled LSP linter.

Resolves #2474
2019-05-31 17:58:27 +02:00
w0rp
36c35d840b
Fix LSP tests 2019-05-24 01:13:52 +01:00
w0rp
937138dad4
Try to fix the tests 2019-05-20 20:06:44 +01:00
w0rp
4ee28d3129
Fix #2515 - Send client capabilities to LSP servers 2019-05-20 09:40:06 +01:00
w0rp
381fe1badf
Close #829 - Close LSP documents when buffers are deleted 2019-05-14 00:21:58 +01:00
w0rp
79e42fed14
#2403 - Make ale_disable_lsp apply consistently, and document it better 2019-05-10 13:42:41 +01:00
Jethro Shuwen Sun
7f31065fce improve the lsp diagnostic message format (#2425) 2019-04-15 14:36:18 +01:00
w0rp
ce64e349cd
Close #2132 - Add deprecation warnings for old features 2019-04-07 16:24:08 +01:00
w0rp
3bebcb5d48
#2132 - Replace command_chain and chain_with with ale#command#Run 2019-04-07 14:58:06 +01:00
w0rp
435a072181
#2397 - didChangeConfiguration should be a notification 2019-04-02 22:00:03 +01:00
w0rp
c4328f2a31
#2132 - Support deferred execution for LSP executables, commands, and addresses 2019-02-27 23:26:32 +00:00
w0rp
883978ece9
#2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
w0rp
1a69c9c88c
#2295 Send an empty object for the initialized notification, per the spec 2019-02-15 10:44:45 +00:00
w0rp
0d10653a7c
Fix #2295 - Respond to initialize with an initialized message 2019-02-15 08:54:53 +00:00
w0rp
1ee56713b8
#2132 Use an on-init callback for all LSP logic 2019-02-13 17:26:37 +00:00
w0rp
81c73da3b9
#2132 - lint and fix with ale#command#Run
A new function is added here which will later be modified for public use
in linter and fixer callbacks. All linting and fixing now goes through
this new function, to prove that it works in all cases.
2019-02-06 22:00:11 +00:00
brian m. carlson
6fc016ad05
Add additional ways to detect LSP project root
Currently, we detect the linter root based on a variety of techniques.
However, these techniques are not foolproof. For example, clangd works
fine for many things without a compile_commands.json file, and Go
projects may be built outside of the GOPATH to take advantage of Go
1.11's automatic module support.

Add global and buffer-specific variables to allow the user to specify
the root, either as a string or a funcref. Make the funcrefs accept the
buffer number as an argument to make sure that they can function easily
in an asynchronous environment.

We define the global variable in the main plugin, since the LSP linter
code is not loaded unless required, and we want the variable to be able
to be read correctly by :ALEInfo regardless.
2019-01-26 04:46:41 +00:00
brian m. carlson
766636e0c4
test/lsp: ensure linter name is set
All linters should have a name variable set in their dictionary, and
code should be able to rely on that. Fix this test such that its example
linter contains a name entry.
2019-01-26 04:46:41 +00:00
Andrey Popp
d0284f22ea Add textDocument/typeDefinition for LSP (#2226)
* Add textDocument/typeDefinition for LSP

Doc to spec https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition

This works like textDocument/definition but resolves a location of a
type of an expression under the cursor.

I'm not sure what to do with tsserver though.

* Fix passing column to LSP
* test_go_to_definition: wording
* Add tests for textDocument/typeDefinition
* Add docs for textDocument/typeDefinition
2019-01-21 23:06:28 +00:00
w0rp
a4932679b5
Merge pull request #2224 from andreypopp/andreypopp/lsp-hover-fix-column
Adjust column to be 0-based for LSP messages
2019-01-21 21:11:02 +00:00
Andrey Popp
c2e4b553d0 Update tests 2019-01-21 18:36:52 +03:00
Andrey Popp
e960e54eca Update tests 2019-01-21 17:40:33 +03:00
Bjorn Neergaard
d2b0ae8108 Merge branch 'master' into sridhars 2018-11-29 14:57:35 -07:00
Bjorn Neergaard
ef641dda80 Add test for detail in lsp ReadDiagnostics 2018-11-29 14:51:01 -07:00
w0rp
5f206d900e
Merge pull request #2035 from jparise/lsp_config_callback
Add a `lsp_config_callback` linter option
2018-10-31 16:24:11 +00:00
w0rp
4ef2c81e95
Implement LSP symbol search 2018-10-31 16:13:31 +00:00
Jon Parise
2ac9e2a29e Only send LSP config updates when the dict changes
Each LSP connection now stores its configuration dictionary. It is
initially empty (`{}`) and is updated each time the LSP connection is
started. When a change is detected, the workspace/didChangeConfiguration
message is sent to the LSP servers with the updated configuration.
2018-10-31 08:42:42 -07:00
Daniel Welch
2000436dfd LSP configuration via didChangeConfiguration (#1852)
* adding LSP configuration via workspace/didChangeConfiguration
2018-10-22 13:24:46 +01:00
w0rp
c4eca7c417
Use one LSP connection per project 2018-08-24 13:16:58 +01:00
w0rp
a366d325a7
Merge pull request #1815 from fredemmott/lsp-related-information
If present, use new-ish LSP 'relatedInformation' field for :ALEDetail
2018-08-20 16:59:21 +01:00
w0rp
ad8b260519
Fix #1816 - Fix a type error in the initialize message handler 2018-08-16 14:19:12 +01:00
Fred Emmott
4923d48d53
Correct related information line numbers from 0-based to 1-based 2018-08-15 14:46:57 -07:00
Fred Emmott
764da48c57
Test file was the wrong way around 2018-08-15 14:40:51 -07:00
Fred Emmott
c467db3ed9
Better formatting 2018-08-15 14:31:30 -07:00
Fred Emmott
484a70f0c0
Use new-ish LSP 'relatedInformation' field for :ALEDetail 2018-08-15 14:19:32 -07:00
Fred Emmott
04362c746d
Add test for LSP code of -1 2018-08-02 09:30:22 -07:00
Fred Emmott
2768bf15ba
Handle LSP codes for %code% in message formats
fixes #1767
2018-08-02 09:06:48 -07:00