forked from streetsidesoftware/cspell-dicts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcspell-ext.json
83 lines (83 loc) · 2.94 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
83
// cSpell Settings
{
"id": "python",
"version": "0.2",
"readonly": true,
"name": "Python Dictionary",
"description": "Python Keyword Dictionary",
// List of dictionary files to add to the global list of dictionaries
"dictionaryDefinitions": [
{
"name": "python",
"path": "./python.txt.gz",
"description": "Python Dictionary"
},
{
"name": "python-common",
"path": "./python-common.txt.gz",
"description": "Python Common Terms Dictionary"
}
],
// Dictionaries to always be used.
// Generally left empty
"dictionaries": [],
// Language Rules to apply to matching files.
// Files are matched on `languageId` and `local`
"languageSettings": [
{
// Matching Language
"languageId": "python",
// Apply settings
"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
]
}
]
}
]
}