Don't repeat suggestions for same symbol (#21140)

* Track seen module graphs so symbols from the same module aren't repeated
Add test case

* Track symbols instead of modules

* Don't show duplicate symbols in spell checker

Removes the declared location from the message. Since we don't show duplicates anymore it would be a bit misleading if we only show the location for the first declaration of the symbol
This commit is contained in:
Jake Leahy 2022-12-23 00:44:10 +11:00 • committed by GitHub
commit 18c115c8d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 35 deletions

View file

@ -0,0 +1,21 @@
discard """
# pending bug #16521 (bug 12) use `matrix`
cmd: "nim c --spellsuggest:4 --hints:off $file"
action: "reject"
nimout: '''
tspellsuggest3.nim(21, 1) Error: undeclared identifier: 'fooBar'
candidates (edit distance, scope distance); see '--spellSuggest':
(1, 2): 'FooBar'
(1, 2): 'fooBar4'
(1, 2): 'fooBar9'
(1, 2): 'fooCar'
'''
"""
import ./mspellsuggest
import ./mspellsuggest
import ./mspellsuggest
import ./mspellsuggest
fooBar