File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
src/plugins/editor-monaco-language-apidom/language Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,11 @@ export default class WorkerManager {
5959
6060 async getLanguageServiceWorker ( ...resources ) {
6161 const client = await this . #getClient( ) ;
62- await this . #worker. withSyncedResources ( resources ) ;
62+
63+ if ( this . #worker) {
64+ await this . #worker. withSyncedResources ( resources ) ;
65+ }
66+
6367 return client ;
6468 }
6569
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class DiagnosticsProvider extends Provider {
4343 } ;
4444
4545 const onModelRemoved = ( model ) => {
46- this . #diagnosticCollection. set ( model . uri , [ ] ) ;
46+ this . #diagnosticCollection? .set ( model . uri , [ ] ) ;
4747 const key = model . uri . toString ( ) ;
4848 if ( this . #listener[ key ] ) {
4949 this . #listener[ key ] . dispose ( ) ;
@@ -94,10 +94,12 @@ class DiagnosticsProvider extends Provider {
9494 async #validate( model ) {
9595 const diagnostics = await this . #getDiagnostics( model ) ;
9696
97- this . #diagnosticCollection?. set (
98- model . uri ,
99- await this . protocolConverter . asDiagnostics ( diagnostics )
100- ) ;
97+ if ( this . protocolConverter && this . #diagnosticCollection) {
98+ this . #diagnosticCollection. set (
99+ model . uri ,
100+ await this . protocolConverter . asDiagnostics ( diagnostics )
101+ ) ;
102+ }
101103 }
102104
103105 dispose ( ) {
You can’t perform that action at this time.
0 commit comments