Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 6c09f75

Browse files
Merge pull request #216 from github/remove-scope-stack-linearity
2 parents 81a4f02 + 4840877 commit 6c09f75

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

languages/tree-sitter-stack-graphs-typescript/src/stack-graphs.tsg

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5847,26 +5847,6 @@ if none @is_acc {
58475847
;
58485848
attr (@gen_decl.type_abs) pop_scoped_symbol = "<>"
58495849
edge @gen_decl.type_abs -> @gen_decl.generic_inner_type
5850-
5851-
; FIXME This edge enables resolving to a member while dropping the type
5852-
; application from the scope stack. This is necessary to be able to
5853-
; resolve to a member inside a generic type without consuming its type.
5854-
; Consuming the type results in either DROP or JUMP. Resolving just to
5855-
; the field does not consume the scope on the scope stack, and is not
5856-
; considered a complete path.
5857-
; I think this is an example where a semantics that allows a non-
5858-
; empty scope stack, but not symbol stack, makes more sense than re-
5859-
; quiring the complete consumption of it. One of the effects of the strict
5860-
; semantics is that an intermediate path may not resolve on its own, but does
5861-
; resolve in the context of another path.
5862-
; An example can be found in the test `types/generic-interface.ts`, where
5863-
; in the expression `x.f.v`, the reference `.f` does not resolve on its own,
5864-
; while the reference `.v`, which depend on being able to resolve `.f` does
5865-
; resolve fine.
5866-
edge @gen_decl.type_abs -> @gen_decl.drop_type_abs
5867-
;
5868-
attr (@gen_decl.drop_type_abs) type = "drop_scopes"
5869-
edge @gen_decl.drop_type_abs -> @gen_decl.generic_inner_type
58705850
}
58715851

58725852
;; Attributes defined on generic applications

stack-graphs/src/partial.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,9 +1818,7 @@ impl PartialPath {
18181818
/// Returns whether a partial path represents the end of a name binding from a reference to a
18191819
/// definition.
18201820
pub fn ends_at_definition(&self, graph: &StackGraph) -> bool {
1821-
graph[self.end_node].is_definition()
1822-
&& self.symbol_stack_postcondition.can_match_empty()
1823-
&& self.scope_stack_postcondition.can_match_empty()
1821+
graph[self.end_node].is_definition() && self.symbol_stack_postcondition.can_match_empty()
18241822
}
18251823

18261824
/// A _complete_ partial path represents a full name binding that resolves a reference to a

0 commit comments

Comments
 (0)