Skip to content

Experimental wildcard import resolver strategy #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
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
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ scalacache_protos:
mv build/stack/gazelle/scala/cache/build/stack/gazelle/scala/cache/*.go build/stack/gazelle/scala/cache/
rm -rf build/stack/gazelle/scala/cache/build

.PHONY: autokeep_protos
autokeep_protos:
bazel run //build/stack/gazelle/scala/autokeep:autokeep_go_compiled_sources.update
mv build/stack/gazelle/scala/autokeep/build/stack/gazelle/scala/autokeep/*.go build/stack/gazelle/scala/autokeep/
rm -rf build/stack/gazelle/scala/autokeep/build

.PHONY: protos
protos: jarindex_protos parser_protos scalacache_protos
protos: jarindex_protos parser_protos scalacache_protos autokeep_protos
echo "Done."

.PHONY: tidy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ Another way to resolve the conflict is to use a `resolver.ConflictResolver` impl
type ConflictResolver interface {
// ResolveConflict takes the context rule and imports, and the target symbol
// with conflicts to resolve.
ResolveConflict(universe Universe, r *rule.Rule, imports ImportMap, imp *Import, symbol *Symbol) (*Symbol, bool)
ResolveConflict(universe Universe, r *rule.Rule, imports ImportMap, imp *Import, symbol *Symbol, from label.Label) (*Symbol, bool)
}
```

Expand Down
218 changes: 170 additions & 48 deletions build/stack/gazelle/scala/parse/file.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions build/stack/gazelle/scala/parse/file.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package build.stack.gazelle.scala.parse;

import "build/stack/gazelle/scala/parse/symbol.proto";
import "build/stack/gazelle/scala/parse/import.proto";

option go_package = "github.com/stackb/scala-gazelle/build/stack/gazelle/scala/parse;parse";
option java_package = "build.stack.gazelle.scala.parse";
Expand Down Expand Up @@ -40,3 +41,19 @@ message File {
message ClassList {
repeated string classes = 1;
}

// Import represents a resolved import/export.
message Import {
// Kind is the import type
ImportKind kind = 1;
// Imp is the name of the import
string imp = 2;
// File is the source file (when this is a direct import).
string source_file = 3;
// Src is the name of the parent import (when this is an implicit import)
string src = 4;
// Symbol is the resolved symbol of the import, or nil if not resolved.
Symbol symbol = 5;
// Error is assiged if there is a resolution error.
string error = 6;
}
Loading
Loading