From 7caa0379366a500b5db11922d3ac1e739dd5dea1 Mon Sep 17 00:00:00 2001 From: Ivan Yonchovski Date: Thu, 6 Oct 2022 08:18:46 +0300 Subject: Fix/improve handling of forward declarations in nimsuggest (#20493) * Fix/improve handling of forward declarations in nimsuggest - ideUse now works fine when invoked on the implementation - implemented ideDeclaration to make cover lsp feature textDocument/declaration - fixed performance issue related to deduplicating symbols. Now the deduplication happens after the symbols are filtered. As a alternative we might change the way cached symbols are stored(e. g. use set). - I also fixed the way globalSymbols work. Now it will sort the responses based on the match location to make sure that the results are sorted in user friendly way. * Update nimsuggest/nimsuggest.nim Co-authored-by: Andreas Rumpf Co-authored-by: Andreas Rumpf --- compiler/suggest.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/suggest.nim') diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 9d4089707..b5f787296 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -164,7 +164,7 @@ proc symToSuggest*(g: ModuleGraph; s: PSym, isLocal: bool, section: IdeCmd, info result.tokenLen = 0 else: let infox = - if useSuppliedInfo or section in {ideUse, ideHighlight, ideOutline}: + if useSuppliedInfo or section in {ideUse, ideHighlight, ideOutline, ideDeclaration}: info else: s.info -- cgit 1.4.1-2-gfad0