cspell-grammar 10.3.1-alpha.0 → 10.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -9
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# `cspell-grammar`
|
|
2
2
|
|
|
3
|
-
CSpell Grammar is used to generate a parser. The Parser is used to add context / scope to parts of a document, making it easier to define the parts to
|
|
3
|
+
CSpell Grammar is used to generate a parser. The Parser is used to add context / scope to parts of a document, making it easier to define the parts to be spell checked.
|
|
4
4
|
|
|
5
5
|
This is to address the issues and limitations related to `ignoreRegExpList` and `includeRegExpList`.
|
|
6
6
|
|
|
7
|
-
The parser is
|
|
7
|
+
The parser is used to add `scope` to sections of a document. The `scope` can then be used to apply spell checking rules.
|
|
8
8
|
|
|
9
9
|
Example: Only check comments and strings
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ rules:
|
|
|
23
23
|
language: en
|
|
24
24
|
string:
|
|
25
25
|
language: en,fr
|
|
26
|
-
dictionaries: ['marketing-terms']
|
|
26
|
+
dictionaries: ['marketing-terms']
|
|
27
27
|
caseSensitive: true
|
|
28
28
|
string.javascript:
|
|
29
29
|
caseSensitive: false
|
|
@@ -56,14 +56,14 @@ The goal of a grammar parser for the spell checker is to allow the user to decid
|
|
|
56
56
|
1. Which dictionaries (or languages) should be used.
|
|
57
57
|
1. Are accents and case important
|
|
58
58
|
|
|
59
|
-
Note: CSpell is a pure JavaScript application, so including
|
|
59
|
+
Note: CSpell is a pure JavaScript application, so including Oniguruma is not an option.
|
|
60
60
|
|
|
61
61
|
### Considerations
|
|
62
62
|
|
|
63
63
|
- Parsing a document should be fast - meaning the grammar should be as simple as possible to meet
|
|
64
64
|
the needs of the spell checker and not focus on scope detail. This is where a colorizer grammar is
|
|
65
65
|
not a good fit to be used.
|
|
66
|
-
-
|
|
66
|
+
- ASTs are a bit of an overkill for a spell checker. They provide too much detail while not bringing much benefit
|
|
67
67
|
from the detail.
|
|
68
68
|
|
|
69
69
|
## Transformation
|
|
@@ -87,14 +87,13 @@ Possible options:
|
|
|
87
87
|
- Challenges
|
|
88
88
|
- It is not context aware and might replace the wrong text.
|
|
89
89
|
- It changes the location of the words and messes up issue reporting (some sort of Map would be needed to get the correct line / character offset).
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
- Easy to implement except for the context and mapping.
|
|
90
|
+
- Advantages
|
|
91
|
+
- Easy to implement except for the context and mapping.
|
|
93
92
|
|
|
94
93
|
1. Scope level substitution
|
|
95
94
|
Transformations occur at the scope level.
|
|
96
95
|
- Challenges
|
|
97
|
-
- offset mapping is still
|
|
96
|
+
- offset mapping is still an issue (maybe)
|
|
98
97
|
- need a way to merge text with adjacent scopes after transformation
|
|
99
98
|
- Advantages
|
|
100
99
|
- it is context aware
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
|
-
"version": "10.3.1
|
|
7
|
+
"version": "10.3.1",
|
|
8
8
|
"description": "Grammar parsing support for cspell",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"cspell",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"node": ">=22.18.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@cspell/cspell-pipe": "10.3.1
|
|
89
|
-
"@cspell/cspell-types": "10.3.1
|
|
88
|
+
"@cspell/cspell-pipe": "10.3.1",
|
|
89
|
+
"@cspell/cspell-types": "10.3.1"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "793953d1c2b4f1cab257389ff6ecb3ae2dd40230"
|
|
92
92
|
}
|