mathworks / mathworks/MATLAB-extension-for-vscode
Syntax highlighting is buggy in class folders
Nobody has claimed this yet.
- 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:
- Create a class-folder (also nested in namespaces)
- Create the classes main file, e.g. +mynamespace/@MyClass/MyClass.m
- Create another method for the class and to arbitrary work on the class
- open and edit documents. Sometime the behavior appears only after a loaded document is changed.
- Visually inspect the document in VSCode.
Expected behavior
The same highlighting behavior between files in "normal" folders as in class folders.
Screenshots
Useful Information
- MATLAB Version: R2025b, 1.3.13
- OS Version: Ubuntu 24.04, Arch
- VS Code Version: 1.130
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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