* for inlay type hints, take only nimsuggest symbols with isGenericInstance = false

* for inlay exception hints, take only nimsuggest symbols with isGenericInstance = true
This commit is contained in:
Nikolay Nikolov
2024-05-14 19:05:35 +03:00
parent bb4af90799
commit 284f3cec81

View File

@@ -1271,9 +1271,9 @@ proc executeNoHooksV3(cmd: IdeCmd, file: AbsoluteFile, dirtyfile: AbsoluteFile,
let s = graph.findSymDataInRange(file, line, col, endLine, endCol)
for q in s:
if typeHints and q.sym.kind in {skLet, skVar, skForVar, skConst} and q.isDecl and not q.sym.hasUserSpecifiedType:
if typeHints and q.sym.kind in {skLet, skVar, skForVar, skConst} and q.isDecl and not q.sym.hasUserSpecifiedType and not q.isGenericInstance:
graph.suggestInlayHintResultType(q.sym, q.info, ideInlayHints)
if exceptionHints and q.sym.kind in {skProc, skFunc, skMethod, skVar, skLet, skParam} and not q.isDecl:
if exceptionHints and q.sym.kind in {skProc, skFunc, skMethod, skVar, skLet, skParam} and not q.isDecl and q.isGenericInstance:
graph.suggestInlayHintResultException(q.sym, q.info, ideInlayHints, caughtExceptions = q.caughtExceptions, caughtExceptionsSet = q.caughtExceptionsSet)
else:
myLog fmt "Discarding {cmd}"