Skip to content

Commit ecbe2cd

Browse files
committed
Update CSS language configuration and grammars to the latest ones from VSCode 1.79.0
1 parent ba33382 commit ecbe2cd

File tree

9 files changed

+793
-143
lines changed

9 files changed

+793
-143
lines changed

org.eclipse.wildwebdeveloper.tests/src/org/eclipse/wildwebdeveloper/tests/TestLanguageServers.java

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

org.eclipse.wildwebdeveloper/grammars/css/css.tmLanguage.json

Lines changed: 80 additions & 21 deletions
Large diffs are not rendered by default.

org.eclipse.wildwebdeveloper/grammars/less/less.tmLanguage.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,9 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7+
"version": "https://github.com/atom/language-less/commit/87d4d59e8de6796b506b81a16e1dc1fafc99d30f",
78
"name": "Less",
89
"scopeName": "source.css.less",
9-
"fileTypes": [
10-
"less",
11-
"less.erb",
12-
"rc",
13-
"gtkrc",
14-
"gtkrc-2.0",
15-
"themerc"
16-
],
1710
"patterns": [
1811
{
1912
"include": "#strings"
@@ -444,7 +437,7 @@
444437
"name": "string.quoted.double.css",
445438
"patterns": [
446439
{
447-
"match": "\\\\(\\h{1,6}|.)",
440+
"match": "\\\\([0-9A-Fa-f]{1,6}|.)",
448441
"name": "constant.character.escape.css"
449442
},
450443
{
@@ -468,7 +461,7 @@
468461
"name": "string.quoted.single.css",
469462
"patterns": [
470463
{
471-
"match": "\\\\(\\h{1,6}|.)",
464+
"match": "\\\\([0-9A-Fa-f]{1,6}|.)",
472465
"name": "constant.character.escape.css"
473466
},
474467
{

0 commit comments

Comments
 (0)