mathworks / mathworks/MATLAB-extension-for-vscode

Syntax highlighting is buggy in class folders

Open
#341 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When having code in a class folder (beginning with '@') the highlighting is inconsistent and all over the place for the main class declaration file. This reaches from just missing keyword highlighting (for, classdef, ...) to arbitrary words having multiple colors. This makes reading of documents very hard and efficient working nearly impossible.

To Reproduce
Steps to reproduce the behavior:

  1. Create a class-folder (also nested in namespaces)
  2. Create the classes main file, e.g. +mynamespace/@MyClass/MyClass.m
  3. Create another method for the class and to arbitrary work on the class
  4. open and edit documents. Sometime the behavior appears only after a loaded document is changed.
  5. Visually inspect the document in VSCode.

Expected behavior
The same highlighting behavior between files in "normal" folders as in class folders.

Screenshots
Image

Useful Information

  • MATLAB Version: R2025b, 1.3.13
  • OS Version: Ubuntu 24.04, Arch
  • VS Code Version: 1.130

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

No source file or test is named. Start by reproducing the issue in VS Code with the nested MATLAB class-folder path +mynamespace/@MyClass/MyClass.m, including a method file and a changed loaded document. Compare highlighting with an equivalent normal folder; done means keywords and arbitrary words are highlighted consistently in the class-folder files.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.