forked from lix-project/lix-website
84 lines
2.9 KiB
JSON
84 lines
2.9 KiB
JSON
|
// 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
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|