This extension enables the display of the inferred types of identifiers declared with the var keyword, similar to the CodeLens items.
This extension works with VS2019 and NEW in VS2022, too.
Please let me know if there are issues with VS2019 versions < 16.10, I updated the nuget references trying to get the azure devops build working ... unsuccessfully, so i might downgrade them again.
Options
You can change the text size and color of the type names, and disable the adornments.
Screenshots
In Action
Options Page
Known Issues
When doing Drag&Drop inside an editor window into a line that has adornments, the Drag&Drop operation inserts the text at the beginning of that line. you then have to drag the text into the desired column. this is a known bug in VS that will hopefully be fixed with VS2019.
When changing the options, a refresh must occur in the editor for the changed otions to be respected (e.g. scroll)
TODOs
improve icons for the extension and for the Command for enabling/disabling the adornments
exclude list e.g. for types or literals / identifier patterns ??
tagging var immediately after comments
set the default color of the adornment to the color the var keyword is drawn in.
change the options page category title to something common to all my extions. ideas welcome
1.9.2022.2019 Improvements regarding the options, i think, migration to github (that's why i don't know exactly, anymore, sorry - but i tested it, so it should all be working :-) )
1.8.2022.2019 Support for VS2022. I downgraded a nuget ref. please let me know if there are new errors coming up...
1.6.2 Bugfix for VS 2019 16.10 behaviour change regarding SpaceNegotiatingTags
1.5 removed Inline error feature to put it in a separate extension, adjusted adornment line height.
1.4.1 fixed a nullReference in the inline error display
1.4 new Feature Error inline display
1.3.12 additional cases for the adornments: after { and ; \t and at the start of the line.
1.3.10 Possible Bug with SnapshotPoint
1.3.9 Added Command to disable var adornments without going into the options dialog. Bumped max VS version to 2019. Bugfix in options initialization
1.3.7 fixed NullReferenceException in Options Persistence, Renamed from VsVarAdornment to "C# Var Type CodeLens"