diff --git a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts index 1e44988bcf..e01aa2e19e 100644 --- a/apps/remix-ide-e2e/src/tests/file_decorator.test.ts +++ b/apps/remix-ide-e2e/src/tests/file_decorator.test.ts @@ -16,7 +16,7 @@ module.exports = { .openFile('contracts/3_Ballot.sol') .addFile('scripts/decorators.ts', { content: testScriptSet }) .pause(2000) - .executeScriptInTerminal('remix.exeCurrent()') + .click('[data-id="play-editor"]') .pause(4000) .useXpath() .waitForElementContainsText('//*[@id="fileExplorerView"]//*[@data-id="file-decoration-error-contracts/2_Owner.sol"]', '2') @@ -37,7 +37,7 @@ module.exports = { .useCss() .addFile('scripts/clearballot.ts', { content: testScriptClearBallot }) .pause(2000) - .executeScriptInTerminal('remix.exeCurrent()') + .click('[data-id="play-editor"]') .pause(4000) .waitForElementNotPresent('[data-id="file-decoration-custom-contracts/3_Ballot.sol"]', 10000) }, @@ -45,7 +45,7 @@ module.exports = { browser .addFile('scripts/clearall.ts', { content: testScriptClear }) .pause(2000) - .executeScriptInTerminal('remix.exeCurrent()') + .click('[data-id="play-editor"]') .pause(4000) .waitForElementNotPresent('[data-id="file-decoration-error-contracts/2_Owner.sol"]', 10000) .waitForElementNotPresent('[data-id="file-decoration-warning-contracts/1_Storage.sol"]', 10000) diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts index 9e0089401d..5974c0b6b9 100644 --- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts +++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts @@ -225,20 +225,10 @@ export default class CodeParserCompiler { } for (const fileName of filesWithOutErrors) { const fileTarget = await this.plugin.call('fileManager', 'getPathFromUrl', fileName) - const decorator: fileDecoration = { - path: fileTarget.file, - isDirectory: false, - fileStateType: fileDecorationType.None, - fileStateLabelClass: '', - fileStateIconClass: '', - fileStateIcon: '', - text: '', - owner: 'code-parser', - bubble: false - } - decorators.push(decorator) + await this.plugin.call('fileDecorator', 'clearFileDecorators', fileTarget.file) } - await this.plugin.call('fileDecorator', 'setFileDecorators', decorators) + if(decorators.length > 0) + await this.plugin.call('fileDecorator', 'setFileDecorators', decorators) await this.plugin.call('editor', 'clearErrorMarkers', filesWithOutErrors) } @@ -265,22 +255,8 @@ export default class CodeParserCompiler { const decorators: fileDecoration[] = [] if (!sources) return for (const fileName of Object.keys(sources)) { - const decorator: fileDecoration = { - path: fileName, - isDirectory: false, - fileStateType: fileDecorationType.None, - fileStateLabelClass: '', - fileStateIconClass: '', - fileStateIcon: '', - text: '', - owner: 'code-parser', - bubble: false - } - decorators.push(decorator) + await this.plugin.call('fileDecorator', 'clearFileDecorators', fileName) } - - - await this.plugin.call('fileDecorator', 'setFileDecorators', decorators) } async getPositionForImportErrors(importedFileName: string, text: string) { diff --git a/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx b/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx index 08fffd7add..9b1315f734 100644 --- a/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx +++ b/libs/remix-ui/workspace/src/lib/components/flat-tree.tsx @@ -145,7 +145,7 @@ export const FlatTree = (props: FlatTreeProps) => { if (state.path === file.path) return true if (state.bubble && file.isDirectory && state.path.startsWith(file.path)) return true }) - if (state && state.fileStateLabelClass) { + if (state) { return } }