diff --git a/libs/remix-ui/editor/src/lib/providers/codeActionProvider.ts b/libs/remix-ui/editor/src/lib/providers/codeActionProvider.ts index 0efce23bee..019e7502d0 100644 --- a/libs/remix-ui/editor/src/lib/providers/codeActionProvider.ts +++ b/libs/remix-ui/editor/src/lib/providers/codeActionProvider.ts @@ -81,7 +81,8 @@ export class RemixCodeActionProvider implements monaco.languages.CodeActionProvi } } - } + } else if (fix && fix.nodeType !== nodeAtPosition.nodeType) return + actions.push({ title: fix.title, diagnostics: [error], diff --git a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts index c0d6117191..ec8e7fda6f 100644 --- a/libs/remix-ui/editor/src/lib/providers/quickfixes.ts +++ b/libs/remix-ui/editor/src/lib/providers/quickfixes.ts @@ -1,11 +1,13 @@ export default { "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.": { "title": "Add open-source license", - "message": "// SPDX-License-Identifier: GPL-3.0" + "message": "// SPDX-License-Identifier: GPL-3.0", + "nodeType": "SourceUnit" }, "Warning: Source file does not specify required compiler version! Consider adding" : { "title": "Add pragma line", "message": "pragma solidity ^0.*.*;", + "nodeType": "PragmaDirective", "range": { startLineNumber: 2, endLineNumber: 2, @@ -16,5 +18,6 @@ export default { "SyntaxError: No visibility specified. Did you intend to add \"public\"": { "title": "Add public visibility", "message": "public ", + "nodeType": "FunctionDefinition" } } \ No newline at end of file