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

function.definition changes to function.call if a newline is inserted after the return type #659

Open
a-stewart opened this issue Aug 7, 2024 · 0 comments

Comments

@a-stewart
Copy link
Contributor

a-stewart commented Aug 7, 2024

Consider the following code:

bool test1(int a) {
    return true;
}

bool
test2(int a) {
    return true;
}

Using inspect tokens and scopes, we see that test1 is defined as a entity.name.function.definition.

image

However, with the added line break, test2 is defined as a entity.name.function.call.

image

This is fine in the default VS Code theme, since these are coloured the same, however, with themes that differentiate, it results in the syntax highlighting looking off.

image

To reproduce the above, add the following to settings.json:

  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": ["entity.name.function.definition.cpp"],
        "settings": {
          "fontStyle": "bold underline",
          "foreground": "#8f224c",
        }
      }
    ]
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant