forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontext.ts
36 lines (32 loc) · 1.62 KB
/
context.ts
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 2022 The Go Authors. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/
import * as vscode from 'vscode';
import { LanguageClient } from 'vscode-languageclient/node';
import { LanguageServerConfig, Restart, ServerInfo } from './language/goLanguageServer';
import { LegacyLanguageService } from './language/registerDefaultProviders';
import { TelemetryService } from './goTelemetry';
// Global variables used for management of the language client.
// They are global so that the server can be easily restarted with
// new configurations.
export interface GoExtensionContext {
languageClient?: LanguageClient;
legacyLanguageService?: LegacyLanguageService;
latestConfig?: LanguageServerConfig;
telemetryService?: TelemetryService;
serverOutputChannel?: vscode.OutputChannel; // server-side output.
serverTraceChannel?: vscode.OutputChannel; // client-side tracing.
languageServerIsRunning?: boolean;
// serverInfo is the information from the server received during initialization.
serverInfo?: ServerInfo;
// lastUserAction is the time of the last user-triggered change.
// A user-triggered change is a didOpen, didChange, didSave, or didClose event.
lastUserAction?: Date;
crashCount?: number;
// Some metrics for automated issue reports:
restartHistory?: Restart[];
buildDiagnosticCollection?: vscode.DiagnosticCollection;
lintDiagnosticCollection?: vscode.DiagnosticCollection;
vetDiagnosticCollection?: vscode.DiagnosticCollection;
}