Support for Python Rules that are Code Generators #6725
Labels
awaiting-maintainer
Awaiting review from Bazel team on issues
product: CLion
CLion plugin
product: GoLand
GoLand plugin
product: IntelliJ
IntelliJ plugin
product: PyCharm
PyCharm plugin
type: feature request
Description of the feature request:
Please see accompanying PR 6726.
Plugin recognizing code generators
When working with Python in Bazel, it is sometimes desirable to generate code using an Action configured from a Rule. In this situation, the Rule that configures the Action might return a
PyInfo
and to all intents and purposes behave as apy_library
.In the Intelli-J environment, the Rule would however not be recognized and the outputs of the Rule would not be seen as source code. This means that in logic that uses the generated code, these sources would simply be missing and would show as errors in the IDE.
It would be ideal if there were a means by which Rules could signal to the IDE that their outputs rather than their inputs (
srcs
attribute) supplied the sources for the Rule.Plugin handling source supplied as a directory
Code generators are often not able to specify the precise list of output files ahead of time. This might be because the list of files is contingent on the contents of an input such as schema. For this reason the outputs from a code-generators' Rule might be a directory. In this case, The IDE is currently not able to handle a directory of Python source; it is wanting to work with files only. It would be better if the Plugin were able to work with source directories as well.
Which category does this issue belong to?
Intellij, GoLand, CLion, PyCharm
What underlying problem are you trying to solve with this feature?
At the present time when a Python Bazel Project uses the outputs of a code-generator Rule, the sources from the code generator are not recognized in the IDE and show as errors.
What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.
2024.1
Have you found anything relevant by searching the web?
--
Any other information, logs, or outputs that you want to share?
--
The text was updated successfully, but these errors were encountered: