Idea logo

IntelliJ IDEA

IntelliJ IDEA – the IDE for Professional Development in Java and Kotlin

Build System IntelliJ IntelliJ IDEA Releases

What’s New in Bazel Plugin 2025.1

We’re excited to tell you about all the changes we’ve made in recent months to improve the Bazel plugin experience in IntelliJ IDEA. Every couple of weeks, we’ve been shipping updates to JetBrains Marketplace with focused fixes and features. Over time, these smaller updates have amounted to substantial enhancements. Most updates are included in the 2024.3 and 2025.1 versions of the Bazel plugin, but if you see something here that you’re missing, try upgrading!

Here’s a more detailed look at what we improved and added:

Spotlight features: Bazel 8, faster sync, Python, and Scala

phased sync in action on the Bazel project
phased sync in action on the Bazel project
  • Full Bazel 8 and nested modules support: Bazel 8 projects should now work seamlessly. This includes support for nested modules. This Bazel feature allows structuring large projects less monolithically, enabling teams to work on and import sub-modules somewhat independently, which the plugin now fully understands. You can import these modules individually or treat the whole repository as one unit.
  • Phased sync (experimental): Try it! Designed to drastically reduce the time you spend waiting for initial project syncs. Enable this experimental mode under Settings | Build, Execution, Deployment | Build Tools | Bazel | Advanced Settings, and the plugin performs a quicker initial import phase. You can start browsing and editing your code almost immediately, while heavier tasks like resolving all dependencies and indexing generated code happen concurrently in the background. This means less upfront delay and fewer distracting red squiggles while background work completes.
  • Python and Scala support: These languages are now officially supported targets. This means you get the full IDE experience: sync Python and Scala targets, enjoy code assistance during editing, run and debug your code – all integrated with Bazel’s build process.

JVM project enhancements: smoother sailing

  • Improved project structure handling: The plugin is now smarter at detecting common project layouts, particularly Maven-style structures where all sources in a directory belong to a single target. This translates to IntelliJ’s own features (like package prefix detection and source root identification), working more reliably out of the box.

Getting started & managing dependencies: Less friction

add dependencies on the fly
add dependencies on the fly
  • Quick start project templates: For those new to Bazel or starting a fresh project, we’ve added basic project templates for Java and Kotlin. These provide a minimal, working Bazel setup (MODULE.bazel, BUILD files) so you’re not starting from a completely blank slate.
  • Add dependencies directly from code: When you use a class from another part of your Bazel project that isn’t yet a dependency, IntelliJ’s standard Alt+Enter intention actions will now offer an Add dependency on module… option. Selecting this automatically finds the target defining the class and adds the necessary dependency line to your current target’s BUILD file. This is a significant time-saver, bypassing manual BUILD file editing and requiring no Bazel sync afterward.

Working with targets: More convenient actions

Shift-Shift to your target of choice
Shift-Shift to your target of choice
  • Create Bazel packages from the context menu: Right-click a directory in the Project view and select the option to create a new Bazel package. The plugin will create the directory (if needed) and a blank BUILD or BUILD.bazel file, reducing boilerplate.
  • Easier access from source file tabs: Right-clicking on an open editor tab now gives you quick actions to navigate to the corresponding BUILD file for that source file, or to copy the file’s Bazel target label (e.g. //path/to:target) to the clipboard for use elsewhere. You can assign keyboard shortcuts to these actions for maximum efficiency.
  • Search Everywhere finds targets: Bazel targets are now integrated into IntelliJ IDEA’s powerful Search Everywhere (Shift+Shift) feature. Type part of a target name, and you can jump directly to its definition in the corresponding BUILD file. The preview shows you where you will go right away.

Running tests: Debugging, coverage, and more

run tests - with or without coverage
run tests – with or without coverage
  • Debugging and coverage for Bazel tests: You can now launch Bazel test targets directly from the IDE with the debugger attached or with code coverage enabled, using IntelliJ IDEA’s standard testing UI and tools.
  • Run multiple tests easily: Right-click a directory in the Project tree view, or a target node in the Bazel tool window, to run all tests contained within that scope. This provides a convenient way to execute logical groups of tests without defining specific test_suite targets.
  • More informative JUnit 5 output: For projects using JUnit 5, the test results for failed tests displayed in the IDE’s run console are now even more informative and include the whole stack trace.
  • Clickable Targets in the Sync console: When the Bazel Sync console outputs messages containing target labels, those labels are now often hyperlinked. Clicking them will navigate you directly to the target’s definition in its BUILD file, useful for diagnosing sync issues or exploring project structure.

Starlark language support: Improving the build language experience

Starlark is the language of Bazel BUILD and .bzl files and we’re making it easier to write code in it.

  • In-Editor Quick Documentation: Place your cursor on a native Bazel rule (like java_library) or its attributes within a BUILD or .bzl file and invoke Quick Documentation (Ctrl+Q or F1). You’ll see documentation directly in the editor – no need to constantly refer to the Bazel website.
  • Comprehensive Code Completions: Get intelligent suggestions as you type for:
    • Native Bazel rule names (java_..., py_...) and their parameters.
    • File paths within your workspace.
    • Target labels (e.g., //path/to:target, dependencies).
    • External repository names and library targets (e.g., @maven//:).
    • Visibility specifications (//visibility:public, //project:__pkg__). 
  • Glob Function Expansion: Curious what files a glob([“*.java”]) expression actually matched during the last sync? You can now navigate on the glob function to see the expanded list of files, which is helpful for debugging glob patterns.

Project View file editor (.bazelproject)

Improving the experience of editing the plugin’s own configuration file.

  • Enhanced Editor Experience: The .bazelproject file now has better syntax highlighting, making it easier to read.
  • Standard Commenting: You can use the standard IDE shortcut (Ctrl+/ or Cmd+/) to toggle comments for lines in this file.
  • Code Style Configuration: Control formatting options like indentation for your .bazelproject file under Settings | Editor | Code Style | Bazel ProjectView.

Tools for project administrators: Taming complexity

Advanced features for those maintaining the build infrastructure.

  • Shard sync for large projects: If your project is so large that Bazel runs out of memory during sync, you can enable shard sync. Add shard_sync: true to your .bazelproject file. This tells the plugin to break the sync process into smaller, independent chunks (shards), significantly reducing the peak memory requirement for each chunk – at the cost of increased sync times.
  • Managed .bazelproject for consistency: To ensure developers working in your monorepo have a consistent and sensible starting configuration, you can check a tools/intellij/.managed.bazelproject file into your repository. When a user imports the project for the first time, the plugin will use a copy of this managed file instead of potentially inconsistent application defaults, reducing setup friction and “works on my machine” issues.
  • Import shared run configurations: Define standard run/debug configurations (e.g. for common services or test suites) in the format used by the original Bazel plugin by Google and check them into version control. Use the import_run_configurations directive in your .bazelproject file to tell the plugin which of these configurations should be automatically imported into the IDE during sync, making them readily available to the whole team.

Credit where it’s due

Big props to our external contributors, especially Mihai Toader for the excellent .bazelrc support and students from the University of Warsaw – Stanislaw Solarewicz, Piotr Plywacz, Robert Grigoryan, and Andzrej Jablonski – for many improvements to the Starlark editor experience.

We welcome any contributions here.

But I found a problem!

We got you. Please report any issues, ideas, improvements straight to our issue tracker.

You’ll also find us on the Bazel community Slack in the #intellij channel. See you there!

image description