tabnine/tabnine-visual-studio

Tabnine show no suggestion in projects.

Closed this issue · 9 comments

Installed extensions (please ignore the bubbles, they're my desktop decorations):
image

OS version: Windows_NT x64 10.0.22000
Microsoft Visual Studio Community 2019 Version: 16.11.5

tabnine_extension_011.log
tabnine_extension_012.log
tabnine_extension_013.log
tabnine_extension_014.log
tabnine_extension_015.log

These are five new logs from 2021/10/30.
Recently it sometimes worked but I don't know why. In my C++ project, it almost can't work.

Thanks @Betristor!
I analyzed the logs and it appears there is an issue with an internal timeout in the code.

Unfortunately, in the current version of the plugin this is not configurable, but I've added it to our todo list.

We'll paste any updates here.

Thanks again!

Thanks @Betristor! I analyzed the logs and it appears there is an issue with an internal timeout in the code.

Unfortunately, in the current version of the plugin this is not configurable, but I've added it to our todo list.

We'll paste any updates here.

Thanks again!

No thanks, I'm glad to help. Can not wait to use tabnine in visual studio! Respect for your saving developers' time!

@shaigeva I also got my TabNine Binary has failed to respond to request in log.
Certainly, this is a critical bug: Tabnine support of Visual Studio == Not support Visual Studio.
On same PC, TabNine for Visual Studio Code run with no problem.

Codota has TabNine for Visual Studio repository start from Oct 12, 2020,
nearly 2 years after, no a fix to let the extension just work to provide BASIC FEATURE.

According to "the plugin is not configurable",
a "made open source soon" claim announced at Sep 26, 2021,
which is also nearly 1 years ago.

I use TabNine start from July , 2019, at that day, I'm waiting for Visual Studio support.
The 3-year wait was becoming unbearable.
The first day TabNine released Visual Studio support, I go and download,
but no luck, the extension just not work, till now.
I can't even "fix it my self" just like any other open source code.

Can I just have the source code to compile / debug / patch,
or to have a fix?

It sounds just like if you change the "timeout time" from 10 ms to 3000 ms,
the extension will work after that, instead of as hard as inventing a new 3D engine or something.

I'm looking at the TabNineVisualStudio.dll and noticed something called BinaryRequestTimeoutMillis...

I assume there is an equivalent of const int BINARY_REQUEST_TIMEOUT_MILLIS = 1000 somewhere in your source code.
Strange, 1000 ms should be enough for TabNine, even the Cloud version to response.

Log says 100, instead of 1000

2022-09-29 00:56:56.248 [] DBUG [56]  [BinaryFacade] ProcessRequest has timed out (allowedTimeout: [100]) [AutocompleteRequest(correlation_id=1, 'before' ends with: "ameters();")]

So I assume there is an equivalent of

print to log function("ProcessRequest has timed out (allowedTimeout: [{0}])", allowedTimeoutMillis);

When the code run to this line, it got a 100 from function parameter

The only two 100 can be found in dll should be like:

const int BINARY_REQUEST_TIMEOUT_MILLIS_STANDARD_CASE = 100;
const int BINARY_REQUEST_TIMEOUT_MILLIS_EXPLICIT_AUTOCOMPLETE_INVOCATION = 100;

// A function can returns 100 and have a meaningful name
int BinaryRequestTimeoutMillis

If I can modify the dll diretly, I will try to change them to 1000 or 3000.
See if I can do...

@mhtvsSFrpHdE I am no longer with the company.
@dimacodota - FYI.

The dll is possible to patch without using source code, if just modify few int variables.
After modify the dll, TabNine extension can provide suggestions.
However, there is no Visual Studio built in suggestion aside, for example,
you can see all function name start with letter "a" by default in Visual Studio,
but if you use TabNine extension, only 5 of TabNine suggestions available.

I share my modify result for who still want to try TabNine for Visual Studio,
and how to create the patch from scratch in case if you don't trust.

You MUST do the following to let this unofficial version of TabNine extension to work:

  • Go to extension, uninstall current TabNine
    IMPORTANT: Without this step, the extension is just not load at all in my experience.
  • Close Visual Studio to apply change
  • Open Visual Studio
  • Enter the project to make sure history data is refreshed
  • Close Visual Studio
  • Install TabNineVisualStudio_Modified.vsix
    Download: TabNineVisualStudio_Modified.vsix.zip
    GitHub not support upload vsix file, so after download, remove the .zip suffix from file name.
  • Open Visual Studio and Enter the project
  • Wait until no disk or CPU activity
  • Type few characters, press Ctrl+Space
  • TabNine may take 1 minute to connect the cloud, or start local

Until fully load, no suggestion will available.
If TabNine still not show, download and open Visual Studio Code version of TabNine,
see if this one will work, then back to Visual Studio to try again.
The two TabNine share the same configuration.

A working TabNine extension look like this:
TabNinePatch6

Patch the dll yourself, use dnSpy:
Here are two const int, increase them, unit is ms
TabNinePatch1
TabNinePatch2
TabNinePatch3
In this step, choose ldc.i4, or a maximum value of 128 is limited
The one is a function with return value instead of just a const int
TabNinePatch4
TabNinePatch5
Use 7-zip open TabNine official vsix, drag the modified dll into it, replace exist, install the new modified vsix