Skip to content

Commit 670b137

Browse files
committed
Remove URI factory
It's not actually used anymore.
1 parent 1b0a962 commit 670b137

File tree

6 files changed

+8
-36
lines changed

6 files changed

+8
-36
lines changed

packages/ide/src/client.ts

-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { upload } from "./upload";
66
import { client } from "./fill/client";
77
import { clipboard } from "./fill/clipboard";
88
import { INotificationService, IProgressService } from "./fill/notification";
9-
import { IURIFactory } from "./fill/uri";
109

1110
/**
1211
* A general abstraction of an IDE client.
@@ -19,7 +18,6 @@ import { IURIFactory } from "./fill/uri";
1918
export abstract class IdeClient {
2019
public readonly retry = retry;
2120
public readonly clipboard = clipboard;
22-
public readonly uriFactory: IURIFactory;
2321
public readonly upload = upload;
2422

2523
private start: Time | undefined;
@@ -47,8 +45,6 @@ export abstract class IdeClient {
4745
logger.info("Unloaded");
4846
});
4947

50-
this.uriFactory = this.createUriFactory();
51-
5248
this.initialize().then(() => {
5349
logger.info("Load completed", field("duration", this.loadTime));
5450
}).catch((error) => {
@@ -134,9 +130,4 @@ export abstract class IdeClient {
134130
* Initialize the IDE.
135131
*/
136132
protected abstract initialize(): Promise<void>;
137-
138-
/**
139-
* Create URI factory.
140-
*/
141-
protected abstract createUriFactory(): IURIFactory;
142133
}

packages/ide/src/fill/uri.ts

-14
This file was deleted.

packages/ide/src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from "./client";
22
export * from "./fill/clipboard";
33
export * from "./fill/notification";
4-
export * from "./fill/uri";
54
export * from "./retry";
65
export * from "./upload";

packages/ide/src/upload.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ import { appendFile } from "fs";
33
import { promisify } from "util";
44
import { logger, Logger } from "@coder/logger";
55
import { escapePath } from "@coder/protocol";
6-
import { IURI } from "./fill/uri";
76
import { NotificationService, INotificationService, ProgressService, IProgressService, IProgress, Severity } from "./fill/notification";
87

8+
export interface IURI {
9+
readonly path: string;
10+
readonly fsPath: string;
11+
readonly scheme: string;
12+
}
13+
914
/**
1015
* Represents an uploadable directory, so we can query for existing files once.
1116
*/

packages/vscode/src/client.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import "./fill/workbenchRegistry";
1212
import { PasteAction } from "./fill/paste";
1313
import "./fill/dom";
1414
import "./vscode.scss";
15-
import { IdeClient, IURI, IURIFactory, IProgress, INotificationHandle } from "@coder/ide";
15+
import { IdeClient, IProgress, INotificationHandle } from "@coder/ide";
1616
import { registerContextMenuListener } from "vs/base/parts/contextmenu/electron-main/contextmenu";
1717
import { LogLevel } from "vs/platform/log/common/log";
1818
import { URI } from "vs/base/common/uri";
@@ -144,16 +144,6 @@ export class Client extends IdeClient {
144144
};
145145
}
146146

147-
protected createUriFactory(): IURIFactory {
148-
return {
149-
// TODO: not sure why this is an error.
150-
// tslint:disable-next-line no-any
151-
create: <URI>(uri: IURI): URI => URI.from(uri) as any,
152-
file: (path: string): IURI => URI.file(path),
153-
parse: (raw: string): IURI => URI.parse(raw),
154-
};
155-
}
156-
157147
protected initialize(): Promise<void> {
158148
registerContextMenuListener();
159149

tslint.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"no-redundant-jsdoc": true,
2727
"no-implicit-dependencies": false,
2828
"no-boolean-literal-compare": true,
29+
"prefer-readonly": true,
2930
"deprecation": true,
3031
"semicolon": true,
3132
"one-line": [

0 commit comments

Comments
 (0)