forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmockLanguageServer.ts
More file actions
36 lines (31 loc) · 1.31 KB
/
mockLanguageServer.ts
File metadata and controls
36 lines (31 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import { injectable } from 'inversify';
import { Uri } from 'vscode';
import { LanguageClient, LanguageClientOptions } from 'vscode-languageclient';
import { ILanguageServer } from '../../client/activation/types';
import { MockLanguageClient } from './mockLanguageClient';
// tslint:disable:no-any unified-signatures
@injectable()
export class MockLanguageServer implements ILanguageServer {
private mockLanguageClient: MockLanguageClient | undefined;
public get languageClient(): LanguageClient | undefined {
if (!this.mockLanguageClient) {
this.mockLanguageClient = new MockLanguageClient('mockLanguageClient', { module: 'dummy' }, {});
}
return this.mockLanguageClient;
}
public start(_resource: Uri | undefined, _options: LanguageClientOptions): Promise<void> {
if (!this.mockLanguageClient) {
this.mockLanguageClient = new MockLanguageClient('mockLanguageClient', { module: 'dummy' }, {});
}
return Promise.resolve();
}
public loadExtension(_args?: {} | undefined): void {
throw new Error('Method not implemented.');
}
public dispose(): void | undefined {
this.mockLanguageClient = undefined;
}
}