jeff-hykin / better-cpp-syntax

💾 The source of VS Code's C++ syntax highlighting
GNU General Public License v3.0
155 stars 30 forks source link

Argument `&classname` highlighted incorrectly #656

Closed alexr00 closed 7 months ago

alexr00 commented 7 months ago

Checklist

If Disabling that^ makes the problem go away, then follow this to make an issue on the C++ extension: https://github.com/microsoft/vscode-cpptools/issues/new/choose

The code with a problem is:

static QAccessibleInterface *factory(const QString &classname, QObject *object) {
    if (classname == QLatin1String("VBase") && object && object->isWidgetType())
        return new Base(static_cast<QWidget *>(object));

    return 0;
}

It looks like:

image

It should look like:

This classname should be highlighted as identifier, but it's got the class keyword and highlighted as Keyword not identifier. And when I restart VSCode, it's occurs again.

Originally from @AlmondRyan in https://github.com/microsoft/vscode/issues/210151