fix parameters in constructors being treated as fields

This commit is contained in:
brianush1 2023-07-15 21:07:31 +03:00
parent 1c60c5480f
commit f814594d12
1 changed files with 7 additions and 1 deletions

View File

@ -908,7 +908,6 @@ private:
CompletionKind.functionName, symbolFile, location); CompletionKind.functionName, symbolFile, location);
symbol.parent = currentSymbol; symbol.parent = currentSymbol;
currentSymbol.addChild(symbol, true); currentSymbol.addChild(symbol, true);
processParameters(symbol, null, THIS_SYMBOL_NAME, parameters, templateParameters);
symbol.acSymbol.protection = protection.current; symbol.acSymbol.protection = protection.current;
symbol.acSymbol.doc = makeDocumentation(doc); symbol.acSymbol.doc = makeDocumentation(doc);
@ -921,9 +920,16 @@ private:
pushFunctionScope(functionBody, location + 4); // 4 == "this".length pushFunctionScope(functionBody, location + 4); // 4 == "this".length
scope(exit) popScope(); scope(exit) popScope();
currentSymbol = symbol; currentSymbol = symbol;
processParameters(symbol, null, THIS_SYMBOL_NAME, parameters, templateParameters);
functionBody.accept(this); functionBody.accept(this);
currentSymbol = currentSymbol.parent; currentSymbol = currentSymbol.parent;
} }
else
{
currentSymbol = symbol;
processParameters(symbol, null, THIS_SYMBOL_NAME, parameters, templateParameters);
currentSymbol = currentSymbol.parent;
}
} }
void visitDestructor(size_t location, const FunctionBody functionBody, string doc) void visitDestructor(size_t location, const FunctionBody functionBody, string doc)