codemirror-languageserver 1.9.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ declare class LanguageServerClient {
24
24
  ready: boolean;
25
25
  capabilities: LSP.ServerCapabilities<any>;
26
26
  private plugins;
27
+ initializePromise: Promise<void>;
27
28
  constructor(options: LanguageServerClientOptions);
28
29
  initialize(): Promise<void>;
29
30
  close(): void;
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ class LanguageServerClient {
39
39
  }
40
40
  });
41
41
  }
42
- this.initialize();
42
+ this.initializePromise = this.initialize();
43
43
  }
44
44
  async initialize() {
45
45
  const { capabilities } = await this.request('initialize', {
@@ -170,6 +170,9 @@ class LanguageServerPlugin {
170
170
  this.client.detachPlugin(this);
171
171
  }
172
172
  async initialize({ documentText }) {
173
+ if (this.client.initializePromise) {
174
+ await this.client.initializePromise;
175
+ }
173
176
  this.client.textDocumentDidOpen({
174
177
  textDocument: {
175
178
  uri: this.documentUri,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemirror-languageserver",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Language Server Plugin for CodeMirror 6",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {