-
Notifications
You must be signed in to change notification settings - Fork 77
Printf specifiers tagger #1257
Printf specifiers tagger #1257
Conversation
Dig up the old code, here it is https://github.com/fsprojects/VisualFSharpPowerTools/blob/8c172d04050559655be75e28182ec8e3cc027641/src/FSharpVSPowerTools.Logic/HighlightUsageTagger.fs#L21-L35. The main issue is to hook up theme change in order to have appropriate colors for each theme. |
@dungpa what do you think we should use instead of these types (I've copy-pasted them from classifier) https://github.com/fsprojects/VisualFSharpPowerTools/blob/1339ba748a51c0529329096cccde9f17ee11dafb/src/FSharpVSPowerTools/Commands/PrintfSpecifiersUsageTaggerProvider.cs#L68-L72 ? |
Fixed the issue with themes. Now we should grab the proper Dark theme color from R#. |
@dungpa do you think we should add a separate sub-setting for this feature? |
fixed: wrong behavior for partially applied printf
I think it's ready. |
Wait, it does not work for user defined printf functions. |
@dungpa I mean the tags color, not classifier color. I've grabbed it. OK, finding printf argument positions is rather messy, especially if they are forward/backward piped. That said, the feature works in most case. |
{ SpecifierRange: Range.range | ||
ArgumentRange: Range.range } | ||
|
||
let private sortRange (r: Range.range) = r.StartLine, r.StartColumn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean 'startPos' i.e. a tuple denoting start position? (sortRange sounds like a totally different thing.)
Looks great. I agree it should be a separate feature with its own setting. |
All done. |
Awesome. |
This super handy feature doesn't seem to work in fsx files for me, but works in fs files. Is this known and expected, or a bug? I'm running Visual Studio 2013; F# 3.x I think. F# Interactive version 12.0.30815.0. Ok, yup, I have a C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0 folder but not a F# 4.0. |
@WildBamboo It's a bug. Could you open a separate issue with more information e.g. (1) What is location of FSharp.Core 4.3.1.0 in your system? (2) Can you see any error logged in Diagnostics mode http://fsprojects.github.io/VisualFSharpPowerTools/faq.html#What-is-Diagnostic-mode-When-should-I-use-it? Thanks. |
Created issue #1257 and in the process got some more info. It appears
|
It works like this:
I'd like to use different color for this tags. Currently I reuse "MarkerFormatDefinition/HighlightedReference", as
HighlightUsageTagger
does. @dungpa do you know a way to add a color (visible in settings) and specify to use it in this new tagger? If I remember correctly, we did use a custom color for tags until we found out how to use the standard one.