-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathHostErrorNode.ts
More file actions
33 lines (27 loc) · 1.23 KB
/
HostErrorNode.ts
File metadata and controls
33 lines (27 loc) · 1.23 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { localize } from '../../localize';
export class HostErrorNode {
public readonly kind = 'hostError' as const;
constructor(
public readonly workspaceFolder: vscode.WorkspaceFolder,
public readonly portNumber: string,
public readonly message: string,
public readonly cwd?: string,
) { }
public getTreeItem(): vscode.TreeItem {
const firstLine = this.message.split(/\r?\n/)[0].trim();
const label = firstLine || localize('funcHostDebug.errorDetected', 'Error detected');
const item = new vscode.TreeItem(label, vscode.TreeItemCollapsibleState.None);
item.iconPath = new vscode.ThemeIcon('error');
item.tooltip = this.message;
item.contextValue = 'azFunc.funcHostDebug.hostError';
return item;
}
public getChildren(): never[] {
return [];
}
}