Skip to content

Commit

Permalink
Revert "Populate import symbols with correct name when Importee.Rename (
Browse files Browse the repository at this point in the history
#103)" (#111)

This reverts commit 5831670.
  • Loading branch information
pcj authored Dec 12, 2023
1 parent 04527ef commit 7316bb2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion language/scala/scala_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ func (r *scalaRule) fileImports(file *sppb.File, imports resolver.ImportMap) {
log.Fatalf("invalid extends token: %q: should have form '(class|interface|object) com.foo.Bar' ", token)
}

name := parts[1] // note: parts[0] is the 'kind'
// kind := parts[0]
name := parts[1]

// assume the name if fully-qualified, so resolve it from the "root"
// scope rather than involving package scopes.
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/scalameta_parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class ScalaFile {
scope.addImport([ref, importee.name.value].join('.'), importee.name.value)
break;
case 'Importee.Rename':
scope.addImport([ref, importee.rename.value].join('.'), importee.rename.value)
scope.addImport([ref, importee.name.value].join('.'), importee.name.value)
break;
case 'Importee.Unimport':
// an unimport is specifically excluded from the scala
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/scalameta_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ object Palette {
Objects: []string{"color.Palette"},
Imports: []string{
"java.awt.Color",
"scala.util.Random.rint",
"scala.util.Random.nextInt",
},
Names: []string{
"MandelPalette",
Expand Down

0 comments on commit 7316bb2

Please sign in to comment.