Skip to content

Commit

Permalink
refactor: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Sep 28, 2023
1 parent 67bbfcf commit 92f003a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/language/scoping/safe-ds-scope-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
isSdsCallable,
isSdsClass,
isSdsEnum,
isSdsExpressionLambda,
isSdsLambda,
isSdsMemberAccess,
isSdsMemberType,
Expand Down Expand Up @@ -123,19 +122,18 @@ export class SafeDsScopeProvider extends DefaultScopeProvider {
}

private localDeclarations(node: AstNode, outerScope: Scope): Scope {
// Own parameters
// Parameters
const containingCallable = getContainerOfType(node.$container, isSdsCallable);
const parameters = parametersOrEmpty(containingCallable?.parameterList);

// Own placeholders
const containingExpressionLambda = getContainerOfType(node.$container, isSdsExpressionLambda);
// Placeholders up to the containing statement
const containingStatement = getContainerOfType(node.$container, isSdsStatement);

let placeholders: Iterable<SdsPlaceholder>;
if (!containingExpressionLambda || isContainedIn(containingStatement, containingExpressionLambda)) {
if (!containingCallable || isContainedIn(containingStatement, containingCallable)) {
placeholders = this.placeholdersUpToStatement(containingStatement);
} else {
// We already jumped out of the expression lambda
// Placeholders are further away than the parameters
placeholders = [];
}

Expand Down

0 comments on commit 92f003a

Please sign in to comment.