-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathindex.ts
executable file
·37 lines (34 loc) · 1016 Bytes
/
index.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
37
import { Disposable, languages } from "vscode";
import { DBTPowerUserExtension } from "../dbtPowerUserExtension";
import { provideSingleton } from "../utils";
import { ModelHoverProvider } from "./modelHoverProvider";
import { SourceHoverProvider } from "./sourceHoverProvider";
@provideSingleton(HoverProviders)
export class HoverProviders implements Disposable {
private disposables: Disposable[] = [];
constructor(
private modelHoverProvider: ModelHoverProvider,
private sourceHoverProvider: SourceHoverProvider,
) {
this.disposables.push(
languages.registerHoverProvider(
DBTPowerUserExtension.DBT_SQL_SELECTOR,
this.modelHoverProvider,
),
);
this.disposables.push(
languages.registerHoverProvider(
DBTPowerUserExtension.DBT_SQL_SELECTOR,
this.sourceHoverProvider,
),
);
}
dispose() {
while (this.disposables.length) {
const x = this.disposables.pop();
if (x) {
x.dispose();
}
}
}
}