Skip to content

Syntax highlighting fails inside for...to inside a computation expression #12449

Closed

Description

@piju3

I managed to find bug report #2680 which seems to describe the exact problem I'm having and was marked as closed in 2017. Whatever the cause, it appears to have come back, so I'm creating a new issue.

I can reproduce the problem in the latest version of both Visual Studio Community 2022 and 2019 (17.0.1, 16.11.7). Here is a screenshot of the same code from the other bug report in 2022:
image

I have noticed that the comments in the code actually seem to get highlighted correctly for a second while the project loads, but then change to the state shown in the screenshot.

Activity

  1. added this to the Backlog milestone on Oct 19, 2022
  2. T-Gro commented on Dec 19, 2022

    @T-Gro
    Member

    (needs recheck)

  3. added
    Area-VS-Editor
    and removed on Dec 19, 2022
  4. github-actions commented on Oct 18, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    This is not Windows-only: the Visual Studio classification service obtains semantic spans from FSharpCheckFileResults.GetSemanticClassification, while lexical coloring is exposed by FSharpSourceTokenizer; both are portable FSharp.Compiler.Service APIs.

    I reran the exact six-list repro from #2680 against current main at 99406265c88090c50e575afe8474f0979aa6f815 (committed 2026-10-17, about 29 hours old when tested), using freshly built Microsoft (R) F# Interactive version 15.2.200.0 for F# 11.2 artifacts. The semantic-classification result contains only the expected values, locals, method, and module spans—there is no range-operator span covering the loop body, which was the cause fixed by #2681. The tokenizer independently classifies each for, to, do, let, and yield as Keyword, and every // comment segment on the affected lines as Comment.

    The full solution build later ended with exit code 137 on the netstandard2.0 FSharp.Compiler.Service target, after producing the current net11.0 compiler/FCS artifacts used for this probe. The original highlighting corruption does not reproduce through either classification layer, so I am removing AI-thinks-windows-only and applying AI-thinks-issue-fixed for regression-test verification.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • southcentralus0.in.applicationinsights.azure.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "southcentralus0.in.applicationinsights.azure.com"

    See Network Configuration for more information.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@7c7feb61a52b662eb2089aa2945588b7a200d404
    
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

    AI-thinks-issue-fixedArea-VS-EditorBugFeature ImprovementNeeds-Confirmation

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions