-
Notifications
You must be signed in to change notification settings - Fork 767
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 Highlighting not for working for some scopes #401
Comments
Thanks for the feedback. Semantic colorization takes precedence over the syntax colorization provided by textmate grammar. The current release is limited to the VS Code built in list of semantic token types. The known list of token and their mapping is available at https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#semantic-token-scope-map In the next release, we've added some custom semantic token types to cover Python specific scenarios, such as the self parameter, cls parameter and dunder methods. Those will map to the existing python textmate scopes, such that colors for those identifiers will be the same with/without semantic colorization enabled. As for decorators, we've decided to keep them colored based on their semantic type (class or function). If there's enough demand, we can add custom types for those. For functions, we use the FYI you can see the token/scopes via |
I am trying to inform you that I use my own custom syntax colouring by customising scopes that I get from the "scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#6adb3e"
} When I do this for the Microsoft Language Server this seems to work fine but for Pylance this doesn't work among some other scopes as mentioned above. Hope the update allows me to change for more scopes using this json snippet. |
Here's how you can customize colors for functions: Using the semantic token:
Or using textmate scope:
|
This issue has been fixed in version 2020.9.7, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202097-30-september-2020 |
Environment data
Expected behaviour
![Screenshot 2020-09-22 at 5 52 16 PM](https://user-images.githubusercontent.com/67118602/93881660-d264c900-fcfc-11ea-8aa7-ef47f3fd24ac.png)
3. Decorator name should be highlighted as green. 4. Function name should be green.![Screenshot 2020-09-22 at 6 03 46 PM](https://user-images.githubusercontent.com/67118602/93882590-0bea0400-fcfe-11ea-8edd-a669a1c72c43.png)
5. Member Function calls are supposed to be green.Actual behaviour
![Screenshot 2020-09-22 at 5 56 59 PM](https://user-images.githubusercontent.com/67118602/93881865-15bf3780-fcfd-11ea-878e-f439ecd212a1.png)
variable.language.special.self.python, support.function.magic.python and variable.parameter.function.python aren't overriding default colouring scheme.![Screenshot 2020-09-22 at 6 01 41 PM](https://user-images.githubusercontent.com/67118602/93882624-16a49900-fcfe-11ea-8fdd-8a8ca52adbae.png)
entity.name.function.decorator.python and entity.name.function.python aren't overriding the default colour scheme.![Screenshot 2020-09-22 at 6 11 15 PM](https://user-images.githubusercontent.com/67118602/93883461-34263280-fcff-11ea-8508-06b460b4ff4e.png)
meta.function-call.generic.python isn't overriding the default colour scheme.Logs
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: