forked from github/codespaces-host-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoToProjectConfiguration.ts
More file actions
42 lines (35 loc) · 1.65 KB
/
Copy pathgoToProjectConfiguration.ts
File metadata and controls
42 lines (35 loc) · 1.65 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
37
38
39
40
41
42
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import TypeScriptServiceClientHost from '../typeScriptServiceClientHost';
import { ActiveJsTsEditorTracker } from '../ui/activeJsTsEditorTracker';
import { Lazy } from '../utils/lazy';
import { openProjectConfigForFile, ProjectType } from '../tsconfig';
import { Command } from './commandManager';
export class TypeScriptGoToProjectConfigCommand implements Command {
public readonly id = 'typescript.goToProjectConfig';
public constructor(
private readonly activeJsTsEditorTracker: ActiveJsTsEditorTracker,
private readonly lazyClientHost: Lazy<TypeScriptServiceClientHost>,
) { }
public execute() {
const editor = this.activeJsTsEditorTracker.activeJsTsEditor;
if (editor) {
openProjectConfigForFile(ProjectType.TypeScript, this.lazyClientHost.value.serviceClient, editor.document.uri);
}
}
}
export class JavaScriptGoToProjectConfigCommand implements Command {
public readonly id = 'javascript.goToProjectConfig';
public constructor(
private readonly activeJsTsEditorTracker: ActiveJsTsEditorTracker,
private readonly lazyClientHost: Lazy<TypeScriptServiceClientHost>,
) { }
public execute() {
const editor = this.activeJsTsEditorTracker.activeJsTsEditor;
if (editor) {
openProjectConfigForFile(ProjectType.JavaScript, this.lazyClientHost.value.serviceClient, editor.document.uri);
}
}
}