Skip to content

Inconsistent coloring of interface inheriting IDisposable #16268

Closed

Description

@kerams

image

The problem is here

| 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.

Activity

  1. added this to the Backlog milestone on Nov 13, 2023
  2. changed the title [-]Inconsistent coloring of interface ihneriting IDisposable[/-] [+]Inconsistent coloring of interface inheriting IDisposable[/+] on Nov 13, 2023
  3. added
    Impact-Low
    and removed on Nov 13, 2023
  4. majocha commented on Nov 21, 2023

    @majocha
    Contributor

    Tooltips use TextTag type for colorization, not SemanticClassificationType. 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.

  5. added a commit that references this issue on May 28, 2026
  6. added 2 commits that reference this issue on May 29, 2026
    9743552
    298dba9
  7. added a commit that references this issue on Jun 23, 2026
  8. added a commit that references this issue on Jul 3, 2026
    e16435d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-ColorizationBugImpact-Low

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions