diff --git a/src/extension.ts b/src/extension.ts index 6825500..336c275 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,12 +1,8 @@ -import * as fs from 'fs'; import * as vscode from 'vscode'; import { invalidConfigName, loadConfigs } from './config'; -import { MemFs } from './fileSystemProvider'; import { Manager } from './manager'; -const workspace = vscode.workspace; - async function pickConfig(manager: Manager, activeOrNot?: boolean) { let names = manager.getActive(); const others = loadConfigs(); diff --git a/src/manager.ts b/src/manager.ts index 98f5784..92b554b 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -3,10 +3,9 @@ import { readFile } from 'fs'; import { parse as parseJsonc, ParseError } from 'jsonc-parser'; import * as path from 'path'; import { Client, ClientChannel, ConnectConfig } from 'ssh2'; -import { SFTPStream } from 'ssh2-streams'; import * as vscode from 'vscode'; import { getConfig, loadConfigs, openConfigurationEditor, updateConfig } from './config'; -import { createSocket, createSSH, getSFTP } from './connect'; +import { createSSH, getSFTP } from './connect'; import SSHFileSystem, { EMPTY_FILE_SYSTEM } from './sshFileSystem'; import { MemoryDuplex } from './streams'; import { catchingPromise, toPromise } from './toPromise'; @@ -15,7 +14,6 @@ async function assertFs(man: Manager, uri: vscode.Uri) { const fs = await man.getFs(uri); if (fs) return fs; return man.createFileSystem(uri.authority); - // throw new Error(`A SSH filesystem with the name '${uri.authority}' doesn't exists`); } export interface ProxyConfig { @@ -126,7 +124,6 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid protected configFileSystem = createConfigFs(this); protected onDidChangeFileEmitter = new vscode.EventEmitter(); protected onDidChangeTreeDataEmitter = new vscode.EventEmitter(); - // private memento: vscode.Memento = this.context.globalState; constructor(public readonly context: vscode.ExtensionContext) { this.onDidChangeFile = this.onDidChangeFileEmitter.event; this.onDidChangeTreeData = this.onDidChangeTreeDataEmitter.event; @@ -178,7 +175,6 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid if (existing) return existing; let promise = this.creatingFileSystems[name]; if (promise) return promise; - // config = config || this.memento.get(`fs.config.${name}`); config = config || loadConfigs().find(c => c.name === name); promise = catchingPromise(async (resolve, reject) => { if (!config) { @@ -261,6 +257,7 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid } /* FileSystemProvider */ public watch(uri: vscode.Uri, options: { recursive: boolean; excludes: string[]; }): vscode.Disposable { + // TODO: Store watched files/directories in an array and periodically check if they're modified /*let disp = () => {}; assertFs(this, uri).then((fs) => { disp = fs.watch(uri, options).dispose.bind(fs); diff --git a/src/putty.ts b/src/putty.ts index 5af47dd..b748ea8 100644 --- a/src/putty.ts +++ b/src/putty.ts @@ -1,6 +1,5 @@ import * as Winreg from 'winreg'; - import { toPromise } from './toPromise'; const winreg = new Winreg({ diff --git a/src/streams.ts b/src/streams.ts index 6e95c33..e620dfc 100644 --- a/src/streams.ts +++ b/src/streams.ts @@ -1,5 +1,5 @@ -import { Duplex, Stream, Writable } from 'stream'; +import { Duplex, Writable } from 'stream'; export class MemoryDuplex extends Duplex { protected buffer = new Buffer(this.size);