-
Notifications
You must be signed in to change notification settings - Fork 313
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
[#6664] Resolve a workspace label across external repositories - 4/n #6700
[#6664] Resolve a workspace label across external repositories - 4/n #6700
Conversation
6ed571f
to
b325547
Compare
Making this a draft since I need to add some changes to it once the #6704 lands |
…xternal-repositories
…xternal-repositories
@tpasternak This is ready btw. |
…xternal-repositories
WorkspaceFileSystem workspaceFileSystem; | ||
|
||
public ExternalWorkspaceFixture(ExternalWorkspace w, TestFileSystem fileSystem) { | ||
this.w = w; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change the name (in a follow up PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What name do you think would work here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean the w
or the fixture name ?
.../google/idea/blaze/base/lang/buildfile/references/ExternalWorkspaceReferenceBzlModeTest.java
Outdated
Show resolved
Hide resolved
)""", targetLabel)); | ||
|
||
Editor editor = editorTest.openFileInEditor(file); | ||
editorTest.setCaretPosition(editor, 2, (" deps = ['" + targetLabel).length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test relies on whitespace length, etc. I would prefer to extract the whole line to the variable to avoid duplication of strings here. Can be done in a follow-up PR ofc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The next PR in the chain switches to something similar to configureByText("asdfasf<caret>")
which is more useful. I can try to put that in here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, ignore then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a change to use configureByText
...sts/com/google/idea/blaze/base/lang/buildfile/references/ExternalWorkspaceReferenceTest.java
Outdated
Show resolved
Hide resolved
base/tests/utils/integration/com/google/idea/blaze/base/ExternalWorkspaceFixture.java
Show resolved
Hide resolved
base/tests/utils/integration/com/google/idea/blaze/base/ExternalWorkspaceFixture.java
Outdated
Show resolved
Hide resolved
I still couldn't get the navigation working, because for some reason I'm getting null here, however the progress is impressive, thank you @mtoader intellij/base/src/com/google/idea/blaze/base/lang/buildfile/references/BuildReferenceManager.java Line 246 in 4acdddd
|
You most likely need a Full sync since the whole resolution depends on the repo mapping data being correct and after the last issue with bazel mod only a full sync will fully reset the in-memory state |
ok, I've found the root cause #6664 (comment) |
cc @ivyspirit you might be interested in this change ☝️ |
Checklist
Discussion thread for this change
Issue number:
#6664
(#6664)Description of this change
This enabled
LabelReference
to resolve if pointed inside a module-defined external repository. It will not do that recursively yet, and it doesn't complete yet.Added some extensions to the BuildFileIntegrationTestCase to enable testing these scenarios and added two tests (one for non renamed external workspace and one for an aliased external workspace).
Resolving with Cmd + click
and the target: