Search in sources :

Example 1 with CssInvalidElementInspection

use of com.intellij.psi.css.inspections.CssInvalidElementInspection in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testUnresolvedClassReference2.

@JSTestOptions({ JSTestOption.WithGumboSdk })
public void testUnresolvedClassReference2() throws Throwable {
    enableInspectionTool(new CssInvalidElementInspection());
    JSTestUtils.disableFileHeadersInTemplates(getProject());
    final String testName = getTestName(false);
    doHighlightingWithInvokeFixAndCheckResult("Create MXML Component 'Missing'", "mxml");
    final VirtualFile expectedFile = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + getBasePath() + "/" + testName + "_2.mxml");
    final VirtualFile createdFile = VfsUtilCore.findRelativeFile("/foo/boo2/Missing.mxml", ModuleRootManager.getInstance(myModule).getSourceRoots()[0]);
    assertNotNull(expectedFile);
    assertNotNull(createdFile);
    FileDocumentManager.getInstance().saveAllDocuments();
    String expected = StringUtil.convertLineSeparators(VfsUtilCore.loadText(expectedFile));
    Properties properties = FileTemplateManager.getInstance(getProject()).getDefaultProperties();
    expected = FileTemplateUtil.mergeTemplate(properties, expected, false);
    assertEquals(expected, StringUtil.convertLineSeparators(VfsUtilCore.loadText(createdFile)));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CssInvalidElementInspection(com.intellij.psi.css.inspections.CssInvalidElementInspection)

Example 2 with CssInvalidElementInspection

use of com.intellij.psi.css.inspections.CssInvalidElementInspection in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testFlexSpecificFunctionsInCss.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexSpecificFunctionsInCss() throws Exception {
    enableInspectionTool(new CssInvalidElementInspection());
    enableInspectionTool(new CssInvalidPropertyValueInspection());
    enableInspectionTool(new CssInvalidFunctionInspection());
    doTestFor(true, getTestName(false) + ".css");
}
Also used : CssInvalidFunctionInspection(com.intellij.psi.css.inspections.invalid.CssInvalidFunctionInspection) CssInvalidPropertyValueInspection(com.intellij.psi.css.inspections.invalid.CssInvalidPropertyValueInspection) CssInvalidElementInspection(com.intellij.psi.css.inspections.CssInvalidElementInspection)

Example 3 with CssInvalidElementInspection

use of com.intellij.psi.css.inspections.CssInvalidElementInspection in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testUnresolvedClassReference.

@JSTestOptions({ JSTestOption.WithGumboSdk })
public void testUnresolvedClassReference() throws Throwable {
    enableInspectionTool(new CssInvalidElementInspection());
    JSTestUtils.disableFileHeadersInTemplates(getProject());
    final String testName = getTestName(false);
    doHighlightingWithInvokeFixAndCheckResult(JSBundle.message("javascript.create.class.intention.name", "MyZuperClass"), "mxml");
    final VirtualFile expectedFile = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + getBasePath() + "/" + testName + "_2.as");
    final VirtualFile createdFile = VfsUtilCore.findRelativeFile("/foo/MyZuperClass.as", ModuleRootManager.getInstance(myModule).getSourceRoots()[0]);
    assertNotNull(expectedFile);
    assertNotNull(createdFile);
    FileDocumentManager.getInstance().saveAllDocuments();
    assertEquals(StringUtil.convertLineSeparators(VfsUtilCore.loadText(expectedFile)), StringUtil.convertLineSeparators(VfsUtilCore.loadText(createdFile)));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) CssInvalidElementInspection(com.intellij.psi.css.inspections.CssInvalidElementInspection)

Example 4 with CssInvalidElementInspection

use of com.intellij.psi.css.inspections.CssInvalidElementInspection in project intellij-plugins by JetBrains.

the class FlexHighlightingTest method testFlexWithMockFlex.

@JSTestOptions({ JSTestOption.WithJsSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexWithMockFlex() throws Exception {
    enableInspectionTool(new CssInvalidElementInspection());
    final String testName = getTestName(false);
    doHighlightingWithInvokeFixAndCheckResult("Add override modifier", "mxml", testName + ".mxml", testName + "_2.as");
}
Also used : CssInvalidElementInspection(com.intellij.psi.css.inspections.CssInvalidElementInspection)

Aggregations

CssInvalidElementInspection (com.intellij.psi.css.inspections.CssInvalidElementInspection)4 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 CssInvalidFunctionInspection (com.intellij.psi.css.inspections.invalid.CssInvalidFunctionInspection)1 CssInvalidPropertyValueInspection (com.intellij.psi.css.inspections.invalid.CssInvalidPropertyValueInspection)1