-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NimSuggest: Fix for the inlay exception hints with generic procs #23610
base: devel
Are you sure you want to change the base?
NimSuggest: Fix for the inlay exception hints with generic procs #23610
Conversation
…e shouldn't be modified, instead the code needs to be adapted to return the previous value + added parameter isGenericInstance to markUsed * restored the previous calls to markUsed with isGenericInstance false * markUsed with isGenericInstance is ignored for now, but it will be stored in the nimsuggest database later
…easons (although the parameter is currently not used)
…en inlay exception hints are turned on * avoid all ideUse, ideDef, etc. commands in suggestSym when isGenericInstance is true
…stance = false * for inlay exception hints, take only nimsuggest symbols with isGenericInstance = true
…ange, deduplicateSymInfoPair, etc.
…to mark caught exceptions only for isGenericInstance=true records
Seems to work pretty well, but while looking for issues I found that iterators do not participate either (perhaps because of their transformation step?) Not a regression, previous version also didn't handle iterators from what I can tell. Also not as disruptive as the generic issue because this one at least doesn't put false positives everywhere. proc foo() =
raise newException(ValueError, "a")
iterator bar(): int =
raise newException(OSError, "b")
iterator foobar[T](): T =
raise newException(LibraryError, "c")
foo() # bell
for x in bar(): # no bell
discard
for x in foobar[float](): # no bell
discard |
I think it's best to report this as a separate issue, because IMO it's independent from this fix. |
Based on the fix, started by SirOlaf in #23414