@@ -81,7 +81,16 @@ proc cmpSuggestions(a, b: Suggest): int =
81
81
# independent of hashing order:
82
82
result = cmp(a.name[], b.name[])
83
83
84
- proc getTokenLenFromSource(conf: ConfigRef; ident: string ; info: TLineInfo): int =
84
+ proc scanForTrailingAsterisk(line: string , start: int ): int =
85
+ result = 0
86
+ while start+ result < line.len and line[start+ result ] in {' ' , '\t ' }:
87
+ inc result
88
+ if start+ result < line.len and line[start+ result ] == '*' :
89
+ inc result
90
+ else :
91
+ result = 0
92
+
93
+ proc getTokenLenFromSource(conf: ConfigRef; ident: string ; info: TLineInfo; skipTrailingAsterisk: bool = false ): int =
85
94
let
86
95
line = sourceLine(conf, info)
87
96
column = toColumn(info)
@@ -105,6 +114,8 @@ proc getTokenLenFromSource(conf: ConfigRef; ident: string; info: TLineInfo): int
105
114
result = identLen(line, column)
106
115
if cmpIgnoreStyle(line[column.. column + result - 1 ], ident[0 .. min(result - 1 ,len(ident)- 1 )]) != 0 :
107
116
result = 0
117
+ if skipTrailingAsterisk and result > 0 :
118
+ result += scanForTrailingAsterisk(line, column + result )
108
119
else :
109
120
var sourceIdent: string
110
121
result = parseWhile(line, sourceIdent,
@@ -179,7 +190,7 @@ proc symToSuggest*(g: ModuleGraph; s: PSym, isLocal: bool, section: IdeCmd, info
179
190
result .tokenLen = if section notin {ideHighlight, ideInlayHints}:
180
191
s.name.s.len
181
192
else :
182
- getTokenLenFromSource(g.config, s.name.s, infox)
193
+ getTokenLenFromSource(g.config, s.name.s, infox, section == ideInlayHints )
183
194
result .version = g.config.suggestVersion
184
195
result .endLine = endLine
185
196
result .endCol = endCol
0 commit comments