Semantic Completion
Semantic completion permits suggestions which make use of language-specific information.
For example, this suggestion requires TabNine to infer that x
is a string:

For information about the features TabNine provides once semantic completion is enabled, see this blog post.
TabNine is language agnostic, so it relies on other software to provide semantic completions. Any server which implements the Language Server Protocol can be used as a source of semantic completions.
TabNine comes with default choices of language servers for many common languages. You can also override TabNine's defaults to use a language server of your choice (described later).
To get semantic completion working:
- Verify you are running TabNine 1.0.5 or above by typing
TabNine::version
in your text editor. If you're running an earlier version, try restarting your editor. - Type
TabNine::sem
to enable semantic completion. - If TabNine notifies you of an error, try installing the semantic completion backend manually by following the link in the table. If you don't see any message, then semantic completion is working.
If the above steps don't work, check that the language server works when you run it in your terminal. If it works in the terminal, but TabNine can't find it, follow these steps:
- 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. - Type
TabNine::config_dir
in your editor to find your configuration directory. - Find the entry in
<config_dir>/ExampleTabNine.toml
corresponding to your language. In this case it is:[language.go] command = "go-langserver" args = ["-mode", "stdio", "-gocodecompletion"] install = [["go", "get", "-u", "github.com/sourcegraph/go-langserver"]]
- Create a file
<config_dir>/TabNine.toml
and paste the entry you found above into it, but replace thecommand
field with the absolute path you found in step 1. (If you're on Windows, you'll need to escape the backslashes in the path, for exampleC:\Users\janedoe
should be replaced withC:\\Users\\janedoe
.) - Type
TabNine::restart
into your text editor.
Language | Commands | Project link |
---|---|---|
JavaScript | npm install -g typescript-language-server typescript-language-server --stdio | TypeScript Language Server |
TypeScript | npm install -g typescript-language-server typescript-language-server --stdio | TypeScript Language Server |
Python | pip install python-language-server pyls | Python Language Server |
C/C++ | clangd (manual installation) | cquery |
Rust | rustup update rustup component add rls rust-analysis rust-src rls | Rust Language Server |
Go | go get -u golang.org/x/tools/gopls gopls serve | Go Language Server |
Ruby | gem install solargraph solargraph stdio | Solargraph |
HTML | npm install -g vscode-html-languageserver-bin html-languageserver --stdio | VS Code HTML Language Server |
OCaml/Reason | npm install -g ocaml-language-server ocaml-language-server --stdio | OCaml Language Server |
Haskell | hie --lsp (manual installation) | Haskell IDE Engine |
Dart | pub global activate dart_language_server dart_language_server | Dart Language Server |
PureScript | npm install -g purescript-language-server purescript-language-server --stdio | PureScript Language Server |
CSS | npm install -g vscode-css-languageserver-bin css-languageserver --stdio | vscode-css-languageserver-bin |
SCSS | npm install -g vscode-css-languageserver-bin css-languageserver --stdio | vscode-css-languageserver-bin |
Custom configuration
Create a file called TabNine.toml
in your TabNine configuration directory. You can find your TabNine configuration directory by typing TabNine::config_dir
into a file while TabNine is running.
Here is an example TabNine.toml
which uses ccls for C++ completion rather than the default choice of cquery. It also does the following:
- Allows TabNine to start 2 language servers to enable prefetching.
- Configures TabNine to wait for the language server to respond when the user types
.
(rather than returning TabNine's results immediately and caching the server's response for future requests). This is enabled by default for both.
and::
. - Waits 200 ms for the language server to respond when the user types
.
or::
(the default is 50 ms). - Prevents TabNine from always preferring language server suggestions over other identifiers.
[language.cpp] command = "ccls" args = ["--init={\"cacheDirectory\":\"${project_root}/.ccls\"}"] synchronous_triggers = ["."] synchronous_timeout_ms = 200 num_server_instances = 2 always_prefer = false