Skip to content

modification to #member-access repository #188

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

Closed
CasuallyCalm opened this issue Aug 27, 2019 · 2 comments · Fixed by #190
Closed

modification to #member-access repository #188

CasuallyCalm opened this issue Aug 27, 2019 · 2 comments · Fixed by #190

Comments

@CasuallyCalm
Copy link

CasuallyCalm commented Aug 27, 2019

I'm working with VSCode, would it be possible to get a scope name for member-access? It might just be personal preference but it's nice when themes are able to take advantage of when they're used.

Default

default

Named member-access

named

It can be taken a bit further by adding another repository for it to check against. I only have a few hours of textMate exposure so I'm sure there are better ways of doing this. I don't have a lot of experience with regex either so most of this I just bogarted from the source.js file since it supports what I'm trying to do.

Here's a gist of my modded MagicPython that was used by VSCode The added repository is called class-call

And an example of what that produces

modded_source

@1st1
Copy link
Member

1st1 commented Aug 27, 2019

@vpetrovykh

@vpetrovykh
Copy link
Member

I would probably go with adding a meta.member.access.python to all the syntax rules that start with a .. The other meta scopes can be used to distinguish whether this is a method or attribute, etc. Generally this has the advantage of covering a sufficiently base case so that if we have some more special differentiation of the actual kinds of member access, those don't need to replicate the scoping logic.

vpetrovykh added a commit that referenced this issue May 1, 2020
Add `meta.attribute.python` to mark otherwise non-special attributes.
Add `meta.indexed-name.python` to mark the name of the object being
indexed.

In combination with `meta.member.access.python` the above scopes can
help highlight member access that is no otherwise using a builtin or
some other special case. For highlighting method names in method calls
the combination of `meta.member.access.python` and
`meta.function-call.generic.python` could be used.

Fixes #188.
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

Successfully merging a pull request may close this issue.

3 participants