From 284f3cec817fa668341bb2c3fde09995d59621da Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Tue, 14 May 2024 19:05:35 +0300 Subject: [PATCH] * for inlay type hints, take only nimsuggest symbols with isGenericInstance = false * for inlay exception hints, take only nimsuggest symbols with isGenericInstance = true --- nimsuggest/nimsuggest.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index c6eb20bcd3..a8e43e8472 100644 --- a/nimsuggest/nimsuggest.nim +++ b/nimsuggest/nimsuggest.nim @@ -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}"