11// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
22package com .jetbrains .lang .dart .highlighting ;
33
4- import com .intellij .codeInsight .daemon .impl .analysis .HtmlUnknownTargetInspection ;
5- import com .intellij .codeInspection .htmlInspections .HtmlUnknownTagInspection ;
64import com .intellij .openapi .application .ApplicationManager ;
75import com .intellij .openapi .roots .ContentEntry ;
86import com .intellij .openapi .roots .ModifiableRootModel ;
97import com .intellij .openapi .roots .ModuleRootManager ;
108import com .intellij .psi .PsiFile ;
119import com .intellij .spellchecker .inspections .SpellCheckingInspection ;
12- import com .intellij .testFramework .ExpectedHighlightingData ;
13- import com .intellij .testFramework .fixtures .impl .CodeInsightTestFixtureImpl ;
1410import com .jetbrains .lang .dart .DartCodeInsightFixtureTestCase ;
15- import com .jetbrains .lang .dart .ide .inspections .DartPathPackageReferenceInspection ;
1611import com .jetbrains .lang .dart .util .DartResolveUtil ;
1712
1813import java .util .function .Consumer ;
@@ -39,33 +34,6 @@ private void updateModuleRoots(Consumer<ContentEntry> contentEntryModifier) {
3934 });
4035 }
4136
42- public void testScriptSrcPathToPackagesFolder () {
43- final String testName = getTestName (false );
44- myFixture .enableInspections (HtmlUnknownTargetInspection .class );
45-
46- myFixture .addFileToProject ("pubspec.yaml" , """
47- name: ProjectName
48- dependencies:
49- PathPackage:
50- path: local_package
51- """ );
52- myFixture .addFileToProject ("lib/projectFile.dart" , "" );
53- myFixture .addFileToProject ("local_package/lib/localPackageFile.html" , "" );
54- myFixture .addFileToProject ("packages/browser/dart.js" , "" );
55- myFixture .configureByFile (testName + "/" + testName + ".html" );
56- myFixture .checkHighlighting (true , false , true );
57- }
58-
59- public void testScriptSrcPathToDotPackagesFile () {
60- myFixture .enableInspections (HtmlUnknownTargetInspection .class );
61- myFixture .addFileToProject ("pubspec.yaml" , "name: ProjectName" );
62- myFixture .addFileToProject ("local_package/lib/src/localPackageFile.html" , "" );
63- myFixture .addFileToProject (".packages" , "PathPackage:local_package/lib/" );
64- myFixture .configureByText ("foo.html" , "<link href=\" packages/PathPackage/src/localPackageFile.html\" >\n " +
65- "<link href=\" packages/PathPackage/src/<warning descr=\" Cannot resolve file 'incorrect.html'\" >incorrect.html</warning> \" >" );
66- myFixture .checkHighlighting (true , false , true );
67- }
68-
6937 public void testSpelling () {
7038 myFixture .enableInspections (SpellCheckingInspection .class );
7139 myFixture .configureByFile (getTestName (false ) + ".dart" );
@@ -83,38 +51,6 @@ public void testColorAnnotatorIdePart() {
8351 myFixture .checkHighlighting (true , true , true );
8452 }
8553
86- public void testSimplePolymer () {
87- myFixture .enableInspections (HtmlUnknownTagInspection .class );
88- myFixture .addFileToProject ("pubspec.yaml" , """
89- name: ThisProject
90- dependencies:
91- PathPackage:
92- path: PathPackage
93- """ );
94- myFixture .addFileToProject ("lib/custom_element.html" , "<polymer-element name='custom-element'/>" );
95- myFixture .addFileToProject ("PathPackage/lib/in_path_package.html" , "<polymer-element name='path-package-element'/>" );
96- addStandardPackage ("polymer" );
97- addStandardPackage ("core_elements" );
98- myFixture .configureByFile (getTestName (false ) + "/web/" + getTestName (false ) + ".html" );
99- myFixture .checkHighlighting (true , false , true );
100- }
101-
102- public void testPathPackageReferenceInspection () {
103- myFixture .enableInspections (new DartPathPackageReferenceInspection ());
104- myFixture .copyDirectoryToProject (getTestName (false ), "" );
105- myFixture .openFileInEditor (ModuleRootManager .getInstance (getModule ()).getContentRoots ()[0 ].findChild ("pubspec.yaml" ));
106-
107- ExpectedHighlightingData data = new ExpectedHighlightingData (myFixture .getEditor ().getDocument (), true , true , false , false );
108- data .init ();
109- ((CodeInsightTestFixtureImpl )myFixture ).collectAndCheckHighlighting (data );
110-
111- updateModuleRoots ((contentEntry ) -> contentEntry .addExcludeFolder (contentEntry .getUrl () + "/other_project" ));
112- ((CodeInsightTestFixtureImpl )myFixture ).collectAndCheckHighlighting (data );
113-
114- updateModuleRoots ((contentEntry ) -> contentEntry .addSourceFolder (contentEntry .getUrl () + "/test" , true ));
115- ((CodeInsightTestFixtureImpl )myFixture ).collectAndCheckHighlighting (data );
116- }
117-
11854 public void testUriInPartOf () {
11955 final PsiFile libFile = myFixture .addFileToProject ("foo/bar/libFile.dart" , "library libName;" );
12056 final PsiFile part1File = myFixture .addFileToProject ("part1.dart" , "part of 'part1.dart'" ); // self reference
0 commit comments