forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
goBaseCodelens.ts
30 lines (25 loc) · 977 Bytes
/
goBaseCodelens.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
/* eslint-disable @typescript-eslint/no-unused-vars */
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/
import vscode = require('vscode');
export abstract class GoBaseCodeLensProvider implements vscode.CodeLensProvider {
protected enabled = true;
private onDidChangeCodeLensesEmitter = new vscode.EventEmitter<void>();
public get onDidChangeCodeLenses(): vscode.Event<void> {
return this.onDidChangeCodeLensesEmitter.event;
}
public setEnabled(enabled: false): void {
if (this.enabled !== enabled) {
this.enabled = enabled;
this.onDidChangeCodeLensesEmitter.fire();
}
}
public provideCodeLenses(
document: vscode.TextDocument,
token: vscode.CancellationToken
): vscode.ProviderResult<vscode.CodeLens[]> {
return [];
}
}