From 18d5eb41ebb07ed08cf0e721c9b14b7bb88853b5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 29 Aug 2022 14:52:20 +0200 Subject: [PATCH] remove uneeded --- apps/remix-ide/src/app/editor/editor.js | 27 ------------------------- 1 file changed, 27 deletions(-) diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index e2db22943d..e8597e0721 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -166,33 +166,6 @@ class Editor extends Plugin { } } }) - - this.on('fileManager', 'noFileSelected', async () => { - this.currentFile = null - this.renderComponent() - }) - this.on('fileManager', 'currentFileChanged', async (name) => { - if (name.endsWith('.ts')) { - // extract the import, resolve their content - // and add the imported files to Monaco through the `addModel` - // so Monaco can provide auto completion - let content = await this.call('fileManager', 'readFile', name) - const paths = name.split('/') - paths.pop() - const fromPath = paths.join('/') // get current execution context path - for (const match of content.matchAll(/import\s+.*\s+from\s+(?:"(.*?)"|'(.*?)')/g)) { - let path = match[2] - if (path.startsWith('./') || path.startsWith('../')) path = resolve(fromPath, path) - if (path.startsWith('/')) path = path.substring(1) - if (!path.endsWith('.ts')) path = path + '.ts' - if (await this.call('fileManager', 'exists', path)) { - content = await this.call('fileManager', 'readFile', path) - this.emit('addModel', content, 'typescript', path, false) - } - } - } - }) - this.on('fileManager', 'noFileSelected', async () => { this.currentFile = null this.renderComponent()