Tabnine was created as a language-agnostic autocompleter. The core idea behind Tabnine is that by indexing your code and detecting statistical patterns within it, Tabnine can make better suggestions than a completer which understands your programming language. This brings additional gains in responsiveness, reliability, and ease of configuration because Tabnine doesn’t need to compile your code.
Nonetheless, there are some situations where you would rather use a semantic completer than Tabnine. For example, if you don’t know what methods are contained in the class Math, you could type Math. and see what suggestions are provided by the semantic completer. Also, semantic completers can provide documentation and type signatures together with their suggestions.
That’s why Tabnine now supports semantic completion. Tabnine continues to be language-agnostic: semantic completion is provided by external software which Tabnine communicates with using the Language Server Protocol. Tabnine comes with default install scripts for several common language servers, and this is fully configurable, so you can use a different language server or add semantic completion for a new language if you wish. You can read more about how to configure it here.
Here’s an example:
Here, Tabnine uses the language server to provide type signatures and documentation for the suggestions. Also note that Tabnine is using its index to sort the language server’s suggestions in order of frequency, placing new and with_capacity at the top.
The skeptical reader asks: why use Tabnine together with a language server when I could simply use the language server instead? Here are three ways in which Tabnine improves the user experience over the language server alone:
Semantic completion is part of Tabnine 1.0.7. You can read the full changelog here.