This is an automated email from the ASF dual-hosted git repository. hansva pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 1db2b89dc9 Switch the JavaScript transform dialog to the TM4E content
editor #8488 (#8490)
1db2b89dc9 is described below
commit 1db2b89dc9c51ac0a4053978cceccd7d1cd116d7
Author: Nicolas Adment <[email protected]>
AuthorDate: Mon Sep 21 13:30:49 2026 +0200
Switch the JavaScript transform dialog to the TM4E content editor #8488
(#8490)
---
.../transforms/javascript/ScriptValuesDialog.java | 147 +-
.../javascript/messages/messages_de_DE.properties | 1 -
.../javascript/messages/messages_en_US.properties | 1 -
.../javascript/messages/messages_es_AR.properties | 3 +-
.../javascript/messages/messages_es_ES.properties | 1 -
.../javascript/messages/messages_fr_FR.properties | 1 -
.../javascript/messages/messages_it_IT.properties | 1 -
.../javascript/messages/messages_ja_JP.properties | 1 -
.../javascript/messages/messages_ko_KR.properties | 1 -
.../javascript/messages/messages_pt_BR.properties | 1 -
.../javascript/messages/messages_zh_CN.properties | 1 -
.../hop/ui/hopgui/ContentEditorTm4eSupport.java | 23 +-
.../apache/hop/ui/hopgui/grammars/javascript.json | 3575 ++++++++++++++++++++
13 files changed, 3638 insertions(+), 119 deletions(-)
diff --git
a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java
b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java
index cc94066688..fcb74655cb 100644
---
a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java
+++
b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java
@@ -54,16 +54,14 @@ import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.ComboVar;
import org.apache.hop.ui.core.widget.FolderTreeIcons;
import org.apache.hop.ui.core.widget.HopTree;
-import org.apache.hop.ui.core.widget.JavaScriptStyledTextComp;
import org.apache.hop.ui.core.widget.NamingSchemeTypes;
-import org.apache.hop.ui.core.widget.StyledTextComp;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.core.widget.TextComposite;
import org.apache.hop.ui.core.widget.TextVar;
+import org.apache.hop.ui.core.widget.editor.IContentEditorWidget;
import org.apache.hop.ui.hopgui.BackgroundThreadFacade;
+import org.apache.hop.ui.hopgui.ContentEditorFacade;
import org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog;
import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
-import org.apache.hop.ui.util.EnvironmentUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabFolder2Adapter;
@@ -86,7 +84,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
@@ -94,6 +91,7 @@ import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.jspecify.annotations.Nullable;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.EvaluatorException;
@@ -107,6 +105,8 @@ import org.mozilla.javascript.ast.ScriptNode;
public class ScriptValuesDialog extends BaseTransformDialog {
private static final Class<?> PKG = ScriptValuesMeta.class;
+ private static final String EDITOR_WIDGET = "ContentEditorWidget";
+
private static final String[] YES_NO_COMBO =
new String[] {
BaseMessages.getString(PKG, "System.Combo.No"),
@@ -125,8 +125,6 @@ public class ScriptValuesDialog extends BaseTransformDialog
{
private TableView wFields;
- private Label wlPosition;
-
private Tree wTree;
private TreeItem wTreeScriptsItem;
private TreeItem wTreeClassesitem;
@@ -273,7 +271,7 @@ public class ScriptValuesDialog extends BaseTransformDialog
{
// some information at the bottom...
//
- // The optimisation level...
+ // The optimization level...
//
Label wlOptimizationLevel = new Label(wTop, SWT.NONE);
wlOptimizationLevel.setText(
@@ -291,7 +289,7 @@ public class ScriptValuesDialog extends BaseTransformDialog
{
FormData fdOptimizationLevel = new FormData();
fdOptimizationLevel.left = new FormAttachment(wlOptimizationLevel, margin);
fdOptimizationLevel.top = new FormAttachment(wlOptimizationLevel, 0,
SWT.CENTER);
- fdOptimizationLevel.right = new FormAttachment(100, margin);
+ fdOptimizationLevel.right = new FormAttachment(100, 0);
wOptimizationLevel.setLayoutData(fdOptimizationLevel);
wOptimizationLevel.addModifyListener(lsMod);
@@ -315,21 +313,10 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
FormData fdLanguageVersion = new FormData();
fdLanguageVersion.left = new FormAttachment(wlLanguageVersion, margin);
fdLanguageVersion.top = new FormAttachment(wlLanguageVersion, 0,
SWT.CENTER);
- fdLanguageVersion.right = new FormAttachment(100, margin);
+ fdLanguageVersion.right = new FormAttachment(100, 0);
wLanguageVersion.setLayoutData(fdLanguageVersion);
wLanguageVersion.addModifyListener(lsMod);
- // The position just above that and below the script...
- //
- wlPosition = new Label(wTop, SWT.LEFT);
- wlPosition.setText(BaseMessages.getString(PKG,
"ScriptValuesDialogMod.Position.Label", 1, 1));
- PropsUi.setLook(wlPosition);
- FormData fdlPosition = new FormData();
- fdlPosition.left = new FormAttachment(wTree, margin);
- fdlPosition.right = new FormAttachment(100, 0);
- fdlPosition.bottom = new FormAttachment(wLanguageVersion, -margin);
- wlPosition.setLayoutData(fdlPosition);
-
folder = new CTabFolder(wTop, SWT.BORDER | SWT.RESIZE);
PropsUi.setLook(folder, Props.WIDGET_STYLE_TAB);
folder.setUnselectedImageVisible(true);
@@ -337,8 +324,8 @@ public class ScriptValuesDialog extends BaseTransformDialog
{
FormData fdScript = new FormData();
fdScript.left = new FormAttachment(wTree, margin);
fdScript.top = new FormAttachment(wlScript, margin);
- fdScript.right = new FormAttachment(100, -5);
- fdScript.bottom = new FormAttachment(wlPosition, -margin);
+ fdScript.right = new FormAttachment(100, 0);
+ fdScript.bottom = new FormAttachment(wLanguageVersion, -margin);
fdScript.width = 500;
fdScript.height = 400;
folder.setLayoutData(fdScript);
@@ -548,7 +535,7 @@ public class ScriptValuesDialog extends BaseTransformDialog
{
public void dragStart(DragSourceEvent event) {
TreeItem item = wTree.getSelection()[0];
- // Qualifikation where the Drag Request Comes from
+ // Qualification where the Drag Request Comes from
if (item != null && item.getParentItem() != null) {
if (item.getParentItem().equals(wTreeScriptsItem)) {
event.doit = false;
@@ -601,49 +588,22 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
break;
}
- TextComposite wScript;
- if (EnvironmentUtils.getInstance().isWeb()) {
- wScript =
- new StyledTextComp(
- variables,
- item.getParent(),
- SWT.MULTI | SWT.LEFT | SWT.H_SCROLL | SWT.V_SCROLL,
- false,
- TextComposite.STYLE_TYPE_JAVASCRIPT);
- } else {
- wScript =
- new JavaScriptStyledTextComp(
- variables,
- item.getParent(),
- SWT.MULTI | SWT.LEFT | SWT.H_SCROLL | SWT.V_SCROLL,
- false);
- wScript.addLineStyleListener();
- }
-
+ IContentEditorWidget editor =
+ ContentEditorFacade.createContentEditor(item.getParent(),
"javascript");
if ((strScript != null) && !strScript.isEmpty()) {
- wScript.setText(strScript);
+ editor.setText(strScript);
} else {
- wScript.setText(
+ editor.setText(
BaseMessages.getString(PKG, "ScriptValuesDialogMod.ScriptHere.Label")
+ Const.CR
+ Const.CR);
}
- PropsUi.setLook(wScript, Props.WIDGET_STYLE_FIXED);
-
- Listener listener = e -> setPosition(wScript);
- wScript.addListener(SWT.Modify, listener);
- wScript.addListener(SWT.KeyDown, listener);
- wScript.addListener(SWT.KeyUp, listener);
- wScript.addListener(SWT.FocusIn, listener);
- wScript.addListener(SWT.FocusOut, listener);
- wScript.addListener(SWT.MouseDoubleClick, listener);
- wScript.addListener(SWT.MouseUp, listener);
- wScript.addListener(SWT.MouseDown, listener);
- wScript.addModifyListener(lsMod);
+ editor.addModifyListener(lsMod);
item.setImage(imageInactiveScript);
- item.setControl(wScript);
+ item.setControl(editor.getControl());
+ item.setData(EDITOR_WIDGET, editor);
// Adding new Item to Tree
modifyScriptTree(item, ADD_ITEM);
@@ -776,17 +736,17 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
}
}
- private TextComposite getStyledTextComp() {
+ private IContentEditorWidget getContentEditorWidget() {
CTabItem item = folder.getSelection();
if (item.getControl().isDisposed()) {
return null;
} else {
- return (TextComposite) item.getControl();
+ return (IContentEditorWidget) item.getData(EDITOR_WIDGET);
}
}
- private TextComposite getStyledTextComp(CTabItem item) {
- return (TextComposite) item.getControl();
+ private @Nullable IContentEditorWidget getContentEditorWidget(CTabItem item)
{
+ return (IContentEditorWidget) item.getData(EDITOR_WIDGET);
}
private String getNextName(String strActualName) {
@@ -804,14 +764,6 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
return strRC;
}
- public void setPosition(TextComposite wScript) {
- int lineNumber = wScript.getLineNumber();
- int columnNumber = wScript.getColumnNumber();
- wlPosition.setText(
- BaseMessages.getString(
- PKG, "ScriptValuesDialogMod.Position.Label", lineNumber,
columnNumber));
- }
-
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
if (!Utils.isEmpty(Const.trim(input.getOptimizationLevel()))) {
@@ -956,24 +908,21 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
meta.getScriptFields().add(field);
}
- CTabItem[] cTabs = folder.getItems();
meta.getJsScripts().clear();
- if (cTabs.length > 0) {
- for (int i = 0; i < cTabs.length; i++) {
- ScriptValuesScript jsScript = new ScriptValuesScript();
- jsScript.setType(ScriptValuesScript.NORMAL_SCRIPT);
- jsScript.setName(cTabs[i].getText());
- jsScript.setScript(getStyledTextComp(cTabs[i]).getText());
-
- if (cTabs[i].getImage().equals(imageActiveScript)) {
- jsScript.setType(ScriptValuesScript.TRANSFORM_SCRIPT);
- } else if (cTabs[i].getImage().equals(imageActiveStartScript)) {
- jsScript.setType(ScriptValuesScript.START_SCRIPT);
- } else if (cTabs[i].getImage().equals(imageActiveEndScript)) {
- jsScript.setType(ScriptValuesScript.END_SCRIPT);
- }
- meta.getJsScripts().add(jsScript);
+ for (CTabItem cTab : folder.getItems()) {
+ ScriptValuesScript jsScript = new ScriptValuesScript();
+ jsScript.setType(ScriptValuesScript.NORMAL_SCRIPT);
+ jsScript.setName(cTab.getText());
+ jsScript.setScript(getContentEditorWidget(cTab).getText());
+
+ if (cTab.getImage().equals(imageActiveScript)) {
+ jsScript.setType(ScriptValuesScript.TRANSFORM_SCRIPT);
+ } else if (cTab.getImage().equals(imageActiveStartScript)) {
+ jsScript.setType(ScriptValuesScript.START_SCRIPT);
+ } else if (cTab.getImage().equals(imageActiveEndScript)) {
+ jsScript.setType(ScriptValuesScript.END_SCRIPT);
}
+ meta.getJsScripts().add(jsScript);
}
}
@@ -1205,8 +1154,8 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
private boolean test(boolean getvars, boolean popup) {
boolean retval = true;
boolean scriptRan = true;
- TextComposite wScript = getStyledTextComp();
- String scr = wScript.getText();
+ IContentEditorWidget editor = getContentEditorWidget();
+ String scr = editor.getText();
HopException testException = null;
Context jscx;
@@ -1230,8 +1179,8 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
// Adding the existing Scripts to the Context
for (int i = 0; i < folder.getItemCount(); i++) {
- TextComposite sItem = getStyledTextComp(folder.getItem(i));
- Scriptable jsR = Context.toObject(sItem.getText(), jsscope);
+ IContentEditorWidget contentEditorWidget =
getContentEditorWidget(folder.getItem(i));
+ Scriptable jsR = Context.toObject(contentEditorWidget.getText(),
jsscope);
jsscope.put(folder.getItem(i).getText(), jsscope, jsR);
}
@@ -1344,7 +1293,8 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
&& !folder.getSelection().getText().equals(strActiveStartScript)
&& !strActiveStartScript.isEmpty()) {
String strStartScript =
-
getStyledTextComp(folder.getItem(getCTabPosition(strActiveStartScript))).getText();
+
getContentEditorWidget(folder.getItem(getCTabPosition(strActiveStartScript)))
+ .getText();
/* Object startScript = */ jscx.evaluateString(
jsscope, strStartScript, "pipeline_Start", 1, null);
}
@@ -1621,7 +1571,7 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
// Adds the Current item to the current Position
private void treeDblClick(Event event) {
- TextComposite wScript = getStyledTextComp();
+ IContentEditorWidget editor = getContentEditorWidget();
Point point = new Point(event.x, event.y);
TreeItem item = wTree.getItem(point);
@@ -1630,9 +1580,9 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
if (item.getParentItem().equals(wTreeScriptsItem)) {
setActiveCtab(item.getText());
} else if (!item.getData().equals(CONST_FUNCTION)) {
- int iStart = wScript.getCaretPosition();
+ int iStart = editor.getCaretPosition();
int selCount =
- wScript.getSelectionCount(); // this selection will be replaced by
wScript.insert
+ editor.getSelectionCount(); // this selection will be replaced by
wScript.insert
iStart =
iStart - selCount; // when a selection is already there we need to
subtract the position
if (iStart < 0) {
@@ -1642,8 +1592,8 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
if (strInsert.equals(CONST_JS_FUNCTION)) {
strInsert = item.getText();
}
- wScript.insert(strInsert);
- wScript.setSelection(iStart, iStart + strInsert.length());
+ editor.insert(strInsert);
+ editor.setSelection(iStart, iStart + strInsert.length());
}
}
}
@@ -1668,8 +1618,8 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
SWT.Selection,
e -> {
CTabItem item = folder.getSelection();
- StyledTextComp st = (StyledTextComp) item.getControl();
- addCtab(item.getText(), st.getText(), ADD_COPY);
+ IContentEditorWidget contentEditorWidget =
getContentEditorWidget(item);
+ addCtab(item.getText(), contentEditorWidget.getText(), ADD_COPY);
});
new MenuItem(cMenu, SWT.SEPARATOR);
@@ -1911,6 +1861,7 @@ public class ScriptValuesDialog extends
BaseTransformDialog {
break;
}
});
+ PropsUi.setLook(text);
editor.setEditor(text, item);
text.setText(item.getText());
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_de_DE.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_de_DE.properties
index 9d898c238b..34cc04b2e1 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_de_DE.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_de_DE.properties
@@ -26,7 +26,6 @@ ScriptValuesDialogMod.Fields.Label=Felder
ScriptValuesDialogMod.GetVariables.Button=\ &Lade Variablen
ScriptValuesDialogMod.Javascript.Label=JavaScript :
ScriptValuesDialogMod.JavascriptFunctions.Label=Javascript Funktionen:
-ScriptValuesDialogMod.Position.Label=Zeile {0} Spalte {1}
ScriptValuesDialogMod.ScriptCompilationOK=Dieses Skript konnte problemlos
kompiliert werden.
ScriptValuesDialogMod.Shell.Title=JavaScript
ScriptValuesDialogMod.StringFunctions.Label=Stringfunktionen
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_en_US.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_en_US.properties
index 5a5cb5e48e..fbd282e89f 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_en_US.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_en_US.properties
@@ -54,7 +54,6 @@ ScriptValuesDialogMod.OptimizationLevel.Label=Optimization
level
ScriptValuesDialogMod.OptimizationLevel.Tooltip=Valid values are -1 for
interpretive mode, 0 for no optimizations, and a value from 1 - 9 where 9
specifies maximal optimization
ScriptValuesDialogMod.OutputFields.Label=Output fields
ScriptValuesDialogMod.OutputFiels.CompatibilityOff=Please use the ''Replace
value ''Fieldname'' or ''Rename To'' field.
-ScriptValuesDialogMod.Position.Label=Position\: Line {0} Column {1}
ScriptValuesDialogMod.RemoveScriptType=Remove Script Type
ScriptValuesDialogMod.Rename.Label=Rename
ScriptValuesDialogMod.Sample.Label=Sample
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_AR.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_AR.properties
index 5f17763fac..715e60196f 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_AR.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_AR.properties
@@ -29,8 +29,7 @@ ScriptValuesDialogMod.Exception.CouldNotGetFields=No se ha
podido obtener campos
ScriptValuesDialogMod.Fields.Label=Campos
ScriptValuesDialogMod.GetVariables.Button=\ Obtener &Variables
ScriptValuesDialogMod.Javascript.Label=Java script \:
-ScriptValuesDialogMod.JavascriptFunctions.Label=Funciones Javascript\:
-ScriptValuesDialogMod.Position.Label=N\u00fam. L\u00ednea\: 0
+ScriptValuesDialogMod.JavascriptFunctions.Label=Funciones Javascript\:
ScriptValuesDialogMod.Shell.Title=Valores de Script
ScriptValuesDialogMod.TestFailed.DialogMessage=No se ha podido obtener campos
del paso anterior debido a un error
ScriptValuesDialogMod.TestFailed.DialogTitle=Fallo en Prueba
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_ES.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_ES.properties
index 6af162558b..b9a0d1dfde 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_ES.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_es_ES.properties
@@ -29,7 +29,6 @@ ScriptValuesDialogMod.Exception.CouldNotGetFields=No se ha
podido obtener campos
ScriptValuesDialogMod.Fields.Label=Campos
ScriptValuesDialogMod.GetVariables.Button=\ Obtener &Variables
ScriptValuesDialogMod.Javascript.Label=Java script :
-ScriptValuesDialogMod.Position.Label=Núm. Línea: 0
ScriptValuesDialogMod.Shell.Title=Valores de Script
ScriptValuesDialogMod.TestFailed.DialogMessage=No se ha podido obtener campos
del paso anterior debido a un error
ScriptValuesDialogMod.TestFailed.DialogTitle=Fallo en Prueba
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_fr_FR.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_fr_FR.properties
index 5301960fb6..40bfa686e8 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_fr_FR.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_fr_FR.properties
@@ -52,7 +52,6 @@ ScriptValuesDialogMod.OptimizationLevel.Label=Niveau
d''optimisation
ScriptValuesDialogMod.OptimizationLevel.Tooltip=Valeur comprise en 1 et 9 (0\=
aucune optimisation).
ScriptValuesDialogMod.OutputFields.Label=Modifier champs flux entr\u00E9e
ScriptValuesDialogMod.OutputFiels.CompatibilityOff=Pri\u00E8re d''utiliser la
grille des champs
-ScriptValuesDialogMod.Position.Label=Position\: Ligne {0} Colonne {1}
ScriptValuesDialogMod.RemoveScriptType=D\u00E9sactiver ce script
ScriptValuesDialogMod.Rename.Label=Renommer
ScriptValuesDialogMod.Sample.Label=Syntaxe
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_it_IT.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_it_IT.properties
index c329785ed2..6d7f0676d1 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_it_IT.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_it_IT.properties
@@ -52,7 +52,6 @@ ScriptValuesDialogMod.NumericFunctions.Label=Funzioni
numeriche
ScriptValuesDialogMod.OptimizationLevel.Label=Livello di ottimizzazione
ScriptValuesDialogMod.OptimizationLevel.Tooltip=Valori validi sono -1 per
modalit\u00E0 interpretativa, 0 per nessuna ottimizzazione ed un valore fra 1 e
9 dove 9 specifica l''ottimizzazione massima
ScriptValuesDialogMod.OutputFields.Label=Campi di output
-ScriptValuesDialogMod.Position.Label=Posizione\: Linea {0} Colonna {1}
ScriptValuesDialogMod.RemoveScriptType=Rimuovi il tipo script
ScriptValuesDialogMod.Rename.Label=Rinomina
ScriptValuesDialogMod.Sample.Label=Campione
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ja_JP.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ja_JP.properties
index c6e450c82e..e2dac019bc 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ja_JP.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ja_JP.properties
@@ -52,7 +52,6 @@
ScriptValuesDialogMod.NumericFunctions.Label=\u6570\u5b66\u95a2\u6570
ScriptValuesDialogMod.OptimizationLevel.Label=\u6700\u9069\u5316\u30ec\u30d9\u30eb
ScriptValuesDialogMod.OptimizationLevel.Tooltip=\u30a4\u30f3\u30bf\u30d7\u30ea\u30f3\u30bf\u30e2\u30fc\u30c9\u3067\u6709\u52b9\u306a\u5024\u306f-1\u3001\u6700\u9069\u5316\u306a\u3057\u306e\u5834\u5408\u306f0\u3001\u305d\u3057\u30661-9\u306e\u5024\u30019\u306f\u6700\u5927\u306e\u6700\u9069\u5316
ScriptValuesDialogMod.OutputFields.Label=\u51fa\u529b\u30d5\u30a3\u30fc\u30eb\u30c9
-ScriptValuesDialogMod.Position.Label=\u884c\u6570\: 0
ScriptValuesDialogMod.RemoveScriptType=\u30b9\u30af\u30ea\u30d7\u30c8\u30bf\u30a4\u30d7\u306e\u524a\u9664
ScriptValuesDialogMod.Rename.Label=\u30ea\u30cd\u30fc\u30e0
ScriptValuesDialogMod.Sample.Label=\u30b5\u30f3\u30d7\u30eb
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ko_KR.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ko_KR.properties
index 771b35a0ad..53a1a08213 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ko_KR.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_ko_KR.properties
@@ -41,7 +41,6 @@ ScriptValuesDialogMod.JavascriptFunctions.Label=Java script
\uD568\uC218 \:
ScriptValuesDialogMod.LogicFunctions.Label=\uB17C\uB9AC \uD568\uC218
ScriptValuesDialogMod.NumericFunctions.Label=\uC22B\uC790 \uD568\uC218
ScriptValuesDialogMod.OutputFields.Label=\uCD9C\uB825 \uD544\uB4DC
-ScriptValuesDialogMod.Position.Label=\uC904\uBC88\uD638\: 0
ScriptValuesDialogMod.RemoveScriptType=\uC2A4\uD06C\uB9BD\uD2B8 \uD615\uC2DD
\uC81C\uAC70
ScriptValuesDialogMod.Rename.Label=\uC774\uB984 \uBC14\uAFB8\uAE30
ScriptValuesDialogMod.Sample.Label=\uC608\uC81C
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_pt_BR.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_pt_BR.properties
index 2e25e4e206..5fa6bded2d 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_pt_BR.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_pt_BR.properties
@@ -81,7 +81,6 @@ ScriptValuesDialogMod.NumericFunctions.Label=Funções numéricas
ScriptValuesDialogMod.OptimizationLevel.Label=Nível de otimização
ScriptValuesDialogMod.OptimizationLevel.Tooltip=Valores válidos são -1 para
modo interpretativo, 0 para nenhuma otimização, e um valor de 1-9 onde 9
especifica otimização máxima
ScriptValuesDialogMod.OutputFiels.CompatibilityOff=Por favor, use o campo
''Substituir valor'' ou ''Renomear para''.
-ScriptValuesDialogMod.Position.Label=Posição\: Linha {0} Coluna {1}
ScriptValuesDialogMod.RemoveScriptType=Remover tipo de script
ScriptValuesDialogMod.SetEndScript=Definir script final
ScriptValuesDialogMod.SetStartScript=Definir script inicial
diff --git
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_zh_CN.properties
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_zh_CN.properties
index 1632989134..f4900a0068 100644
---
a/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_zh_CN.properties
+++
b/plugins/transforms/javascript/src/main/resources/org/apache/hop/pipeline/transforms/javascript/messages/messages_zh_CN.properties
@@ -52,7 +52,6 @@
ScriptValuesDialogMod.OptimizationLevel.Label=\u4F18\u5316\u7EA7\u522B
ScriptValuesDialogMod.OptimizationLevel.Tooltip=\u6709\u6548\u503C\u4E3A\uFF1A-1
\u8868\u793A\u89E3\u91CA\u6A21\u5F0F\uFF0C0
\u8868\u793A\u65E0\u4F18\u5316\uFF0C1-9 \u7EA7\u522B\u5176\u4E2D 9
\u4E3A\u6700\u5927\u4F18\u5316\u7EA7\u522B
ScriptValuesDialogMod.OutputFields.Label=\u8F93\u51FA\u5B57\u6BB5
ScriptValuesDialogMod.OutputFiels.CompatibilityOff=\u4F7F\u7528\u8868\u683C\u4E2D\u7684
"\u66FF\u6362\u5B57\u6BB5\u540D\u79F0 \u6216 \u91CD\u547D\u540D"
-ScriptValuesDialogMod.Position.Label=\u4F4D\u7F6E: \u884C\u53F7 {0}
\u5217\u540D{1}
ScriptValuesDialogMod.RemoveScriptType=\u6E05\u9664\u811A\u672C\u7C7B\u578B
ScriptValuesDialogMod.Rename.Label=\u91CD\u547D\u540D
ScriptValuesDialogMod.Sample.Label=\u6837\u4F8B
diff --git
a/rcp/src/main/java/org/apache/hop/ui/hopgui/ContentEditorTm4eSupport.java
b/rcp/src/main/java/org/apache/hop/ui/hopgui/ContentEditorTm4eSupport.java
index 34bcebfe61..4ab371da59 100644
--- a/rcp/src/main/java/org/apache/hop/ui/hopgui/ContentEditorTm4eSupport.java
+++ b/rcp/src/main/java/org/apache/hop/ui/hopgui/ContentEditorTm4eSupport.java
@@ -60,20 +60,22 @@ final class ContentEditorTm4eSupport {
private static final String SCOPE_YAML = "source.yaml";
private static final String SCOPE_SHELL = "source.shell";
private static final String SCOPE_BATCH = "source.batchfile";
+ private static final String SCOPE_JAVASCRIPT = "source.js";
private static final String SCOPE_MARKDOWN = "text.html.markdown";
/** Maps TM4E scope names to grammar resource filenames (classpath-relative
to grammars/). */
private static final Map<String, String> GRAMMAR_FILES =
- Map.of(
- SCOPE_JSON, "json.json",
- SCOPE_XML, "xml.json",
- SCOPE_SQL, "sql.json",
- SCOPE_TEXT, "text.json",
- SCOPE_PYTHON, "python.json",
- SCOPE_YAML, "yaml.json",
- SCOPE_SHELL, "shell.json",
- SCOPE_BATCH, "bat.json",
- SCOPE_MARKDOWN, "markdown.json");
+ Map.ofEntries(
+ Map.entry(SCOPE_JSON, "json.json"),
+ Map.entry(SCOPE_XML, "xml.json"),
+ Map.entry(SCOPE_SQL, "sql.json"),
+ Map.entry(SCOPE_TEXT, "text.json"),
+ Map.entry(SCOPE_PYTHON, "python.json"),
+ Map.entry(SCOPE_YAML, "yaml.json"),
+ Map.entry(SCOPE_SHELL, "shell.json"),
+ Map.entry(SCOPE_BATCH, "bat.json"),
+ Map.entry(SCOPE_JAVASCRIPT, "javascript.json"),
+ Map.entry(SCOPE_MARKDOWN, "markdown.json"));
// Same palette as before (light/dark) for consistency
private static final RGB L_COMMENT = new RGB(128, 128, 128);
@@ -126,6 +128,7 @@ final class ContentEditorTm4eSupport {
case "sql" -> SCOPE_SQL;
case "python", "py" -> SCOPE_PYTHON;
case "yaml", "yml" -> SCOPE_YAML;
+ case "javascript", "js" -> SCOPE_JAVASCRIPT;
case "shell", "bash", "sh" -> SCOPE_SHELL;
case "bat", "cmd", "batch" -> SCOPE_BATCH;
case "markdown", "md" -> SCOPE_MARKDOWN;
diff --git
a/rcp/src/main/resources/org/apache/hop/ui/hopgui/grammars/javascript.json
b/rcp/src/main/resources/org/apache/hop/ui/hopgui/grammars/javascript.json
new file mode 100644
index 0000000000..3e9a33e482
--- /dev/null
+++ b/rcp/src/main/resources/org/apache/hop/ui/hopgui/grammars/javascript.json
@@ -0,0 +1,3575 @@
+{
+ "name": "JavaScript (with React support)",
+ "scopeName": "source.js",
+ "fileTypes": [
+ ".js",
+ ".jsx"
+ ],
+ "uuid": "805375ec-d614-41f5-8993-5843fe63ea82",
+ "patterns": [
+ {
+ "include": "#directives"
+ },
+ {
+ "include": "#statements"
+ },
+ {
+ "name": "comment.line.shebang.ts",
+ "match": "\\A(#!).*(?=$)",
+ "captures": {
+ "1": {
+ "name":
"punctuation.definition.comment.ts"
+ }
+ }
+ }
+ ],
+ "repository": {
+ "statements": {
+ "patterns": [
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#template"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#literal"
+ },
+ {
+ "include": "#declaration"
+ },
+ {
+ "include": "#switch-statement"
+ },
+ {
+ "include": "#for-loop"
+ },
+ {
+ "include": "#after-operator-block"
+ },
+ {
+ "include": "#decl-block"
+ },
+ {
+ "include": "#control-statement"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "var-expr": {
+ "name": "meta.var.expr.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(var|let|const(?!\\s+enum\\b))\\b(?!\\$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.type.js"
+ }
+ },
+ "end": "(?=$|;|}|(\\s+(of|in)\\s+))",
+ "patterns": [
+ {
+ "include": "#destructuring-variable"
+ },
+ {
+ "include": "#var-single-variable"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "var-single-variable": {
+ "patterns": [
+ {
+ "name":
"meta.var-single-variable.expr.js",
+ "begin":
"(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\\s* (=\\s*( (async\\s+) |
(function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |
((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))
) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*(
([:,?=])| ([)]\\s*=>) )) ))) ))",
+ "beginCaptures": {
+ "1": {
+ "name":
"entity.name.function.js"
+ }
+ },
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
+ "patterns": [
+ {
+ "include":
"#type-annotation"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ {
+ "name":
"meta.var-single-variable.expr.js",
+ "begin":
"([_$[:alpha:]][_$[:alnum:]]*)",
+ "beginCaptures": {
+ "1": {
+ "name":
"variable.other.readwrite.js"
+ }
+ },
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
+ "patterns": [
+ {
+ "include":
"#type-annotation"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ }
+ ]
+ },
+ "destructuring-variable": {
+ "patterns": [
+ {
+ "name":
"meta.object-binding-pattern-variable.js",
+ "begin": "(?<!=|:|of|in)\\s*(?=\\{)",
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
+ "patterns": [
+ {
+ "include":
"#object-binding-pattern"
+ },
+ {
+ "include":
"#type-annotation"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ },
+ {
+ "name":
"meta.array-binding-pattern-variable.js",
+ "begin": "(?<!=|:|of|in)\\s*(?=\\[)",
+ "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))",
+ "patterns": [
+ {
+ "include":
"#array-binding-pattern"
+ },
+ {
+ "include":
"#type-annotation"
+ },
+ {
+ "include": "#comment"
+ }
+ ]
+ }
+ ]
+ },
+ "object-binding-element": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "begin":
"(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include":
"#object-binding-element-propertyName"
+ },
+ {
+ "include":
"#binding-element"
+ }
+ ]
+ },
+ {
+ "include": "#object-binding-pattern"
+ },
+ {
+ "include":
"#destructuring-variable-rest"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "object-binding-element-propertyName": {
+ "begin":
"(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
+ "end": "(:)",
+ "endCaptures": {
+ "0": {
+ "name": "punctuation.destructuring.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#array-literal"
+ },
+ {
+ "name": "variable.object.property.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ }
+ ]
+ },
+ "binding-element": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#object-binding-pattern"
+ },
+ {
+ "include": "#array-binding-pattern"
+ },
+ {
+ "include":
"#destructuring-variable-rest"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "destructuring-variable-rest": {
+ "match":
"(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name": "variable.other.readwrite.js"
+ }
+ }
+ },
+ "object-binding-pattern": {
+ "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#object-binding-element"
+ }
+ ]
+ },
+ "array-binding-pattern": {
+ "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#binding-element"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "ternary-expression": {
+ "begin": "(?=\\?)",
+ "end": "(?=$|[;,})\\]])",
+ "patterns": [
+ {
+ "include": "#ternary-operator"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "ternary-operator": {
+ "begin": "(\\?)",
+ "beginCaptures": {
+ "0": {
+ "name": "keyword.operator.ternary.js"
+ }
+ },
+ "end": "(:)",
+ "endCaptures": {
+ "0": {
+ "name": "keyword.operator.ternary.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "expression": {
+ "name": "meta.expression.js",
+ "patterns": [
+ {
+ "include": "#jsx"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#regex"
+ },
+ {
+ "include": "#template"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#literal"
+ },
+ {
+ "include": "#function-declaration"
+ },
+ {
+ "include":
"#class-or-interface-declaration"
+ },
+ {
+ "include": "#arrow-function"
+ },
+ {
+ "include": "#cast"
+ },
+ {
+ "include": "#ternary-expression"
+ },
+ {
+ "include": "#new-expr"
+ },
+ {
+ "include": "#object-literal"
+ },
+ {
+ "include": "#expression-operators"
+ },
+ {
+ "include": "#function-call"
+ },
+ {
+ "include": "#support-objects"
+ },
+ {
+ "include": "#identifiers"
+ },
+ {
+ "include": "#paren-expression"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#punctuation-accessor"
+ }
+ ]
+ },
+ "control-statement": {
+ "patterns": [
+ {
+ "name": "keyword.control.trycatch.js",
+ "match":
"(?<!\\.|\\$)\\b(catch|finally|throw|try)\\b(?!\\$)"
+ },
+ {
+ "name": "keyword.control.loop.js",
+ "match":
"(?<!\\.|\\$)\\b(break|continue|do|goto|while)\\b(?!\\$)"
+ },
+ {
+ "name": "keyword.control.flow.js",
+ "match":
"(?<!\\.|\\$)\\b(return)\\b(?!\\$)"
+ },
+ {
+ "match":
"(?<!\\.|\\$)\\b(yield)\\b(?!\\$)(?:\\s*(\\*))?",
+ "captures": {
+ "1": {
+ "name":
"keyword.control.flow.js"
+ },
+ "2": {
+ "name":
"keyword.generator.asterisk.js"
+ }
+ }
+ },
+ {
+ "name": "keyword.control.switch.js",
+ "match":
"(?<!\\.|\\$)\\b(case|default|switch)\\b(?!\\$)"
+ },
+ {
+ "name":
"keyword.control.conditional.js",
+ "match":
"(?<!\\.|\\$)\\b(else|if)\\b(?!\\$)"
+ },
+ {
+ "name": "keyword.control.with.js",
+ "match":
"(?<!\\.|\\$)\\b(with)\\b(?!\\$)"
+ },
+ {
+ "name": "keyword.other.debugger.js",
+ "match":
"(?<!\\.|\\$)\\b(debugger)\\b(?!\\$)"
+ },
+ {
+ "name": "storage.modifier.js",
+ "match":
"(?<!\\.|\\$)\\b(declare)\\b(?!\\$)"
+ }
+ ]
+ },
+ "declaration": {
+ "name": "meta.declaration.js",
+ "patterns": [
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#var-expr"
+ },
+ {
+ "include": "#function-declaration"
+ },
+ {
+ "include":
"#class-or-interface-declaration"
+ },
+ {
+ "include": "#type-declaration"
+ },
+ {
+ "include": "#enum-declaration"
+ },
+ {
+ "include": "#namespace-declaration"
+ },
+ {
+ "include": "#import-equals-declaration"
+ },
+ {
+ "include": "#import-declaration"
+ },
+ {
+ "include": "#export-declaration"
+ }
+ ]
+ },
+ "decorator": {
+ "name": "meta.decorator.js",
+ "begin": "(?<!\\.|\\$)\\@",
+ "beginCaptures": {
+ "0": {
+ "name": "punctuation.decorator.js"
+ }
+ },
+ "end": "(?=\\s)",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "type-declaration": {
+ "name": "meta.type.declaration.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(type)\\b\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.type.type.js"
+ },
+ "3": {
+ "name": "entity.name.type.js"
+ }
+ },
+ "end":
"(?=[};]|\\bvar\\b|\\blet\\b|\\bconst\\b|\\btype\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\bnamespace\\b|\\bmodule\\b|\\bimport\\b|\\benum\\b|\\bdeclare\\b|\\bexport\\b|\\babstract\\b|\\basync\\b)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#type"
+ },
+ {
+ "match": "(=)\\s*",
+ "captures": {
+ "1": {
+ "name":
"keyword.operator.assignment.js"
+ }
+ }
+ }
+ ]
+ },
+ "enum-declaration": {
+ "name": "meta.enum.declaration.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.type.enum.js"
+ },
+ "4": {
+ "name": "entity.name.type.enum.js"
+ }
+ },
+ "end": "(?<=\\})",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "begin":
"([_$[:alpha:]][_$[:alnum:]]*)",
+ "beginCaptures": {
+ "0": {
+ "name":
"variable.other.enummember.js"
+ }
+ },
+ "end": "(?=,|\\}|$)",
+ "patterns": [
+ {
+
"include": "#comment"
+ },
+ {
+
"include": "#variable-initializer"
+ }
+ ]
+ },
+ {
+ "begin":
"(?=((\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\])))",
+ "end": "(?=,|\\}|$)",
+ "patterns": [
+ {
+
"include": "#string"
+ },
+ {
+
"include": "#array-literal"
+ },
+ {
+
"include": "#comment"
+ },
+ {
+
"include": "#variable-initializer"
+ }
+ ]
+ },
+ {
+ "include":
"#punctuation-comma"
+ }
+ ]
+ }
+ ]
+ },
+ "namespace-declaration": {
+ "name": "meta.namespace.declaration.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(namespace|module)\\s+",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.type.namespace.js"
+ }
+ },
+ "end": "(?=$|\\{)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "name": "entity.name.type.module.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ },
+ {
+ "name": "punctuation.accessor.js",
+ "match": "\\."
+ }
+ ]
+ },
+ "import-equals-declaration": {
+ "patterns": [
+ {
+ "name":
"meta.import-equals.external.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.control.export.js"
+ },
+ "2": {
+ "name":
"keyword.control.import.js"
+ },
+ "3": {
+ "name":
"variable.other.readwrite.alias.js"
+ },
+ "4": {
+ "name":
"keyword.operator.assignment.js"
+ },
+ "5": {
+ "name":
"keyword.control.require.js"
+ },
+ "6": {
+ "name":
"meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name":
"meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ },
+ {
+ "name":
"meta.import-equals.internal.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.control.export.js"
+ },
+ "2": {
+ "name":
"keyword.control.import.js"
+ },
+ "3": {
+ "name":
"variable.other.readwrite.alias.js"
+ },
+ "4": {
+ "name":
"keyword.operator.assignment.js"
+ }
+ },
+ "end": "(?=;|$)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)",
+ "captures": {
+ "1": {
+ "name":
"entity.name.type.module.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ }
+ }
+ },
+ {
+ "name":
"variable.other.readwrite.js",
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)"
+ }
+ ]
+ }
+ ]
+ },
+ "import-declaration": {
+ "name": "meta.import.js",
+ "begin":
"(?<!\\.|\\$)(?:(\\bexport)\\s+)?\\b(import)(?!(\\s*:)|(\\$))\\b",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "keyword.control.import.js"
+ }
+ },
+ "end": "(?=;|$)",
+ "patterns": [
+ {
+ "include": "#import-export-declaration"
+ }
+ ]
+ },
+ "export-declaration": {
+ "patterns": [
+ {
+ "match":
"(?<!\\.|\\$)\\b(export)\\s+(as)\\s+(namespace)\\s+([_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name":
"keyword.control.export.js"
+ },
+ "2": {
+ "name":
"keyword.control.as.js"
+ },
+ "3": {
+ "name":
"storage.type.namespace.js"
+ },
+ "4": {
+ "name":
"entity.name.type.module.js"
+ }
+ }
+ },
+ {
+ "name": "meta.export.default.js",
+ "begin":
"(?<!\\.|\\$)\\b(export)(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.control.export.js"
+ },
+ "2": {
+ "name":
"keyword.operator.assignment.js"
+ },
+ "3": {
+ "name":
"keyword.control.default.js"
+ }
+ },
+ "end":
"(?=;|\\bexport\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\blet\\b|\\bvar\\b|\\bconst\\b|\\bimport\\b|\\benum\\b|\\bnamespace\\b|\\bmodule\\b|\\btype\\b|\\babstract\\b|\\bdeclare\\b|\\basync\\b|$)",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.export.js",
+ "begin":
"(?<!\\.|\\$)\\b(export)(?!(\\s*:)|(\\$))\\b",
+ "beginCaptures": {
+ "0": {
+ "name":
"keyword.control.export.js"
+ }
+ },
+ "end":
"(?=;|\\bexport\\b|\\bfunction\\b|\\bclass\\b|\\binterface\\b|\\blet\\b|\\bvar\\b|\\bconst\\b|\\bimport\\b|\\benum\\b|\\bnamespace\\b|\\bmodule\\b|\\btype\\b|\\babstract\\b|\\bdeclare\\b|\\basync\\b|$)",
+ "patterns": [
+ {
+ "include":
"#import-export-declaration"
+ }
+ ]
+ }
+ ]
+ },
+ "import-export-declaration": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#import-export-block"
+ },
+ {
+ "name": "keyword.control.from.js",
+ "match": "\\bfrom\\b"
+ },
+ {
+ "include": "#import-export-clause"
+ }
+ ]
+ },
+ "import-export-block": {
+ "name": "meta.block.js",
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#import-export-clause"
+ }
+ ]
+ },
+ "import-export-clause": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "comment": "(default|*|name) as alias",
+ "match": "(?x) (?: \\b(default)\\b |
(\\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \\s+ (as) \\s+ (?: (\\b default \\b |
\\*) | ([_$[:alpha:]][_$[:alnum:]]*))",
+ "captures": {
+ "1": {
+ "name":
"keyword.control.default.js"
+ },
+ "2": {
+ "name":
"constant.language.import-export-all.js"
+ },
+ "3": {
+ "name":
"variable.other.readwrite.js"
+ },
+ "4": {
+ "name":
"keyword.control.as.js"
+ },
+ "5": {
+ "name":
"invalid.illegal.js"
+ },
+ "6": {
+ "name":
"variable.other.readwrite.alias.js"
+ }
+ }
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "name":
"constant.language.import-export-all.js",
+ "match": "\\*"
+ },
+ {
+ "name": "keyword.control.default.js",
+ "match": "\\b(default)\\b"
+ },
+ {
+ "name":
"variable.other.readwrite.alias.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ }
+ ]
+ },
+ "class-or-interface-declaration": {
+ "name": "meta.class.js",
+ "begin":
"(?<!\\.|\\$)\\b(?:(export)\\s+)?\\b(?:(abstract)\\s+)?\\b(?:(class)|(interface))\\b",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.type.class.js"
+ },
+ "4": {
+ "name": "storage.type.interface.js"
+ }
+ },
+ "end": "(?<=\\})",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include":
"#class-or-interface-heritage"
+ },
+ {
+ "match": "[_$[:alpha:]][_$[:alnum:]]*",
+ "captures": {
+ "0": {
+ "name":
"entity.name.type.class.js"
+ }
+ }
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#class-or-interface-body"
+ }
+ ]
+ },
+ "class-or-interface-heritage": {
+ "begin":
"(?<!\\.|\\$)(?:\\b(extends|implements)\\b)(?!\\$)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ }
+ },
+ "end": "(?=\\{)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include":
"#class-or-interface-heritage"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*([,<{]|extends|implements|//|/\\*))",
+ "captures": {
+ "1": {
+ "name":
"entity.name.type.module.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ }
+ }
+ },
+ {
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*([,<{]|extends|implements|//|/\\*))",
+ "captures": {
+ "1": {
+ "name":
"entity.other.inherited-class.js"
+ }
+ }
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "class-or-interface-body": {
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "include": "#indexer-declaration"
+ },
+ {
+ "include": "#field-declaration"
+ },
+ {
+ "include": "#type-annotation"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#access-modifier"
+ },
+ {
+ "include": "#property-accessor"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "type-object": {
+ "name": "meta.object.type.js",
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type-object-members"
+ }
+ ]
+ },
+ "type-object-members": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "include": "#indexer-declaration"
+ },
+ {
+ "include": "#field-declaration"
+ },
+ {
+ "include": "#type-annotation"
+ },
+ {
+ "begin": "\\.\\.\\.",
+ "beginCaptures": {
+ "0": {
+ "name":
"keyword.operator.spread.js"
+ }
+ },
+ "end": "(?=\\}|;|,|$)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ {
+ "include": "#punctuation-comma"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "field-declaration": {
+ "name": "meta.field.declaration.js",
+ "begin":
"(?<!\\()(?:(?<!\\.|\\$)\\b(readonly)\\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ }
+ },
+ "end": "(?=\\}|;|,|$)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "begin":
"(?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\?\\s*)?(=|:))",
+ "end": "(?=[};,=]|$)|(?<=\\})",
+ "patterns": [
+ {
+ "include":
"#type-annotation"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include":
"#array-literal"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "name":
"entity.name.function.js",
+ "match":
"(?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\\?\\s*)?\\s* (=\\s*( (async\\s+) |
(function\\s*[(<]) | (function\\s+) | ([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |
((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))
) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*(
([:,?=])| ([)]\\s*=>) )) ))) ))"
+ },
+ {
+ "name":
"variable.object.property.js",
+ "match":
"[_$[:alpha:]][_$[:alnum:]]*"
+ },
+ {
+ "name":
"keyword.operator.optional.js",
+ "match": "\\?"
+ }
+ ]
+ }
+ ]
+ },
+ "method-declaration": {
+ "name": "meta.method.declaration.js",
+ "begin":
"(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??))?\\s*[\\(\\<]))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.modifier.async.js"
+ },
+ "4": {
+ "name": "storage.type.property.js"
+ },
+ "5": {
+ "name": "keyword.operator.new.js"
+ },
+ "6": {
+ "name": "storage.type.js"
+ },
+ "7": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\}|;|,)|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#function-parameters"
+ },
+ {
+ "include": "#return-type"
+ },
+ {
+ "include":
"#method-overload-declaration"
+ },
+ {
+ "include": "#decl-block"
+ }
+ ]
+ },
+ "method-overload-declaration": {
+ "begin":
"(?<!\\.|\\$)(?:\\b(public|private|protected)\\s+)?(?:\\b(abstract)\\s+)?(?:\\b(async)\\s+)?(?:\\b(get|set)\\s+)?(?:(?:\\b(?:(new)|(constructor))\\b(?!\\$|:))|(?:(\\*)\\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??))?\\s*[\\(\\<]))",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "storage.modifier.js"
+ },
+ "3": {
+ "name": "storage.modifier.async.js"
+ },
+ "4": {
+ "name": "storage.type.property.js"
+ },
+ "5": {
+ "name": "keyword.operator.new.js"
+ },
+ "6": {
+ "name": "storage.type.js"
+ },
+ "7": {
+ "name": "keyword.generator.asterisk.js"
+ }
+ },
+ "end": "(?=\\(|\\<)",
+ "patterns": [
+ {
+ "include": "#method-declaration-name"
+ }
+ ]
+ },
+ "method-declaration-name": {
+ "begin":
"(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(\\??)\\s*[\\(\\<])",
+ "end": "(?=\\(|\\<)",
+ "patterns": [
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#array-literal"
+ },
+ {
+ "name": "entity.name.function.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ },
+ {
+ "name": "keyword.operator.optional.js",
+ "match": "\\?"
+ }
+ ]
+ },
+ "indexer-declaration": {
+ "name": "meta.indexer.declaration.js",
+ "begin":
"(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=:)",
+ "beginCaptures": {
+ "1": {
+ "name": "storage.modifier.js"
+ },
+ "2": {
+ "name": "meta.brace.square.js"
+ },
+ "3": {
+ "name": "variable.parameter.js"
+ }
+ },
+ "end": "(\\])\\s*(\\?\\s*)?|$",
+ "endCaptures": {
+ "1": {
+ "name": "meta.brace.square.js"
+ },
+ "2": {
+ "name": "keyword.operator.optional.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type-annotation"
+ }
+ ]
+ },
+ "function-declaration": {
+ "name": "meta.function.js",
+ "begin":
"(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.modifier.async.js"
+ },
+ "3": {
+ "name": "storage.type.function.js"
+ },
+ "4": {
+ "name": "keyword.generator.asterisk.js"
+ },
+ "5": {
+ "name": "entity.name.function.js"
+ }
+ },
+ "end": "(?=;|\\})|(?<=\\})",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#function-parameters"
+ },
+ {
+ "include": "#return-type"
+ },
+ {
+ "include":
"#function-overload-declaration"
+ },
+ {
+ "include": "#decl-block"
+ }
+ ]
+ },
+ "function-overload-declaration": {
+ "name": "meta.function.overload.js",
+ "match":
"(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
+ "captures": {
+ "1": {
+ "name": "keyword.control.export.js"
+ },
+ "2": {
+ "name": "storage.modifier.async.js"
+ },
+ "3": {
+ "name": "storage.type.function.js"
+ },
+ "4": {
+ "name": "keyword.generator.asterisk.js"
+ },
+ "5": {
+ "name": "entity.name.function.js"
+ }
+ }
+ },
+ "object-literal": {
+ "name": "meta.objectliteral.js",
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#object-member"
+ }
+ ]
+ },
+ "decl-block": {
+ "name": "meta.block.js",
+ "begin": "\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#statements"
+ }
+ ]
+ },
+ "after-operator-block": {
+ "name": "meta.objectliteral.js",
+ "begin":
"(?<=[=(,\\[?+!]|await|return|yield|throw|in|of|typeof|&&|\\|\\||\\*)\\s*(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#object-member"
+ }
+ ]
+ },
+ "parameter-name": {
+ "patterns": [
+ {
+ "match":
"(?x)(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)(?=\\s*
(=\\s*( (async\\s+) | (function\\s*[(<]) | (function\\s+) |
([_$[:alpha:]][_$[:alnum:]]*\\s*=>) |
((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))
) | (:\\s*( (<) | ([(]\\s*( ([)]) | (\\.\\.\\.) | ([_$[:alnum:]]+\\s*(
([:,?=])| ([)]\\s*=>) )) ))) ))",
+ "captures": {
+ "1": {
+ "name":
"storage.modifier.js"
+ },
+ "2": {
+ "name":
"storage.modifier.js"
+ },
+ "3": {
+ "name":
"keyword.operator.rest.js"
+ },
+ "4": {
+ "name":
"entity.name.function.js"
+ },
+ "5": {
+ "name":
"keyword.operator.optional.js"
+ }
+ }
+ },
+ {
+ "match":
"(?:\\s*\\b(readonly)\\s+)?(?:\\s*\\b(public|private|protected)\\s+)?(\\.\\.\\.)?\\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\??)",
+ "captures": {
+ "1": {
+ "name":
"storage.modifier.js"
+ },
+ "2": {
+ "name":
"storage.modifier.js"
+ },
+ "3": {
+ "name":
"keyword.operator.rest.js"
+ },
+ "4": {
+ "name":
"variable.parameter.js"
+ },
+ "5": {
+ "name":
"keyword.operator.optional.js"
+ }
+ }
+ }
+ ]
+ },
+ "destructuring-parameter": {
+ "patterns": [
+ {
+ "name":
"meta.parameter.object-binding-pattern.js",
+ "begin": "(?<!=|:)\\s*(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#parameter-object-binding-element"
+ }
+ ]
+ },
+ {
+ "name":
"meta.paramter.array-binding-pattern.js",
+ "begin": "(?<!=|:)\\s*(\\[)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#parameter-binding-element"
+ },
+ {
+ "include":
"#punctuation-comma"
+ }
+ ]
+ }
+ ]
+ },
+ "parameter-object-binding-element": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "begin":
"(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\\'[^']*\\')|(\\\"[^\"]*\\\")|(\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*(:))",
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include":
"#object-binding-element-propertyName"
+ },
+ {
+ "include":
"#parameter-binding-element"
+ }
+ ]
+ },
+ {
+ "include":
"#parameter-object-binding-pattern"
+ },
+ {
+ "include":
"#destructuring-parameter-rest"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "parameter-binding-element": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include":
"#parameter-object-binding-pattern"
+ },
+ {
+ "include":
"#parameter-array-binding-pattern"
+ },
+ {
+ "include":
"#destructuring-parameter-rest"
+ },
+ {
+ "include": "#variable-initializer"
+ }
+ ]
+ },
+ "destructuring-parameter-rest": {
+ "match":
"(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name": "variable.parameter.js"
+ }
+ }
+ },
+ "parameter-object-binding-pattern": {
+ "begin": "(?:(\\.\\.\\.)\\s*)?(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.object.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#parameter-object-binding-element"
+ }
+ ]
+ },
+ "parameter-array-binding-pattern": {
+ "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.rest.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.binding-pattern.array.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#parameter-binding-element"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "return-type": {
+ "name": "meta.return.type.js",
+ "begin": "(?<=\\))\\s*(:)",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?<!:)((?=$)|(?=\\{|;|//|\\}))",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "meta.object.type.js",
+ "begin": "(?<=:)\\s*(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#type-object-members"
+ }
+ ]
+ },
+ {
+ "include": "#type-predicate-operator"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "type-predicate-operator": {
+ "name": "keyword.operator.expression.is.js",
+ "match": "(?<!\\.|\\$)\\bis\\b(?!\\$)"
+ },
+ "type-annotation": {
+ "name": "meta.type.annotation.js",
+ "begin": ":",
+ "beginCaptures": {
+ "0": {
+ "name":
"keyword.operator.type.annotation.js"
+ }
+ },
+ "end":
"(?=$|[,);\\}\\]]|//)|(?==[^>])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "type": {
+ "name": "meta.type.js",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#string"
+ },
+ {
+ "include": "#numeric-literal"
+ },
+ {
+ "include": "#type-primitive"
+ },
+ {
+ "include": "#type-builtin-literals"
+ },
+ {
+ "include": "#type-parameters"
+ },
+ {
+ "include": "#type-tuple"
+ },
+ {
+ "include": "#type-object"
+ },
+ {
+ "include": "#type-operators"
+ },
+ {
+ "include": "#type-fn-type-parameters"
+ },
+ {
+ "include":
"#type-paren-or-function-parameters"
+ },
+ {
+ "include": "#type-function-return-type"
+ },
+ {
+ "include": "#type-name"
+ }
+ ]
+ },
+ "function-parameters": {
+ "name": "meta.parameters.js",
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.parameters.begin.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.parameters.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#decorator"
+ },
+ {
+ "include": "#destructuring-parameter"
+ },
+ {
+ "include": "#parameter-name"
+ },
+ {
+ "include": "#type-annotation"
+ },
+ {
+ "include": "#variable-initializer"
+ },
+ {
+ "name":
"punctuation.separator.parameter.js",
+ "match": ","
+ }
+ ]
+ },
+ "type-primitive": {
+ "name": "support.type.primitive.js",
+ "match":
"(?<!\\.|\\$)\\b(string|number|boolean|symbol|any|void|never)\\b(?!\\$)"
+ },
+ "type-builtin-literals": {
+ "name": "support.type.builtin.js",
+ "match":
"(?<!\\.|\\$)\\b(this|true|false|undefined|null)\\b(?!\\$)"
+ },
+ "type-paren-or-function-parameters": {
+ "name": "meta.type.paren.cover.js",
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#function-parameters"
+ }
+ ]
+ },
+ "type-fn-type-parameters": {
+ "patterns": [
+ {
+ "name": "meta.type.constructor.js",
+ "match":
"(?<!\\.|\\$)\\b(new)\\b(?=\\s*\\<)",
+ "captures": {
+ "1": {
+ "name":
"keyword.control.new.js"
+ }
+ }
+ },
+ {
+ "name": "meta.type.constructor.js",
+ "begin":
"(?<!\\.|\\$)\\b(new)\\b\\s*(?=\\()",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.control.new.js"
+ }
+ },
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include":
"#function-parameters"
+ }
+ ]
+ },
+ {
+ "name": "meta.type.function.js",
+ "begin": "(?<=\\>)\\s*(?=\\()",
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include":
"#function-parameters"
+ }
+ ]
+ },
+ {
+ "name": "meta.type.function.js",
+ "begin": "(?x)( (?= [(]\\s*( ([)]) |
(\\.\\.\\.) | ([_$[:alnum:]]+\\s*( ([:,?=])| ([)]\\s*=>) )) ) ) )",
+ "end": "(?<=\\))",
+ "patterns": [
+ {
+ "include":
"#function-parameters"
+ }
+ ]
+ }
+ ]
+ },
+ "type-operators": {
+ "patterns": [
+ {
+ "include": "#typeof-operator"
+ },
+ {
+ "name": "keyword.operator.type.js",
+ "match": "[&|]"
+ },
+ {
+ "name":
"keyword.operator.expression.keyof.js",
+ "match":
"(?<!\\.|\\$)\\bkeyof\\b(?!\\$)"
+ }
+ ]
+ },
+ "type-function-return-type": {
+ "name": "meta.type.function.return.js",
+ "begin": "=>",
+ "beginCaptures": {
+ "0": {
+ "name": "storage.type.function.arrow.js"
+ }
+ },
+ "end": "(?<!=>)(?=[,\\]\\)\\{\\}=;>]|//|$)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "meta.object.type.js",
+ "begin": "(?<==>)\\s*(\\{)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#type-object-members"
+ }
+ ]
+ },
+ {
+ "include": "#type-predicate-operator"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "type-tuple": {
+ "name": "meta.type.tuple.js",
+ "begin": "\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.square.js"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.square.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "type-name": {
+ "patterns": [
+ {
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)\\s*(\\.)",
+ "captures": {
+ "1": {
+ "name":
"entity.name.type.module.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ }
+ }
+ },
+ {
+ "name": "entity.name.type.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ }
+ ]
+ },
+ "type-parameters": {
+ "name": "meta.type.parameters.js",
+ "begin": "(<)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.typeparameters.begin.js"
+ }
+ },
+ "end": "(?=$)|(>)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "storage.modifier.js",
+ "match":
"(?<!\\.|\\$)\\b(extends)\\b(?!\\$)"
+ },
+ {
+ "include": "#type"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "variable-initializer": {
+ "begin": "(?<!=|!)(=)(?!=)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.assignment.js"
+ }
+ },
+ "end": "(?=$|[,);}\\]])",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "for-loop": {
+ "begin": "(?<!\\.|\\$)\\b(for)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.loop.js"
+ },
+ "2": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#var-expr"
+ },
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-semicolon"
+ }
+ ]
+ },
+ "switch-expression": {
+ "name": "switch-expression.expr.js",
+ "begin": "(?<!\\.|\\$)\\b(switch)\\s*(\\()",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.switch.js"
+ },
+ "2": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "switch-block": {
+ "name": "switch-block.expr.js",
+ "begin": "{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "end": "(?=\\})",
+ "patterns": [
+ {
+ "include": "#case-clause"
+ },
+ {
+ "include": "#statements"
+ }
+ ]
+ },
+ "case-clause": {
+ "name": "case-clause.expr.js",
+ "begin": "(?<!\\.|\\$)\\b(case|default(?=:))\\b(?!\\$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.control.switch.js"
+ }
+ },
+ "end": ":",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.section.case-statement.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "switch-statement": {
+ "name": "switch-statement.expr.js",
+ "begin": "(?<!\\.|\\$)(?=\\bswitch\\s*\\()",
+ "end": "}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.block.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#switch-expression"
+ },
+ {
+ "include": "#switch-block"
+ }
+ ]
+ },
+ "support-objects": {
+ "patterns": [
+ {
+ "name":
"variable.language.arguments.js",
+ "match":
"(?<!\\.|\\$)\\b(arguments)\\b(?!\\$)"
+ },
+ {
+ "name": "support.class.builtin.js",
+ "match":
"(?x)(?<!\\.|\\$)\\b(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise|Proxy
|Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\\b(?!\\$)"
+ },
+ {
+ "name": "support.class.error.js",
+ "match":
"(?<!\\.|\\$)\\b((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\\b(?!\\$)"
+ },
+ {
+ "name": "support.function.js",
+ "match":
"(?x)(?<!\\.|\\$)\\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|
isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\\s*\\()"
+ },
+ {
+ "match":
"(?x)(?<!\\.|\\$)\\b(Math)(?:\\s*(\\.)\\s*(?:\n
(abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|\n
expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|\n
round|sign|sin|sinh|sqrt|tan|tanh|trunc)\n |\n
(E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"support.constant.math.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ },
+ "3": {
+ "name":
"support.function.math.js"
+ },
+ "4": {
+ "name":
"support.constant.property.math.js"
+ }
+ }
+ },
+ {
+ "match":
"(?x)(?<!\\.|\\$)\\b(console)(?:\\s*(\\.)\\s*(\n
assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log\n
|profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"support.class.console.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ },
+ "3": {
+ "name":
"support.function.console.js"
+ }
+ }
+ },
+ {
+ "match":
"(?<!\\.|\\$)\\b(JSON)(?:\\s*(\\.)\\s*(parse|stringify))?\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"support.constant.json.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ },
+ "3": {
+ "name":
"support.function.json.js"
+ }
+ }
+ },
+ {
+ "match": "(?x) (\\.) \\s* (?:\n
(constructor|length|prototype|__proto__) \n |\n
(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"support.variable.property.js"
+ },
+ "3": {
+ "name":
"support.constant.js"
+ }
+ }
+ },
+ {
+ "match": "(?x) (?<!\\.|\\$) \\b (?:\n
(document|event|navigator|performance|screen|window) \n |\n
(AnalyserNode|ArrayBufferView|Attr|AudioBuffer|AudioBufferSourceNode|AudioContext|AudioDestinationNode|AudioListener\n
|AudioNode|AudioParam|BatteryManager|BeforeUnloadEvent|BiquadFilterNode|Blob|BufferSource|ByteString|CSS|CSSConditionRule\n
|CSSCounterStyleRule|CSSGroupingRule|CSSMatrix|CSSMediaRule|CSSPageRule|CSSPrimitiveValue|CSSRule|CSSRuleList|CSSStyleDeclaration\n
|CSSStyl [...]
+ "captures": {
+ "1": {
+ "name":
"support.variable.dom.js"
+ },
+ "2": {
+ "name":
"support.class.dom.js"
+ }
+ }
+ },
+ {
+ "match": "(?x) (\\.) \\s* (?:\n
(ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE\n
|DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR\n
|INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR\n
|NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)\n
|\n (_content|[xyz]|abbr|above|accept [...]
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"support.constant.dom.js"
+ },
+ "3": {
+ "name":
"support.variable.property.dom.js"
+ }
+ }
+ },
+ {
+ "name": "support.class.node.js",
+ "match":
"(?x)(?<!\\.|\\$)\\b(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream\n
|Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b(?!\\$)"
+ },
+ {
+ "name": "support.module.node.js",
+ "match":
"(?x)(?<!\\.|\\$)\\b(assert|buffer|child_process|cluster|constants|crypto|dgram|dns|domain|events|fs|http|https|net\n
|os|path|punycode|querystring|readline|repl|stream|string_decoder|timers|tls|tty|url|util|vm|zlib)\\b(?!\\$)"
+ },
+ {
+ "match":
"(?x)(?<!\\.|\\$)\\b(process)(?:(\\.)(?:\n
(arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)\n
|\n
(abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)\n))?\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"support.variable.object.process.js"
+ },
+ "2": {
+ "name":
"punctuation.accessor.js"
+ },
+ "3": {
+ "name":
"support.variable.property.process.js"
+ },
+ "4": {
+ "name":
"support.function.process.js"
+ }
+ }
+ },
+ {
+ "match":
"(?<!\\.|\\$)\\b(?:(exports)|(module)(?:(\\.)(exports|id|filename|loaded|parent|children))?)\\b(?!\\$)",
+ "captures": {
+ "1": {
+ "name":
"support.type.object.module.js"
+ },
+ "2": {
+ "name":
"support.type.object.module.js"
+ },
+ "3": {
+ "name":
"punctuation.accessor.js"
+ },
+ "4": {
+ "name":
"support.type.object.module.js"
+ }
+ }
+ },
+ {
+ "name":
"support.variable.object.node.js",
+ "match":
"(?<!\\.|\\$)\\b(global|GLOBAL|root|__dirname|__filename)\\b(?!\\$)"
+ },
+ {
+ "match": "(?x) (\\.) \\s* \n(?:\n
(on(?:Rowsinserted|Rowsdelete|Rowenter|Rowexit|Resize|Resizestart|Resizeend|Reset|\n
Readystatechange|Mouseout|Mouseover|Mousedown|Mouseup|Mousemove|\n
Before(?:cut|deactivate|unload|update|paste|print|editfocus|activate)|\n
Blur|Scrolltop|Submit|Select|Selectstart|Selectionchange|Hover|Help|\n
Change|Contextmenu|Controlselect|Cut|Cellchange|Clock|Close|Deactivate|\n
Datasetchanged|Datasetcomplete|Dataavailable|Drop|Drag|Dragstart|Dragover [...]
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"support.function.event-handler.js"
+ },
+ "3": {
+ "name":
"support.function.js"
+ },
+ "4": {
+ "name":
"support.function.dom.js"
+ }
+ }
+ }
+ ]
+ },
+ "function-call": {
+ "begin":
"(?=(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
+ "end":
"(?<=\\))(?!(\\.\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\()",
+ "patterns": [
+ {
+ "include": "#support-objects"
+ },
+ {
+ "name": "punctuation.accessor.js",
+ "match": "\\."
+ },
+ {
+ "name": "entity.name.function.js",
+ "match": "([_$[:alpha:]][_$[:alnum:]]*)"
+ },
+ {
+ "include": "#comment"
+ },
+ {
+ "name": "meta.type.parameters.js",
+ "begin": "\\<",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.typeparameters.begin.js"
+ }
+ },
+ "end": "\\>",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.typeparameters.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#type"
+ },
+ {
+ "include":
"#punctuation-comma"
+ }
+ ]
+ },
+ {
+ "include": "#paren-expression"
+ }
+ ]
+ },
+ "identifiers": {
+ "patterns": [
+ {
+ "name": "support.class.js",
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\.\\s*prototype\\b(?!\\$))"
+ },
+ {
+ "match": "(?x)(\\.)\\s*(?:\n
([[:upper:]][_$[:digit:][:upper:]]*) |\n
([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"constant.other.object.property.js"
+ },
+ "3": {
+ "name":
"variable.other.object.property.js"
+ }
+ }
+ },
+ {
+ "match":
"(?x)(?:(\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*=\\s*(
(async\\s+)|(function\\s*[(<])|(function\\s+)|
([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|
((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)))",
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"entity.name.function.js"
+ }
+ }
+ },
+ {
+ "match":
"(\\.)\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])",
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"constant.other.property.js"
+ }
+ }
+ },
+ {
+ "match":
"(\\.)\\s*([_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name":
"punctuation.accessor.js"
+ },
+ "2": {
+ "name":
"variable.other.property.js"
+ }
+ }
+ },
+ {
+ "match": "(?x)(?:\n
([[:upper:]][_$[:digit:][:upper:]]*) |\n
([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
+ "captures": {
+ "1": {
+ "name":
"constant.other.object.js"
+ },
+ "2": {
+ "name":
"variable.other.object.js"
+ }
+ }
+ },
+ {
+ "name": "constant.other.js",
+ "match":
"([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
+ },
+ {
+ "name": "variable.other.readwrite.js",
+ "match": "[_$[:alpha:]][_$[:alnum:]]*"
+ }
+ ]
+ },
+ "cast": {
+ "patterns": [
+ {
+ "include": "#jsx"
+ }
+ ]
+ },
+ "new-expr": {
+ "name": "new.expr.js",
+ "begin": "(?<!\\.|\\$)\\b(new)\\b(?!\\$)",
+ "beginCaptures": {
+ "1": {
+ "name": "keyword.operator.new.js"
+ }
+ },
+ "end":
"(?<=\\))|(?=[;),]|$|((?<!\\.|\\$)\\bnew\\b(?!\\$)))",
+ "patterns": [
+ {
+ "include": "#paren-expression"
+ },
+ {
+ "include":
"#class-or-interface-declaration"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "object-member": {
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include": "#method-declaration"
+ },
+ {
+ "name": "meta.object.member.js",
+ "begin":
"(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "name":
"meta.object-literal.key.js",
+ "begin":
"(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]+\\])+\\]))\\s*:)",
+ "end": ":",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.separator.key-value.js"
+ }
+ },
+ "patterns": [
+ {
+
"include": "#string"
+ },
+ {
+
"include": "#array-literal"
+ }
+ ]
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js",
+ "begin":
"(?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\\s*(:)(?=\\s*(
(async\\s+)|(function\\s*[(<])|(function\\s+)|
([_$[:alpha:]][_$[:alnum:]]*\\s*=>)|
((<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>))))",
+ "beginCaptures": {
+ "0": {
+ "name":
"meta.object-literal.key.js"
+ },
+ "1": {
+ "name":
"entity.name.function.js"
+ },
+ "2": {
+ "name":
"punctuation.separator.key-value.js"
+ }
+ },
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js",
+ "begin":
"(?:[_$[:alpha:]][_$[:alnum:]]*)\\s*(:)",
+ "beginCaptures": {
+ "0": {
+ "name":
"meta.object-literal.key.js"
+ },
+ "1": {
+ "name":
"punctuation.separator.key-value.js"
+ }
+ },
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js",
+ "begin": "\\.\\.\\.",
+ "beginCaptures": {
+ "0": {
+ "name":
"keyword.operator.spread.js"
+ }
+ },
+ "end": "(?=,|\\})",
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ {
+ "name": "meta.object.member.js",
+ "match":
"([_$[:alpha:]][_$[:alnum:]]*)\\s*(?=,|\\}|$)",
+ "captures": {
+ "1": {
+ "name":
"variable.other.readwrite.js"
+ }
+ }
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "expression-operators": {
+ "patterns": [
+ {
+ "name": "keyword.control.flow.js",
+ "match":
"(?<!\\.|\\$)\\b(await)\\b(?!\\$)"
+ },
+ {
+ "name":
"keyword.operator.expression.delete.js",
+ "match":
"(?<!\\.|\\$)\\bdelete\\b(?!\\$)"
+ },
+ {
+ "name":
"keyword.operator.expression.in.js",
+ "match": "(?<!\\.|\\$)\\bin\\b(?!\\$)"
+ },
+ {
+ "name":
"keyword.operator.expression.of.js",
+ "match": "(?<!\\.|\\$)\\bof\\b(?!\\$)"
+ },
+ {
+ "name":
"keyword.operator.expression.instanceof.js",
+ "match":
"(?<!\\.|\\$)\\binstanceof\\b(?!\\$)"
+ },
+ {
+ "name": "keyword.operator.new.js",
+ "match": "(?<!\\.|\\$)\\bnew\\b(?!\\$)"
+ },
+ {
+ "include": "#typeof-operator"
+ },
+ {
+ "name":
"keyword.operator.expression.void.js",
+ "match": "(?<!\\.|\\$)\\bvoid\\b(?!\\$)"
+ },
+ {
+ "begin": "(?<!\\.|\\$)\\bas\\b(?!\\$)",
+ "beginCaptures": {
+ "0": {
+ "name":
"keyword.control.as.js"
+ }
+ },
+ "end": "(?=$|[;,:})\\]])",
+ "patterns": [
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ {
+ "name": "keyword.operator.spread.js",
+ "match": "\\.\\.\\."
+ },
+ {
+ "name":
"keyword.operator.assignment.compound.js",
+ "match": "\\*=|(?<!\\()/=|%=|\\+=|\\-="
+ },
+ {
+ "name":
"keyword.operator.assignment.compound.bitwise.js",
+ "match": "\\&=|\\^=|<<=|>>=|>>>=|\\|="
+ },
+ {
+ "name":
"keyword.operator.bitwise.shift.js",
+ "match": "<<|>>>|>>"
+ },
+ {
+ "name":
"keyword.operator.comparison.js",
+ "match": "===|!==|==|!="
+ },
+ {
+ "name":
"keyword.operator.relational.js",
+ "match": "<=|>=|<>|<|>"
+ },
+ {
+ "name": "keyword.operator.logical.js",
+ "match": "\\!|&&|\\|\\|"
+ },
+ {
+ "name": "keyword.operator.bitwise.js",
+ "match": "\\&|~|\\^|\\|"
+ },
+ {
+ "name":
"keyword.operator.assignment.js",
+ "match": "\\="
+ },
+ {
+ "name": "keyword.operator.decrement.js",
+ "match": "--"
+ },
+ {
+ "name": "keyword.operator.increment.js",
+ "match": "\\+\\+"
+ },
+ {
+ "name":
"keyword.operator.arithmetic.js",
+ "match": "%|\\*|/|-|\\+"
+ },
+ {
+ "match":
"(?<=[_$[:alnum:]])\\s*(/)(?![/*])",
+ "captures": {
+ "1": {
+ "name":
"keyword.operator.arithmetic.js"
+ }
+ }
+ }
+ ]
+ },
+ "typeof-operator": {
+ "name": "keyword.operator.expression.typeof.js",
+ "match": "(?<!\\.|\\$)\\btypeof\\b(?!\\$)"
+ },
+ "arrow-function": {
+ "patterns": [
+ {
+ "name": "meta.arrow.js",
+ "match":
"(?<!\\.|\\$)(\\basync)(?=\\s*[<(])",
+ "captures": {
+ "1": {
+ "name":
"storage.modifier.async.js"
+ }
+ }
+ },
+ {
+ "name": "meta.arrow.js",
+ "match":
"(?:(?<!\\.|\\$)(\\basync)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)",
+ "captures": {
+ "1": {
+ "name":
"storage.modifier.async.js"
+ },
+ "2": {
+ "name":
"variable.parameter.js"
+ }
+ }
+ },
+ {
+ "name": "meta.arrow.js",
+ "begin":
"(?x)\\s*(?=(<([^<>]|\\<[^<>]+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)",
+ "end": "(?==>)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include":
"#type-parameters"
+ },
+ {
+ "include":
"#function-parameters"
+ },
+ {
+ "include":
"#arrow-return-type"
+ }
+ ]
+ },
+ {
+ "name": "meta.arrow.js",
+ "begin": "=>",
+ "beginCaptures": {
+ "0": {
+ "name":
"storage.type.function.arrow.js"
+ }
+ },
+ "end": "(?<=\\})|((?!\\{)(?=\\S))",
+ "patterns": [
+ {
+ "include": "#decl-block"
+ },
+ {
+ "include": "#expression"
+ }
+ ]
+ }
+ ]
+ },
+ "arrow-return-type": {
+ "name": "meta.return.type.arrow.js",
+ "begin": "(?<=\\))\\s*(:)",
+ "beginCaptures": {
+ "1": {
+ "name":
"keyword.operator.type.annotation.js"
+ }
+ },
+ "end": "(?<!:)((?=$)|(?==>|;|//))",
+ "patterns": [
+ {
+ "include": "#type-predicate-operator"
+ },
+ {
+ "include": "#type"
+ }
+ ]
+ },
+ "punctuation-comma": {
+ "name": "punctuation.separator.comma.js",
+ "match": ","
+ },
+ "punctuation-semicolon": {
+ "name": "punctuation.terminator.statement.js",
+ "match": ";"
+ },
+ "punctuation-accessor": {
+ "name": "punctuation.accessor.js",
+ "match": "\\."
+ },
+ "paren-expression": {
+ "begin": "\\(",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.round.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "qstring-double": {
+ "name": "string.quoted.double.js",
+ "begin": "\"",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(\")|((?:[^\\\\\\n])$)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ },
+ "qstring-single": {
+ "name": "string.quoted.single.js",
+ "begin": "'",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(\\')|((?:[^\\\\\\n])$)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name": "invalid.illegal.newline.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ },
+ "regex": {
+ "patterns": [
+ {
+ "name": "string.regex.js",
+ "begin":
"(?<=[=(:,\\[?+!]|return|case|=>|&&|\\|\\||\\*\\/)\\s*(/)(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(/)([gimuy]*)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name":
"keyword.other.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ },
+ {
+ "name": "string.regex.js",
+ "begin":
"/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "end": "(/)([gimuy]*)",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.string.end.js"
+ },
+ "2": {
+ "name":
"keyword.other.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ }
+ ]
+ },
+ "regexp": {
+ "patterns": [
+ {
+ "name": "keyword.control.anchor.regexp",
+ "match": "\\\\[bB]|\\^|\\$"
+ },
+ {
+ "name":
"keyword.other.back-reference.regexp",
+ "match": "\\\\[1-9]\\d*"
+ },
+ {
+ "name":
"keyword.operator.quantifier.regexp",
+ "match":
"[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??"
+ },
+ {
+ "name": "keyword.operator.or.regexp",
+ "match": "\\|"
+ },
+ {
+ "name": "meta.group.assertion.regexp",
+ "begin": "(\\()((\\?=)|(\\?!))",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.group.regexp"
+ },
+ "2": {
+ "name":
"punctuation.definition.group.assertion.regexp"
+ },
+ "3": {
+ "name":
"meta.assertion.look-ahead.regexp"
+ },
+ "4": {
+ "name":
"meta.assertion.negative-look-ahead.regexp"
+ }
+ },
+ "end": "(\\))",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.group.regexp"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ },
+ {
+ "name": "meta.group.regexp",
+ "begin": "\\((\\?:)?",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.group.regexp"
+ },
+ "1": {
+ "name":
"punctuation.definition.group.capture.regexp"
+ }
+ },
+ "end": "\\)",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.group.regexp"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#regexp"
+ }
+ ]
+ },
+ {
+ "name":
"constant.other.character-class.set.regexp",
+ "begin": "(\\[)(\\^)?",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.character-class.regexp"
+ },
+ "2": {
+ "name":
"keyword.operator.negation.regexp"
+ }
+ },
+ "end": "(\\])",
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.character-class.regexp"
+ }
+ },
+ "patterns": [
+ {
+ "name":
"constant.other.character-class.range.regexp",
+ "match":
"(?:.|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x\\h\\h|u\\h\\h\\h\\h))|(\\\\c[A-Z])|(\\\\.))",
+ "captures": {
+ "1": {
+ "name":
"constant.character.numeric.regexp"
+ },
+ "2": {
+ "name":
"constant.character.control.regexp"
+ },
+ "3": {
+ "name":
"constant.character.escape.backslash.regexp"
+ },
+ "4": {
+ "name":
"constant.character.numeric.regexp"
+ },
+ "5": {
+ "name":
"constant.character.control.regexp"
+ },
+ "6": {
+ "name":
"constant.character.escape.backslash.regexp"
+ }
+ }
+ },
+ {
+ "include":
"#regex-character-class"
+ }
+ ]
+ },
+ {
+ "include": "#regex-character-class"
+ }
+ ]
+ },
+ "regex-character-class": {
+ "patterns": [
+ {
+ "name":
"constant.other.character-class.regexp",
+ "match": "\\\\[wWsSdDtrnvf]|\\."
+ },
+ {
+ "name":
"constant.character.numeric.regexp",
+ "match":
"\\\\([0-7]{3}|x\\h\\h|u\\h\\h\\h\\h)"
+ },
+ {
+ "name":
"constant.character.control.regexp",
+ "match": "\\\\c[A-Z]"
+ },
+ {
+ "name":
"constant.character.escape.backslash.regexp",
+ "match": "\\\\."
+ }
+ ]
+ },
+ "string": {
+ "patterns": [
+ {
+ "include": "#qstring-single"
+ },
+ {
+ "include": "#qstring-double"
+ }
+ ]
+ },
+ "template": {
+ "name": "string.template.js",
+ "begin": "([_$[:alpha:]][_$[:alnum:]]*)?(`)",
+ "beginCaptures": {
+ "1": {
+ "name":
"entity.name.function.tagged-template.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.string.template.begin.js"
+ }
+ },
+ "end": "`",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.template.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include":
"#template-substitution-element"
+ },
+ {
+ "include": "#string-character-escape"
+ }
+ ]
+ },
+ "string-character-escape": {
+ "name": "constant.character.escape.js",
+ "match":
"\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)"
+ },
+ "template-substitution-element": {
+ "name": "meta.template.expression.js",
+ "begin": "\\$\\{",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.template-expression.begin.js"
+ }
+ },
+ "end": "\\}",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.template-expression.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "literal": {
+ "name": "literal.js",
+ "patterns": [
+ {
+ "include": "#numeric-literal"
+ },
+ {
+ "include": "#boolean-literal"
+ },
+ {
+ "include": "#null-literal"
+ },
+ {
+ "include": "#undefined-literal"
+ },
+ {
+ "include": "#numericConstant-literal"
+ },
+ {
+ "include": "#array-literal"
+ },
+ {
+ "include": "#this-literal"
+ },
+ {
+ "include": "#super-literal"
+ }
+ ]
+ },
+ "array-literal": {
+ "name": "meta.array.literal.js",
+ "begin": "\\[",
+ "beginCaptures": {
+ "0": {
+ "name": "meta.brace.square.js"
+ }
+ },
+ "end": "\\]",
+ "endCaptures": {
+ "0": {
+ "name": "meta.brace.square.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ },
+ {
+ "include": "#punctuation-comma"
+ }
+ ]
+ },
+ "numeric-literal": {
+ "patterns": [
+ {
+ "name": "constant.numeric.hex.js",
+ "match":
"\\b(?<!\\$)0(x|X)[0-9a-fA-F]+\\b(?!\\$)"
+ },
+ {
+ "name": "constant.numeric.binary.js",
+ "match":
"\\b(?<!\\$)0(b|B)[01]+\\b(?!\\$)"
+ },
+ {
+ "name": "constant.numeric.octal.js",
+ "match":
"\\b(?<!\\$)0(o|O)?[0-7]+\\b(?!\\$)"
+ },
+ {
+ "match": "(?x)\n(?<!\\$)(?:\n
(?:\\b[0-9]+(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # 1.1E+3\n
(?:\\b[0-9]+(\\.)[eE][+-]?[0-9]+\\b)| # 1.E+3\n
(?:\\B(\\.)[0-9]+[eE][+-]?[0-9]+\\b)| # .1E+3\n
(?:\\b[0-9]+[eE][+-]?[0-9]+\\b)| # 1E+3\n
(?:\\b[0-9]+(\\.)[0-9]+\\b)| # 1.1\n (?:\\b[0-9]+(\\.)\\B)|
# 1.\n (?:\\B(\\.)[0-9]+\\b)| # .1\n
(?:\\b[0-9]+\\b(?!\\.)) # 1\n)(?!\\$)",
+ "captures": {
+ "0": {
+ "name":
"constant.numeric.decimal.js"
+ },
+ "1": {
+ "name":
"meta.delimiter.decimal.period.js"
+ },
+ "2": {
+ "name":
"meta.delimiter.decimal.period.js"
+ },
+ "3": {
+ "name":
"meta.delimiter.decimal.period.js"
+ },
+ "4": {
+ "name":
"meta.delimiter.decimal.period.js"
+ },
+ "5": {
+ "name":
"meta.delimiter.decimal.period.js"
+ },
+ "6": {
+ "name":
"meta.delimiter.decimal.period.js"
+ }
+ }
+ }
+ ]
+ },
+ "boolean-literal": {
+ "patterns": [
+ {
+ "name":
"constant.language.boolean.true.js",
+ "match": "(?<!\\.|\\$)\\btrue\\b(?!\\$)"
+ },
+ {
+ "name":
"constant.language.boolean.false.js",
+ "match":
"(?<!\\.|\\$)\\bfalse\\b(?!\\$)"
+ }
+ ]
+ },
+ "null-literal": {
+ "name": "constant.language.null.js",
+ "match": "(?<!\\.|\\$)\\bnull\\b(?!\\$)"
+ },
+ "this-literal": {
+ "name": "variable.language.this.js",
+ "match": "(?<!\\.|\\$)\\bthis\\b(?!\\$)"
+ },
+ "super-literal": {
+ "name": "variable.language.super.js",
+ "match": "(?<!\\.|\\$)\\bsuper\\b(?!\\$)"
+ },
+ "undefined-literal": {
+ "name": "constant.language.undefined.js",
+ "match": "(?<!\\.|\\$)\\bundefined\\b(?!\\$)"
+ },
+ "numericConstant-literal": {
+ "patterns": [
+ {
+ "name": "constant.language.nan.js",
+ "match": "(?<!\\.|\\$)\\bNaN\\b(?!\\$)"
+ },
+ {
+ "name": "constant.language.infinity.js",
+ "match":
"(?<!\\.|\\$)\\bInfinity\\b(?!\\$)"
+ }
+ ]
+ },
+ "access-modifier": {
+ "name": "storage.modifier.js",
+ "match":
"(?<!\\.|\\$)\\b(abstract|public|protected|private|readonly|static)\\b(?!\\$)"
+ },
+ "property-accessor": {
+ "name": "storage.type.property.js",
+ "match": "(?<!\\.|\\$)\\b(get|set)\\b(?!\\$)"
+ },
+ "comment": {
+ "patterns": [
+ {
+ "name":
"comment.block.documentation.js",
+ "begin": "/\\*\\*(?!/)",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#docblock"
+ }
+ ]
+ },
+ {
+ "name": "comment.block.js",
+ "begin": "/\\*",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ },
+ "end": "\\*/",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ }
+ },
+ {
+ "begin": "(^[ \\t]+)?(?=//)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.whitespace.comment.leading.js"
+ }
+ },
+ "end": "(?=$)",
+ "patterns": [
+ {
+ "name":
"comment.line.double-slash.js",
+ "begin": "//",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ },
+ "end": "(?=$)"
+ }
+ ]
+ }
+ ]
+ },
+ "directives": {
+ "name": "comment.line.triple-slash.directive.js",
+ "begin":
"^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.comment.js"
+ }
+ },
+ "end": "(?=$)",
+ "patterns": [
+ {
+ "name": "meta.tag.js",
+ "begin":
"(<)(reference|amd-dependency|amd-module)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.tag.directive.js"
+ },
+ "2": {
+ "name":
"entity.name.tag.directive.js"
+ }
+ },
+ "end": "/>",
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.tag.directive.js"
+ }
+ },
+ "patterns": [
+ {
+ "name":
"entity.other.attribute-name.directive.js",
+ "match":
"path|types|no-default-lib|name"
+ },
+ {
+ "name":
"keyword.operator.assignment.js",
+ "match": "="
+ },
+ {
+ "include": "#string"
+ }
+ ]
+ }
+ ]
+ },
+ "docblock": {
+ "patterns": [
+ {
+ "name": "storage.type.class.jsdoc",
+ "match":
"(?<!\\w)@(abstract|access|alias|arg|argument|async|attribute|augments|author|beta|borrows|bubbes|callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright|default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exports?|extends|extension|extension_for|extensionfor|external|file|fileoverview|final|fires|for|function|global|host|ignore|implements|inherit[Dd]oc|inner|instance|interface|kind|lends|license|liste
[...]
+ },
+ {
+ "match":
"(?x)\n(?:(?<=@param)|(?<=@arg)|(?<=@argument)|(?<=@type))\n\\s+\n({(?:\n \\*
| # {*} any type\n \\? |
# {?} unknown type\n (?:
# Check for a prefix\n \\? |
# {?string} nullable type\n ! | #
{!string} non-nullable type\n \\.{3} #
{...str [...]
+ "captures": {
+ "0": {
+ "name":
"other.meta.jsdoc"
+ },
+ "1": {
+ "name":
"entity.name.type.instance.jsdoc"
+ },
+ "2": {
+ "name":
"variable.other.jsdoc"
+ },
+ "3": {
+ "name":
"other.description.jsdoc"
+ }
+ }
+ },
+ {
+ "match": "(?x)\n({(?:\n \\* |
# {*} any type\n \\? |
# {?} unknown type\n\n (?: #
Check for a prefix\n \\? | # {?string}
nullable type\n ! | # {!string}
non-nullable type\n \\.{3} # {...string}
variable number of parameters\n )?\n\n (?:\n \\( [...]
+ "captures": {
+ "0": {
+ "name":
"other.meta.jsdoc"
+ },
+ "1": {
+ "name":
"entity.name.type.instance.jsdoc"
+ },
+ "2": {
+ "name":
"other.description.jsdoc"
+ }
+ }
+ }
+ ]
+ },
+ "jsx-tag-attributes": {
+ "patterns": [
+ {
+ "include": "#jsx-tag-attribute-name"
+ },
+ {
+ "include":
"#jsx-tag-attribute-assignment"
+ },
+ {
+ "include": "#jsx-string-double-quoted"
+ },
+ {
+ "include": "#jsx-string-single-quoted"
+ },
+ {
+ "include": "#jsx-evaluated-code"
+ }
+ ]
+ },
+ "jsx-tag-attribute-name": {
+ "match": "(?x)\n \\s*\n ([_$a-zA-Z][-$\\w]*)\n
(?=\\s|=|/?>|/\\*|//)",
+ "captures": {
+ "1": {
+ "name": "entity.other.attribute-name.js"
+ }
+ }
+ },
+ "jsx-tag-attribute-assignment": {
+ "name": "keyword.operator.assignment.js",
+ "match": "=(?=\\s*(?:'|\"|{|/\\*|//|\\n))"
+ },
+ "jsx-string-double-quoted": {
+ "name": "string.quoted.double.js",
+ "begin": "\"",
+ "end": "\"",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx-string-single-quoted": {
+ "name": "string.quoted.single.js",
+ "begin": "'",
+ "end": "'",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.definition.string.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx-entities": {
+ "patterns": [
+ {
+ "name": "constant.character.entity.js",
+ "match":
"(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
+ "captures": {
+ "1": {
+ "name":
"punctuation.definition.entity.js"
+ },
+ "3": {
+ "name":
"punctuation.definition.entity.js"
+ }
+ }
+ },
+ {
+ "name":
"invalid.illegal.bad-ampersand.js",
+ "match": "&"
+ }
+ ]
+ },
+ "jsx-evaluated-code": {
+ "name": "meta.embedded.expression.js",
+ "begin": "{",
+ "end": "}",
+ "beginCaptures": {
+ "0": {
+ "name":
"punctuation.section.embedded.begin.js"
+ }
+ },
+ "endCaptures": {
+ "0": {
+ "name":
"punctuation.section.embedded.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#expression"
+ }
+ ]
+ },
+ "jsx-tag-attributes-illegal": {
+ "name": "invalid.illegal.attribute.js",
+ "match": "\\S+"
+ },
+ "jsx-tag-without-attributes": {
+ "name": "meta.tag.without-attributes.js",
+ "begin":
"(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
+ "end": "(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name": "entity.name.tag.js"
+ },
+ "3": {
+ "name":
"punctuation.definition.tag.end.js"
+ }
+ },
+ "endCaptures": {
+ "1": {
+ "name":
"punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name": "entity.name.tag.js"
+ },
+ "3": {
+ "name":
"punctuation.definition.tag.end.js"
+ }
+ },
+ "contentName": "meta.jsx.children.tsx",
+ "patterns": [
+ {
+ "include": "#jsx-children"
+ }
+ ]
+ },
+ "jsx-tag-in-expression": {
+ "begin": "(?x)\n
(?<=[({\\[,?=>]|&&|\\|\\||\\?|\\Wreturn|^return|\\Wdefault|^)\\s*\n
(?!(<)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)) #look ahead is not start of
tag without attributes\n
(?!<\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s+[^=>])|,)) # look ahead is
not type parameter of arrow\n (?=(<)\\s*\n ([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n
(?=\\s+(?!\\?)|/?>))",
+ "end":
"(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
+ "endCaptures": {
+ "0": {
+ "name": "meta.tag.js"
+ },
+ "1": {
+ "name":
"punctuation.definition.tag.end.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.tag.begin.js"
+ },
+ "3": {
+ "name": "entity.name.tag.js"
+ },
+ "4": {
+ "name":
"punctuation.definition.tag.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-tag"
+ }
+ ]
+ },
+ "jsx-child-tag": {
+ "begin": "(?x)\n (?=(<)\\s*\n
([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
+ "end":
"(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>))",
+ "endCaptures": {
+ "0": {
+ "name": "meta.tag.js"
+ },
+ "1": {
+ "name":
"punctuation.definition.tag.end.js"
+ },
+ "2": {
+ "name":
"punctuation.definition.tag.begin.js"
+ },
+ "3": {
+ "name": "entity.name.tag.js"
+ },
+ "4": {
+ "name":
"punctuation.definition.tag.end.js"
+ }
+ },
+ "patterns": [
+ {
+ "include": "#jsx-tag"
+ }
+ ]
+ },
+ "jsx-tag": {
+ "name": "meta.tag.js",
+ "begin": "(?x)\n (?=(<)\\s*\n
([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>))",
+ "end":
"(?=(/>)|(?:(</)\\s*([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\\s*(>)))",
+ "patterns": [
+ {
+ "begin": "(?x)\n (<)\\s*\n
([_$a-zA-Z][-$\\w.]*(?<!\\.|-))\n (?=\\s+(?!\\?)|/?>)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.tag.begin.js"
+ },
+ "2": {
+ "name":
"entity.name.tag.js"
+ }
+ },
+ "end": "(?=[/]?>)",
+ "patterns": [
+ {
+ "include": "#comment"
+ },
+ {
+ "include":
"#jsx-tag-attributes"
+ },
+ {
+ "include":
"#jsx-tag-attributes-illegal"
+ }
+ ]
+ },
+ {
+ "begin": "(>)",
+ "beginCaptures": {
+ "1": {
+ "name":
"punctuation.definition.tag.end.js"
+ }
+ },
+ "end": "(?=</)",
+ "contentName": "meta.jsx.children.tsx",
+ "patterns": [
+ {
+ "include":
"#jsx-children"
+ }
+ ]
+ }
+ ]
+ },
+ "jsx-tag-invalid": {
+ "name": "invalid.illegal.tag.incomplete.js",
+ "match": "<\\s*>"
+ },
+ "jsx-children": {
+ "patterns": [
+ {
+ "include": "#jsx-tag-without-attributes"
+ },
+ {
+ "include": "#jsx-child-tag"
+ },
+ {
+ "include": "#jsx-tag-invalid"
+ },
+ {
+ "include": "#jsx-evaluated-code"
+ },
+ {
+ "include": "#jsx-entities"
+ }
+ ]
+ },
+ "jsx": {
+ "patterns": [
+ {
+ "include": "#jsx-tag-without-attributes"
+ },
+ {
+ "include": "#jsx-tag-in-expression"
+ },
+ {
+ "include": "#jsx-tag-invalid"
+ }
+ ]
+ }
+ },
+ "version":
"https://github.com/Microsoft/TypeScript-TmLanguage/commit/4d0bdebb93aadc25ecbb903ebc897e9cd5fab69c"
+}
\ No newline at end of file
