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

Python has no TextMate scope for variables #78711

Closed
Mooninaut opened this issue Aug 8, 2019 · 2 comments
Closed

Python has no TextMate scope for variables #78711

Mooninaut opened this issue Aug 8, 2019 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar

Comments

@Mooninaut
Copy link

Mooninaut commented Aug 8, 2019

Issue Type: Bug

There is no TextMate (TM) scope for ordinary variables in Python. In order to style ordinary Python variables, it is necessary to set the entire source.python scope to the desired color and font style, and then select every .python scope individually to change the color and font style back.

The problem still exists with all extensions disabled.

Example using Developer: Inspect TM Scopes
image

Example theme workaround:

{
  "scope": "source.python",
  "settings": {
    "foreground": "#76aae0"
  }
},
{
  "scope": [
    "keyword.operator.arithmetic.python",
    "keyword.operator.assignment.python",
    "keyword.operator.comparison.python",
    "punctuation.definition.arguments.begin.python",
    "punctuation.definition.arguments.end.python",
    "punctuation.definition.dict.begin.python",
    "punctuation.definition.dict.end.python",
    "punctuation.definition.list.begin.python",
    "punctuation.definition.list.end.python",
    "punctuation.section.function.lambda.begin.python",
    "punctuation.separator.annotation.result.python",
    "punctuation.separator.arguments.python",
    "punctuation.separator.colon.python",
    "punctuation.separator.element.python",
    "punctuation.separator.period.python"
  ],
  "settings": {
    "foreground": "#dadada",
  }
},
{
  "scope": [
    "meta.function-call.generic.python",
    "support.function.builtin.python"
  ],
  "settings": {
    "foreground": "#ff8000",
  }
}

VS Code version: Code 1.36.1 (2213894, 2019-07-08T22:56:38.504Z)
OS version: Darwin x64 18.7.0

@alexr00
Copy link
Member

alexr00 commented Aug 13, 2019

This is a neat idea, but it is beyond what can be done with textmate. An exploration of how this could be down outside of textmate is here: #77140

@alexr00 alexr00 added *duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar labels Aug 13, 2019
@vscodebot
Copy link

vscodebot bot commented Aug 13, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Aug 13, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

2 participants