Commit Graph

114 Commits

Author SHA1 Message Date
Marios S a918f8c7bc
Improve struct and pointer autocompletion in C (#4231)
* Add explicit trigger characters for C (#4226)

* Stop completion before issuing subsequent requests (#4226)

Co-authored-by: Marios Sioutis <26476573+s-marios@users.noreply.github.com>
2022-07-04 22:00:29 +09:00
D. Ben Knoble 0e99519500
racket: start completion in a full keyword (#4186)
The default `omni_start_map` is too restrictive for Lisps and Schemes
like Racket, which permit hyphens (among other special characters).

As recorded in #3870, trying to complete `file-name-from-path` when
typing `file-name<C-x><C-o>` would give completions like `namespace`
because the hyphen is ignored to find the start of the word for
completion.

Now the racket filetype searches for the start using the keyword class
`\k`, which is more precise.
2022-06-23 09:13:28 +09:00
w0rp d3df00b898
Fix test for echoing messages
The previous linter rule about stray echo lines has been restored, and
now all problems for custom linting rules can be ignored by adding a
comment above problem lines.
2022-04-01 14:35:07 +01:00
João Costa bc406a846e
Set default value for insertTextFormat (#4124)
Co-authored-by: w0rp <devw0rp@gmail.com>
2022-04-01 12:41:05 +00:00
yoshi1123 c42fee3da5
Fix :ALEImport column position
Fix :ALEImport column position so it works with more language servers.

Co-authored-by: w0rp <devw0rp@gmail.com>
2022-03-20 13:20:33 +00:00
Horacio Sanson c173b6243d
Enable autoimport by default (#4102) 2022-03-04 19:05:41 +00:00
Horacio Sanson 42aadf6a26
Fix 3886 - Don't JSON decode completion user data if already a dict (#3894)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-09-08 21:45:19 +09:00
Horacio Sanson d098124e59
Fix 3373 - do not crash on HandleUserData with invalid json (#3807)
Co-authored-by: Horacio Sanson <horacio@allm.inc>
2021-07-13 08:37:21 +09:00
w0rp e78519683e
Close #3433 - Only use noselect if set for automatic completion 2021-06-19 10:57:34 +01:00
Jerko Steiner e8080be08b
Allow duplicate LSP completions for autoimport (#3473)
Similarly to TS completions, this allows the user to pick the package to autoimport when both the package and method name are the same.
2021-01-31 16:21:31 +00:00
w0rp edd96f4414
Merge pull request #3354 from rphln/collapse-whitespaces
Collapse spaces and lines in the completion menu.
2020-11-21 16:16:08 +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 477eb89793
#3332 Implement :ALERename! for ignoring errors
:ALERename! now ignores errors for files that cannot be modified, and
modifies all other files.
2020-10-15 21:56:21 +01:00
Raphael Nepomuceno 9769565f88 Collapse spaces and lines in the completion menu. 2020-09-14 12:11:16 -03:00
w0rp 7d90ff56d9
Close #3333 - Add an ALECompletePost event
Add an `ALECompletePost` event along with everything needed to make it
useful for its primary purpose: fixing code after inserting completions.

* `ALEFix` can now be called with a bang (`!`) to suppress errors.
* A new `ALELintStop` command lets you stop linting, and start it later.
2020-09-08 21:40:10 +01:00
w0rp b4b75126f9
Fix a completion error 2020-09-07 10:01:18 +01:00
w0rp c36053d4cc
Close #3268 - Implement :ALEImport
A new command, `:ALEImport`, has been added, which lets you import words
at your cursor if a completion provider can provide a completion for
that word which includes some additional text changes.
2020-09-06 22:37:37 +01:00
w0rp 25b572b3bf
Close #3205 - Avoid inserting completions by default 2020-08-29 17:36:25 +01:00
w0rp 6e2e51b154
Fix #2971 - Disable automatic completion while 'paste' is active 2020-08-29 17:27:53 +01:00
w0rp a955f5dfa8
#3312 - Just check if additionalTextEdits is non-empty 2020-08-27 08:57:12 +01:00
w0rp 396fba7cca
Fix #3312 - Fix a false positive for auto imports
ALE was incorrectly detecting completion results from servers such as
rust-analyzer as wanting to add import lines when additionalTextEdits
was present, but empty.

Now ALE only filters out completion results if the autoimport setting is
off, and one of the additionalTextEdits starts on some line other than
the current line. If any additionalTextEdits happen to be identical to
the change from completion anyway, ALE will skip them.
2020-08-27 08:44:43 +01:00
w0rp 5a4fad6172
Fix #2899 - Handle tsserver default import completion 2020-08-14 01:55:54 +01:00
w0rp 6d502233d8
Close #3267 - Add a general autoimport setting 2020-08-09 02:32:47 +01:00
w0rp 8bfb5c6407
Merge pull request #2849 from DonnieWest/excludeTsserverWarnings
Allow the user to remove warnings from completions
2020-08-09 01:32:27 +01:00
Jerko Steiner b29e9867e8 Add test for LSP autoimport 2020-05-31 11:46:10 +02:00
Jerko Steiner 4062b05669 Fix completion with langserver (autoimport in go) 2020-05-31 11:00:53 +02:00
w0rp dc054f30c8
Merge pull request #2823 from jeremija/do-not-save-on-autoimport
Do not save after ALERename and ALEOrganizeImports
2020-04-17 17:32:36 +01:00
Jerko Steiner 0cb432cb82 Add TypeScript autoimport support for deoplete (#2779)
* Add autoimport support for deoplete

* Fix test_deoplete_source.py

* Use callback instead of is_async for deoplete

Shuogo, the author of Deoplete, does not recommend using the `is_async`
option:

> I think is_async is not recommended. It is not so useful and broken.
> You should use callback system instead.

Link: https://github.com/Shougo/deoplete.nvim/issues/1006#issuecomment-526797857

Incidentally, the same thread mentiones an issue started by w0rp:
https://github.com/Shougo/deoplete.nvim/issues/976

The deoplete docs also say is_async is deprecated:

> is_async        (Bool)
>     If the gather is asynchronous, the source must set
>     it to "True". A typical strategy for an asynchronous
>     gather_candidates method to use this flag is to
>     set is_async flag to True while results are being
>     produced in the background (optionally, returning them
>     as they become ready). Once background processing
>     has completed, is_async flag should be set to False
>     indicating that this is the last portion of the
>     candidates.
>
>     Note: The feature is deprecated and not recommended.
>     You should use callback system by
>     |deoplete#auto_complete()| instead.

Link: https://github.com/Shougo/deoplete.nvim/blob/master/doc/deoplete.txt

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
2020-01-01 19:00:41 +00:00
Zander Lee 4cbe16197c
Allow popup to be used instead of preview in completeopt 2019-12-22 09:35:29 +01:00
Donnie West e6ee613e00
Switch variables to dictionary key 2019-11-08 16:44:04 -06:00
Donnie West 6637de46c2
Add scriptencoding to `completion.vim` 2019-11-08 16:44:03 -06:00
Donnie West 0b5fcbad1f
Allow the user to set their own completion values 2019-11-08 16:44:00 -06:00
Donnie West 4bdde36661
Check kind safely 2019-11-08 16:41:38 -06:00
Donnie West db5fe5659f
Allow the user to remove warnings from completions 2019-11-08 16:41:37 -06:00
Jerko Steiner 463deedc29 Merge branch 'master' into do-not-save-on-autoimport 2019-10-22 16:40:27 -05:00
w0rp 9125ec8739
Merge pull request #2845 from DonnieWest/fixItemDetailsOnEmptySource
Fix tsserver not returning details for items with empty source
2019-10-18 15:16:54 +01:00
Donnie West 8698c44e2a
Fix tsserver not returning details for items with empty source 2019-10-17 23:26:24 -05:00
Donnie West b27df1b169
Allow code actions to work on callback based sources 2019-10-17 23:22:31 -05:00
Jerko Steiner c8c142b881 Do not save for ALERename and ALEOrganizeImports 2019-10-09 20:54:47 -05:00
w0rp 3fe2223a48
Fix #2800 - Ignore completion user data which is not a dictionary 2019-10-09 10:12:31 +01:00
Jerko Steiner f5e44415e8 Show description of autoimport action for tsserver 2019-09-20 13:11:16 +07: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
Donnie West 5388ff1d54 Add asyncomplete.vim Support (#2627) 2019-08-17 18:40:05 +01:00
w0rp 36a50111b9
Merge pull request #2601 from delphinus/feature/better-completion-for-deoplete
Show more candidates for Deoplete completion
2019-07-14 10:29:03 +01:00
delphinus a3521de64e Use input_patterns & add comments for updating it 2019-06-25 18:04:04 +09:00
delphinus e0f8304860 Add separated func for deoplete
Deoplete needs `get_complete_position` method and it has a different
signature. It already fetches the input string and attempts to detect
the position with `\k*` regexp patterns.
2019-06-19 15:08:24 +09:00
Parker Snell c5a4bbf8b0 Enable C++ autocompletion on '::' and '->' 2019-06-18 18:02:44 -07:00
w0rp 27146ade32
Fix #2544 - Completion positions are off by one 2019-05-30 10:26:17 +01:00
w0rp 67d7caee30
Fix #2535 - Automatically emit <C-x><C-o> less to prevent <C-o> issues 2019-05-28 20:03:35 +01:00
w0rp e5ea809094
Close #2285 - Add a function for use with omnifunc 2019-05-17 00:57:52 +01:00