editorcontextDummy
filip mertens 2 years ago
parent 3cfc8d1d0b
commit 640c8af011
  1. 1
      apps/remix-ide-e2e/src/tests/editor.test.ts
  2. 3
      apps/remix-ide/src/app/plugins/parser/code-parser.tsx
  3. 10
      libs/remix-ui/editor/src/lib/providers/completionProvider.ts

@ -234,6 +234,7 @@ contract Storage {
} }
}` }`
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const BallotWithARefToOwner = ` const BallotWithARefToOwner = `

@ -375,7 +375,6 @@ export class CodeParser extends Plugin {
async positionOfDefinition(node: any): Promise<any | null> { async positionOfDefinition(node: any): Promise<any | null> {
if (node) { if (node) {
if (node.src) { if (node.src) {
console.log('positionOfDefinition', node)
const position = sourceMappingDecoder.decode(node.src) const position = sourceMappingDecoder.decode(node.src)
if (position) { if (position) {
return position return position
@ -393,7 +392,6 @@ export class CodeParser extends Plugin {
*/ */
async resolveImports(node, imported = {}) { async resolveImports(node, imported = {}) {
if (node.nodeType === 'ImportDirective' && !imported[node.sourceUnit]) { if (node.nodeType === 'ImportDirective' && !imported[node.sourceUnit]) {
console.log('IMPORTING', node)
const importNode = await this.getNodeById(node.sourceUnit) const importNode = await this.getNodeById(node.sourceUnit)
imported[importNode.id] = importNode imported[importNode.id] = importNode
if (importNode.nodes) { if (importNode.nodes) {
@ -402,7 +400,6 @@ export class CodeParser extends Plugin {
} }
} }
} }
console.log(imported)
return imported return imported
} }

@ -56,7 +56,15 @@ export class RemixCompletionProvider implements languages.CompletionItemProvider
} }
if (lastNodeInExpression.name === 'this') { if (lastNodeInExpression.name === 'this') {
dotCompleted = true dotCompleted = true
nodes = [...nodes, ...await this.getContractCompletions(nodes, position)] let thisCompletionNodes = await this.getContractCompletions(nodes, position)
thisCompletionNodes = thisCompletionNodes.filter(node =>
{
if(node.visibility && node.visibility === 'internal') {
return false
}
return true
})
nodes = [...nodes, ...thisCompletionNodes]
} }
//} //}
if (expressionElements.length > 1 && !dotCompleted) { if (expressionElements.length > 1 && !dotCompleted) {

Loading…
Cancel
Save