[2.x] fix: support comma-separated imports in build.sbt#8829
Merged
eed3si9n merged 2 commits intosbt:developfrom Mar 1, 2026
Merged
[2.x] fix: support comma-separated imports in build.sbt#8829eed3si9n merged 2 commits intosbt:developfrom
eed3si9n merged 2 commits intosbt:developfrom
Conversation
Contributor
Author
|
@eed3si9n Please review my PR. Thanks. |
xuwei-k
previously requested changes
Feb 28, 2026
Member
xuwei-k
left a comment
There was a problem hiding this comment.
Please add scripted test. not only SbtParserTest unit test.
Member
|
@RenzoMXD Hi, thanks for the contribution! Here's a doc on scripted test - https://github.com/sbt/sbt/blob/develop/contributing-docs/05_scripted_tests.md Please check out our Contributor's Guildeline and:
|
Contributor
Author
eed3si9n
reviewed
Feb 28, 2026
| @@ -0,0 +1,11 @@ | |||
| import scala.util, util.Random | |||
eed3si9n
pushed a commit
to eed3si9n/sbt
that referenced
this pull request
Mar 1, 2026
Summary - Fix `SbtParser.importsToLineRanges` to prepend `import` keyword when missing from Dotty's `Import` AST node source spans - Add unit test for comma-separated import parsing
eed3si9n
added a commit
that referenced
this pull request
Mar 1, 2026
Summary - Fix `SbtParser.importsToLineRanges` to prepend `import` keyword when missing from Dotty's `Import` AST node source spans - Add unit test for comma-separated import parsing Co-authored-by: Renzo <[email protected]>
Contributor
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SbtParser.importsToLineRangesto prependimportkeyword when missing from Dotty'sImportAST node source spansProblem
import scala.util, util.Randominbuild.sbtfails with:Dotty splits comma-separated imports into separate
ImportAST nodes, but only the first node's source span includes theimportkeyword.importsToLineRangesextracts raw source text, producing("util.Random", 1)instead of("import util.Random", 1).Test plan
sbt-app/src/sbt-test/project/comma-separated-import/build.sbt— scripted test buildsbt-app/src/sbt-test/project/comma-separated-import/test— scripted test scriptFixes #8826