From 3a95b1a3b24eebee34d07ea101d75ebab79d21e7 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Fri, 17 May 2019 15:39:49 +0200 Subject: [PATCH 1/4] FileManager exposes "switchFile" --- package.json | 2 +- src/app/files/fileManager.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8d9ea1e43d..41d7053da9 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "yo-yoify": "^3.7.3" }, "dependencies": { - "remix-plugin": "0.0.2-alpha.6", "http-server": "^0.11.1", + "remix-plugin": "0.0.2-alpha.8", "remixd": "0.1.8-alpha.6" }, "repository": { diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 19d64c8608..8d725319b4 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -22,7 +22,7 @@ const profile = { // File System profile // - events: ['currentFileChanged'] -// - methods: ['getFolder', 'getCurrentFile', 'getFile', 'setFile'] +// - methods: ['getFolder', 'getCurrentFile', 'getFile', 'setFile', 'switchFile'] class FileManager extends FileSystemApi { constructor (localRegistry) { @@ -114,10 +114,7 @@ class FileManager extends FileSystemApi { } async getCurrentFile () { - const path = this.currentFile() - if (!path) throw new Error('no file selected') - console.log('Get current File', path) - return path + return this.currentFile() } getFile (path) { From 6d0cecafccd84d699a1b479ce8b86a5aacb5cdc1 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Fri, 17 May 2019 15:40:02 +0200 Subject: [PATCH 2/4] use new version of vyper --- src/remixAppManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index ffe3144157..e4943c6f9a 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -63,8 +63,8 @@ export class RemixAppManager extends AppManagerApi { events: ['compilationFinished'], methods: [], notifications: {}, - url: 'https://remix-vyper.surge.sh/', - description: 'compile vyper contracts', + url: 'https://remix-vyper-plugin.surge.sh/', +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YgMCAxNzkyIDQ0My40IDIwNDggMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPiAgPHBvbHlsaW5lIHBvaW50cz0iNTEyIDAgMCAwIDI1NiA0NDMuNCA1MTIgMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPjwvc3ZnPg==', location: 'swapPanel' From 465fe162ef1d8847bae850a7b69b23a4a9451277 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Fri, 17 May 2019 15:59:27 +0200 Subject: [PATCH 3/4] Add notification to vyper plugin --- src/remixAppManager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/remixAppManager.js b/src/remixAppManager.js index e4943c6f9a..a6a78aa33e 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -62,8 +62,10 @@ export class RemixAppManager extends AppManagerApi { displayName: 'Vyper', events: ['compilationFinished'], methods: [], - notifications: {}, - url: 'https://remix-vyper-plugin.surge.sh/', + notifications: { + 'fileManager': ['currentFileChanged'] + }, + url: 'https://remix-vyper-plugin.surge.sh', description: 'Compile vyper contracts', kind: 'compile', icon: 'data:image/svg+xml;base64,PHN2ZyBpZD0iRmxhdF9Mb2dvIiBkYXRhLW5hbWU9IkZsYXQgTG9nbyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzczLjYyIj4gIDx0aXRsZT52eXBlci1sb2dvLWZsYXQ8L3RpdGxlPiAgPHBvbHlsaW5lIHBvaW50cz0iMTAyNCA4ODYuODEgNzY4IDEzMzAuMjIgMTAyNCAxNzczLjYyIDEyODAgMTMzMC4yMiAxMDI0IDg4Ni44MSIgc3R5bGU9ImZpbGw6IzMzMyIvPiAgPHBvbHlsaW5lIHBvaW50cz0iMTI4MCA0NDMuNDEgMTAyNCA4ODYuODEgMTI4MCAxMzMwLjIyIDE1MzYgODg2LjgxIDEyODAgNDQzLjQxIiBzdHlsZT0iZmlsbDojNjY2Ii8+ICA8cG9seWxpbmUgcG9pbnRzPSI3NjggNDQzLjQxIDUxMiA4ODYuODEgNzY4IDEzMzAuMjIgMTAyNCA4ODYuODEgNzY4IDQ0My40MSIgc3R5bGU9ImZpbGw6IzY2NiIvPiAgPHBvbHlsaW5lIHBvaW50cz0iMTUzNiAwIDEyODAgNDQzLjQxIDE1MzYgODg2LjgxIDE3OTIgNDQzLjQxIDE1MzYgMCIgc3R5bGU9ImZpbGw6IzhjOGM4YyIvPiAgPHBvbHlsaW5lIHBvaW50cz0iMTE1MiAyMjEuNyA4OTYgMjIxLjcgNzY4IDQ0My40MSAxMDI0IDg4Ni44MSAxMjgwIDQ0My40MSAxMTUyIDIyMS43IiBzdHlsZT0iZmlsbDojOGM4YzhjIi8+ICA8cG9seWxpbmUgcG9pbnRzPSI1MTIgMCAyNTYgNDQzLjQxIDUxMiA4ODYuODEgNzY4IDQ0My40MSA1MTIgMCIgc3R5bGU9ImZpbGw6IzhjOGM4YyIvPiAgPHBvbHlsaW5lIHBvaW50cz0iMjA0OCAwIDE1MzYgMCAxNzkyIDQ0My40IDIwNDggMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPiAgPHBvbHlsaW5lIHBvaW50cz0iNTEyIDAgMCAwIDI1NiA0NDMuNCA1MTIgMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPjwvc3ZnPg==', From 099a95cd667b2150d9c354568c201d3dfc4360b9 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Fri, 17 May 2019 19:19:31 +0200 Subject: [PATCH 4/4] add the expection again --- src/app/files/fileManager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 8d725319b4..7bc800515a 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -113,8 +113,10 @@ class FileManager extends FileSystemApi { return path ? path[1] : null } - async getCurrentFile () { - return this.currentFile() + getCurrentFile () { + const path = this.currentFile() + if (!path) throw new Error('No file selected') + return path } getFile (path) {