Skip to content

Conversation

@vasily-kirichenko
Copy link
Contributor

ColorizationService returned duplicated spans in some cases which caused FindReferencesService to crash somewhere in Roslyn code as it checks given spans for overlapping.

It also added a glyph for a definition symbol in Find References results window:

image

@smoothdeveloper
Copy link
Contributor

@vasily-kirichenko I wonder if the issue is with the implementation itself at https://github.com/Microsoft/visualfsharp/blob/b3f6501ead8997c2b7f2e34fce75219d657aed2c/src/fsharp/vs/service.fs#L1394 ?

Maybe it is at least worth putting a comment at the call site explaining the reason for Array.distinctBy fst, as well as a comment in the method itself mentioning duplicate spans being potentially returned.

@vasily-kirichenko
Copy link
Contributor Author

I also completely fixes #2140

image

@vasily-kirichenko
Copy link
Contributor Author

@smoothdeveloper other editors may want to get duplicated spans because I suspect (I've not checked, sorry) they are not strictly duplicated, but related to different symbols (for example, type itself and its primary ctor, I believe). I think it's absolutely necessary to distinct spans right on VS side because an assumption that FCS does not return duplicates is rather weak and fragile.

@KevinRansom KevinRansom merged commit f8e579f into dotnet:master Jan 6, 2017
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* add glyph for declarations in Find All References result window

* fixed: ColorizationService may return duplicated spans which caused FindReferencesService to crash

* remove #nowarn "1182"

* fixed: FindReferencesService does not work on external symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants