Skip to content

Commit

Permalink
test: ignore lines for coverage that cannot be covered
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Sep 28, 2023
1 parent f871ae0 commit 67bbfcf
Showing 1 changed file with 2 additions and 56 deletions.
58 changes: 2 additions & 56 deletions src/language/scoping/safe-ds-scope-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ export class SafeDsScopeProvider extends DefaultScopeProvider {
private globalDeclarationsInSameFile(node: AstNode, outerScope: Scope): Scope {
const module = getContainerOfType(node, isSdsModule);
if (!module) {
/* c8 ignore next 2 */
return outerScope;
}

const precomputed = getDocument(module).precomputedScopes?.get(module);
if (!precomputed) {
/* c8 ignore next 2 */
return outerScope;
}

Expand Down Expand Up @@ -167,34 +169,6 @@ export class SafeDsScopeProvider extends DefaultScopeProvider {
}
}

// private fun localDeclarations(context: EObject, parentScope: IScope): IScope {
// // Placeholders
// val placeholders = when (val containingStatement = context.closestAncestorOrNull<SdsAbstractStatement>()) {
// null -> emptyList()
// else ->
// containingStatement
// .closestAncestorOrNull<SdsBlock>()
// ?.placeholdersUpTo(containingStatement)
// .orEmpty()
// }
//
// // Parameters
// val containingCallable = context.containingCallableOrNull()
// val parameters = containingCallable.parametersOrEmpty()
//
// // Local declarations
// val localDeclarations = placeholders + parameters
//
// return when (containingCallable) {
// // Lambdas can be nested
// is SdsAbstractLambda -> Scopes.scopeFor(
// localDeclarations,
// localDeclarations(containingCallable, parentScope),
// )
// else -> Scopes.scopeFor(localDeclarations, parentScope)
// }
// }

// private fun scopeForReferenceDeclaration(context: SdsReference): IScope {
// val resource = context.eResource()
// val packageName = context.containingCompilationUnitOrNull()?.qualifiedNameOrNull()
Expand Down Expand Up @@ -310,34 +284,6 @@ export class SafeDsScopeProvider extends DefaultScopeProvider {
// else -> Scopes.scopeFor(context.classMembersOrEmpty(), parentScope)
// }
// }
//
// private fun localDeclarations(context: EObject, parentScope: IScope): IScope {
// // Placeholders
// val placeholders = when (val containingStatement = context.closestAncestorOrNull<SdsAbstractStatement>()) {
// null -> emptyList()
// else ->
// containingStatement
// .closestAncestorOrNull<SdsBlock>()
// ?.placeholdersUpTo(containingStatement)
// .orEmpty()
// }
//
// // Parameters
// val containingCallable = context.containingCallableOrNull()
// val parameters = containingCallable.parametersOrEmpty()
//
// // Local declarations
// val localDeclarations = placeholders + parameters
//
// return when (containingCallable) {
// // Lambdas can be nested
// is SdsAbstractLambda -> Scopes.scopeFor(
// localDeclarations,
// localDeclarations(containingCallable, parentScope),
// )
// else -> Scopes.scopeFor(localDeclarations, parentScope)
// }
// }

private getScopeForYieldResult(node: SdsYield): Scope {
const containingSegment = getContainerOfType(node, isSdsSegment);
Expand Down

0 comments on commit 67bbfcf

Please sign in to comment.