Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scip_indexer/SCIPIndexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class SCIPState {
ast::ExpressionPtr &constantLitExpr) {
auto *expr = &constantLitExpr;
while (auto *constantLit = ast::cast_tree<ast::ConstantLit>(*expr)) {
if (constantLit->symbol.exists() && constantLit->symbol.asClassOrModuleRef().exists()) {
if (constantLit->symbol.exists() && constantLit->symbol.isClassOrModule()) {
core::Context ctx(gs, constantLit->symbol, file);
auto status = this->saveReference(ctx, GenericSymbolRef::classOrModule(constantLit->symbol),
/*overrideType*/ std::nullopt, constantLit->loc, 0);
Expand Down
16 changes: 16 additions & 0 deletions test/scip/testdata/dynamic_constant_qualifiers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# typed: true

module Helpers
Dynamic = build_helpers

class Client
include Dynamic
end

module Static
end

class OtherClient
include Helpers::Static
end
end
36 changes: 36 additions & 0 deletions test/scip/testdata/dynamic_constant_qualifiers.snapshot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# typed: true

#⌄ enclosing_range_start [..] Helpers#
module Helpers
# ^^^^^^^ definition [..] Helpers#
Dynamic = build_helpers
# ^^^^^^^ definition [..] Helpers#Dynamic.
# ^^^^^^^^^^^^^^^^^^^^^^^ reference [..] Helpers#Dynamic.

# ⌄ enclosing_range_start [..] Helpers#Client#
class Client
# ^^^^^^ definition [..] Helpers#Client#
include Dynamic
# ^^^^^^^ reference [..] Module#include().
# ^^^^^^^ reference [..] Helpers#Dynamic.
end
# ⌃ enclosing_range_end [..] Helpers#Client#

# ⌄ enclosing_range_start [..] Helpers#Static#
module Static
# ^^^^^^ definition [..] Helpers#Static#
end
# ⌃ enclosing_range_end [..] Helpers#Static#

# ⌄ enclosing_range_start [..] Helpers#OtherClient#
class OtherClient
# ^^^^^^^^^^^ definition [..] Helpers#OtherClient#
include Helpers::Static
# ^^^^^^^ reference [..] Module#include().
# ^^^^^^^ reference [..] Helpers#
# ^^^^^^ reference [..] Helpers#Static#
# ^^^^^^ reference [..] Helpers#Static#
end
# ⌃ enclosing_range_end [..] Helpers#OtherClient#
end
# ⌃ enclosing_range_end [..] Helpers#