Search in sources :

Example 96 with WorkspacePath

use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.

the class BuildQuoteHandlerTest method testClosingTripleSingleQuoteInserted.

@Test
public void testClosingTripleSingleQuoteInserted() {
    BuildFile file = createBuildFile(new WorkspacePath("BUILD"), "");
    editorTest.performTypingAction(file, '\'');
    editorTest.performTypingAction(file, '\'');
    editorTest.performTypingAction(file, '\'');
    assertFileContents(file, "''''''");
}
Also used : BuildFile(com.google.idea.blaze.base.lang.buildfile.psi.BuildFile) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) Test(org.junit.Test)

Example 97 with WorkspacePath

use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.

the class BuildQuoteHandlerTest method testAdditionalQuoteNotInsertedWhenClosingQuotes.

@Test
public void testAdditionalQuoteNotInsertedWhenClosingQuotes() {
    BuildFile file = createBuildFile(new WorkspacePath("BUILD"), "'text<caret>", "laterContents");
    testFixture.configureFromExistingVirtualFile(file.getVirtualFile());
    editorTest.performTypingAction(file, '\'');
    testFixture.checkResult(Joiner.on("\n").join("'text'<caret>", "laterContents"));
}
Also used : BuildFile(com.google.idea.blaze.base.lang.buildfile.psi.BuildFile) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) Test(org.junit.Test)

Example 98 with WorkspacePath

use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.

the class BuildQuoteHandlerTest method testOnlyCaretMovedWhenCompletingExistingClosingQuotes.

@Test
public void testOnlyCaretMovedWhenCompletingExistingClosingQuotes() {
    BuildFile file = createBuildFile(new WorkspacePath("BUILD"), "'text<caret>'", "laterContents");
    testFixture.configureFromExistingVirtualFile(file.getVirtualFile());
    editorTest.performTypingAction(file, '\'');
    testFixture.checkResult(Joiner.on("\n").join("'text'<caret>", "laterContents"));
}
Also used : BuildFile(com.google.idea.blaze.base.lang.buildfile.psi.BuildFile) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) Test(org.junit.Test)

Example 99 with WorkspacePath

use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.

the class BuildQuoteHandlerTest method testAdditionalTripleQuotesNotInsertedWhenClosingQuotes.

@Test
public void testAdditionalTripleQuotesNotInsertedWhenClosingQuotes() {
    BuildFile file = createBuildFile(new WorkspacePath("BUILD"), "'''text''<caret>", "laterContents");
    testFixture.configureFromExistingVirtualFile(file.getVirtualFile());
    editorTest.performTypingAction(file, '\'');
    testFixture.checkResult(Joiner.on("\n").join("'''text'''<caret>", "laterContents"));
}
Also used : BuildFile(com.google.idea.blaze.base.lang.buildfile.psi.BuildFile) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) Test(org.junit.Test)

Example 100 with WorkspacePath

use of com.google.idea.blaze.base.model.primitives.WorkspacePath in project intellij by bazelbuild.

the class EnterInLineCommentTest method testInternalNewlineCommented.

@Test
public void testInternalNewlineCommented() {
    BuildFile file = createBuildFile(new WorkspacePath("BUILD"), "# first line comment", "# second line comment");
    Editor editor = editorTest.openFileInEditor(file.getVirtualFile());
    editorTest.setCaretPosition(editor, 1, "# second ".length());
    editorTest.performTypingAction(editor, '\n');
    assertFileContents(file, "# first line comment", "# second ", "# line comment");
    editorTest.assertCaretPosition(editor, 2, 2);
}
Also used : BuildFile(com.google.idea.blaze.base.lang.buildfile.psi.BuildFile) WorkspacePath(com.google.idea.blaze.base.model.primitives.WorkspacePath) Editor(com.intellij.openapi.editor.Editor) Test(org.junit.Test)

Aggregations

WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)509 Test (org.junit.Test)454 BuildFile (com.google.idea.blaze.base.lang.buildfile.psi.BuildFile)197 PsiFile (com.intellij.psi.PsiFile)84 File (java.io.File)75 ProjectView (com.google.idea.blaze.base.projectview.ProjectView)53 TargetMapBuilder (com.google.idea.blaze.base.ideinfo.TargetMapBuilder)48 Editor (com.intellij.openapi.editor.Editor)46 VirtualFile (com.intellij.openapi.vfs.VirtualFile)41 BlazeJavaImportResult (com.google.idea.blaze.java.sync.model.BlazeJavaImportResult)40 FuncallExpression (com.google.idea.blaze.base.lang.buildfile.psi.FuncallExpression)37 PsiReference (com.intellij.psi.PsiReference)37 MockBlazeProjectDataManager (com.google.idea.blaze.base.model.MockBlazeProjectDataManager)34 ConfigurationContext (com.intellij.execution.actions.ConfigurationContext)34 BlazeContentEntry (com.google.idea.blaze.java.sync.model.BlazeContentEntry)33 BlazeCommandRunConfiguration (com.google.idea.blaze.base.run.BlazeCommandRunConfiguration)29 MockBlazeProjectDataBuilder (com.google.idea.blaze.base.model.MockBlazeProjectDataBuilder)26 ImportRoots (com.google.idea.blaze.base.sync.projectview.ImportRoots)26 TargetMap (com.google.idea.blaze.base.ideinfo.TargetMap)25 PsiElement (com.intellij.psi.PsiElement)25