Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

[Highlight usages] Generic parameters are not highlighted properly #25

Closed
vasily-kirichenko opened this issue Feb 13, 2014 · 7 comments
Closed

Comments

@vasily-kirichenko
Copy link
Contributor

This is how the C# editor highlights generic parameters:
image
image
This is how the add-in works:
image
image

@OkayX6
Copy link
Contributor

OkayX6 commented Feb 18, 2014

Question: shouldn't we have the plug-in highlight the single quote as part of the generic type symbol too?

@dungpa
Copy link
Contributor

dungpa commented Feb 18, 2014

Yes, we should highlight single quotes in 'T and 'P. The issue is that VS doesn't automatically select them as words. We need to manipulate spans using the lexer and update references from F.C.S.

@vasily-kirichenko Could you please check whether we get all the references for type variables by using F.C.S 0.0.20?

@vasily-kirichenko
Copy link
Contributor Author

I checked this on the master (which uses 0.0.20 now).
For line:

type C<'a> = C of 'a

the following call (we "place" the cursor inside the first 'a):

CheckFileResults.GetSymbolAtLocation(15, 9, "type C<'a> = C of 'a", ["'a"])

it returns None.
If we place the cursor on the second 'a:

CheckFileResults.GetSymbolAtLocation(15, 20, "type C<'a> = C of 'a", ["'a"])

we get a Some(symbol), then we are trying to get the refs for it:

CheckProjectResults.GetUsesOfSymbol(symbol)

results:
image
So, we can highlight the second 'a occurrence only:
image

@7sharp9
Copy link

7sharp9 commented Feb 20, 2014

It would be good to get type parameter highlighting in XS too.

@dungpa
Copy link
Contributor

dungpa commented Feb 20, 2014

We are altering findLongIdent by GetLongIdent function based on the lexer, which correctly identifies type parameters. When this issue is resolved, one can pull the changes to FSharpBinding easily.

@dungpa dungpa added bug labels Mar 4, 2014
@ghost
Copy link

ghost commented Mar 4, 2014

Should be fixed in FCS 0.0.22

@vasily-kirichenko
Copy link
Contributor Author

Yes, it fixed after updating to 0.0.22 here #97

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants