-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper resolution / completion of external workspaces / repositories in label definitions #6664
Comments
To add more context on my thinking here: I want to call into One open question I have is: should I try to do this using the async mode or the aspect mode? |
Thanks @mtoader, I think we can accept contributions addressing this issue cc @tpasternak |
However, the latter is off (the experiment flag is @Override
public TargetMap getTargetMap() {
throw new NotSupportedWithQuerySyncException("getTargetMap");
}
@Override
public BlazeInfo getBlazeInfo() {
throw new NotSupportedWithQuerySyncException("getBlazeInfo");
}
// ...
@Override
public ArtifactLocationDecoder getArtifactLocationDecoder() {
throw new NotSupportedWithQuerySyncException("getArtifactLocationDecoder");
}
@Override
public RemoteOutputArtifacts getRemoteOutputs() {
throw new NotSupportedWithQuerySyncException("getRemoteOutputs");
}
@Override
public ExternalWorkspaceData getExternalWorkspaceData() {
throw new NotSupportedWithQuerySyncException("getExternalWorkspaceData");
}
@Override
public SyncState getSyncState() {
throw new NotSupportedWithQuerySyncException("getSyncState");
} I'm not sure what is the rollout/completion plan of said functionality since if I want to plumb some metadata into |
So the qsync module has been introduced some time ago by Google, however at the moment it works well only with Android Studio, as we didn't have capacity to provide the proper support for it. This means, you can skip the |
Also, the issue occurs for bzlmod imports. Legacy imports still work well. This comes from the fact that It just fails here, because it merges "external" stem with the repository name, resulting in a directory that doesn't exist intellij/base/src/com/google/idea/blaze/base/sync/workspace/WorkspaceHelper.java Lines 213 to 219 in b67720a
|
When i checked that didn't do completion at all (neither in classical or bzlmod situatiosn). I recall solving completion when i was within Goog but i don't know what happened with that. However in order to do it right in bzlmod world we need to use the output of |
oh, wait, you're right, I meant navigation, not completion |
As of now i have this big change here: master...mtoader:intellij:mtoader/support-module-based-repo-completion. It is still incomplete since I have to fix resolving and tweak the completion UX (fix the tab vs enter vs inside/outside quotes, etc behavior). My q is: would the reviewers be ok with such a big change or should I make into more manageable pieces? Note: this is fundamentally big because the ceremony is needed to hook into the sync machinery. |
Managable pieces highly appreciated! Thank you for asking btw |
Posted the first PR in the series |
* [#6664] Add `blaze mod ...` runner implementation - 2/n * Revert unnecessary change * javadocs * More comments * Skip using asMap * Update copyright and use project local output file * better name + copyright years
Just loose thoughts for later:
|
So far, I'm making this work only if bazel has |
I know we only have to ensure it doesn't crash |
The plugin? I'm trying to default the I could make that execution success optional and warn if it fails. I will see how hard that is. If your bazel is > |
It would be enough to just check the bazel version and skip the call if it's too low. |
The last PR actually does that |
In PR bazelbuild#6711 i added two back to back bazel info calls. This PR collapsed those calls into one.
Running it on demand is making things more complex in a sense (from the IDE / resolving POV), but one doesn't usually edit imported modules (which is the main case for completion). Resolving otoh would need that info but it can be a on demand cost paid once you try to do it first time. It would be way better if i could take once from a cmd output :) |
In PR bazelbuild#6711 i added two back to back bazel info calls. This PR collapsed those calls into one.
In PR bazelbuild#6711 i added two back to back bazel info calls. This PR collapsed those calls into one.
Also add a CharFilter that enable: * '@' to filter the lookup elements and not hide the lookup. * '/' to autocomplete selected item Other issues: bazelbuild#505
@tpasternak I have a q. how are changes from this repo "migrated" to https://github.com/JetBrains/hirschgarten ? |
Usually they are not, hirschgarten is a full rewrite |
So anything i would want there would have to be redone there? I like clean rewrites :) |
Cc @jastice |
And cc @ujohnny |
I see no real completion in there as of now (neither respecting bzlmod info nor just basic local repository) so I assume this is not yet there. |
HI @mtoader! Thanks for your contributions to this plugin, they're appreciated. But to give you a bit of context, we are spending over 90% of our efforts on the new plugin in the hirschgarten repo, so mid-term it might be more productive to contribute there. We're happy to work with you to address any feature gaps to help migrate to the new plugin. |
For now, I'm happy to complete the work I want here (moving the ideas there would be easier afterward, and I would have to learn Kotlin to be effective). This was more of a generic question: What is the current progress state? For example, is any completion work being done? Reference searches, etc, yet? (i couldn't tell from the current beta) |
Hi @mtoader! Currently we have completion/resolution for local references and those from load statements in the main repository. At the moment I am working on completion for labels and keyword arguments. We are also working on adding these features for external workspaces. So yes, completion work is being done right now :) |
Description of the feature request:
As of current master, when looking at a label definition in a BUILD.xxx file (and especially inside bzlmod enabled workspaces) I would like to be able to complete/resolve the visible repository / external workspaces. This doesn't really work as of now
Which category does this issue belong to?
Intellij
What underlying problem are you trying to solve with this feature?
No response
What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.
Current plugin HEAD on mac
Have you found anything relevant by searching the web?
There are some issues related to more general bzl mod support but they seem to have been pushed in the future since internally google didn't adopt this at scale.
Any other information, logs, or outputs that you want to share?
I'm open to work on some of these if acceptable.
The text was updated successfully, but these errors were encountered: