fixes no file selected error

pull/2227/head
aniket-engg 3 years ago committed by yann300
parent 63c30e258e
commit c00365b0b0
  1. 8
      libs/remix-core-plugin/src/lib/editor-context-listener.ts

@ -55,10 +55,16 @@ export class EditorContextListener extends Plugin {
setInterval(async () => { setInterval(async () => {
const compilationResult = await this.call('compilerArtefacts', 'getLastCompilationResult') const compilationResult = await this.call('compilerArtefacts', 'getLastCompilationResult')
if (compilationResult && compilationResult.languageversion.indexOf('soljson') === 0) { if (compilationResult && compilationResult.languageversion.indexOf('soljson') === 0) {
let currentFile
try {
currentFile = await this.call('fileManager', 'file')
} catch (error) {
if (error.message !== 'Error: No such file or directory No file selected') throw error
}
this._highlightItems( this._highlightItems(
await this.call('editor', 'getCursorPosition'), await this.call('editor', 'getCursorPosition'),
compilationResult, compilationResult,
await this.call('fileManager', 'file') currentFile
) )
} }
}, 1000) }, 1000)

Loading…
Cancel
Save