MagicStack / MagicStack/MagicPython

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

Đang mở
#252 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
98
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

* **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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, python
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.