Skip to content

Commit 2a826f7

Browse files
tree-editor: fix deprecations
Signed-off-by: vince-fugnitto <[email protected]>
1 parent 55fead2 commit 2a826f7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { LabelProviderContribution } from '@theia/core/lib/browser';
22
import URI from '@theia/core/lib/common/uri';
3-
import { FileStat } from '@theia/filesystem/lib/common';
3+
import { FileStat } from '@theia/filesystem/lib/common/files';
44
import { injectable } from '@theia/core/shared/inversify';
55

66
@injectable()
77
export class TreeLabelProviderContribution implements LabelProviderContribution {
8-
canHandle(uri: object): number {
9-
let toCheck = uri;
8+
9+
canHandle(element: object): number {
10+
let toCheck = element;
1011
if (FileStat.is(toCheck)) {
11-
toCheck = new URI(toCheck.uri);
12+
toCheck = toCheck.resource;
1213
}
1314
if (toCheck instanceof URI) {
1415
if (toCheck.path.ext === '.tree') {
@@ -21,6 +22,6 @@ export class TreeLabelProviderContribution implements LabelProviderContribution
2122
getIcon(): string {
2223
return 'fa fa-coffee dark-purple';
2324
}
24-
25+
2526
// We don't need to specify getName() nor getLongName() because the default uri label provider is responsible for them.
2627
}

0 commit comments

Comments
 (0)