MagicStack / MagicStack/MagicPython

Syntax Highlighting Error - Inconsistent Scoping for Keywords

Open
#216 0 comments 2 reactions 0 assignees View on GitHub

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.

They are slight variations to the Material and Materialize color schemes.

  • MagicPython version: 1.1.1 (according to my package.json)

  • A screenshot:

Screen Shot 2020-06-23 at 10 50 03 PM
  • 5-10 lines of surrounding code:
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.