MagicStack / MagicStack/MagicPython

Getting invalid.illegal.name.python on valid python code from textmate

Open
#252 0 comments 1 reaction 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**: VS Code 1.67
* **Platform**: all
* **Color scheme**: all
* **MagicPython version**: commit c9b3409deb69acec31bbf7913830e93a046b30cc
* **A sreenshot**:
![image](https://user-images.githubusercontent.com/38270282/172645134-50114cbe-6480-4c34-b956-4544fbdcbc2b.png)

* **5-10 lines of surrounding code**:
```python
print(42and 2)
```

in `42and 2`, a valid python code, `42and` is marked as `invalid.illegal.name.python`

`42` should be marked as `constant.numeric.dec.python` and `and` should be marked as `keyword.control.flow.python`.

PyCharm is able to parse it correctly:
image

Originally from @Bobronium in https://github.com/microsoft/vscode/issues/150199

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 case in the MagicPython syntax highlighter using `print(42and 2)` in VS Code 1.67. Inspect the Python grammar responsible for numeric literals, names, and flow-control keywords; done means `42` is `constant.numeric.dec.python` and `and` is `keyword.control.flow.python`, without the illegal-name scope.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.