Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax colourisation goes to hell after specifying a return type for a lambda. #13210

Open
GrubbyHalo opened this issue Jan 28, 2025 · 4 comments
Assignees
Labels
Language Service more info needed The issue report is not actionable in its current state

Comments

@GrubbyHalo
Copy link

Environment

Version: 1.96.4
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Linux x64 6.12.10-arch1-1

ms-vscode.cpptools version 1.22.11

Bug Summary and Steps to Reproduce

Create a lambda with a return type as a parameter to a function call. all text after that has a single color. Blue in my case

Image

Configuration and Logs

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "linux-gcc-x64",
            "browse": {
                "databaseFilename": "/home/garf/hdd/intellisense/${workspaceFolderBasename}"
            }
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

@GrubbyHalo GrubbyHalo changed the title Syntax colourisation go to hell after a return type for a lambda. Syntax colourisation goes to hell after specifying a return type for a lambda. Jan 28, 2025
@GrubbyHalo
Copy link
Author

It seems as though I have solved my own issue. If i put space between the return type and the opening brace signifying the start of the function, the problem goes away.

@GrubbyHalo
Copy link
Author

Re-opened this issue as i don't think formatting the code in a certain way should alter the syntax highlighting.

@Colengms
Copy link
Contributor

Hi @GrubbyHalo . Could you try using the "Developer: Inspect Editor Tokens and Scopes" command, and click in the incorrectly colored areas? That should display information indicating whether the cursor position is in an area that is colored using a semantic token or textmate (lexical).

I think I've reproduced the issue. But the incorrect colors seem to be coming from textmate. The C/C++ Extension is responsible for the semantic token colorization. The lexical colorization comes from VS Code itself, and is provided by a contributor, from the repo here: https://github.com/jeff-hykin/better-cpp-syntax Could you confirm whether you are seeing an issue with textmate colorization? If so, I'd suggest opening an issue in that repo.

@Colengms Colengms self-assigned this Jan 28, 2025
@Colengms Colengms added the more info needed The issue report is not actionable in its current state label Jan 28, 2025
@GrubbyHalo
Copy link
Author

GrubbyHalo commented Jan 30, 2025

Hi @GrubbyHalo . Could you try using the "Developer: Inspect Editor Tokens and Scopes" command, and click in the incorrectly colored areas? That should display information indicating whether the cursor position is in an area that is colored using a semantic token or textmate (lexical).

I think I've reproduced the issue. But the incorrect colors seem to be coming from textmate. The C/C++ Extension is responsible for the semantic token colorization. The lexical colorization comes from VS Code itself, and is provided by a contributor, from the repo here: https://github.com/jeff-hykin/better-cpp-syntax Could you confirm whether you are seeing an issue with textmate colorization? If so, I'd suggest opening an issue in that repo.

@Colengms . Yip. It seems to be coming from the textmate extension. I actually assumed that it was coming from that as I see there are lots of related issues pertaining to that extension but I thought it might be to open an issue here as it looks as though that repo is getting stale (no commits for the last 6 months) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Service more info needed The issue report is not actionable in its current state
Projects
Status: No status
Development

No branches or pull requests

2 participants