The Wayback Machine - https://web.archive.org/web/20201206081253/https://github.com/MagicStack/MagicPython/issues/123
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

`from` in the `from mod import fun` statement has `keyword.control.import.python` scope only if `mod` consists of dots #123

Closed
zzag opened this issue Jan 17, 2018 · 3 comments
Assignees
Labels
bug

Comments

@zzag
Copy link

@zzag zzag commented Jan 17, 2018

  • Editor name and version: Visual Studio Code 1.19.2
  • Platform: Linux
  • Color scheme: Dark+(default)

from_ok

from_wrong

In both cases, from should have the following scopes:

  • keyword.control.import.python
  • source.python
@1st1 1st1 added the bug label Jan 17, 2018
@zzag
Copy link
Author

@zzag zzag commented Jan 17, 2018

I guess it has something to do with the match \s* \b(from)\b \s*(\.+)\s* (import)? (https://github.com/MagicStack/MagicPython/blob/master/grammars/src/MagicPython.syntax.yaml#L834)

@1st1
Copy link
Member

@1st1 1st1 commented Oct 4, 2018

@vpetrovykh please take a look

@elprans
Copy link
Member

@elprans elprans commented Oct 5, 2018

Also, as should probably be in the import scope as well.

from foo import bar as spam
vpetrovykh added a commit that referenced this issue Oct 10, 2018
Use `keyword.control.import.python` scope for `from`, `import`, and `as`
keywords when they appear as part of an import statement.
Use `keyword.control.flow.python` scope for `from` and `as` if they
appear elsewhere.

Issue: #123.
1st1 added a commit that referenced this issue Oct 21, 2018
Use `keyword.control.import.python` scope for `from`, `import`, and `as`
keywords when they appear as part of an import statement.
Use `keyword.control.flow.python` scope for `from` and `as` if they
appear elsewhere.

Issue: #123.
@vpetrovykh vpetrovykh closed this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.