microsoft / microsoft/monaco-editor

[Bug] Incorrect Syntax Highlighting for 'End Sub' and 'Sub' in VB.NET Code

Open
#4,783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link

No response

Monaco Editor Playground Code

Reproduction Steps

No response

Actual (Problematic) Behavior

No response

Expected Behavior

No response

Additional Context

Bug Report: Incorrect Syntax Highlighting for VB.NET in Monaco Editor
Description
When using Monaco Editor to highlight VB.NET code, the syntax highlighting renders incorrectly under certain conditions. Specifically, when the following VB.NET code is entered:

Public Class Form1
Private Sub abc()
End Sub
End Class

The End Sub and Sub keywords are incorrectly rendered in green (as if they were comments).
This behavior does not align with the expected VB.NET syntax highlighting rules.
Steps to Reproduce
Set the language of Monaco Editor to vb.
Paste the following VB.NET code into the editor:

Public Class Form1
Private Sub abc()
End Sub
End Class

Observe that the End Sub and Sub keywords are highlighted in green.
Expected Behavior
End Sub and Sub should be rendered in a different color, as per VB.NET syntax highlighting conventions, not in green.
Actual Behavior
End Sub and Sub are highlighted in green, which is incorrect.
Environment
Monaco Editor Version: [monaco-editor-0.52.2]
Browser: [Google Chrome-131.0.6778.140]
Operating System: [Windows 10]
Screenshots

Additional Notes
This issue appears to be related to the VB.NET syntax tokenizer used by Monaco Editor. It seems to misidentify certain keywords as comments.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Monaco's VB.NET syntax tokenizer, using the VB.NET language registration and the reproduction snippet in the issue as the entry point. Verify that Sub and End Sub are tokenized as keywords rather than comments, and confirm the sample renders with the corrected highlighting.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.