-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly emit refs for entities in the Opus namespace (#223)
Fixes https://linear.app/sourcegraph/issue/GRAPH-857 ### Motivation I think I added a workaround here originally as it wasn't super clear if the extra entities for `encrypted_prop:` would be useful. But the problem is that the workaround would stop code nav for other things inside the Opus namespace in other contexts. Let's fix the immediate issue for now, I've filed a follow-up issue for synthetic references from rewrites here. https://linear.app/sourcegraph/issue/GRAPH-928
- Loading branch information
1 parent
189e47e
commit 0070514
Showing
4 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# typed: true | ||
|
||
class Opus::Base | ||
end | ||
|
||
class Opus::Derived < Opus::Base | ||
end | ||
|
||
TYPES = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
|
||
module ABC | ||
TYPES_IN_MODULE = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
end | ||
|
||
class Other | ||
TYPES_IN_CLASS = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# typed: true | ||
|
||
class Opus::Base | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^ definition [..] Opus#Base# | ||
end | ||
|
||
class Opus::Derived < Opus::Base | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^^^^ definition [..] Opus#Derived# | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^ reference [..] Opus#Base# | ||
end | ||
|
||
TYPES = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
#^^^^^ definition [..] TYPES. | ||
# ^^ reference [..] Kernel# | ||
# ^^ reference [..] Kernel#lambda(). | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^^^^ reference [..] Opus#Derived# | ||
# ^ reference [..] T# | ||
# ^^^^ reference [..] T#Hash# | ||
# ^^^^^^ reference [..] Symbol# | ||
# ^ reference [..] T# | ||
# ^^^^ reference [..] `<Class:T>`#proc(). | ||
# ^ reference [..] T# | ||
# ^^^^^^^^ reference [..] `<Class:T>`#class_of(). | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^ reference [..] Opus#Base# | ||
# ^^^^^^^ definition local 4~#119448696 | ||
# ^^^^^^^^ reference [..] TYPES. | ||
|
||
module ABC | ||
# ^^^ definition [..] ABC# | ||
TYPES_IN_MODULE = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
# ^^^^^^^^^^^^^^^ definition [..] ABC#TYPES_IN_MODULE. | ||
# ^^ reference [..] Kernel# | ||
# ^^ reference [..] Kernel#lambda(). | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^^^^ reference [..] Opus#Derived# | ||
# ^^^^^^ reference [..] Symbol# | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^ reference [..] Opus#Base# | ||
# ^^^^^^^ definition local 4~#119448696 | ||
# ^^^^^^^^ reference [..] ABC#TYPES_IN_MODULE. | ||
end | ||
|
||
class Other | ||
# ^^^^^ definition [..] Other# | ||
TYPES_IN_CLASS = T.let({ derived: -> { Opus::Derived } }, T::Hash[Symbol, T.proc.returns(T.class_of(Opus::Base))]) | ||
# ^^^^^^^^^^^^^^ definition [..] Other#TYPES_IN_CLASS. | ||
# ^^ reference [..] Kernel# | ||
# ^^ reference [..] Kernel#lambda(). | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^^^^ reference [..] Opus#Derived# | ||
# ^^^^^^ reference [..] Symbol# | ||
# ^^^^ reference [..] Opus# | ||
# ^^^^ reference [..] Opus#Base# | ||
# ^^^^^^^ definition local 4~#119448696 | ||
# ^^^^^^^^ reference [..] Other#TYPES_IN_CLASS. | ||
end |