Skip to content

Commit 4747468

Browse files
committed
Remove duplicate code
1 parent f8d9ef8 commit 4747468

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/find_symbol/SymbolDataProvider.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
import {
2-
Configuration,
32
Disposable,
4-
LanguageClient,
53
lspRangeToRange,
6-
NotificationRequest,
74
nova,
85
TreeDataProvider,
96
TreeItem,
107
TreeItemCollapsibleState,
118
TreeView,
12-
wrapCommand,
139
} from "../nova_utils.ts";
1410
import { lsp } from "../../deps.ts";
15-
let symbolDataProvider: SymbolDataProvider | null = null;
11+
import { Element, Header } from "../sidebars.ts";
1612

1713
function getFilename(uri: string) {
1814
return decodeURIComponent(uri).split("/").pop()!;
1915
}
20-
21-
interface Element {
22-
toTreeItem: () => TreeItem;
23-
children: Element[];
24-
}
2516
class File implements Element {
2617
uri: string;
2718
extension: string;
@@ -51,19 +42,6 @@ class File implements Element {
5142
return item;
5243
}
5344
}
54-
class Header implements Element {
55-
content: string;
56-
children: [];
57-
constructor(content: string) {
58-
this.content = content;
59-
this.children = [];
60-
}
61-
62-
toTreeItem() {
63-
const item = new TreeItem(this.content);
64-
return item;
65-
}
66-
}
6745
class Symbol implements Element {
6846
name: string;
6947
type: string;

src/sidebars.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { TreeItem } from "./nova_utils.ts";
33
export interface Element {
44
toTreeItem: () => TreeItem;
55
children: Element[];
6-
path?: string;
7-
uri?: string;
8-
shouldDisambiguate?: boolean;
96
}
107

118
export class Header implements Element {

0 commit comments

Comments
 (0)