aboutsummaryrefslogtreecommitdiffstats
path: root/language-web/src/main/js/xtext/xtextServiceResults.ts
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-10-30 21:56:42 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2021-10-31 19:26:15 +0100
commit8c90023676fae675e89b1a20c7fc95c63fc1dd5a (patch)
treecef3c3f6716026d1e9998fec8ca9171c6fe478af /language-web/src/main/js/xtext/xtextServiceResults.ts
parentfeat(web): use 4 space for indentation (diff)
downloadrefinery-8c90023676fae675e89b1a20c7fc95c63fc1dd5a.tar.gz
refinery-8c90023676fae675e89b1a20c7fc95c63fc1dd5a.tar.zst
refinery-8c90023676fae675e89b1a20c7fc95c63fc1dd5a.zip
feat(web): find occurrences when idle
Diffstat (limited to 'language-web/src/main/js/xtext/xtextServiceResults.ts')
-rw-r--r--language-web/src/main/js/xtext/xtextServiceResults.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/language-web/src/main/js/xtext/xtextServiceResults.ts b/language-web/src/main/js/xtext/xtextServiceResults.ts
index e32d49c3..b2de1e4a 100644
--- a/language-web/src/main/js/xtext/xtextServiceResults.ts
+++ b/language-web/src/main/js/xtext/xtextServiceResults.ts
@@ -224,3 +224,16 @@ export function isHighlightingResult(result: unknown): result is IHighlightingRe
224 return typeof highlightingResult === 'object' 224 return typeof highlightingResult === 'object'
225 && isArrayOfType(highlightingResult.regions, isHighlightingRegion); 225 && isArrayOfType(highlightingResult.regions, isHighlightingRegion);
226} 226}
227
228export interface IOccurrencesResult extends IDocumentStateResult {
229 writeRegions: ITextRegion[];
230
231 readRegions: ITextRegion[];
232}
233
234export function isOccurrencesResult(result: unknown): result is IOccurrencesResult {
235 const occurrencesResult = result as IOccurrencesResult;
236 return isDocumentStateResult(occurrencesResult)
237 && isArrayOfType(occurrencesResult.writeRegions, isTextRegion)
238 && isArrayOfType(occurrencesResult.readRegions, isTextRegion);
239}