Closed amadeus closed 3 years ago
Use forceCompletionPattern
. See README in https://github.com/Shougo/ddc-nvim-lsp . It should be useful also in ddc-ale.
Interestingly this didn't seem to help my problem, (using this configuration):
call ddc#custom#patch_global('sourceOptions', {
\ 'ale': { 'forceCompletionPattern': '\.|:|->' },
\ })
Is this something that the ale plugin needs to be able to support?
Ok! I think I have fixed the problem, but this has been a bit of an interesting rabbit hole, but I think I have it figured out!
The TL;DR: Doing some digging, I realized this was only breaking when using import * as React from 'react'
, because Deno appears to have an issue with react types. I had to disable deno
as a linter in Ale and it all seemed to be working again (at least also using forceCompletionPattern
).
The longer version:
I added a bunch of logging throughout ddc-ale and ale's actual functions that were getting called, and I was noticing that in certain cases (after typing the .
, the async handlers from ale were never getting resolved. However ale was not throwing any errors, or anything, it was just silently not responding.
I started testing out just creating my own objects with properties and immediately they were autocompleting just fine. I initially thought that this might have something to do with perhaps too many results (I did notice that Ale limited things to 50) but then as I was continuing to test and debug - I started noticing that Ale was kicking up linter errors with deno
. Specifically - these linter errors were around JSX elements and having no interface (a lot like these: https://github.com/denoland/deno/issues/9425 ). I went in and disabled deno as a linter, and boom, everything started to work as expected. I will probably need to do some separate digging to figure out what was going on here, but it was interesting that deno having issues with types somehow cause Ale's completion handlers to NOT fire properly.
It works for me.
call ddc#custom#patch_global('sourceOptions', {
\ 'ale': { 'forceCompletionPattern': '\.|:|->' },
\ })
I have tested it for console.
pattern.
It is not ddc problem.
Problems summary
Ale completions not working after using
.
Expected
See completions after pressing
.
and also while typing textEnvironment Information
ddc version (SHA1):
75e6b2722799ff3abede8b1c465ee5d42db11525
OS: macOS
neovim/Vim
:version
output: MacVim 8.2, 1-3376Provide a minimal init.vim/vimrc with less than 50 lines (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)
Video Example
https://user-images.githubusercontent.com/83376/131266531-cd400bb3-eeea-4409-8cb3-54d86f324420.mp4