No difference between single and double quoted strings
@vpetrovykh đang làm issue này rồi.
Từ ngày 4/2/2019.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Ok I'm sorry if I don't take the time to use your template and try to prepare a pull request and all that stuff. I'm just not used to it.
I already spent much time on solving the issue for myself. And I only post here to share my solution.
If somebody is experimented with pull requests and all those things, below is my diff.
Also, if anybody finds this issue from google they will have the option to just apply the diff.
SOLUTION
Put the fix-string-quoted-double.patch (file below) in the relevant location of the extension.
Should be something like ~/.vscode/extensions/magicstack.magicpython-1.1.0/grammars/src
Then go to this location and execute git apply fix-string-quoted-double.patch
fix-string-quoted-double.patch
diff --git a/MagicPython.syntax.yaml b/MagicPython.syntax.yaml
index f885059..c6f6ae4 100644
--- a/MagicPython.syntax.yaml
+++ b/MagicPython.syntax.yaml
@@ -86,7 +86,7 @@ repository:
- file: 'regexp.wrapper.syntax.yaml'
vars:
- scopename: string.regexp.quoted.single.python
+ scopename: string.regexp.quoted.double.python
prefix: 'double-one-'
basename: 'regexp'
nested: ''
@@ -160,7 +160,7 @@ repository:
- file: 'regexp.wrapper.syntax.yaml'
vars:
- scopename: string.regexp.quoted.single.python
+ scopename: string.regexp.quoted.double.python
string.interpolated.python
prefix: 'double-one-'
basename: 'fregexp'
@@ -183,7 +183,13 @@ repository:
- file: 'pystring.inc.syntax.yaml'
vars:
line: single
- marker: (['"])
+ marker: "'"
+ guard: "|((?<!\\\\)\\n)"
+
+ - file: 'pystring.inc.syntax.yaml'
+ vars:
+ line: double
+ marker: '"'
guard: "|((?<!\\\\)\\n)"
- file: 'pystring.inc.syntax.yaml'
@@ -195,7 +201,14 @@ repository:
- file: 'pyfstring.inc.syntax.yaml'
vars:
line: single
- marker: (['"])
+ marker: "'"
+ fguard: "|(?=\\n)"
+ guard: "|((?<!\\\\)\\n)"
+
+ - file: 'pyfstring.inc.syntax.yaml'
+ vars:
+ line: double
+ marker: '"'
fguard: "|(?=\\n)"
guard: "|((?<!\\\\)\\n)"
@@ -666,18 +679,25 @@ repository:
string:
patterns:
- include: '#string-quoted-multi-line'
+ - include: '#string-quoted-double-line'
- include: '#string-quoted-single-line'
- include: '#string-bin-quoted-multi-line'
+ - include: '#string-bin-quoted-double-line'
- include: '#string-bin-quoted-single-line'
- include: '#string-raw-quoted-multi-line'
+ - include: '#string-raw-quoted-double-line'
- include: '#string-raw-quoted-single-line'
- include: '#string-raw-bin-quoted-multi-line'
+ - include: '#string-raw-bin-quoted-double-line'
- include: '#string-raw-bin-quoted-single-line'
- include: '#fstring-fnorm-quoted-multi-line'
+ - include: '#fstring-fnorm-quoted-double-line'
- include: '#fstring-fnorm-quoted-single-line'
- include: '#fstring-normf-quoted-multi-line'
+ - include: '#fstring-normf-quoted-double-line'
- include: '#fstring-normf-quoted-single-line'
- include: '#fstring-raw-quoted-multi-line'
+ - include: '#fstring-raw-quoted-double-line'
- include: '#fstring-raw-quoted-single-line'
string-unicode-guts:
- 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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MagicStack/MagicPython
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
MagicStack/MagicPython#275 · 1 reaction ·
-
Support for type parameters Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
MagicStack/MagicPython#273 · 7 reaction ·
-
Color python properties Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
MagicStack/MagicPython#269 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
MagicStack/MagicPython#267 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
MagicStack/MagicPython#265 · 2 bình luận ·
Tất cả issue của MagicStack/MagicPython
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Seeed-Studio/wiki-documents#5655 · 2 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
capricorn86/happy-dom#2435 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Edit: CW+ Đang mởchannels:edit check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
01 type: bug 30 needs: triage 99 tag: UX Accessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100