@@ -79,6 +79,44 @@ protected boolean condition() {
7979 }.waitForCondition (PlatformUI .getWorkbench ().getDisplay (), 5000 ), "Diagnostic not published" );
8080 }
8181
82+ @ Test
83+ public void testSCSSFile () throws Exception {
84+ final IFile file = project .getFile ("blah.scss" );
85+ file .create (new ByteArrayInputStream ("ERROR" .getBytes ()), true , null );
86+ ITextEditor editor = (ITextEditor ) IDE
87+ .openEditor (PlatformUI .getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), file );
88+ editor .getDocumentProvider ().getDocument (editor .getEditorInput ()).set ("FAIL" );
89+ assertTrue (new DisplayHelper () {
90+ @ Override
91+ protected boolean condition () {
92+ try {
93+ return file .findMarkers ("org.eclipse.lsp4e.diagnostic" , true , IResource .DEPTH_ZERO ).length != 0 ;
94+ } catch (CoreException e ) {
95+ return false ;
96+ }
97+ }
98+ }.waitForCondition (PlatformUI .getWorkbench ().getDisplay (), 5000 ), "Diagnostic not published" );
99+ }
100+
101+ @ Test
102+ public void testSASSFile () throws Exception {
103+ final IFile file = project .getFile ("blah.sass" );
104+ file .create (new ByteArrayInputStream ("ERROR" .getBytes ()), true , null );
105+ ITextEditor editor = (ITextEditor ) IDE
106+ .openEditor (PlatformUI .getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), file );
107+ editor .getDocumentProvider ().getDocument (editor .getEditorInput ()).set ("FAIL" );
108+ assertTrue (new DisplayHelper () {
109+ @ Override
110+ protected boolean condition () {
111+ try {
112+ return file .findMarkers ("org.eclipse.lsp4e.diagnostic" , true , IResource .DEPTH_ZERO ).length != 0 ;
113+ } catch (CoreException e ) {
114+ return false ;
115+ }
116+ }
117+ }.waitForCondition (PlatformUI .getWorkbench ().getDisplay (), 5000 ), "Diagnostic not published" );
118+ }
119+
82120 @ Test
83121 public void testHTMLFile () throws Exception {
84122 final IFile file = project .getFile ("blah.html" );
@@ -202,7 +240,7 @@ public void testTSXFile() throws Exception {
202240 ITextEditor editor = (ITextEditor ) IDE
203241 .openEditor (PlatformUI .getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), file );
204242 editor .getDocumentProvider ().getDocument (editor .getEditorInput ()).set ("FAIL" );
205-
243+
206244 assertTrue (new DisplayHelper () {
207245 @ Override
208246 protected boolean condition () {
@@ -213,15 +251,15 @@ protected boolean condition() {
213251 }
214252 }
215253 }.waitForCondition (PlatformUI .getWorkbench ().getDisplay (), 15000 ), "Diagnostic not published" );
216-
254+
217255 editor .getDocumentProvider ().getDocument (editor .getEditorInput ()).set ("const x = <></>;export default x;" );
218256 assertTrue (new DisplayHelper () {
219257 @ Override
220258 protected boolean condition () {
221259 try {
222260 IMarker [] markers = file .findMarkers ("org.eclipse.lsp4e.diagnostic" , true , IResource .DEPTH_ZERO );
223- for (IMarker m : markers ){
224- if (((String ) m .getAttribute (IMarker .MESSAGE )).contains ("React" )){
261+ for (IMarker m : markers ) {
262+ if (((String ) m .getAttribute (IMarker .MESSAGE )).contains ("React" )) {
225263 return true ;
226264 }
227265 }
0 commit comments