You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Syntax highlighting fails inside for...to inside a computation expression #12449
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:
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.
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:
Activity
T-Gro commentedon Dec 19, 2022
(needs recheck)
github-actions commentedon Oct 18, 2026
🤖 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 byFSharpSourceTokenizer; both are portable FSharp.Compiler.Service APIs.I reran the exact six-list repro from #2680 against current
mainat99406265c88090c50e575afe8474f0979aa6f815(committed 2026-10-17, about 29 hours old when tested), using freshly builtMicrosoft (R) F# Interactive version 15.2.200.0 for F# 11.2artifacts. 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 eachfor,to,do,let, andyieldasKeyword, and every// commentsegment on the affected lines asComment.The full solution build later ended with exit code 137 on the
netstandard2.0FSharp.Compiler.Service target, after producing the currentnet11.0compiler/FCS artifacts used for this probe. The original highlighting corruption does not reproduce through either classification layer, so I am removingAI-thinks-windows-onlyand applyingAI-thinks-issue-fixedfor regression-test verification.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
southcentralus0.in.applicationinsights.azure.comSee Network Configuration for more information.
Add this agentic workflows to your repo
To install this agentic workflow, run