Repository navigation
Labels
Area-LangService-ColorizationBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
The problem is here
fsharp/src/Compiler/Service/SemanticClassification.fs
Lines 311 to 329 in d441308
| | Item.Types (_, ty :: _), LegitTypeOccurence, m -> | |
| let ty = stripTyEqns g ty | |
| if isDisposableTy g amap ty then | |
| add m SemanticClassificationType.DisposableType | |
| else | |
| match tryTcrefOfAppTy g ty with | |
| | ValueSome tcref -> add m (reprToClassificationType g tcref.TypeReprInfo tcref) | |
| | ValueNone -> | |
| if isStructTupleTy g ty then | |
| add m SemanticClassificationType.ValueType | |
| elif isRefTupleTy g ty then | |
| add m SemanticClassificationType.ReferenceType | |
| elif isForallFunctionTy g ty then | |
| add m SemanticClassificationType.Function | |
| elif isTyparTy g ty then | |
| add m SemanticClassificationType.ValueType | |
| else | |
| add m SemanticClassificationType.TypeDef |
We check for a disposable type first.
Expected behavior
IConn in source code should be classified as an interface. Or perhaps the tooltip coloring should be changed?
Actual behavior
IConn in source code is classified as a disposable type. IConn in tooltip is classified as an interface.
Reacted by Petr
Metadata
Metadata
Assignees
Labels
Area-LangService-ColorizationBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

Activity
[-]Inconsistent coloring of interface ihneriting IDisposable[/-][+]Inconsistent coloring of interface inheriting IDisposable[/+]majocha commentedon Nov 21, 2023
Tooltips use
TextTagtype for colorization, notSemanticClassificationType. Unfortunately there is no one-to-one mapping between those. That's why tooltips entirely miss some semantic colors for mutability, disposable value / type etc.IIRC tooltip text generation and tagging happens mostly in
NicePrint.fs.Add release notes for #16268 fix and add trailing newline to test file
Fix #16268: classify IDisposable in type-occurrence positions as Inte…
Add release notes for #16268 fix and add trailing newline to test file
Strengthen #16268 concrete-disposable test to exercise Item.Types arm
Fix #16268: classify IDisposable in type-occurrence positions as Inte…