diff --git a/client/src/common/client.ts b/client/src/common/client.ts index 106a5f91b..4564bf4ac 100644 --- a/client/src/common/client.ts +++ b/client/src/common/client.ts @@ -655,7 +655,7 @@ export abstract class BaseLanguageClient implements FeatureClient(type, ...params); } catch (error) { this.error(`Sending request ${Is.string(type) ? type : type.method} failed.`, error); @@ -718,7 +718,7 @@ export abstract class BaseLanguageClient implements FeatureClient => { const connection = await client.$start(); - client.forceDocumentSync(); + await client.forceDocumentSync(); const result = connection.sendNotification(DidChangeWatchedFilesNotification.type, { changes: client._fileEvents }); client._fileEvents = []; return result; @@ -1337,11 +1337,11 @@ export abstract class BaseLanguageClient implements FeatureClient { if (this._didChangeTextDocumentFeature === undefined) { this._didChangeTextDocumentFeature = this._dynamicFeatures.get(DidChangeTextDocumentNotification.type.method) as DidChangeTextDocumentFeature; } - this._didChangeTextDocumentFeature.forceDelivery(); + return this._didChangeTextDocumentFeature.forceDelivery(); } private _diagnosticQueue: Map = new Map(); diff --git a/client/src/common/textSynchronization.ts b/client/src/common/textSynchronization.ts index 055842bb1..041e36ac2 100644 --- a/client/src/common/textSynchronization.ts +++ b/client/src/common/textSynchronization.ts @@ -176,7 +176,7 @@ export class DidChangeTextDocumentFeature extends DynamicDocumentFeature; private _forcingDelivery: boolean = false; - private _changeDelayer: { uri: string; delayer: Delayer } | undefined; + private _changeDelayer: { uri: string; delayer: Delayer> } | undefined; private readonly _onNotificationSent: EventEmitter>; constructor(client: FeatureClient) { @@ -253,15 +253,23 @@ export class DidChangeTextDocumentFeature extends DynamicDocumentFeature doSend(event)); } else { this._changeDelayer = { uri: event.document.uri.toString(), - delayer: new Delayer(200) + delayer: new Delayer>(200) }; + // See comment above. return this._changeDelayer.delayer.trigger(() => doSend(event), -1); } }; @@ -304,13 +312,13 @@ export class DidChangeTextDocumentFeature extends DynamicDocumentFeature { if (this._forcingDelivery || !this._changeDelayer) { return; } try { this._forcingDelivery = true; - this._changeDelayer.delayer.forceDelivery(); + return this._changeDelayer.delayer.forceDelivery(); } finally { this._forcingDelivery = false; } diff --git a/testbed/server/src/server.ts b/testbed/server/src/server.ts index 4ea360472..4d8d15eb0 100644 --- a/testbed/server/src/server.ts +++ b/testbed/server/src/server.ts @@ -124,7 +124,8 @@ connection.onInitialize((params, cancel, progress): Thenable | textDocumentSync: TextDocumentSyncKind.Full, hoverProvider: true, completionProvider: { - allCommitCharacters: ['.', ','], + triggerCharacters: ['.'], + allCommitCharacters: [';'], resolveProvider: false, }, signatureHelpProvider: {