use of com.google.idea.blaze.base.lang.buildfile.psi.BuildFile in project intellij by bazelbuild.
the class LoadStatementAnnotatorTest method testNoWarningsInExternalLoad.
@Test
public void testNoWarningsInExternalLoad() {
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('@tools//ide:build_test.bzl', 'build_test')");
assertNoAnnotations(file);
}
use of com.google.idea.blaze.base.lang.buildfile.psi.BuildFile in project intellij by bazelbuild.
the class LoadStatementAnnotatorTest method testNoWarningsInNormalLoad.
@Test
public void testNoWarningsInNormalLoad() {
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('//tools/ide/build_test.bzl', 'build_test')", "load(':local_file.bzl', 'symbol')");
assertNoAnnotations(file);
}
use of com.google.idea.blaze.base.lang.buildfile.psi.BuildFile in project intellij by bazelbuild.
the class DeprecatedLoadQuickFixTest method testRelativeLoadStatementUntouched.
@Test
public void testRelativeLoadStatementUntouched() {
workspace.createPsiFile(new WorkspacePath("foo/bar/build_defs.bzl"));
BuildFile file = createBuildFile(new WorkspacePath("foo/bar/BUILD"), "load(':build_defs.bzl', 'symbol')");
StringLiteral string = PsiUtils.findFirstChildOfClassRecursive(file, StringLiteral.class);
String prevString = string.getStringContents();
applyQuickFix(string);
assertThat(string.getStringContents()).isEqualTo(prevString);
}
use of com.google.idea.blaze.base.lang.buildfile.psi.BuildFile in project intellij by bazelbuild.
the class DeprecatedLoadQuickFixTest method testNormalLoadStatementUntouched.
@Test
public void testNormalLoadStatementUntouched() {
workspace.createPsiFile(new WorkspacePath("foo/bar/BUILD"));
workspace.createPsiFile(new WorkspacePath("foo/bar/build_defs.bzl"));
BuildFile file = createBuildFile(new WorkspacePath("java/com/google/BUILD"), "load('//foo/bar:build_defs.bzl', 'symbol')");
StringLiteral string = PsiUtils.findFirstChildOfClassRecursive(file, StringLiteral.class);
String prevString = string.getStringContents();
applyQuickFix(string);
assertThat(string.getStringContents()).isEqualTo(prevString);
}
use of com.google.idea.blaze.base.lang.buildfile.psi.BuildFile in project intellij by bazelbuild.
the class RenameRefactoringTest method testRenameSuggestionForBuildFile.
@Test
public void testRenameSuggestionForBuildFile() {
BuildFile buildFile = createBuildFile(new WorkspacePath("java/com/google/BUILD"));
RenamePsiElementProcessor processor = RenamePsiElementProcessor.forElement(buildFile);
RenameDialog dialog = processor.createRenameDialog(getProject(), buildFile, buildFile, null);
String[] suggestions = dialog.getSuggestedNames();
assertThat(suggestions[0]).isEqualTo("BUILD");
}
Aggregations