algorithm - Efficient autocomplete for a language server - Stack Overflow

admin2025-04-26  2

I'm currently thinking about how to efficiently implement autocomplete/intellisense in a language server environment.

The task would be to find all symbols/identifiers (e.g. type names, function, constants, etc.) that match a user-typed string. Both the input and the symbols/identifiers are expected to be quite short but some degree of typos should be tolerated.

What should also be accounted for is that in a development environment the actively developed module changes often and rapidly while e.g. imported libraries remain mostly static.

What kind of data-structure / algorithm is favorable in such an application?

I found some older discussion (1 ,2) that suggests Tries and Ngrams but would be happy about an opinion on this (and if there are other ways to do this in 2024).

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745630513a310987.html

最新回复(0)