@@ -25,13 +25,21 @@ const openers = [
25
25
]
26
26
const reopeners = [ "else" , "elseif" , "catch" , "finally" ]
27
27
28
+ /**
29
+ *
30
+ * @param {readonly string[] } scopes
31
+ */
28
32
function isKeywordScope ( scopes : readonly string [ ] ) {
29
33
// Skip 'source.julia'
30
34
return scopes . slice ( 1 ) . some ( scope => {
31
35
return scope . indexOf ( "keyword" ) > - 1
32
36
} )
33
37
}
34
38
39
+ /**
40
+ *
41
+ * @param {readonly string[] } scopes
42
+ */
35
43
export function isStringScope ( scopes : readonly string [ ] ) {
36
44
let isString = false
37
45
let isInterp = false
@@ -46,6 +54,11 @@ export function isStringScope(scopes: readonly string[]) {
46
54
return isString && ! isInterp
47
55
}
48
56
57
+ /**
58
+ *
59
+ * @param {TextEditor } editor
60
+ * @param {RangeCompatible } range
61
+ */
49
62
function forRange ( editor : TextEditor , range : RangeCompatible ) {
50
63
// this should happen here and not a top-level so that we aren't relying on
51
64
// Atom to load packages in a specific order:
@@ -90,13 +103,23 @@ function forRange(editor: TextEditor, range: RangeCompatible) {
90
103
return scopes
91
104
}
92
105
106
+ /**
107
+ *
108
+ * @param {TextEditor } editor
109
+ * @param {number } start
110
+ * @param {number } end
111
+ */
93
112
export function forLines ( editor : TextEditor , start : number , end : number ) {
94
113
const startPoint = new Point ( start , 0 )
95
114
const endPoint = new Point ( end , Infinity )
96
115
const range = new Range ( startPoint , endPoint )
97
116
return forRange ( editor , range )
98
117
}
99
118
119
+ /**
120
+ *
121
+ * @param {readonly string[] } scopes
122
+ */
100
123
export function isCommentScope ( scopes : readonly string [ ] ) {
101
124
// Skip 'source.julia'
102
125
return scopes . slice ( 1 ) . some ( scope => {
@@ -108,6 +131,9 @@ export function isCommentScope(scopes: readonly string[]) {
108
131
* Returns `true` if the scope at `bufferPosition` in `editor` is valid code scope to be inspected.
109
132
* Supposed to be used within Atom-IDE integrations, whose `grammarScopes` setting doesn't support
110
133
* embedded scopes by default.
134
+ *
135
+ * @param {TextEditor } editor
136
+ * @param {PointCompatible } bufferPosition
111
137
*/
112
138
export function isValidScopeToInspect ( editor : TextEditor , bufferPosition : PointCompatible ) {
113
139
const scopes = editor . scopeDescriptorForBufferPosition ( bufferPosition ) . getScopesArray ( )
0 commit comments