Tags
IntelliJ with Bazel

Tags

Tags are arbitrary strings can be added on any bazel rule. The bazel plugin looks for certain tags to change how the rules get imported into the IDE.

no-ide

Completely drops the target and all of its dependencies (unless they are reachable from some other, non-excluded target). The IDE will be unaware of the target, and none of its artifacts will be built.

Example:

java_library(
  name = 'mylib',
  srcs = [':my_generated_sources'],
  tags = ['no-ide'],
  ...
)

intellij-import-target-output

NOTE: Deprecated. You should never need to use this tag.

This tag forces the IDE to import a rule’s outputs, meaning we’ll add its jars instead of its sources. This is useful when the source is generated anyway and cannot be edited, like proto_libraries.

See also import_target_output.

intellij-exclude-target

NOTE: Deprecated. Prefer the no-ide tag.

This tag drops the target sources and jars. The target will still be built and the IDE is still aware that it exists. Also note that if the target has dependencies these are not dropped.

See also exclude_target.