Skip to content

Commit

Permalink
Fix CI failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoader committed Sep 4, 2024
1 parent f8b4295 commit 268d01d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ protected String getTailText() {

@Override
public void handleInsert(InsertionContext context) {
Document document = context.getDocument();

StringLiteral literal = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), StringLiteral.class, false);
if (literal == null) {
super.handleInsert(context);
return;
}

Document document = context.getDocument();
context.commitDocument();
// find an remove trailing package path after insert / replace.
// current element text looks like `@workspace//`. If this is complete inside an existing workspace name the
// result would look like: @workspace//old_workspace_path//. The following bit will remove `old_workspace_path//`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private static WorkspacePath getWorkspacePathForExternalTarget(
Project project,
WorkspacePathResolver workspacePathResolver) {
if (target.toTargetInfo().getLabel().isExternal()) {
WorkspaceRoot externalWorkspace = WorkspaceHelper.resolveExternalWorkspace(project,
WorkspaceRoot externalWorkspace = WorkspaceHelper.getExternalWorkspace(project,
target.getKey().getLabel().externalWorkspaceName());

if (externalWorkspace != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ public void testExternalDependencyResolvedWhenIsPartOfProject() throws IOExcepti
.build();

File externalRoot = WorkspaceHelper.getExternalSourceRoot(
BlazeProjectDataManager.getInstance(project).getBlazeProjectData());
BlazeProjectDataManager.getInstance(project).getBlazeProjectData()).toFile();

File spyExternalDependencyRoot = spy(new File(externalRoot, "external_dependency"));
doReturn(true).when(spyExternalDependencyRoot).isDirectory();
Expand All @@ -844,7 +844,7 @@ public void testExternalDependencyResolvedWhenIsPartOfProject() throws IOExcepti

try (MockedStatic<WorkspaceHelper> mockedStatic = Mockito.mockStatic(WorkspaceHelper.class)) {
mockedStatic.when(
() -> WorkspaceHelper.resolveExternalWorkspace(Mockito.any(MockProject.class),
() -> WorkspaceHelper.getExternalWorkspace(Mockito.any(MockProject.class),
Mockito.any(String.class))).thenReturn(new WorkspaceRoot(spyExternalDependencyRoot));

assertThatResolving(projectView, targetMap).producesConfigurationsFor(
Expand Down

0 comments on commit 268d01d

Please sign in to comment.