tbodt / deoplete-tabnine

Deoplete source for TabNine
256 stars 17 forks source link

Fix #14 TabNine:: completion #15

Closed Shougo closed 5 years ago

Shougo commented 5 years ago

Fix TabNine::sem problem after protocol 1.0 feature is enabled.

iovis commented 5 years ago

Testing

iovis commented 5 years ago

Out of the box not seeing solargraph data.

Trying to run :TabNine::sem in the command prompt gives me: E492: Not an editor command: TabNine::sem

Shougo commented 5 years ago

Please try input the text on the buffer instead.

Shougo commented 5 years ago

Please read it carefully.

https://tabnine.com/semantic

It does not say type TabNine::sem in the command line.

iovis commented 5 years ago

Oh... that works! Sorry, I didn't realize it meant to literally type it in the buffer.

Thank you!

screenshot 2018-12-17 at 14 28 46
Shougo commented 5 years ago

:-)

jaydorsey commented 5 years ago

I tested this on my machine too. This fixes the issue

nvim 0.3.1, latest tabnine, latest plugin versions

tbodt commented 5 years ago

Huh why wouldn't the combination of min_pattern_length and [^\w\s] not already detect TabNine::? Since : matches [^\w\s] and any letter would trigger min_pattern_length. @Shougo

Shougo commented 5 years ago

Because, min_pattern_length is 1.

For example, TabNine::version| matches | position. It is 0 length match completion. If min_pattern_length is 1, it will be ignored.

input_pattern ignores min_pattern_length. So it works.

Shougo commented 5 years ago

@tbodt Ping.

tbodt commented 5 years ago

Why is TabNine::version| a 0 length match?

Shougo commented 5 years ago

match length is calculated by tabnine's result. If TabNine::version matches TabNine::|version position, deoplete-tabnine works without the change. The special command seems matches at the end of input. Please ask it for tabnine's author. It is tabnine's feature.

tbodt commented 5 years ago

I don't really understand the min_pattern_length and input_pattern settings. All I know is TabNine is intended to be refreshed on every keystroke; what settings are needed for that?

Shougo commented 5 years ago

I don't really understand the min_pattern_length and input_pattern settings. All I know is TabNine is intended to be refreshed on every keystroke; what settings are needed for that?

If so, you should set min_pattern_length is 0. min_pattern_length is minimum matched length to complete position. If it is 1, the end of input matches are ignored.

But I think min_pattern_length should be customized by user. I have customized min_pattern_length to 2. TabNine::version is special case. So min_pattern_length should be ignored by input_pattern.

tbodt commented 5 years ago

OK, I'll merge this. I'll also test with min_pattern_length = 0 and see if that's better.

Shougo commented 5 years ago

Thank you!