-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathcspell-ext.json
82 lines (82 loc) · 2.8 KB
/
cspell-ext.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"id": "python",
"version": "0.2",
"readonly": true,
"name": "Python",
"description": "Python Keyword Dictionary",
"dictionaryDefinitions": [
{
"name": "python",
"path": "./dict/python.txt",
"description": "Python Dictionary"
},
{
"name": "python-common",
"path": "./dict/python-common.txt",
"description": "Python Common Terms Dictionary"
}
],
"import": ["@cspell/dict-data-science"],
"dictionaries": [],
"languageSettings": [
{
"languageId": "python",
"dictionaries": ["python", "python-common"],
"ignoreRegExpList": ["ignore_string_literal_prefix"],
"patterns": [
{
// Pattern to be ignored
"name": "ignore_string_literal_prefix",
"pattern": "/\\b(?:rf|fr|f|r|u|ur|b|br)'/gi"
},
{
"name": "string_binary",
"pattern": "/\\bbr?(['\"]).*?\\1/gi"
},
{
"name": "string_raw",
"pattern": "/\\bu?r(['\"]).*?\\1/gi"
},
// Redefine the "strings" and "comments" pattern to match Python
{
"name": "string-multi-line",
"pattern": "/(\"\"\"|''')[^\\1]*?\\1/g"
},
{
"name": "string-single-line",
"pattern": "/((?<!\\\\)(?:'|\"))(?!\\1).*?(?<!\\1)(?<!\\\\)\\1(?!\\1)/g"
},
{
"name": "strings",
"description": "Matches all strings in a Python File.",
"pattern": [
"/((?<!\\\\)(?:'|\"))(?!\\1).*?(?<!\\1)(?<!\\\\)\\1(?!\\1)/g", // Single line string
"/(\"\"\"|''')[^\\1]*?\\1/g" // Multi-line string
]
},
{
"name": "comment-single-line",
"pattern": "/#.*/g"
},
{
"name": "comment-multi-line",
"pattern": "/(\"\"\"|''')[^\\1]*?\\1/g"
},
{
"name": "comments",
"description": "Matches all comments in a Python File.",
"pattern": [
"/#.*/g", // Single line comment
"/(\"\"\"|''')[^\\1]*?\\1/g" // Multi line comment using multi-line string
]
}
]
}
],
"overrides": [
{
"filename": "**/constraints.txt",
"dictionaries": ["python", "python-common"]
}
]
}