diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-10-30 21:56:42 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-10-31 19:26:15 +0100 |
commit | 8c90023676fae675e89b1a20c7fc95c63fc1dd5a (patch) | |
tree | cef3c3f6716026d1e9998fec8ca9171c6fe478af /language-web/src/main/js/xtext/XtextClient.ts | |
parent | feat(web): use 4 space for indentation (diff) | |
download | refinery-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/XtextClient.ts')
-rw-r--r-- | language-web/src/main/js/xtext/XtextClient.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/language-web/src/main/js/xtext/XtextClient.ts b/language-web/src/main/js/xtext/XtextClient.ts index ccb58ab4..03b81b1c 100644 --- a/language-web/src/main/js/xtext/XtextClient.ts +++ b/language-web/src/main/js/xtext/XtextClient.ts | |||
@@ -7,6 +7,7 @@ import type { Transaction } from '@codemirror/state'; | |||
7 | import type { EditorStore } from '../editor/EditorStore'; | 7 | import type { EditorStore } from '../editor/EditorStore'; |
8 | import { ContentAssistService } from './ContentAssistService'; | 8 | import { ContentAssistService } from './ContentAssistService'; |
9 | import { HighlightingService } from './HighlightingService'; | 9 | import { HighlightingService } from './HighlightingService'; |
10 | import { OccurrencesService } from './OccurrencesService'; | ||
10 | import { UpdateService } from './UpdateService'; | 11 | import { UpdateService } from './UpdateService'; |
11 | import { getLogger } from '../utils/logger'; | 12 | import { getLogger } from '../utils/logger'; |
12 | import { ValidationService } from './ValidationService'; | 13 | import { ValidationService } from './ValidationService'; |
@@ -25,6 +26,8 @@ export class XtextClient { | |||
25 | 26 | ||
26 | private validationService: ValidationService; | 27 | private validationService: ValidationService; |
27 | 28 | ||
29 | private occurrencesService: OccurrencesService; | ||
30 | |||
28 | constructor(store: EditorStore) { | 31 | constructor(store: EditorStore) { |
29 | this.webSocketClient = new XtextWebSocketClient( | 32 | this.webSocketClient = new XtextWebSocketClient( |
30 | () => this.updateService.onConnect(), | 33 | () => this.updateService.onConnect(), |
@@ -34,6 +37,11 @@ export class XtextClient { | |||
34 | this.contentAssistService = new ContentAssistService(this.updateService); | 37 | this.contentAssistService = new ContentAssistService(this.updateService); |
35 | this.highlightingService = new HighlightingService(store, this.updateService); | 38 | this.highlightingService = new HighlightingService(store, this.updateService); |
36 | this.validationService = new ValidationService(store, this.updateService); | 39 | this.validationService = new ValidationService(store, this.updateService); |
40 | this.occurrencesService = new OccurrencesService( | ||
41 | store, | ||
42 | this.webSocketClient, | ||
43 | this.updateService, | ||
44 | ); | ||
37 | } | 45 | } |
38 | 46 | ||
39 | onTransaction(transaction: Transaction): void { | 47 | onTransaction(transaction: Transaction): void { |
@@ -41,6 +49,7 @@ export class XtextClient { | |||
41 | // _before_ the current edit, so we call it before `updateService`. | 49 | // _before_ the current edit, so we call it before `updateService`. |
42 | this.contentAssistService.onTransaction(transaction); | 50 | this.contentAssistService.onTransaction(transaction); |
43 | this.updateService.onTransaction(transaction); | 51 | this.updateService.onTransaction(transaction); |
52 | this.occurrencesService.onTransaction(transaction); | ||
44 | } | 53 | } |
45 | 54 | ||
46 | private async onPush(resource: string, stateId: string, service: string, push: unknown) { | 55 | private async onPush(resource: string, stateId: string, service: string, push: unknown) { |