MagicStack / MagicStack/MagicPython
Syntax Highlighting Error - Inconsistent Scoping for Keywords
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
* **Editor name and version**:
- Sublime Text 3
- Version 3.2.2, Build 3211
* **Platform**:
- MacOS (Catalina)
* **Color scheme**:
[Link to a repository with my slightly customized color schemes.](https://github.com/jarrodchung-dev/custom-sublime-color-schemes)
They are slight variations to the Material and Materialize color schemes.
* **MagicPython version**: 1.1.1 (according to my package.json)
* **A screenshot**:

* **5-10 lines of surrounding code**:
```python
def syntax_bug(example):
# When code scoped as `keyword.operator.logical.python` are
# used outside the scope of `meta.function-call.*.python`,
# the keywords
if "keywords" not in "function-call":
print("logical operator keywords highlight correctly")
# `is` and `not` are scoped as `keyword.control.flow.python`
# when used inside a function-call
if "keywords" in "function-call":
print(
"keyword highlighting" is not "yellowish-green"
or "greenish-yellow"
)
outside_function_call = (
"keyword highlighting" is not "yellowish-green" or "greenish-yellow"
)
return outside_function_call
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported Python example in Sublime Text 3 with MagicPython 1.1.1 and inspect how the shown operators receive scopes inside and outside function calls. Done means the keyword scopes are consistent in both contexts and the example highlights as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100