diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index fcf96659ec..3f02d4e716 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -11,7 +11,7 @@ const requiredModules = [ // services + layout views + system views 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout', 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected-optimism-provider', 'injected-arbitrum-one-provider', - 'compileAndRun', 'search', 'recorder', 'fileDecorator'] + 'compileAndRun', 'search', 'recorder', 'fileDecorator', 'codeParser'] // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) const dependentModules = ['hardhat', 'truffle', 'slither'] diff --git a/libs/remix-ui/editor/src/lib/providers/completionProvider.ts b/libs/remix-ui/editor/src/lib/providers/completionProvider.ts index 6021e22ae5..745c5e395b 100644 --- a/libs/remix-ui/editor/src/lib/providers/completionProvider.ts +++ b/libs/remix-ui/editor/src/lib/providers/completionProvider.ts @@ -242,8 +242,10 @@ export class RemixCompletionProvider implements languages.CompletionItemProvider // try to find the real block in the AST and get the nodes in that scope if (node.nodeType === 'ContractDefinition') { const contractNodes = fileNodes.contracts[node.name].contractNodes - for (const contractNode of Object.values(contractNodes)) { - if (contractNode['name'] === ANTLRBlock.name) { + for (const contractNode of Object.values(contractNodes)) { + if (contractNode['name'] === ANTLRBlock.name + || (contractNode['kind'] === 'constructor' && ANTLRBlock.name === null ) + ) { let nodeOfScope = await this.props.plugin.call('codeParser', 'getNodesWithScope', (contractNode as any).id) nodes = [...nodes, ...nodeOfScope] if (contractNode['body']) {