Skip to content

Add support for Deder build tool#8343

Open
sake92 wants to merge 5 commits intoscalameta:mainfrom
sake92:main
Open

Add support for Deder build tool#8343
sake92 wants to merge 5 commits intoscalameta:mainfrom
sake92:main

Conversation

@sake92
Copy link
Copy Markdown
Contributor

@sake92 sake92 commented Apr 30, 2026

This adds support for Deder build tool automatic import.


I've tested this locally, works fine.
Tho I am not sure why I get 2 of these messages, shouldn't there be just one? (or even none if it's obvious which build tool it should use)

1:
Screenshot from 2026-04-30 14-35-55

2 (switch? after I accepted to use Deder?):
Screenshot from 2026-04-30 14-36-09

Summary by CodeRabbit

  • New Features
    • Added full Deder build tool support with project detection and integration into the build system.
    • Build system now recognizes Deder configuration files and associates Deder-related project paths automatically.
    • Integrated BSP installation/management support for Deder workspaces.
    • Deder is included among recognized build tool identifiers.
    • Build digest computation now covers Deder workspaces for accurate change detection.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca54e693-04e0-4f9a-b119-b08612971242

📥 Commits

Reviewing files that changed from the base of the PR and between cfcfef9 and 3ca1857.

📒 Files selected for processing (1)
  • tests/unit/src/test/scala/tests/UserConfigurationSuite.scala
 _______________________________________________________
< Cyberdyne Systems Model GPT-101: Code Review Edition. >
 -------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

Adds Deder build-tool support: detection, a new DederBuildTool implementation (including BSP install command), workspace digesting via DederDigest, and wiring to include Deder in build-tool enumeration and path-relations.

Changes

Deder build tool integration

Layer / File(s) Summary
Detection / Flags
metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala
Adds dederProject: Option[AbsolutePath] and isDeder: Boolean; includes Deder in isBuildRelated path checks.
Core Implementation
metals/src/main/scala/scala/meta/internal/builds/DederBuildTool.scala
New DederBuildTool(userConfig: () => UserConfiguration, projectRoot: AbsolutePath) implementing BuildTool and BuildServerProvider; provides installBspCommand (List("deder","bsp","install")), sets executable name, overrides toString, and exposes isDederRelatedPath helper.
Workspace Digest
metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala
New DederDigest extends Digestable; digestWorkspace checks for deder.pkl and digests it if present, returning false otherwise.
Enumeration / Wiring
metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala
Registers DederBuildTool in allAvailable, all, and loadSupported; adds DederBuildTool.bspName to knownBsps and DederBuildTool.name to allBuildToolNames.

Sequence Diagram

sequenceDiagram
    participant Workspace
    participant BuildTools
    participant DederBuildTool
    participant DederDigest
    participant BSP

    Workspace->>BuildTools: scan workspace
    BuildTools->>Workspace: check for `deder.pkl`
    alt `deder.pkl` found
        BuildTools->>DederBuildTool: instantiate(projectRoot, userConfig)
        DederBuildTool->>DederDigest: current(projectRoot)
        DederDigest->>Workspace: read `deder.pkl`
        Workspace-->>DederDigest: file contents
        DederDigest-->>DederBuildTool: digest result
        DederBuildTool->>BSP: run ["deder","bsp","install"]
        BSP-->>DederBuildTool: BSP ready
        DederBuildTool-->>BuildTools: registered/loaded
    else not found
        BuildTools-->>Workspace: no Deder project
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibble bytes where deder.pkl hides,

Paths aligned and BSP installs glide,
BuildTools sniff, the digest hums,
Deder joins the build-time drums,
Hooray — another tool at our side!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for the Deder build tool. It directly matches the changeset which introduces DederBuildTool, DederDigest, and integration into BuildTools.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala`:
- Around line 215-216: Add the Deder BSP name string "deder-bsp" to the
knownBsps collection in scala.meta.internal.builds.BuildTools so that the
DederBuildTool (DederBuildTool(userConfig, workspace)) is recognized as a known
built-in BSP instead of being treated as a separate custom tool; update the
knownBsps definition to include the "deder-bsp" entry next to other BSP names to
prevent duplicate/unknown BSP detection and the second switch prompt.

In `@metals/src/main/scala/scala/meta/internal/builds/DederBuildTool.scala`:
- Around line 23-30: The BSP identity currently exposes "deder" via
DederBuildTool.name, causing a mismatch with the detected "deder-bsp"; update
the object DederBuildTool so the public identity matches the BSP by changing the
val name (used by executableName and consumers) to "deder-bsp" so executableName
and any tool-detection logic report the same identifier.

In `@metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala`:
- Around line 12-15: DederDigest currently treats a missing deder.pkl as success
because the else branch returns true; update the logic in DederDigest (use the
dederFile and Digest.digestFile calls) so that when dederFile.isFile is false it
returns false (or otherwise signals failure) instead of true, ensuring
Digestable.current() will not produce a digest when deder.pkl is absent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7bbae11c-d79a-49ff-a66b-6ed33b05290f

📥 Commits

Reviewing files that changed from the base of the PR and between 7150cac and dcd7d8e.

📒 Files selected for processing (3)
  • metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala
  • metals/src/main/scala/scala/meta/internal/builds/DederBuildTool.scala
  • metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala

Comment thread metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala
Comment thread metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala
Copy link
Copy Markdown
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising the PR. I would be ok with including it, the comments from coderabbit make sense and should help out with the issues you are seeing

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala (1)

146-149: 💤 Low value

Add Deder detection tests to DetectionSuite.

Other build tools have detection coverage in DetectionSuite (sbt/mill/gradle/maven). Add a small checkDeder helper and test cases for isDeder/dederProject detection with a workspace containing deder.pkl to prevent future regressions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala` around
lines 146 - 149, Add unit tests to DetectionSuite to cover Deder detection:
implement a small helper named checkDeder (similar to existing
checkSbt/checkMill) that sets up a temporary workspace containing the
DederBuildTool.buildFile (deder.pkl) and asserts that BuildTools.isDeder returns
true and BuildTools.dederProject is defined (and conversely false/None for
workspaces without deder.pkl). Locate references to DetectionSuite, checkDeder,
isDeder, dederProject and DederBuildTool.buildFile when adding the tests so they
mirror the structure of existing sbt/mill/gradle/maven detection tests to
prevent future regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala`:
- Around line 146-149: Add unit tests to DetectionSuite to cover Deder
detection: implement a small helper named checkDeder (similar to existing
checkSbt/checkMill) that sets up a temporary workspace containing the
DederBuildTool.buildFile (deder.pkl) and asserts that BuildTools.isDeder returns
true and BuildTools.dederProject is defined (and conversely false/None for
workspaces without deder.pkl). Locate references to DetectionSuite, checkDeder,
isDeder, dederProject and DederBuildTool.buildFile when adding the tests so they
mirror the structure of existing sbt/mill/gradle/maven detection tests to
prevent future regressions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2263f273-e933-47c6-8ceb-266ec98ebdf9

📥 Commits

Reviewing files that changed from the base of the PR and between dcd7d8e and cfcfef9.

📒 Files selected for processing (3)
  • metals/src/main/scala/scala/meta/internal/builds/BuildTools.scala
  • metals/src/main/scala/scala/meta/internal/builds/DederBuildTool.scala
  • metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala
🚧 Files skipped from review as they are similar to previous changes (1)
  • metals/src/main/scala/scala/meta/internal/builds/DederDigest.scala

@tgodzik
Copy link
Copy Markdown
Contributor

tgodzik commented May 6, 2026

Looks like there is a valid test failure in UserConfigurationSuite, but otherwise there some flakiness related to sonatype's recent changes.

@sake92
Copy link
Copy Markdown
Contributor Author

sake92 commented May 6, 2026

Looks like there is a valid test failure in UserConfigurationSuite, but otherwise there some flakiness related to sonatype's recent changes.

Thanks! I will have a look tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants