aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/ContentAssistService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/xtext/ContentAssistService.ts')
-rw-r--r--subprojects/frontend/src/xtext/ContentAssistService.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/subprojects/frontend/src/xtext/ContentAssistService.ts b/subprojects/frontend/src/xtext/ContentAssistService.ts
index 8b872e06..cf0fb49f 100644
--- a/subprojects/frontend/src/xtext/ContentAssistService.ts
+++ b/subprojects/frontend/src/xtext/ContentAssistService.ts
@@ -169,7 +169,7 @@ export class ContentAssistService {
169 this.lastCompletion = { 169 this.lastCompletion = {
170 ...range, 170 ...range,
171 options, 171 options,
172 span: computeSpan(prefix, entries.length), 172 validFor: computeSpan(prefix, entries.length),
173 }; 173 };
174 return this.lastCompletion; 174 return this.lastCompletion;
175 } 175 }
@@ -181,15 +181,15 @@ export class ContentAssistService {
181 return false; 181 return false;
182 } 182 }
183 const { from, to, text } = token; 183 const { from, to, text } = token;
184 const { from: lastFrom, to: lastTo, span } = this.lastCompletion; 184 const { from: lastFrom, to: lastTo, validFor } = this.lastCompletion;
185 if (!lastTo) { 185 if (!lastTo) {
186 return true; 186 return true;
187 } 187 }
188 const [transformedFrom, transformedTo] = this.mapRangeInclusive(lastFrom, lastTo); 188 const [transformedFrom, transformedTo] = this.mapRangeInclusive(lastFrom, lastTo);
189 return from >= transformedFrom 189 return from >= transformedFrom
190 && to <= transformedTo 190 && to <= transformedTo
191 && typeof span !== 'undefined' 191 && validFor instanceof RegExp
192 && span.exec(text) !== null; 192 && validFor.exec(text) !== null;
193 } 193 }
194 194
195 private shouldInvalidateCachedCompletion(transaction: Transaction): boolean { 195 private shouldInvalidateCachedCompletion(transaction: Transaction): boolean {