codota / tabnine-sublime

Tabnine Autocomplete AI: JavaScript, Python, TypeScript, PHP, C/C++, HTML/CSS, Go, Java, Ruby, C#, Rust, SQL, Bash, Kotlin, Julia, Lua, OCaml, Perl, Haskell, React
https://www.tabnine.com/install/sublime
MIT License
197 stars 37 forks source link

TabNine was unable to install javascript semantic completion backend #37

Open jasonycw opened 5 years ago

jasonycw commented 5 years ago

Not sure what it means in https://tabnine.com/semantic

  1. image

  2. image

But when I start typing, it shows the below message image

Is it not working properly? It doesn't show the % like the videos from the blog post

The help page said

If the above steps don't work, check that the language server works when you run it in your terminal.

Which terminal and what language server does this mean???

I can get to the TabNine::config page and find the 2 files in C:\Users\jason_yu\AppData\Roaming\TabNine

But I am not sure what is the equivilance to this step for javascript or any other language other than GO

Assume for the sake of these instructions that you're trying to get go-langserver to work. Use "which go-langserver" in your terminal to find the absolute path to the language server.

which is not working in Sublime's console or cmd or powershell and I am not sure what is the "javascript-langserver"


Sublime Text: Version 3.2.1, Build 3207 OS: Windows 10 1903 npm: 5.6.0

zxqfl commented 5 years ago

Are you using TabNine Cloud? That's how you see the %s.

The language server is flow. You can look up instructions for how to install it. The windows equivalent of which is where, see https://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line

jasonycw commented 5 years ago

Tried installing flow and use where flow and added it to the TabNine.toml file

[language.javascript]
command = "C:\\Users\\jason_yu\\AppData\\Roaming\\npm\\flow"
args = ["lsp"]
install = [["npm", "install", "-g", "flow-bin"]]

But after TabNine::restart, it still show the same error image

Smolations commented 5 years ago

I had this issue as well, but I'm on a mac so your solution may not be as easy. I was able to get around it with the Fix Mac Path package, but maybe there is a similar package for windows? Anywho, the issue basically came down to tabnine being unable to find the correct binary from the PATH when it opened a shell behind the scenes. If you ensure your node binary path is added to your PATH in one of your shell's initialization files (~/.profile for me), then stuff should work. You may also want to try restarting sublime after changes have been made. Also, you didn't mention if you tried typing TabNine::restart after you made changes, but you should definitely do that. 😋

FWIW, tabnine's suggestion of adding the full path for command did not seem to work for me either.

Cobertos commented 5 years ago

Still having issues with this on Windows. I installed flow-bin and I can find it in both Msys Git which and Cmd where. I can run flow and flow lsp and it seems to be working fine. But no matter what I do I can't get it to work in TabNine. I get the log below when filtering for lsp:: (I changed a few of the paths):

[2019-10-28][11:13:07][lsp::session][INFO] Spawning controller for route Route { language: "javascript", root: AbsolutePath { path: "\\\\?\\C:\\Users\\xxx.xxx\\Workspace\\tb2\\xxx\\xxx", uri: "file:///C:/Users/xxx.xxx/Workspace/tb2/xxx/xxx" } }
[2019-10-28][11:13:07][lsp::language_server_transport][INFO] Starting language server: `flow lsp`
[2019-10-28][11:13:07][lsp::low_level_language_server][INFO] Calling LSP method `DidOpenTextDocument`
[2019-10-28][11:13:07][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:13:07][lsp::language_server_transport][ERROR] install error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
[2019-10-28][11:16:00][lsp::session][INFO] Spawning controller for route Route { language: "javascript", root: AbsolutePath { path: "\\\\?\\C:\\Users\\xxx.xxx\\Workspace\\tb2\\xxx\\xxx", uri: "file:///C:/Users/xxx.xxx/Workspace/tb2/xxx/xxx" } }
[2019-10-28][11:16:00][lsp::language_server_transport][INFO] Starting language server: `flow lsp`
[2019-10-28][11:16:00][lsp::language_server_transport][ERROR] install error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
[2019-10-28][11:16:00][lsp::low_level_language_server][INFO] Calling LSP method `DidOpenTextDocument`
[2019-10-28][11:16:00][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
[2019-10-28][11:16:00][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:16:00][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
[2019-10-28][11:16:00][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:16:00][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
[2019-10-28][11:16:01][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:16:01][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
[2019-10-28][11:16:01][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:16:01][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
[2019-10-28][11:16:01][lsp::low_level_language_server][INFO] Calling LSP method `Completion`
[2019-10-28][11:16:01][lsp::low_level_language_server][ERROR] send error: "SendError(..)"
maxke24 commented 4 years ago

I'm having the exact same problem

sysRoot commented 4 years ago
[language.javascript]
command = "C:\Users\thero\AppData\Roaming\npm\node_modules\flow-bin\flow-win64-v0.118.0\flow"
args = ["lsp"]
install = [["npm", "install", "-g", "flow-bin"]]

I modified as such, still no love. Still tries to install it. EDIT: After escaping the \ with \ it seems to work... novice mistake.

paradox8599 commented 4 years ago
[language.javascript]
command = "C:\Users\thero\AppData\Roaming\npm\node_modules\flow-bin\flow-win64-v0.118.0\flow"
args = ["lsp"]
install = [["npm", "install", "-g", "flow-bin"]]

I modified as such, still no love. Still tries to install it. EDIT: After escaping the \ with \ it seems to work... novice mistake.

That is how I solved TabNine command execution problem. Just add the full path of the executable to the config file. But the point is, you have to use \ and escape it. Finally it looks like this. image

stared commented 4 years ago

Sadly, nothing worked for me on Windows 10 (neither these paths with ...npm\\flow, nor with ...npm\\flow.cmd).

What worked for me (from a similar thread is there https://github.com/codota/tabnine-vscode/issues/45):