diff --git a/.eslintignore b/.eslintignore
index d1a5354..60678f7 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,5 +1,6 @@
# Upstream code
-/modules/lib/
+/modules/lib/*
+!modules/lib/foreign-resources.*
# Build
/vendor/
diff --git a/.gitignore b/.gitignore
index f4e2803..59252cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ project.index
## Sublime
sublime-*
sftp-config.json
+/.stylelintcache
diff --git a/.phan/config.php b/.phan/config.php
index 76efd06..60ea863 100644
--- a/.phan/config.php
+++ b/.phan/config.php
@@ -1,3 +1,18 @@
= 1.43",
+ "MediaWiki": ">= 1.45",
"extensions": {
"WikiEditor": ">= 0.5.2"
}
},
+ "config": {
+ "CodeEditorEnabledModes": {
+ "value": {
+ "javascript": true,
+ "json": true,
+ "css": true,
+ "lua": true
+ },
+ "description": "Temporary configuration flag to control conflicts with Extension:CodeMirror. Only modes that exist in CodeMirror need to be specified."
+ }
+ },
"Hooks": {
"EditPage::showEditForm:initial": "CodeEditorHooks",
"EditPage::showReadOnlyForm:initial": "CodeEditorHooks",
@@ -24,7 +35,8 @@
"class": "MediaWiki\\Extension\\CodeEditor\\Hooks",
"services": [
"UserOptionsLookup",
- "HookContainer"
+ "HookContainer",
+ "MainConfig"
]
}
},
@@ -113,6 +125,7 @@
"lib/ace/mode-javascript.js",
"lib/ace/mode-json.js",
"lib/ace/mode-css.js",
+ "lib/ace/mode-vue.js",
"lib/ace/mode-lua.js",
"lib/ace/ext-language_tools.js",
"lib/ace/ext-modelist.js"
diff --git a/i18n/ar.json b/i18n/ar.json
index 58df1b7..478bff2 100644
--- a/i18n/ar.json
+++ b/i18n/ar.json
@@ -1,6 +1,7 @@
{
"@metadata": {
"authors": [
+ "Mohammed Qays",
"SaldırganSincap",
"ديفيد",
"علاء",
@@ -9,7 +10,7 @@
},
"codeeditor-desc": "بناء على ذلك، أبرز التحرير لصفحات جافا سكريبت وCSS باستخدام [https://ace.c9.io/ محرر Ace]",
"codeeditor-next-annotation": "انتقل إلى التعليق التوضيحي التالي",
- "codeeditor-toolbar-toggle": "تبديل محرر الكود",
+ "codeeditor-toolbar-toggle": "تبديل محرر الأكواد",
"codeeditor-save-with-errors": "الملف يحتوي على أخطاء. هل أنت متأكد أنك تريد النشر؟",
"codeeditor-invisibleChars-toggle": "تبديل الأحرف غير المرئية",
"codeeditor-lineWrapping-toggle": "تبديل التفاف الخط",
diff --git a/i18n/az.json b/i18n/az.json
index 617621a..da50427 100644
--- a/i18n/az.json
+++ b/i18n/az.json
@@ -8,14 +8,14 @@
"codeeditor-desc": "[https://ace.c9.io/ Ace editor] istifadə edərək JavaScript and CSS səhifələri üçün sintaksis-rəngləndirici redaktor",
"codeeditor-next-annotation": "Növbəti annotasiyaya keç",
"codeeditor-toolbar-toggle": "Kod redaktorunu dəyişdir",
- "codeeditor-save-with-errors": "Sənəddə səhvlər var. Yayımlamaq istədiyinizə əminsiniz?",
+ "codeeditor-save-with-errors": "Kodda xətalar mövcuddur. Yayımlamaq istədiyinizə əminsiniz?",
"codeeditor-invisibleChars-toggle": "Görünməz simvolları dəyişdir",
"codeeditor-lineWrapping-toggle": "Sətir sürüşməsini dəyiş",
"codeeditor-searchReplace-toggle": "Axtarış və dəyişdirmə dialoqunu dəyiş",
"codeeditor-gotoline": "Sətirə get...",
"codeeditor-gotoline-placeholder": "sətir[:sütun]",
"codeeditor-gotoline-prompt": "Sətir nömrəsini daxil et",
- "codeeditor-indent": "Giriş",
+ "codeeditor-indent": "Abzas",
"codeeditor-outdent": "Çıxış",
"codeeditor-error-title": "Paket uğursuz oldu",
"codeeditor-error-message": "CodeEditor-un yüklənməsi üçün WikiEditor lazımdır."
diff --git a/i18n/en-gb.json b/i18n/en-gb.json
deleted file mode 100644
index afa2e76..0000000
--- a/i18n/en-gb.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "@metadata": {
- "authors": [
- "Piano1forte2"
- ]
- },
- "codeeditor-searchReplace-toggle": "Toggle search and replace dialogue"
-}
diff --git a/i18n/es.json b/i18n/es.json
index d812071..6516ac2 100644
--- a/i18n/es.json
+++ b/i18n/es.json
@@ -10,7 +10,7 @@
"codeeditor-desc": "Edición de páginas con resaltado de sintaxis para JavaScript y CSS, usando [https://ace.c9.io el editor Ace]",
"codeeditor-next-annotation": "Ir a la anotación siguiente",
"codeeditor-toolbar-toggle": "Activar o desactivar el editor de código",
- "codeeditor-save-with-errors": "El documento contiene errores. ¿Confirmas que quieres publicarlo?",
+ "codeeditor-save-with-errors": "El documento contiene errores. ¿{{#FORMAL:Confirmas|Confirma}} que {{#FORMAL:quieres|quiere}} publicarlo?",
"codeeditor-invisibleChars-toggle": "Mostrar u ocultar los caracteres invisibles",
"codeeditor-lineWrapping-toggle": "Activar o desactivar el ajuste de renglones",
"codeeditor-searchReplace-toggle": "Mostrar u ocultar el cuadro de buscar y reemplazar",
diff --git a/i18n/fi.json b/i18n/fi.json
index 9c641a6..43e7783 100644
--- a/i18n/fi.json
+++ b/i18n/fi.json
@@ -2,7 +2,8 @@
"@metadata": {
"authors": [
"01miki10",
- "Nike"
+ "Nike",
+ "Samoasambia"
]
},
"codeeditor-desc": "Lisää syntaksinkorostuksen JavaScript ja CSS-sivuille käyttäen [https://ace.c9.io/ Ace-muokkainta]",
@@ -17,5 +18,6 @@
"codeeditor-gotoline-prompt": "Syötä rivin numero",
"codeeditor-indent": "Sisennä",
"codeeditor-outdent": "Poista sisennys",
+ "codeeditor-error-title": "Riippuvuus epäonnistui",
"codeeditor-error-message": "CodeEditor tarvitsee WikiEditorin lataamisen."
}
diff --git a/i18n/fr.json b/i18n/fr.json
index 8302313..9aadcd8 100644
--- a/i18n/fr.json
+++ b/i18n/fr.json
@@ -14,7 +14,7 @@
"codeeditor-desc": "Coloration syntaxique lors de la modification de pages écrites en JavaScript et CSS, en utilisant l’[https://ace.c9.io/ éditeur Ace]",
"codeeditor-next-annotation": "Aller à la prochaine annotation",
"codeeditor-toolbar-toggle": "Activer / désactiver l’éditeur de code",
- "codeeditor-save-with-errors": "Le document contient des erreurs. Êtes-vous sûr{{GENDER:||e}} de vouloir le publier ?",
+ "codeeditor-save-with-errors": "Le document contient des erreurs. Êtes-vous {{GENDER:|sûr|sûre}} de vouloir le publier ?",
"codeeditor-invisibleChars-toggle": "Afficher / masquer les caractères invisibles",
"codeeditor-lineWrapping-toggle": "Activer / désactiver le repli de ligne",
"codeeditor-searchReplace-toggle": "Afficher / masquer l’outil de recherche et de remplacement",
diff --git a/i18n/id.json b/i18n/id.json
index 565dde3..5edd461 100644
--- a/i18n/id.json
+++ b/i18n/id.json
@@ -3,16 +3,17 @@
"authors": [
"Daud I.F. Argana",
"Farras",
- "William Surya Permana"
+ "William Surya Permana",
+ "Penyuwangi"
]
},
"codeeditor-desc": "Penyuntingan dengan penyorotan sintaks untuk halaman JavaScript dan CSS menggunakan [https://ace.c9.io/ penyunting Ace]",
"codeeditor-next-annotation": "Pergi ke anotasi berikutnya",
- "codeeditor-toolbar-toggle": "Aktifkan/Nonaktifkan penyunting kode",
+ "codeeditor-toolbar-toggle": "Nyalakan/Matikan penyunting kode",
"codeeditor-save-with-errors": "Dokumen mengandung galat. Apakah Anda yakin ingin menerbitkannya?",
- "codeeditor-invisibleChars-toggle": "Aktifkan/Nonaktifkan karakter tidak terlihat",
- "codeeditor-lineWrapping-toggle": "Aktifkan/Nonaktifkan pembungkusan baris",
- "codeeditor-searchReplace-toggle": "Aktifkan/Nonaktifkan dialog cari dan ganti",
+ "codeeditor-invisibleChars-toggle": "Nyalakan/Matikan karakter tak terlihat",
+ "codeeditor-lineWrapping-toggle": "Nyalakan/Matikan pembungkusan baris",
+ "codeeditor-searchReplace-toggle": "Nyalakan/Matikan dialog cari dan ganti",
"codeeditor-gotoline": "Pergi ke baris nomor...",
"codeeditor-gotoline-placeholder": "baris[:kolom]",
"codeeditor-gotoline-prompt": "Masukkan nomor baris",
diff --git a/i18n/lb.json b/i18n/lb.json
index 226eaba..07a58ff 100644
--- a/i18n/lb.json
+++ b/i18n/lb.json
@@ -1,14 +1,20 @@
{
"@metadata": {
"authors": [
- "Robby"
+ "Robby",
+ "Volvox"
]
},
"codeeditor-desc": "Ännere vu JavaScript an CSS-Säite mam [https://ace.c9.io/ Ace editor] deen d'Syntax faarweg duerstellt",
"codeeditor-next-annotation": "Op déi nächst Notiz goen",
"codeeditor-toolbar-toggle": "Editeur vum Code an- an ausschalten",
- "codeeditor-save-with-errors": "Et si Feeler am Dokument. Sidd Dir sécher datt dir e et späichere wëllt?",
- "codeeditor-gotoline": "Gitt op d'Linn mat der Nummer...",
+ "codeeditor-save-with-errors": "Et si Feeler am Dokument. Sidd Dir sécher, datt Dir et verëffentleche wëllt?",
+ "codeeditor-invisibleChars-toggle": "Onsiichtbar Zeechen ëmschalten",
+ "codeeditor-lineWrapping-toggle": "Zeilenëmbroch ëmschalten",
+ "codeeditor-searchReplace-toggle": "Sichen-an-Ersetzen-Dialog ëmschalten",
+ "codeeditor-gotoline": "Gitt op d'Zeil mat der Nummer…",
+ "codeeditor-gotoline-placeholder": "Zeil[:Kolonn]",
+ "codeeditor-gotoline-prompt": "Gitt eng Zeilennummer an",
"codeeditor-indent": "Eraréckelen",
"codeeditor-outdent": "Erausréckelen",
"codeeditor-error-title": "Ofhängegkeet feelgeschlo",
diff --git a/i18n/ps.json b/i18n/ps.json
new file mode 100644
index 0000000..f0d5ab2
--- /dev/null
+++ b/i18n/ps.json
@@ -0,0 +1,19 @@
+{
+ "@metadata": {
+ "authors": [
+ "شاه زمان پټان"
+ ]
+ },
+ "codeeditor-desc": "د جاوا سکريپټ او سياېساېس مخونو لپاره د [https://ace.c9.io/ ايس سمونگر] په کارولو سره د غونډلپوهې-روښانهشوی سمون کول",
+ "codeeditor-next-annotation": "راتلونکي څنگليک ته ورتلل",
+ "codeeditor-toolbar-toggle": "کوډ سمونگر بدلول",
+ "codeeditor-save-with-errors": "لاسوند تېروتنې لري. ايا تاسو ډاډه ياست چې خپور يې کړئ؟",
+ "codeeditor-invisibleChars-toggle": "نه ليدوړ لوښې بدلول",
+ "codeeditor-lineWrapping-toggle": "د کرښې نغاړل بدلول",
+ "codeeditor-gotoline": "د کرښې شمېرې ته ورتلل",
+ "codeeditor-gotoline-placeholder": "کرښه [:ستون]",
+ "codeeditor-gotoline-prompt": "کرښې شمېره وليکئ",
+ "codeeditor-indent": "دننکوږی",
+ "codeeditor-outdent": "بهرکوږی",
+ "codeeditor-error-message": "کوډسمونگر د ويکيسمونگر بارولو ته اړتيا لري."
+}
diff --git a/i18n/sh-latn.json b/i18n/sh-latn.json
index 135d9ec..78e9ab9 100644
--- a/i18n/sh-latn.json
+++ b/i18n/sh-latn.json
@@ -1,6 +1,7 @@
{
"@metadata": {
"authors": [
+ "Aca",
"Winston Sung"
]
},
@@ -13,7 +14,7 @@
"codeeditor-searchReplace-toggle": "Ukl/iskl. dijalog za pretragu i zamjenu",
"codeeditor-gotoline": "Idi na red broj...",
"codeeditor-gotoline-placeholder": "red[:kolona]",
- "codeeditor-gotoline-prompt": "Upišite broj reda",
+ "codeeditor-gotoline-prompt": "Unesite broj reda",
"codeeditor-indent": "Uvlaka",
"codeeditor-outdent": "Izvlaka",
"codeeditor-error-title": "Zavisnost nije uspjela",
diff --git a/i18n/sjd.json b/i18n/sjd.json
new file mode 100644
index 0000000..2696cc8
--- /dev/null
+++ b/i18n/sjd.json
@@ -0,0 +1,9 @@
+{
+ "@metadata": {
+ "authors": [
+ "Merrahtar"
+ ]
+ },
+ "codeeditor-toolbar-toggle": "Ко̄д воа̄йхэм режимм",
+ "codeeditor-save-with-errors": "Документэсьт ле̄в ся̄гкнэг. Та̄так то̄нн зоа̄бэль со̄н элмсаһтӭ?"
+}
diff --git a/i18n/sr-ec.json b/i18n/sr-ec.json
index 27fda71..8a60210 100644
--- a/i18n/sr-ec.json
+++ b/i18n/sr-ec.json
@@ -1,6 +1,7 @@
{
"@metadata": {
"authors": [
+ "Aca",
"BadDog",
"Kizule",
"Obsuser"
diff --git a/i18n/yue-hant.json b/i18n/yue-hant.json
new file mode 100644
index 0000000..90d316f
--- /dev/null
+++ b/i18n/yue-hant.json
@@ -0,0 +1,22 @@
+{
+ "@metadata": {
+ "authors": [
+ "JeffreyKim",
+ "Ktchankt"
+ ]
+ },
+ "codeeditor-desc": "用[https://ace.c9.io/Ace editor]嚟編輯JavaScript同CSS頁面嘅語法突顯",
+ "codeeditor-next-annotation": "去下一個註解",
+ "codeeditor-toolbar-toggle": "切換代碼編輯器",
+ "codeeditor-save-with-errors": "呢份文件包含啲錯誤。 你肯定你想發佈?",
+ "codeeditor-invisibleChars-toggle": "切換隱形字元",
+ "codeeditor-lineWrapping-toggle": "切換線條包裝",
+ "codeeditor-searchReplace-toggle": "切換搜尋同替換對話框",
+ "codeeditor-gotoline": "去行嘅冧巴 ...",
+ "codeeditor-gotoline-placeholder": "行[:欄]",
+ "codeeditor-gotoline-prompt": "輸入一個行嘅冧巴",
+ "codeeditor-indent": "縮排",
+ "codeeditor-outdent": "過時",
+ "codeeditor-error-title": "依賴失敗咗",
+ "codeeditor-error-message": "代碼編輯器需要加載維基編輯器。"
+}
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 4ec1a6a..35c650d 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -2,8 +2,11 @@
namespace MediaWiki\Extension\CodeEditor;
-use ErrorPageError;
+use MediaWiki\Config\Config;
+use MediaWiki\Context\RequestContext;
use MediaWiki\EditPage\EditPage;
+use MediaWiki\Exception\ErrorPageError;
+use MediaWiki\Extension\BetaFeatures\BetaFeatures;
use MediaWiki\Extension\CodeEditor\Hooks\HookRunner;
use MediaWiki\Hook\EditPage__showEditForm_initialHook;
use MediaWiki\Hook\EditPage__showReadOnlyForm_initialHook;
@@ -15,23 +18,21 @@
use MediaWiki\User\Options\UserOptionsLookup;
use MediaWiki\User\User;
-/**
- * @phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
- */
class Hooks implements
GetPreferencesHook,
EditPage__showEditForm_initialHook,
EditPage__showReadOnlyForm_initialHook
{
- private UserOptionsLookup $userOptionsLookup;
- private HookRunner $hookRunner;
+ private readonly HookRunner $hookRunner;
+ private readonly array $enabledModes;
public function __construct(
- UserOptionsLookup $userOptionsLookup,
- HookContainer $hookContainer
+ private readonly UserOptionsLookup $userOptionsLookup,
+ HookContainer $hookContainer,
+ Config $config,
) {
- $this->userOptionsLookup = $userOptionsLookup;
$this->hookRunner = new HookRunner( $hookContainer );
+ $this->enabledModes = $config->get( 'CodeEditorEnabledModes' );
}
private function getPageLanguage( Title $title, string $model, string $format ): ?string {
@@ -41,6 +42,8 @@ private function getPageLanguage( Title $title, string $model, string $format ):
return 'css';
} elseif ( $model === CONTENT_MODEL_JSON ) {
return 'json';
+ } elseif ( $model === CONTENT_MODEL_VUE ) {
+ return 'vue';
}
// Give extensions a chance
@@ -67,11 +70,20 @@ public function onGetPreferences( $user, &$defaultPreferences ) {
* @throws ErrorPageError
*/
public function onEditPage__showEditForm_initial( $editpage, $output ) {
- $title = $editpage->getContextTitle();
$model = $editpage->contentModel;
+ $title = $editpage->getContextTitle();
$format = $editpage->contentFormat;
-
$lang = $this->getPageLanguage( $title, $model, $format );
+
+ if ( $lang &&
+ // @phan-suppress-next-line PhanAccessReadOnlyProperty
+ isset( $this->enabledModes[$lang] ) &&
+ $this->enabledModes[$lang] === false &&
+ self::tempIsCodeMirrorEnabled()
+ ) {
+ return;
+ }
+
if ( $lang && $this->userOptionsLookup->getOption( $output->getUser(), 'usebetatoolbar' ) ) {
$output->addModules( 'ext.codeEditor' );
$output->addModuleStyles( 'ext.codeEditor.styles' );
@@ -95,4 +107,33 @@ public function onEditPage__showEditForm_initial( $editpage, $output ) {
public function onEditPage__showReadOnlyForm_initial( $editpage, $output ) {
$this->onEditPage__showEditForm_initial( $editpage, $output );
}
+
+ /**
+ * Temporary code while CodeMirror is still in beta. This should be checked
+ * against in every CodeEditorGetPageLanguageHook implementation where the
+ * extension has CodeMirror integration (via the CodeMirrorGetMode hook).
+ *
+ * In such cases, we want to fallback to using CodeEditor.
+ * Set $wgCodeEditorEnabledModes for the content model to false if you
+ * do not want to use CodeEditor or CodeMirror for that mode.
+ *
+ * See T373711#11018957
+ *
+ * @return bool
+ */
+ public static function tempIsCodeMirrorEnabled(): bool {
+ $extensionRegistry = ExtensionRegistry::getInstance();
+ $requestContext = RequestContext::getMain();
+ return $extensionRegistry->isLoaded( 'CodeMirror' ) && (
+ // $wgCodeMirrorV6 is explicitly set
+ $requestContext->getConfig()->get( 'CodeMirrorV6' ) ||
+ // ?cm6enable=1 URL parameter is set
+ $requestContext->getRequest()->getBool( 'cm6enable' ) ||
+ // Beta feature is enabled for the user
+ (
+ $extensionRegistry->isLoaded( 'BetaFeatures' ) &&
+ BetaFeatures::isFeatureEnabled( $requestContext->getUser(), 'codemirror-beta-feature-enable' )
+ )
+ );
+ }
}
diff --git a/includes/Hooks/CodeEditorGetPageLanguageHook.php b/includes/Hooks/CodeEditorGetPageLanguageHook.php
index dc894e8..6fad4f9 100644
--- a/includes/Hooks/CodeEditorGetPageLanguageHook.php
+++ b/includes/Hooks/CodeEditorGetPageLanguageHook.php
@@ -15,6 +15,10 @@ interface CodeEditorGetPageLanguageHook {
/**
* Allows to set a code language for extensions content models
*
+ * As of MW 1.45, implementations of this interface should check
+ * Hooks::tempIsCodeMirrorBetaFeatureEnabled() if the extension
+ * also has integration with CodeMirror.
+ *
* @param Title $title The title the language is for
* @param string|null &$lang The language to use
* @param string $model The content model of the title
diff --git a/includes/Hooks/HookRunner.php b/includes/Hooks/HookRunner.php
index a4bddb7..4e8b24b 100644
--- a/includes/Hooks/HookRunner.php
+++ b/includes/Hooks/HookRunner.php
@@ -12,10 +12,9 @@
class HookRunner implements
CodeEditorGetPageLanguageHook
{
- private HookContainer $hookContainer;
-
- public function __construct( HookContainer $hookContainer ) {
- $this->hookContainer = $hookContainer;
+ public function __construct(
+ private readonly HookContainer $hookContainer,
+ ) {
}
/**
diff --git a/modules/.eslintrc.json b/modules/.eslintrc.json
index 60d8f2d..4374deb 100644
--- a/modules/.eslintrc.json
+++ b/modules/.eslintrc.json
@@ -1,13 +1,11 @@
{
"root": true,
"extends": [
- "wikimedia/client-es5",
+ "wikimedia/client",
"wikimedia/jquery",
"wikimedia/mediawiki"
],
"rules": {
- "max-len": "off",
- "no-jquery/no-extend": "warn",
- "es-x/no-object-assign": "warn"
+ "max-len": "off"
}
}
diff --git a/modules/ext.codeEditor.js b/modules/ext.codeEditor.js
index 4bb450e..13c310f 100644
--- a/modules/ext.codeEditor.js
+++ b/modules/ext.codeEditor.js
@@ -19,9 +19,9 @@
* JavaScript for WikiEditor Table of Contents
*/
-$( function () {
+$( () => {
// eslint-disable-next-line no-jquery/no-global-selector
- var $wpTextbox1 = $( '#wpTextbox1' );
+ const $wpTextbox1 = $( '#wpTextbox1' );
// Code is supposed to be always LTR. See bug 39364.
$wpTextbox1.parent().prop( 'dir', 'ltr' );
@@ -29,7 +29,7 @@ $( function () {
// Add code editor module
$wpTextbox1.wikiEditor( 'addModule', 'codeEditor' );
- $wpTextbox1.on( 'wikiEditor-toolbar-doneInitialSections', function () {
+ $wpTextbox1.on( 'wikiEditor-toolbar-doneInitialSections', () => {
$wpTextbox1.data( 'wikiEditor-context' ).fn.codeEditorMonitorFragment();
} );
} );
diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index 0dcc87f..8d1e9cc 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -34,17 +34,16 @@
};
$.wikiEditor.extensions.codeEditor = function ( context ) {
- var saveAndExtend,
- textSelectionFn,
- hasErrorsOnSave = false,
+ let hasErrorsOnSave = false,
selectedLine = 0,
- returnFalse = function () {
+ textSelectionFn = null;
+ const returnFalse = function () {
return false;
},
api = new mw.Api();
// Initialize state
- var cookieEnabled = parseInt( mw.cookie.get( 'codeEditor-' + context.instance + '-showInvisibleChars' ), 10 );
+ let cookieEnabled = parseInt( mw.cookie.get( 'codeEditor-' + context.instance + '-showInvisibleChars' ), 10 );
context.showInvisibleChars = ( cookieEnabled === 1 );
cookieEnabled = parseInt( mw.cookie.get( 'codeEditor-' + context.instance + '-lineWrappingActive' ), 10 );
context.lineWrappingActive = ( cookieEnabled === 1 );
@@ -66,11 +65,11 @@
paste: returnFalse,
ready: returnFalse,
codeEditorSubmit: function () {
- var form = this;
+ const form = this;
context.evt.codeEditorSync();
if ( hasErrorsOnSave ) {
hasErrorsOnSave = false;
- OO.ui.confirm( mw.msg( 'codeeditor-save-with-errors' ) ).done( function ( confirmed ) {
+ OO.ui.confirm( mw.msg( 'codeeditor-save-with-errors' ) ).then( ( confirmed ) => {
if ( confirmed ) {
// Programmatic submit doesn't retrigger this event listener
form.submit();
@@ -81,9 +80,7 @@
return true;
},
codeEditorSave: function () {
- if ( context.codeEditor.getSession().getAnnotations().some( function ( ann ) {
- return ann.type === 'error';
- } ) ) {
+ if ( context.codeEditor.getSession().getAnnotations().some( ( ann ) => ann.type === 'error' ) ) {
hasErrorsOnSave = true;
}
},
@@ -118,14 +115,14 @@
aceGotoLineColumn: function () {
OO.ui.prompt( mw.msg( 'codeeditor-gotoline-prompt' ), {
textInput: { placeholder: mw.msg( 'codeeditor-gotoline-placeholder' ) }
- } ).done( function ( result ) {
+ } ).then( ( result ) => {
if ( !result ) {
return;
}
- var matches = result.split( ':' );
- var line = 0;
- var column = 0;
+ const matches = result.split( ':' );
+ let line = 0;
+ let column = 0;
if ( matches.length > 0 ) {
line = +matches[ 0 ];
@@ -148,7 +145,7 @@
} );
},
setupCodeEditorToolbar: function () {
- var toggleEditor = function ( ctx ) {
+ const toggleEditor = function ( ctx ) {
ctx.codeEditorActive = !ctx.codeEditorActive;
ctx.fn.setCodeEditorPreference( ctx.codeEditorActive );
@@ -161,7 +158,7 @@
ctx.fn.disableCodeEditor();
}
};
- var toggleInvisibleChars = function ( ctx ) {
+ const toggleInvisibleChars = function ( ctx ) {
ctx.showInvisibleChars = !ctx.showInvisibleChars;
ctx.fn.changeCookieValue( 'showInvisibleChars', ctx.showInvisibleChars ? 1 : 0 );
@@ -169,8 +166,8 @@
ctx.codeEditor.setShowInvisibles( ctx.showInvisibleChars );
};
- var toggleSearchReplace = function ( ctx ) {
- var searchBox = ctx.codeEditor.searchBox;
+ const toggleSearchReplace = function ( ctx ) {
+ const searchBox = ctx.codeEditor.searchBox;
if ( searchBox && $( searchBox.element ).css( 'display' ) !== 'none' ) {
searchBox.hide();
} else {
@@ -179,7 +176,7 @@
);
}
};
- var toggleLineWrapping = function ( ctx ) {
+ const toggleLineWrapping = function ( ctx ) {
ctx.lineWrappingActive = !ctx.lineWrappingActive;
ctx.fn.changeCookieValue( 'lineWrappingActive', ctx.lineWrappingActive ? 1 : 0 );
@@ -187,13 +184,13 @@
ctx.codeEditor.getSession().setUseWrapMode( ctx.lineWrappingActive );
};
- var indent = function ( ctx ) {
+ const indent = function ( ctx ) {
ctx.codeEditor.execCommand( 'indent' );
};
- var outdent = function ( ctx ) {
+ const outdent = function ( ctx ) {
ctx.codeEditor.execCommand( 'outdent' );
};
- var gotoLine = function ( ctx ) {
+ const gotoLine = function ( ctx ) {
ctx.codeEditor.execCommand( 'gotolinecolumn' );
};
@@ -286,7 +283,7 @@
$( '.group-codeeditor-main' ).prependTo( '.section-main' );
},
updateButtonIcon: function ( targetName, iconFn ) {
- var target = '.tool[rel=' + targetName + ']',
+ const target = '.tool[rel=' + targetName + ']',
$button = context.modules.toolbar.$toolbar.find( target );
$button.data( 'setActive' )( iconFn() );
@@ -305,7 +302,7 @@
api.abort();
api.saveOption( 'usecodeeditor', prefValue ? 1 : 0 )
- .fail( function ( code, result ) {
+ .catch( ( code, result ) => {
if ( code === 'http' && result.textStatus === 'abort' ) {
// Request was aborted. Ignore error
return;
@@ -315,7 +312,7 @@
return;
}
- var message = 'Failed to set code editor preference: ' + code;
+ let message = 'Failed to set code editor preference: ' + code;
if ( result.error && result.error.info ) {
message += '\n' + result.error.info;
}
@@ -326,9 +323,9 @@
* Sets up the iframe in place of the textarea to allow more advanced operations
*/
setupCodeEditor: function () {
- var $box = context.$textarea;
- var lang = mw.config.get( 'wgCodeEditorCurrentLanguage' );
- var basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
+ const $box = context.$textarea;
+ let lang = mw.config.get( 'wgCodeEditorCurrentLanguage' );
+ let basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
if ( basePath.slice( 0, 2 ) === '//' ) {
// ACE uses web workers, which have importScripts, which don't like relative links.
// This is a problem only when the assets are on another server, so this rewrite should suffice
@@ -342,8 +339,8 @@
// We'll stub this out to sit on top of it...
// line-height is needed to compensate for oddity in WikiEditor extension, which zeroes the line-height on a parent container
// eslint-disable-next-line no-jquery/no-parse-html-literal
- var container = context.$codeEditorContainer = $( '
' ).insertAfter( $box );
- var editdiv = container.find( '.editor' );
+ const container = context.$codeEditorContainer = $( '' ).insertAfter( $box );
+ const editdiv = container.find( '.editor' );
$box.css( 'display', 'none' );
container.height( $box.height() );
@@ -366,8 +363,8 @@
context.codeEditor.setReadOnly( $box.prop( 'readonly' ) );
context.codeEditor.setShowInvisibles( context.showInvisibleChars );
- var htmlClasses = document.documentElement.classList;
- var inDarkMode = htmlClasses.contains( 'skin-theme-clientpref-night' ) || (
+ const htmlClasses = document.documentElement.classList;
+ const inDarkMode = htmlClasses.contains( 'skin-theme-clientpref-night' ) || (
htmlClasses.contains( 'skin-theme-clientpref-os' ) &&
window.matchMedia && window.matchMedia( '(prefers-color-scheme: dark)' ).matches
);
@@ -375,6 +372,7 @@
// The options to enable
context.codeEditor.setOptions( {
enableBasicAutocompletion: true,
+ enableLiveAutocompletion: true,
enableSnippets: true,
theme: inDarkMode ? 'ace/theme/monokai' : 'ace/theme/textmate'
} );
@@ -390,16 +388,16 @@
.on( 'submit', context.evt.codeEditorSubmit )
.find( '#wpSave' ).on( 'click', context.evt.codeEditorSave );
- var session = context.codeEditor.getSession();
+ const session = context.codeEditor.getSession();
// Use proper tabs
session.setUseSoftTabs( false );
session.setUseWrapMode( context.lineWrappingActive );
// Configure any workers
- session.on( 'changeMode', function ( e, session2 ) {
+ session.on( 'changeMode', ( e, session2 ) => {
// eslint-disable-next-line no-jquery/variable-pattern
- var mode = session2.getMode().$id;
+ const mode = session2.getMode().$id;
if ( mode === 'ace/mode/javascript' ) {
session2.$worker.send( 'changeOptions', [ {
maxerr: 1000,
@@ -411,11 +409,11 @@
mw.hook( 'codeEditor.configure' ).fire( session );
// Add an Ace change handler to pass changes to Edit Recovery.
- mw.hook( 'editRecovery.loadEnd' ).add( function ( data ) {
+ mw.hook( 'editRecovery.loadEnd' ).add( ( data ) => {
session.on( 'change', data.fieldChangeHandler );
} );
- ace.config.loadModule( 'ace/ext/modelist', function ( modelist ) {
+ ace.config.loadModule( 'ace/ext/modelist', ( modelist ) => {
if ( !modelist || !modelist.modesByName[ lang ] ) {
lang = 'text';
}
@@ -486,8 +484,8 @@
*/
codeEditorMonitorFragment: function () {
function onHashChange() {
- var regexp = /#mw-ce-l(\d+)/;
- var result = regexp.exec( window.location.hash );
+ const regexp = /#mw-ce-l(\d+)/;
+ const result = regexp.exec( window.location.hash );
if ( result === null ) {
return;
@@ -511,12 +509,11 @@
* the position of the cursor.
*/
setupStatusBar: function () {
- var shouldUpdateAnnotations,
+ let shouldUpdateAnnotations,
shouldUpdateSelection,
shouldUpdateLineInfo,
- nextAnnotation,
- delayedUpdate,
- editor = context.codeEditor,
+ nextAnnotation;
+ const editor = context.codeEditor,
lang = ace.require( 'ace/lib/lang' ),
$errors = $( '' ).addClass( 'codeEditor-status-worker-cell ace_gutter-cell ace_error' ).text( '0' ),
$warnings = $( '' ).addClass( 'codeEditor-status-worker-cell ace_gutter-cell ace_warning' ).text( '0' ),
@@ -547,21 +544,21 @@
* Update all the information in the status bar
*/
function updateStatusBar() {
- var errors = 0,
+ let errors = 0,
warnings = 0,
infos = 0,
distance,
shortestDistance = Infinity,
closestAnnotation,
- currentLine = editor.selection.lead.row,
- annotations = editor.getSession().getAnnotations(),
closestType;
+ const currentLine = editor.selection.lead.row,
+ annotations = editor.getSession().getAnnotations();
// Reset the next annotation
nextAnnotation = null;
- for ( var i = 0; i < annotations.length; i++ ) {
- var annotation = annotations[ i ];
+ for ( let i = 0; i < annotations.length; i++ ) {
+ const annotation = annotations[ i ];
distance = Math.abs( currentLine - annotation.row );
if ( distance < shortestDistance ) {
@@ -615,7 +612,7 @@
// The cursor position has changed
if ( shouldUpdateSelection || shouldUpdateLineInfo ) {
// Adapted from Ajax.org's ace/ext/statusbar module
- var status = [];
+ const status = [];
if ( editor.$vimModeHandler ) {
addToStatus( status, editor.$vimModeHandler.getStatusText() );
@@ -623,10 +620,10 @@
addToStatus( status, 'REC' );
}
- var c = editor.selection.lead;
+ const c = editor.selection.lead;
addToStatus( status, ( c.row + 1 ) + ':' + c.column, '' );
if ( !editor.selection.isEmpty() ) {
- var r = editor.getSelectionRange();
+ const r = editor.getSelectionRange();
addToStatus( status, '(' + ( r.end.row - r.start.row ) + ':' + ( r.end.column - r.start.column ) + ')' );
}
status.pop();
@@ -637,14 +634,14 @@
}
// Function to delay/debounce updates for the StatusBar
- delayedUpdate = lang.delayedCall( function () {
+ const delayedUpdate = lang.delayedCall( () => {
updateStatusBar( editor );
} );
/**
* Click handler that allows you to skip to the next annotation
*/
- $workerStatus.on( 'click', function ( e ) {
+ $workerStatus.on( 'click', ( e ) => {
if ( nextAnnotation ) {
context.codeEditor.navigateTo( nextAnnotation.row, nextAnnotation.column );
// Scroll up a bit to give some context
@@ -653,15 +650,15 @@
}
} );
- editor.getSession().on( 'changeAnnotation', function () {
+ editor.getSession().on( 'changeAnnotation', () => {
shouldUpdateAnnotations = true;
delayedUpdate.schedule( 100 );
} );
- editor.on( 'changeStatus', function () {
+ editor.on( 'changeStatus', () => {
shouldUpdateLineInfo = true;
delayedUpdate.schedule( 100 );
} );
- editor.on( 'changeSelection', function () {
+ editor.on( 'changeSelection', () => {
shouldUpdateSelection = true;
delayedUpdate.schedule( 100 );
} );
@@ -670,7 +667,7 @@
shouldUpdateLineInfo = shouldUpdateSelection = shouldUpdateAnnotations = true;
updateStatusBar( editor );
- context.$statusBar.insertAfter( $( '.wikiEditor-ui-view-wikitext .wikiEditor-ui-bottom' ) );
+ context.$statusBar.insertAfter( context.$ui.find( '.wikiEditor-ui-bottom' ) );
},
removeStatusBar: function () {
context.codeEditor.getSession().removeListener( 'changeAnnotation' );
@@ -691,11 +688,11 @@
* @param {Object} base
* @param {Object} extended
*/
- saveAndExtend = function ( base, extended ) {
+ const saveAndExtend = function ( base, extended ) {
// eslint-disable-next-line no-jquery/no-map-util
- $.map( extended, function ( func, name ) {
+ $.map( extended, ( func, name ) => {
if ( name in base ) {
- var orig = base[ name ];
+ const orig = base[ name ];
base[ name ] = function () {
if ( context.codeEditorActive ) {
return func.apply( this, arguments );
@@ -740,6 +737,7 @@
setContents: function ( newContents ) {
context.codeEditor.getSession().setValue( newContents );
+ return context.$textarea;
},
/**
@@ -757,9 +755,11 @@
* DO NOT CALL THIS DIRECTLY, use $.textSelection( 'functionname', options ) instead
*
* @param {string} text
+ * @return {jQuery}
*/
replaceSelection: function ( text ) {
context.codeEditor.insert( text );
+ return context.$textarea;
},
/**
@@ -772,10 +772,10 @@
*/
encapsulateSelection: function ( options ) {
// Does not yet handle 'ownline', 'splitlines' option
- var sel = context.codeEditor.getSelection();
- var range = sel.getRange();
- var selText = textSelectionFn.getSelection();
- var isSample = false;
+ const sel = context.codeEditor.getSelection();
+ const range = sel.getRange();
+ let selText = textSelectionFn.getSelection();
+ let isSample = false;
if ( !selText ) {
selText = options.peri;
@@ -784,7 +784,7 @@
selText = options.peri;
}
- var text = options.pre;
+ let text = options.pre;
text += selText;
text += options.post;
context.codeEditor.insert( text );
@@ -807,13 +807,13 @@
* end of the selection, else returns only the start of the selection as a single number.
*/
getCaretPosition: function ( options ) {
- var selection = context.codeEditor.getSelection(),
+ const selection = context.codeEditor.getSelection(),
range = selection.getRange(),
doc = context.codeEditor.getSession().getDocument(),
startOffset = doc.positionToIndex( range.start );
if ( options.startAndEnd ) {
- var endOffset = doc.positionToIndex( range.end );
+ const endOffset = doc.positionToIndex( range.end );
return [ startOffset, endOffset ];
}
@@ -830,11 +830,11 @@
setSelection: function ( options ) {
// Ace stores positions for ranges as row/column pairs.
// To convert from character offsets, we'll need to iterate through the document
- var doc = context.codeEditor.getSession().getDocument();
- var lines = doc.getAllLines();
+ const doc = context.codeEditor.getSession().getDocument();
+ const lines = doc.getAllLines();
- var offsetToPos = function ( offset ) {
- var row, col, pos;
+ const offsetToPos = function ( offset ) {
+ let row, col, pos;
row = 0;
col = 0;
@@ -848,11 +848,11 @@
col = offset - pos;
return { row: row, column: col };
};
- var start = offsetToPos( options.start );
- var end = offsetToPos( options.end );
+ const start = offsetToPos( options.start );
+ const end = offsetToPos( options.end );
- var sel = context.codeEditor.getSelection();
- var range = sel.getRange();
+ const sel = context.codeEditor.getSelection();
+ const range = sel.getRange();
range.setStart( start.row, start.column );
range.setEnd( end.row, end.column );
sel.setSelectionRange( range );
diff --git a/modules/lib/ace/CHANGELOG.md b/modules/lib/ace/CHANGELOG.md
index bef1df7..243a747 100644
--- a/modules/lib/ace/CHANGELOG.md
+++ b/modules/lib/ace/CHANGELOG.md
@@ -2,6 +2,254 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+### [1.39.1](https://github.com/ajaxorg/ace/compare/v1.39.0...v1.39.1) (2025-03-20)
+
+
+### Features
+
+* Editing is disabled tooltip in readonly mode ([#5771](https://github.com/ajaxorg/ace/issues/5771)) ([1098e53](https://github.com/ajaxorg/ace/commit/1098e5306fdc02e873cdadc85d2e13228abfe80c))
+
+
+### Bug Fixes
+
+* Fix is check in xml FoldMode ([#5752](https://github.com/ajaxorg/ace/issues/5752)) ([810c465](https://github.com/ajaxorg/ace/commit/810c4650288d32b119239f7731a3b3be0c25376c))
+* replace NodeList.foreach with for loop ([#5769](https://github.com/ajaxorg/ace/issues/5769)) ([b3de3c1](https://github.com/ajaxorg/ace/commit/b3de3c1d99540bd94df122cedb7c5e3a792986a7))
+* updateDocTooltip with undefined this.completions ([#5754](https://github.com/ajaxorg/ace/issues/5754)) ([adde072](https://github.com/ajaxorg/ace/commit/adde072dd4810aa8f99bb1e16a6ab7dfc81a6e9d))
+* wrong java keywords ([#5759](https://github.com/ajaxorg/ace/issues/5759)) ([6b4c7a0](https://github.com/ajaxorg/ace/commit/6b4c7a09d844a2e16d664d3e9fbb384b543bcfcb))
+
+## [1.39.0](https://github.com/ajaxorg/ace/compare/v1.38.0...v1.39.0) (2025-02-21)
+
+
+### Features
+
+* Multiline Search Support: line breaks `\n` ([#5675](https://github.com/ajaxorg/ace/issues/5675)) ([06d51b9](https://github.com/ajaxorg/ace/commit/06d51b9164dc9dc39fbd6df26b7132f4b9580a4c))
+
+
+### Bug Fixes
+
+* check if row is present when setting aria label of popup elements ([#5750](https://github.com/ajaxorg/ace/issues/5750)) ([ff16482](https://github.com/ajaxorg/ace/commit/ff16482101965fc4fce488a61a3cd0f9454d8e87))
+* gutter hover tooltip a11y improvements ([#5747](https://github.com/ajaxorg/ace/issues/5747)) ([fbe3ddc](https://github.com/ajaxorg/ace/commit/fbe3ddccb1248c9f8f4a6524d2ded7235d225b41))
+* narrowing platform to be either win or mac ([#5707](https://github.com/ajaxorg/ace/issues/5707)) ([18cc336](https://github.com/ajaxorg/ace/commit/18cc336187519107f47bb15e989008f48f0b1563))
+* set score completion item when skipfilter true ([#5749](https://github.com/ajaxorg/ace/issues/5749)) ([a27e1e8](https://github.com/ajaxorg/ace/commit/a27e1e8a5d3d912b3b554cd2b5916b58750e8e71))
+
+## [1.38.0](https://github.com/ajaxorg/ace/compare/v1.37.5...v1.38.0) (2025-02-12)
+
+
+### Features
+
+* **popup:** add supporting skipFilter flag for popup item ([#5740](https://github.com/ajaxorg/ace/issues/5740)) ([0db7585](https://github.com/ajaxorg/ace/commit/0db7585ae0ccbd353091426f60ac3d9e53e182c4))
+
+
+### Bug Fixes
+
+* **AcePopup:** fix aria-posinset issue on google chrome ([#5719](https://github.com/ajaxorg/ace/issues/5719)) ([09a0c5a](https://github.com/ajaxorg/ace/commit/09a0c5a11106754916a4fc324a35e8daf84055ba))
+* calling setMode just before destroy causes error reading getLength ([#5727](https://github.com/ajaxorg/ace/issues/5727)) ([62b973e](https://github.com/ajaxorg/ace/commit/62b973ef2247debdd51cf6a41a3b24b97277efdb))
+* highlight indent guides with wrapped lines ([#5621](https://github.com/ajaxorg/ace/issues/5621)) ([77b9fe1](https://github.com/ajaxorg/ace/commit/77b9fe1bc0b10b4c3fb2780d65f9d256d60634ce))
+* improve aria attributes of popup elements ([#5739](https://github.com/ajaxorg/ace/issues/5739)) ([09fba2e](https://github.com/ajaxorg/ace/commit/09fba2e7347cd499c979e53ec7a8d8ee1fd48918))
+* types for setTimeout/setInterval calls ([#5726](https://github.com/ajaxorg/ace/issues/5726)) ([9a76656](https://github.com/ajaxorg/ace/commit/9a76656acc9528a4a2e92a3b72c4d6598d3a0a8c))
+* **VirtualRenderer:** fix scrollbar overlap on autocompletion ([#5713](https://github.com/ajaxorg/ace/issues/5713)) ([5acea6d](https://github.com/ajaxorg/ace/commit/5acea6d9200f4ca0c8495350cda6e41e8351913f))
+* wrong type of paste event and missing types for themelist extension ([#5725](https://github.com/ajaxorg/ace/issues/5725)) ([a4b9d2d](https://github.com/ajaxorg/ace/commit/a4b9d2d91a2be841320030d93afde46ae723c8c3))
+
+### [1.37.5](https://github.com/ajaxorg/ace/compare/v1.37.4...v1.37.5) (2025-01-16)
+
+
+### Bug Fixes
+
+* update aria-roledescription gutter ([#5718](https://github.com/ajaxorg/ace/issues/5718)) ([7ae3a4c](https://github.com/ajaxorg/ace/commit/7ae3a4c5f6f6e9bd31ae491f1fcef71fc5ae62fa))
+
+### [1.37.4](https://github.com/ajaxorg/ace/compare/v1.37.3...v1.37.4) (2025-01-09)
+
+
+### Bug Fixes
+
+* Remove unnecesary `typeof` from type imports in declarations ([#5715](https://github.com/ajaxorg/ace/issues/5715)) ([2c8bf91](https://github.com/ajaxorg/ace/commit/2c8bf916d75b086b958c205896bc2adc1747d241))
+
+### [1.37.3](https://github.com/ajaxorg/ace/compare/v1.37.2...v1.37.3) (2025-01-07)
+
+### [1.37.2](https://github.com/ajaxorg/ace/compare/v1.37.1...v1.37.2) (2025-01-06)
+
+
+### Bug Fixes
+
+* fix return type of supportsFile modelist ([#5705](https://github.com/ajaxorg/ace/issues/5705)) ([de21d50](https://github.com/ajaxorg/ace/commit/de21d50656bd874e1626265b8853923cb8da7c8b))
+
+### [1.37.1](https://github.com/ajaxorg/ace/compare/v1.37.0...v1.37.1) (2024-12-20)
+
+
+### Bug Fixes
+
+* hide gutter tooltip event missing from editor signal ([#5701](https://github.com/ajaxorg/ace/issues/5701)) ([66a6736](https://github.com/ajaxorg/ace/commit/66a673643d5d128eaf59d4fb6e5907fa6fa68773))
+
+### [1.36.6](https://github.com/ajaxorg/ace/compare/v1.36.5...v1.36.6) (2024-12-17)
+
+
+### Bug Fixes
+
+* update contribuition guide to mandate test cases ([#5694](https://github.com/ajaxorg/ace/issues/5694)) ([e6533b3](https://github.com/ajaxorg/ace/commit/e6533b3972d5adbf5995646c44894466b3b7f40f))
+* wrong behaviour rules in modes ([#5682](https://github.com/ajaxorg/ace/issues/5682)) ([442680c](https://github.com/ajaxorg/ace/commit/442680c68e66531c2d5ac80d80444ed600262ec1))
+
+### [1.36.5](https://github.com/ajaxorg/ace/compare/v1.36.4...v1.36.5) (2024-11-14)
+
+
+### Features
+
+* exposing getter setter for widget manager created using line widgets ([#5673](https://github.com/ajaxorg/ace/issues/5673)) ([f5d0c19](https://github.com/ajaxorg/ace/commit/f5d0c196c69d06a9dda1bdeb379fa20ecbf75590))
+
+
+### Bug Fixes
+
+* vue-directives regex bug ([#5671](https://github.com/ajaxorg/ace/issues/5671)) ([5e1e524](https://github.com/ajaxorg/ace/commit/5e1e524d7ef04e13291b5a979fb4166e973e61f0))
+
+### [1.36.4](https://github.com/ajaxorg/ace/compare/v1.36.3...v1.36.4) (2024-11-04)
+
+
+### Bug Fixes
+
+* **a11y:** update aria-label of textinput on cursor move ([#5665](https://github.com/ajaxorg/ace/issues/5665)) ([6ff93a8](https://github.com/ajaxorg/ace/commit/6ff93a86fe8c4855789ee7e7c156f7b376c0f935))
+
+### [1.36.3](https://github.com/ajaxorg/ace/compare/v1.36.2...v1.36.3) (2024-10-21)
+
+
+### Bug Fixes
+
+* `readdirSync` options `recursive: true` was added only in NodeJs v20.1.0 ([#5645](https://github.com/ajaxorg/ace/issues/5645)) ([2953f72](https://github.com/ajaxorg/ace/commit/2953f72877a90691432373cfe9182e60ea9b2d8f))
+
+### [1.36.2](https://github.com/ajaxorg/ace/compare/v1.36.1...v1.36.2) (2024-08-30)
+
+
+### Bug Fixes
+
+* apply padding to right side multi-line markers ([#5636](https://github.com/ajaxorg/ace/issues/5636)) ([c7549aa](https://github.com/ajaxorg/ace/commit/c7549aa5d53fb62f134b31a44d09029ceee3c800))
+
+### [1.36.1](https://github.com/ajaxorg/ace/compare/v1.36.0...v1.36.1) (2024-08-29)
+
+
+### Bug Fixes
+
+* improve type getMarkerAtPosition markergroup ([#5631](https://github.com/ajaxorg/ace/issues/5631)) ([89bd40a](https://github.com/ajaxorg/ace/commit/89bd40a66a2f06fb8806f174e5559021540a5b1e))
+* update cloudeditor light colours ([#5633](https://github.com/ajaxorg/ace/issues/5633)) ([0e2813e](https://github.com/ajaxorg/ace/commit/0e2813ed9e858d9359c2a79f2a9255d675308ad1))
+
+## [1.36.0](https://github.com/ajaxorg/ace/compare/v1.35.5...v1.36.0) (2024-08-21)
+
+
+### Features
+
+* allow setting marker type for MarkerGroups ([#5630](https://github.com/ajaxorg/ace/issues/5630)) ([214df9c](https://github.com/ajaxorg/ace/commit/214df9cea8d729f3071f9c02889cba2b2e7051b3))
+* **forced-color:** do not adjust the forced colors for the editor ([#5624](https://github.com/ajaxorg/ace/issues/5624)) ([c8f9df8](https://github.com/ajaxorg/ace/commit/c8f9df84e70ee29e8e989966985bcea95a9bef9b))
+
+### [1.35.5](https://github.com/ajaxorg/ace/compare/v1.35.4...v1.35.5) (2024-08-20)
+
+### [1.35.4](https://github.com/ajaxorg/ace/compare/v1.35.3...v1.35.4) (2024-07-22)
+
+
+### Bug Fixes
+
+* move right of cursor tokens to end of ghost text. ([#5616](https://github.com/ajaxorg/ace/issues/5616)) ([063ef9b](https://github.com/ajaxorg/ace/commit/063ef9bbe0934dfe75d9b447e8a92b69bfa41a3a))
+
+### [1.35.3](https://github.com/ajaxorg/ace/compare/v1.35.2...v1.35.3) (2024-07-18)
+
+
+### Bug Fixes
+
+* ghost text rendering of empty lines ([#5615](https://github.com/ajaxorg/ace/issues/5615)) ([1ae0bdc](https://github.com/ajaxorg/ace/commit/1ae0bdcfb9da4078713d116e93a9c9a935a1258d))
+
+### [1.35.2](https://github.com/ajaxorg/ace/compare/v1.35.1...v1.35.2) (2024-07-01)
+
+### [1.35.1](https://github.com/ajaxorg/ace/compare/v1.35.0...v1.35.1) (2024-06-27)
+
+
+### Bug Fixes
+
+* explicitly construct Number from window zoom attribute ([#5600](https://github.com/ajaxorg/ace/issues/5600)) ([2591c36](https://github.com/ajaxorg/ace/commit/2591c36b9e768305a9f837bf74c828c2d8d76e05))
+* use dom builder for gutter tooltip and inline widget ([#5601](https://github.com/ajaxorg/ace/issues/5601)) ([e81a299](https://github.com/ajaxorg/ace/commit/e81a299a8be39a7245a334ebc844eaeac6864bb3))
+* workaround for safari rendering bug ([#5573](https://github.com/ajaxorg/ace/issues/5573)) ([f9a152f](https://github.com/ajaxorg/ace/commit/f9a152fd925a8a16b10c65c909201100486c71e8))
+* wrong doc comment * insert behaviour ([#5571](https://github.com/ajaxorg/ace/issues/5571)) ([16c95b3](https://github.com/ajaxorg/ace/commit/16c95b32197c0ec952e52be85d21269005875940))
+
+## [1.35.0](https://github.com/ajaxorg/ace/compare/v1.34.2...v1.35.0) (2024-06-11)
+
+
+### Features
+
+* allow '{n}' as placeholder for translated strings ([#5581](https://github.com/ajaxorg/ace/issues/5581)) ([2206024](https://github.com/ajaxorg/ace/commit/220602488b95748c74141d647e13114c7a4569fb))
+
+
+### Bug Fixes
+
+* allow setting the placeholder type for nls ([#5584](https://github.com/ajaxorg/ace/issues/5584)) ([3e2d50f](https://github.com/ajaxorg/ace/commit/3e2d50f5307e201c20825311585e1f612f1ff23c))
+* not closed generic state in case of left-shift operator ([#5572](https://github.com/ajaxorg/ace/issues/5572)) ([e5bea6f](https://github.com/ajaxorg/ace/commit/e5bea6f63290003ff3270d56dbf9610e8a3091a8))
+* wrong vue-directives regexp ([#5586](https://github.com/ajaxorg/ace/issues/5586)) ([5f89a33](https://github.com/ajaxorg/ace/commit/5f89a334e69640bb395e74ae86530217d08f141c))
+
+### [1.34.2](https://github.com/ajaxorg/ace/compare/v1.34.1...v1.34.2) (2024-05-27)
+
+### [1.34.1](https://github.com/ajaxorg/ace/compare/v1.34.0...v1.34.1) (2024-05-24)
+
+
+### Bug Fixes
+
+* always set aria-label to text input in a11y mode ([#5563](https://github.com/ajaxorg/ace/issues/5563)) ([00346fd](https://github.com/ajaxorg/ace/commit/00346fde824beabb69f677631ad52815665eaef4))
+* Folding for comments and different modes ([#5533](https://github.com/ajaxorg/ace/issues/5533)) ([f4d0e33](https://github.com/ajaxorg/ace/commit/f4d0e33dac270ce21df09a96a39f50e16d6354db))
+
+## [1.34.0](https://github.com/ajaxorg/ace/compare/v1.33.3...v1.34.0) (2024-05-22)
+
+
+### Features
+
+* allow users to add arialabel to text input ([#5560](https://github.com/ajaxorg/ace/issues/5560)) ([8d7dfb6](https://github.com/ajaxorg/ace/commit/8d7dfb69392960aba61def982f4bea8f3a5caa70))
+
+### [1.33.3](https://github.com/ajaxorg/ace/compare/v1.33.2...v1.33.3) (2024-05-21)
+
+
+### Bug Fixes
+
+* contrast completion meta contrast cloud editor themes ([#5558](https://github.com/ajaxorg/ace/issues/5558)) ([b8877f0](https://github.com/ajaxorg/ace/commit/b8877f0f725b3973961cb639127402c9f56609de))
+
+### [1.33.2](https://github.com/ajaxorg/ace/compare/v1.33.1...v1.33.2) (2024-05-13)
+
+
+### Bug Fixes
+
+* Add soft wrap for ghost text ([#5540](https://github.com/ajaxorg/ace/issues/5540)) ([6a26b27](https://github.com/ajaxorg/ace/commit/6a26b277d0050b38cd766e00f93be4b9f3170f68))
+* generator function's determination; wrong parameter highlighting ([#5538](https://github.com/ajaxorg/ace/issues/5538)) ([ceca6f7](https://github.com/ajaxorg/ace/commit/ceca6f7b38f6b3347988f17579ae6a2e758137dd))
+* incorrect spans style ([#5539](https://github.com/ajaxorg/ace/issues/5539)) ([65a7f38](https://github.com/ajaxorg/ace/commit/65a7f38713cffb729dab530711351c0a17c5801f))
+* not determined folding widgets for html tags ([#5548](https://github.com/ajaxorg/ace/issues/5548)) ([7a51992](https://github.com/ajaxorg/ace/commit/7a5199292f55dfa1a8ea8830ea1a9d98be097161))
+* wrong token type ([#5535](https://github.com/ajaxorg/ace/issues/5535)) ([4041489](https://github.com/ajaxorg/ace/commit/4041489bb38ffe609d5f9b43b4a7637e47fc4739))
+
+### [1.33.1](https://github.com/ajaxorg/ace/compare/v1.33.0...v1.33.1) (2024-04-23)
+
+
+### Bug Fixes
+
+* account for `this.popup` being potentially undefined in completion mousewheel listener ([#5537](https://github.com/ajaxorg/ace/issues/5537)) ([6c3a9a6](https://github.com/ajaxorg/ace/commit/6c3a9a66a7a0ab0dd493ad2c281c9dd343d5301f))
+
+## [1.33.0](https://github.com/ajaxorg/ace/compare/v1.32.9...v1.33.0) (2024-04-12)
+
+
+### Features
+
+* Make translation system key based and add annotation type to gutter icon aria labels ([#5524](https://github.com/ajaxorg/ace/issues/5524)) ([bb8256d](https://github.com/ajaxorg/ace/commit/bb8256d5a5b5e989e3fb1bb80f326b8564fbbc20))
+
+
+### Bug Fixes
+
+* Contrast is too low for searched items ([#5523](https://github.com/ajaxorg/ace/issues/5523)) ([507ae2f](https://github.com/ajaxorg/ace/commit/507ae2f872a2b2f1a14fdffbf6530f4046df44c0))
+
+### [1.32.9](https://github.com/ajaxorg/ace/compare/v1.32.8...v1.32.9) (2024-03-29)
+
+
+### Bug Fixes
+
+* apply class to autocomplete popup for no suggestions state ([#5522](https://github.com/ajaxorg/ace/issues/5522)) ([a66f861](https://github.com/ajaxorg/ace/commit/a66f8619953eecd85833d97715e479d3b211c4cd))
+
+### [1.32.8](https://github.com/ajaxorg/ace/compare/v1.32.7...v1.32.8) (2024-03-22)
+
+
+### Bug Fixes
+
+* allow completers to trigger on newline characters ([#5519](https://github.com/ajaxorg/ace/issues/5519)) ([6e870fd](https://github.com/ajaxorg/ace/commit/6e870fd08e06be47f9da971743d13b25c41f99c2))
+* don't detach completion popup while typing when prefix is empty ([#5517](https://github.com/ajaxorg/ace/issues/5517)) ([7937e53](https://github.com/ajaxorg/ace/commit/7937e53babb9b327902e9dab4b18c04a907883be))
+* scroll cursor line to top editor for long inline preview ([#5514](https://github.com/ajaxorg/ace/issues/5514)) ([529473b](https://github.com/ajaxorg/ace/commit/529473b6959d5f7a70ada1d20feb0c87b432f766))
+* SwiftHighlightRules exports ([#5516](https://github.com/ajaxorg/ace/issues/5516)) ([f493ab0](https://github.com/ajaxorg/ace/commit/f493ab03bb50fe089c927b7a50a4a327c8dcec4c))
+
### [1.32.7](https://github.com/ajaxorg/ace/compare/v1.32.6...v1.32.7) (2024-03-01)
diff --git a/modules/lib/ace/ace.js b/modules/lib/ace/ace.js
index e5321ac..6d55a0e 100644
--- a/modules/lib/ace/ace.js
+++ b/modules/lib/ace/ace.js
@@ -582,9 +582,7 @@ exports.getDocumentHead = function (doc) {
return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement;
};
exports.createElement = function (tag, ns) {
- return document.createElementNS ?
- document.createElementNS(ns || XHTML_NS, tag) :
- document.createElement(tag);
+ return document.createElementNS ? document.createElementNS(ns || XHTML_NS, tag) : document.createElement(tag);
};
exports.removeChildren = function (element) {
element.innerHTML = "";
@@ -965,10 +963,64 @@ ace.define("ace/lib/report_error",["require","exports","module"], function(requi
});
-ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error"], function(require, exports, module){"no use strict";
+ace.define("ace/lib/default_english_messages",["require","exports","module"], function(require, exports, module){var defaultEnglishMessages = {
+ "autocomplete.popup.aria-roledescription": "Autocomplete suggestions",
+ "autocomplete.popup.aria-label": "Autocomplete suggestions",
+ "autocomplete.popup.item.aria-roledescription": "item",
+ "autocomplete.loading": "Loading...",
+ "editor.scroller.aria-roledescription": "editor",
+ "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit",
+ "editor.gutter.aria-roledescription": "editor gutter",
+ "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit",
+ "error-marker.good-state": "Looks good!",
+ "prompt.recently-used": "Recently used",
+ "prompt.other-commands": "Other commands",
+ "prompt.no-matching-commands": "No matching commands",
+ "search-box.find.placeholder": "Search for",
+ "search-box.find-all.text": "All",
+ "search-box.replace.placeholder": "Replace with",
+ "search-box.replace-next.text": "Replace",
+ "search-box.replace-all.text": "All",
+ "search-box.toggle-replace.title": "Toggle Replace mode",
+ "search-box.toggle-regexp.title": "RegExp Search",
+ "search-box.toggle-case.title": "CaseSensitive Search",
+ "search-box.toggle-whole-word.title": "Whole Word Search",
+ "search-box.toggle-in-selection.title": "Search In Selection",
+ "search-box.search-counter": "$0 of $1",
+ "text-input.aria-roledescription": "editor",
+ "text-input.aria-label": "Cursor at row $0",
+ "gutter.code-folding.range.aria-label": "Toggle code folding, rows $0 through $1",
+ "gutter.code-folding.closed.aria-label": "Toggle code folding, rows $0 through $1",
+ "gutter.code-folding.open.aria-label": "Toggle code folding, row $0",
+ "gutter.code-folding.closed.title": "Unfold code",
+ "gutter.code-folding.open.title": "Fold code",
+ "gutter.annotation.aria-label.error": "Error, read annotations row $0",
+ "gutter.annotation.aria-label.warning": "Warning, read annotations row $0",
+ "gutter.annotation.aria-label.info": "Info, read annotations row $0",
+ "inline-fold.closed.title": "Unfold code",
+ "gutter-tooltip.aria-label.error.singular": "error",
+ "gutter-tooltip.aria-label.error.plural": "errors",
+ "gutter-tooltip.aria-label.warning.singular": "warning",
+ "gutter-tooltip.aria-label.warning.plural": "warnings",
+ "gutter-tooltip.aria-label.info.singular": "information message",
+ "gutter-tooltip.aria-label.info.plural": "information messages",
+ "gutter.annotation.aria-label.security": "Security finding, read annotations row $0",
+ "gutter.annotation.aria-label.hint": "Suggestion, read annotations row $0",
+ "gutter-tooltip.aria-label.security.singular": "security finding",
+ "gutter-tooltip.aria-label.security.plural": "security findings",
+ "gutter-tooltip.aria-label.hint.singular": "suggestion",
+ "gutter-tooltip.aria-label.hint.plural": "suggestions",
+ "editor.tooltip.disable-editing": "Editing is disabled"
+};
+exports.defaultEnglishMessages = defaultEnglishMessages;
+
+});
+
+ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"], function(require, exports, module){"no use strict";
var oop = require("./oop");
var EventEmitter = require("./event_emitter").EventEmitter;
var reportError = require("./report_error").reportError;
+var defaultEnglishMessages = require("./default_english_messages").defaultEnglishMessages;
var optionsProvider = {
setOptions: function (optList) {
Object.keys(optList).forEach(function (key) {
@@ -1021,9 +1073,12 @@ function warn(message) {
console.warn.apply(console, arguments);
}
var messages;
+var nlsPlaceholders;
var AppConfig = /** @class */ (function () {
function AppConfig() {
this.$defaultOptions = {};
+ messages = defaultEnglishMessages;
+ nlsPlaceholders = "dollarSigns";
}
AppConfig.prototype.defineOptions = function (obj, path, options) {
if (!obj.$options)
@@ -1068,20 +1123,33 @@ var AppConfig = /** @class */ (function () {
this.setDefaultValue(path, key, optionHash[key]);
}, this);
};
- AppConfig.prototype.setMessages = function (value) {
+ AppConfig.prototype.setMessages = function (value, options) {
messages = value;
+ if (options && options.placeholders) {
+ nlsPlaceholders = options.placeholders;
+ }
};
- AppConfig.prototype.nls = function (string, params) {
- if (messages && !messages[string]) {
- warn("No message found for '" + string + "' in the provided messages, falling back to default English message.");
+ AppConfig.prototype.nls = function (key, defaultString, params) {
+ if (!messages[key]) {
+ warn("No message found for the key '" + key + "' in messages with id " + messages.$id + ", trying to find a translation for the default string '" + defaultString + "'.");
+ if (!messages[defaultString]) {
+ warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message.");
+ }
}
- var translated = messages && messages[string] || string;
+ var translated = messages[key] || messages[defaultString] || defaultString;
if (params) {
- translated = translated.replace(/\$(\$|[\d]+)/g, function (_, name) {
- if (name == "$")
- return "$";
- return params[name];
- });
+ if (nlsPlaceholders === "dollarSigns") {
+ translated = translated.replace(/\$(\$|[\d]+)/g, function (_, dollarMatch) {
+ if (dollarMatch == "$")
+ return "$";
+ return params[dollarMatch];
+ });
+ }
+ if (nlsPlaceholders === "curlyBrackets") {
+ translated = translated.replace(/\{([^\}]+)\}/g, function (_, curlyBracketMatch) {
+ return params[curlyBracketMatch];
+ });
+ }
}
return translated;
};
@@ -1253,7 +1321,7 @@ var reportErrorIfPathIsNotConfigured = function () {
reportErrorIfPathIsNotConfigured = function () { };
}
};
-exports.version = "1.32.7";
+exports.version = "1.39.1";
});
@@ -1565,132 +1633,133 @@ exports.Range = Range;
});
-ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"], function(require, exports, module){/*! @license
-==========================================================================
-SproutCore -- JavaScript Application Framework
-copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.
-
-For more information about SproutCore, visit http://www.sproutcore.com
-
-
-==========================================================================
-@license */
-"use strict";
+ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"], function(require, exports, module){"use strict";
var oop = require("./oop");
-var Keys = (function () {
- var ret = {
- MODIFIER_KEYS: {
- 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta',
- 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu'
- },
- KEY_MODS: {
- "ctrl": 1, "alt": 2, "option": 2, "shift": 4,
- "super": 8, "meta": 8, "command": 8, "cmd": 8,
- "control": 1
- },
- FUNCTION_KEYS: {
- 8: "Backspace",
- 9: "Tab",
- 13: "Return",
- 19: "Pause",
- 27: "Esc",
- 32: "Space",
- 33: "PageUp",
- 34: "PageDown",
- 35: "End",
- 36: "Home",
- 37: "Left",
- 38: "Up",
- 39: "Right",
- 40: "Down",
- 44: "Print",
- 45: "Insert",
- 46: "Delete",
- 96: "Numpad0",
- 97: "Numpad1",
- 98: "Numpad2",
- 99: "Numpad3",
- 100: "Numpad4",
- 101: "Numpad5",
- 102: "Numpad6",
- 103: "Numpad7",
- 104: "Numpad8",
- 105: "Numpad9",
- '-13': "NumpadEnter",
- 112: "F1",
- 113: "F2",
- 114: "F3",
- 115: "F4",
- 116: "F5",
- 117: "F6",
- 118: "F7",
- 119: "F8",
- 120: "F9",
- 121: "F10",
- 122: "F11",
- 123: "F12",
- 144: "Numlock",
- 145: "Scrolllock"
- },
- PRINTABLE_KEYS: {
- 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5',
- 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 61: '=', 65: 'a',
- 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h',
- 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o',
- 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v',
- 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.',
- 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',
- 219: '[', 220: '\\', 221: ']', 222: "'", 111: '/', 106: '*'
- }
- };
- ret.PRINTABLE_KEYS[173] = '-';
- var name, i;
- for (i in ret.FUNCTION_KEYS) {
- name = ret.FUNCTION_KEYS[i].toLowerCase();
- ret[name] = parseInt(i, 10);
+var Keys = {
+ MODIFIER_KEYS: {
+ 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 224: 'Meta',
+ 91: 'MetaLeft', 92: 'MetaRight', 93: 'ContextMenu'
+ },
+ KEY_MODS: {
+ "ctrl": 1, "alt": 2, "option": 2, "shift": 4,
+ "super": 8, "meta": 8, "command": 8, "cmd": 8,
+ "control": 1
+ },
+ FUNCTION_KEYS: {
+ 8: "Backspace",
+ 9: "Tab",
+ 13: "Return",
+ 19: "Pause",
+ 27: "Esc",
+ 32: "Space",
+ 33: "PageUp",
+ 34: "PageDown",
+ 35: "End",
+ 36: "Home",
+ 37: "Left",
+ 38: "Up",
+ 39: "Right",
+ 40: "Down",
+ 44: "Print",
+ 45: "Insert",
+ 46: "Delete",
+ '-13': "NumpadEnter",
+ 144: "Numlock",
+ 145: "Scrolllock"
+ },
+ PRINTABLE_KEYS: {
+ 32: ' ', 59: ';', 61: '=', 107: '+', 109: '-', 110: '.',
+ 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`',
+ 219: '[', 220: '\\', 221: ']', 222: "'", 111: '/', 106: '*'
}
- for (i in ret.PRINTABLE_KEYS) {
- name = ret.PRINTABLE_KEYS[i].toLowerCase();
- ret[name] = parseInt(i, 10);
+};
+var codeToKeyCode = {
+ Command: 224,
+ Backspace: 8,
+ Tab: 9,
+ Return: 13,
+ Enter: 13,
+ Pause: 19,
+ Escape: 27,
+ PageUp: 33,
+ PageDown: 34,
+ End: 35,
+ Home: 36,
+ Insert: 45,
+ Delete: 46,
+ ArrowLeft: 37,
+ ArrowUp: 38,
+ ArrowRight: 39,
+ ArrowDown: 40,
+ Backquote: 192,
+ Minus: 189,
+ Equal: 187,
+ BracketLeft: 219,
+ Backslash: 220,
+ BracketRight: 221,
+ Semicolon: 186,
+ Quote: 222,
+ Comma: 188,
+ Period: 190,
+ Slash: 191,
+ Space: 32,
+ NumpadAdd: 107,
+ NumpadDecimal: 110,
+ NumpadSubtract: 109,
+ NumpadDivide: 111,
+ NumpadMultiply: 106
+};
+for (var i = 0; i < 10; i++) {
+ codeToKeyCode["Digit" + i] = 48 + i;
+ codeToKeyCode["Numpad" + i] = 96 + i;
+ Keys.PRINTABLE_KEYS[48 + i] = "" + i;
+ Keys.FUNCTION_KEYS[96 + i] = "Numpad" + i;
+}
+for (var i = 65; i < 91; i++) {
+ var chr = String.fromCharCode(i + 32);
+ codeToKeyCode["Key" + chr.toUpperCase()] = i;
+ Keys.PRINTABLE_KEYS[i] = chr;
+}
+for (var i = 1; i < 13; i++) {
+ codeToKeyCode["F" + i] = 111 + i;
+ Keys.FUNCTION_KEYS[111 + i] = "F" + i;
+}
+var modifiers = {
+ Shift: 16,
+ Control: 17,
+ Alt: 18,
+ Meta: 224
+};
+for (var mod in modifiers) {
+ codeToKeyCode[mod] = codeToKeyCode[mod + "Left"]
+ = codeToKeyCode[mod + "Right"] = modifiers[mod];
+}
+exports.$codeToKeyCode = codeToKeyCode;
+Keys.PRINTABLE_KEYS[173] = '-';
+for (var j in Keys.FUNCTION_KEYS) {
+ var name = Keys.FUNCTION_KEYS[j].toLowerCase();
+ Keys[name] = parseInt(j, 10);
+}
+for (var j in Keys.PRINTABLE_KEYS) {
+ var name = Keys.PRINTABLE_KEYS[j].toLowerCase();
+ Keys[name] = parseInt(j, 10);
+}
+oop.mixin(Keys, Keys.MODIFIER_KEYS);
+oop.mixin(Keys, Keys.PRINTABLE_KEYS);
+oop.mixin(Keys, Keys.FUNCTION_KEYS);
+Keys.enter = Keys["return"];
+Keys.escape = Keys.esc;
+Keys.del = Keys["delete"];
+(function () {
+ var mods = ["cmd", "ctrl", "alt", "shift"];
+ for (var i = Math.pow(2, mods.length); i--;) {
+ Keys.KEY_MODS[i] = mods.filter(function (x) {
+ return i & Keys.KEY_MODS[x];
+ }).join("-") + "-";
}
- oop.mixin(ret, ret.MODIFIER_KEYS);
- oop.mixin(ret, ret.PRINTABLE_KEYS);
- oop.mixin(ret, ret.FUNCTION_KEYS);
- ret.enter = ret["return"];
- ret.escape = ret.esc;
- ret.del = ret["delete"];
- (function () {
- var mods = ["cmd", "ctrl", "alt", "shift"];
- for (var i = Math.pow(2, mods.length); i--;) {
- ret.KEY_MODS[i] = mods.filter(function (x) {
- return i & ret.KEY_MODS[x];
- }).join("-") + "-";
- }
- })();
- ret.KEY_MODS[0] = "";
- ret.KEY_MODS[-1] = "input-";
- return ret;
})();
+Keys.KEY_MODS[0] = "";
+Keys.KEY_MODS[-1] = "input-";
oop.mixin(exports, Keys);
exports.default = exports;
exports.keyCodeToString = function (keyCode) {
@@ -1733,7 +1802,7 @@ EventListener.prototype.destroy = function () {
removeListener(this.elem, this.type, this.callback);
this.elem = this.type = this.callback = undefined;
};
-var addListener = exports.addListener = function (elem, type, callback, /**@type{any?}*/ destroyer) {
+var addListener = exports.addListener = function (elem, type, callback, destroyer) {
elem.addEventListener(type, callback, getListenerOptions());
if (destroyer)
destroyer.$toDestroy.push(new EventListener(elem, type, callback));
@@ -1852,6 +1921,9 @@ exports.getModifierString = function (e) {
};
function normalizeCommandKeys(callback, e, keyCode) {
var hashId = getModifierHash(e);
+ if (!keyCode && e.code) {
+ keyCode = keys.$codeToKeyCode[e.code] || keyCode;
+ }
if (!useragent.isMac && pressedKeys) {
if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win")))
hashId |= 8;
@@ -2004,7 +2076,7 @@ var isIOS = useragent.isIOS;
var valueResetRegex = isIOS ? /\s/ : /\n/;
var isMobile = useragent.isMobile;
var TextInput;
-TextInput = function (parentNode, host) {
+TextInput = function (/**@type{HTMLTextAreaElement} */ parentNode, /**@type{import("../editor").Editor} */ host) {
var text = dom.createElement("textarea");
text.className = "ace_text-input";
text.setAttribute("wrap", "off");
@@ -2012,8 +2084,7 @@ TextInput = function (parentNode, host) {
text.setAttribute("autocapitalize", "off");
text.setAttribute("spellcheck", "false");
text.style.opacity = "0";
- parentNode.insertBefore(text, parentNode.firstChild);
- var copied = false;
+ parentNode.insertBefore(text, parentNode.firstChild); var copied = false;
var pasted = false;
var inComposition = false;
var sendingText = false;
@@ -2033,7 +2104,7 @@ TextInput = function (parentNode, host) {
var isFocused = document.activeElement === text;
}
catch (e) { }
- this.setNumberOfExtraLines = function (number) {
+ this.setNumberOfExtraLines = function (/**@type{number}*/ number) {
rowStart = Number.MAX_SAFE_INTEGER;
rowEnd = Number.MIN_SAFE_INTEGER;
if (number < 0) {
@@ -2042,6 +2113,17 @@ TextInput = function (parentNode, host) {
}
numberOfExtraLines = number;
};
+ this.setAriaLabel = function () {
+ var ariaLabel = "";
+ if (host.$textInputAriaLabel) {
+ ariaLabel += "".concat(host.$textInputAriaLabel, ", ");
+ }
+ if (host.session) {
+ var row = host.session.selection.cursor.row;
+ ariaLabel += nls("text-input.aria-label", "Cursor at row $0", [row + 1]);
+ }
+ text.setAttribute("aria-label", ariaLabel);
+ };
this.setAriaOptions = function (options) {
if (options.activeDescendant) {
text.setAttribute("aria-haspopup", "true");
@@ -2057,11 +2139,8 @@ TextInput = function (parentNode, host) {
text.setAttribute("role", options.role);
}
if (options.setLabel) {
- text.setAttribute("aria-roledescription", nls("editor"));
- if (host.session) {
- var row = host.session.selection.cursor.row;
- text.setAttribute("aria-label", nls("Cursor at row $0", [row + 1]));
- }
+ text.setAttribute("aria-roledescription", nls("text-input.aria-roledescription", "editor"));
+ this.setAriaLabel();
}
};
this.setAriaOptions({ role: "textbox" });
@@ -2146,6 +2225,7 @@ TextInput = function (parentNode, host) {
}
resetSelection();
});
+ host.on("changeSelection", this.setAriaLabel);
var positionToSelection = function (row, column) {
var selection = column;
for (var i = 1; i <= row - rowStart && i < 2 * numberOfExtraLines + 1; i++) {
@@ -2565,7 +2645,7 @@ TextInput = function (parentNode, host) {
var rect = host.container.getBoundingClientRect();
var style = dom.computedStyle(host.container);
var top = rect.top + (parseInt(style.borderTopWidth) || 0);
- var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);
+ var left = rect.left + (parseInt(style.borderLeftWidth) || 0);
var maxTop = rect.bottom - top - text.clientHeight - 2;
var move = function (e) {
dom.translate(text, e.clientX - left - 2, Math.min(e.clientY - top - 2, maxTop));
@@ -3315,10 +3395,14 @@ var dom = require("../lib/dom");
var event = require("../lib/event");
var Tooltip = require("../tooltip").Tooltip;
var nls = require("../config").nls;
+var GUTTER_TOOLTIP_LEFT_OFFSET = 5;
+var GUTTER_TOOLTIP_TOP_OFFSET = 3;
+exports.GUTTER_TOOLTIP_LEFT_OFFSET = GUTTER_TOOLTIP_LEFT_OFFSET;
+exports.GUTTER_TOOLTIP_TOP_OFFSET = GUTTER_TOOLTIP_TOP_OFFSET;
function GutterHandler(mouseHandler) {
var editor = mouseHandler.editor;
var gutter = editor.renderer.$gutterLayer;
- var tooltip = new GutterTooltip(editor);
+ var tooltip = new GutterTooltip(editor, true);
mouseHandler.editor.setDefaultHandler("guttermousedown", function (e) {
if (!editor.isFocused() || e.getButton() != 0)
return;
@@ -3354,6 +3438,8 @@ function GutterHandler(mouseHandler) {
if (!tooltip.isOpen)
return;
editor.on("mousewheel", hideTooltip);
+ editor.on("changeSession", hideTooltip);
+ window.addEventListener("keydown", hideTooltip, true);
if (mouseHandler.$tooltipFollowsMouse) {
moveTooltip(mouseEvent);
}
@@ -3364,20 +3450,26 @@ function GutterHandler(mouseHandler) {
var gutterElement = gutterCell.element.querySelector(".ace_gutter_annotation");
var rect = gutterElement.getBoundingClientRect();
var style = tooltip.getElement().style;
- style.left = rect.right + "px";
- style.top = rect.bottom + "px";
+ style.left = (rect.right - GUTTER_TOOLTIP_LEFT_OFFSET) + "px";
+ style.top = (rect.bottom - GUTTER_TOOLTIP_TOP_OFFSET) + "px";
}
else {
moveTooltip(mouseEvent);
}
}
}
- function hideTooltip() {
+ function hideTooltip(e) {
+ if (e && e.type === "keydown" && (e.ctrlKey || e.metaKey))
+ return;
+ if (e && e.type === "mouseout" && (!e.relatedTarget || tooltip.getElement().contains(e.relatedTarget)))
+ return;
if (tooltipTimeout)
tooltipTimeout = clearTimeout(tooltipTimeout);
if (tooltip.isOpen) {
tooltip.hideTooltip();
editor.off("mousewheel", hideTooltip);
+ editor.off("changeSession", hideTooltip);
+ window.removeEventListener("keydown", hideTooltip, true);
}
}
function moveTooltip(e) {
@@ -3396,30 +3488,44 @@ function GutterHandler(mouseHandler) {
tooltipTimeout = null;
if (mouseEvent && !mouseHandler.isMousePressed)
showTooltip();
- else
- hideTooltip();
}, 50);
});
event.addListener(editor.renderer.$gutter, "mouseout", function (e) {
mouseEvent = null;
- if (!tooltip.isOpen || tooltipTimeout)
+ if (!tooltip.isOpen)
return;
tooltipTimeout = setTimeout(function () {
tooltipTimeout = null;
- hideTooltip();
+ hideTooltip(e);
}, 50);
}, editor);
- editor.on("changeSession", hideTooltip);
- editor.on("input", hideTooltip);
}
exports.GutterHandler = GutterHandler;
var GutterTooltip = /** @class */ (function (_super) {
__extends(GutterTooltip, _super);
- function GutterTooltip(editor) {
+ function GutterTooltip(editor, isHover) {
+ if (isHover === void 0) { isHover = false; }
var _this = _super.call(this, editor.container) || this;
_this.editor = editor;
+ _this.visibleTooltipRow;
+ var el = _this.getElement();
+ el.setAttribute("role", "tooltip");
+ el.style.pointerEvents = "auto";
+ if (isHover) {
+ _this.onMouseOut = _this.onMouseOut.bind(_this);
+ el.addEventListener("mouseout", _this.onMouseOut);
+ }
return _this;
}
+ GutterTooltip.prototype.onMouseOut = function (e) {
+ if (!this.isOpen)
+ return;
+ if (!e.relatedTarget || this.getElement().contains(e.relatedTarget))
+ return;
+ if (e && e.currentTarget.contains(e.relatedTarget))
+ return;
+ this.hideTooltip();
+ };
GutterTooltip.prototype.setPosition = function (x, y) {
var windowWidth = window.innerWidth || document.documentElement.clientWidth;
var windowHeight = window.innerHeight || document.documentElement.clientHeight;
@@ -3438,75 +3544,111 @@ var GutterTooltip = /** @class */ (function (_super) {
Object.defineProperty(GutterTooltip, "annotationLabels", {
get: function () {
return {
- error: { singular: nls("error"), plural: nls("errors") },
- warning: { singular: nls("warning"), plural: nls("warnings") },
- info: { singular: nls("information message"), plural: nls("information messages") }
+ error: {
+ singular: nls("gutter-tooltip.aria-label.error.singular", "error"),
+ plural: nls("gutter-tooltip.aria-label.error.plural", "errors")
+ },
+ security: {
+ singular: nls("gutter-tooltip.aria-label.security.singular", "security finding"),
+ plural: nls("gutter-tooltip.aria-label.security.plural", "security findings")
+ },
+ warning: {
+ singular: nls("gutter-tooltip.aria-label.warning.singular", "warning"),
+ plural: nls("gutter-tooltip.aria-label.warning.plural", "warnings")
+ },
+ info: {
+ singular: nls("gutter-tooltip.aria-label.info.singular", "information message"),
+ plural: nls("gutter-tooltip.aria-label.info.plural", "information messages")
+ },
+ hint: {
+ singular: nls("gutter-tooltip.aria-label.hint.singular", "suggestion"),
+ plural: nls("gutter-tooltip.aria-label.hint.plural", "suggestions")
+ }
};
},
enumerable: false,
configurable: true
});
GutterTooltip.prototype.showTooltip = function (row) {
+ var _a;
var gutter = this.editor.renderer.$gutterLayer;
var annotationsInRow = gutter.$annotations[row];
var annotation;
if (annotationsInRow)
- annotation = { text: Array.from(annotationsInRow.text), type: Array.from(annotationsInRow.type) };
+ annotation = {
+ displayText: Array.from(annotationsInRow.displayText),
+ type: Array.from(annotationsInRow.type)
+ };
else
- annotation = { text: [], type: [] };
+ annotation = { displayText: [], type: [] };
var fold = gutter.session.getFoldLine(row);
if (fold && gutter.$showFoldedAnnotations) {
- var annotationsInFold = { error: [], warning: [], info: [] };
- var mostSevereAnnotationInFoldType;
+ var annotationsInFold = { error: [], security: [], warning: [], info: [], hint: [] };
+ var severityRank = { error: 1, security: 2, warning: 3, info: 4, hint: 5 };
+ var mostSevereAnnotationTypeInFold;
for (var i = row + 1; i <= fold.end.row; i++) {
if (!gutter.$annotations[i])
continue;
for (var j = 0; j < gutter.$annotations[i].text.length; j++) {
var annotationType = gutter.$annotations[i].type[j];
annotationsInFold[annotationType].push(gutter.$annotations[i].text[j]);
- if (annotationType === "error") {
- mostSevereAnnotationInFoldType = "error_fold";
- continue;
- }
- if (annotationType === "warning") {
- mostSevereAnnotationInFoldType = "warning_fold";
- continue;
+ if (!mostSevereAnnotationTypeInFold ||
+ severityRank[annotationType] < severityRank[mostSevereAnnotationTypeInFold]) {
+ mostSevereAnnotationTypeInFold = annotationType;
}
}
}
- if (mostSevereAnnotationInFoldType === "error_fold" || mostSevereAnnotationInFoldType === "warning_fold") {
+ if (["error", "security", "warning"].includes(mostSevereAnnotationTypeInFold)) {
var summaryFoldedAnnotations = "".concat(GutterTooltip.annotationsToSummaryString(annotationsInFold), " in folded code.");
- annotation.text.push(summaryFoldedAnnotations);
- annotation.type.push(mostSevereAnnotationInFoldType);
+ annotation.displayText.push(summaryFoldedAnnotations);
+ annotation.type.push(mostSevereAnnotationTypeInFold + "_fold");
}
}
- if (annotation.text.length === 0)
- return this.hide();
- var annotationMessages = { error: [], warning: [], info: [] };
+ if (annotation.displayText.length === 0)
+ return this.hideTooltip();
+ var annotationMessages = { error: [], security: [], warning: [], info: [], hint: [] };
var iconClassName = gutter.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon";
- for (var i = 0; i < annotation.text.length; i++) {
- var line = " ").concat(annotation.text[i]);
- annotationMessages[annotation.type[i].replace("_fold", "")].push(line);
- }
- var tooltipContent = [].concat(annotationMessages.error, annotationMessages.warning, annotationMessages.info).join("
");
- this.setHtml(tooltipContent);
- this.$element.setAttribute("aria-live", "polite");
+ for (var i = 0; i < annotation.displayText.length; i++) {
+ var lineElement = dom.createElement("span");
+ var iconElement = dom.createElement("span");
+ (_a = iconElement.classList).add.apply(_a, ["ace_".concat(annotation.type[i]), iconClassName]);
+ iconElement.setAttribute("aria-label", "".concat(GutterTooltip.annotationLabels[annotation.type[i].replace("_fold", "")].singular));
+ iconElement.setAttribute("role", "img");
+ iconElement.appendChild(dom.createTextNode(" "));
+ lineElement.appendChild(iconElement);
+ lineElement.appendChild(dom.createTextNode(annotation.displayText[i]));
+ lineElement.appendChild(dom.createElement("br"));
+ annotationMessages[annotation.type[i].replace("_fold", "")].push(lineElement);
+ }
+ var tooltipElement = this.getElement();
+ dom.removeChildren(tooltipElement);
+ annotationMessages.error.forEach(function (el) { return tooltipElement.appendChild(el); });
+ annotationMessages.security.forEach(function (el) { return tooltipElement.appendChild(el); });
+ annotationMessages.warning.forEach(function (el) { return tooltipElement.appendChild(el); });
+ annotationMessages.info.forEach(function (el) { return tooltipElement.appendChild(el); });
+ annotationMessages.hint.forEach(function (el) { return tooltipElement.appendChild(el); });
+ tooltipElement.setAttribute("aria-live", "polite");
if (!this.isOpen) {
this.setTheme(this.editor.renderer.theme);
this.setClassName("ace_gutter-tooltip");
}
this.show();
+ this.visibleTooltipRow = row;
this.editor._signal("showGutterTooltip", this);
};
GutterTooltip.prototype.hideTooltip = function () {
+ if (!this.isOpen) {
+ return;
+ }
this.$element.removeAttribute("aria-live");
this.hide();
+ this.visibleTooltipRow = undefined;
this.editor._signal("hideGutterTooltip", this);
};
GutterTooltip.annotationsToSummaryString = function (annotations) {
var e_1, _a;
var summary = [];
- var annotationTypes = ['error', 'warning', 'info'];
+ var annotationTypes = ["error", "security", "warning", "info", "hint"];
try {
for (var annotationTypes_1 = __values(annotationTypes), annotationTypes_1_1 = annotationTypes_1.next(); !annotationTypes_1_1.done; annotationTypes_1_1 = annotationTypes_1.next()) {
var annotationType = annotationTypes_1_1.value;
@@ -3962,15 +4104,18 @@ exports.addTouchListeners = function (el, editor) {
var selected = editor.getCopyText();
var hasUndo = editor.session.getUndoManager().hasUndo();
contextMenu.replaceChild(dom.buildDom(isOpen ? ["span",
- !selected && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"],
- selected && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"],
- selected && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"],
- clipboard && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"],
- hasUndo && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"],
- ["span", { class: "ace_mobile-button", action: "find" }, "Find"],
- ["span", { class: "ace_mobile-button", action: "openCommandPalette" }, "Palette"]
+ !selected && canExecuteCommand("selectall") && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"],
+ selected && canExecuteCommand("copy") && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"],
+ selected && canExecuteCommand("cut") && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"],
+ clipboard && canExecuteCommand("paste") && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"],
+ hasUndo && canExecuteCommand("undo") && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"],
+ canExecuteCommand("find") && ["span", { class: "ace_mobile-button", action: "find" }, "Find"],
+ canExecuteCommand("openCommandPalette") && ["span", { class: "ace_mobile-button", action: "openCommandPalette" }, "Palette"]
] : ["span"]), contextMenu.firstChild);
};
+ var canExecuteCommand = function (/** @type {string} */ cmd) {
+ return editor.commands.canExecute(cmd, editor);
+ };
var handleClick = function (e) {
var action = e.target.getAttribute("action");
if (action == "more" || !isOpen) {
@@ -4017,6 +4162,12 @@ exports.addTouchListeners = function (el, editor) {
], editor.container);
}
function showContextMenu() {
+ if (!editor.getOption("enableMobileMenu")) {
+ if (contextMenu) {
+ hideContextMenu();
+ }
+ return;
+ }
if (!contextMenu)
createContextMenu();
var cursor = editor.selection.cursor;
@@ -6360,9 +6511,23 @@ CstyleBehaviour = function (options) {
initContext(editor);
var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection);
+ var token = session.getTokenAt(cursor.row, cursor.column);
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
return getWrapped(selection, selected, '{', '}');
}
+ else if (token && /(?:string)\.quasi|\.xml/.test(token.type)) {
+ var excludeTokens = [
+ /tag\-(?:open|name)/, /attribute\-name/
+ ];
+ if (excludeTokens.some(function (el) { return el.test(token.type); }) || /(string)\.quasi/.test(token.type)
+ && token.value[cursor.column - token.start - 1] !== '$')
+ return;
+ CstyleBehaviour.recordAutoInsert(editor, session, "}");
+ return {
+ text: '{}',
+ selection: [1, 1]
+ };
+ }
else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options.braces) {
CstyleBehaviour.recordAutoInsert(editor, session, "}");
@@ -6604,14 +6769,47 @@ CstyleBehaviour = function (options) {
this.add("doc comment end", "insertion", function (state, action, editor, session, text) {
if (state === "doc-start" && (text === "\n" || text === "\r\n") && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition();
+ if (cursor.column === 0) {
+ return;
+ }
var line = session.doc.getLine(cursor.row);
var nextLine = session.doc.getLine(cursor.row + 1);
+ var tokens = session.getTokens(cursor.row);
+ var index = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ index += tokens[i].value.length;
+ var currentToken = tokens[i];
+ if (index >= cursor.column) {
+ if (index === cursor.column) {
+ if (!/\.doc/.test(currentToken.type)) {
+ return;
+ }
+ if (/\*\//.test(currentToken.value)) {
+ var nextToken = tokens[i + 1];
+ if (!nextToken || !/\.doc/.test(nextToken.type)) {
+ return;
+ }
+ }
+ }
+ var cursorPosInToken = cursor.column - (index - currentToken.value.length);
+ var closeDocPos = currentToken.value.indexOf("*/");
+ var openDocPos = currentToken.value.indexOf("/**", closeDocPos > -1 ? closeDocPos + 2 : 0);
+ if (openDocPos !== -1 && cursorPosInToken > openDocPos && cursorPosInToken < openDocPos + 3) {
+ return;
+ }
+ if (closeDocPos !== -1 && openDocPos !== -1 && cursorPosInToken >= closeDocPos
+ && cursorPosInToken <= openDocPos || !/\.doc/.test(currentToken.type)) {
+ return;
+ }
+ break;
+ }
+ }
var indent = this.$getIndent(line);
if (/\s*\*/.test(nextLine)) {
if (/^\s*\*/.test(line)) {
return {
text: text + indent + "* ",
- selection: [1, 3 + indent.length, 1, 3 + indent.length]
+ selection: [1, 2 + indent.length, 1, 2 + indent.length]
};
}
else {
@@ -7033,6232 +7231,6550 @@ exports.Mode = Mode;
});
-ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module){"use strict";
-function throwDeltaError(delta, errorText) {
- console.log("Invalid Delta:", delta);
- throw "Invalid Delta: " + errorText;
-}
-function positionInDocument(docLines, position) {
- return position.row >= 0 && position.row < docLines.length &&
- position.column >= 0 && position.column <= docLines[position.row].length;
-}
-function validateDelta(docLines, delta) {
- if (delta.action != "insert" && delta.action != "remove")
- throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
- if (!(delta.lines instanceof Array))
- throwDeltaError(delta, "delta.lines must be an Array");
- if (!delta.start || !delta.end)
- throwDeltaError(delta, "delta.start/end must be an present");
- var start = delta.start;
- if (!positionInDocument(docLines, delta.start))
- throwDeltaError(delta, "delta.start must be contained in document");
- var end = delta.end;
- if (delta.action == "remove" && !positionInDocument(docLines, end))
- throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
- var numRangeRows = end.row - start.row;
- var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
- if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
- throwDeltaError(delta, "delta.range must match delta lines");
-}
-exports.applyDelta = function (docLines, delta, doNotValidate) {
- var row = delta.start.row;
- var startColumn = delta.start.column;
- var line = docLines[row] || "";
- switch (delta.action) {
- case "insert":
- var lines = delta.lines;
- if (lines.length === 1) {
- docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
- }
- else {
- var args = [row, 1].concat(delta.lines);
- docLines.splice.apply(docLines, args);
- docLines[row] = line.substring(0, startColumn) + docLines[row];
- docLines[row + delta.lines.length - 1] += line.substring(startColumn);
- }
- break;
- case "remove":
- var endColumn = delta.end.column;
- var endRow = delta.end.row;
- if (row === endRow) {
- docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
- }
- else {
- docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
- }
- break;
+ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict";
+var dom = require("./lib/dom");
+var LineWidgets = /** @class */ (function () {
+ function LineWidgets(session) {
+ this.session = session;
+ this.session.widgetManager = this;
+ this.session.getRowLength = this.getRowLength;
+ this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;
+ this.updateOnChange = this.updateOnChange.bind(this);
+ this.renderWidgets = this.renderWidgets.bind(this);
+ this.measureWidgets = this.measureWidgets.bind(this);
+ this.session._changedWidgets = [];
+ this.$onChangeEditor = this.$onChangeEditor.bind(this);
+ this.session.on("change", this.updateOnChange);
+ this.session.on("changeFold", this.updateOnFold);
+ this.session.on("changeEditor", this.$onChangeEditor);
}
-};
-
-});
-
-ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict";
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var Anchor = /** @class */ (function () {
- function Anchor(doc, row, column) {
- this.$onChange = this.onChange.bind(this);
- this.attach(doc);
- if (typeof row != "number")
- this.setPosition(row.row, row.column);
+ LineWidgets.prototype.getRowLength = function (row) {
+ var h;
+ if (this.lineWidgets)
+ h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
else
- this.setPosition(row, column);
- }
- Anchor.prototype.getPosition = function () {
- return this.$clipPositionToDocument(this.row, this.column);
- };
- Anchor.prototype.getDocument = function () {
- return this.document;
- };
- Anchor.prototype.onChange = function (delta) {
- if (delta.start.row == delta.end.row && delta.start.row != this.row)
- return;
- if (delta.start.row > this.row)
- return;
- var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
- this.setPosition(point.row, point.column, true);
- };
- Anchor.prototype.setPosition = function (row, column, noClip) {
- var pos;
- if (noClip) {
- pos = {
- row: row,
- column: column
- };
+ h = 0;
+ if (!this["$useWrapMode"] || !this["$wrapData"][row]) {
+ return 1 + h;
}
else {
- pos = this.$clipPositionToDocument(row, column);
+ return this["$wrapData"][row].length + 1 + h;
}
- if (this.row == pos.row && this.column == pos.column)
- return;
- var old = {
- row: this.row,
- column: this.column
- };
- this.row = pos.row;
- this.column = pos.column;
- this._signal("change", {
- old: old,
- value: pos
- });
};
- Anchor.prototype.detach = function () {
- this.document.off("change", this.$onChange);
+ LineWidgets.prototype.$getWidgetScreenLength = function () {
+ var screenRows = 0;
+ this.lineWidgets.forEach(function (w) {
+ if (w && w.rowCount && !w.hidden)
+ screenRows += w.rowCount;
+ });
+ return screenRows;
};
- Anchor.prototype.attach = function (doc) {
- this.document = doc || this.document;
- this.document.on("change", this.$onChange);
+ LineWidgets.prototype.$onChangeEditor = function (e) {
+ this.attach(e.editor);
};
- Anchor.prototype.$clipPositionToDocument = function (row, column) {
- var pos = {};
- if (row >= this.document.getLength()) {
- pos.row = Math.max(0, this.document.getLength() - 1);
- pos.column = this.document.getLine(pos.row).length;
- }
- else if (row < 0) {
- pos.row = 0;
- pos.column = 0;
+ LineWidgets.prototype.attach = function (editor) {
+ if (editor && editor.widgetManager && editor.widgetManager != this)
+ editor.widgetManager.detach();
+ if (this.editor == editor)
+ return;
+ this.detach();
+ this.editor = editor;
+ if (editor) {
+ editor.widgetManager = this;
+ editor.renderer.on("beforeRender", this.measureWidgets);
+ editor.renderer.on("afterRender", this.renderWidgets);
}
- else {
- pos.row = row;
- pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
- }
- if (column < 0)
- pos.column = 0;
- return pos;
};
- return Anchor;
-}());
-Anchor.prototype.$insertRight = false;
-oop.implement(Anchor.prototype, EventEmitter);
-function $pointsInOrder(point1, point2, equalPointsInOrder) {
- var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
- return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
-}
-function $getTransformedPoint(delta, point, moveIfEqual) {
- var deltaIsInsert = delta.action == "insert";
- var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
- var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
- var deltaStart = delta.start;
- var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
- if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
- return {
- row: point.row,
- column: point.column
- };
- }
- if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
- return {
- row: point.row + deltaRowShift,
- column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
- };
- }
- return {
- row: deltaStart.row,
- column: deltaStart.column
+ LineWidgets.prototype.detach = function (e) {
+ var editor = this.editor;
+ if (!editor)
+ return;
+ this.editor = null;
+ editor.widgetManager = null;
+ editor.renderer.off("beforeRender", this.measureWidgets);
+ editor.renderer.off("afterRender", this.renderWidgets);
+ var lineWidgets = this.session.lineWidgets;
+ lineWidgets && lineWidgets.forEach(function (w) {
+ if (w && w.el && w.el.parentNode) {
+ w._inDocument = false;
+ w.el.parentNode.removeChild(w.el);
+ }
+ });
};
-}
-exports.Anchor = Anchor;
-
-});
-
-ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module){"use strict";
-var oop = require("./lib/oop");
-var applyDelta = require("./apply_delta").applyDelta;
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var Range = require("./range").Range;
-var Anchor = require("./anchor").Anchor;
-var Document = /** @class */ (function () {
- function Document(textOrLines) {
- this.$lines = [""];
- if (textOrLines.length === 0) {
- this.$lines = [""];
- }
- else if (Array.isArray(textOrLines)) {
- this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
- }
- else {
- this.insert({ row: 0, column: 0 }, textOrLines);
+ LineWidgets.prototype.updateOnFold = function (e, session) {
+ var lineWidgets = session.lineWidgets;
+ if (!lineWidgets || !e.action)
+ return;
+ var fold = e.data;
+ var start = fold.start.row;
+ var end = fold.end.row;
+ var hide = e.action == "add";
+ for (var i = start + 1; i < end; i++) {
+ if (lineWidgets[i])
+ lineWidgets[i].hidden = hide;
}
- }
- Document.prototype.setValue = function (text) {
- var len = this.getLength() - 1;
- this.remove(new Range(0, 0, len, this.getLine(len).length));
- this.insert({ row: 0, column: 0 }, text || "");
- };
- Document.prototype.getValue = function () {
- return this.getAllLines().join(this.getNewLineCharacter());
- };
- Document.prototype.createAnchor = function (row, column) {
- return new Anchor(this, row, column);
- };
- Document.prototype.$detectNewLine = function (text) {
- var match = text.match(/^.*?(\r\n|\r|\n)/m);
- this.$autoNewLine = match ? match[1] : "\n";
- this._signal("changeNewLineMode");
- };
- Document.prototype.getNewLineCharacter = function () {
- switch (this.$newLineMode) {
- case "windows":
- return "\r\n";
- case "unix":
- return "\n";
- default:
- return this.$autoNewLine || "\n";
+ if (lineWidgets[end]) {
+ if (hide) {
+ if (!lineWidgets[start])
+ lineWidgets[start] = lineWidgets[end];
+ else
+ lineWidgets[end].hidden = hide;
+ }
+ else {
+ if (lineWidgets[start] == lineWidgets[end])
+ lineWidgets[start] = undefined;
+ lineWidgets[end].hidden = hide;
+ }
}
};
- Document.prototype.setNewLineMode = function (newLineMode) {
- if (this.$newLineMode === newLineMode)
+ LineWidgets.prototype.updateOnChange = function (delta) {
+ var lineWidgets = this.session.lineWidgets;
+ if (!lineWidgets)
return;
- this.$newLineMode = newLineMode;
- this._signal("changeNewLineMode");
- };
- Document.prototype.getNewLineMode = function () {
- return this.$newLineMode;
- };
- Document.prototype.isNewLine = function (text) {
- return (text == "\r\n" || text == "\r" || text == "\n");
- };
- Document.prototype.getLine = function (row) {
- return this.$lines[row] || "";
- };
- Document.prototype.getLines = function (firstRow, lastRow) {
- return this.$lines.slice(firstRow, lastRow + 1);
- };
- Document.prototype.getAllLines = function () {
- return this.getLines(0, this.getLength());
- };
- Document.prototype.getLength = function () {
- return this.$lines.length;
- };
- Document.prototype.getTextRange = function (range) {
- return this.getLinesForRange(range).join(this.getNewLineCharacter());
- };
- Document.prototype.getLinesForRange = function (range) {
- var lines;
- if (range.start.row === range.end.row) {
- lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
+ var startRow = delta.start.row;
+ var len = delta.end.row - startRow;
+ if (len === 0) {
+ }
+ else if (delta.action == "remove") {
+ var removed = lineWidgets.splice(startRow + 1, len);
+ if (!lineWidgets[startRow] && removed[removed.length - 1]) {
+ lineWidgets[startRow] = removed.pop();
+ }
+ removed.forEach(function (w) {
+ w && this.removeLineWidget(w);
+ }, this);
+ this.$updateRows();
}
else {
- lines = this.getLines(range.start.row, range.end.row);
- lines[0] = (lines[0] || "").substring(range.start.column);
- var l = lines.length - 1;
- if (range.end.row - range.start.row == l)
- lines[l] = lines[l].substring(0, range.end.column);
+ var args = new Array(len);
+ if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {
+ if (delta.start.column > lineWidgets[startRow].column)
+ startRow++;
+ }
+ args.unshift(startRow, 0);
+ lineWidgets.splice.apply(lineWidgets, args);
+ this.$updateRows();
}
- return lines;
- };
- Document.prototype.insertLines = function (row, lines) {
- console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
- return this.insertFullLines(row, lines);
- };
- Document.prototype.removeLines = function (firstRow, lastRow) {
- console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
- return this.removeFullLines(firstRow, lastRow);
- };
- Document.prototype.insertNewLine = function (position) {
- console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
- return this.insertMergedLines(position, ["", ""]);
- };
- Document.prototype.insert = function (position, text) {
- if (this.getLength() <= 1)
- this.$detectNewLine(text);
- return this.insertMergedLines(position, this.$split(text));
};
- Document.prototype.insertInLine = function (position, text) {
- var start = this.clippedPos(position.row, position.column);
- var end = this.pos(position.row, position.column + text.length);
- this.applyDelta({
- start: start,
- end: end,
- action: "insert",
- lines: [text]
- }, true);
- return this.clonePos(end);
+ LineWidgets.prototype.$updateRows = function () {
+ var lineWidgets = this.session.lineWidgets;
+ if (!lineWidgets)
+ return;
+ var noWidgets = true;
+ lineWidgets.forEach(function (w, i) {
+ if (w) {
+ noWidgets = false;
+ w.row = i;
+ while (w.$oldWidget) {
+ w.$oldWidget.row = i;
+ w = w.$oldWidget;
+ }
+ }
+ });
+ if (noWidgets)
+ this.session.lineWidgets = null;
};
- Document.prototype.clippedPos = function (row, column) {
- var length = this.getLength();
- if (row === undefined) {
- row = length;
+ LineWidgets.prototype.$registerLineWidget = function (w) {
+ if (!this.session.lineWidgets)
+ this.session.lineWidgets = new Array(this.session.getLength());
+ var old = this.session.lineWidgets[w.row];
+ if (old) {
+ w.$oldWidget = old;
+ if (old.el && old.el.parentNode) {
+ old.el.parentNode.removeChild(old.el);
+ old._inDocument = false;
+ }
}
- else if (row < 0) {
- row = 0;
+ this.session.lineWidgets[w.row] = w;
+ return w;
+ };
+ LineWidgets.prototype.addLineWidget = function (w) {
+ this.$registerLineWidget(w);
+ w.session = this.session;
+ if (!this.editor)
+ return w;
+ var renderer = this.editor.renderer;
+ if (w.html && !w.el) {
+ w.el = dom.createElement("div");
+ w.el.innerHTML = w.html;
}
- else if (row >= length) {
- row = length - 1;
- column = undefined;
+ if (w.text && !w.el) {
+ w.el = dom.createElement("div");
+ w.el.textContent = w.text;
}
- var line = this.getLine(row);
- if (column == undefined)
- column = line.length;
- column = Math.min(Math.max(column, 0), line.length);
- return { row: row, column: column };
- };
- Document.prototype.clonePos = function (pos) {
- return { row: pos.row, column: pos.column };
- };
- Document.prototype.pos = function (row, column) {
- return { row: row, column: column };
- };
- Document.prototype.$clipPosition = function (position) {
- var length = this.getLength();
- if (position.row >= length) {
- position.row = Math.max(0, length - 1);
- position.column = this.getLine(length - 1).length;
- }
- else {
- position.row = Math.max(0, position.row);
- position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
- }
- return position;
- };
- Document.prototype.insertFullLines = function (row, lines) {
- row = Math.min(Math.max(row, 0), this.getLength());
- var column = 0;
- if (row < this.getLength()) {
- lines = lines.concat([""]);
- column = 0;
+ if (w.el) {
+ dom.addCssClass(w.el, "ace_lineWidgetContainer");
+ if (w.className) {
+ dom.addCssClass(w.el, w.className);
+ }
+ w.el.style.position = "absolute";
+ w.el.style.zIndex = "5";
+ renderer.container.appendChild(w.el);
+ w._inDocument = true;
+ if (!w.coverGutter) {
+ w.el.style.zIndex = "3";
+ }
+ if (w.pixelHeight == null) {
+ w.pixelHeight = w.el.offsetHeight;
+ }
}
- else {
- lines = [""].concat(lines);
- row--;
- column = this.$lines[row].length;
+ if (w.rowCount == null) {
+ w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;
}
- this.insertMergedLines({ row: row, column: column }, lines);
- };
- Document.prototype.insertMergedLines = function (position, lines) {
- var start = this.clippedPos(position.row, position.column);
- var end = {
- row: start.row + lines.length - 1,
- column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
- };
- this.applyDelta({
- start: start,
- end: end,
- action: "insert",
- lines: lines
- });
- return this.clonePos(end);
- };
- Document.prototype.remove = function (range) {
- var start = this.clippedPos(range.start.row, range.start.column);
- var end = this.clippedPos(range.end.row, range.end.column);
- this.applyDelta({
- start: start,
- end: end,
- action: "remove",
- lines: this.getLinesForRange({ start: start, end: end })
- });
- return this.clonePos(start);
- };
- Document.prototype.removeInLine = function (row, startColumn, endColumn) {
- var start = this.clippedPos(row, startColumn);
- var end = this.clippedPos(row, endColumn);
- this.applyDelta({
- start: start,
- end: end,
- action: "remove",
- lines: this.getLinesForRange({ start: start, end: end })
- }, true);
- return this.clonePos(start);
- };
- Document.prototype.removeFullLines = function (firstRow, lastRow) {
- firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
- lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
- var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
- var deleteLastNewLine = lastRow < this.getLength() - 1;
- var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);
- var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);
- var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);
- var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);
- var range = new Range(startRow, startCol, endRow, endCol);
- var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
- this.applyDelta({
- start: range.start,
- end: range.end,
- action: "remove",
- lines: this.getLinesForRange(range)
- });
- return deletedLines;
- };
- Document.prototype.removeNewLine = function (row) {
- if (row < this.getLength() - 1 && row >= 0) {
- this.applyDelta({
- start: this.pos(row, this.getLine(row).length),
- end: this.pos(row + 1, 0),
- action: "remove",
- lines: ["", ""]
- });
+ var fold = this.session.getFoldAt(w.row, 0);
+ w.$fold = fold;
+ if (fold) {
+ var lineWidgets = this.session.lineWidgets;
+ if (w.row == fold.end.row && !lineWidgets[fold.start.row])
+ lineWidgets[fold.start.row] = w;
+ else
+ w.hidden = true;
}
+ this.session._emit("changeFold", { data: { start: { row: w.row } } });
+ this.$updateRows();
+ this.renderWidgets(null, renderer);
+ this.onWidgetChanged(w);
+ return w;
};
- Document.prototype.replace = function (range, text) {
- if (!(range instanceof Range))
- range = Range.fromPoints(range.start, range.end);
- if (text.length === 0 && range.isEmpty())
- return range.start;
- if (text == this.getTextRange(range))
- return range.end;
- this.remove(range);
- var end;
- if (text) {
- end = this.insert(range.start, text);
- }
- else {
- end = range.start;
+ LineWidgets.prototype.removeLineWidget = function (w) {
+ w._inDocument = false;
+ w.session = null;
+ if (w.el && w.el.parentNode)
+ w.el.parentNode.removeChild(w.el);
+ if (w.editor && w.editor.destroy)
+ try {
+ w.editor.destroy();
+ }
+ catch (e) { }
+ if (this.session.lineWidgets) {
+ var w1 = this.session.lineWidgets[w.row];
+ if (w1 == w) {
+ this.session.lineWidgets[w.row] = w.$oldWidget;
+ if (w.$oldWidget)
+ this.onWidgetChanged(w.$oldWidget);
+ }
+ else {
+ while (w1) {
+ if (w1.$oldWidget == w) {
+ w1.$oldWidget = w.$oldWidget;
+ break;
+ }
+ w1 = w1.$oldWidget;
+ }
+ }
}
- return end;
+ this.session._emit("changeFold", { data: { start: { row: w.row } } });
+ this.$updateRows();
};
- Document.prototype.applyDeltas = function (deltas) {
- for (var i = 0; i < deltas.length; i++) {
- this.applyDelta(deltas[i]);
+ LineWidgets.prototype.getWidgetsAtRow = function (row) {
+ var lineWidgets = this.session.lineWidgets;
+ var w = lineWidgets && lineWidgets[row];
+ var list = [];
+ while (w) {
+ list.push(w);
+ w = w.$oldWidget;
}
+ return list;
};
- Document.prototype.revertDeltas = function (deltas) {
- for (var i = deltas.length - 1; i >= 0; i--) {
- this.revertDelta(deltas[i]);
- }
+ LineWidgets.prototype.onWidgetChanged = function (w) {
+ this.session._changedWidgets.push(w);
+ this.editor && this.editor.renderer.updateFull();
};
- Document.prototype.applyDelta = function (delta, doNotValidate) {
- var isInsert = delta.action == "insert";
- if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
- : !Range.comparePoints(delta.start, delta.end)) {
+ LineWidgets.prototype.measureWidgets = function (e, renderer) {
+ var changedWidgets = this.session._changedWidgets;
+ var config = renderer.layerConfig;
+ if (!changedWidgets || !changedWidgets.length)
return;
+ var min = Infinity;
+ for (var i = 0; i < changedWidgets.length; i++) {
+ var w = changedWidgets[i];
+ if (!w || !w.el)
+ continue;
+ if (w.session != this.session)
+ continue;
+ if (!w._inDocument) {
+ if (this.session.lineWidgets[w.row] != w)
+ continue;
+ w._inDocument = true;
+ renderer.container.appendChild(w.el);
+ }
+ w.h = w.el.offsetHeight;
+ if (!w.fixedWidth) {
+ w.w = w.el.offsetWidth;
+ w.screenWidth = Math.ceil(w.w / config.characterWidth);
+ }
+ var rowCount = w.h / config.lineHeight;
+ if (w.coverLine) {
+ rowCount -= this.session.getRowLineCount(w.row);
+ if (rowCount < 0)
+ rowCount = 0;
+ }
+ if (w.rowCount != rowCount) {
+ w.rowCount = rowCount;
+ if (w.row < min)
+ min = w.row;
+ }
}
- if (isInsert && delta.lines.length > 20000) {
- this.$splitAndapplyLargeDelta(delta, 20000);
- }
- else {
- applyDelta(this.$lines, delta, doNotValidate);
- this._signal("change", delta);
- }
- };
- Document.prototype.$safeApplyDelta = function (delta) {
- var docLength = this.$lines.length;
- if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
- || delta.action == "insert" && delta.start.row <= docLength) {
- this.applyDelta(delta);
+ if (min != Infinity) {
+ this.session._emit("changeFold", { data: { start: { row: min } } });
+ this.session.lineWidgetWidth = null;
}
+ this.session._changedWidgets = [];
};
- Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) {
- var lines = delta.lines;
- var l = lines.length - MAX + 1;
- var row = delta.start.row;
- var column = delta.start.column;
- for (var from = 0, to = 0; from < l; from = to) {
- to += MAX - 1;
- var chunk = lines.slice(from, to);
- chunk.push("");
- this.applyDelta({
- start: this.pos(row + from, column),
- end: this.pos(row + to, column = 0),
- action: delta.action,
- lines: chunk
- }, true);
- }
- delta.lines = lines.slice(from);
- delta.start.row = row + from;
- delta.start.column = column;
- this.applyDelta(delta, true);
- };
- Document.prototype.revertDelta = function (delta) {
- this.$safeApplyDelta({
- start: this.clonePos(delta.start),
- end: this.clonePos(delta.end),
- action: (delta.action == "insert" ? "remove" : "insert"),
- lines: delta.lines.slice()
- });
- };
- Document.prototype.indexToPosition = function (index, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- for (var i = startRow || 0, l = lines.length; i < l; i++) {
- index -= lines[i].length + newlineLength;
- if (index < 0)
- return { row: i, column: index + lines[i].length + newlineLength };
+ LineWidgets.prototype.renderWidgets = function (e, renderer) {
+ var config = renderer.layerConfig;
+ var lineWidgets = this.session.lineWidgets;
+ if (!lineWidgets)
+ return;
+ var first = Math.min(this.firstRow, config.firstRow);
+ var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);
+ while (first > 0 && !lineWidgets[first])
+ first--;
+ this.firstRow = config.firstRow;
+ this.lastRow = config.lastRow;
+ renderer.$cursorLayer.config = config;
+ for (var i = first; i <= last; i++) {
+ var w = lineWidgets[i];
+ if (!w || !w.el)
+ continue;
+ if (w.hidden) {
+ w.el.style.top = -100 - (w.pixelHeight || 0) + "px";
+ continue;
+ }
+ if (!w._inDocument) {
+ w._inDocument = true;
+ renderer.container.appendChild(w.el);
+ }
+ var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top;
+ if (!w.coverLine)
+ top += config.lineHeight * this.session.getRowLineCount(w.row);
+ w.el.style.top = top - config.offset + "px";
+ var left = w.coverGutter ? 0 : renderer.gutterWidth;
+ if (!w.fixedWidth)
+ left -= renderer.scrollLeft;
+ w.el.style.left = left + "px";
+ if (w.fullWidth && w.screenWidth) {
+ w.el.style.minWidth = config.width + 2 * config.padding + "px";
+ }
+ if (w.fixedWidth) {
+ w.el.style.right = renderer.scrollBar.getWidth() + "px";
+ }
+ else {
+ w.el.style.right = "";
+ }
}
- return { row: l - 1, column: index + lines[l - 1].length + newlineLength };
- };
- Document.prototype.positionToIndex = function (pos, startRow) {
- var lines = this.$lines || this.getAllLines();
- var newlineLength = this.getNewLineCharacter().length;
- var index = 0;
- var row = Math.min(pos.row, lines.length);
- for (var i = startRow || 0; i < row; ++i)
- index += lines[i].length + newlineLength;
- return index + pos.column;
- };
- Document.prototype.$split = function (text) {
- return text.split(/\r\n|\r|\n/);
};
- return Document;
+ return LineWidgets;
}());
-Document.prototype.$autoNewLine = "";
-Document.prototype.$newLineMode = "auto";
-oop.implement(Document.prototype, EventEmitter);
-exports.Document = Document;
+exports.LineWidgets = LineWidgets;
});
-ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict";
-var oop = require("./lib/oop");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var BackgroundTokenizer = /** @class */ (function () {
- function BackgroundTokenizer(tokenizer, session) {
- this.running = false;
- this.lines = [];
- this.states = [];
- this.currentLine = 0;
- this.tokenizer = tokenizer;
- var self = this;
- this.$worker = function () {
- if (!self.running) {
- return;
+ace.define("ace/apply_delta",["require","exports","module"], function(require, exports, module){"use strict";
+function throwDeltaError(delta, errorText) {
+ console.log("Invalid Delta:", delta);
+ throw "Invalid Delta: " + errorText;
+}
+function positionInDocument(docLines, position) {
+ return position.row >= 0 && position.row < docLines.length &&
+ position.column >= 0 && position.column <= docLines[position.row].length;
+}
+function validateDelta(docLines, delta) {
+ if (delta.action != "insert" && delta.action != "remove")
+ throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
+ if (!(delta.lines instanceof Array))
+ throwDeltaError(delta, "delta.lines must be an Array");
+ if (!delta.start || !delta.end)
+ throwDeltaError(delta, "delta.start/end must be an present");
+ var start = delta.start;
+ if (!positionInDocument(docLines, delta.start))
+ throwDeltaError(delta, "delta.start must be contained in document");
+ var end = delta.end;
+ if (delta.action == "remove" && !positionInDocument(docLines, end))
+ throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
+ var numRangeRows = end.row - start.row;
+ var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
+ if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
+ throwDeltaError(delta, "delta.range must match delta lines");
+}
+exports.applyDelta = function (docLines, delta, doNotValidate) {
+ var row = delta.start.row;
+ var startColumn = delta.start.column;
+ var line = docLines[row] || "";
+ switch (delta.action) {
+ case "insert":
+ var lines = delta.lines;
+ if (lines.length === 1) {
+ docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
}
- var workerStart = new Date();
- var currentLine = self.currentLine;
- var endLine = -1;
- var doc = self.doc;
- var startLine = currentLine;
- while (self.lines[currentLine])
- currentLine++;
- var len = doc.getLength();
- var processedLines = 0;
- self.running = false;
- while (currentLine < len) {
- self.$tokenizeRow(currentLine);
- endLine = currentLine;
- do {
- currentLine++;
- } while (self.lines[currentLine]);
- processedLines++;
- if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {
- self.running = setTimeout(self.$worker, 20);
- break;
- }
+ else {
+ var args = [row, 1].concat(delta.lines);
+ docLines.splice.apply(docLines, args);
+ docLines[row] = line.substring(0, startColumn) + docLines[row];
+ docLines[row + delta.lines.length - 1] += line.substring(startColumn);
}
- self.currentLine = currentLine;
- if (endLine == -1)
- endLine = currentLine;
- if (startLine <= endLine)
- self.fireUpdateEvent(startLine, endLine);
- };
+ break;
+ case "remove":
+ var endColumn = delta.end.column;
+ var endRow = delta.end.row;
+ if (row === endRow) {
+ docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
+ }
+ else {
+ docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
+ }
+ break;
}
- BackgroundTokenizer.prototype.setTokenizer = function (tokenizer) {
- this.tokenizer = tokenizer;
- this.lines = [];
- this.states = [];
- this.start(0);
- };
- BackgroundTokenizer.prototype.setDocument = function (doc) {
- this.doc = doc;
- this.lines = [];
- this.states = [];
- this.stop();
- };
- BackgroundTokenizer.prototype.fireUpdateEvent = function (firstRow, lastRow) {
- var data = {
- first: firstRow,
- last: lastRow
- };
- this._signal("update", { data: data });
+};
+
+});
+
+ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict";
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Anchor = /** @class */ (function () {
+ function Anchor(doc, row, column) {
+ this.$onChange = this.onChange.bind(this);
+ this.attach(doc);
+ if (typeof row != "number")
+ this.setPosition(row.row, row.column);
+ else
+ this.setPosition(row, column);
+ }
+ Anchor.prototype.getPosition = function () {
+ return this.$clipPositionToDocument(this.row, this.column);
};
- BackgroundTokenizer.prototype.start = function (startRow) {
- this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());
- this.lines.splice(this.currentLine, this.lines.length);
- this.states.splice(this.currentLine, this.states.length);
- this.stop();
- this.running = setTimeout(this.$worker, 700);
+ Anchor.prototype.getDocument = function () {
+ return this.document;
};
- BackgroundTokenizer.prototype.scheduleStart = function () {
- if (!this.running)
- this.running = setTimeout(this.$worker, 700);
+ Anchor.prototype.onChange = function (delta) {
+ if (delta.start.row == delta.end.row && delta.start.row != this.row)
+ return;
+ if (delta.start.row > this.row)
+ return;
+ var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
+ this.setPosition(point.row, point.column, true);
};
- BackgroundTokenizer.prototype.$updateOnChange = function (delta) {
- var startRow = delta.start.row;
- var len = delta.end.row - startRow;
- if (len === 0) {
- this.lines[startRow] = null;
- }
- else if (delta.action == "remove") {
- this.lines.splice(startRow, len + 1, null);
- this.states.splice(startRow, len + 1, null);
+ Anchor.prototype.setPosition = function (row, column, noClip) {
+ var pos;
+ if (noClip) {
+ pos = {
+ row: row,
+ column: column
+ };
}
else {
- var args = Array(len + 1);
- args.unshift(startRow, 1);
- this.lines.splice.apply(this.lines, args);
- this.states.splice.apply(this.states, args);
+ pos = this.$clipPositionToDocument(row, column);
}
- this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());
- this.stop();
- };
- BackgroundTokenizer.prototype.stop = function () {
- if (this.running)
- clearTimeout(this.running);
- this.running = false;
+ if (this.row == pos.row && this.column == pos.column)
+ return;
+ var old = {
+ row: this.row,
+ column: this.column
+ };
+ this.row = pos.row;
+ this.column = pos.column;
+ this._signal("change", {
+ old: old,
+ value: pos
+ });
};
- BackgroundTokenizer.prototype.getTokens = function (row) {
- return this.lines[row] || this.$tokenizeRow(row);
+ Anchor.prototype.detach = function () {
+ this.document.off("change", this.$onChange);
};
- BackgroundTokenizer.prototype.getState = function (row) {
- if (this.currentLine == row)
- this.$tokenizeRow(row);
- return this.states[row] || "start";
+ Anchor.prototype.attach = function (doc) {
+ this.document = doc || this.document;
+ this.document.on("change", this.$onChange);
};
- BackgroundTokenizer.prototype.$tokenizeRow = function (row) {
- var line = this.doc.getLine(row);
- var state = this.states[row - 1];
- var data = this.tokenizer.getLineTokens(line, state, row);
- if (this.states[row] + "" !== data.state + "") {
- this.states[row] = data.state;
- this.lines[row + 1] = null;
- if (this.currentLine > row + 1)
- this.currentLine = row + 1;
+ Anchor.prototype.$clipPositionToDocument = function (row, column) {
+ var pos = {};
+ if (row >= this.document.getLength()) {
+ pos.row = Math.max(0, this.document.getLength() - 1);
+ pos.column = this.document.getLine(pos.row).length;
}
- else if (this.currentLine == row) {
- this.currentLine = row + 1;
+ else if (row < 0) {
+ pos.row = 0;
+ pos.column = 0;
}
- return this.lines[row] = data.tokens;
- };
- BackgroundTokenizer.prototype.cleanup = function () {
- this.running = false;
- this.lines = [];
- this.states = [];
- this.currentLine = 0;
- this.removeAllListeners();
+ else {
+ pos.row = row;
+ pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
+ }
+ if (column < 0)
+ pos.column = 0;
+ return pos;
};
- return BackgroundTokenizer;
+ return Anchor;
}());
-oop.implement(BackgroundTokenizer.prototype, EventEmitter);
-exports.BackgroundTokenizer = BackgroundTokenizer;
-
-});
-
-ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"], function(require, exports, module){"use strict";
-var lang = require("./lib/lang");
-var Range = require("./range").Range;
-var SearchHighlight = /** @class */ (function () {
- function SearchHighlight(regExp, clazz, type) {
- if (type === void 0) { type = "text"; }
- this.setRegexp(regExp);
- this.clazz = clazz;
- this.type = type;
+Anchor.prototype.$insertRight = false;
+oop.implement(Anchor.prototype, EventEmitter);
+function $pointsInOrder(point1, point2, equalPointsInOrder) {
+ var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
+ return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
+}
+function $getTransformedPoint(delta, point, moveIfEqual) {
+ var deltaIsInsert = delta.action == "insert";
+ var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
+ var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
+ var deltaStart = delta.start;
+ var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
+ if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
+ return {
+ row: point.row,
+ column: point.column
+ };
}
- SearchHighlight.prototype.setRegexp = function (regExp) {
- if (this.regExp + "" == regExp + "")
- return;
- this.regExp = regExp;
- this.cache = [];
- };
- SearchHighlight.prototype.update = function (html, markerLayer, session, config) {
- if (!this.regExp)
- return;
- var start = config.firstRow, end = config.lastRow;
- var renderedMarkerRanges = {};
- for (var i = start; i <= end; i++) {
- var ranges = this.cache[i];
- if (ranges == null) {
- ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);
- if (ranges.length > this.MAX_RANGES)
- ranges = ranges.slice(0, this.MAX_RANGES);
- ranges = ranges.map(function (match) {
- return new Range(i, match.offset, i, match.offset + match.length);
- });
- this.cache[i] = ranges.length ? ranges : "";
- }
- for (var j = ranges.length; j--;) {
- var rangeToAddMarkerTo = ranges[j].toScreenRange(session);
- var rangeAsString = rangeToAddMarkerTo.toString();
- if (renderedMarkerRanges[rangeAsString])
- continue;
- renderedMarkerRanges[rangeAsString] = true;
- markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config);
- }
- }
+ if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
+ return {
+ row: point.row + deltaRowShift,
+ column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
+ };
+ }
+ return {
+ row: deltaStart.row,
+ column: deltaStart.column
};
- return SearchHighlight;
-}());
-SearchHighlight.prototype.MAX_RANGES = 500;
-exports.SearchHighlight = SearchHighlight;
+}
+exports.Anchor = Anchor;
});
-ace.define("ace/undomanager",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var UndoManager = /** @class */ (function () {
- function UndoManager() {
- this.$keepRedoStack;
- this.$maxRev = 0;
- this.$fromUndo = false;
- this.$undoDepth = Infinity;
- this.reset();
+ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"], function(require, exports, module){"use strict";
+var oop = require("./lib/oop");
+var applyDelta = require("./apply_delta").applyDelta;
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Range = require("./range").Range;
+var Anchor = require("./anchor").Anchor;
+var Document = /** @class */ (function () {
+ function Document(textOrLines) {
+ this.$lines = [""];
+ if (textOrLines.length === 0) {
+ this.$lines = [""];
+ }
+ else if (Array.isArray(textOrLines)) {
+ this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
+ }
+ else {
+ this.insert({ row: 0, column: 0 }, textOrLines);
+ }
}
- UndoManager.prototype.addSession = function (session) {
- this.$session = session;
+ Document.prototype.setValue = function (text) {
+ var len = this.getLength() - 1;
+ this.remove(new Range(0, 0, len, this.getLine(len).length));
+ this.insert({ row: 0, column: 0 }, text || "");
};
- UndoManager.prototype.add = function (delta, allowMerge, session) {
- if (this.$fromUndo)
- return;
- if (delta == this.$lastDelta)
- return;
- if (!this.$keepRedoStack)
- this.$redoStack.length = 0;
- if (allowMerge === false || !this.lastDeltas) {
- this.lastDeltas = [];
- var undoStackLength = this.$undoStack.length;
- if (undoStackLength > this.$undoDepth - 1) {
- this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);
- }
- this.$undoStack.push(this.lastDeltas);
- delta.id = this.$rev = ++this.$maxRev;
- }
- if (delta.action == "remove" || delta.action == "insert")
- this.$lastDelta = delta;
- this.lastDeltas.push(delta);
+ Document.prototype.getValue = function () {
+ return this.getAllLines().join(this.getNewLineCharacter());
};
- UndoManager.prototype.addSelection = function (selection, rev) {
- this.selections.push({
- value: selection,
- rev: rev || this.$rev
- });
+ Document.prototype.createAnchor = function (row, column) {
+ return new Anchor(this, row, column);
};
- UndoManager.prototype.startNewGroup = function () {
- this.lastDeltas = null;
- return this.$rev;
+ Document.prototype.$detectNewLine = function (text) {
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
+ this.$autoNewLine = match ? match[1] : "\n";
+ this._signal("changeNewLineMode");
};
- UndoManager.prototype.markIgnored = function (from, to) {
- if (to == null)
- to = this.$rev + 1;
- var stack = this.$undoStack;
- for (var i = stack.length; i--;) {
- var delta = stack[i][0];
- if (delta.id <= from)
- break;
- if (delta.id < to)
- delta.ignore = true;
+ Document.prototype.getNewLineCharacter = function () {
+ switch (this.$newLineMode) {
+ case "windows":
+ return "\r\n";
+ case "unix":
+ return "\n";
+ default:
+ return this.$autoNewLine || "\n";
}
- this.lastDeltas = null;
};
- UndoManager.prototype.getSelection = function (rev, after) {
- var stack = this.selections;
- for (var i = stack.length; i--;) {
- var selection = stack[i];
- if (selection.rev < rev) {
- if (after)
- selection = stack[i + 1];
- return selection;
- }
- }
+ Document.prototype.setNewLineMode = function (newLineMode) {
+ if (this.$newLineMode === newLineMode)
+ return;
+ this.$newLineMode = newLineMode;
+ this._signal("changeNewLineMode");
};
- UndoManager.prototype.getRevision = function () {
- return this.$rev;
+ Document.prototype.getNewLineMode = function () {
+ return this.$newLineMode;
};
- UndoManager.prototype.getDeltas = function (from, to) {
- if (to == null)
- to = this.$rev + 1;
- var stack = this.$undoStack;
- var end = null, start = 0;
- for (var i = stack.length; i--;) {
- var delta = stack[i][0];
- if (delta.id < to && !end)
- end = i + 1;
- if (delta.id <= from) {
- start = i + 1;
- break;
- }
- }
- return stack.slice(start, end);
+ Document.prototype.isNewLine = function (text) {
+ return (text == "\r\n" || text == "\r" || text == "\n");
};
- UndoManager.prototype.getChangedRanges = function (from, to) {
- if (to == null)
- to = this.$rev + 1;
- };
- UndoManager.prototype.getChangedLines = function (from, to) {
- if (to == null)
- to = this.$rev + 1;
- };
- UndoManager.prototype.undo = function (session, dontSelect) {
- this.lastDeltas = null;
- var stack = this.$undoStack;
- if (!rearrangeUndoStack(stack, stack.length))
- return;
- if (!session)
- session = this.$session;
- if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)
- this.$redoStack = [];
- this.$fromUndo = true;
- var deltaSet = stack.pop();
- var undoSelectionRange = null;
- if (deltaSet) {
- undoSelectionRange = session.undoChanges(deltaSet, dontSelect);
- this.$redoStack.push(deltaSet);
- this.$syncRev();
- }
- this.$fromUndo = false;
- return undoSelectionRange;
+ Document.prototype.getLine = function (row) {
+ return this.$lines[row] || "";
};
- UndoManager.prototype.redo = function (session, dontSelect) {
- this.lastDeltas = null;
- if (!session)
- session = this.$session;
- this.$fromUndo = true;
- if (this.$redoStackBaseRev != this.$rev) {
- var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);
- rebaseRedoStack(this.$redoStack, diff);
- this.$redoStackBaseRev = this.$rev;
- this.$redoStack.forEach(function (x) {
- x[0].id = ++this.$maxRev;
- }, this);
- }
- var deltaSet = this.$redoStack.pop();
- var redoSelectionRange = null;
- if (deltaSet) {
- redoSelectionRange = session.redoChanges(deltaSet, dontSelect);
- this.$undoStack.push(deltaSet);
- this.$syncRev();
- }
- this.$fromUndo = false;
- return redoSelectionRange;
+ Document.prototype.getLines = function (firstRow, lastRow) {
+ return this.$lines.slice(firstRow, lastRow + 1);
};
- UndoManager.prototype.$syncRev = function () {
- var stack = this.$undoStack;
- var nextDelta = stack[stack.length - 1];
- var id = nextDelta && nextDelta[0].id || 0;
- this.$redoStackBaseRev = id;
- this.$rev = id;
+ Document.prototype.getAllLines = function () {
+ return this.getLines(0, this.getLength());
};
- UndoManager.prototype.reset = function () {
- this.lastDeltas = null;
- this.$lastDelta = null;
- this.$undoStack = [];
- this.$redoStack = [];
- this.$rev = 0;
- this.mark = 0;
- this.$redoStackBaseRev = this.$rev;
- this.selections = [];
+ Document.prototype.getLength = function () {
+ return this.$lines.length;
};
- UndoManager.prototype.canUndo = function () {
- return this.$undoStack.length > 0;
+ Document.prototype.getTextRange = function (range) {
+ return this.getLinesForRange(range).join(this.getNewLineCharacter());
};
- UndoManager.prototype.canRedo = function () {
- return this.$redoStack.length > 0;
+ Document.prototype.getLinesForRange = function (range) {
+ var lines;
+ if (range.start.row === range.end.row) {
+ lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
+ }
+ else {
+ lines = this.getLines(range.start.row, range.end.row);
+ lines[0] = (lines[0] || "").substring(range.start.column);
+ var l = lines.length - 1;
+ if (range.end.row - range.start.row == l)
+ lines[l] = lines[l].substring(0, range.end.column);
+ }
+ return lines;
};
- UndoManager.prototype.bookmark = function (rev) {
- if (rev == undefined)
- rev = this.$rev;
- this.mark = rev;
+ Document.prototype.insertLines = function (row, lines) {
+ console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
+ return this.insertFullLines(row, lines);
};
- UndoManager.prototype.isAtBookmark = function () {
- return this.$rev === this.mark;
+ Document.prototype.removeLines = function (firstRow, lastRow) {
+ console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
+ return this.removeFullLines(firstRow, lastRow);
};
- UndoManager.prototype.toJSON = function () {
- return {
- $redoStack: this.$redoStack,
- $undoStack: this.$undoStack
- };
+ Document.prototype.insertNewLine = function (position) {
+ console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
+ return this.insertMergedLines(position, ["", ""]);
};
- UndoManager.prototype.fromJSON = function (json) {
- this.reset();
- this.$undoStack = json.$undoStack;
- this.$redoStack = json.$redoStack;
+ Document.prototype.insert = function (position, text) {
+ if (this.getLength() <= 1)
+ this.$detectNewLine(text);
+ return this.insertMergedLines(position, this.$split(text));
};
- UndoManager.prototype.$prettyPrint = function (delta) {
- if (delta)
- return stringifyDelta(delta);
- return stringifyDelta(this.$undoStack) + "\n---\n" + stringifyDelta(this.$redoStack);
+ Document.prototype.insertInLine = function (position, text) {
+ var start = this.clippedPos(position.row, position.column);
+ var end = this.pos(position.row, position.column + text.length);
+ this.applyDelta({
+ start: start,
+ end: end,
+ action: "insert",
+ lines: [text]
+ }, true);
+ return this.clonePos(end);
};
- return UndoManager;
-}());
-UndoManager.prototype.hasUndo = UndoManager.prototype.canUndo;
-UndoManager.prototype.hasRedo = UndoManager.prototype.canRedo;
-UndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark;
-UndoManager.prototype.markClean = UndoManager.prototype.bookmark;
-function rearrangeUndoStack(stack, pos) {
- for (var i = pos; i--;) {
- var deltaSet = stack[i];
- if (deltaSet && !deltaSet[0].ignore) {
- while (i < pos - 1) {
- var swapped = swapGroups(stack[i], stack[i + 1]);
- stack[i] = swapped[0];
- stack[i + 1] = swapped[1];
- i++;
- }
- return true;
+ Document.prototype.clippedPos = function (row, column) {
+ var length = this.getLength();
+ if (row === undefined) {
+ row = length;
}
- }
-}
-var Range = require("./range").Range;
-var cmp = Range.comparePoints;
-var comparePoints = Range.comparePoints;
-function $updateMarkers(delta) {
- var isInsert = delta.action == "insert";
- var start = delta.start;
- var end = delta.end;
- var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);
- var colShift = (end.column - start.column) * (isInsert ? 1 : -1);
- if (isInsert)
- end = start;
- for (var i in this.marks) {
- var point = this.marks[i];
- var cmp = comparePoints(point, start);
- if (cmp < 0) {
- continue; // delta starts after the range
+ else if (row < 0) {
+ row = 0;
}
- if (cmp === 0) {
- if (isInsert) {
- if (point.bias == 1) {
- cmp = 1;
- }
- else {
- point.bias == -1;
- continue;
- }
- }
+ else if (row >= length) {
+ row = length - 1;
+ column = undefined;
}
- var cmp2 = isInsert ? cmp : comparePoints(point, end);
- if (cmp2 > 0) {
- point.row += rowShift;
- point.column += point.row == end.row ? colShift : 0;
- continue;
+ var line = this.getLine(row);
+ if (column == undefined)
+ column = line.length;
+ column = Math.min(Math.max(column, 0), line.length);
+ return { row: row, column: column };
+ };
+ Document.prototype.clonePos = function (pos) {
+ return { row: pos.row, column: pos.column };
+ };
+ Document.prototype.pos = function (row, column) {
+ return { row: row, column: column };
+ };
+ Document.prototype.$clipPosition = function (position) {
+ var length = this.getLength();
+ if (position.row >= length) {
+ position.row = Math.max(0, length - 1);
+ position.column = this.getLine(length - 1).length;
}
- if (!isInsert && cmp2 <= 0) {
- point.row = start.row;
- point.column = start.column;
- if (cmp2 === 0)
- point.bias = 1;
+ else {
+ position.row = Math.max(0, position.row);
+ position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
}
- }
-}
-function clonePos(pos) {
- return { row: pos.row, column: pos.column };
-}
-function cloneDelta(d) {
- return {
- start: clonePos(d.start),
- end: clonePos(d.end),
- action: d.action,
- lines: d.lines.slice()
+ return position;
};
-}
-function stringifyDelta(d) {
- d = d || this;
- if (Array.isArray(d)) {
- return d.map(stringifyDelta).join("\n");
- }
- var type = "";
- if (d.action) {
- type = d.action == "insert" ? "+" : "-";
- type += "[" + d.lines + "]";
- }
- else if (d.value) {
- if (Array.isArray(d.value)) {
- type = d.value.map(stringifyRange).join("\n");
+ Document.prototype.insertFullLines = function (row, lines) {
+ row = Math.min(Math.max(row, 0), this.getLength());
+ var column = 0;
+ if (row < this.getLength()) {
+ lines = lines.concat([""]);
+ column = 0;
}
else {
- type = stringifyRange(d.value);
+ lines = [""].concat(lines);
+ row--;
+ column = this.$lines[row].length;
}
- }
- if (d.start) {
- type += stringifyRange(d);
- }
- if (d.id || d.rev) {
- type += "\t(" + (d.id || d.rev) + ")";
- }
- return type;
-}
-function stringifyRange(r) {
- return r.start.row + ":" + r.start.column
- + "=>" + r.end.row + ":" + r.end.column;
-}
-function swap(d1, d2) {
- var i1 = d1.action == "insert";
- var i2 = d2.action == "insert";
- if (i1 && i2) {
- if (cmp(d2.start, d1.end) >= 0) {
- shift(d2, d1, -1);
+ this.insertMergedLines({ row: row, column: column }, lines);
+ };
+ Document.prototype.insertMergedLines = function (position, lines) {
+ var start = this.clippedPos(position.row, position.column);
+ var end = {
+ row: start.row + lines.length - 1,
+ column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
+ };
+ this.applyDelta({
+ start: start,
+ end: end,
+ action: "insert",
+ lines: lines
+ });
+ return this.clonePos(end);
+ };
+ Document.prototype.remove = function (range) {
+ var start = this.clippedPos(range.start.row, range.start.column);
+ var end = this.clippedPos(range.end.row, range.end.column);
+ this.applyDelta({
+ start: start,
+ end: end,
+ action: "remove",
+ lines: this.getLinesForRange({ start: start, end: end })
+ });
+ return this.clonePos(start);
+ };
+ Document.prototype.removeInLine = function (row, startColumn, endColumn) {
+ var start = this.clippedPos(row, startColumn);
+ var end = this.clippedPos(row, endColumn);
+ this.applyDelta({
+ start: start,
+ end: end,
+ action: "remove",
+ lines: this.getLinesForRange({ start: start, end: end })
+ }, true);
+ return this.clonePos(start);
+ };
+ Document.prototype.removeFullLines = function (firstRow, lastRow) {
+ firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
+ lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
+ var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
+ var deleteLastNewLine = lastRow < this.getLength() - 1;
+ var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);
+ var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);
+ var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);
+ var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);
+ var range = new Range(startRow, startCol, endRow, endCol);
+ var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
+ this.applyDelta({
+ start: range.start,
+ end: range.end,
+ action: "remove",
+ lines: this.getLinesForRange(range)
+ });
+ return deletedLines;
+ };
+ Document.prototype.removeNewLine = function (row) {
+ if (row < this.getLength() - 1 && row >= 0) {
+ this.applyDelta({
+ start: this.pos(row, this.getLine(row).length),
+ end: this.pos(row + 1, 0),
+ action: "remove",
+ lines: ["", ""]
+ });
}
- else if (cmp(d2.start, d1.start) <= 0) {
- shift(d1, d2, +1);
+ };
+ Document.prototype.replace = function (range, text) {
+ if (!(range instanceof Range))
+ range = Range.fromPoints(range.start, range.end);
+ if (text.length === 0 && range.isEmpty())
+ return range.start;
+ if (text == this.getTextRange(range))
+ return range.end;
+ this.remove(range);
+ var end;
+ if (text) {
+ end = this.insert(range.start, text);
}
else {
- return null;
- }
- }
- else if (i1 && !i2) {
- if (cmp(d2.start, d1.end) >= 0) {
- shift(d2, d1, -1);
+ end = range.start;
}
- else if (cmp(d2.end, d1.start) <= 0) {
- shift(d1, d2, -1);
+ return end;
+ };
+ Document.prototype.applyDeltas = function (deltas) {
+ for (var i = 0; i < deltas.length; i++) {
+ this.applyDelta(deltas[i]);
}
- else {
- return null;
+ };
+ Document.prototype.revertDeltas = function (deltas) {
+ for (var i = deltas.length - 1; i >= 0; i--) {
+ this.revertDelta(deltas[i]);
}
- }
- else if (!i1 && i2) {
- if (cmp(d2.start, d1.start) >= 0) {
- shift(d2, d1, +1);
+ };
+ Document.prototype.applyDelta = function (delta, doNotValidate) {
+ var isInsert = delta.action == "insert";
+ if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
+ : !Range.comparePoints(delta.start, delta.end)) {
+ return;
}
- else if (cmp(d2.start, d1.start) <= 0) {
- shift(d1, d2, +1);
+ if (isInsert && delta.lines.length > 20000) {
+ this.$splitAndapplyLargeDelta(delta, 20000);
}
else {
- return null;
+ applyDelta(this.$lines, delta, doNotValidate);
+ this._signal("change", delta);
}
- }
- else if (!i1 && !i2) {
- if (cmp(d2.start, d1.start) >= 0) {
- shift(d2, d1, +1);
+ };
+ Document.prototype.$safeApplyDelta = function (delta) {
+ var docLength = this.$lines.length;
+ if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
+ || delta.action == "insert" && delta.start.row <= docLength) {
+ this.applyDelta(delta);
}
- else if (cmp(d2.end, d1.start) <= 0) {
- shift(d1, d2, -1);
+ };
+ Document.prototype.$splitAndapplyLargeDelta = function (delta, MAX) {
+ var lines = delta.lines;
+ var l = lines.length - MAX + 1;
+ var row = delta.start.row;
+ var column = delta.start.column;
+ for (var from = 0, to = 0; from < l; from = to) {
+ to += MAX - 1;
+ var chunk = lines.slice(from, to);
+ chunk.push("");
+ this.applyDelta({
+ start: this.pos(row + from, column),
+ end: this.pos(row + to, column = 0),
+ action: delta.action,
+ lines: chunk
+ }, true);
}
- else {
- return null;
+ delta.lines = lines.slice(from);
+ delta.start.row = row + from;
+ delta.start.column = column;
+ this.applyDelta(delta, true);
+ };
+ Document.prototype.revertDelta = function (delta) {
+ this.$safeApplyDelta({
+ start: this.clonePos(delta.start),
+ end: this.clonePos(delta.end),
+ action: (delta.action == "insert" ? "remove" : "insert"),
+ lines: delta.lines.slice()
+ });
+ };
+ Document.prototype.indexToPosition = function (index, startRow) {
+ var lines = this.$lines || this.getAllLines();
+ var newlineLength = this.getNewLineCharacter().length;
+ for (var i = startRow || 0, l = lines.length; i < l; i++) {
+ index -= lines[i].length + newlineLength;
+ if (index < 0)
+ return { row: i, column: index + lines[i].length + newlineLength };
}
- }
- return [d2, d1];
-}
-function swapGroups(ds1, ds2) {
- for (var i = ds1.length; i--;) {
- for (var j = 0; j < ds2.length; j++) {
- if (!swap(ds1[i], ds2[j])) {
- while (i < ds1.length) {
- while (j--) {
- swap(ds2[j], ds1[i]);
- }
- j = ds2.length;
- i++;
+ return { row: l - 1, column: index + lines[l - 1].length + newlineLength };
+ };
+ Document.prototype.positionToIndex = function (pos, startRow) {
+ var lines = this.$lines || this.getAllLines();
+ var newlineLength = this.getNewLineCharacter().length;
+ var index = 0;
+ var row = Math.min(pos.row, lines.length);
+ for (var i = startRow || 0; i < row; ++i)
+ index += lines[i].length + newlineLength;
+ return index + pos.column;
+ };
+ Document.prototype.$split = function (text) {
+ return text.split(/\r\n|\r|\n/);
+ };
+ return Document;
+}());
+Document.prototype.$autoNewLine = "";
+Document.prototype.$newLineMode = "auto";
+oop.implement(Document.prototype, EventEmitter);
+exports.Document = Document;
+
+});
+
+ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"], function(require, exports, module){"use strict";
+var oop = require("./lib/oop");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var BackgroundTokenizer = /** @class */ (function () {
+ function BackgroundTokenizer(tokenizer, session) {
+ this.running = false;
+ this.lines = [];
+ this.states = [];
+ this.currentLine = 0;
+ this.tokenizer = tokenizer;
+ var self = this;
+ this.$worker = function () {
+ if (!self.running) {
+ return;
+ }
+ var workerStart = new Date();
+ var currentLine = self.currentLine;
+ var endLine = -1;
+ var doc = self.doc;
+ var startLine = currentLine;
+ while (self.lines[currentLine])
+ currentLine++;
+ var len = doc.getLength();
+ var processedLines = 0;
+ self.running = false;
+ while (currentLine < len) {
+ self.$tokenizeRow(currentLine);
+ endLine = currentLine;
+ do {
+ currentLine++;
+ } while (self.lines[currentLine]);
+ processedLines++;
+ if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {
+ self.running = setTimeout(self.$worker, 20);
+ break;
}
- return [ds1, ds2];
}
- }
- }
- ds1.selectionBefore = ds2.selectionBefore =
- ds1.selectionAfter = ds2.selectionAfter = null;
- return [ds2, ds1];
-}
-function xform(d1, c1) {
- var i1 = d1.action == "insert";
- var i2 = c1.action == "insert";
- if (i1 && i2) {
- if (cmp(d1.start, c1.start) < 0) {
- shift(c1, d1, 1);
- }
- else {
- shift(d1, c1, 1);
- }
- }
- else if (i1 && !i2) {
- if (cmp(d1.start, c1.end) >= 0) {
- shift(d1, c1, -1);
- }
- else if (cmp(d1.start, c1.start) <= 0) {
- shift(c1, d1, +1);
- }
- else {
- shift(d1, Range.fromPoints(c1.start, d1.start), -1);
- shift(c1, d1, +1);
- }
+ self.currentLine = currentLine;
+ if (endLine == -1)
+ endLine = currentLine;
+ if (startLine <= endLine)
+ self.fireUpdateEvent(startLine, endLine);
+ };
}
- else if (!i1 && i2) {
- if (cmp(c1.start, d1.end) >= 0) {
- shift(c1, d1, -1);
+ BackgroundTokenizer.prototype.setTokenizer = function (tokenizer) {
+ this.tokenizer = tokenizer;
+ this.lines = [];
+ this.states = [];
+ this.start(0);
+ };
+ BackgroundTokenizer.prototype.setDocument = function (doc) {
+ this.doc = doc;
+ this.lines = [];
+ this.states = [];
+ this.stop();
+ };
+ BackgroundTokenizer.prototype.fireUpdateEvent = function (firstRow, lastRow) {
+ var data = {
+ first: firstRow,
+ last: lastRow
+ };
+ this._signal("update", { data: data });
+ };
+ BackgroundTokenizer.prototype.start = function (startRow) {
+ this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());
+ this.lines.splice(this.currentLine, this.lines.length);
+ this.states.splice(this.currentLine, this.states.length);
+ this.stop();
+ this.running = setTimeout(this.$worker, 700);
+ };
+ BackgroundTokenizer.prototype.scheduleStart = function () {
+ if (!this.running)
+ this.running = setTimeout(this.$worker, 700);
+ };
+ BackgroundTokenizer.prototype.$updateOnChange = function (delta) {
+ var startRow = delta.start.row;
+ var len = delta.end.row - startRow;
+ if (len === 0) {
+ this.lines[startRow] = null;
}
- else if (cmp(c1.start, d1.start) <= 0) {
- shift(d1, c1, +1);
+ else if (delta.action == "remove") {
+ this.lines.splice(startRow, len + 1, null);
+ this.states.splice(startRow, len + 1, null);
}
else {
- shift(c1, Range.fromPoints(d1.start, c1.start), -1);
- shift(d1, c1, +1);
- }
- }
- else if (!i1 && !i2) {
- if (cmp(c1.start, d1.end) >= 0) {
- shift(c1, d1, -1);
+ var args = Array(len + 1);
+ args.unshift(startRow, 1);
+ this.lines.splice.apply(this.lines, args);
+ this.states.splice.apply(this.states, args);
}
- else if (cmp(c1.end, d1.start) <= 0) {
- shift(d1, c1, -1);
+ this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());
+ this.stop();
+ };
+ BackgroundTokenizer.prototype.stop = function () {
+ if (this.running)
+ clearTimeout(this.running);
+ this.running = false;
+ };
+ BackgroundTokenizer.prototype.getTokens = function (row) {
+ return this.lines[row] || this.$tokenizeRow(row);
+ };
+ BackgroundTokenizer.prototype.getState = function (row) {
+ if (this.currentLine == row)
+ this.$tokenizeRow(row);
+ return this.states[row] || "start";
+ };
+ BackgroundTokenizer.prototype.$tokenizeRow = function (row) {
+ var line = this.doc.getLine(row);
+ var state = this.states[row - 1];
+ var data = this.tokenizer.getLineTokens(line, state, row);
+ if (this.states[row] + "" !== data.state + "") {
+ this.states[row] = data.state;
+ this.lines[row + 1] = null;
+ if (this.currentLine > row + 1)
+ this.currentLine = row + 1;
}
- else {
- var before, after;
- if (cmp(d1.start, c1.start) < 0) {
- before = d1;
- d1 = splitDelta(d1, c1.start);
- }
- if (cmp(d1.end, c1.end) > 0) {
- after = splitDelta(d1, c1.end);
- }
- shiftPos(c1.end, d1.start, d1.end, -1);
- if (after && !before) {
- d1.lines = after.lines;
- d1.start = after.start;
- d1.end = after.end;
- after = d1;
- }
- return [c1, before, after].filter(Boolean);
+ else if (this.currentLine == row) {
+ this.currentLine = row + 1;
}
+ return this.lines[row] = data.tokens;
+ };
+ BackgroundTokenizer.prototype.cleanup = function () {
+ this.running = false;
+ this.lines = [];
+ this.states = [];
+ this.currentLine = 0;
+ this.removeAllListeners();
+ };
+ return BackgroundTokenizer;
+}());
+oop.implement(BackgroundTokenizer.prototype, EventEmitter);
+exports.BackgroundTokenizer = BackgroundTokenizer;
+
+});
+
+ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"], function(require, exports, module){"use strict";
+var lang = require("./lib/lang");
+var Range = require("./range").Range;
+var SearchHighlight = /** @class */ (function () {
+ function SearchHighlight(regExp, clazz, type) {
+ if (type === void 0) { type = "text"; }
+ this.setRegexp(regExp);
+ this.clazz = clazz;
+ this.type = type;
+ this.docLen = 0;
}
- return [c1, d1];
-}
-function shift(d1, d2, dir) {
- shiftPos(d1.start, d2.start, d2.end, dir);
- shiftPos(d1.end, d2.start, d2.end, dir);
-}
-function shiftPos(pos, start, end, dir) {
- if (pos.row == (dir == 1 ? start : end).row) {
- pos.column += dir * (end.column - start.column);
- }
- pos.row += dir * (end.row - start.row);
-}
-function splitDelta(c, pos) {
- var lines = c.lines;
- var end = c.end;
- c.end = clonePos(pos);
- var rowsBefore = c.end.row - c.start.row;
- var otherLines = lines.splice(rowsBefore, lines.length);
- var col = rowsBefore ? pos.column : pos.column - c.start.column;
- lines.push(otherLines[0].substring(0, col));
- otherLines[0] = otherLines[0].substr(col);
- var rest = {
- start: clonePos(pos),
- end: end,
- lines: otherLines,
- action: c.action
+ SearchHighlight.prototype.setRegexp = function (regExp) {
+ if (this.regExp + "" == regExp + "")
+ return;
+ this.regExp = regExp;
+ this.cache = [];
};
- return rest;
-}
-function moveDeltasByOne(redoStack, d) {
- d = cloneDelta(d);
- for (var j = redoStack.length; j--;) {
- var deltaSet = redoStack[j];
- for (var i = 0; i < deltaSet.length; i++) {
- var x = deltaSet[i];
- var xformed = xform(x, d);
- d = xformed[0];
- if (xformed.length != 2) {
- if (xformed[2]) {
- deltaSet.splice(i + 1, 1, xformed[1], xformed[2]);
- i++;
+ SearchHighlight.prototype.update = function (html, markerLayer, session, config) {
+ if (!this.regExp)
+ return;
+ var start = config.firstRow;
+ var end = config.lastRow;
+ var renderedMarkerRanges = {};
+ var _search = session.$editor.$search;
+ var mtSearch = _search.$isMultilineSearch(session.$editor.getLastSearchOptions());
+ for (var i = start; i <= end; i++) {
+ var ranges = this.cache[i];
+ if (ranges == null || session.getValue().length != this.docLen) {
+ if (mtSearch) {
+ ranges = [];
+ var match = _search.$multiLineForward(session, this.regExp, i, end);
+ if (match) {
+ var end_row = match.endRow <= end ? match.endRow - 1 : end;
+ if (end_row > i)
+ i = end_row;
+ ranges.push(new Range(match.startRow, match.startCol, match.endRow, match.endCol));
+ }
+ if (ranges.length > this.MAX_RANGES)
+ ranges = ranges.slice(0, this.MAX_RANGES);
}
- else if (!xformed[1]) {
- deltaSet.splice(i, 1);
- i--;
+ else {
+ ranges = lang.getMatchOffsets(session.getLine(i), this.regExp);
+ if (ranges.length > this.MAX_RANGES)
+ ranges = ranges.slice(0, this.MAX_RANGES);
+ ranges = ranges.map(function (match) {
+ return new Range(i, match.offset, i, match.offset + match.length);
+ });
}
+ this.cache[i] = ranges.length ? ranges : "";
+ }
+ if (ranges.length === 0)
+ continue;
+ for (var j = ranges.length; j--;) {
+ var rangeToAddMarkerTo = ranges[j].toScreenRange(session);
+ var rangeAsString = rangeToAddMarkerTo.toString();
+ if (renderedMarkerRanges[rangeAsString])
+ continue;
+ renderedMarkerRanges[rangeAsString] = true;
+ markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config);
}
}
- if (!deltaSet.length) {
- redoStack.splice(j, 1);
- }
- }
- return redoStack;
-}
-function rebaseRedoStack(redoStack, deltaSets) {
- for (var i = 0; i < deltaSets.length; i++) {
- var deltas = deltaSets[i];
- for (var j = 0; j < deltas.length; j++) {
- moveDeltasByOne(redoStack, deltas[j]);
- }
- }
-}
-exports.UndoManager = UndoManager;
+ this.docLen = session.getValue().length;
+ };
+ return SearchHighlight;
+}());
+SearchHighlight.prototype.MAX_RANGES = 500;
+exports.SearchHighlight = SearchHighlight;
});
-ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-var FoldLine = /** @class */ (function () {
- function FoldLine(foldData, folds) {
- this.foldData = foldData;
- if (Array.isArray(folds)) {
- this.folds = folds;
- }
- else {
- folds = this.folds = [folds];
- }
- var last = folds[folds.length - 1];
- this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);
- this.start = this.range.start;
- this.end = this.range.end;
- this.folds.forEach(function (fold) {
- fold.setFoldLine(this);
- }, this);
+ace.define("ace/undomanager",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+var UndoManager = /** @class */ (function () {
+ function UndoManager() {
+ this.$keepRedoStack;
+ this.$maxRev = 0;
+ this.$fromUndo = false;
+ this.$undoDepth = Infinity;
+ this.reset();
}
- FoldLine.prototype.shiftRow = function (shift) {
- this.start.row += shift;
- this.end.row += shift;
- this.folds.forEach(function (fold) {
- fold.start.row += shift;
- fold.end.row += shift;
- });
+ UndoManager.prototype.addSession = function (session) {
+ this.$session = session;
};
- FoldLine.prototype.addFold = function (fold) {
- if (fold.sameRow) {
- if (fold.start.row < this.startRow || fold.endRow > this.endRow) {
- throw new Error("Can't add a fold to this FoldLine as it has no connection");
- }
- this.folds.push(fold);
- this.folds.sort(function (a, b) {
- return -a.range.compareEnd(b.start.row, b.start.column);
- });
- if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {
- this.end.row = fold.end.row;
- this.end.column = fold.end.column;
- }
- else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {
- this.start.row = fold.start.row;
- this.start.column = fold.start.column;
+ UndoManager.prototype.add = function (delta, allowMerge, session) {
+ if (this.$fromUndo)
+ return;
+ if (delta == this.$lastDelta)
+ return;
+ if (!this.$keepRedoStack)
+ this.$redoStack.length = 0;
+ if (allowMerge === false || !this.lastDeltas) {
+ this.lastDeltas = [];
+ var undoStackLength = this.$undoStack.length;
+ if (undoStackLength > this.$undoDepth - 1) {
+ this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);
}
+ this.$undoStack.push(this.lastDeltas);
+ delta.id = this.$rev = ++this.$maxRev;
}
- else if (fold.start.row == this.end.row) {
- this.folds.push(fold);
- this.end.row = fold.end.row;
- this.end.column = fold.end.column;
- }
- else if (fold.end.row == this.start.row) {
- this.folds.unshift(fold);
- this.start.row = fold.start.row;
- this.start.column = fold.start.column;
- }
- else {
- throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
- }
- fold.foldLine = this;
+ if (delta.action == "remove" || delta.action == "insert")
+ this.$lastDelta = delta;
+ this.lastDeltas.push(delta);
};
- FoldLine.prototype.containsRow = function (row) {
- return row >= this.start.row && row <= this.end.row;
+ UndoManager.prototype.addSelection = function (selection, rev) {
+ this.selections.push({
+ value: selection,
+ rev: rev || this.$rev
+ });
};
- FoldLine.prototype.walk = function (callback, endRow, endColumn) {
- var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;
- if (endRow == null) {
- endRow = this.end.row;
- endColumn = this.end.column;
- }
- for (var i = 0; i < folds.length; i++) {
- fold = folds[i];
- cmp = fold.range.compareStart(endRow, endColumn);
- if (cmp == -1) {
- callback(null, endRow, endColumn, lastEnd, isNewRow);
- return;
- }
- stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);
- stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);
- if (stop || cmp === 0) {
- return;
- }
- isNewRow = !fold.sameRow;
- lastEnd = fold.end.column;
- }
- callback(null, endRow, endColumn, lastEnd, isNewRow);
+ UndoManager.prototype.startNewGroup = function () {
+ this.lastDeltas = null;
+ return this.$rev;
};
- FoldLine.prototype.getNextFoldTo = function (row, column) {
- var fold, cmp;
- for (var i = 0; i < this.folds.length; i++) {
- fold = this.folds[i];
- cmp = fold.range.compareEnd(row, column);
- if (cmp == -1) {
- return {
- fold: fold,
- kind: "after"
- };
- }
- else if (cmp === 0) {
- return {
- fold: fold,
- kind: "inside"
- };
- }
+ UndoManager.prototype.markIgnored = function (from, to) {
+ if (to == null)
+ to = this.$rev + 1;
+ var stack = this.$undoStack;
+ for (var i = stack.length; i--;) {
+ var delta = stack[i][0];
+ if (delta.id <= from)
+ break;
+ if (delta.id < to)
+ delta.ignore = true;
}
- return null;
+ this.lastDeltas = null;
};
- FoldLine.prototype.addRemoveChars = function (row, column, len) {
- var ret = this.getNextFoldTo(row, column), fold, folds;
- if (ret) {
- fold = ret.fold;
- if (ret.kind == "inside"
- && fold.start.column != column
- && fold.start.row != row) {
- window.console && window.console.log(row, column, fold);
- }
- else if (fold.start.row == row) {
- folds = this.folds;
- var i = folds.indexOf(fold);
- if (i === 0) {
- this.start.column += len;
- }
- for (i; i < folds.length; i++) {
- fold = folds[i];
- fold.start.column += len;
- if (!fold.sameRow) {
- return;
- }
- fold.end.column += len;
- }
- this.end.column += len;
+ UndoManager.prototype.getSelection = function (rev, after) {
+ var stack = this.selections;
+ for (var i = stack.length; i--;) {
+ var selection = stack[i];
+ if (selection.rev < rev) {
+ if (after)
+ selection = stack[i + 1];
+ return selection;
}
}
};
- FoldLine.prototype.split = function (row, column) {
- var pos = this.getNextFoldTo(row, column);
- if (!pos || pos.kind == "inside")
- return null;
- var fold = pos.fold;
- var folds = this.folds;
- var foldData = this.foldData;
- var i = folds.indexOf(fold);
- var foldBefore = folds[i - 1];
- this.end.row = foldBefore.end.row;
- this.end.column = foldBefore.end.column;
- folds = folds.splice(i, folds.length - i);
- var newFoldLine = new FoldLine(foldData, folds);
- foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);
- return newFoldLine;
+ UndoManager.prototype.getRevision = function () {
+ return this.$rev;
};
- FoldLine.prototype.merge = function (foldLineNext) {
- var folds = foldLineNext.folds;
- for (var i = 0; i < folds.length; i++) {
- this.addFold(folds[i]);
+ UndoManager.prototype.getDeltas = function (from, to) {
+ if (to == null)
+ to = this.$rev + 1;
+ var stack = this.$undoStack;
+ var end = null, start = 0;
+ for (var i = stack.length; i--;) {
+ var delta = stack[i][0];
+ if (delta.id < to && !end)
+ end = i + 1;
+ if (delta.id <= from) {
+ start = i + 1;
+ break;
+ }
}
- var foldData = this.foldData;
- foldData.splice(foldData.indexOf(foldLineNext), 1);
+ return stack.slice(start, end);
};
- FoldLine.prototype.toString = function () {
- var ret = [this.range.toString() + ": ["];
- this.folds.forEach(function (fold) {
- ret.push(" " + fold.toString());
- });
- ret.push("]");
- return ret.join("\n");
+ UndoManager.prototype.getChangedRanges = function (from, to) {
+ if (to == null)
+ to = this.$rev + 1;
};
- FoldLine.prototype.idxToPosition = function (idx) {
- var lastFoldEndColumn = 0;
- for (var i = 0; i < this.folds.length; i++) {
- var fold = this.folds[i];
- idx -= fold.start.column - lastFoldEndColumn;
- if (idx < 0) {
- return {
- row: fold.start.row,
- column: fold.start.column + idx
- };
- }
- idx -= fold.placeholder.length;
- if (idx < 0) {
- return fold.start;
- }
- lastFoldEndColumn = fold.end.column;
+ UndoManager.prototype.getChangedLines = function (from, to) {
+ if (to == null)
+ to = this.$rev + 1;
+ };
+ UndoManager.prototype.undo = function (session, dontSelect) {
+ this.lastDeltas = null;
+ var stack = this.$undoStack;
+ if (!rearrangeUndoStack(stack, stack.length))
+ return;
+ if (!session)
+ session = this.$session;
+ if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)
+ this.$redoStack = [];
+ this.$fromUndo = true;
+ var deltaSet = stack.pop();
+ var undoSelectionRange = null;
+ if (deltaSet) {
+ undoSelectionRange = session.undoChanges(deltaSet, dontSelect);
+ this.$redoStack.push(deltaSet);
+ this.$syncRev();
}
- return {
- row: this.end.row,
- column: this.end.column + idx
- };
+ this.$fromUndo = false;
+ return undoSelectionRange;
};
- return FoldLine;
-}());
-exports.FoldLine = FoldLine;
-
-});
-
-ace.define("ace/range_list",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("./range").Range;
-var comparePoints = Range.comparePoints;
-var RangeList = /** @class */ (function () {
- function RangeList() {
- this.ranges = [];
- this.$bias = 1;
- }
- RangeList.prototype.pointIndex = function (pos, excludeEdges, startIndex) {
- var list = this.ranges;
- for (var i = startIndex || 0; i < list.length; i++) {
- var range = list[i];
- var cmpEnd = comparePoints(pos, range.end);
- if (cmpEnd > 0)
- continue;
- var cmpStart = comparePoints(pos, range.start);
- if (cmpEnd === 0)
- return excludeEdges && cmpStart !== 0 ? -i - 2 : i;
- if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges))
- return i;
- return -i - 1;
+ UndoManager.prototype.redo = function (session, dontSelect) {
+ this.lastDeltas = null;
+ if (!session)
+ session = this.$session;
+ this.$fromUndo = true;
+ if (this.$redoStackBaseRev != this.$rev) {
+ var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);
+ rebaseRedoStack(this.$redoStack, diff);
+ this.$redoStackBaseRev = this.$rev;
+ this.$redoStack.forEach(function (x) {
+ x[0].id = ++this.$maxRev;
+ }, this);
}
- return -i - 1;
- };
- RangeList.prototype.add = function (range) {
- var excludeEdges = !range.isEmpty();
- var startIndex = this.pointIndex(range.start, excludeEdges);
- if (startIndex < 0)
- startIndex = -startIndex - 1;
- var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);
- if (endIndex < 0)
- endIndex = -endIndex - 1;
- else
- endIndex++;
- return this.ranges.splice(startIndex, endIndex - startIndex, range);
- };
- RangeList.prototype.addList = function (list) {
- var removed = [];
- for (var i = list.length; i--;) {
- removed.push.apply(removed, this.add(list[i]));
+ var deltaSet = this.$redoStack.pop();
+ var redoSelectionRange = null;
+ if (deltaSet) {
+ redoSelectionRange = session.redoChanges(deltaSet, dontSelect);
+ this.$undoStack.push(deltaSet);
+ this.$syncRev();
}
- return removed;
+ this.$fromUndo = false;
+ return redoSelectionRange;
};
- RangeList.prototype.substractPoint = function (pos) {
- var i = this.pointIndex(pos);
- if (i >= 0)
- return this.ranges.splice(i, 1);
+ UndoManager.prototype.$syncRev = function () {
+ var stack = this.$undoStack;
+ var nextDelta = stack[stack.length - 1];
+ var id = nextDelta && nextDelta[0].id || 0;
+ this.$redoStackBaseRev = id;
+ this.$rev = id;
};
- RangeList.prototype.merge = function () {
- var removed = [];
- var list = this.ranges;
- list = list.sort(function (a, b) {
- return comparePoints(a.start, b.start);
- });
- var next = list[0], range;
- for (var i = 1; i < list.length; i++) {
- range = next;
- next = list[i];
- var cmp = comparePoints(range.end, next.start);
- if (cmp < 0)
- continue;
- if (cmp == 0 && !range.isEmpty() && !next.isEmpty())
- continue;
- if (comparePoints(range.end, next.end) < 0) {
- range.end.row = next.end.row;
- range.end.column = next.end.column;
- }
- list.splice(i, 1);
- removed.push(next);
- next = range;
- i--;
- }
- this.ranges = list;
- return removed;
+ UndoManager.prototype.reset = function () {
+ this.lastDeltas = null;
+ this.$lastDelta = null;
+ this.$undoStack = [];
+ this.$redoStack = [];
+ this.$rev = 0;
+ this.mark = 0;
+ this.$redoStackBaseRev = this.$rev;
+ this.selections = [];
};
- RangeList.prototype.contains = function (row, column) {
- return this.pointIndex({ row: row, column: column }) >= 0;
+ UndoManager.prototype.canUndo = function () {
+ return this.$undoStack.length > 0;
};
- RangeList.prototype.containsPoint = function (pos) {
- return this.pointIndex(pos) >= 0;
+ UndoManager.prototype.canRedo = function () {
+ return this.$redoStack.length > 0;
};
- RangeList.prototype.rangeAtPoint = function (pos) {
- var i = this.pointIndex(pos);
- if (i >= 0)
- return this.ranges[i];
+ UndoManager.prototype.bookmark = function (rev) {
+ if (rev == undefined)
+ rev = this.$rev;
+ this.mark = rev;
};
- RangeList.prototype.clipRows = function (startRow, endRow) {
- var list = this.ranges;
- if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)
- return [];
- var startIndex = this.pointIndex({ row: startRow, column: 0 });
- if (startIndex < 0)
- startIndex = -startIndex - 1;
- var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);
- if (endIndex < 0)
- endIndex = -endIndex - 1;
- var clipped = [];
- for (var i = startIndex; i < endIndex; i++) {
- clipped.push(list[i]);
- }
- return clipped;
+ UndoManager.prototype.isAtBookmark = function () {
+ return this.$rev === this.mark;
};
- RangeList.prototype.removeAll = function () {
- return this.ranges.splice(0, this.ranges.length);
+ UndoManager.prototype.toJSON = function () {
+ return {
+ $redoStack: this.$redoStack,
+ $undoStack: this.$undoStack
+ };
};
- RangeList.prototype.attach = function (session) {
- if (this.session)
- this.detach();
- this.session = session;
- this.onChange = this.$onChange.bind(this);
- this.session.on('change', this.onChange);
+ UndoManager.prototype.fromJSON = function (json) {
+ this.reset();
+ this.$undoStack = json.$undoStack;
+ this.$redoStack = json.$redoStack;
};
- RangeList.prototype.detach = function () {
- if (!this.session)
- return;
- this.session.removeListener('change', this.onChange);
- this.session = null;
+ UndoManager.prototype.$prettyPrint = function (delta) {
+ if (delta)
+ return stringifyDelta(delta);
+ return stringifyDelta(this.$undoStack) + "\n---\n" + stringifyDelta(this.$redoStack);
};
- RangeList.prototype.$onChange = function (delta) {
- var start = delta.start;
- var end = delta.end;
- var startRow = start.row;
- var endRow = end.row;
- var ranges = this.ranges;
- for (var i = 0, n = ranges.length; i < n; i++) {
- var r = ranges[i];
- if (r.end.row >= startRow)
- break;
+ return UndoManager;
+}());
+UndoManager.prototype.hasUndo = UndoManager.prototype.canUndo;
+UndoManager.prototype.hasRedo = UndoManager.prototype.canRedo;
+UndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark;
+UndoManager.prototype.markClean = UndoManager.prototype.bookmark;
+function rearrangeUndoStack(stack, pos) {
+ for (var i = pos; i--;) {
+ var deltaSet = stack[i];
+ if (deltaSet && !deltaSet[0].ignore) {
+ while (i < pos - 1) {
+ var swapped = swapGroups(stack[i], stack[i + 1]);
+ stack[i] = swapped[0];
+ stack[i + 1] = swapped[1];
+ i++;
+ }
+ return true;
}
- if (delta.action == "insert") {
- var lineDif = endRow - startRow;
- var colDiff = -start.column + end.column;
- for (; i < n; i++) {
- var r = ranges[i];
- if (r.start.row > startRow)
- break;
- if (r.start.row == startRow && r.start.column >= start.column) {
- if (r.start.column == start.column && this.$bias <= 0) {
- }
- else {
- r.start.column += colDiff;
- r.start.row += lineDif;
- }
+ }
+}
+var Range = require("./range").Range;
+var cmp = Range.comparePoints;
+var comparePoints = Range.comparePoints;
+function $updateMarkers(delta) {
+ var isInsert = delta.action == "insert";
+ var start = delta.start;
+ var end = delta.end;
+ var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);
+ var colShift = (end.column - start.column) * (isInsert ? 1 : -1);
+ if (isInsert)
+ end = start;
+ for (var i in this.marks) {
+ var point = this.marks[i];
+ var cmp = comparePoints(point, start);
+ if (cmp < 0) {
+ continue; // delta starts after the range
+ }
+ if (cmp === 0) {
+ if (isInsert) {
+ if (point.bias == 1) {
+ cmp = 1;
}
- if (r.end.row == startRow && r.end.column >= start.column) {
- if (r.end.column == start.column && this.$bias < 0) {
- continue;
- }
- if (r.end.column == start.column && colDiff > 0 && i < n - 1) {
- if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column)
- r.end.column -= colDiff;
- }
- r.end.column += colDiff;
- r.end.row += lineDif;
+ else {
+ point.bias == -1;
+ continue;
}
}
}
- else {
- var lineDif = startRow - endRow;
- var colDiff = start.column - end.column;
- for (; i < n; i++) {
- var r = ranges[i];
- if (r.start.row > endRow)
- break;
- if (r.end.row < endRow
- && (startRow < r.end.row
- || startRow == r.end.row && start.column < r.end.column)) {
- r.end.row = startRow;
- r.end.column = start.column;
- }
- else if (r.end.row == endRow) {
- if (r.end.column <= end.column) {
- if (lineDif || r.end.column > start.column) {
- r.end.column = start.column;
- r.end.row = start.row;
- }
- }
- else {
- r.end.column += colDiff;
- r.end.row += lineDif;
- }
- }
- else if (r.end.row > endRow) {
- r.end.row += lineDif;
- }
- if (r.start.row < endRow
- && (startRow < r.start.row
- || startRow == r.start.row && start.column < r.start.column)) {
- r.start.row = startRow;
- r.start.column = start.column;
- }
- else if (r.start.row == endRow) {
- if (r.start.column <= end.column) {
- if (lineDif || r.start.column > start.column) {
- r.start.column = start.column;
- r.start.row = start.row;
- }
- }
- else {
- r.start.column += colDiff;
- r.start.row += lineDif;
- }
- }
- else if (r.start.row > endRow) {
- r.start.row += lineDif;
- }
- }
+ var cmp2 = isInsert ? cmp : comparePoints(point, end);
+ if (cmp2 > 0) {
+ point.row += rowShift;
+ point.column += point.row == end.row ? colShift : 0;
+ continue;
}
- if (lineDif != 0 && i < n) {
- for (; i < n; i++) {
- var r = ranges[i];
- r.start.row += lineDif;
- r.end.row += lineDif;
- }
+ if (!isInsert && cmp2 <= 0) {
+ point.row = start.row;
+ point.column = start.column;
+ if (cmp2 === 0)
+ point.bias = 1;
}
- };
- return RangeList;
-}());
-RangeList.prototype.comparePoints = comparePoints;
-exports.RangeList = RangeList;
-
-});
-
-ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"], function(require, exports, module){"use strict";
-var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-var RangeList = require("../range_list").RangeList;
-var Fold = /** @class */ (function (_super) {
- __extends(Fold, _super);
- function Fold(range, placeholder) {
- var _this = _super.call(this) || this;
- _this.foldLine = null;
- _this.placeholder = placeholder;
- _this.range = range;
- _this.start = range.start;
- _this.end = range.end;
- _this.sameRow = range.start.row == range.end.row;
- _this.subFolds = _this.ranges = [];
- return _this;
}
- Fold.prototype.toString = function () {
- return '"' + this.placeholder + '" ' + this.range.toString();
- };
- Fold.prototype.setFoldLine = function (foldLine) {
- this.foldLine = foldLine;
- this.subFolds.forEach(function (fold) {
- fold.setFoldLine(foldLine);
- });
- };
- Fold.prototype.clone = function () {
- var range = this.range.clone();
- var fold = new Fold(range, this.placeholder);
- this.subFolds.forEach(function (subFold) {
- fold.subFolds.push(subFold.clone());
- });
- fold.collapseChildren = this.collapseChildren;
- return fold;
+}
+function clonePos(pos) {
+ return { row: pos.row, column: pos.column };
+}
+function cloneDelta(d) {
+ return {
+ start: clonePos(d.start),
+ end: clonePos(d.end),
+ action: d.action,
+ lines: d.lines.slice()
};
- Fold.prototype.addSubFold = function (fold) {
- if (this.range.isEqual(fold))
- return;
- consumeRange(fold, this.start);
- var row = fold.start.row, column = fold.start.column;
- for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {
- cmp = this.subFolds[i].range.compare(row, column);
- if (cmp != 1)
- break;
- }
- var afterStart = this.subFolds[i];
- var firstConsumed = 0;
- if (cmp == 0) {
- if (afterStart.range.containsRange(fold))
- return afterStart.addSubFold(fold);
- else
- firstConsumed = 1;
- }
- var row = fold.range.end.row, column = fold.range.end.column;
- for (var j = i, cmp = -1; j < this.subFolds.length; j++) {
- cmp = this.subFolds[j].range.compare(row, column);
- if (cmp != 1)
- break;
+}
+function stringifyDelta(d) {
+ d = d || this;
+ if (Array.isArray(d)) {
+ return d.map(stringifyDelta).join("\n");
+ }
+ var type = "";
+ if (d.action) {
+ type = d.action == "insert" ? "+" : "-";
+ type += "[" + d.lines + "]";
+ }
+ else if (d.value) {
+ if (Array.isArray(d.value)) {
+ type = d.value.map(stringifyRange).join("\n");
}
- if (cmp == 0)
- j++;
- var consumedFolds = this.subFolds.splice(i, j - i, fold);
- var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;
- for (var k = firstConsumed; k < last; k++) {
- fold.addSubFold(consumedFolds[k]);
+ else {
+ type = stringifyRange(d.value);
}
- fold.setFoldLine(this.foldLine);
- return fold;
- };
- Fold.prototype.restoreRange = function (range) {
- return restoreRange(range, this.start);
- };
- return Fold;
-}(RangeList));
-function consumePoint(point, anchor) {
- point.row -= anchor.row;
- if (point.row == 0)
- point.column -= anchor.column;
-}
-function consumeRange(range, anchor) {
- consumePoint(range.start, anchor);
- consumePoint(range.end, anchor);
-}
-function restorePoint(point, anchor) {
- if (point.row == 0)
- point.column += anchor.column;
- point.row += anchor.row;
+ }
+ if (d.start) {
+ type += stringifyRange(d);
+ }
+ if (d.id || d.rev) {
+ type += "\t(" + (d.id || d.rev) + ")";
+ }
+ return type;
}
-function restoreRange(range, anchor) {
- restorePoint(range.start, anchor);
- restorePoint(range.end, anchor);
+function stringifyRange(r) {
+ return r.start.row + ":" + r.start.column
+ + "=>" + r.end.row + ":" + r.end.column;
}
-exports.Fold = Fold;
-
-});
-
-ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"], function(require, exports, module){// @ts-nocheck
-"use strict";
-var Range = require("../range").Range;
-var FoldLine = require("./fold_line").FoldLine;
-var Fold = require("./fold").Fold;
-var TokenIterator = require("../token_iterator").TokenIterator;
-var MouseEvent = require("../mouse/mouse_event").MouseEvent;
-function Folding() {
- this.getFoldAt = function (row, column, side) {
- var foldLine = this.getFoldLine(row);
- if (!foldLine)
+function swap(d1, d2) {
+ var i1 = d1.action == "insert";
+ var i2 = d2.action == "insert";
+ if (i1 && i2) {
+ if (cmp(d2.start, d1.end) >= 0) {
+ shift(d2, d1, -1);
+ }
+ else if (cmp(d2.start, d1.start) <= 0) {
+ shift(d1, d2, +1);
+ }
+ else {
return null;
- var folds = foldLine.folds;
- for (var i = 0; i < folds.length; i++) {
- var range = folds[i].range;
- if (range.contains(row, column)) {
- if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {
- continue;
- }
- else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {
- continue;
- }
- return folds[i];
- }
}
- };
- this.getFoldsInRange = function (range) {
- var start = range.start;
- var end = range.end;
- var foldLines = this.$foldData;
- var foundFolds = [];
- start.column += 1;
- end.column -= 1;
- for (var i = 0; i < foldLines.length; i++) {
- var cmp = foldLines[i].range.compareRange(range);
- if (cmp == 2) {
- continue;
- }
- else if (cmp == -2) {
- break;
- }
- var folds = foldLines[i].folds;
- for (var j = 0; j < folds.length; j++) {
- var fold = folds[j];
- cmp = fold.range.compareRange(range);
- if (cmp == -2) {
- break;
- }
- else if (cmp == 2) {
- continue;
- }
- else
- if (cmp == 42) {
- break;
- }
- foundFolds.push(fold);
- }
+ }
+ else if (i1 && !i2) {
+ if (cmp(d2.start, d1.end) >= 0) {
+ shift(d2, d1, -1);
}
- start.column -= 1;
- end.column += 1;
- return foundFolds;
- };
- this.getFoldsInRangeList = function (ranges) {
- if (Array.isArray(ranges)) {
- var folds = [];
- ranges.forEach(function (range) {
- folds = folds.concat(this.getFoldsInRange(range));
- }, this);
+ else if (cmp(d2.end, d1.start) <= 0) {
+ shift(d1, d2, -1);
}
else {
- var folds = this.getFoldsInRange(ranges);
- }
- return folds;
- };
- this.getAllFolds = function () {
- var folds = [];
- var foldLines = this.$foldData;
- for (var i = 0; i < foldLines.length; i++)
- for (var j = 0; j < foldLines[i].folds.length; j++)
- folds.push(foldLines[i].folds[j]);
- return folds;
- };
- this.getFoldStringAt = function (row, column, trim, foldLine) {
- foldLine = foldLine || this.getFoldLine(row);
- if (!foldLine)
return null;
- var lastFold = {
- end: { column: 0 }
- };
- var str, fold;
- for (var i = 0; i < foldLine.folds.length; i++) {
- fold = foldLine.folds[i];
- var cmp = fold.range.compareEnd(row, column);
- if (cmp == -1) {
- str = this
- .getLine(fold.start.row)
- .substring(lastFold.end.column, fold.start.column);
- break;
- }
- else if (cmp === 0) {
- return null;
- }
- lastFold = fold;
- }
- if (!str)
- str = this.getLine(fold.start.row).substring(lastFold.end.column);
- if (trim == -1)
- return str.substring(0, column - lastFold.end.column);
- else if (trim == 1)
- return str.substring(column - lastFold.end.column);
- else
- return str;
- };
- this.getFoldLine = function (docRow, startFoldLine) {
- var foldData = this.$foldData;
- var i = 0;
- if (startFoldLine)
- i = foldData.indexOf(startFoldLine);
- if (i == -1)
- i = 0;
- for (i; i < foldData.length; i++) {
- var foldLine = foldData[i];
- if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {
- return foldLine;
- }
- else if (foldLine.end.row > docRow) {
- return null;
- }
}
- return null;
- };
- this.getNextFoldLine = function (docRow, startFoldLine) {
- var foldData = this.$foldData;
- var i = 0;
- if (startFoldLine)
- i = foldData.indexOf(startFoldLine);
- if (i == -1)
- i = 0;
- for (i; i < foldData.length; i++) {
- var foldLine = foldData[i];
- if (foldLine.end.row >= docRow) {
- return foldLine;
- }
+ }
+ else if (!i1 && i2) {
+ if (cmp(d2.start, d1.start) >= 0) {
+ shift(d2, d1, +1);
}
- return null;
- };
- this.getFoldedRowCount = function (first, last) {
- var foldData = this.$foldData, rowCount = last - first + 1;
- for (var i = 0; i < foldData.length; i++) {
- var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row;
- if (end >= last) {
- if (start < last) {
- if (start >= first)
- rowCount -= last - start;
- else
- rowCount = 0; // in one fold
- }
- break;
- }
- else if (end >= first) {
- if (start >= first) // fold inside range
- rowCount -= end - start;
- else
- rowCount -= end - first + 1;
- }
+ else if (cmp(d2.start, d1.start) <= 0) {
+ shift(d1, d2, +1);
}
- return rowCount;
- };
- this.$addFoldLine = function (foldLine) {
- this.$foldData.push(foldLine);
- this.$foldData.sort(function (a, b) {
- return a.start.row - b.start.row;
- });
- return foldLine;
- };
- this.addFold = function (placeholder, range) {
- var foldData = this.$foldData;
- var added = false;
- var fold;
- if (placeholder instanceof Fold)
- fold = placeholder;
else {
- fold = new Fold(range, placeholder);
- fold.collapseChildren = range.collapseChildren;
+ return null;
}
- this.$clipRangeToDocument(fold.range);
- var startRow = fold.start.row;
- var startColumn = fold.start.column;
- var endRow = fold.end.row;
- var endColumn = fold.end.column;
- var startFold = this.getFoldAt(startRow, startColumn, 1);
- var endFold = this.getFoldAt(endRow, endColumn, -1);
- if (startFold && endFold == startFold)
- return startFold.addSubFold(fold);
- if (startFold && !startFold.range.isStart(startRow, startColumn))
- this.removeFold(startFold);
- if (endFold && !endFold.range.isEnd(endRow, endColumn))
- this.removeFold(endFold);
- var folds = this.getFoldsInRange(fold.range);
- if (folds.length > 0) {
- this.removeFolds(folds);
- if (!fold.collapseChildren) {
- folds.forEach(function (subFold) {
- fold.addSubFold(subFold);
- });
- }
+ }
+ else if (!i1 && !i2) {
+ if (cmp(d2.start, d1.start) >= 0) {
+ shift(d2, d1, +1);
}
- for (var i = 0; i < foldData.length; i++) {
- var foldLine = foldData[i];
- if (endRow == foldLine.start.row) {
- foldLine.addFold(fold);
- added = true;
- break;
- }
- else if (startRow == foldLine.end.row) {
- foldLine.addFold(fold);
- added = true;
- if (!fold.sameRow) {
- var foldLineNext = foldData[i + 1];
- if (foldLineNext && foldLineNext.start.row == endRow) {
- foldLine.merge(foldLineNext);
- break;
+ else if (cmp(d2.end, d1.start) <= 0) {
+ shift(d1, d2, -1);
+ }
+ else {
+ return null;
+ }
+ }
+ return [d2, d1];
+}
+function swapGroups(ds1, ds2) {
+ for (var i = ds1.length; i--;) {
+ for (var j = 0; j < ds2.length; j++) {
+ if (!swap(ds1[i], ds2[j])) {
+ while (i < ds1.length) {
+ while (j--) {
+ swap(ds2[j], ds1[i]);
}
+ j = ds2.length;
+ i++;
}
- break;
- }
- else if (endRow <= foldLine.start.row) {
- break;
+ return [ds1, ds2];
}
}
- if (!added)
- foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));
- if (this.$useWrapMode)
- this.$updateWrapData(foldLine.start.row, foldLine.start.row);
- else
- this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);
- this.$modified = true;
- this._signal("changeFold", { data: fold, action: "add" });
- return fold;
- };
- this.addFolds = function (folds) {
- folds.forEach(function (fold) {
- this.addFold(fold);
- }, this);
- };
- this.removeFold = function (fold) {
- var foldLine = fold.foldLine;
- var startRow = foldLine.start.row;
- var endRow = foldLine.end.row;
- var foldLines = this.$foldData;
- var folds = foldLine.folds;
- if (folds.length == 1) {
- foldLines.splice(foldLines.indexOf(foldLine), 1);
+ }
+ ds1.selectionBefore = ds2.selectionBefore =
+ ds1.selectionAfter = ds2.selectionAfter = null;
+ return [ds2, ds1];
+}
+function xform(d1, c1) {
+ var i1 = d1.action == "insert";
+ var i2 = c1.action == "insert";
+ if (i1 && i2) {
+ if (cmp(d1.start, c1.start) < 0) {
+ shift(c1, d1, 1);
}
- else
- if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {
- folds.pop();
- foldLine.end.row = folds[folds.length - 1].end.row;
- foldLine.end.column = folds[folds.length - 1].end.column;
+ else {
+ shift(d1, c1, 1);
}
- else
- if (foldLine.range.isStart(fold.start.row, fold.start.column)) {
- folds.shift();
- foldLine.start.row = folds[0].start.row;
- foldLine.start.column = folds[0].start.column;
+ }
+ else if (i1 && !i2) {
+ if (cmp(d1.start, c1.end) >= 0) {
+ shift(d1, c1, -1);
}
- else
- if (fold.sameRow) {
- folds.splice(folds.indexOf(fold), 1);
- }
- else
- {
- var newFoldLine = foldLine.split(fold.start.row, fold.start.column);
- folds = newFoldLine.folds;
- folds.shift();
- newFoldLine.start.row = folds[0].start.row;
- newFoldLine.start.column = folds[0].start.column;
- }
- if (!this.$updating) {
- if (this.$useWrapMode)
- this.$updateWrapData(startRow, endRow);
- else
- this.$updateRowLengthCache(startRow, endRow);
- }
- this.$modified = true;
- this._signal("changeFold", { data: fold, action: "remove" });
- };
- this.removeFolds = function (folds) {
- var cloneFolds = [];
- for (var i = 0; i < folds.length; i++) {
- cloneFolds.push(folds[i]);
- }
- cloneFolds.forEach(function (fold) {
- this.removeFold(fold);
- }, this);
- this.$modified = true;
- };
- this.expandFold = function (fold) {
- this.removeFold(fold);
- fold.subFolds.forEach(function (subFold) {
- fold.restoreRange(subFold);
- this.addFold(subFold);
- }, this);
- if (fold.collapseChildren > 0) {
- this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);
- }
- fold.subFolds = [];
- };
- this.expandFolds = function (folds) {
- folds.forEach(function (fold) {
- this.expandFold(fold);
- }, this);
- };
- this.unfold = function (location, expandInner) {
- var range, folds;
- if (location == null) {
- range = new Range(0, 0, this.getLength(), 0);
- if (expandInner == null)
- expandInner = true;
+ else if (cmp(d1.start, c1.start) <= 0) {
+ shift(c1, d1, +1);
}
- else if (typeof location == "number") {
- range = new Range(location, 0, location, this.getLine(location).length);
+ else {
+ shift(d1, Range.fromPoints(c1.start, d1.start), -1);
+ shift(c1, d1, +1);
}
- else if ("row" in location) {
- range = Range.fromPoints(location, location);
+ }
+ else if (!i1 && i2) {
+ if (cmp(c1.start, d1.end) >= 0) {
+ shift(c1, d1, -1);
}
- else if (Array.isArray(location)) {
- folds = [];
- location.forEach(function (range) {
- folds = folds.concat(this.unfold(range));
- }, this);
- return folds;
+ else if (cmp(c1.start, d1.start) <= 0) {
+ shift(d1, c1, +1);
}
else {
- range = location;
+ shift(c1, Range.fromPoints(d1.start, c1.start), -1);
+ shift(d1, c1, +1);
}
- folds = this.getFoldsInRangeList(range);
- var outermostFolds = folds;
- while (folds.length == 1
- && Range.comparePoints(folds[0].start, range.start) < 0
- && Range.comparePoints(folds[0].end, range.end) > 0) {
- this.expandFolds(folds);
- folds = this.getFoldsInRangeList(range);
+ }
+ else if (!i1 && !i2) {
+ if (cmp(c1.start, d1.end) >= 0) {
+ shift(c1, d1, -1);
}
- if (expandInner != false) {
- this.removeFolds(folds);
+ else if (cmp(c1.end, d1.start) <= 0) {
+ shift(d1, c1, -1);
}
else {
- this.expandFolds(folds);
- }
- if (outermostFolds.length)
- return outermostFolds;
- };
- this.isRowFolded = function (docRow, startFoldRow) {
- return !!this.getFoldLine(docRow, startFoldRow);
- };
- this.getRowFoldEnd = function (docRow, startFoldRow) {
- var foldLine = this.getFoldLine(docRow, startFoldRow);
- return foldLine ? foldLine.end.row : docRow;
- };
- this.getRowFoldStart = function (docRow, startFoldRow) {
- var foldLine = this.getFoldLine(docRow, startFoldRow);
- return foldLine ? foldLine.start.row : docRow;
- };
- this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) {
- if (startRow == null)
- startRow = foldLine.start.row;
- if (startColumn == null)
- startColumn = 0;
- if (endRow == null)
- endRow = foldLine.end.row;
- if (endColumn == null)
- endColumn = this.getLine(endRow).length;
- var doc = this.doc;
- var textLine = "";
- foldLine.walk(function (placeholder, row, column, lastColumn) {
- if (row < startRow)
- return;
- if (row == startRow) {
- if (column < startColumn)
- return;
- lastColumn = Math.max(startColumn, lastColumn);
+ var before, after;
+ if (cmp(d1.start, c1.start) < 0) {
+ before = d1;
+ d1 = splitDelta(d1, c1.start);
}
- if (placeholder != null) {
- textLine += placeholder;
+ if (cmp(d1.end, c1.end) > 0) {
+ after = splitDelta(d1, c1.end);
}
- else {
- textLine += doc.getLine(row).substring(lastColumn, column);
+ shiftPos(c1.end, d1.start, d1.end, -1);
+ if (after && !before) {
+ d1.lines = after.lines;
+ d1.start = after.start;
+ d1.end = after.end;
+ after = d1;
}
- }, endRow, endColumn);
- return textLine;
- };
- this.getDisplayLine = function (row, endColumn, startRow, startColumn) {
- var foldLine = this.getFoldLine(row);
- if (!foldLine) {
- var line;
- line = this.doc.getLine(row);
- return line.substring(startColumn || 0, endColumn || line.length);
- }
- else {
- return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);
+ return [c1, before, after].filter(Boolean);
}
+ }
+ return [c1, d1];
+}
+function shift(d1, d2, dir) {
+ shiftPos(d1.start, d2.start, d2.end, dir);
+ shiftPos(d1.end, d2.start, d2.end, dir);
+}
+function shiftPos(pos, start, end, dir) {
+ if (pos.row == (dir == 1 ? start : end).row) {
+ pos.column += dir * (end.column - start.column);
+ }
+ pos.row += dir * (end.row - start.row);
+}
+function splitDelta(c, pos) {
+ var lines = c.lines;
+ var end = c.end;
+ c.end = clonePos(pos);
+ var rowsBefore = c.end.row - c.start.row;
+ var otherLines = lines.splice(rowsBefore, lines.length);
+ var col = rowsBefore ? pos.column : pos.column - c.start.column;
+ lines.push(otherLines[0].substring(0, col));
+ otherLines[0] = otherLines[0].substr(col);
+ var rest = {
+ start: clonePos(pos),
+ end: end,
+ lines: otherLines,
+ action: c.action
};
- this.$cloneFoldData = function () {
- var fd = [];
- fd = this.$foldData.map(function (foldLine) {
- var folds = foldLine.folds.map(function (fold) {
- return fold.clone();
- });
- return new FoldLine(fd, folds);
- });
- return fd;
- };
- this.toggleFold = function (tryToUnfold) {
- var selection = this.selection;
- var range = selection.getRange();
- var fold;
- var bracketPos;
- if (range.isEmpty()) {
- var cursor = range.start;
- fold = this.getFoldAt(cursor.row, cursor.column);
- if (fold) {
- this.expandFold(fold);
- return;
- }
- else if (bracketPos = this.findMatchingBracket(cursor)) {
- if (range.comparePoint(bracketPos) == 1) {
- range.end = bracketPos;
+ return rest;
+}
+function moveDeltasByOne(redoStack, d) {
+ d = cloneDelta(d);
+ for (var j = redoStack.length; j--;) {
+ var deltaSet = redoStack[j];
+ for (var i = 0; i < deltaSet.length; i++) {
+ var x = deltaSet[i];
+ var xformed = xform(x, d);
+ d = xformed[0];
+ if (xformed.length != 2) {
+ if (xformed[2]) {
+ deltaSet.splice(i + 1, 1, xformed[1], xformed[2]);
+ i++;
}
- else {
- range.start = bracketPos;
- range.start.column++;
- range.end.column--;
+ else if (!xformed[1]) {
+ deltaSet.splice(i, 1);
+ i--;
}
}
- else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {
- if (range.comparePoint(bracketPos) == 1)
- range.end = bracketPos;
- else
- range.start = bracketPos;
- range.start.column++;
- }
- else {
- range = this.getCommentFoldRange(cursor.row, cursor.column) || range;
- }
- }
- else {
- var folds = this.getFoldsInRange(range);
- if (tryToUnfold && folds.length) {
- this.expandFolds(folds);
- return;
- }
- else if (folds.length == 1) {
- fold = folds[0];
- }
}
- if (!fold)
- fold = this.getFoldAt(range.start.row, range.start.column);
- if (fold && fold.range.toString() == range.toString()) {
- this.expandFold(fold);
- return;
+ if (!deltaSet.length) {
+ redoStack.splice(j, 1);
}
- var placeholder = "...";
- if (!range.isMultiLine()) {
- placeholder = this.getTextRange(range);
- if (placeholder.length < 4)
- return;
- placeholder = placeholder.trim().substring(0, 2) + "..";
+ }
+ return redoStack;
+}
+function rebaseRedoStack(redoStack, deltaSets) {
+ for (var i = 0; i < deltaSets.length; i++) {
+ var deltas = deltaSets[i];
+ for (var j = 0; j < deltas.length; j++) {
+ moveDeltasByOne(redoStack, deltas[j]);
}
- this.addFold(placeholder, range);
+ }
+}
+exports.UndoManager = UndoManager;
+
+});
+
+ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+var Range = require("../range").Range;
+var FoldLine = /** @class */ (function () {
+ function FoldLine(foldData, folds) {
+ this.foldData = foldData;
+ if (Array.isArray(folds)) {
+ this.folds = folds;
+ }
+ else {
+ folds = this.folds = [folds];
+ }
+ var last = folds[folds.length - 1];
+ this.range = new Range(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);
+ this.start = this.range.start;
+ this.end = this.range.end;
+ this.folds.forEach(function (fold) {
+ fold.setFoldLine(this);
+ }, this);
+ }
+ FoldLine.prototype.shiftRow = function (shift) {
+ this.start.row += shift;
+ this.end.row += shift;
+ this.folds.forEach(function (fold) {
+ fold.start.row += shift;
+ fold.end.row += shift;
+ });
};
- this.getCommentFoldRange = function (row, column, dir) {
- var iterator = new TokenIterator(this, row, column);
- var token = iterator.getCurrentToken();
- var type = token && token.type;
- if (token && /^comment|string/.test(type)) {
- type = type.match(/comment|string/)[0];
- if (type == "comment")
- type += "|doc-start|\\.doc";
- var re = new RegExp(type);
- var range = new Range();
- if (dir != 1) {
- do {
- token = iterator.stepBackward();
- } while (token && re.test(token.type) && !/^comment.end/.test(token.type));
- token = iterator.stepForward();
+ FoldLine.prototype.addFold = function (fold) {
+ if (fold.sameRow) {
+ if (fold.start.row < this.startRow || fold.endRow > this.endRow) {
+ throw new Error("Can't add a fold to this FoldLine as it has no connection");
}
- range.start.row = iterator.getCurrentTokenRow();
- range.start.column = iterator.getCurrentTokenColumn() + (/^comment.start/.test(token.type) ? token.value.length : 2);
- iterator = new TokenIterator(this, row, column);
- if (dir != -1) {
- var lastRow = -1;
- do {
- token = iterator.stepForward();
- if (lastRow == -1) {
- var state = this.getState(iterator.$row);
- if (!re.test(state))
- lastRow = iterator.$row;
- }
- else if (iterator.$row > lastRow) {
- break;
- }
- } while (token && re.test(token.type) && !/^comment.start/.test(token.type));
- token = iterator.stepBackward();
+ this.folds.push(fold);
+ this.folds.sort(function (a, b) {
+ return -a.range.compareEnd(b.start.row, b.start.column);
+ });
+ if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {
+ this.end.row = fold.end.row;
+ this.end.column = fold.end.column;
}
- else
- token = iterator.getCurrentToken();
- range.end.row = iterator.getCurrentTokenRow();
- range.end.column = iterator.getCurrentTokenColumn();
- if (!/^comment.end/.test(token.type)) {
- range.end.column += token.value.length - 2;
+ else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {
+ this.start.row = fold.start.row;
+ this.start.column = fold.start.column;
}
- return range;
}
- };
- this.foldAll = function (startRow, endRow, depth, test) {
- if (depth == undefined)
- depth = 100000; // JSON.stringify doesn't hanle Infinity
- var foldWidgets = this.foldWidgets;
- if (!foldWidgets)
- return; // mode doesn't support folding
- endRow = endRow || this.getLength();
- startRow = startRow || 0;
- for (var row = startRow; row < endRow; row++) {
- if (foldWidgets[row] == null)
- foldWidgets[row] = this.getFoldWidget(row);
- if (foldWidgets[row] != "start")
- continue;
- if (test && !test(row))
- continue;
- var range = this.getFoldWidgetRange(row);
- if (range && range.isMultiLine()
- && range.end.row <= endRow
- && range.start.row >= startRow) {
- row = range.end.row;
- range.collapseChildren = depth;
- this.addFold("...", range);
- }
+ else if (fold.start.row == this.end.row) {
+ this.folds.push(fold);
+ this.end.row = fold.end.row;
+ this.end.column = fold.end.column;
}
+ else if (fold.end.row == this.start.row) {
+ this.folds.unshift(fold);
+ this.start.row = fold.start.row;
+ this.start.column = fold.start.column;
+ }
+ else {
+ throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
+ }
+ fold.foldLine = this;
};
- this.foldToLevel = function (level) {
- this.foldAll();
- while (level-- > 0)
- this.unfold(null, false);
- };
- this.foldAllComments = function () {
- var session = this;
- this.foldAll(null, null, null, function (row) {
- var tokens = session.getTokens(row);
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (token.type == "text" && /^\s+$/.test(token.value))
- continue;
- if (/comment/.test(token.type))
- return true;
- return false;
- }
- });
- };
- this.$foldStyles = {
- "manual": 1,
- "markbegin": 1,
- "markbeginend": 1
- };
- this.$foldStyle = "markbegin";
- this.setFoldStyle = function (style) {
- if (!this.$foldStyles[style])
- throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
- if (this.$foldStyle == style)
- return;
- this.$foldStyle = style;
- if (style == "manual")
- this.unfold();
- var mode = this.$foldMode;
- this.$setFolding(null);
- this.$setFolding(mode);
+ FoldLine.prototype.containsRow = function (row) {
+ return row >= this.start.row && row <= this.end.row;
};
- this.$setFolding = function (foldMode) {
- if (this.$foldMode == foldMode)
- return;
- this.$foldMode = foldMode;
- this.off('change', this.$updateFoldWidgets);
- this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);
- this._signal("changeAnnotation");
- if (!foldMode || this.$foldStyle == "manual") {
- this.foldWidgets = null;
- return;
+ FoldLine.prototype.walk = function (callback, endRow, endColumn) {
+ var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;
+ if (endRow == null) {
+ endRow = this.end.row;
+ endColumn = this.end.column;
}
- this.foldWidgets = [];
- this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);
- this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);
- this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);
- this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);
- this.on('change', this.$updateFoldWidgets);
- this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);
- };
- this.getParentFoldRangeData = function (row, ignoreCurrent) {
- var fw = this.foldWidgets;
- if (!fw || (ignoreCurrent && fw[row]))
- return {};
- var i = row - 1, firstRange;
- while (i >= 0) {
- var c = fw[i];
- if (c == null)
- c = fw[i] = this.getFoldWidget(i);
- if (c == "start") {
- var range = this.getFoldWidgetRange(i);
- if (!firstRange)
- firstRange = range;
- if (range && range.end.row >= row)
- break;
+ for (var i = 0; i < folds.length; i++) {
+ fold = folds[i];
+ cmp = fold.range.compareStart(endRow, endColumn);
+ if (cmp == -1) {
+ callback(null, endRow, endColumn, lastEnd, isNewRow);
+ return;
}
- i--;
+ stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);
+ stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);
+ if (stop || cmp === 0) {
+ return;
+ }
+ isNewRow = !fold.sameRow;
+ lastEnd = fold.end.column;
}
- return {
- range: i !== -1 && range,
- firstRange: firstRange
- };
+ callback(null, endRow, endColumn, lastEnd, isNewRow);
};
- this.onFoldWidgetClick = function (row, e) {
- if (e instanceof MouseEvent)
- e = e.domEvent;
- var options = {
- children: e.shiftKey,
- all: e.ctrlKey || e.metaKey,
- siblings: e.altKey
- };
- var range = this.$toggleFoldWidget(row, options);
- if (!range) {
- var el = (e.target || e.srcElement);
- if (el && /ace_fold-widget/.test(el.className))
- el.className += " ace_invalid";
+ FoldLine.prototype.getNextFoldTo = function (row, column) {
+ var fold, cmp;
+ for (var i = 0; i < this.folds.length; i++) {
+ fold = this.folds[i];
+ cmp = fold.range.compareEnd(row, column);
+ if (cmp == -1) {
+ return {
+ fold: fold,
+ kind: "after"
+ };
+ }
+ else if (cmp === 0) {
+ return {
+ fold: fold,
+ kind: "inside"
+ };
+ }
}
+ return null;
};
- this.$toggleFoldWidget = function (row, options) {
- if (!this.getFoldWidget)
- return;
- var type = this.getFoldWidget(row);
- var line = this.getLine(row);
- var dir = type === "end" ? -1 : 1;
- var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);
- if (fold) {
- if (options.children || options.all)
- this.removeFold(fold);
- else
- this.expandFold(fold);
- return fold;
- }
- var range = this.getFoldWidgetRange(row, true);
- if (range && !range.isMultiLine()) {
- fold = this.getFoldAt(range.start.row, range.start.column, 1);
- if (fold && range.isEqual(fold.range)) {
- this.removeFold(fold);
- return fold;
+ FoldLine.prototype.addRemoveChars = function (row, column, len) {
+ var ret = this.getNextFoldTo(row, column), fold, folds;
+ if (ret) {
+ fold = ret.fold;
+ if (ret.kind == "inside"
+ && fold.start.column != column
+ && fold.start.row != row) {
+ window.console && window.console.log(row, column, fold);
}
- }
- if (options.siblings) {
- var data = this.getParentFoldRangeData(row);
- if (data.range) {
- var startRow = data.range.start.row + 1;
- var endRow = data.range.end.row;
+ else if (fold.start.row == row) {
+ folds = this.folds;
+ var i = folds.indexOf(fold);
+ if (i === 0) {
+ this.start.column += len;
+ }
+ for (i; i < folds.length; i++) {
+ fold = folds[i];
+ fold.start.column += len;
+ if (!fold.sameRow) {
+ return;
+ }
+ fold.end.column += len;
+ }
+ this.end.column += len;
}
- this.foldAll(startRow, endRow, options.all ? 10000 : 0);
- }
- else if (options.children) {
- endRow = range ? range.end.row : this.getLength();
- this.foldAll(row + 1, endRow, options.all ? 10000 : 0);
- }
- else if (range) {
- if (options.all)
- range.collapseChildren = 10000;
- this.addFold("...", range);
}
- return range;
};
- this.toggleFoldWidget = function (toggleParent) {
- var row = this.selection.getCursor().row;
- row = this.getRowFoldStart(row);
- var range = this.$toggleFoldWidget(row, {});
- if (range)
- return;
- var data = this.getParentFoldRangeData(row, true);
- range = data.range || data.firstRange;
- if (range) {
- row = range.start.row;
- var fold = this.getFoldAt(row, this.getLine(row).length, 1);
- if (fold) {
- this.removeFold(fold);
- }
- else {
- this.addFold("...", range);
- }
- }
+ FoldLine.prototype.split = function (row, column) {
+ var pos = this.getNextFoldTo(row, column);
+ if (!pos || pos.kind == "inside")
+ return null;
+ var fold = pos.fold;
+ var folds = this.folds;
+ var foldData = this.foldData;
+ var i = folds.indexOf(fold);
+ var foldBefore = folds[i - 1];
+ this.end.row = foldBefore.end.row;
+ this.end.column = foldBefore.end.column;
+ folds = folds.splice(i, folds.length - i);
+ var newFoldLine = new FoldLine(foldData, folds);
+ foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);
+ return newFoldLine;
};
- this.updateFoldWidgets = function (delta) {
- var firstRow = delta.start.row;
- var len = delta.end.row - firstRow;
- if (len === 0) {
- this.foldWidgets[firstRow] = null;
- }
- else if (delta.action == 'remove') {
- this.foldWidgets.splice(firstRow, len + 1, null);
- }
- else {
- var args = Array(len + 1);
- args.unshift(firstRow, 1);
- this.foldWidgets.splice.apply(this.foldWidgets, args);
+ FoldLine.prototype.merge = function (foldLineNext) {
+ var folds = foldLineNext.folds;
+ for (var i = 0; i < folds.length; i++) {
+ this.addFold(folds[i]);
}
+ var foldData = this.foldData;
+ foldData.splice(foldData.indexOf(foldLineNext), 1);
};
- this.tokenizerUpdateFoldWidgets = function (e) {
- var rows = e.data;
- if (rows.first != rows.last) {
- if (this.foldWidgets.length > rows.first)
- this.foldWidgets.splice(rows.first, this.foldWidgets.length);
+ FoldLine.prototype.toString = function () {
+ var ret = [this.range.toString() + ": ["];
+ this.folds.forEach(function (fold) {
+ ret.push(" " + fold.toString());
+ });
+ ret.push("]");
+ return ret.join("\n");
+ };
+ FoldLine.prototype.idxToPosition = function (idx) {
+ var lastFoldEndColumn = 0;
+ for (var i = 0; i < this.folds.length; i++) {
+ var fold = this.folds[i];
+ idx -= fold.start.column - lastFoldEndColumn;
+ if (idx < 0) {
+ return {
+ row: fold.start.row,
+ column: fold.start.column + idx
+ };
+ }
+ idx -= fold.placeholder.length;
+ if (idx < 0) {
+ return fold.start;
+ }
+ lastFoldEndColumn = fold.end.column;
}
+ return {
+ row: this.end.row,
+ column: this.end.column + idx
+ };
};
-}
-exports.Folding = Folding;
+ return FoldLine;
+}());
+exports.FoldLine = FoldLine;
});
-ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(require, exports, module){"use strict";
-var TokenIterator = require("../token_iterator").TokenIterator;
-var Range = require("../range").Range;
-function BracketMatch() {
- this.findMatchingBracket = function (position, chr) {
- if (position.column == 0)
- return null;
- var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);
- if (charBeforeCursor == "")
- return null;
- var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/);
- if (!match)
- return null;
- if (match[1])
- return this.$findClosingBracket(match[1], position);
+ace.define("ace/range_list",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+var Range = require("./range").Range;
+var comparePoints = Range.comparePoints;
+var RangeList = /** @class */ (function () {
+ function RangeList() {
+ this.ranges = [];
+ this.$bias = 1;
+ }
+ RangeList.prototype.pointIndex = function (pos, excludeEdges, startIndex) {
+ var list = this.ranges;
+ for (var i = startIndex || 0; i < list.length; i++) {
+ var range = list[i];
+ var cmpEnd = comparePoints(pos, range.end);
+ if (cmpEnd > 0)
+ continue;
+ var cmpStart = comparePoints(pos, range.start);
+ if (cmpEnd === 0)
+ return excludeEdges && cmpStart !== 0 ? -i - 2 : i;
+ if (cmpStart > 0 || (cmpStart === 0 && !excludeEdges))
+ return i;
+ return -i - 1;
+ }
+ return -i - 1;
+ };
+ RangeList.prototype.add = function (range) {
+ var excludeEdges = !range.isEmpty();
+ var startIndex = this.pointIndex(range.start, excludeEdges);
+ if (startIndex < 0)
+ startIndex = -startIndex - 1;
+ var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);
+ if (endIndex < 0)
+ endIndex = -endIndex - 1;
else
- return this.$findOpeningBracket(match[2], position);
+ endIndex++;
+ return this.ranges.splice(startIndex, endIndex - startIndex, range);
};
- this.getBracketRange = function (pos) {
- var line = this.getLine(pos.row);
- var before = true, range;
- var chr = line.charAt(pos.column - 1);
- var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
- if (!match) {
- chr = line.charAt(pos.column);
- pos = { row: pos.row, column: pos.column + 1 };
- match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
- before = false;
+ RangeList.prototype.addList = function (list) {
+ var removed = [];
+ for (var i = list.length; i--;) {
+ removed.push.apply(removed, this.add(list[i]));
}
- if (!match)
- return null;
- if (match[1]) {
- var bracketPos = this.$findClosingBracket(match[1], pos);
- if (!bracketPos)
- return null;
- range = Range.fromPoints(pos, bracketPos);
- if (!before) {
- range.end.column++;
- range.start.column--;
+ return removed;
+ };
+ RangeList.prototype.substractPoint = function (pos) {
+ var i = this.pointIndex(pos);
+ if (i >= 0)
+ return this.ranges.splice(i, 1);
+ };
+ RangeList.prototype.merge = function () {
+ var removed = [];
+ var list = this.ranges;
+ list = list.sort(function (a, b) {
+ return comparePoints(a.start, b.start);
+ });
+ var next = list[0], range;
+ for (var i = 1; i < list.length; i++) {
+ range = next;
+ next = list[i];
+ var cmp = comparePoints(range.end, next.start);
+ if (cmp < 0)
+ continue;
+ if (cmp == 0 && !range.isEmpty() && !next.isEmpty())
+ continue;
+ if (comparePoints(range.end, next.end) < 0) {
+ range.end.row = next.end.row;
+ range.end.column = next.end.column;
}
- range.cursor = range.end;
+ list.splice(i, 1);
+ removed.push(next);
+ next = range;
+ i--;
}
- else {
- var bracketPos = this.$findOpeningBracket(match[2], pos);
- if (!bracketPos)
- return null;
- range = Range.fromPoints(bracketPos, pos);
- if (!before) {
- range.start.column++;
- range.end.column--;
- }
- range.cursor = range.start;
- }
- return range;
+ this.ranges = list;
+ return removed;
};
- this.getMatchingBracketRanges = function (pos, isBackwards) {
- var line = this.getLine(pos.row);
- var bracketsRegExp = /([\(\[\{])|([\)\]\}])/;
- var chr = !isBackwards && line.charAt(pos.column - 1);
- var match = chr && chr.match(bracketsRegExp);
- if (!match) {
- chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column);
- pos = {
- row: pos.row,
- column: pos.column + 1
- };
- match = chr && chr.match(bracketsRegExp);
+ RangeList.prototype.contains = function (row, column) {
+ return this.pointIndex({ row: row, column: column }) >= 0;
+ };
+ RangeList.prototype.containsPoint = function (pos) {
+ return this.pointIndex(pos) >= 0;
+ };
+ RangeList.prototype.rangeAtPoint = function (pos) {
+ var i = this.pointIndex(pos);
+ if (i >= 0)
+ return this.ranges[i];
+ };
+ RangeList.prototype.clipRows = function (startRow, endRow) {
+ var list = this.ranges;
+ if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)
+ return [];
+ var startIndex = this.pointIndex({ row: startRow, column: 0 });
+ if (startIndex < 0)
+ startIndex = -startIndex - 1;
+ var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);
+ if (endIndex < 0)
+ endIndex = -endIndex - 1;
+ var clipped = [];
+ for (var i = startIndex; i < endIndex; i++) {
+ clipped.push(list[i]);
}
- if (!match)
- return null;
- var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);
- var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)
- : this.$findOpeningBracket(match[2], pos);
- if (!bracketPos)
- return [startRange];
- var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);
- return [startRange, endRange];
+ return clipped;
};
- this.$brackets = {
- ")": "(",
- "(": ")",
- "]": "[",
- "[": "]",
- "{": "}",
- "}": "{",
- "<": ">",
- ">": "<"
+ RangeList.prototype.removeAll = function () {
+ return this.ranges.splice(0, this.ranges.length);
};
- this.$findOpeningBracket = function (bracket, position, typeRe) {
- var openBracket = this.$brackets[bracket];
- var depth = 1;
- var iterator = new TokenIterator(this, position.row, position.column);
- var token = iterator.getCurrentToken();
- if (!token)
- token = iterator.stepForward();
- if (!token)
+ RangeList.prototype.attach = function (session) {
+ if (this.session)
+ this.detach();
+ this.session = session;
+ this.onChange = this.$onChange.bind(this);
+ this.session.on('change', this.onChange);
+ };
+ RangeList.prototype.detach = function () {
+ if (!this.session)
return;
- if (!typeRe) {
- typeRe = new RegExp("(\\.?" +
- token.type.replace(".", "\\.").replace("rparen", ".paren")
- .replace(/\b(?:end)\b/, "(?:start|begin|end)")
- .replace(/-close\b/, "-(close|open)")
- + ")+");
+ this.session.removeListener('change', this.onChange);
+ this.session = null;
+ };
+ RangeList.prototype.$onChange = function (delta) {
+ var start = delta.start;
+ var end = delta.end;
+ var startRow = start.row;
+ var endRow = end.row;
+ var ranges = this.ranges;
+ for (var i = 0, n = ranges.length; i < n; i++) {
+ var r = ranges[i];
+ if (r.end.row >= startRow)
+ break;
}
- var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;
- var value = token.value;
- while (true) {
- while (valueIndex >= 0) {
- var chr = value.charAt(valueIndex);
- if (chr == openBracket) {
- depth -= 1;
- if (depth == 0) {
- return { row: iterator.getCurrentTokenRow(),
- column: valueIndex + iterator.getCurrentTokenColumn() };
+ if (delta.action == "insert") {
+ var lineDif = endRow - startRow;
+ var colDiff = -start.column + end.column;
+ for (; i < n; i++) {
+ var r = ranges[i];
+ if (r.start.row > startRow)
+ break;
+ if (r.start.row == startRow && r.start.column >= start.column) {
+ if (r.start.column == start.column && this.$bias <= 0) {
+ }
+ else {
+ r.start.column += colDiff;
+ r.start.row += lineDif;
}
}
- else if (chr == bracket) {
- depth += 1;
+ if (r.end.row == startRow && r.end.column >= start.column) {
+ if (r.end.column == start.column && this.$bias < 0) {
+ continue;
+ }
+ if (r.end.column == start.column && colDiff > 0 && i < n - 1) {
+ if (r.end.column > r.start.column && r.end.column == ranges[i + 1].start.column)
+ r.end.column -= colDiff;
+ }
+ r.end.column += colDiff;
+ r.end.row += lineDif;
}
- valueIndex -= 1;
}
- do {
- token = iterator.stepBackward();
- } while (token && !typeRe.test(token.type));
- if (token == null)
- break;
- value = token.value;
- valueIndex = value.length - 1;
- }
- return null;
- };
- this.$findClosingBracket = function (bracket, position, typeRe) {
- var closingBracket = this.$brackets[bracket];
- var depth = 1;
- var iterator = new TokenIterator(this, position.row, position.column);
- var token = iterator.getCurrentToken();
- if (!token)
- token = iterator.stepForward();
- if (!token)
- return;
- if (!typeRe) {
- typeRe = new RegExp("(\\.?" +
- token.type.replace(".", "\\.").replace("lparen", ".paren")
- .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)")
- .replace(/-open\b/, "-(close|open)")
- + ")+");
}
- var valueIndex = position.column - iterator.getCurrentTokenColumn();
- while (true) {
- var value = token.value;
- var valueLength = value.length;
- while (valueIndex < valueLength) {
- var chr = value.charAt(valueIndex);
- if (chr == closingBracket) {
- depth -= 1;
- if (depth == 0) {
- return { row: iterator.getCurrentTokenRow(),
- column: valueIndex + iterator.getCurrentTokenColumn() };
+ else {
+ var lineDif = startRow - endRow;
+ var colDiff = start.column - end.column;
+ for (; i < n; i++) {
+ var r = ranges[i];
+ if (r.start.row > endRow)
+ break;
+ if (r.end.row < endRow
+ && (startRow < r.end.row
+ || startRow == r.end.row && start.column < r.end.column)) {
+ r.end.row = startRow;
+ r.end.column = start.column;
+ }
+ else if (r.end.row == endRow) {
+ if (r.end.column <= end.column) {
+ if (lineDif || r.end.column > start.column) {
+ r.end.column = start.column;
+ r.end.row = start.row;
+ }
+ }
+ else {
+ r.end.column += colDiff;
+ r.end.row += lineDif;
}
}
- else if (chr == bracket) {
- depth += 1;
+ else if (r.end.row > endRow) {
+ r.end.row += lineDif;
+ }
+ if (r.start.row < endRow
+ && (startRow < r.start.row
+ || startRow == r.start.row && start.column < r.start.column)) {
+ r.start.row = startRow;
+ r.start.column = start.column;
+ }
+ else if (r.start.row == endRow) {
+ if (r.start.column <= end.column) {
+ if (lineDif || r.start.column > start.column) {
+ r.start.column = start.column;
+ r.start.row = start.row;
+ }
+ }
+ else {
+ r.start.column += colDiff;
+ r.start.row += lineDif;
+ }
+ }
+ else if (r.start.row > endRow) {
+ r.start.row += lineDif;
}
- valueIndex += 1;
}
- do {
- token = iterator.stepForward();
- } while (token && !typeRe.test(token.type));
- if (token == null)
- break;
- valueIndex = 0;
- }
- return null;
- };
- this.getMatchingTags = function (pos) {
- var iterator = new TokenIterator(this, pos.row, pos.column);
- var token = this.$findTagName(iterator);
- if (!token)
- return;
- var prevToken = iterator.stepBackward();
- if (prevToken.value === '<') {
- return this.$findClosingTag(iterator, token);
}
- else {
- return this.$findOpeningTag(iterator, token);
+ if (lineDif != 0 && i < n) {
+ for (; i < n; i++) {
+ var r = ranges[i];
+ r.start.row += lineDif;
+ r.end.row += lineDif;
+ }
}
};
- this.$findTagName = function (iterator) {
- var token = iterator.getCurrentToken();
- var found = false;
- var backward = false;
- if (token && token.type.indexOf('tag-name') === -1) {
- do {
- if (backward)
- token = iterator.stepBackward();
- else
- token = iterator.stepForward();
- if (token) {
- if (token.value === "/>") {
- backward = true;
- }
- else if (token.type.indexOf('tag-name') !== -1) {
- found = true;
- }
- }
- } while (token && !found);
- }
- return token;
+ return RangeList;
+}());
+RangeList.prototype.comparePoints = comparePoints;
+exports.RangeList = RangeList;
+
+});
+
+ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"], function(require, exports, module){"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+ return extendStatics(d, b);
};
- this.$findClosingTag = function (iterator, token) {
- var prevToken;
- var currentTag = token.value;
- var tag = token.value;
- var depth = 0;
- var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
- token = iterator.stepForward();
- var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
- var foundOpenTagEnd = false;
- do {
- prevToken = token;
- token = iterator.stepForward();
- if (token) {
- if (token.value === '>' && !foundOpenTagEnd) {
- var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`
- foundOpenTagEnd = true;
- }
- if (token.type.indexOf('tag-name') !== -1) {
- currentTag = token.value;
- if (tag === currentTag) {
- if (prevToken.value === '<') {
- depth++;
- }
- else if (prevToken.value === '') {
- depth--;
- if (depth < 0) { //found closing tag
- iterator.stepBackward();
- var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2); //Range for
- token = iterator.stepForward();
- var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
- token = iterator.stepForward();
- if (token && token.value === '>') {
- var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
- }
- else {
- return;
- }
- }
- }
- }
- }
- else if (tag === currentTag && token.value === '/>') { // self-closing tag
- depth--;
- if (depth < 0) { //found self-closing tag end
- var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);
- var closeTagName = closeTagStart;
- var closeTagEnd = closeTagName;
- var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);
- }
- }
- }
- } while (token && depth >= 0);
- if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
- return {
- openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
- closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
- openTagName: openTagName,
- closeTagName: closeTagName
- };
- }
+ return function (d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
- this.$findOpeningTag = function (iterator, token) {
- var prevToken = iterator.getCurrentToken();
- var tag = token.value;
- var depth = 0;
- var startRow = iterator.getCurrentTokenRow();
- var startColumn = iterator.getCurrentTokenColumn();
- var endColumn = startColumn + 2;
- var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for
- iterator.stepForward();
- var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
- token = iterator.stepForward();
- if (!token || token.value !== ">")
+})();
+var RangeList = require("../range_list").RangeList;
+var Fold = /** @class */ (function (_super) {
+ __extends(Fold, _super);
+ function Fold(range, placeholder) {
+ var _this = _super.call(this) || this;
+ _this.foldLine = null;
+ _this.placeholder = placeholder;
+ _this.range = range;
+ _this.start = range.start;
+ _this.end = range.end;
+ _this.sameRow = range.start.row == range.end.row;
+ _this.subFolds = _this.ranges = [];
+ return _this;
+ }
+ Fold.prototype.toString = function () {
+ return '"' + this.placeholder + '" ' + this.range.toString();
+ };
+ Fold.prototype.setFoldLine = function (foldLine) {
+ this.foldLine = foldLine;
+ this.subFolds.forEach(function (fold) {
+ fold.setFoldLine(foldLine);
+ });
+ };
+ Fold.prototype.clone = function () {
+ var range = this.range.clone();
+ var fold = new Fold(range, this.placeholder);
+ this.subFolds.forEach(function (subFold) {
+ fold.subFolds.push(subFold.clone());
+ });
+ fold.collapseChildren = this.collapseChildren;
+ return fold;
+ };
+ Fold.prototype.addSubFold = function (fold) {
+ if (this.range.isEqual(fold))
return;
- var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
- iterator.stepBackward();
- iterator.stepBackward();
- do {
- token = prevToken;
- startRow = iterator.getCurrentTokenRow();
- startColumn = iterator.getCurrentTokenColumn();
- endColumn = startColumn + token.value.length;
- prevToken = iterator.stepBackward();
- if (token) {
- if (token.type.indexOf('tag-name') !== -1) {
- if (tag === token.value) {
- if (prevToken.value === '<') {
- depth++;
- if (depth > 0) { //found opening tag
- var openTagName = new Range(startRow, startColumn, startRow, endColumn);
- var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for <
- do {
- token = iterator.stepForward();
- } while (token && token.value !== '>');
- var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
- }
- }
- else if (prevToken.value === '') {
- depth--;
- }
- }
- }
- else if (token.value === '/>') { // self-closing tag
- var stepCount = 0;
- var tmpToken = prevToken;
- while (tmpToken) {
- if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) {
- depth--;
- break;
- }
- else if (tmpToken.value === '<') {
- break;
- }
- tmpToken = iterator.stepBackward();
- stepCount++;
- }
- for (var i = 0; i < stepCount; i++) {
- iterator.stepForward();
- }
- }
- }
- } while (prevToken && depth <= 0);
- if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
- return {
- openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
- closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
- openTagName: openTagName,
- closeTagName: closeTagName
- };
+ consumeRange(fold, this.start);
+ var row = fold.start.row, column = fold.start.column;
+ for (var i = 0, cmp = -1; i < this.subFolds.length; i++) {
+ cmp = this.subFolds[i].range.compare(row, column);
+ if (cmp != 1)
+ break;
+ }
+ var afterStart = this.subFolds[i];
+ var firstConsumed = 0;
+ if (cmp == 0) {
+ if (afterStart.range.containsRange(fold))
+ return afterStart.addSubFold(fold);
+ else
+ firstConsumed = 1;
+ }
+ var row = fold.range.end.row, column = fold.range.end.column;
+ for (var j = i, cmp = -1; j < this.subFolds.length; j++) {
+ cmp = this.subFolds[j].range.compare(row, column);
+ if (cmp != 1)
+ break;
+ }
+ if (cmp == 0)
+ j++;
+ var consumedFolds = this.subFolds.splice(i, j - i, fold);
+ var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;
+ for (var k = firstConsumed; k < last; k++) {
+ fold.addSubFold(consumedFolds[k]);
}
+ fold.setFoldLine(this.foldLine);
+ return fold;
+ };
+ Fold.prototype.restoreRange = function (range) {
+ return restoreRange(range, this.start);
};
+ return Fold;
+}(RangeList));
+function consumePoint(point, anchor) {
+ point.row -= anchor.row;
+ if (point.row == 0)
+ point.column -= anchor.column;
}
-exports.BracketMatch = BracketMatch;
+function consumeRange(range, anchor) {
+ consumePoint(range.start, anchor);
+ consumePoint(range.end, anchor);
+}
+function restorePoint(point, anchor) {
+ if (point.row == 0)
+ point.column += anchor.column;
+ point.row += anchor.row;
+}
+function restoreRange(range, anchor) {
+ restorePoint(range.start, anchor);
+ restorePoint(range.end, anchor);
+}
+exports.Fold = Fold;
});
-ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module){"use strict";
-var oop = require("./lib/oop");
-var lang = require("./lib/lang");
-var BidiHandler = require("./bidihandler").BidiHandler;
-var config = require("./config");
-var EventEmitter = require("./lib/event_emitter").EventEmitter;
-var Selection = require("./selection").Selection;
-var TextMode = require("./mode/text").Mode;
-var Range = require("./range").Range;
-var Document = require("./document").Document;
-var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer;
-var SearchHighlight = require("./search_highlight").SearchHighlight;
-var UndoManager = require("./undomanager").UndoManager;
-var EditSession = /** @class */ (function () {
- function EditSession(text, mode) { this.doc;
- this.$breakpoints = [];
- this.$decorations = [];
- this.$frontMarkers = {};
- this.$backMarkers = {};
- this.$markerId = 1;
- this.$undoSelect = true;
- this.$foldData = [];
- this.id = "session" + (++EditSession.$uid);
- this.$foldData.toString = function () {
- return this.join("\n");
- };
- this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this);
- var _self = this;
- this.bgTokenizer.on("update", function (e) {
- _self._signal("tokenizerUpdate", e);
- });
- this.on("changeFold", this.onChangeFold.bind(this));
- this.$onChange = this.onChange.bind(this);
- if (typeof text != "object" || !text.getLine)
- text = new Document(/**@type{string}*/ (text));
- this.setDocument(text);
- this.selection = new Selection(this);
- this.$bidiHandler = new BidiHandler(this);
- config.resetOptions(this);
- this.setMode(mode);
- config._signal("session", this);
- this.destroyed = false;
- }
- EditSession.prototype.setDocument = function (doc) {
- if (this.doc)
- this.doc.off("change", this.$onChange);
- this.doc = doc;
- doc.on("change", this.$onChange, true);
- this.bgTokenizer.setDocument(this.getDocument());
- this.resetCaches();
+ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"], function(require, exports, module){// @ts-nocheck
+"use strict";
+var Range = require("../range").Range;
+var FoldLine = require("./fold_line").FoldLine;
+var Fold = require("./fold").Fold;
+var TokenIterator = require("../token_iterator").TokenIterator;
+var MouseEvent = require("../mouse/mouse_event").MouseEvent;
+function Folding() {
+ this.getFoldAt = function (row, column, side) {
+ var foldLine = this.getFoldLine(row);
+ if (!foldLine)
+ return null;
+ var folds = foldLine.folds;
+ for (var i = 0; i < folds.length; i++) {
+ var range = folds[i].range;
+ if (range.contains(row, column)) {
+ if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {
+ continue;
+ }
+ else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {
+ continue;
+ }
+ return folds[i];
+ }
+ }
};
- EditSession.prototype.getDocument = function () {
- return this.doc;
+ this.getFoldsInRange = function (range) {
+ var start = range.start;
+ var end = range.end;
+ var foldLines = this.$foldData;
+ var foundFolds = [];
+ start.column += 1;
+ end.column -= 1;
+ for (var i = 0; i < foldLines.length; i++) {
+ var cmp = foldLines[i].range.compareRange(range);
+ if (cmp == 2) {
+ continue;
+ }
+ else if (cmp == -2) {
+ break;
+ }
+ var folds = foldLines[i].folds;
+ for (var j = 0; j < folds.length; j++) {
+ var fold = folds[j];
+ cmp = fold.range.compareRange(range);
+ if (cmp == -2) {
+ break;
+ }
+ else if (cmp == 2) {
+ continue;
+ }
+ else
+ if (cmp == 42) {
+ break;
+ }
+ foundFolds.push(fold);
+ }
+ }
+ start.column -= 1;
+ end.column += 1;
+ return foundFolds;
};
- EditSession.prototype.$resetRowCache = function (docRow) {
- if (!docRow) {
- this.$docRowCache = [];
- this.$screenRowCache = [];
- return;
+ this.getFoldsInRangeList = function (ranges) {
+ if (Array.isArray(ranges)) {
+ var folds = [];
+ ranges.forEach(function (range) {
+ folds = folds.concat(this.getFoldsInRange(range));
+ }, this);
}
- var l = this.$docRowCache.length;
- var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
- if (l > i) {
- this.$docRowCache.splice(i, l);
- this.$screenRowCache.splice(i, l);
+ else {
+ var folds = this.getFoldsInRange(ranges);
}
+ return folds;
};
- EditSession.prototype.$getRowCacheIndex = function (cacheArray, val) {
- var low = 0;
- var hi = cacheArray.length - 1;
- while (low <= hi) {
- var mid = (low + hi) >> 1;
- var c = cacheArray[mid];
- if (val > c)
- low = mid + 1;
- else if (val < c)
- hi = mid - 1;
- else
- return mid;
+ this.getAllFolds = function () {
+ var folds = [];
+ var foldLines = this.$foldData;
+ for (var i = 0; i < foldLines.length; i++)
+ for (var j = 0; j < foldLines[i].folds.length; j++)
+ folds.push(foldLines[i].folds[j]);
+ return folds;
+ };
+ this.getFoldStringAt = function (row, column, trim, foldLine) {
+ foldLine = foldLine || this.getFoldLine(row);
+ if (!foldLine)
+ return null;
+ var lastFold = {
+ end: { column: 0 }
+ };
+ var str, fold;
+ for (var i = 0; i < foldLine.folds.length; i++) {
+ fold = foldLine.folds[i];
+ var cmp = fold.range.compareEnd(row, column);
+ if (cmp == -1) {
+ str = this
+ .getLine(fold.start.row)
+ .substring(lastFold.end.column, fold.start.column);
+ break;
+ }
+ else if (cmp === 0) {
+ return null;
+ }
+ lastFold = fold;
}
- return low - 1;
+ if (!str)
+ str = this.getLine(fold.start.row).substring(lastFold.end.column);
+ if (trim == -1)
+ return str.substring(0, column - lastFold.end.column);
+ else if (trim == 1)
+ return str.substring(column - lastFold.end.column);
+ else
+ return str;
};
- EditSession.prototype.resetCaches = function () {
- this.$modified = true;
- this.$wrapData = [];
- this.$rowLengthCache = [];
- this.$resetRowCache(0);
- if (!this.destroyed)
- this.bgTokenizer.start(0);
+ this.getFoldLine = function (docRow, startFoldLine) {
+ var foldData = this.$foldData;
+ var i = 0;
+ if (startFoldLine)
+ i = foldData.indexOf(startFoldLine);
+ if (i == -1)
+ i = 0;
+ for (i; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {
+ return foldLine;
+ }
+ else if (foldLine.end.row > docRow) {
+ return null;
+ }
+ }
+ return null;
};
- EditSession.prototype.onChangeFold = function (e) {
- var fold = e.data;
- this.$resetRowCache(fold.start.row);
+ this.getNextFoldLine = function (docRow, startFoldLine) {
+ var foldData = this.$foldData;
+ var i = 0;
+ if (startFoldLine)
+ i = foldData.indexOf(startFoldLine);
+ if (i == -1)
+ i = 0;
+ for (i; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (foldLine.end.row >= docRow) {
+ return foldLine;
+ }
+ }
+ return null;
};
- EditSession.prototype.onChange = function (delta) {
- this.$modified = true;
- this.$bidiHandler.onChange(delta);
- this.$resetRowCache(delta.start.row);
- var removedFolds = this.$updateInternalDataOnChange(delta);
- if (!this.$fromUndo && this.$undoManager) {
- if (removedFolds && removedFolds.length) {
- this.$undoManager.add({
- action: "removeFolds",
- folds: removedFolds
- }, this.mergeUndoDeltas);
- this.mergeUndoDeltas = true;
+ this.getFoldedRowCount = function (first, last) {
+ var foldData = this.$foldData, rowCount = last - first + 1;
+ for (var i = 0; i < foldData.length; i++) {
+ var foldLine = foldData[i], end = foldLine.end.row, start = foldLine.start.row;
+ if (end >= last) {
+ if (start < last) {
+ if (start >= first)
+ rowCount -= last - start;
+ else
+ rowCount = 0; // in one fold
+ }
+ break;
+ }
+ else if (end >= first) {
+ if (start >= first) // fold inside range
+ rowCount -= end - start;
+ else
+ rowCount -= end - first + 1;
}
- this.$undoManager.add(delta, this.mergeUndoDeltas);
- this.mergeUndoDeltas = true;
- this.$informUndoManager.schedule();
}
- this.bgTokenizer.$updateOnChange(delta);
- this._signal("change", delta);
+ return rowCount;
};
- EditSession.prototype.setValue = function (text) {
- this.doc.setValue(text);
- this.selection.moveTo(0, 0);
- this.$resetRowCache(0);
- this.setUndoManager(this.$undoManager);
- this.getUndoManager().reset();
- };
- EditSession.fromJSON = function (session) {
- if (typeof session == "string")
- session = JSON.parse(session);
- var undoManager = new UndoManager();
- undoManager.$undoStack = session.history.undo;
- undoManager.$redoStack = session.history.redo;
- undoManager.mark = session.history.mark;
- undoManager.$rev = session.history.rev;
- var editSession = new EditSession(session.value);
- session.folds.forEach(function (fold) {
- editSession.addFold("...", Range.fromPoints(fold.start, fold.end));
+ this.$addFoldLine = function (foldLine) {
+ this.$foldData.push(foldLine);
+ this.$foldData.sort(function (a, b) {
+ return a.start.row - b.start.row;
});
- editSession.setAnnotations(session.annotations);
- editSession.setBreakpoints(session.breakpoints);
- editSession.setMode(session.mode);
- editSession.setScrollLeft(session.scrollLeft);
- editSession.setScrollTop(session.scrollTop);
- editSession.setUndoManager(undoManager);
- editSession.selection.fromJSON(session.selection);
- return editSession;
+ return foldLine;
};
- EditSession.prototype.toJSON = function () {
- return {
- annotations: this.$annotations,
- breakpoints: this.$breakpoints,
- folds: this.getAllFolds().map(function (fold) {
- return fold.range;
- }),
- history: this.getUndoManager(),
- mode: this.$mode.$id,
- scrollLeft: this.$scrollLeft,
- scrollTop: this.$scrollTop,
- selection: this.selection.toJSON(),
- value: this.doc.getValue()
- };
+ this.addFold = function (placeholder, range) {
+ var foldData = this.$foldData;
+ var added = false;
+ var fold;
+ if (placeholder instanceof Fold)
+ fold = placeholder;
+ else {
+ fold = new Fold(range, placeholder);
+ fold.collapseChildren = range.collapseChildren;
+ }
+ this.$clipRangeToDocument(fold.range);
+ var startRow = fold.start.row;
+ var startColumn = fold.start.column;
+ var endRow = fold.end.row;
+ var endColumn = fold.end.column;
+ var startFold = this.getFoldAt(startRow, startColumn, 1);
+ var endFold = this.getFoldAt(endRow, endColumn, -1);
+ if (startFold && endFold == startFold)
+ return startFold.addSubFold(fold);
+ if (startFold && !startFold.range.isStart(startRow, startColumn))
+ this.removeFold(startFold);
+ if (endFold && !endFold.range.isEnd(endRow, endColumn))
+ this.removeFold(endFold);
+ var folds = this.getFoldsInRange(fold.range);
+ if (folds.length > 0) {
+ this.removeFolds(folds);
+ if (!fold.collapseChildren) {
+ folds.forEach(function (subFold) {
+ fold.addSubFold(subFold);
+ });
+ }
+ }
+ for (var i = 0; i < foldData.length; i++) {
+ var foldLine = foldData[i];
+ if (endRow == foldLine.start.row) {
+ foldLine.addFold(fold);
+ added = true;
+ break;
+ }
+ else if (startRow == foldLine.end.row) {
+ foldLine.addFold(fold);
+ added = true;
+ if (!fold.sameRow) {
+ var foldLineNext = foldData[i + 1];
+ if (foldLineNext && foldLineNext.start.row == endRow) {
+ foldLine.merge(foldLineNext);
+ break;
+ }
+ }
+ break;
+ }
+ else if (endRow <= foldLine.start.row) {
+ break;
+ }
+ }
+ if (!added)
+ foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));
+ if (this.$useWrapMode)
+ this.$updateWrapData(foldLine.start.row, foldLine.start.row);
+ else
+ this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);
+ this.$modified = true;
+ this._signal("changeFold", { data: fold, action: "add" });
+ return fold;
};
- EditSession.prototype.toString = function () {
- return this.doc.getValue();
+ this.addFolds = function (folds) {
+ folds.forEach(function (fold) {
+ this.addFold(fold);
+ }, this);
};
- EditSession.prototype.getSelection = function () {
- return this.selection;
+ this.removeFold = function (fold) {
+ var foldLine = fold.foldLine;
+ var startRow = foldLine.start.row;
+ var endRow = foldLine.end.row;
+ var foldLines = this.$foldData;
+ var folds = foldLine.folds;
+ if (folds.length == 1) {
+ foldLines.splice(foldLines.indexOf(foldLine), 1);
+ }
+ else
+ if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {
+ folds.pop();
+ foldLine.end.row = folds[folds.length - 1].end.row;
+ foldLine.end.column = folds[folds.length - 1].end.column;
+ }
+ else
+ if (foldLine.range.isStart(fold.start.row, fold.start.column)) {
+ folds.shift();
+ foldLine.start.row = folds[0].start.row;
+ foldLine.start.column = folds[0].start.column;
+ }
+ else
+ if (fold.sameRow) {
+ folds.splice(folds.indexOf(fold), 1);
+ }
+ else
+ {
+ var newFoldLine = foldLine.split(fold.start.row, fold.start.column);
+ folds = newFoldLine.folds;
+ folds.shift();
+ newFoldLine.start.row = folds[0].start.row;
+ newFoldLine.start.column = folds[0].start.column;
+ }
+ if (!this.$updating) {
+ if (this.$useWrapMode)
+ this.$updateWrapData(startRow, endRow);
+ else
+ this.$updateRowLengthCache(startRow, endRow);
+ }
+ this.$modified = true;
+ this._signal("changeFold", { data: fold, action: "remove" });
};
- EditSession.prototype.getState = function (row) {
- return this.bgTokenizer.getState(row);
+ this.removeFolds = function (folds) {
+ var cloneFolds = [];
+ for (var i = 0; i < folds.length; i++) {
+ cloneFolds.push(folds[i]);
+ }
+ cloneFolds.forEach(function (fold) {
+ this.removeFold(fold);
+ }, this);
+ this.$modified = true;
};
- EditSession.prototype.getTokens = function (row) {
- return this.bgTokenizer.getTokens(row);
+ this.expandFold = function (fold) {
+ this.removeFold(fold);
+ fold.subFolds.forEach(function (subFold) {
+ fold.restoreRange(subFold);
+ this.addFold(subFold);
+ }, this);
+ if (fold.collapseChildren > 0) {
+ this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);
+ }
+ fold.subFolds = [];
};
- EditSession.prototype.getTokenAt = function (row, column) {
- var tokens = this.bgTokenizer.getTokens(row);
- var token, c = 0;
- if (column == null) {
- var i = tokens.length - 1;
- c = this.getLine(row).length;
+ this.expandFolds = function (folds) {
+ folds.forEach(function (fold) {
+ this.expandFold(fold);
+ }, this);
+ };
+ this.unfold = function (location, expandInner) {
+ var range, folds;
+ if (location == null) {
+ range = new Range(0, 0, this.getLength(), 0);
+ if (expandInner == null)
+ expandInner = true;
}
- else {
- for (var i = 0; i < tokens.length; i++) {
- c += tokens[i].value.length;
- if (c >= column)
- break;
- }
+ else if (typeof location == "number") {
+ range = new Range(location, 0, location, this.getLine(location).length);
}
- token = tokens[i];
- if (!token)
- return null;
- token.index = i;
- token.start = c - token.value.length;
- return token;
- };
- EditSession.prototype.setUndoManager = function (undoManager) {
- this.$undoManager = undoManager;
- if (this.$informUndoManager)
- this.$informUndoManager.cancel();
- if (undoManager) {
- var self = this;
- undoManager.addSession(this);
- this.$syncInformUndoManager = function () {
- self.$informUndoManager.cancel();
- self.mergeUndoDeltas = false;
- };
- this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
+ else if ("row" in location) {
+ range = Range.fromPoints(location, location);
+ }
+ else if (Array.isArray(location)) {
+ folds = [];
+ location.forEach(function (range) {
+ folds = folds.concat(this.unfold(range));
+ }, this);
+ return folds;
}
else {
- this.$syncInformUndoManager = function () { };
+ range = location;
}
- };
- EditSession.prototype.markUndoGroup = function () {
- if (this.$syncInformUndoManager)
- this.$syncInformUndoManager();
- };
- EditSession.prototype.getUndoManager = function () {
- return this.$undoManager || this.$defaultUndoManager;
- };
- EditSession.prototype.getTabString = function () {
- if (this.getUseSoftTabs()) {
- return lang.stringRepeat(" ", this.getTabSize());
+ folds = this.getFoldsInRangeList(range);
+ var outermostFolds = folds;
+ while (folds.length == 1
+ && Range.comparePoints(folds[0].start, range.start) < 0
+ && Range.comparePoints(folds[0].end, range.end) > 0) {
+ this.expandFolds(folds);
+ folds = this.getFoldsInRangeList(range);
+ }
+ if (expandInner != false) {
+ this.removeFolds(folds);
}
else {
- return "\t";
+ this.expandFolds(folds);
}
+ if (outermostFolds.length)
+ return outermostFolds;
};
- EditSession.prototype.setUseSoftTabs = function (val) {
- this.setOption("useSoftTabs", val);
- };
- EditSession.prototype.getUseSoftTabs = function () {
- return this.$useSoftTabs && !this.$mode.$indentWithTabs;
- };
- EditSession.prototype.setTabSize = function (tabSize) {
- this.setOption("tabSize", tabSize);
- };
- EditSession.prototype.getTabSize = function () {
- return this.$tabSize;
- };
- EditSession.prototype.isTabStop = function (position) {
- return this.$useSoftTabs && (position.column % this.$tabSize === 0);
- };
- EditSession.prototype.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {
- this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs);
- };
- EditSession.prototype.getNavigateWithinSoftTabs = function () {
- return this.$navigateWithinSoftTabs;
- };
- EditSession.prototype.setOverwrite = function (overwrite) {
- this.setOption("overwrite", overwrite);
- };
- EditSession.prototype.getOverwrite = function () {
- return this.$overwrite;
- };
- EditSession.prototype.toggleOverwrite = function () {
- this.setOverwrite(!this.$overwrite);
- };
- EditSession.prototype.addGutterDecoration = function (row, className) {
- if (!this.$decorations[row])
- this.$decorations[row] = "";
- this.$decorations[row] += " " + className;
- this._signal("changeBreakpoint", {});
- };
- EditSession.prototype.removeGutterDecoration = function (row, className) {
- this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
- this._signal("changeBreakpoint", {});
- };
- EditSession.prototype.getBreakpoints = function () {
- return this.$breakpoints;
- };
- EditSession.prototype.setBreakpoints = function (rows) {
- this.$breakpoints = [];
- for (var i = 0; i < rows.length; i++) {
- this.$breakpoints[rows[i]] = "ace_breakpoint";
- }
- this._signal("changeBreakpoint", {});
+ this.isRowFolded = function (docRow, startFoldRow) {
+ return !!this.getFoldLine(docRow, startFoldRow);
};
- EditSession.prototype.clearBreakpoints = function () {
- this.$breakpoints = [];
- this._signal("changeBreakpoint", {});
+ this.getRowFoldEnd = function (docRow, startFoldRow) {
+ var foldLine = this.getFoldLine(docRow, startFoldRow);
+ return foldLine ? foldLine.end.row : docRow;
};
- EditSession.prototype.setBreakpoint = function (row, className) {
- if (className === undefined)
- className = "ace_breakpoint";
- if (className)
- this.$breakpoints[row] = className;
- else
- delete this.$breakpoints[row];
- this._signal("changeBreakpoint", {});
+ this.getRowFoldStart = function (docRow, startFoldRow) {
+ var foldLine = this.getFoldLine(docRow, startFoldRow);
+ return foldLine ? foldLine.start.row : docRow;
};
- EditSession.prototype.clearBreakpoint = function (row) {
- delete this.$breakpoints[row];
- this._signal("changeBreakpoint", {});
+ this.getFoldDisplayLine = function (foldLine, endRow, endColumn, startRow, startColumn) {
+ if (startRow == null)
+ startRow = foldLine.start.row;
+ if (startColumn == null)
+ startColumn = 0;
+ if (endRow == null)
+ endRow = foldLine.end.row;
+ if (endColumn == null)
+ endColumn = this.getLine(endRow).length;
+ var doc = this.doc;
+ var textLine = "";
+ foldLine.walk(function (placeholder, row, column, lastColumn) {
+ if (row < startRow)
+ return;
+ if (row == startRow) {
+ if (column < startColumn)
+ return;
+ lastColumn = Math.max(startColumn, lastColumn);
+ }
+ if (placeholder != null) {
+ textLine += placeholder;
+ }
+ else {
+ textLine += doc.getLine(row).substring(lastColumn, column);
+ }
+ }, endRow, endColumn);
+ return textLine;
};
- EditSession.prototype.addMarker = function (range, clazz, type, inFront) {
- var id = this.$markerId++;
- var marker = {
- range: range,
- type: type || "line",
- renderer: typeof type == "function" ? type : null,
- clazz: clazz,
- inFront: !!inFront,
- id: id
- };
- if (inFront) {
- this.$frontMarkers[id] = marker;
- this._signal("changeFrontMarker");
+ this.getDisplayLine = function (row, endColumn, startRow, startColumn) {
+ var foldLine = this.getFoldLine(row);
+ if (!foldLine) {
+ var line;
+ line = this.doc.getLine(row);
+ return line.substring(startColumn || 0, endColumn || line.length);
}
else {
- this.$backMarkers[id] = marker;
- this._signal("changeBackMarker");
+ return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);
}
- return id;
};
- EditSession.prototype.addDynamicMarker = function (marker, inFront) {
- if (!marker.update)
- return;
- var id = this.$markerId++;
- marker.id = id;
- marker.inFront = !!inFront;
- if (inFront) {
- this.$frontMarkers[id] = marker;
- this._signal("changeFrontMarker");
+ this.$cloneFoldData = function () {
+ var fd = [];
+ fd = this.$foldData.map(function (foldLine) {
+ var folds = foldLine.folds.map(function (fold) {
+ return fold.clone();
+ });
+ return new FoldLine(fd, folds);
+ });
+ return fd;
+ };
+ this.toggleFold = function (tryToUnfold) {
+ var selection = this.selection;
+ var range = selection.getRange();
+ var fold;
+ var bracketPos;
+ if (range.isEmpty()) {
+ var cursor = range.start;
+ fold = this.getFoldAt(cursor.row, cursor.column);
+ if (fold) {
+ this.expandFold(fold);
+ return;
+ }
+ else if (bracketPos = this.findMatchingBracket(cursor)) {
+ if (range.comparePoint(bracketPos) == 1) {
+ range.end = bracketPos;
+ }
+ else {
+ range.start = bracketPos;
+ range.start.column++;
+ range.end.column--;
+ }
+ }
+ else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {
+ if (range.comparePoint(bracketPos) == 1)
+ range.end = bracketPos;
+ else
+ range.start = bracketPos;
+ range.start.column++;
+ }
+ else {
+ range = this.getCommentFoldRange(cursor.row, cursor.column) || range;
+ }
}
else {
- this.$backMarkers[id] = marker;
- this._signal("changeBackMarker");
+ var folds = this.getFoldsInRange(range);
+ if (tryToUnfold && folds.length) {
+ this.expandFolds(folds);
+ return;
+ }
+ else if (folds.length == 1) {
+ fold = folds[0];
+ }
}
- return marker;
- };
- EditSession.prototype.removeMarker = function (markerId) {
- var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
- if (!marker)
+ if (!fold)
+ fold = this.getFoldAt(range.start.row, range.start.column);
+ if (fold && fold.range.toString() == range.toString()) {
+ this.expandFold(fold);
return;
- var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
- delete (markers[markerId]);
- this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
- };
- EditSession.prototype.getMarkers = function (inFront) {
- return inFront ? this.$frontMarkers : this.$backMarkers;
- };
- EditSession.prototype.highlight = function (re) {
- if (!this.$searchHighlight) {
- var highlight = new SearchHighlight(null, "ace_selected-word", "text");
- this.$searchHighlight = this.addDynamicMarker(highlight);
}
- this.$searchHighlight.setRegexp(re);
+ var placeholder = "...";
+ if (!range.isMultiLine()) {
+ placeholder = this.getTextRange(range);
+ if (placeholder.length < 4)
+ return;
+ placeholder = placeholder.trim().substring(0, 2) + "..";
+ }
+ this.addFold(placeholder, range);
};
- EditSession.prototype.highlightLines = function (startRow, endRow, clazz, inFront) {
- if (typeof endRow != "number") {
- clazz = endRow;
- endRow = startRow;
+ this.getCommentFoldRange = function (row, column, dir) {
+ var iterator = new TokenIterator(this, row, column);
+ var token = iterator.getCurrentToken();
+ var type = token && token.type;
+ if (token && /^comment|string/.test(type)) {
+ type = type.match(/comment|string/)[0];
+ if (type == "comment")
+ type += "|doc-start|\\.doc";
+ var re = new RegExp(type);
+ var range = new Range();
+ if (dir != 1) {
+ do {
+ token = iterator.stepBackward();
+ } while (token && re.test(token.type));
+ token = iterator.stepForward();
+ }
+ range.start.row = iterator.getCurrentTokenRow();
+ range.start.column = iterator.getCurrentTokenColumn() + token.value.length;
+ iterator = new TokenIterator(this, row, column);
+ var initState = this.getState(iterator.$row);
+ if (dir != -1) {
+ var lastRow = -1;
+ do {
+ token = iterator.stepForward();
+ if (lastRow == -1) {
+ var state = this.getState(iterator.$row);
+ if (initState.toString() !== state.toString())
+ lastRow = iterator.$row;
+ }
+ else if (iterator.$row > lastRow) {
+ break;
+ }
+ } while (token && re.test(token.type));
+ token = iterator.stepBackward();
+ }
+ else
+ token = iterator.getCurrentToken();
+ range.end.row = iterator.getCurrentTokenRow();
+ range.end.column = iterator.getCurrentTokenColumn();
+ return range;
}
- if (!clazz)
- clazz = "ace_step";
- var range = new Range(startRow, 0, endRow, Infinity);
- range.id = this.addMarker(range, clazz, "fullLine", inFront);
- return range;
};
- EditSession.prototype.setAnnotations = function (annotations) {
- this.$annotations = annotations;
- this._signal("changeAnnotation", {});
+ this.foldAll = function (startRow, endRow, depth, test) {
+ if (depth == undefined)
+ depth = 100000; // JSON.stringify doesn't hanle Infinity
+ var foldWidgets = this.foldWidgets;
+ if (!foldWidgets)
+ return; // mode doesn't support folding
+ endRow = endRow || this.getLength();
+ startRow = startRow || 0;
+ for (var row = startRow; row < endRow; row++) {
+ if (foldWidgets[row] == null)
+ foldWidgets[row] = this.getFoldWidget(row);
+ if (foldWidgets[row] != "start")
+ continue;
+ if (test && !test(row))
+ continue;
+ var range = this.getFoldWidgetRange(row);
+ if (range && range.isMultiLine()
+ && range.end.row <= endRow
+ && range.start.row >= startRow) {
+ row = range.end.row;
+ range.collapseChildren = depth;
+ this.addFold("...", range);
+ }
+ }
};
- EditSession.prototype.getAnnotations = function () {
- return this.$annotations || [];
+ this.foldToLevel = function (level) {
+ this.foldAll();
+ while (level-- > 0)
+ this.unfold(null, false);
};
- EditSession.prototype.clearAnnotations = function () {
- this.setAnnotations([]);
+ this.foldAllComments = function () {
+ var session = this;
+ this.foldAll(null, null, null, function (row) {
+ var tokens = session.getTokens(row);
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ if (token.type == "text" && /^\s+$/.test(token.value))
+ continue;
+ if (/comment/.test(token.type))
+ return true;
+ return false;
+ }
+ });
};
- EditSession.prototype.$detectNewLine = function (text) {
- var match = text.match(/^.*?(\r?\n)/m);
- if (match) {
- this.$autoNewLine = match[1];
+ this.$foldStyles = {
+ "manual": 1,
+ "markbegin": 1,
+ "markbeginend": 1
+ };
+ this.$foldStyle = "markbegin";
+ this.setFoldStyle = function (style) {
+ if (!this.$foldStyles[style])
+ throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
+ if (this.$foldStyle == style)
+ return;
+ this.$foldStyle = style;
+ if (style == "manual")
+ this.unfold();
+ var mode = this.$foldMode;
+ this.$setFolding(null);
+ this.$setFolding(mode);
+ };
+ this.$setFolding = function (foldMode) {
+ if (this.$foldMode == foldMode)
+ return;
+ this.$foldMode = foldMode;
+ this.off('change', this.$updateFoldWidgets);
+ this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);
+ this._signal("changeAnnotation");
+ if (!foldMode || this.$foldStyle == "manual") {
+ this.foldWidgets = null;
+ return;
}
- else {
- this.$autoNewLine = "\n";
+ this.foldWidgets = [];
+ this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);
+ this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);
+ this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);
+ this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);
+ this.on('change', this.$updateFoldWidgets);
+ this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets);
+ };
+ this.getParentFoldRangeData = function (row, ignoreCurrent) {
+ var fw = this.foldWidgets;
+ if (!fw || (ignoreCurrent && fw[row]))
+ return {};
+ var i = row - 1, firstRange;
+ while (i >= 0) {
+ var c = fw[i];
+ if (c == null)
+ c = fw[i] = this.getFoldWidget(i);
+ if (c == "start") {
+ var range = this.getFoldWidgetRange(i);
+ if (!firstRange)
+ firstRange = range;
+ if (range && range.end.row >= row)
+ break;
+ }
+ i--;
}
+ return {
+ range: i !== -1 && range,
+ firstRange: firstRange
+ };
};
- EditSession.prototype.getWordRange = function (row, column) {
+ this.onFoldWidgetClick = function (row, e) {
+ if (e instanceof MouseEvent)
+ e = e.domEvent;
+ var options = {
+ children: e.shiftKey,
+ all: e.ctrlKey || e.metaKey,
+ siblings: e.altKey
+ };
+ var range = this.$toggleFoldWidget(row, options);
+ if (!range) {
+ var el = (e.target || e.srcElement);
+ if (el && /ace_fold-widget/.test(el.className))
+ el.className += " ace_invalid";
+ }
+ };
+ this.$toggleFoldWidget = function (row, options) {
+ if (!this.getFoldWidget)
+ return;
+ var type = this.getFoldWidget(row);
var line = this.getLine(row);
- var inToken = false;
- if (column > 0)
- inToken = !!line.charAt(column - 1).match(this.tokenRe);
- if (!inToken)
- inToken = !!line.charAt(column).match(this.tokenRe);
- if (inToken)
- var re = this.tokenRe;
- else if (/^\s+$/.test(line.slice(column - 1, column + 1)))
- var re = /\s/;
- else
- var re = this.nonTokenRe;
- var start = column;
- if (start > 0) {
- do {
- start--;
- } while (start >= 0 && line.charAt(start).match(re));
- start++;
+ var dir = type === "end" ? -1 : 1;
+ var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);
+ if (fold) {
+ if (options.children || options.all)
+ this.removeFold(fold);
+ else
+ this.expandFold(fold);
+ return fold;
}
- var end = column;
- while (end < line.length && line.charAt(end).match(re)) {
- end++;
+ var range = this.getFoldWidgetRange(row, true);
+ if (range && !range.isMultiLine()) {
+ fold = this.getFoldAt(range.start.row, range.start.column, 1);
+ if (fold && range.isEqual(fold.range)) {
+ this.removeFold(fold);
+ return fold;
+ }
}
- return new Range(row, start, row, end);
- };
- EditSession.prototype.getAWordRange = function (row, column) {
- var wordRange = this.getWordRange(row, column);
- var line = this.getLine(wordRange.end.row);
- while (line.charAt(wordRange.end.column).match(/[ \t]/)) {
- wordRange.end.column += 1;
+ if (options.siblings) {
+ var data = this.getParentFoldRangeData(row);
+ if (data.range) {
+ var startRow = data.range.start.row + 1;
+ var endRow = data.range.end.row;
+ }
+ this.foldAll(startRow, endRow, options.all ? 10000 : 0);
}
- return wordRange;
- };
- EditSession.prototype.setNewLineMode = function (newLineMode) {
- this.doc.setNewLineMode(newLineMode);
- };
- EditSession.prototype.getNewLineMode = function () {
- return this.doc.getNewLineMode();
- };
- EditSession.prototype.setUseWorker = function (useWorker) { this.setOption("useWorker", useWorker); };
- EditSession.prototype.getUseWorker = function () { return this.$useWorker; };
- EditSession.prototype.onReloadTokenizer = function (e) {
- var rows = e.data;
- this.bgTokenizer.start(rows.first);
- this._signal("tokenizerUpdate", e);
- };
- EditSession.prototype.setMode = function (mode, cb) {
- if (mode && typeof mode === "object") {
- if (mode.getTokenizer)
- return this.$onChangeMode(mode);
- var options = mode;
- var path = options.path;
+ else if (options.children) {
+ endRow = range ? range.end.row : this.getLength();
+ this.foldAll(row + 1, endRow, options.all ? 10000 : 0);
}
- else {
- path = /**@type{string}*/ (mode) || "ace/mode/text";
+ else if (range) {
+ if (options.all)
+ range.collapseChildren = 10000;
+ this.addFold("...", range);
}
- if (!this.$modes["ace/mode/text"])
- this.$modes["ace/mode/text"] = new TextMode();
- if (this.$modes[path] && !options) {
- this.$onChangeMode(this.$modes[path]);
- cb && cb();
+ return range;
+ };
+ this.toggleFoldWidget = function (toggleParent) {
+ var row = this.selection.getCursor().row;
+ row = this.getRowFoldStart(row);
+ var range = this.$toggleFoldWidget(row, {});
+ if (range)
return;
- }
- this.$modeId = path;
- config.loadModule(["mode", path], function (m) {
- if (this.$modeId !== path)
- return cb && cb();
- if (this.$modes[path] && !options) {
- this.$onChangeMode(this.$modes[path]);
+ var data = this.getParentFoldRangeData(row, true);
+ range = data.range || data.firstRange;
+ if (range) {
+ row = range.start.row;
+ var fold = this.getFoldAt(row, this.getLine(row).length, 1);
+ if (fold) {
+ this.removeFold(fold);
}
- else if (m && m.Mode) {
- m = new m.Mode(options);
- if (!options) {
- this.$modes[path] = m;
- m.$id = path;
- }
- this.$onChangeMode(m);
+ else {
+ this.addFold("...", range);
}
- cb && cb();
- }.bind(this));
- if (!this.$mode)
- this.$onChangeMode(this.$modes["ace/mode/text"], true);
+ }
};
- EditSession.prototype.$onChangeMode = function (mode, $isPlaceholder) {
- if (!$isPlaceholder)
- this.$modeId = mode.$id;
- if (this.$mode === mode)
- return;
- var oldMode = this.$mode;
- this.$mode = mode;
- this.$stopWorker();
- if (this.$useWorker)
- this.$startWorker();
- var tokenizer = mode.getTokenizer();
- if (tokenizer.on !== undefined) {
- var onReloadTokenizer = this.onReloadTokenizer.bind(this);
- tokenizer.on("update", onReloadTokenizer);
+ this.updateFoldWidgets = function (delta) {
+ var firstRow = delta.start.row;
+ var len = delta.end.row - firstRow;
+ if (len === 0) {
+ this.foldWidgets[firstRow] = null;
}
- this.bgTokenizer.setTokenizer(tokenizer);
- this.bgTokenizer.setDocument(this.getDocument());
- this.tokenRe = mode.tokenRe;
- this.nonTokenRe = mode.nonTokenRe;
- if (!$isPlaceholder) {
- if (mode.attachToSession)
- mode.attachToSession(this);
- this.$options.wrapMethod.set.call(this, this.$wrapMethod);
- this.$setFolding(mode.foldingRules);
- this.bgTokenizer.start(0);
- this._emit("changeMode", { oldMode: oldMode, mode: mode });
+ else if (delta.action == 'remove') {
+ this.foldWidgets.splice(firstRow, len + 1, null);
}
- };
- EditSession.prototype.$stopWorker = function () {
- if (this.$worker) {
- this.$worker.terminate();
- this.$worker = null;
+ else {
+ var args = Array(len + 1);
+ args.unshift(firstRow, 1);
+ this.foldWidgets.splice.apply(this.foldWidgets, args);
}
};
- EditSession.prototype.$startWorker = function () {
- try {
- this.$worker = this.$mode.createWorker(this);
- }
- catch (e) {
- config.warn("Could not load worker", e);
- this.$worker = null;
+ this.tokenizerUpdateFoldWidgets = function (e) {
+ var rows = e.data;
+ if (rows.first != rows.last) {
+ if (this.foldWidgets.length > rows.first)
+ this.foldWidgets.splice(rows.first, this.foldWidgets.length);
}
};
- EditSession.prototype.getMode = function () {
- return this.$mode;
- };
- EditSession.prototype.setScrollTop = function (scrollTop) {
- if (this.$scrollTop === scrollTop || isNaN(scrollTop))
- return;
- this.$scrollTop = scrollTop;
- this._signal("changeScrollTop", scrollTop);
- };
- EditSession.prototype.getScrollTop = function () {
- return this.$scrollTop;
- };
- EditSession.prototype.setScrollLeft = function (scrollLeft) {
- if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))
- return;
- this.$scrollLeft = scrollLeft;
- this._signal("changeScrollLeft", scrollLeft);
- };
- EditSession.prototype.getScrollLeft = function () {
- return this.$scrollLeft;
- };
- EditSession.prototype.getScreenWidth = function () {
- this.$computeWidth();
- if (this.lineWidgets)
- return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);
- return this.screenWidth;
- };
- EditSession.prototype.getLineWidgetMaxWidth = function () {
- if (this.lineWidgetsWidth != null)
- return this.lineWidgetsWidth;
- var width = 0;
- this.lineWidgets.forEach(function (w) {
- if (w && w.screenWidth > width)
- width = w.screenWidth;
- });
- return this.lineWidgetWidth = width;
+}
+exports.Folding = Folding;
+
+});
+
+ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"], function(require, exports, module){"use strict";
+var TokenIterator = require("../token_iterator").TokenIterator;
+var Range = require("../range").Range;
+function BracketMatch() {
+ this.findMatchingBracket = function (position, chr) {
+ if (position.column == 0)
+ return null;
+ var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);
+ if (charBeforeCursor == "")
+ return null;
+ var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/);
+ if (!match)
+ return null;
+ if (match[1])
+ return this.$findClosingBracket(match[1], position);
+ else
+ return this.$findOpeningBracket(match[2], position);
};
- EditSession.prototype.$computeWidth = function (force) {
- if (this.$modified || force) {
- this.$modified = false;
- if (this.$useWrapMode)
- return this.screenWidth = this.$wrapLimit;
- var lines = this.doc.getAllLines();
- var cache = this.$rowLengthCache;
- var longestScreenLine = 0;
- var foldIndex = 0;
- var foldLine = this.$foldData[foldIndex];
- var foldStart = foldLine ? foldLine.start.row : Infinity;
- var len = lines.length;
- for (var i = 0; i < len; i++) {
- if (i > foldStart) {
- i = foldLine.end.row + 1;
- if (i >= len)
- break;
- foldLine = this.$foldData[foldIndex++];
- foldStart = foldLine ? foldLine.start.row : Infinity;
- }
- if (cache[i] == null)
- cache[i] = this.$getStringScreenWidth(lines[i])[0];
- if (cache[i] > longestScreenLine)
- longestScreenLine = cache[i];
- }
- this.screenWidth = longestScreenLine;
+ this.getBracketRange = function (pos) {
+ var line = this.getLine(pos.row);
+ var before = true, range;
+ var chr = line.charAt(pos.column - 1);
+ var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ if (!match) {
+ chr = line.charAt(pos.column);
+ pos = { row: pos.row, column: pos.column + 1 };
+ match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
+ before = false;
}
- };
- EditSession.prototype.getLine = function (row) {
- return this.doc.getLine(row);
- };
- EditSession.prototype.getLines = function (firstRow, lastRow) {
- return this.doc.getLines(firstRow, lastRow);
- };
- EditSession.prototype.getLength = function () {
- return this.doc.getLength();
- };
- EditSession.prototype.getTextRange = function (range) {
- return this.doc.getTextRange(range || this.selection.getRange());
- };
- EditSession.prototype.insert = function (position, text) {
- return this.doc.insert(position, text);
- };
- EditSession.prototype.remove = function (range) {
- return this.doc.remove(range);
- };
- EditSession.prototype.removeFullLines = function (firstRow, lastRow) {
- return this.doc.removeFullLines(firstRow, lastRow);
- };
- EditSession.prototype.undoChanges = function (deltas, dontSelect) {
- if (!deltas.length)
- return;
- this.$fromUndo = true;
- for (var i = deltas.length - 1; i != -1; i--) {
- var delta = deltas[i];
- if (delta.action == "insert" || delta.action == "remove") {
- this.doc.revertDelta(delta);
- }
- else if (delta.folds) {
- this.addFolds(delta.folds);
+ if (!match)
+ return null;
+ if (match[1]) {
+ var bracketPos = this.$findClosingBracket(match[1], pos);
+ if (!bracketPos)
+ return null;
+ range = Range.fromPoints(pos, bracketPos);
+ if (!before) {
+ range.end.column++;
+ range.start.column--;
}
+ range.cursor = range.end;
}
- if (!dontSelect && this.$undoSelect) {
- if (deltas.selectionBefore)
- this.selection.fromJSON(deltas.selectionBefore);
- else
- this.selection.setRange(this.$getUndoSelection(deltas, true));
- }
- this.$fromUndo = false;
- };
- EditSession.prototype.redoChanges = function (deltas, dontSelect) {
- if (!deltas.length)
- return;
- this.$fromUndo = true;
- for (var i = 0; i < deltas.length; i++) {
- var delta = deltas[i];
- if (delta.action == "insert" || delta.action == "remove") {
- this.doc.$safeApplyDelta(delta);
+ else {
+ var bracketPos = this.$findOpeningBracket(match[2], pos);
+ if (!bracketPos)
+ return null;
+ range = Range.fromPoints(bracketPos, pos);
+ if (!before) {
+ range.start.column++;
+ range.end.column--;
}
+ range.cursor = range.start;
}
- if (!dontSelect && this.$undoSelect) {
- if (deltas.selectionAfter)
- this.selection.fromJSON(deltas.selectionAfter);
- else
- this.selection.setRange(this.$getUndoSelection(deltas, false));
+ return range;
+ };
+ this.getMatchingBracketRanges = function (pos, isBackwards) {
+ var line = this.getLine(pos.row);
+ var bracketsRegExp = /([\(\[\{])|([\)\]\}])/;
+ var chr = !isBackwards && line.charAt(pos.column - 1);
+ var match = chr && chr.match(bracketsRegExp);
+ if (!match) {
+ chr = (isBackwards === undefined || isBackwards) && line.charAt(pos.column);
+ pos = {
+ row: pos.row,
+ column: pos.column + 1
+ };
+ match = chr && chr.match(bracketsRegExp);
}
- this.$fromUndo = false;
+ if (!match)
+ return null;
+ var startRange = new Range(pos.row, pos.column - 1, pos.row, pos.column);
+ var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos)
+ : this.$findOpeningBracket(match[2], pos);
+ if (!bracketPos)
+ return [startRange];
+ var endRange = new Range(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);
+ return [startRange, endRange];
};
- EditSession.prototype.setUndoSelect = function (enable) {
- this.$undoSelect = enable;
+ this.$brackets = {
+ ")": "(",
+ "(": ")",
+ "]": "[",
+ "[": "]",
+ "{": "}",
+ "}": "{",
+ "<": ">",
+ ">": "<"
};
- EditSession.prototype.$getUndoSelection = function (deltas, isUndo) {
- function isInsert(delta) {
- return isUndo ? delta.action !== "insert" : delta.action === "insert";
- }
- var range, point;
- for (var i = 0; i < deltas.length; i++) {
- var delta = deltas[i];
- if (!delta.start)
- continue; // skip folds
- if (!range) {
- if (isInsert(delta)) {
- range = Range.fromPoints(delta.start, delta.end);
+ this.$findOpeningBracket = function (bracket, position, typeRe) {
+ var openBracket = this.$brackets[bracket];
+ var depth = 1;
+ var iterator = new TokenIterator(this, position.row, position.column);
+ var token = iterator.getCurrentToken();
+ if (!token)
+ token = iterator.stepForward();
+ if (!token)
+ return;
+ if (!typeRe) {
+ typeRe = new RegExp("(\\.?" +
+ token.type.replace(".", "\\.").replace("rparen", ".paren")
+ .replace(/\b(?:end)\b/, "(?:start|begin|end)")
+ .replace(/-close\b/, "-(close|open)")
+ + ")+");
+ }
+ var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;
+ var value = token.value;
+ while (true) {
+ while (valueIndex >= 0) {
+ var chr = value.charAt(valueIndex);
+ if (chr == openBracket) {
+ depth -= 1;
+ if (depth == 0) {
+ return { row: iterator.getCurrentTokenRow(),
+ column: valueIndex + iterator.getCurrentTokenColumn() };
+ }
}
- else {
- range = Range.fromPoints(delta.start, delta.start);
+ else if (chr == bracket) {
+ depth += 1;
}
- continue;
+ valueIndex -= 1;
}
- if (isInsert(delta)) {
- point = delta.start;
- if (range.compare(point.row, point.column) == -1) {
- range.setStart(point);
- }
- point = delta.end;
- if (range.compare(point.row, point.column) == 1) {
- range.setEnd(point);
+ do {
+ token = iterator.stepBackward();
+ } while (token && !typeRe.test(token.type));
+ if (token == null)
+ break;
+ value = token.value;
+ valueIndex = value.length - 1;
+ }
+ return null;
+ };
+ this.$findClosingBracket = function (bracket, position, typeRe) {
+ var closingBracket = this.$brackets[bracket];
+ var depth = 1;
+ var iterator = new TokenIterator(this, position.row, position.column);
+ var token = iterator.getCurrentToken();
+ if (!token)
+ token = iterator.stepForward();
+ if (!token)
+ return;
+ if (!typeRe) {
+ typeRe = new RegExp("(\\.?" +
+ token.type.replace(".", "\\.").replace("lparen", ".paren")
+ .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)")
+ .replace(/-open\b/, "-(close|open)")
+ + ")+");
+ }
+ var valueIndex = position.column - iterator.getCurrentTokenColumn();
+ while (true) {
+ var value = token.value;
+ var valueLength = value.length;
+ while (valueIndex < valueLength) {
+ var chr = value.charAt(valueIndex);
+ if (chr == closingBracket) {
+ depth -= 1;
+ if (depth == 0) {
+ return { row: iterator.getCurrentTokenRow(),
+ column: valueIndex + iterator.getCurrentTokenColumn() };
+ }
}
- }
- else {
- point = delta.start;
- if (range.compare(point.row, point.column) == -1) {
- range = Range.fromPoints(delta.start, delta.start);
+ else if (chr == bracket) {
+ depth += 1;
}
+ valueIndex += 1;
}
+ do {
+ token = iterator.stepForward();
+ } while (token && !typeRe.test(token.type));
+ if (token == null)
+ break;
+ valueIndex = 0;
}
- return range;
- };
- EditSession.prototype.replace = function (range, text) {
- return this.doc.replace(range, text);
+ return null;
};
- EditSession.prototype.moveText = function (fromRange, toPosition, copy) {
- var text = this.getTextRange(fromRange);
- var folds = this.getFoldsInRange(fromRange);
- var toRange = Range.fromPoints(toPosition, toPosition);
- if (!copy) {
- this.remove(fromRange);
- var rowDiff = fromRange.start.row - fromRange.end.row;
- var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;
- if (collDiff) {
- if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)
- toRange.start.column += collDiff;
- if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)
- toRange.end.column += collDiff;
- }
- if (rowDiff && toRange.start.row >= fromRange.end.row) {
- toRange.start.row += rowDiff;
- toRange.end.row += rowDiff;
- }
+ this.getMatchingTags = function (pos) {
+ var iterator = new TokenIterator(this, pos.row, pos.column);
+ var token = this.$findTagName(iterator);
+ if (!token)
+ return;
+ var prevToken = iterator.stepBackward();
+ if (prevToken.value === '<') {
+ return this.$findClosingTag(iterator, token);
}
- toRange.end = this.insert(toRange.start, text);
- if (folds.length) {
- var oldStart = fromRange.start;
- var newStart = toRange.start;
- var rowDiff = newStart.row - oldStart.row;
- var collDiff = newStart.column - oldStart.column;
- this.addFolds(folds.map(function (x) {
- x = x.clone();
- if (x.start.row == oldStart.row)
- x.start.column += collDiff;
- if (x.end.row == oldStart.row)
- x.end.column += collDiff;
- x.start.row += rowDiff;
- x.end.row += rowDiff;
- return x;
- }));
+ else {
+ return this.$findOpeningTag(iterator, token);
}
- return toRange;
};
- EditSession.prototype.indentRows = function (startRow, endRow, indentString) {
- indentString = indentString.replace(/\t/g, this.getTabString());
- for (var row = startRow; row <= endRow; row++)
- this.doc.insertInLine({ row: row, column: 0 }, indentString);
+ this.$findTagName = function (iterator) {
+ var token = iterator.getCurrentToken();
+ var found = false;
+ var backward = false;
+ if (token && token.type.indexOf('tag-name') === -1) {
+ do {
+ if (backward)
+ token = iterator.stepBackward();
+ else
+ token = iterator.stepForward();
+ if (token) {
+ if (token.value === "/>") {
+ backward = true;
+ }
+ else if (token.type.indexOf('tag-name') !== -1) {
+ found = true;
+ }
+ }
+ } while (token && !found);
+ }
+ return token;
};
- EditSession.prototype.outdentRows = function (range) {
- var rowRange = range.collapseRows();
- var deleteRange = new Range(0, 0, 0, 0);
- var size = this.getTabSize();
- for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {
- var line = this.getLine(i);
- deleteRange.start.row = i;
- deleteRange.end.row = i;
- for (var j = 0; j < size; ++j)
- if (line.charAt(j) != ' ')
- break;
- if (j < size && line.charAt(j) == '\t') {
- deleteRange.start.column = j;
- deleteRange.end.column = j + 1;
+ this.$findClosingTag = function (iterator, token) {
+ var prevToken;
+ var currentTag = token.value;
+ var tag = token.value;
+ var depth = 0;
+ var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
+ token = iterator.stepForward();
+ var openTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
+ var foundOpenTagEnd = false;
+ do {
+ prevToken = token;
+ if (prevToken.type.indexOf('tag-close') !== -1 && !foundOpenTagEnd) {
+ var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`
+ foundOpenTagEnd = true;
}
- else {
- deleteRange.start.column = 0;
- deleteRange.end.column = j;
+ token = iterator.stepForward();
+ if (token) {
+ if (token.value === '>' && !foundOpenTagEnd) {
+ var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for `>`
+ foundOpenTagEnd = true;
+ }
+ if (token.type.indexOf('tag-name') !== -1) {
+ currentTag = token.value;
+ if (tag === currentTag) {
+ if (prevToken.value === '<') {
+ depth++;
+ }
+ else if (prevToken.value === '') {
+ depth--;
+ if (depth < 0) { //found closing tag
+ iterator.stepBackward();
+ var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2); //Range for
+ token = iterator.stepForward();
+ var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
+ if (token.type.indexOf('tag-close') === -1) {
+ token = iterator.stepForward();
+ }
+ if (token && token.value === '>') {
+ var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
+ }
+ else {
+ return;
+ }
+ }
+ }
+ }
+ }
+ else if (tag === currentTag && token.value === '/>') { // self-closing tag
+ depth--;
+ if (depth < 0) { //found self-closing tag end
+ var closeTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);
+ var closeTagName = closeTagStart;
+ var closeTagEnd = closeTagName;
+ var openTagEnd = new Range(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);
+ }
+ }
}
- this.remove(deleteRange);
+ } while (token && depth >= 0);
+ if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
+ return {
+ openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
+ closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
+ openTagName: openTagName,
+ closeTagName: closeTagName
+ };
}
};
- EditSession.prototype.$moveLines = function (firstRow, lastRow, dir) {
- firstRow = this.getRowFoldStart(firstRow);
- lastRow = this.getRowFoldEnd(lastRow);
- if (dir < 0) {
- var row = this.getRowFoldStart(firstRow + dir);
- if (row < 0)
- return 0;
- var diff = row - firstRow;
- }
- else if (dir > 0) {
- var row = this.getRowFoldEnd(lastRow + dir);
- if (row > this.doc.getLength() - 1)
- return 0;
- var diff = row - lastRow;
+ this.$findOpeningTag = function (iterator, token) {
+ var prevToken = iterator.getCurrentToken();
+ var tag = token.value;
+ var depth = 0;
+ var startRow = iterator.getCurrentTokenRow();
+ var startColumn = iterator.getCurrentTokenColumn();
+ var endColumn = startColumn + 2;
+ var closeTagStart = new Range(startRow, startColumn, startRow, endColumn); //Range for
+ iterator.stepForward();
+ var closeTagName = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
+ if (token.type.indexOf('tag-close') === -1) {
+ token = iterator.stepForward();
}
- else {
- firstRow = this.$clipRowToDocument(firstRow);
- lastRow = this.$clipRowToDocument(lastRow);
- var diff = lastRow - firstRow + 1;
+ if (!token || token.value !== ">")
+ return;
+ var closeTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
+ iterator.stepBackward();
+ iterator.stepBackward();
+ do {
+ token = prevToken;
+ startRow = iterator.getCurrentTokenRow();
+ startColumn = iterator.getCurrentTokenColumn();
+ endColumn = startColumn + token.value.length;
+ prevToken = iterator.stepBackward();
+ if (token) {
+ if (token.type.indexOf('tag-name') !== -1) {
+ if (tag === token.value) {
+ if (prevToken.value === '<') {
+ depth++;
+ if (depth > 0) { //found opening tag
+ var openTagName = new Range(startRow, startColumn, startRow, endColumn);
+ var openTagStart = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for <
+ do {
+ token = iterator.stepForward();
+ } while (token && token.value !== '>');
+ var openTagEnd = new Range(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1); //Range for >
+ }
+ }
+ else if (prevToken.value === '') {
+ depth--;
+ }
+ }
+ }
+ else if (token.value === '/>') { // self-closing tag
+ var stepCount = 0;
+ var tmpToken = prevToken;
+ while (tmpToken) {
+ if (tmpToken.type.indexOf('tag-name') !== -1 && tmpToken.value === tag) {
+ depth--;
+ break;
+ }
+ else if (tmpToken.value === '<') {
+ break;
+ }
+ tmpToken = iterator.stepBackward();
+ stepCount++;
+ }
+ for (var i = 0; i < stepCount; i++) {
+ iterator.stepForward();
+ }
+ }
+ }
+ } while (prevToken && depth <= 0);
+ if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
+ return {
+ openTag: new Range(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
+ closeTag: new Range(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
+ openTagName: openTagName,
+ closeTagName: closeTagName
+ };
}
- var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);
- var folds = this.getFoldsInRange(range).map(function (x) {
- x = x.clone();
- x.start.row += diff;
- x.end.row += diff;
- return x;
- });
- var lines = dir == 0
- ? this.doc.getLines(firstRow, lastRow)
- : this.doc.removeFullLines(firstRow, lastRow);
- this.doc.insertFullLines(firstRow + diff, lines);
- folds.length && this.addFolds(folds);
- return diff;
- };
- EditSession.prototype.moveLinesUp = function (firstRow, lastRow) {
- return this.$moveLines(firstRow, lastRow, -1);
};
- EditSession.prototype.moveLinesDown = function (firstRow, lastRow) {
- return this.$moveLines(firstRow, lastRow, 1);
- };
- EditSession.prototype.duplicateLines = function (firstRow, lastRow) {
- return this.$moveLines(firstRow, lastRow, 0);
- };
- EditSession.prototype.$clipRowToDocument = function (row) {
- return Math.max(0, Math.min(row, this.doc.getLength() - 1));
- };
- EditSession.prototype.$clipColumnToRow = function (row, column) {
- if (column < 0)
- return 0;
- return Math.min(this.doc.getLine(row).length, column);
- };
- EditSession.prototype.$clipPositionToDocument = function (row, column) {
- column = Math.max(0, column);
- if (row < 0) {
- row = 0;
- column = 0;
- }
- else {
- var len = this.doc.getLength();
- if (row >= len) {
- row = len - 1;
- column = this.doc.getLine(len - 1).length;
+}
+exports.BracketMatch = BracketMatch;
+
+});
+
+ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"], function(require, exports, module){"use strict";
+var oop = require("./lib/oop");
+var lang = require("./lib/lang");
+var BidiHandler = require("./bidihandler").BidiHandler;
+var config = require("./config");
+var EventEmitter = require("./lib/event_emitter").EventEmitter;
+var Selection = require("./selection").Selection;
+var TextMode = require("./mode/text").Mode;
+var Range = require("./range").Range;
+var LineWidgets = require("./line_widgets").LineWidgets;
+var Document = require("./document").Document;
+var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer;
+var SearchHighlight = require("./search_highlight").SearchHighlight;
+var UndoManager = require("./undomanager").UndoManager;
+var EditSession = /** @class */ (function () {
+ function EditSession(text, mode) { this.doc;
+ this.$breakpoints = [];
+ this.$decorations = [];
+ this.$frontMarkers = {};
+ this.$backMarkers = {};
+ this.$markerId = 1;
+ this.$undoSelect = true;
+ this.$editor = null;
+ this.prevOp = {};
+ this.$foldData = [];
+ this.id = "session" + (++EditSession.$uid);
+ this.$foldData.toString = function () {
+ return this.join("\n");
+ };
+ this.bgTokenizer = new BackgroundTokenizer((new TextMode()).getTokenizer(), this);
+ var _self = this;
+ this.bgTokenizer.on("update", function (e) {
+ _self._signal("tokenizerUpdate", e);
+ });
+ this.on("changeFold", this.onChangeFold.bind(this));
+ this.$onChange = this.onChange.bind(this);
+ if (typeof text != "object" || !text.getLine)
+ text = new Document(/**@type{string}*/ (text));
+ this.setDocument(text);
+ this.selection = new Selection(this);
+ this.$onSelectionChange = this.onSelectionChange.bind(this);
+ this.selection.on("changeSelection", this.$onSelectionChange);
+ this.selection.on("changeCursor", this.$onSelectionChange);
+ this.$bidiHandler = new BidiHandler(this);
+ config.resetOptions(this);
+ this.setMode(mode);
+ config._signal("session", this);
+ this.destroyed = false;
+ this.$initOperationListeners();
+ }
+ EditSession.prototype.$initOperationListeners = function () {
+ var _this = this;
+ this.curOp = null;
+ this.on("change", function () {
+ if (!_this.curOp) {
+ _this.startOperation();
+ _this.curOp.selectionBefore = _this.$lastSel;
}
- else {
- column = Math.min(this.doc.getLine(row).length, column);
+ _this.curOp.docChanged = true;
+ }, true);
+ this.on("changeSelection", function () {
+ if (!_this.curOp) {
+ _this.startOperation();
+ _this.curOp.selectionBefore = _this.$lastSel;
}
- }
- return {
- row: row,
- column: column
- };
+ _this.curOp.selectionChanged = true;
+ }, true);
+ this.$operationResetTimer = lang.delayedCall(this.endOperation.bind(this, true));
};
- EditSession.prototype.$clipRangeToDocument = function (range) {
- if (range.start.row < 0) {
- range.start.row = 0;
- range.start.column = 0;
- }
- else {
- range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);
- }
- var len = this.doc.getLength() - 1;
- if (range.end.row > len) {
- range.end.row = len;
- range.end.column = this.doc.getLine(len).length;
+ EditSession.prototype.startOperation = function (commandEvent) {
+ if (this.curOp) {
+ if (!commandEvent || this.curOp.command) {
+ return;
+ }
+ this.prevOp = this.curOp;
}
- else {
- range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);
+ if (!commandEvent) {
+ commandEvent = {};
}
- return range;
+ this.$operationResetTimer.schedule();
+ this.curOp = {
+ command: commandEvent.command || {},
+ args: commandEvent.args
+ };
+ this.curOp.selectionBefore = this.selection.toJSON();
+ this._signal("startOperation", commandEvent);
};
- EditSession.prototype.setUseWrapMode = function (useWrapMode) {
- if (useWrapMode != this.$useWrapMode) {
- this.$useWrapMode = useWrapMode;
- this.$modified = true;
- this.$resetRowCache(0);
- if (useWrapMode) {
- var len = this.getLength();
- this.$wrapData = Array(len);
- this.$updateWrapData(0, len - 1);
+ EditSession.prototype.endOperation = function (e) {
+ if (this.curOp) {
+ if (e && e.returnValue === false) {
+ this.curOp = null;
+ this._signal("endOperation", e);
+ return;
}
- this._signal("changeWrapMode");
+ if (e == true && this.curOp.command && this.curOp.command.name == "mouse") {
+ return;
+ }
+ var currentSelection = this.selection.toJSON();
+ this.curOp.selectionAfter = currentSelection;
+ this.$lastSel = this.selection.toJSON();
+ this.getUndoManager().addSelection(currentSelection);
+ this._signal("beforeEndOperation");
+ this.prevOp = this.curOp;
+ this.curOp = null;
+ this._signal("endOperation", e);
}
};
- EditSession.prototype.getUseWrapMode = function () {
- return this.$useWrapMode;
+ EditSession.prototype.setDocument = function (doc) {
+ if (this.doc)
+ this.doc.off("change", this.$onChange);
+ this.doc = doc;
+ doc.on("change", this.$onChange, true);
+ this.bgTokenizer.setDocument(this.getDocument());
+ this.resetCaches();
};
- EditSession.prototype.setWrapLimitRange = function (min, max) {
- if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
- this.$wrapLimitRange = { min: min, max: max };
- this.$modified = true;
- this.$bidiHandler.markAsDirty();
- if (this.$useWrapMode)
- this._signal("changeWrapMode");
- }
+ EditSession.prototype.getDocument = function () {
+ return this.doc;
};
- EditSession.prototype.adjustWrapLimit = function (desiredLimit, $printMargin) {
- var limits = this.$wrapLimitRange;
- if (limits.max < 0)
- limits = { min: $printMargin, max: $printMargin };
- var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);
- if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {
- this.$wrapLimit = wrapLimit;
- this.$modified = true;
- if (this.$useWrapMode) {
- this.$updateWrapData(0, this.getLength() - 1);
- this.$resetRowCache(0);
- this._signal("changeWrapLimit");
- }
- return true;
+ Object.defineProperty(EditSession.prototype, "widgetManager", {
+ get: function () {
+ var widgetManager = new LineWidgets(this);
+ this.widgetManager = widgetManager;
+ if (this.$editor)
+ widgetManager.attach(this.$editor);
+ return widgetManager;
+ },
+ set: function (value) {
+ Object.defineProperty(this, "widgetManager", {
+ writable: true,
+ enumerable: true,
+ configurable: true,
+ value: value,
+ });
+ },
+ enumerable: false,
+ configurable: true
+ });
+ EditSession.prototype.$resetRowCache = function (docRow) {
+ if (!docRow) {
+ this.$docRowCache = [];
+ this.$screenRowCache = [];
+ return;
+ }
+ var l = this.$docRowCache.length;
+ var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
+ if (l > i) {
+ this.$docRowCache.splice(i, l);
+ this.$screenRowCache.splice(i, l);
}
- return false;
};
- EditSession.prototype.$constrainWrapLimit = function (wrapLimit, min, max) {
- if (min)
- wrapLimit = Math.max(min, wrapLimit);
- if (max)
- wrapLimit = Math.min(max, wrapLimit);
- return wrapLimit;
+ EditSession.prototype.$getRowCacheIndex = function (cacheArray, val) {
+ var low = 0;
+ var hi = cacheArray.length - 1;
+ while (low <= hi) {
+ var mid = (low + hi) >> 1;
+ var c = cacheArray[mid];
+ if (val > c)
+ low = mid + 1;
+ else if (val < c)
+ hi = mid - 1;
+ else
+ return mid;
+ }
+ return low - 1;
};
- EditSession.prototype.getWrapLimit = function () {
- return this.$wrapLimit;
+ EditSession.prototype.resetCaches = function () {
+ this.$modified = true;
+ this.$wrapData = [];
+ this.$rowLengthCache = [];
+ this.$resetRowCache(0);
+ if (!this.destroyed)
+ this.bgTokenizer.start(0);
};
- EditSession.prototype.setWrapLimit = function (limit) {
- this.setWrapLimitRange(limit, limit);
+ EditSession.prototype.onChangeFold = function (e) {
+ var fold = e.data;
+ this.$resetRowCache(fold.start.row);
};
- EditSession.prototype.getWrapLimitRange = function () {
+ EditSession.prototype.onChange = function (delta) {
+ this.$modified = true;
+ this.$bidiHandler.onChange(delta);
+ this.$resetRowCache(delta.start.row);
+ var removedFolds = this.$updateInternalDataOnChange(delta);
+ if (!this.$fromUndo && this.$undoManager) {
+ if (removedFolds && removedFolds.length) {
+ this.$undoManager.add({
+ action: "removeFolds",
+ folds: removedFolds
+ }, this.mergeUndoDeltas);
+ this.mergeUndoDeltas = true;
+ }
+ this.$undoManager.add(delta, this.mergeUndoDeltas);
+ this.mergeUndoDeltas = true;
+ this.$informUndoManager.schedule();
+ }
+ this.bgTokenizer.$updateOnChange(delta);
+ this._signal("change", delta);
+ };
+ EditSession.prototype.onSelectionChange = function () {
+ this._signal("changeSelection");
+ };
+ EditSession.prototype.setValue = function (text) {
+ this.doc.setValue(text);
+ this.selection.moveTo(0, 0);
+ this.$resetRowCache(0);
+ this.setUndoManager(this.$undoManager);
+ this.getUndoManager().reset();
+ };
+ EditSession.fromJSON = function (session) {
+ if (typeof session == "string")
+ session = JSON.parse(session);
+ var undoManager = new UndoManager();
+ undoManager.$undoStack = session.history.undo;
+ undoManager.$redoStack = session.history.redo;
+ undoManager.mark = session.history.mark;
+ undoManager.$rev = session.history.rev;
+ var editSession = new EditSession(session.value);
+ session.folds.forEach(function (fold) {
+ editSession.addFold("...", Range.fromPoints(fold.start, fold.end));
+ });
+ editSession.setAnnotations(session.annotations);
+ editSession.setBreakpoints(session.breakpoints);
+ editSession.setMode(session.mode);
+ editSession.setScrollLeft(session.scrollLeft);
+ editSession.setScrollTop(session.scrollTop);
+ editSession.setUndoManager(undoManager);
+ editSession.selection.fromJSON(session.selection);
+ return editSession;
+ };
+ EditSession.prototype.toJSON = function () {
return {
- min: this.$wrapLimitRange.min,
- max: this.$wrapLimitRange.max
+ annotations: this.$annotations,
+ breakpoints: this.$breakpoints,
+ folds: this.getAllFolds().map(function (fold) {
+ return fold.range;
+ }),
+ history: this.getUndoManager(),
+ mode: this.$mode.$id,
+ scrollLeft: this.$scrollLeft,
+ scrollTop: this.$scrollTop,
+ selection: this.selection.toJSON(),
+ value: this.doc.getValue()
};
};
- EditSession.prototype.$updateInternalDataOnChange = function (delta) {
- var useWrapMode = this.$useWrapMode;
- var action = delta.action;
- var start = delta.start;
- var end = delta.end;
- var firstRow = start.row;
- var lastRow = end.row;
- var len = lastRow - firstRow;
- var removedFolds = null;
- this.$updating = true;
- if (len != 0) {
- if (action === "remove") {
- this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
- var foldLines = this.$foldData;
- removedFolds = this.getFoldsInRange(delta);
- this.removeFolds(removedFolds);
- var foldLine = this.getFoldLine(end.row);
- var idx = 0;
- if (foldLine) {
- foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
- foldLine.shiftRow(-len);
- var foldLineBefore = this.getFoldLine(firstRow);
- if (foldLineBefore && foldLineBefore !== foldLine) {
- foldLineBefore.merge(foldLine);
- foldLine = foldLineBefore;
- }
- idx = foldLines.indexOf(foldLine) + 1;
- }
- for (idx; idx < foldLines.length; idx++) {
- var foldLine = foldLines[idx];
- if (foldLine.start.row >= end.row) {
- foldLine.shiftRow(-len);
- }
- }
- lastRow = firstRow;
- }
- else {
- var args = Array(len);
- args.unshift(firstRow, 0);
- var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;
- arr.splice.apply(arr, args);
- var foldLines = this.$foldData;
- var foldLine = this.getFoldLine(firstRow);
- var idx = 0;
- if (foldLine) {
- var cmp = foldLine.range.compareInside(start.row, start.column);
- if (cmp == 0) {
- foldLine = foldLine.split(start.row, start.column);
- if (foldLine) {
- foldLine.shiftRow(len);
- foldLine.addRemoveChars(lastRow, 0, end.column - start.column);
- }
- }
- else
- if (cmp == -1) {
- foldLine.addRemoveChars(firstRow, 0, end.column - start.column);
- foldLine.shiftRow(len);
- }
- idx = foldLines.indexOf(foldLine) + 1;
- }
- for (idx; idx < foldLines.length; idx++) {
- var foldLine = foldLines[idx];
- if (foldLine.start.row >= firstRow) {
- foldLine.shiftRow(len);
- }
- }
- }
+ EditSession.prototype.toString = function () {
+ return this.doc.getValue();
+ };
+ EditSession.prototype.getSelection = function () {
+ return this.selection;
+ };
+ EditSession.prototype.getState = function (row) {
+ return this.bgTokenizer.getState(row);
+ };
+ EditSession.prototype.getTokens = function (row) {
+ return this.bgTokenizer.getTokens(row);
+ };
+ EditSession.prototype.getTokenAt = function (row, column) {
+ var tokens = this.bgTokenizer.getTokens(row);
+ var token, c = 0;
+ if (column == null) {
+ var i = tokens.length - 1;
+ c = this.getLine(row).length;
}
else {
- len = Math.abs(delta.start.column - delta.end.column);
- if (action === "remove") {
- removedFolds = this.getFoldsInRange(delta);
- this.removeFolds(removedFolds);
- len = -len;
- }
- var foldLine = this.getFoldLine(firstRow);
- if (foldLine) {
- foldLine.addRemoveChars(firstRow, start.column, len);
+ for (var i = 0; i < tokens.length; i++) {
+ c += tokens[i].value.length;
+ if (c >= column)
+ break;
}
}
- if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {
- console.error("doc.getLength() and $wrapData.length have to be the same!");
+ token = tokens[i];
+ if (!token)
+ return null;
+ token.index = i;
+ token.start = c - token.value.length;
+ return token;
+ };
+ EditSession.prototype.setUndoManager = function (undoManager) {
+ this.$undoManager = undoManager;
+ if (this.$informUndoManager)
+ this.$informUndoManager.cancel();
+ if (undoManager) {
+ var self = this;
+ undoManager.addSession(this);
+ this.$syncInformUndoManager = function () {
+ self.$informUndoManager.cancel();
+ self.mergeUndoDeltas = false;
+ };
+ this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
+ }
+ else {
+ this.$syncInformUndoManager = function () { };
}
- this.$updating = false;
- if (useWrapMode)
- this.$updateWrapData(firstRow, lastRow);
- else
- this.$updateRowLengthCache(firstRow, lastRow);
- return removedFolds;
};
- EditSession.prototype.$updateRowLengthCache = function (firstRow, lastRow) {
- this.$rowLengthCache[firstRow] = null;
- this.$rowLengthCache[lastRow] = null;
+ EditSession.prototype.markUndoGroup = function () {
+ if (this.$syncInformUndoManager)
+ this.$syncInformUndoManager();
};
- EditSession.prototype.$updateWrapData = function (firstRow, lastRow) {
- var lines = this.doc.getAllLines();
- var tabSize = this.getTabSize();
- var wrapData = this.$wrapData;
- var wrapLimit = this.$wrapLimit;
- var tokens;
- var foldLine;
- var row = firstRow;
- lastRow = Math.min(lastRow, lines.length - 1);
- while (row <= lastRow) {
- foldLine = this.getFoldLine(row, foldLine);
- if (!foldLine) {
- tokens = this.$getDisplayTokens(lines[row]);
- wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
- row++;
- }
- else {
- tokens = [];
- foldLine.walk(function (placeholder, row, column, lastColumn) {
- var walkTokens;
- if (placeholder != null) {
- walkTokens = this.$getDisplayTokens(placeholder, tokens.length);
- walkTokens[0] = PLACEHOLDER_START;
- for (var i = 1; i < walkTokens.length; i++) {
- walkTokens[i] = PLACEHOLDER_BODY;
- }
- }
- else {
- walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length);
- }
- tokens = tokens.concat(walkTokens);
- }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);
- wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
- row = foldLine.end.row + 1;
- }
- }
+ EditSession.prototype.getUndoManager = function () {
+ return this.$undoManager || this.$defaultUndoManager;
};
- EditSession.prototype.$computeWrapSplits = function (tokens, wrapLimit, tabSize) {
- if (tokens.length == 0) {
- return [];
- }
- var splits = [];
- var displayLength = tokens.length;
- var lastSplit = 0, lastDocSplit = 0;
- var isCode = this.$wrapAsCode;
- var indentedSoftWrap = this.$indentedSoftWrap;
- var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)
- || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);
- function getWrapIndent() {
- var indentation = 0;
- if (maxIndent === 0)
- return indentation;
- if (indentedSoftWrap) {
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (token == SPACE)
- indentation += 1;
- else if (token == TAB)
- indentation += tabSize;
- else if (token == TAB_SPACE)
- continue;
- else
- break;
- }
- }
- if (isCode && indentedSoftWrap !== false)
- indentation += tabSize;
- return Math.min(indentation, maxIndent);
- }
- function addSplit(screenPos) {
- var len = screenPos - lastSplit;
- for (var i = lastSplit; i < screenPos; i++) {
- var ch = tokens[i];
- if (ch === 12 || ch === 2)
- len -= 1;
- }
- if (!splits.length) {
- indent = getWrapIndent();
- splits.indent = indent;
- }
- lastDocSplit += len;
- splits.push(lastDocSplit);
- lastSplit = screenPos;
+ EditSession.prototype.getTabString = function () {
+ if (this.getUseSoftTabs()) {
+ return lang.stringRepeat(" ", this.getTabSize());
}
- var indent = 0;
- while (displayLength - lastSplit > wrapLimit - indent) {
- var split = lastSplit + wrapLimit - indent;
- if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {
- addSplit(split);
- continue;
- }
- if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {
- for (split; split != lastSplit - 1; split--) {
- if (tokens[split] == PLACEHOLDER_START) {
- break;
- }
- }
- if (split > lastSplit) {
- addSplit(split);
- continue;
- }
- split = lastSplit + wrapLimit;
- for (split; split < tokens.length; split++) {
- if (tokens[split] != PLACEHOLDER_BODY) {
- break;
- }
- }
- if (split == tokens.length) {
- break; // Breaks the while-loop.
- }
- addSplit(split);
- continue;
- }
- var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);
- while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
- split--;
- }
- if (isCode) {
- while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
- split--;
- }
- while (split > minSplit && tokens[split] == PUNCTUATION) {
- split--;
- }
- }
- else {
- while (split > minSplit && tokens[split] < SPACE) {
- split--;
- }
- }
- if (split > minSplit) {
- addSplit(++split);
- continue;
- }
- split = lastSplit + wrapLimit;
- if (tokens[split] == CHAR_EXT)
- split--;
- addSplit(split - indent);
+ else {
+ return "\t";
}
- return splits;
};
- EditSession.prototype.$getDisplayTokens = function (str, offset) {
- var arr = [];
- var tabSize;
- offset = offset || 0;
- for (var i = 0; i < str.length; i++) {
- var c = str.charCodeAt(i);
- if (c == 9) {
- tabSize = this.getScreenTabSize(arr.length + offset);
- arr.push(TAB);
- for (var n = 1; n < tabSize; n++) {
- arr.push(TAB_SPACE);
- }
- }
- else if (c == 32) {
- arr.push(SPACE);
- }
- else if ((c > 39 && c < 48) || (c > 57 && c < 64)) {
- arr.push(PUNCTUATION);
- }
- else if (c >= 0x1100 && isFullWidth(c)) {
- arr.push(CHAR, CHAR_EXT);
- }
- else {
- arr.push(CHAR);
- }
- }
- return arr;
+ EditSession.prototype.setUseSoftTabs = function (val) {
+ this.setOption("useSoftTabs", val);
};
- EditSession.prototype.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {
- if (maxScreenColumn == 0)
- return [0, 0];
- if (maxScreenColumn == null)
- maxScreenColumn = Infinity;
- screenColumn = screenColumn || 0;
- var c, column;
- for (column = 0; column < str.length; column++) {
- c = str.charCodeAt(column);
- if (c == 9) {
- screenColumn += this.getScreenTabSize(screenColumn);
- }
- else if (c >= 0x1100 && isFullWidth(c)) {
- screenColumn += 2;
- }
- else {
- screenColumn += 1;
- }
- if (screenColumn > maxScreenColumn) {
- break;
- }
- }
- return [screenColumn, column];
+ EditSession.prototype.getUseSoftTabs = function () {
+ return this.$useSoftTabs && !this.$mode.$indentWithTabs;
};
- EditSession.prototype.getRowLength = function (row) {
- var h = 1;
- if (this.lineWidgets)
- h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
- if (!this.$useWrapMode || !this.$wrapData[row])
- return h;
- else
- return this.$wrapData[row].length + h;
+ EditSession.prototype.setTabSize = function (tabSize) {
+ this.setOption("tabSize", tabSize);
};
- EditSession.prototype.getRowLineCount = function (row) {
- if (!this.$useWrapMode || !this.$wrapData[row]) {
- return 1;
- }
- else {
- return this.$wrapData[row].length + 1;
- }
+ EditSession.prototype.getTabSize = function () {
+ return this.$tabSize;
};
- EditSession.prototype.getRowWrapIndent = function (screenRow) {
- if (this.$useWrapMode) {
- var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
- var splits = this.$wrapData[pos.row];
- return splits.length && splits[0] < pos.column ? splits.indent : 0;
- }
- else {
- return 0;
- }
+ EditSession.prototype.isTabStop = function (position) {
+ return this.$useSoftTabs && (position.column % this.$tabSize === 0);
};
- EditSession.prototype.getScreenLastRowColumn = function (screenRow) {
- var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
- return this.documentToScreenColumn(pos.row, pos.column);
+ EditSession.prototype.setNavigateWithinSoftTabs = function (navigateWithinSoftTabs) {
+ this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs);
};
- EditSession.prototype.getDocumentLastRowColumn = function (docRow, docColumn) {
- var screenRow = this.documentToScreenRow(docRow, docColumn);
- return this.getScreenLastRowColumn(screenRow);
+ EditSession.prototype.getNavigateWithinSoftTabs = function () {
+ return this.$navigateWithinSoftTabs;
};
- EditSession.prototype.getDocumentLastRowColumnPosition = function (docRow, docColumn) {
- var screenRow = this.documentToScreenRow(docRow, docColumn);
- return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
+ EditSession.prototype.setOverwrite = function (overwrite) {
+ this.setOption("overwrite", overwrite);
};
- EditSession.prototype.getRowSplitData = function (row) {
- if (!this.$useWrapMode) {
- return undefined;
- }
- else {
- return this.$wrapData[row];
- }
+ EditSession.prototype.getOverwrite = function () {
+ return this.$overwrite;
};
- EditSession.prototype.getScreenTabSize = function (screenColumn) {
- return this.$tabSize - (screenColumn % this.$tabSize | 0);
+ EditSession.prototype.toggleOverwrite = function () {
+ this.setOverwrite(!this.$overwrite);
};
- EditSession.prototype.screenToDocumentRow = function (screenRow, screenColumn) {
- return this.screenToDocumentPosition(screenRow, screenColumn).row;
+ EditSession.prototype.addGutterDecoration = function (row, className) {
+ if (!this.$decorations[row])
+ this.$decorations[row] = "";
+ this.$decorations[row] += " " + className;
+ this._signal("changeBreakpoint", {});
};
- EditSession.prototype.screenToDocumentColumn = function (screenRow, screenColumn) {
- return this.screenToDocumentPosition(screenRow, screenColumn).column;
+ EditSession.prototype.removeGutterDecoration = function (row, className) {
+ this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
+ this._signal("changeBreakpoint", {});
};
- EditSession.prototype.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) {
- if (screenRow < 0)
- return { row: 0, column: 0 };
- var line;
- var docRow = 0;
- var docColumn = 0;
- var column;
- var row = 0;
- var rowLength = 0;
- var rowCache = this.$screenRowCache;
- var i = this.$getRowCacheIndex(rowCache, screenRow);
- var l = rowCache.length;
- if (l && i >= 0) {
- var row = rowCache[i];
- var docRow = this.$docRowCache[i];
- var doCache = screenRow > rowCache[l - 1];
- }
- else {
- var doCache = !l;
+ EditSession.prototype.getBreakpoints = function () {
+ return this.$breakpoints;
+ };
+ EditSession.prototype.setBreakpoints = function (rows) {
+ this.$breakpoints = [];
+ for (var i = 0; i < rows.length; i++) {
+ this.$breakpoints[rows[i]] = "ace_breakpoint";
}
- var maxRow = this.getLength() - 1;
- var foldLine = this.getNextFoldLine(docRow);
- var foldStart = foldLine ? foldLine.start.row : Infinity;
- while (row <= screenRow) {
- rowLength = this.getRowLength(docRow);
- if (row + rowLength > screenRow || docRow >= maxRow) {
- break;
- }
- else {
- row += rowLength;
- docRow++;
- if (docRow > foldStart) {
- docRow = foldLine.end.row + 1;
- foldLine = this.getNextFoldLine(docRow, foldLine);
- foldStart = foldLine ? foldLine.start.row : Infinity;
- }
- }
- if (doCache) {
- this.$docRowCache.push(docRow);
- this.$screenRowCache.push(row);
- }
+ this._signal("changeBreakpoint", {});
+ };
+ EditSession.prototype.clearBreakpoints = function () {
+ this.$breakpoints = [];
+ this._signal("changeBreakpoint", {});
+ };
+ EditSession.prototype.setBreakpoint = function (row, className) {
+ if (className === undefined)
+ className = "ace_breakpoint";
+ if (className)
+ this.$breakpoints[row] = className;
+ else
+ delete this.$breakpoints[row];
+ this._signal("changeBreakpoint", {});
+ };
+ EditSession.prototype.clearBreakpoint = function (row) {
+ delete this.$breakpoints[row];
+ this._signal("changeBreakpoint", {});
+ };
+ EditSession.prototype.addMarker = function (range, clazz, type, inFront) {
+ var id = this.$markerId++;
+ var marker = {
+ range: range,
+ type: type || "line",
+ renderer: typeof type == "function" ? type : null,
+ clazz: clazz,
+ inFront: !!inFront,
+ id: id
+ };
+ if (inFront) {
+ this.$frontMarkers[id] = marker;
+ this._signal("changeFrontMarker");
}
- if (foldLine && foldLine.start.row <= docRow) {
- line = this.getFoldDisplayLine(foldLine);
- docRow = foldLine.start.row;
+ else {
+ this.$backMarkers[id] = marker;
+ this._signal("changeBackMarker");
}
- else if (row + rowLength <= screenRow || docRow > maxRow) {
- return {
- row: maxRow,
- column: this.getLine(maxRow).length
- };
+ return id;
+ };
+ EditSession.prototype.addDynamicMarker = function (marker, inFront) {
+ if (!marker.update)
+ return;
+ var id = this.$markerId++;
+ marker.id = id;
+ marker.inFront = !!inFront;
+ if (inFront) {
+ this.$frontMarkers[id] = marker;
+ this._signal("changeFrontMarker");
}
else {
- line = this.getLine(docRow);
- foldLine = null;
+ this.$backMarkers[id] = marker;
+ this._signal("changeBackMarker");
}
- var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);
- if (this.$useWrapMode) {
- var splits = this.$wrapData[docRow];
- if (splits) {
- column = splits[splitIndex];
- if (splitIndex > 0 && splits.length) {
- wrapIndent = splits.indent;
- docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
- line = line.substring(docColumn);
- }
- }
+ return marker;
+ };
+ EditSession.prototype.removeMarker = function (markerId) {
+ var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
+ if (!marker)
+ return;
+ var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
+ delete (markers[markerId]);
+ this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
+ };
+ EditSession.prototype.getMarkers = function (inFront) {
+ return inFront ? this.$frontMarkers : this.$backMarkers;
+ };
+ EditSession.prototype.highlight = function (re) {
+ if (!this.$searchHighlight) {
+ var highlight = new SearchHighlight(null, "ace_selected-word", "text");
+ this.$searchHighlight = this.addDynamicMarker(highlight);
}
- if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))
- screenColumn = this.$bidiHandler.offsetToCol(offsetX);
- docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];
- if (this.$useWrapMode && docColumn >= column)
- docColumn = column - 1;
- if (foldLine)
- return foldLine.idxToPosition(docColumn);
- return { row: docRow, column: docColumn };
+ this.$searchHighlight.setRegexp(re);
};
- EditSession.prototype.documentToScreenPosition = function (docRow, docColumn) {
- if (typeof docColumn === "undefined")
- var pos = this.$clipPositionToDocument(/**@type{Point}*/ (docRow).row, /**@type{Point}*/ (docRow).column);
- else
- pos = this.$clipPositionToDocument(/**@type{number}*/ (docRow), docColumn);
- docRow = pos.row;
- docColumn = pos.column;
- var screenRow = 0;
- var foldStartRow = null;
- var fold = null;
- fold = this.getFoldAt(docRow, docColumn, 1);
- if (fold) {
- docRow = fold.start.row;
- docColumn = fold.start.column;
+ EditSession.prototype.highlightLines = function (startRow, endRow, clazz, inFront) {
+ if (typeof endRow != "number") {
+ clazz = endRow;
+ endRow = startRow;
}
- var rowEnd, row = 0;
- var rowCache = this.$docRowCache;
- var i = this.$getRowCacheIndex(rowCache, docRow);
- var l = rowCache.length;
- if (l && i >= 0) {
- var row = rowCache[i];
- var screenRow = this.$screenRowCache[i];
- var doCache = docRow > rowCache[l - 1];
+ if (!clazz)
+ clazz = "ace_step";
+ var range = new Range(startRow, 0, endRow, Infinity);
+ range.id = this.addMarker(range, clazz, "fullLine", inFront);
+ return range;
+ };
+ EditSession.prototype.setAnnotations = function (annotations) {
+ this.$annotations = annotations;
+ this._signal("changeAnnotation", {});
+ };
+ EditSession.prototype.getAnnotations = function () {
+ return this.$annotations || [];
+ };
+ EditSession.prototype.clearAnnotations = function () {
+ this.setAnnotations([]);
+ };
+ EditSession.prototype.$detectNewLine = function (text) {
+ var match = text.match(/^.*?(\r?\n)/m);
+ if (match) {
+ this.$autoNewLine = match[1];
}
else {
- var doCache = !l;
+ this.$autoNewLine = "\n";
}
- var foldLine = this.getNextFoldLine(row);
- var foldStart = foldLine ? foldLine.start.row : Infinity;
- while (row < docRow) {
- if (row >= foldStart) {
- rowEnd = foldLine.end.row + 1;
- if (rowEnd > docRow)
- break;
- foldLine = this.getNextFoldLine(rowEnd, foldLine);
- foldStart = foldLine ? foldLine.start.row : Infinity;
- }
- else {
- rowEnd = row + 1;
- }
- screenRow += this.getRowLength(row);
- row = rowEnd;
- if (doCache) {
- this.$docRowCache.push(row);
- this.$screenRowCache.push(screenRow);
- }
+ };
+ EditSession.prototype.getWordRange = function (row, column) {
+ var line = this.getLine(row);
+ var inToken = false;
+ if (column > 0)
+ inToken = !!line.charAt(column - 1).match(this.tokenRe);
+ if (!inToken)
+ inToken = !!line.charAt(column).match(this.tokenRe);
+ if (inToken)
+ var re = this.tokenRe;
+ else if (/^\s+$/.test(line.slice(column - 1, column + 1)))
+ var re = /\s/;
+ else
+ var re = this.nonTokenRe;
+ var start = column;
+ if (start > 0) {
+ do {
+ start--;
+ } while (start >= 0 && line.charAt(start).match(re));
+ start++;
}
- var textLine = "";
- if (foldLine && row >= foldStart) {
- textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);
- foldStartRow = foldLine.start.row;
+ var end = column;
+ while (end < line.length && line.charAt(end).match(re)) {
+ end++;
}
- else {
- textLine = this.getLine(docRow).substring(0, docColumn);
- foldStartRow = docRow;
+ return new Range(row, start, row, end);
+ };
+ EditSession.prototype.getAWordRange = function (row, column) {
+ var wordRange = this.getWordRange(row, column);
+ var line = this.getLine(wordRange.end.row);
+ while (line.charAt(wordRange.end.column).match(/[ \t]/)) {
+ wordRange.end.column += 1;
}
- var wrapIndent = 0;
- if (this.$useWrapMode) {
- var wrapRow = this.$wrapData[foldStartRow];
- if (wrapRow) {
- var screenRowOffset = 0;
- while (textLine.length >= wrapRow[screenRowOffset]) {
- screenRow++;
- screenRowOffset++;
- }
- textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);
- wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
- }
- }
- if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)
- screenRow += this.lineWidgets[row].rowsAbove;
- return {
- row: screenRow,
- column: wrapIndent + this.$getStringScreenWidth(textLine)[0]
- };
+ return wordRange;
};
- EditSession.prototype.documentToScreenColumn = function (row, docColumn) {
- return this.documentToScreenPosition(row, docColumn).column;
+ EditSession.prototype.setNewLineMode = function (newLineMode) {
+ this.doc.setNewLineMode(newLineMode);
};
- EditSession.prototype.documentToScreenRow = function (docRow, docColumn) {
- return this.documentToScreenPosition(docRow, docColumn).row;
+ EditSession.prototype.getNewLineMode = function () {
+ return this.doc.getNewLineMode();
};
- EditSession.prototype.getScreenLength = function () {
- var screenRows = 0;
- var fold = null;
- if (!this.$useWrapMode) {
- screenRows = this.getLength();
- var foldData = this.$foldData;
- for (var i = 0; i < foldData.length; i++) {
- fold = foldData[i];
- screenRows -= fold.end.row - fold.start.row;
- }
+ EditSession.prototype.setUseWorker = function (useWorker) { this.setOption("useWorker", useWorker); };
+ EditSession.prototype.getUseWorker = function () { return this.$useWorker; };
+ EditSession.prototype.onReloadTokenizer = function (e) {
+ var rows = e.data;
+ this.bgTokenizer.start(rows.first);
+ this._signal("tokenizerUpdate", e);
+ };
+ EditSession.prototype.setMode = function (mode, cb) {
+ if (mode && typeof mode === "object") {
+ if (mode.getTokenizer)
+ return this.$onChangeMode(mode);
+ var options = mode;
+ var path = options.path;
}
else {
- var lastRow = this.$wrapData.length;
- var row = 0, i = 0;
- var fold = this.$foldData[i++];
- var foldStart = fold ? fold.start.row : Infinity;
- while (row < lastRow) {
- var splits = this.$wrapData[row];
- screenRows += splits ? splits.length + 1 : 1;
- row++;
- if (row > foldStart) {
- row = fold.end.row + 1;
- fold = this.$foldData[i++];
- foldStart = fold ? fold.start.row : Infinity;
+ path = /**@type{string}*/ (mode) || "ace/mode/text";
+ }
+ if (!this.$modes["ace/mode/text"])
+ this.$modes["ace/mode/text"] = new TextMode();
+ if (this.$modes[path] && !options) {
+ this.$onChangeMode(this.$modes[path]);
+ cb && cb();
+ return;
+ }
+ this.$modeId = path;
+ config.loadModule(["mode", path], function (m) {
+ if (this.destroyed) {
+ return;
+ }
+ if (this.$modeId !== path)
+ return cb && cb();
+ if (this.$modes[path] && !options) {
+ this.$onChangeMode(this.$modes[path]);
+ }
+ else if (m && m.Mode) {
+ m = new m.Mode(options);
+ if (!options) {
+ this.$modes[path] = m;
+ m.$id = path;
}
+ this.$onChangeMode(m);
}
+ cb && cb();
+ }.bind(this));
+ if (!this.$mode)
+ this.$onChangeMode(this.$modes["ace/mode/text"], true);
+ };
+ EditSession.prototype.$onChangeMode = function (mode, $isPlaceholder) {
+ if (!$isPlaceholder)
+ this.$modeId = mode.$id;
+ if (this.$mode === mode)
+ return;
+ var oldMode = this.$mode;
+ this.$mode = mode;
+ this.$stopWorker();
+ if (this.$useWorker)
+ this.$startWorker();
+ var tokenizer = mode.getTokenizer();
+ if (tokenizer.on !== undefined) {
+ var onReloadTokenizer = this.onReloadTokenizer.bind(this);
+ tokenizer.on("update", onReloadTokenizer);
+ }
+ this.bgTokenizer.setTokenizer(tokenizer);
+ this.bgTokenizer.setDocument(this.getDocument());
+ this.tokenRe = mode.tokenRe;
+ this.nonTokenRe = mode.nonTokenRe;
+ if (!$isPlaceholder) {
+ if (mode.attachToSession)
+ mode.attachToSession(this);
+ this.$options.wrapMethod.set.call(this, this.$wrapMethod);
+ this.$setFolding(mode.foldingRules);
+ this.bgTokenizer.start(0);
+ this._emit("changeMode", { oldMode: oldMode, mode: mode });
}
- if (this.lineWidgets)
- screenRows += this.$getWidgetScreenLength();
- return screenRows;
};
- EditSession.prototype.$setFontMetrics = function (fm) {
- if (!this.$enableVarChar)
+ EditSession.prototype.$stopWorker = function () {
+ if (this.$worker) {
+ this.$worker.terminate();
+ this.$worker = null;
+ }
+ };
+ EditSession.prototype.$startWorker = function () {
+ try {
+ this.$worker = this.$mode.createWorker(this);
+ }
+ catch (e) {
+ config.warn("Could not load worker", e);
+ this.$worker = null;
+ }
+ };
+ EditSession.prototype.getMode = function () {
+ return this.$mode;
+ };
+ EditSession.prototype.setScrollTop = function (scrollTop) {
+ if (this.$scrollTop === scrollTop || isNaN(scrollTop))
return;
- this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {
- if (maxScreenColumn === 0)
- return [0, 0];
- if (!maxScreenColumn)
- maxScreenColumn = Infinity;
- screenColumn = screenColumn || 0;
- var c, column;
- for (column = 0; column < str.length; column++) {
- c = str.charAt(column);
- if (c === "\t") {
- screenColumn += this.getScreenTabSize(screenColumn);
- }
- else {
- screenColumn += fm.getCharacterWidth(c);
- }
- if (screenColumn > maxScreenColumn) {
- break;
+ this.$scrollTop = scrollTop;
+ this._signal("changeScrollTop", scrollTop);
+ };
+ EditSession.prototype.getScrollTop = function () {
+ return this.$scrollTop;
+ };
+ EditSession.prototype.setScrollLeft = function (scrollLeft) {
+ if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))
+ return;
+ this.$scrollLeft = scrollLeft;
+ this._signal("changeScrollLeft", scrollLeft);
+ };
+ EditSession.prototype.getScrollLeft = function () {
+ return this.$scrollLeft;
+ };
+ EditSession.prototype.getScreenWidth = function () {
+ this.$computeWidth();
+ if (this.lineWidgets)
+ return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);
+ return this.screenWidth;
+ };
+ EditSession.prototype.getLineWidgetMaxWidth = function () {
+ if (this.lineWidgetsWidth != null)
+ return this.lineWidgetsWidth;
+ var width = 0;
+ this.lineWidgets.forEach(function (w) {
+ if (w && w.screenWidth > width)
+ width = w.screenWidth;
+ });
+ return this.lineWidgetWidth = width;
+ };
+ EditSession.prototype.$computeWidth = function (force) {
+ if (this.$modified || force) {
+ this.$modified = false;
+ if (this.$useWrapMode)
+ return this.screenWidth = this.$wrapLimit;
+ var lines = this.doc.getAllLines();
+ var cache = this.$rowLengthCache;
+ var longestScreenLine = 0;
+ var foldIndex = 0;
+ var foldLine = this.$foldData[foldIndex];
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+ var len = lines.length;
+ for (var i = 0; i < len; i++) {
+ if (i > foldStart) {
+ i = foldLine.end.row + 1;
+ if (i >= len)
+ break;
+ foldLine = this.$foldData[foldIndex++];
+ foldStart = foldLine ? foldLine.start.row : Infinity;
}
+ if (cache[i] == null)
+ cache[i] = this.$getStringScreenWidth(lines[i])[0];
+ if (cache[i] > longestScreenLine)
+ longestScreenLine = cache[i];
}
- return [screenColumn, column];
- };
- };
- EditSession.prototype.destroy = function () {
- if (!this.destroyed) {
- this.bgTokenizer.setDocument(null);
- this.bgTokenizer.cleanup();
- this.destroyed = true;
- }
- this.$stopWorker();
- this.removeAllListeners();
- if (this.doc) {
- this.doc.off("change", this.$onChange);
+ this.screenWidth = longestScreenLine;
}
- this.selection.detach();
};
- return EditSession;
-}());
-EditSession.$uid = 0;
-EditSession.prototype.$modes = config.$modes;
-EditSession.prototype.getValue = EditSession.prototype.toString;
-EditSession.prototype.$defaultUndoManager = {
- undo: function () { },
- redo: function () { },
- hasUndo: function () { },
- hasRedo: function () { },
- reset: function () { },
- add: function () { },
- addSelection: function () { },
- startNewGroup: function () { },
- addSession: function () { }
-};
-EditSession.prototype.$overwrite = false;
-EditSession.prototype.$mode = null;
-EditSession.prototype.$modeId = null;
-EditSession.prototype.$scrollTop = 0;
-EditSession.prototype.$scrollLeft = 0;
-EditSession.prototype.$wrapLimit = 80;
-EditSession.prototype.$useWrapMode = false;
-EditSession.prototype.$wrapLimitRange = {
- min: null,
- max: null
-};
-EditSession.prototype.lineWidgets = null;
-EditSession.prototype.isFullWidth = isFullWidth;
-oop.implement(EditSession.prototype, EventEmitter);
-var CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;
-function isFullWidth(c) {
- if (c < 0x1100)
- return false;
- return c >= 0x1100 && c <= 0x115F ||
- c >= 0x11A3 && c <= 0x11A7 ||
- c >= 0x11FA && c <= 0x11FF ||
- c >= 0x2329 && c <= 0x232A ||
- c >= 0x2E80 && c <= 0x2E99 ||
- c >= 0x2E9B && c <= 0x2EF3 ||
- c >= 0x2F00 && c <= 0x2FD5 ||
- c >= 0x2FF0 && c <= 0x2FFB ||
- c >= 0x3000 && c <= 0x303E ||
- c >= 0x3041 && c <= 0x3096 ||
- c >= 0x3099 && c <= 0x30FF ||
- c >= 0x3105 && c <= 0x312D ||
- c >= 0x3131 && c <= 0x318E ||
- c >= 0x3190 && c <= 0x31BA ||
- c >= 0x31C0 && c <= 0x31E3 ||
- c >= 0x31F0 && c <= 0x321E ||
- c >= 0x3220 && c <= 0x3247 ||
- c >= 0x3250 && c <= 0x32FE ||
- c >= 0x3300 && c <= 0x4DBF ||
- c >= 0x4E00 && c <= 0xA48C ||
- c >= 0xA490 && c <= 0xA4C6 ||
- c >= 0xA960 && c <= 0xA97C ||
- c >= 0xAC00 && c <= 0xD7A3 ||
- c >= 0xD7B0 && c <= 0xD7C6 ||
- c >= 0xD7CB && c <= 0xD7FB ||
- c >= 0xF900 && c <= 0xFAFF ||
- c >= 0xFE10 && c <= 0xFE19 ||
- c >= 0xFE30 && c <= 0xFE52 ||
- c >= 0xFE54 && c <= 0xFE66 ||
- c >= 0xFE68 && c <= 0xFE6B ||
- c >= 0xFF01 && c <= 0xFF60 ||
- c >= 0xFFE0 && c <= 0xFFE6;
-}
-require("./edit_session/folding").Folding.call(EditSession.prototype);
-require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
-config.defineOptions(EditSession.prototype, "session", {
- wrap: {
- set: function (value) {
- if (!value || value == "off")
- value = false;
- else if (value == "free")
- value = true;
- else if (value == "printMargin")
- value = -1;
- else if (typeof value == "string")
- value = parseInt(value, 10) || false;
- if (this.$wrap == value)
- return;
- this.$wrap = value;
- if (!value) {
- this.setUseWrapMode(false);
+ EditSession.prototype.getLine = function (row) {
+ return this.doc.getLine(row);
+ };
+ EditSession.prototype.getLines = function (firstRow, lastRow) {
+ return this.doc.getLines(firstRow, lastRow);
+ };
+ EditSession.prototype.getLength = function () {
+ return this.doc.getLength();
+ };
+ EditSession.prototype.getTextRange = function (range) {
+ return this.doc.getTextRange(range || this.selection.getRange());
+ };
+ EditSession.prototype.insert = function (position, text) {
+ return this.doc.insert(position, text);
+ };
+ EditSession.prototype.remove = function (range) {
+ return this.doc.remove(range);
+ };
+ EditSession.prototype.removeFullLines = function (firstRow, lastRow) {
+ return this.doc.removeFullLines(firstRow, lastRow);
+ };
+ EditSession.prototype.undoChanges = function (deltas, dontSelect) {
+ if (!deltas.length)
+ return;
+ this.$fromUndo = true;
+ for (var i = deltas.length - 1; i != -1; i--) {
+ var delta = deltas[i];
+ if (delta.action == "insert" || delta.action == "remove") {
+ this.doc.revertDelta(delta);
}
- else {
- var col = typeof value == "number" ? value : null;
- this.setWrapLimitRange(col, col);
- this.setUseWrapMode(true);
+ else if (delta.folds) {
+ this.addFolds(delta.folds);
}
- },
- get: function () {
- if (this.getUseWrapMode()) {
- if (this.$wrap == -1)
- return "printMargin";
- if (!this.getWrapLimitRange().min)
- return "free";
- return this.$wrap;
+ }
+ if (!dontSelect && this.$undoSelect) {
+ if (deltas.selectionBefore)
+ this.selection.fromJSON(deltas.selectionBefore);
+ else
+ this.selection.setRange(this.$getUndoSelection(deltas, true));
+ }
+ this.$fromUndo = false;
+ };
+ EditSession.prototype.redoChanges = function (deltas, dontSelect) {
+ if (!deltas.length)
+ return;
+ this.$fromUndo = true;
+ for (var i = 0; i < deltas.length; i++) {
+ var delta = deltas[i];
+ if (delta.action == "insert" || delta.action == "remove") {
+ this.doc.$safeApplyDelta(delta);
}
- return "off";
- },
- handlesSet: true
- },
- wrapMethod: {
- set: function (val) {
- val = val == "auto"
- ? this.$mode.type != "text"
- : val != "text";
- if (val != this.$wrapAsCode) {
- this.$wrapAsCode = val;
- if (this.$useWrapMode) {
- this.$useWrapMode = false;
- this.setUseWrapMode(true);
+ }
+ if (!dontSelect && this.$undoSelect) {
+ if (deltas.selectionAfter)
+ this.selection.fromJSON(deltas.selectionAfter);
+ else
+ this.selection.setRange(this.$getUndoSelection(deltas, false));
+ }
+ this.$fromUndo = false;
+ };
+ EditSession.prototype.setUndoSelect = function (enable) {
+ this.$undoSelect = enable;
+ };
+ EditSession.prototype.$getUndoSelection = function (deltas, isUndo) {
+ function isInsert(delta) {
+ return isUndo ? delta.action !== "insert" : delta.action === "insert";
+ }
+ var range, point;
+ for (var i = 0; i < deltas.length; i++) {
+ var delta = deltas[i];
+ if (!delta.start)
+ continue; // skip folds
+ if (!range) {
+ if (isInsert(delta)) {
+ range = Range.fromPoints(delta.start, delta.end);
}
+ else {
+ range = Range.fromPoints(delta.start, delta.start);
+ }
+ continue;
}
- },
- initialValue: "auto"
- },
- indentedSoftWrap: {
- set: function () {
- if (this.$useWrapMode) {
- this.$useWrapMode = false;
- this.setUseWrapMode(true);
+ if (isInsert(delta)) {
+ point = delta.start;
+ if (range.compare(point.row, point.column) == -1) {
+ range.setStart(point);
+ }
+ point = delta.end;
+ if (range.compare(point.row, point.column) == 1) {
+ range.setEnd(point);
+ }
}
- },
- initialValue: true
- },
- firstLineNumber: {
- set: function () { this._signal("changeBreakpoint"); },
- initialValue: 1
- },
- useWorker: {
- set: function (useWorker) {
- this.$useWorker = useWorker;
- this.$stopWorker();
- if (useWorker)
- this.$startWorker();
- },
- initialValue: true
- },
- useSoftTabs: { initialValue: true },
- tabSize: {
- set: function (tabSize) {
- tabSize = parseInt(tabSize);
- if (tabSize > 0 && this.$tabSize !== tabSize) {
- this.$modified = true;
- this.$rowLengthCache = [];
- this.$tabSize = tabSize;
- this._signal("changeTabSize");
+ else {
+ point = delta.start;
+ if (range.compare(point.row, point.column) == -1) {
+ range = Range.fromPoints(delta.start, delta.start);
+ }
}
- },
- initialValue: 4,
- handlesSet: true
- },
- navigateWithinSoftTabs: { initialValue: false },
- foldStyle: {
- set: function (val) { this.setFoldStyle(val); },
- handlesSet: true
- },
- overwrite: {
- set: function (val) { this._signal("changeOverwrite"); },
- initialValue: false
- },
- newLineMode: {
- set: function (val) { this.doc.setNewLineMode(val); },
- get: function () { return this.doc.getNewLineMode(); },
- handlesSet: true
- },
- mode: {
- set: function (val) { this.setMode(val); },
- get: function () { return this.$modeId; },
- handlesSet: true
- }
-});
-exports.EditSession = EditSession;
-
-});
-
-ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module){"use strict";
-var lang = require("./lib/lang");
-var oop = require("./lib/oop");
-var Range = require("./range").Range;
-var Search = /** @class */ (function () {
- function Search() {
- this.$options = {};
- }
- Search.prototype.set = function (options) {
- oop.mixin(this.$options, options);
- return this;
- };
- Search.prototype.getOptions = function () {
- return lang.copyObject(this.$options);
+ }
+ return range;
};
- Search.prototype.setOptions = function (options) {
- this.$options = options;
+ EditSession.prototype.replace = function (range, text) {
+ return this.doc.replace(range, text);
};
- Search.prototype.find = function (session) {
- var options = this.$options;
- var iterator = this.$matchIterator(session, options);
- if (!iterator)
- return false;
- var firstRange = null;
- iterator.forEach(function (sr, sc, er, ec) {
- firstRange = new Range(sr, sc, er, ec);
- if (sc == ec && options.start && /**@type{Range}*/ (options.start).start
- && options.skipCurrent != false && firstRange.isEqual(/**@type{Range}*/ (options.start))) {
- firstRange = null;
- return false;
+ EditSession.prototype.moveText = function (fromRange, toPosition, copy) {
+ var text = this.getTextRange(fromRange);
+ var folds = this.getFoldsInRange(fromRange);
+ var toRange = Range.fromPoints(toPosition, toPosition);
+ if (!copy) {
+ this.remove(fromRange);
+ var rowDiff = fromRange.start.row - fromRange.end.row;
+ var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;
+ if (collDiff) {
+ if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)
+ toRange.start.column += collDiff;
+ if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)
+ toRange.end.column += collDiff;
}
- return true;
- });
- return firstRange;
- };
- Search.prototype.findAll = function (session) {
- var options = this.$options;
- if (!options.needle)
- return [];
- this.$assembleRegExp(options);
- var range = options.range;
- var lines = range
- ? session.getLines(range.start.row, range.end.row)
- : session.doc.getAllLines();
- var ranges = [];
- var re = options.re;
- if (options.$isMultiLine) {
- var len = re.length;
- var maxRow = lines.length - len;
- var prevRange;
- outer: for (var row = re.offset || 0; row <= maxRow; row++) {
- for (var j = 0; j < len; j++)
- if (lines[row + j].search(re[j]) == -1)
- continue outer;
- var startLine = lines[row];
- var line = lines[row + len - 1];
- var startIndex = startLine.length - startLine.match(re[0])[0].length;
- var endIndex = line.match(re[len - 1])[0].length;
- if (prevRange && prevRange.end.row === row &&
- prevRange.end.column > startIndex) {
- continue;
- }
- ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex));
- if (len > 2)
- row = row + len - 2;
+ if (rowDiff && toRange.start.row >= fromRange.end.row) {
+ toRange.start.row += rowDiff;
+ toRange.end.row += rowDiff;
}
}
- else {
- for (var i = 0; i < lines.length; i++) {
- var matches = lang.getMatchOffsets(lines[i], re);
- for (var j = 0; j < matches.length; j++) {
- var match = matches[j];
- ranges.push(new Range(i, match.offset, i, match.offset + match.length));
- }
- }
+ toRange.end = this.insert(toRange.start, text);
+ if (folds.length) {
+ var oldStart = fromRange.start;
+ var newStart = toRange.start;
+ var rowDiff = newStart.row - oldStart.row;
+ var collDiff = newStart.column - oldStart.column;
+ this.addFolds(folds.map(function (x) {
+ x = x.clone();
+ if (x.start.row == oldStart.row)
+ x.start.column += collDiff;
+ if (x.end.row == oldStart.row)
+ x.end.column += collDiff;
+ x.start.row += rowDiff;
+ x.end.row += rowDiff;
+ return x;
+ }));
}
- if (range) {
- var startColumn = range.start.column;
- var endColumn = range.end.column;
- var i = 0, j = ranges.length - 1;
- while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0)
- i++;
- var endRow = range.end.row - range.start.row;
- while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)
- j--;
- ranges = ranges.slice(i, j + 1);
- for (i = 0, j = ranges.length; i < j; i++) {
- ranges[i].start.row += range.start.row;
- ranges[i].end.row += range.start.row;
+ return toRange;
+ };
+ EditSession.prototype.indentRows = function (startRow, endRow, indentString) {
+ indentString = indentString.replace(/\t/g, this.getTabString());
+ for (var row = startRow; row <= endRow; row++)
+ this.doc.insertInLine({ row: row, column: 0 }, indentString);
+ };
+ EditSession.prototype.outdentRows = function (range) {
+ var rowRange = range.collapseRows();
+ var deleteRange = new Range(0, 0, 0, 0);
+ var size = this.getTabSize();
+ for (var i = rowRange.start.row; i <= rowRange.end.row; ++i) {
+ var line = this.getLine(i);
+ deleteRange.start.row = i;
+ deleteRange.end.row = i;
+ for (var j = 0; j < size; ++j)
+ if (line.charAt(j) != ' ')
+ break;
+ if (j < size && line.charAt(j) == '\t') {
+ deleteRange.start.column = j;
+ deleteRange.end.column = j + 1;
+ }
+ else {
+ deleteRange.start.column = 0;
+ deleteRange.end.column = j;
}
+ this.remove(deleteRange);
}
- return ranges;
};
- Search.prototype.replace = function (input, replacement) {
- var options = this.$options;
- var re = this.$assembleRegExp(options);
- if (options.$isMultiLine)
- return replacement;
- if (!re)
- return;
- var match = re.exec(input);
- if (!match || match[0].length != input.length)
- return null;
- if (!options.regExp) {
- replacement = replacement.replace(/\$/g, "$$$$");
+ EditSession.prototype.$moveLines = function (firstRow, lastRow, dir) {
+ firstRow = this.getRowFoldStart(firstRow);
+ lastRow = this.getRowFoldEnd(lastRow);
+ if (dir < 0) {
+ var row = this.getRowFoldStart(firstRow + dir);
+ if (row < 0)
+ return 0;
+ var diff = row - firstRow;
}
- replacement = input.replace(re, replacement);
- if (options.preserveCase) {
- replacement = replacement.split("");
- for (var i = Math.min(input.length, input.length); i--;) {
- var ch = input[i];
- if (ch && ch.toLowerCase() != ch)
- replacement[i] = replacement[i].toUpperCase();
- else
- replacement[i] = replacement[i].toLowerCase();
+ else if (dir > 0) {
+ var row = this.getRowFoldEnd(lastRow + dir);
+ if (row > this.doc.getLength() - 1)
+ return 0;
+ var diff = row - lastRow;
+ }
+ else {
+ firstRow = this.$clipRowToDocument(firstRow);
+ lastRow = this.$clipRowToDocument(lastRow);
+ var diff = lastRow - firstRow + 1;
+ }
+ var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE);
+ var folds = this.getFoldsInRange(range).map(function (x) {
+ x = x.clone();
+ x.start.row += diff;
+ x.end.row += diff;
+ return x;
+ });
+ var lines = dir == 0
+ ? this.doc.getLines(firstRow, lastRow)
+ : this.doc.removeFullLines(firstRow, lastRow);
+ this.doc.insertFullLines(firstRow + diff, lines);
+ folds.length && this.addFolds(folds);
+ return diff;
+ };
+ EditSession.prototype.moveLinesUp = function (firstRow, lastRow) {
+ return this.$moveLines(firstRow, lastRow, -1);
+ };
+ EditSession.prototype.moveLinesDown = function (firstRow, lastRow) {
+ return this.$moveLines(firstRow, lastRow, 1);
+ };
+ EditSession.prototype.duplicateLines = function (firstRow, lastRow) {
+ return this.$moveLines(firstRow, lastRow, 0);
+ };
+ EditSession.prototype.$clipRowToDocument = function (row) {
+ return Math.max(0, Math.min(row, this.doc.getLength() - 1));
+ };
+ EditSession.prototype.$clipColumnToRow = function (row, column) {
+ if (column < 0)
+ return 0;
+ return Math.min(this.doc.getLine(row).length, column);
+ };
+ EditSession.prototype.$clipPositionToDocument = function (row, column) {
+ column = Math.max(0, column);
+ if (row < 0) {
+ row = 0;
+ column = 0;
+ }
+ else {
+ var len = this.doc.getLength();
+ if (row >= len) {
+ row = len - 1;
+ column = this.doc.getLine(len - 1).length;
+ }
+ else {
+ column = Math.min(this.doc.getLine(row).length, column);
}
- replacement = replacement.join("");
}
- return replacement;
+ return {
+ row: row,
+ column: column
+ };
};
- Search.prototype.$assembleRegExp = function (options, $disableFakeMultiline) {
- if (options.needle instanceof RegExp)
- return options.re = options.needle;
- var needle = options.needle;
- if (!options.needle)
- return options.re = false;
- if (!options.regExp)
- needle = lang.escapeRegExp(needle);
- var modifier = options.caseSensitive ? "gm" : "gmi";
- try {
- new RegExp(needle, "u");
- options.$supportsUnicodeFlag = true;
- modifier += "u";
+ EditSession.prototype.$clipRangeToDocument = function (range) {
+ if (range.start.row < 0) {
+ range.start.row = 0;
+ range.start.column = 0;
}
- catch (e) {
- options.$supportsUnicodeFlag = false; //left for backward compatibility with previous versions for cases like /ab\{2}/gu
+ else {
+ range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);
}
- if (options.wholeWord)
- needle = addWordBoundary(needle, options);
- options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle);
- if (options.$isMultiLine)
- return options.re = this.$assembleMultilineRegExp(needle, modifier);
- try {
- var re = new RegExp(needle, modifier);
+ var len = this.doc.getLength() - 1;
+ if (range.end.row > len) {
+ range.end.row = len;
+ range.end.column = this.doc.getLine(len).length;
}
- catch (e) {
- re = false;
+ else {
+ range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);
}
- return options.re = re;
+ return range;
};
- Search.prototype.$assembleMultilineRegExp = function (needle, modifier) {
- var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n");
- var re = [];
- for (var i = 0; i < parts.length; i++)
- try {
- re.push(new RegExp(parts[i], modifier));
- }
- catch (e) {
- return false;
- }
- return re;
+ EditSession.prototype.setUseWrapMode = function (useWrapMode) {
+ if (useWrapMode != this.$useWrapMode) {
+ this.$useWrapMode = useWrapMode;
+ this.$modified = true;
+ this.$resetRowCache(0);
+ if (useWrapMode) {
+ var len = this.getLength();
+ this.$wrapData = Array(len);
+ this.$updateWrapData(0, len - 1);
+ }
+ this._signal("changeWrapMode");
+ }
};
- Search.prototype.$matchIterator = function (session, options) {
- var re = this.$assembleRegExp(options);
- if (!re)
- return false;
- var backwards = options.backwards == true;
- var skipCurrent = options.skipCurrent != false;
- var supportsUnicodeFlag = re.unicode;
- var range = options.range;
- var start = options.start;
- if (!start)
- start = range ? range[backwards ? "end" : "start"] : session.selection.getRange();
- if (start.start)
- start = start[skipCurrent != backwards ? "end" : "start"];
- var firstRow = range ? range.start.row : 0;
- var lastRow = range ? range.end.row : session.getLength() - 1;
- if (backwards) {
- var forEach = function (callback) {
- var row = start.row;
- if (forEachInLine(row, start.column, callback))
- return;
- for (row--; row >= firstRow; row--)
- if (forEachInLine(row, Number.MAX_VALUE, callback))
- return;
- if (options.wrap == false)
- return;
- for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
- if (forEachInLine(row, Number.MAX_VALUE, callback))
- return;
- };
+ EditSession.prototype.getUseWrapMode = function () {
+ return this.$useWrapMode;
+ };
+ EditSession.prototype.setWrapLimitRange = function (min, max) {
+ if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
+ this.$wrapLimitRange = { min: min, max: max };
+ this.$modified = true;
+ this.$bidiHandler.markAsDirty();
+ if (this.$useWrapMode)
+ this._signal("changeWrapMode");
}
- else {
- var forEach = function (callback) {
- var row = start.row;
- if (forEachInLine(row, start.column, callback))
- return;
- for (row = row + 1; row <= lastRow; row++)
- if (forEachInLine(row, 0, callback))
- return;
- if (options.wrap == false)
- return;
- for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
- if (forEachInLine(row, 0, callback))
- return;
- };
+ };
+ EditSession.prototype.adjustWrapLimit = function (desiredLimit, $printMargin) {
+ var limits = this.$wrapLimitRange;
+ if (limits.max < 0)
+ limits = { min: $printMargin, max: $printMargin };
+ var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);
+ if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {
+ this.$wrapLimit = wrapLimit;
+ this.$modified = true;
+ if (this.$useWrapMode) {
+ this.$updateWrapData(0, this.getLength() - 1);
+ this.$resetRowCache(0);
+ this._signal("changeWrapLimit");
+ }
+ return true;
}
- if (options.$isMultiLine) {
- var len = re.length;
- var forEachInLine = function (row, offset, callback) {
- var startRow = backwards ? row - len + 1 : row;
- if (startRow < 0 || startRow + len > session.getLength())
- return;
- var line = session.getLine(startRow);
- var startIndex = line.search(re[0]);
- if (!backwards && startIndex < offset || startIndex === -1)
- return;
- for (var i = 1; i < len; i++) {
- line = session.getLine(startRow + i);
- if (line.search(re[i]) == -1)
- return;
+ return false;
+ };
+ EditSession.prototype.$constrainWrapLimit = function (wrapLimit, min, max) {
+ if (min)
+ wrapLimit = Math.max(min, wrapLimit);
+ if (max)
+ wrapLimit = Math.min(max, wrapLimit);
+ return wrapLimit;
+ };
+ EditSession.prototype.getWrapLimit = function () {
+ return this.$wrapLimit;
+ };
+ EditSession.prototype.setWrapLimit = function (limit) {
+ this.setWrapLimitRange(limit, limit);
+ };
+ EditSession.prototype.getWrapLimitRange = function () {
+ return {
+ min: this.$wrapLimitRange.min,
+ max: this.$wrapLimitRange.max
+ };
+ };
+ EditSession.prototype.$updateInternalDataOnChange = function (delta) {
+ var useWrapMode = this.$useWrapMode;
+ var action = delta.action;
+ var start = delta.start;
+ var end = delta.end;
+ var firstRow = start.row;
+ var lastRow = end.row;
+ var len = lastRow - firstRow;
+ var removedFolds = null;
+ this.$updating = true;
+ if (len != 0) {
+ if (action === "remove") {
+ this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
+ var foldLines = this.$foldData;
+ removedFolds = this.getFoldsInRange(delta);
+ this.removeFolds(removedFolds);
+ var foldLine = this.getFoldLine(end.row);
+ var idx = 0;
+ if (foldLine) {
+ foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
+ foldLine.shiftRow(-len);
+ var foldLineBefore = this.getFoldLine(firstRow);
+ if (foldLineBefore && foldLineBefore !== foldLine) {
+ foldLineBefore.merge(foldLine);
+ foldLine = foldLineBefore;
+ }
+ idx = foldLines.indexOf(foldLine) + 1;
}
- var endIndex = line.match(re[len - 1])[0].length;
- if (backwards && endIndex > offset)
- return;
- if (callback(startRow, startIndex, startRow + len - 1, endIndex))
- return true;
- };
- }
- else if (backwards) {
- var forEachInLine = function (row, endIndex, callback) {
- var line = session.getLine(row);
- var matches = [];
- var m, last = 0;
- re.lastIndex = 0;
- while ((m = re.exec(line))) {
- var length = m[0].length;
- last = m.index;
- if (!length) {
- if (last >= line.length)
- break;
- re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);
+ for (idx; idx < foldLines.length; idx++) {
+ var foldLine = foldLines[idx];
+ if (foldLine.start.row >= end.row) {
+ foldLine.shiftRow(-len);
}
- if (m.index + length > endIndex)
- break;
- matches.push(m.index, length);
}
- for (var i = matches.length - 1; i >= 0; i -= 2) {
- var column = matches[i - 1];
- var length = matches[i];
- if (callback(row, column, row, column + length))
- return true;
+ lastRow = firstRow;
+ }
+ else {
+ var args = Array(len);
+ args.unshift(firstRow, 0);
+ var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;
+ arr.splice.apply(arr, args);
+ var foldLines = this.$foldData;
+ var foldLine = this.getFoldLine(firstRow);
+ var idx = 0;
+ if (foldLine) {
+ var cmp = foldLine.range.compareInside(start.row, start.column);
+ if (cmp == 0) {
+ foldLine = foldLine.split(start.row, start.column);
+ if (foldLine) {
+ foldLine.shiftRow(len);
+ foldLine.addRemoveChars(lastRow, 0, end.column - start.column);
+ }
+ }
+ else
+ if (cmp == -1) {
+ foldLine.addRemoveChars(firstRow, 0, end.column - start.column);
+ foldLine.shiftRow(len);
+ }
+ idx = foldLines.indexOf(foldLine) + 1;
}
- };
- }
- else {
- var forEachInLine = function (row, startIndex, callback) {
- var line = session.getLine(row);
- var last;
- var m;
- re.lastIndex = startIndex;
- while ((m = re.exec(line))) {
- var length = m[0].length;
- last = m.index;
- if (callback(row, last, row, last + length))
- return true;
- if (!length) {
- re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);
- if (last >= line.length)
- return false;
+ for (idx; idx < foldLines.length; idx++) {
+ var foldLine = foldLines[idx];
+ if (foldLine.start.row >= firstRow) {
+ foldLine.shiftRow(len);
}
}
- };
+ }
}
- return { forEach: forEach };
- };
- return Search;
-}());
-function addWordBoundary(needle, options) {
- var supportsLookbehind = lang.supportsLookbehind();
- function wordBoundary(c, firstChar) {
- if (firstChar === void 0) { firstChar = true; }
- var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp("[\\p{L}\\p{N}_]", "u") : new RegExp("\\w");
- if (wordRegExp.test(c) || options.regExp) {
- if (supportsLookbehind && options.$supportsUnicodeFlag) {
- if (firstChar)
- return "(?<=^|[^\\p{L}\\p{N}_])";
- return "(?=[^\\p{L}\\p{N}_]|$)";
+ else {
+ len = Math.abs(delta.start.column - delta.end.column);
+ if (action === "remove") {
+ removedFolds = this.getFoldsInRange(delta);
+ this.removeFolds(removedFolds);
+ len = -len;
+ }
+ var foldLine = this.getFoldLine(firstRow);
+ if (foldLine) {
+ foldLine.addRemoveChars(firstRow, start.column, len);
}
- return "\\b";
}
- return "";
- }
- var needleArray = Array.from(needle);
- var firstChar = needleArray[0];
- var lastChar = needleArray[needleArray.length - 1];
- return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false);
-}
-exports.Search = Search;
-
-});
-
-ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module){"use strict";
-var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
+ if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {
+ console.error("doc.getLength() and $wrapData.length have to be the same!");
+ }
+ this.$updating = false;
+ if (useWrapMode)
+ this.$updateWrapData(firstRow, lastRow);
+ else
+ this.$updateRowLengthCache(firstRow, lastRow);
+ return removedFolds;
};
- return function (d, b) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})(); var keyUtil = require("../lib/keys");
-var useragent = require("../lib/useragent");
-var KEY_MODS = keyUtil.KEY_MODS;
-var MultiHashHandler = /** @class */ (function () {
- function MultiHashHandler(config, platform) {
- this.$init(config, platform, false);
- }
- MultiHashHandler.prototype.$init = function (config, platform, $singleCommand) {
- this.platform = platform || (useragent.isMac ? "mac" : "win");
- this.commands = {};
- this.commandKeyBinding = {};
- this.addCommands(config);
- this.$singleCommand = $singleCommand;
- };
- MultiHashHandler.prototype.addCommand = function (command) {
- if (this.commands[command.name])
- this.removeCommand(command);
- this.commands[command.name] = command;
- if (command.bindKey)
- this._buildKeyHash(command);
+ EditSession.prototype.$updateRowLengthCache = function (firstRow, lastRow) {
+ this.$rowLengthCache[firstRow] = null;
+ this.$rowLengthCache[lastRow] = null;
};
- MultiHashHandler.prototype.removeCommand = function (command, keepCommand) {
- var name = command && (typeof command === 'string' ? command : command.name);
- command = this.commands[name];
- if (!keepCommand)
- delete this.commands[name];
- var ckb = this.commandKeyBinding;
- for (var keyId in ckb) {
- var cmdGroup = ckb[keyId];
- if (cmdGroup == command) {
- delete ckb[keyId];
+ EditSession.prototype.$updateWrapData = function (firstRow, lastRow) {
+ var lines = this.doc.getAllLines();
+ var tabSize = this.getTabSize();
+ var wrapData = this.$wrapData;
+ var wrapLimit = this.$wrapLimit;
+ var tokens;
+ var foldLine;
+ var row = firstRow;
+ lastRow = Math.min(lastRow, lines.length - 1);
+ while (row <= lastRow) {
+ foldLine = this.getFoldLine(row, foldLine);
+ if (!foldLine) {
+ tokens = this.$getDisplayTokens(lines[row]);
+ wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
+ row++;
}
- else if (Array.isArray(cmdGroup)) {
- var i = cmdGroup.indexOf(command);
- if (i != -1) {
- cmdGroup.splice(i, 1);
- if (cmdGroup.length == 1)
- ckb[keyId] = cmdGroup[0];
- }
+ else {
+ tokens = [];
+ foldLine.walk(function (placeholder, row, column, lastColumn) {
+ var walkTokens;
+ if (placeholder != null) {
+ walkTokens = this.$getDisplayTokens(placeholder, tokens.length);
+ walkTokens[0] = PLACEHOLDER_START;
+ for (var i = 1; i < walkTokens.length; i++) {
+ walkTokens[i] = PLACEHOLDER_BODY;
+ }
+ }
+ else {
+ walkTokens = this.$getDisplayTokens(lines[row].substring(lastColumn, column), tokens.length);
+ }
+ tokens = tokens.concat(walkTokens);
+ }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);
+ wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
+ row = foldLine.end.row + 1;
}
}
};
- MultiHashHandler.prototype.bindKey = function (key, command, position) {
- if (typeof key == "object" && key) {
- if (position == undefined)
- position = key.position;
- key = key[this.platform];
+ EditSession.prototype.$computeWrapSplits = function (tokens, wrapLimit, tabSize) {
+ if (tokens.length == 0) {
+ return [];
}
- if (!key)
- return;
- if (typeof command == "function")
- return this.addCommand({ exec: command, bindKey: key, name: command.name || /**@type{string}*/ (key) }); (key).split("|").forEach(function (keyPart) {
- var chain = "";
- if (keyPart.indexOf(" ") != -1) {
- var parts = keyPart.split(/\s+/);
- keyPart = parts.pop();
- parts.forEach(function (keyPart) {
- var binding = this.parseKeys(keyPart);
- var id = KEY_MODS[binding.hashId] + binding.key;
- chain += (chain ? " " : "") + id;
- this._addCommandToBinding(chain, "chainKeys");
- }, this);
- chain += " ";
+ var splits = [];
+ var displayLength = tokens.length;
+ var lastSplit = 0, lastDocSplit = 0;
+ var isCode = this.$wrapAsCode;
+ var indentedSoftWrap = this.$indentedSoftWrap;
+ var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8)
+ || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);
+ function getWrapIndent() {
+ var indentation = 0;
+ if (maxIndent === 0)
+ return indentation;
+ if (indentedSoftWrap) {
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ if (token == SPACE)
+ indentation += 1;
+ else if (token == TAB)
+ indentation += tabSize;
+ else if (token == TAB_SPACE)
+ continue;
+ else
+ break;
+ }
}
- var binding = this.parseKeys(keyPart);
- var id = KEY_MODS[binding.hashId] + binding.key;
- this._addCommandToBinding(chain + id, command, position);
- }, this);
- };
- MultiHashHandler.prototype._addCommandToBinding = function (keyId, command, position) {
- var ckb = this.commandKeyBinding, i;
- if (!command) {
- delete ckb[keyId];
+ if (isCode && indentedSoftWrap !== false)
+ indentation += tabSize;
+ return Math.min(indentation, maxIndent);
}
- else if (!ckb[keyId] || this.$singleCommand) {
- ckb[keyId] = command;
+ function addSplit(screenPos) {
+ var len = screenPos - lastSplit;
+ for (var i = lastSplit; i < screenPos; i++) {
+ var ch = tokens[i];
+ if (ch === 12 || ch === 2)
+ len -= 1;
+ }
+ if (!splits.length) {
+ indent = getWrapIndent();
+ splits.indent = indent;
+ }
+ lastDocSplit += len;
+ splits.push(lastDocSplit);
+ lastSplit = screenPos;
}
- else {
- if (!Array.isArray(ckb[keyId])) {
- ckb[keyId] = [ckb[keyId]];
+ var indent = 0;
+ while (displayLength - lastSplit > wrapLimit - indent) {
+ var split = lastSplit + wrapLimit - indent;
+ if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {
+ addSplit(split);
+ continue;
}
- else if ((i = ckb[keyId].indexOf(command)) != -1) {
- ckb[keyId].splice(i, 1);
+ if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {
+ for (split; split != lastSplit - 1; split--) {
+ if (tokens[split] == PLACEHOLDER_START) {
+ break;
+ }
+ }
+ if (split > lastSplit) {
+ addSplit(split);
+ continue;
+ }
+ split = lastSplit + wrapLimit;
+ for (split; split < tokens.length; split++) {
+ if (tokens[split] != PLACEHOLDER_BODY) {
+ break;
+ }
+ }
+ if (split == tokens.length) {
+ break; // Breaks the while-loop.
+ }
+ addSplit(split);
+ continue;
}
- if (typeof position != "number") {
- position = getPosition(command);
+ var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);
+ while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
+ split--;
}
- var commands = ckb[keyId];
- for (i = 0; i < commands.length; i++) {
- var other = commands[i];
- var otherPos = getPosition(other);
- if (otherPos > position)
- break;
+ if (isCode) {
+ while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
+ split--;
+ }
+ while (split > minSplit && tokens[split] == PUNCTUATION) {
+ split--;
+ }
}
- commands.splice(i, 0, command);
+ else {
+ while (split > minSplit && tokens[split] < SPACE) {
+ split--;
+ }
+ }
+ if (split > minSplit) {
+ addSplit(++split);
+ continue;
+ }
+ split = lastSplit + wrapLimit;
+ if (tokens[split] == CHAR_EXT)
+ split--;
+ addSplit(split - indent);
}
+ return splits;
};
- MultiHashHandler.prototype.addCommands = function (commands) {
- commands && Object.keys(commands).forEach(function (name) {
- var command = commands[name];
- if (!command)
- return;
- if (typeof command === "string")
- return this.bindKey(command, name);
- if (typeof command === "function")
- command = { exec: command };
- if (typeof command !== "object")
- return;
- if (!command.name)
- command.name = name;
- this.addCommand(command);
- }, this);
+ EditSession.prototype.$getDisplayTokens = function (str, offset) {
+ var arr = [];
+ var tabSize;
+ offset = offset || 0;
+ for (var i = 0; i < str.length; i++) {
+ var c = str.charCodeAt(i);
+ if (c == 9) {
+ tabSize = this.getScreenTabSize(arr.length + offset);
+ arr.push(TAB);
+ for (var n = 1; n < tabSize; n++) {
+ arr.push(TAB_SPACE);
+ }
+ }
+ else if (c == 32) {
+ arr.push(SPACE);
+ }
+ else if ((c > 39 && c < 48) || (c > 57 && c < 64)) {
+ arr.push(PUNCTUATION);
+ }
+ else if (c >= 0x1100 && isFullWidth(c)) {
+ arr.push(CHAR, CHAR_EXT);
+ }
+ else {
+ arr.push(CHAR);
+ }
+ }
+ return arr;
};
- MultiHashHandler.prototype.removeCommands = function (commands) {
- Object.keys(commands).forEach(function (name) {
- this.removeCommand(commands[name]);
- }, this);
- };
- MultiHashHandler.prototype.bindKeys = function (keyList) {
- Object.keys(keyList).forEach(function (key) {
- this.bindKey(key, keyList[key]);
- }, this);
- };
- MultiHashHandler.prototype._buildKeyHash = function (command) {
- this.bindKey(command.bindKey, command);
- };
- MultiHashHandler.prototype.parseKeys = function (keys) {
- var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function (x) { return x; });
- var key = parts.pop();
- var keyCode = keyUtil[key];
- if (keyUtil.FUNCTION_KEYS[keyCode])
- key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();
- else if (!parts.length)
- return { key: key, hashId: -1 };
- else if (parts.length == 1 && parts[0] == "shift")
- return { key: key.toUpperCase(), hashId: -1 };
- var hashId = 0;
- for (var i = parts.length; i--;) {
- var modifier = keyUtil.KEY_MODS[parts[i]];
- if (modifier == null) {
- if (typeof console != "undefined")
- console.error("invalid modifier " + parts[i] + " in " + keys);
- return false;
+ EditSession.prototype.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {
+ if (maxScreenColumn == 0)
+ return [0, 0];
+ if (maxScreenColumn == null)
+ maxScreenColumn = Infinity;
+ screenColumn = screenColumn || 0;
+ var c, column;
+ for (column = 0; column < str.length; column++) {
+ c = str.charCodeAt(column);
+ if (c == 9) {
+ screenColumn += this.getScreenTabSize(screenColumn);
+ }
+ else if (c >= 0x1100 && isFullWidth(c)) {
+ screenColumn += 2;
+ }
+ else {
+ screenColumn += 1;
+ }
+ if (screenColumn > maxScreenColumn) {
+ break;
}
- hashId |= modifier;
}
- return { key: key, hashId: hashId };
+ return [screenColumn, column];
};
- MultiHashHandler.prototype.findKeyCommand = function (hashId, keyString) {
- var key = KEY_MODS[hashId] + keyString;
- return this.commandKeyBinding[key];
+ EditSession.prototype.getRowLength = function (row) {
+ var h = 1;
+ if (this.lineWidgets)
+ h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
+ if (!this.$useWrapMode || !this.$wrapData[row])
+ return h;
+ else
+ return this.$wrapData[row].length + h;
};
- MultiHashHandler.prototype.handleKeyboard = function (data, hashId, keyString, keyCode) {
- if (keyCode < 0)
- return;
- var key = KEY_MODS[hashId] + keyString;
- var command = this.commandKeyBinding[key];
- if (data.$keyChain) {
- data.$keyChain += " " + key;
- command = this.commandKeyBinding[data.$keyChain] || command;
- }
- if (command) {
- if (command == "chainKeys" || command[command.length - 1] == "chainKeys") {
- data.$keyChain = data.$keyChain || key;
- return { command: "null" };
- }
+ EditSession.prototype.getRowLineCount = function (row) {
+ if (!this.$useWrapMode || !this.$wrapData[row]) {
+ return 1;
}
- if (data.$keyChain) {
- if ((!hashId || hashId == 4) && keyString.length == 1)
- data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input
- else if (hashId == -1 || keyCode > 0)
- data.$keyChain = ""; // reset keyChain
+ else {
+ return this.$wrapData[row].length + 1;
}
- return { command: command };
};
- MultiHashHandler.prototype.getStatusText = function (editor, data) {
- return data.$keyChain || "";
+ EditSession.prototype.getRowWrapIndent = function (screenRow) {
+ if (this.$useWrapMode) {
+ var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
+ var splits = this.$wrapData[pos.row];
+ return splits.length && splits[0] < pos.column ? splits.indent : 0;
+ }
+ else {
+ return 0;
+ }
};
- return MultiHashHandler;
-}());
-function getPosition(command) {
- return typeof command == "object" && command.bindKey
- && command.bindKey.position
- || (command.isDefault ? -100 : 0);
-}
-var HashHandler = /** @class */ (function (_super) {
- __extends(HashHandler, _super);
- function HashHandler(config, platform) {
- var _this = _super.call(this, config, platform) || this;
- _this.$singleCommand = true;
- return _this;
- }
- return HashHandler;
-}(MultiHashHandler));
-HashHandler.call = function (thisArg, config, platform) {
- MultiHashHandler.prototype.$init.call(thisArg, config, platform, true);
-};
-MultiHashHandler.call = function (thisArg, config, platform) {
- MultiHashHandler.prototype.$init.call(thisArg, config, platform, false);
-};
-exports.HashHandler = HashHandler;
-exports.MultiHashHandler = MultiHashHandler;
-
-});
-
-ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(require, exports, module){"use strict";
-var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
+ EditSession.prototype.getScreenLastRowColumn = function (screenRow) {
+ var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
+ return this.documentToScreenColumn(pos.row, pos.column);
};
- return function (d, b) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ EditSession.prototype.getDocumentLastRowColumn = function (docRow, docColumn) {
+ var screenRow = this.documentToScreenRow(docRow, docColumn);
+ return this.getScreenLastRowColumn(screenRow);
};
-})();
-var oop = require("../lib/oop");
-var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler;
-var EventEmitter = require("../lib/event_emitter").EventEmitter;
-var CommandManager = /** @class */ (function (_super) {
- __extends(CommandManager, _super);
- function CommandManager(platform, commands) {
- var _this = _super.call(this, commands, platform) || this;
- _this.byName = _this.commands;
- _this.setDefaultHandler("exec", function (e) {
- if (!e.args) {
- return e.command.exec(e.editor, {}, e.event, true);
- }
- return e.command.exec(e.editor, e.args, e.event, false);
- });
- return _this;
- }
- CommandManager.prototype.exec = function (command, editor, args) {
- if (Array.isArray(command)) {
- for (var i = command.length; i--;) {
- if (this.exec(command[i], editor, args))
- return true;
- }
- return false;
- }
- if (typeof command === "string")
- command = this.commands[command];
- if (!command)
- return false;
- if (editor && editor.$readOnly && !command.readOnly)
- return false;
- if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))
- return false;
- var e = { editor: editor, command: command, args: args };
- e.returnValue = this._emit("exec", e);
- this._signal("afterExec", e);
- return e.returnValue === false ? false : true;
+ EditSession.prototype.getDocumentLastRowColumnPosition = function (docRow, docColumn) {
+ var screenRow = this.documentToScreenRow(docRow, docColumn);
+ return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
};
- CommandManager.prototype.toggleRecording = function (editor) {
- if (this.$inReplay)
- return;
- editor && editor._emit("changeStatus");
- if (this.recording) {
- this.macro.pop();
- this.off("exec", this.$addCommandToMacro);
- if (!this.macro.length)
- this.macro = this.oldMacro;
- return this.recording = false;
+ EditSession.prototype.getRowSplitData = function (row) {
+ if (!this.$useWrapMode) {
+ return undefined;
}
- if (!this.$addCommandToMacro) {
- this.$addCommandToMacro = function (e) {
- this.macro.push([e.command, e.args]);
- }.bind(this);
+ else {
+ return this.$wrapData[row];
}
- this.oldMacro = this.macro;
- this.macro = [];
- this.on("exec", this.$addCommandToMacro);
- return this.recording = true;
};
- CommandManager.prototype.replay = function (editor) {
- if (this.$inReplay || !this.macro)
- return;
- if (this.recording)
- return this.toggleRecording(editor);
- try {
- this.$inReplay = true;
- this.macro.forEach(function (x) {
- if (typeof x == "string")
- this.exec(x, editor);
- else
- this.exec(x[0], editor, x[1]);
- }, this);
- }
- finally {
- this.$inReplay = false;
- }
+ EditSession.prototype.getScreenTabSize = function (screenColumn) {
+ return this.$tabSize - (screenColumn % this.$tabSize | 0);
};
- CommandManager.prototype.trimMacro = function (m) {
- return m.map(function (x) {
- if (typeof x[0] != "string")
- x[0] = x[0].name;
- if (!x[1])
- x = x[0];
- return x;
- });
+ EditSession.prototype.screenToDocumentRow = function (screenRow, screenColumn) {
+ return this.screenToDocumentPosition(screenRow, screenColumn).row;
};
- return CommandManager;
-}(MultiHashHandler));
-oop.implement(CommandManager.prototype, EventEmitter);
-exports.CommandManager = CommandManager;
-
-});
-
-ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(require, exports, module){"use strict";
-var lang = require("../lib/lang");
-var config = require("../config");
-var Range = require("../range").Range;
-function bindKey(win, mac) {
- return { win: win, mac: mac };
-}
-exports.commands = [{
- name: "showSettingsMenu",
- description: "Show settings menu",
- bindKey: bindKey("Ctrl-,", "Command-,"),
- exec: function (editor) {
- config.loadModule("ace/ext/settings_menu", function (module) {
- module.init(editor);
- editor.showSettingsMenu();
- });
- },
- readOnly: true
- }, {
- name: "goToNextError",
- description: "Go to next error",
- bindKey: bindKey("Alt-E", "F4"),
- exec: function (editor) {
- config.loadModule("ace/ext/error_marker", function (module) {
- module.showErrorMarker(editor, 1);
- });
- },
- scrollIntoView: "animate",
- readOnly: true
- }, {
- name: "goToPreviousError",
- description: "Go to previous error",
- bindKey: bindKey("Alt-Shift-E", "Shift-F4"),
- exec: function (editor) {
- config.loadModule("ace/ext/error_marker", function (module) {
- module.showErrorMarker(editor, -1);
- });
- },
- scrollIntoView: "animate",
- readOnly: true
- }, {
- name: "selectall",
- description: "Select all",
- bindKey: bindKey("Ctrl-A", "Command-A"),
- exec: function (editor) { editor.selectAll(); },
- readOnly: true
- }, {
- name: "centerselection",
- description: "Center selection",
- bindKey: bindKey(null, "Ctrl-L"),
- exec: function (editor) { editor.centerSelection(); },
- readOnly: true
- }, {
- name: "gotoline",
- description: "Go to line...",
- bindKey: bindKey("Ctrl-L", "Command-L"),
- exec: function (editor, line) {
- if (typeof line === "number" && !isNaN(line))
- editor.gotoLine(line);
- editor.prompt({ $type: "gotoLine" });
- },
- readOnly: true
- }, {
- name: "fold",
- bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
- exec: function (editor) { editor.session.toggleFold(false); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "unfold",
- bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
- exec: function (editor) { editor.session.toggleFold(true); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "toggleFoldWidget",
- description: "Toggle fold widget",
- bindKey: bindKey("F2", "F2"),
- exec: function (editor) { editor.session.toggleFoldWidget(); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "toggleParentFoldWidget",
- description: "Toggle parent fold widget",
- bindKey: bindKey("Alt-F2", "Alt-F2"),
- exec: function (editor) { editor.session.toggleFoldWidget(true); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "foldall",
- description: "Fold all",
- bindKey: bindKey(null, "Ctrl-Command-Option-0"),
- exec: function (editor) { editor.session.foldAll(); },
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "foldAllComments",
- description: "Fold all comments",
- bindKey: bindKey(null, "Ctrl-Command-Option-0"),
- exec: function (editor) { editor.session.foldAllComments(); },
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "foldOther",
- description: "Fold other",
- bindKey: bindKey("Alt-0", "Command-Option-0"),
- exec: function (editor) {
- editor.session.foldAll();
- editor.session.unfold(editor.selection.getAllRanges());
- },
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "unfoldall",
- description: "Unfold all",
- bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"),
- exec: function (editor) { editor.session.unfold(); },
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "findnext",
- description: "Find next",
- bindKey: bindKey("Ctrl-K", "Command-G"),
- exec: function (editor) { editor.findNext(); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "findprevious",
- description: "Find previous",
- bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
- exec: function (editor) { editor.findPrevious(); },
- multiSelectAction: "forEach",
- scrollIntoView: "center",
- readOnly: true
- }, {
- name: "selectOrFindNext",
- description: "Select or find next",
- bindKey: bindKey("Alt-K", "Ctrl-G"),
- exec: function (editor) {
- if (editor.selection.isEmpty())
- editor.selection.selectWord();
- else
- editor.findNext();
- },
- readOnly: true
- }, {
- name: "selectOrFindPrevious",
- description: "Select or find previous",
- bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"),
- exec: function (editor) {
- if (editor.selection.isEmpty())
- editor.selection.selectWord();
- else
- editor.findPrevious();
- },
- readOnly: true
- }, {
- name: "find",
- description: "Find",
- bindKey: bindKey("Ctrl-F", "Command-F"),
- exec: function (editor) {
- config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor); });
- },
- readOnly: true
- }, {
- name: "overwrite",
- description: "Overwrite",
- bindKey: "Insert",
- exec: function (editor) { editor.toggleOverwrite(); },
- readOnly: true
- }, {
- name: "selecttostart",
- description: "Select to start",
- bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
- exec: function (editor) { editor.getSelection().selectFileStart(); },
- multiSelectAction: "forEach",
- readOnly: true,
- scrollIntoView: "animate",
- aceCommandGroup: "fileJump"
- }, {
- name: "gotostart",
- description: "Go to start",
- bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
- exec: function (editor) { editor.navigateFileStart(); },
- multiSelectAction: "forEach",
- readOnly: true,
- scrollIntoView: "animate",
- aceCommandGroup: "fileJump"
- }, {
- name: "selectup",
- description: "Select up",
- bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
- exec: function (editor) { editor.getSelection().selectUp(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "golineup",
- description: "Go line up",
- bindKey: bindKey("Up", "Up|Ctrl-P"),
- exec: function (editor, args) { editor.navigateUp(args.times); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selecttoend",
- description: "Select to end",
- bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
- exec: function (editor) { editor.getSelection().selectFileEnd(); },
- multiSelectAction: "forEach",
- readOnly: true,
- scrollIntoView: "animate",
- aceCommandGroup: "fileJump"
- }, {
- name: "gotoend",
- description: "Go to end",
- bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
- exec: function (editor) { editor.navigateFileEnd(); },
- multiSelectAction: "forEach",
- readOnly: true,
- scrollIntoView: "animate",
- aceCommandGroup: "fileJump"
- }, {
- name: "selectdown",
- description: "Select down",
- bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
- exec: function (editor) { editor.getSelection().selectDown(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "golinedown",
- description: "Go line down",
- bindKey: bindKey("Down", "Down|Ctrl-N"),
- exec: function (editor, args) { editor.navigateDown(args.times); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectwordleft",
- description: "Select word left",
- bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
- exec: function (editor) { editor.getSelection().selectWordLeft(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotowordleft",
- description: "Go to word left",
- bindKey: bindKey("Ctrl-Left", "Option-Left"),
- exec: function (editor) { editor.navigateWordLeft(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selecttolinestart",
- description: "Select to line start",
- bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
- exec: function (editor) { editor.getSelection().selectLineStart(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotolinestart",
- description: "Go to line start",
- bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
- exec: function (editor) { editor.navigateLineStart(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectleft",
- description: "Select left",
- bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
- exec: function (editor) { editor.getSelection().selectLeft(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotoleft",
- description: "Go to left",
- bindKey: bindKey("Left", "Left|Ctrl-B"),
- exec: function (editor, args) { editor.navigateLeft(args.times); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectwordright",
- description: "Select word right",
- bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
- exec: function (editor) { editor.getSelection().selectWordRight(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotowordright",
- description: "Go to word right",
- bindKey: bindKey("Ctrl-Right", "Option-Right"),
- exec: function (editor) { editor.navigateWordRight(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selecttolineend",
- description: "Select to line end",
- bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"),
- exec: function (editor) { editor.getSelection().selectLineEnd(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotolineend",
- description: "Go to line end",
- bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
- exec: function (editor) { editor.navigateLineEnd(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectright",
- description: "Select right",
- bindKey: bindKey("Shift-Right", "Shift-Right"),
- exec: function (editor) { editor.getSelection().selectRight(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "gotoright",
- description: "Go to right",
- bindKey: bindKey("Right", "Right|Ctrl-F"),
- exec: function (editor, args) { editor.navigateRight(args.times); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectpagedown",
- description: "Select page down",
- bindKey: "Shift-PageDown",
- exec: function (editor) { editor.selectPageDown(); },
- readOnly: true
- }, {
- name: "pagedown",
- description: "Page down",
- bindKey: bindKey(null, "Option-PageDown"),
- exec: function (editor) { editor.scrollPageDown(); },
- readOnly: true
- }, {
- name: "gotopagedown",
- description: "Go to page down",
- bindKey: bindKey("PageDown", "PageDown|Ctrl-V"),
- exec: function (editor) { editor.gotoPageDown(); },
- readOnly: true
- }, {
- name: "selectpageup",
- description: "Select page up",
- bindKey: "Shift-PageUp",
- exec: function (editor) { editor.selectPageUp(); },
- readOnly: true
- }, {
- name: "pageup",
- description: "Page up",
- bindKey: bindKey(null, "Option-PageUp"),
- exec: function (editor) { editor.scrollPageUp(); },
- readOnly: true
- }, {
- name: "gotopageup",
- description: "Go to page up",
- bindKey: "PageUp",
- exec: function (editor) { editor.gotoPageUp(); },
- readOnly: true
- }, {
- name: "scrollup",
- description: "Scroll up",
- bindKey: bindKey("Ctrl-Up", null),
- exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },
- readOnly: true
- }, {
- name: "scrolldown",
- description: "Scroll down",
- bindKey: bindKey("Ctrl-Down", null),
- exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },
- readOnly: true
- }, {
- name: "selectlinestart",
- description: "Select line start",
- bindKey: "Shift-Home",
- exec: function (editor) { editor.getSelection().selectLineStart(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "selectlineend",
- description: "Select line end",
- bindKey: "Shift-End",
- exec: function (editor) { editor.getSelection().selectLineEnd(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "togglerecording",
- description: "Toggle recording",
- bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"),
- exec: function (editor) { editor.commands.toggleRecording(editor); },
- readOnly: true
- }, {
- name: "replaymacro",
- description: "Replay macro",
- bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"),
- exec: function (editor) { editor.commands.replay(editor); },
- readOnly: true
- }, {
- name: "jumptomatching",
- description: "Jump to matching",
- bindKey: bindKey("Ctrl-\\|Ctrl-P", "Command-\\"),
- exec: function (editor) { editor.jumpToMatching(); },
- multiSelectAction: "forEach",
- scrollIntoView: "animate",
- readOnly: true
- }, {
- name: "selecttomatching",
- description: "Select to matching",
- bindKey: bindKey("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"),
- exec: function (editor) { editor.jumpToMatching(true); },
- multiSelectAction: "forEach",
- scrollIntoView: "animate",
- readOnly: true
- }, {
- name: "expandToMatching",
- description: "Expand to matching",
- bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"),
- exec: function (editor) { editor.jumpToMatching(true, true); },
- multiSelectAction: "forEach",
- scrollIntoView: "animate",
- readOnly: true
- }, {
- name: "passKeysToBrowser",
- description: "Pass keys to browser",
- bindKey: bindKey(null, null),
- exec: function () { },
- passEvent: true,
- readOnly: true
- }, {
- name: "copy",
- description: "Copy",
- exec: function (editor) {
+ EditSession.prototype.screenToDocumentColumn = function (screenRow, screenColumn) {
+ return this.screenToDocumentPosition(screenRow, screenColumn).column;
+ };
+ EditSession.prototype.screenToDocumentPosition = function (screenRow, screenColumn, offsetX) {
+ if (screenRow < 0)
+ return { row: 0, column: 0 };
+ var line;
+ var docRow = 0;
+ var docColumn = 0;
+ var column;
+ var row = 0;
+ var rowLength = 0;
+ var rowCache = this.$screenRowCache;
+ var i = this.$getRowCacheIndex(rowCache, screenRow);
+ var l = rowCache.length;
+ if (l && i >= 0) {
+ var row = rowCache[i];
+ var docRow = this.$docRowCache[i];
+ var doCache = screenRow > rowCache[l - 1];
+ }
+ else {
+ var doCache = !l;
+ }
+ var maxRow = this.getLength() - 1;
+ var foldLine = this.getNextFoldLine(docRow);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+ while (row <= screenRow) {
+ rowLength = this.getRowLength(docRow);
+ if (row + rowLength > screenRow || docRow >= maxRow) {
+ break;
+ }
+ else {
+ row += rowLength;
+ docRow++;
+ if (docRow > foldStart) {
+ docRow = foldLine.end.row + 1;
+ foldLine = this.getNextFoldLine(docRow, foldLine);
+ foldStart = foldLine ? foldLine.start.row : Infinity;
+ }
+ }
+ if (doCache) {
+ this.$docRowCache.push(docRow);
+ this.$screenRowCache.push(row);
+ }
+ }
+ if (foldLine && foldLine.start.row <= docRow) {
+ line = this.getFoldDisplayLine(foldLine);
+ docRow = foldLine.start.row;
+ }
+ else if (row + rowLength <= screenRow || docRow > maxRow) {
+ return {
+ row: maxRow,
+ column: this.getLine(maxRow).length
+ };
+ }
+ else {
+ line = this.getLine(docRow);
+ foldLine = null;
+ }
+ var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);
+ if (this.$useWrapMode) {
+ var splits = this.$wrapData[docRow];
+ if (splits) {
+ column = splits[splitIndex];
+ if (splitIndex > 0 && splits.length) {
+ wrapIndent = splits.indent;
+ docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
+ line = line.substring(docColumn);
+ }
+ }
+ }
+ if (offsetX !== undefined && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))
+ screenColumn = this.$bidiHandler.offsetToCol(offsetX);
+ docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];
+ if (this.$useWrapMode && docColumn >= column)
+ docColumn = column - 1;
+ if (foldLine)
+ return foldLine.idxToPosition(docColumn);
+ return { row: docRow, column: docColumn };
+ };
+ EditSession.prototype.documentToScreenPosition = function (docRow, docColumn) {
+ if (typeof docColumn === "undefined")
+ var pos = this.$clipPositionToDocument(/**@type{Point}*/ (docRow).row, /**@type{Point}*/ (docRow).column);
+ else
+ pos = this.$clipPositionToDocument(/**@type{number}*/ (docRow), docColumn);
+ docRow = pos.row;
+ docColumn = pos.column;
+ var screenRow = 0;
+ var foldStartRow = null;
+ var fold = null;
+ fold = this.getFoldAt(docRow, docColumn, 1);
+ if (fold) {
+ docRow = fold.start.row;
+ docColumn = fold.start.column;
+ }
+ var rowEnd, row = 0;
+ var rowCache = this.$docRowCache;
+ var i = this.$getRowCacheIndex(rowCache, docRow);
+ var l = rowCache.length;
+ if (l && i >= 0) {
+ var row = rowCache[i];
+ var screenRow = this.$screenRowCache[i];
+ var doCache = docRow > rowCache[l - 1];
+ }
+ else {
+ var doCache = !l;
+ }
+ var foldLine = this.getNextFoldLine(row);
+ var foldStart = foldLine ? foldLine.start.row : Infinity;
+ while (row < docRow) {
+ if (row >= foldStart) {
+ rowEnd = foldLine.end.row + 1;
+ if (rowEnd > docRow)
+ break;
+ foldLine = this.getNextFoldLine(rowEnd, foldLine);
+ foldStart = foldLine ? foldLine.start.row : Infinity;
+ }
+ else {
+ rowEnd = row + 1;
+ }
+ screenRow += this.getRowLength(row);
+ row = rowEnd;
+ if (doCache) {
+ this.$docRowCache.push(row);
+ this.$screenRowCache.push(screenRow);
+ }
+ }
+ var textLine = "";
+ if (foldLine && row >= foldStart) {
+ textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);
+ foldStartRow = foldLine.start.row;
+ }
+ else {
+ textLine = this.getLine(docRow).substring(0, docColumn);
+ foldStartRow = docRow;
+ }
+ var wrapIndent = 0;
+ if (this.$useWrapMode) {
+ var wrapRow = this.$wrapData[foldStartRow];
+ if (wrapRow) {
+ var screenRowOffset = 0;
+ while (textLine.length >= wrapRow[screenRowOffset]) {
+ screenRow++;
+ screenRowOffset++;
+ }
+ textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);
+ wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
+ }
+ }
+ if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)
+ screenRow += this.lineWidgets[row].rowsAbove;
+ return {
+ row: screenRow,
+ column: wrapIndent + this.$getStringScreenWidth(textLine)[0]
+ };
+ };
+ EditSession.prototype.documentToScreenColumn = function (row, docColumn) {
+ return this.documentToScreenPosition(row, docColumn).column;
+ };
+ EditSession.prototype.documentToScreenRow = function (docRow, docColumn) {
+ return this.documentToScreenPosition(docRow, docColumn).row;
+ };
+ EditSession.prototype.getScreenLength = function () {
+ var screenRows = 0;
+ var fold = null;
+ if (!this.$useWrapMode) {
+ screenRows = this.getLength();
+ var foldData = this.$foldData;
+ for (var i = 0; i < foldData.length; i++) {
+ fold = foldData[i];
+ screenRows -= fold.end.row - fold.start.row;
+ }
+ }
+ else {
+ var lastRow = this.$wrapData.length;
+ var row = 0, i = 0;
+ var fold = this.$foldData[i++];
+ var foldStart = fold ? fold.start.row : Infinity;
+ while (row < lastRow) {
+ var splits = this.$wrapData[row];
+ screenRows += splits ? splits.length + 1 : 1;
+ row++;
+ if (row > foldStart) {
+ row = fold.end.row + 1;
+ fold = this.$foldData[i++];
+ foldStart = fold ? fold.start.row : Infinity;
+ }
+ }
+ }
+ if (this.lineWidgets)
+ screenRows += this.$getWidgetScreenLength();
+ return screenRows;
+ };
+ EditSession.prototype.$setFontMetrics = function (fm) {
+ if (!this.$enableVarChar)
+ return;
+ this.$getStringScreenWidth = function (str, maxScreenColumn, screenColumn) {
+ if (maxScreenColumn === 0)
+ return [0, 0];
+ if (!maxScreenColumn)
+ maxScreenColumn = Infinity;
+ screenColumn = screenColumn || 0;
+ var c, column;
+ for (column = 0; column < str.length; column++) {
+ c = str.charAt(column);
+ if (c === "\t") {
+ screenColumn += this.getScreenTabSize(screenColumn);
+ }
+ else {
+ screenColumn += fm.getCharacterWidth(c);
+ }
+ if (screenColumn > maxScreenColumn) {
+ break;
+ }
+ }
+ return [screenColumn, column];
+ };
+ };
+ EditSession.prototype.getPrecedingCharacter = function () {
+ var pos = this.selection.getCursor();
+ if (pos.column === 0) {
+ return pos.row === 0 ? "" : this.doc.getNewLineCharacter();
+ }
+ var currentLine = this.getLine(pos.row);
+ return currentLine[pos.column - 1];
+ };
+ EditSession.prototype.destroy = function () {
+ if (!this.destroyed) {
+ this.bgTokenizer.setDocument(null);
+ this.bgTokenizer.cleanup();
+ this.destroyed = true;
+ }
+ this.endOperation();
+ this.$stopWorker();
+ this.removeAllListeners();
+ if (this.doc) {
+ this.doc.off("change", this.$onChange);
+ }
+ if (this.selection) {
+ this.selection.off("changeCursor", this.$onSelectionChange);
+ this.selection.off("changeSelection", this.$onSelectionChange);
+ }
+ this.selection.detach();
+ };
+ return EditSession;
+}());
+EditSession.$uid = 0;
+EditSession.prototype.$modes = config.$modes;
+EditSession.prototype.getValue = EditSession.prototype.toString;
+EditSession.prototype.$defaultUndoManager = {
+ undo: function () { },
+ redo: function () { },
+ hasUndo: function () { },
+ hasRedo: function () { },
+ reset: function () { },
+ add: function () { },
+ addSelection: function () { },
+ startNewGroup: function () { },
+ addSession: function () { }
+};
+EditSession.prototype.$overwrite = false;
+EditSession.prototype.$mode = null;
+EditSession.prototype.$modeId = null;
+EditSession.prototype.$scrollTop = 0;
+EditSession.prototype.$scrollLeft = 0;
+EditSession.prototype.$wrapLimit = 80;
+EditSession.prototype.$useWrapMode = false;
+EditSession.prototype.$wrapLimitRange = {
+ min: null,
+ max: null
+};
+EditSession.prototype.lineWidgets = null;
+EditSession.prototype.isFullWidth = isFullWidth;
+oop.implement(EditSession.prototype, EventEmitter);
+var CHAR = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;
+function isFullWidth(c) {
+ if (c < 0x1100)
+ return false;
+ return c >= 0x1100 && c <= 0x115F ||
+ c >= 0x11A3 && c <= 0x11A7 ||
+ c >= 0x11FA && c <= 0x11FF ||
+ c >= 0x2329 && c <= 0x232A ||
+ c >= 0x2E80 && c <= 0x2E99 ||
+ c >= 0x2E9B && c <= 0x2EF3 ||
+ c >= 0x2F00 && c <= 0x2FD5 ||
+ c >= 0x2FF0 && c <= 0x2FFB ||
+ c >= 0x3000 && c <= 0x303E ||
+ c >= 0x3041 && c <= 0x3096 ||
+ c >= 0x3099 && c <= 0x30FF ||
+ c >= 0x3105 && c <= 0x312D ||
+ c >= 0x3131 && c <= 0x318E ||
+ c >= 0x3190 && c <= 0x31BA ||
+ c >= 0x31C0 && c <= 0x31E3 ||
+ c >= 0x31F0 && c <= 0x321E ||
+ c >= 0x3220 && c <= 0x3247 ||
+ c >= 0x3250 && c <= 0x32FE ||
+ c >= 0x3300 && c <= 0x4DBF ||
+ c >= 0x4E00 && c <= 0xA48C ||
+ c >= 0xA490 && c <= 0xA4C6 ||
+ c >= 0xA960 && c <= 0xA97C ||
+ c >= 0xAC00 && c <= 0xD7A3 ||
+ c >= 0xD7B0 && c <= 0xD7C6 ||
+ c >= 0xD7CB && c <= 0xD7FB ||
+ c >= 0xF900 && c <= 0xFAFF ||
+ c >= 0xFE10 && c <= 0xFE19 ||
+ c >= 0xFE30 && c <= 0xFE52 ||
+ c >= 0xFE54 && c <= 0xFE66 ||
+ c >= 0xFE68 && c <= 0xFE6B ||
+ c >= 0xFF01 && c <= 0xFF60 ||
+ c >= 0xFFE0 && c <= 0xFFE6;
+}
+require("./edit_session/folding").Folding.call(EditSession.prototype);
+require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
+config.defineOptions(EditSession.prototype, "session", {
+ wrap: {
+ set: function (value) {
+ if (!value || value == "off")
+ value = false;
+ else if (value == "free")
+ value = true;
+ else if (value == "printMargin")
+ value = -1;
+ else if (typeof value == "string")
+ value = parseInt(value, 10) || false;
+ if (this.$wrap == value)
+ return;
+ this.$wrap = value;
+ if (!value) {
+ this.setUseWrapMode(false);
+ }
+ else {
+ var col = typeof value == "number" ? value : null;
+ this.setWrapLimitRange(col, col);
+ this.setUseWrapMode(true);
+ }
+ },
+ get: function () {
+ if (this.getUseWrapMode()) {
+ if (this.$wrap == -1)
+ return "printMargin";
+ if (!this.getWrapLimitRange().min)
+ return "free";
+ return this.$wrap;
+ }
+ return "off";
+ },
+ handlesSet: true
+ },
+ wrapMethod: {
+ set: function (val) {
+ val = val == "auto"
+ ? this.$mode.type != "text"
+ : val != "text";
+ if (val != this.$wrapAsCode) {
+ this.$wrapAsCode = val;
+ if (this.$useWrapMode) {
+ this.$useWrapMode = false;
+ this.setUseWrapMode(true);
+ }
+ }
+ },
+ initialValue: "auto"
+ },
+ indentedSoftWrap: {
+ set: function () {
+ if (this.$useWrapMode) {
+ this.$useWrapMode = false;
+ this.setUseWrapMode(true);
+ }
},
- readOnly: true
+ initialValue: true
},
- {
- name: "cut",
- description: "Cut",
- exec: function (editor) {
- var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();
- var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();
- editor._emit("cut", range);
- if (!range.isEmpty())
- editor.session.remove(range);
- editor.clearSelection();
+ firstLineNumber: {
+ set: function () { this._signal("changeBreakpoint"); },
+ initialValue: 1
+ },
+ useWorker: {
+ set: function (useWorker) {
+ this.$useWorker = useWorker;
+ this.$stopWorker();
+ if (useWorker)
+ this.$startWorker();
},
- scrollIntoView: "cursor",
- multiSelectAction: "forEach"
- }, {
- name: "paste",
- description: "Paste",
- exec: function (editor, args) {
- editor.$handlePaste(args);
+ initialValue: true
+ },
+ useSoftTabs: { initialValue: true },
+ tabSize: {
+ set: function (tabSize) {
+ tabSize = parseInt(tabSize);
+ if (tabSize > 0 && this.$tabSize !== tabSize) {
+ this.$modified = true;
+ this.$rowLengthCache = [];
+ this.$tabSize = tabSize;
+ this._signal("changeTabSize");
+ }
},
- scrollIntoView: "cursor"
- }, {
- name: "removeline",
- description: "Remove line",
- bindKey: bindKey("Ctrl-D", "Command-D"),
- exec: function (editor) { editor.removeLines(); },
- scrollIntoView: "cursor",
- multiSelectAction: "forEachLine"
- }, {
- name: "duplicateSelection",
- description: "Duplicate selection",
- bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
- exec: function (editor) { editor.duplicateSelection(); },
- scrollIntoView: "cursor",
- multiSelectAction: "forEach"
- }, {
- name: "sortlines",
- description: "Sort lines",
- bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
- exec: function (editor) { editor.sortLines(); },
- scrollIntoView: "selection",
- multiSelectAction: "forEachLine"
- }, {
- name: "togglecomment",
- description: "Toggle comment",
- bindKey: bindKey("Ctrl-/", "Command-/"),
- exec: function (editor) { editor.toggleCommentLines(); },
- multiSelectAction: "forEachLine",
- scrollIntoView: "selectionPart"
- }, {
- name: "toggleBlockComment",
- description: "Toggle block comment",
- bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
- exec: function (editor) { editor.toggleBlockComment(); },
- multiSelectAction: "forEach",
- scrollIntoView: "selectionPart"
- }, {
- name: "modifyNumberUp",
- description: "Modify number up",
- bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
- exec: function (editor) { editor.modifyNumber(1); },
- scrollIntoView: "cursor",
- multiSelectAction: "forEach"
- }, {
- name: "modifyNumberDown",
- description: "Modify number down",
- bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"),
- exec: function (editor) { editor.modifyNumber(-1); },
- scrollIntoView: "cursor",
- multiSelectAction: "forEach"
- }, {
- name: "replace",
- description: "Replace",
- bindKey: bindKey("Ctrl-H", "Command-Option-F"),
- exec: function (editor) {
- config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor, true); });
+ initialValue: 4,
+ handlesSet: true
+ },
+ navigateWithinSoftTabs: { initialValue: false },
+ foldStyle: {
+ set: function (val) { this.setFoldStyle(val); },
+ handlesSet: true
+ },
+ overwrite: {
+ set: function (val) { this._signal("changeOverwrite"); },
+ initialValue: false
+ },
+ newLineMode: {
+ set: function (val) { this.doc.setNewLineMode(val); },
+ get: function () { return this.doc.getNewLineMode(); },
+ handlesSet: true
+ },
+ mode: {
+ set: function (val) { this.setMode(val); },
+ get: function () { return this.$modeId; },
+ handlesSet: true
+ }
+});
+exports.EditSession = EditSession;
+
+});
+
+ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"], function(require, exports, module){"use strict";
+var lang = require("./lib/lang");
+var oop = require("./lib/oop");
+var Range = require("./range").Range;
+var Search = /** @class */ (function () {
+ function Search() {
+ this.$options = {};
+ }
+ Search.prototype.set = function (options) {
+ oop.mixin(this.$options, options);
+ return this;
+ };
+ Search.prototype.getOptions = function () {
+ return lang.copyObject(this.$options);
+ };
+ Search.prototype.setOptions = function (options) {
+ this.$options = options;
+ };
+ Search.prototype.find = function (session) {
+ var options = this.$options;
+ var iterator = this.$matchIterator(session, options);
+ if (!iterator)
+ return false;
+ var firstRange = null;
+ iterator.forEach(function (sr, sc, er, ec) {
+ firstRange = new Range(sr, sc, er, ec);
+ if (sc == ec && options.start && /**@type{Range}*/ (options.start).start
+ && options.skipCurrent != false && firstRange.isEqual(/**@type{Range}*/ (options.start))) {
+ firstRange = null;
+ return false;
+ }
+ return true;
+ });
+ return firstRange;
+ };
+ Search.prototype.findAll = function (session) {
+ var options = this.$options;
+ if (!options.needle)
+ return [];
+ this.$assembleRegExp(options);
+ var range = options.range;
+ var lines = range
+ ? session.getLines(range.start.row, range.end.row)
+ : session.doc.getAllLines();
+ var ranges = [];
+ var re = options.re;
+ if (options.$isMultiLine) {
+ var len = re.length;
+ var maxRow = lines.length - len;
+ var prevRange;
+ outer: for (var row = re.offset || 0; row <= maxRow; row++) {
+ for (var j = 0; j < len; j++)
+ if (lines[row + j].search(re[j]) == -1)
+ continue outer;
+ var startLine = lines[row];
+ var line = lines[row + len - 1];
+ var startIndex = startLine.length - startLine.match(re[0])[0].length;
+ var endIndex = line.match(re[len - 1])[0].length;
+ if (prevRange && prevRange.end.row === row &&
+ prevRange.end.column > startIndex) {
+ continue;
+ }
+ ranges.push(prevRange = new Range(row, startIndex, row + len - 1, endIndex));
+ if (len > 2)
+ row = row + len - 2;
+ }
}
- }, {
- name: "undo",
- description: "Undo",
- bindKey: bindKey("Ctrl-Z", "Command-Z"),
- exec: function (editor) { editor.undo(); }
- }, {
- name: "redo",
- description: "Redo",
- bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
- exec: function (editor) { editor.redo(); }
- }, {
- name: "copylinesup",
- description: "Copy lines up",
- bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
- exec: function (editor) { editor.copyLinesUp(); },
- scrollIntoView: "cursor"
- }, {
- name: "movelinesup",
- description: "Move lines up",
- bindKey: bindKey("Alt-Up", "Option-Up"),
- exec: function (editor) { editor.moveLinesUp(); },
- scrollIntoView: "cursor"
- }, {
- name: "copylinesdown",
- description: "Copy lines down",
- bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
- exec: function (editor) { editor.copyLinesDown(); },
- scrollIntoView: "cursor"
- }, {
- name: "movelinesdown",
- description: "Move lines down",
- bindKey: bindKey("Alt-Down", "Option-Down"),
- exec: function (editor) { editor.moveLinesDown(); },
- scrollIntoView: "cursor"
- }, {
- name: "del",
- description: "Delete",
- bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
- exec: function (editor) { editor.remove("right"); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "backspace",
- description: "Backspace",
- bindKey: bindKey("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
- exec: function (editor) { editor.remove("left"); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "cut_or_delete",
- description: "Cut or delete",
- bindKey: bindKey("Shift-Delete", null),
- exec: function (editor) {
- if (editor.selection.isEmpty()) {
- editor.remove("left");
+ else {
+ for (var matches, i = 0; i < lines.length; i++) {
+ if (this.$isMultilineSearch(options)) {
+ var lng = lines.length - 1;
+ matches = this.$multiLineForward(session, re, i, lng);
+ if (matches) {
+ var end_row = matches.endRow <= lng ? matches.endRow - 1 : lng;
+ if (end_row > i)
+ i = end_row;
+ ranges.push(new Range(matches.startRow, matches.startCol, matches.endRow, matches.endCol));
+ }
+ }
+ else {
+ matches = lang.getMatchOffsets(lines[i], re);
+ for (var j = 0; j < matches.length; j++) {
+ var match = matches[j];
+ ranges.push(new Range(i, match.offset, i, match.offset + match.length));
+ }
+ }
}
- else {
- return false;
+ }
+ if (range) {
+ var startColumn = range.start.column;
+ var endColumn = range.end.column;
+ var i = 0, j = ranges.length - 1;
+ while (i < j && ranges[i].start.column < startColumn && ranges[i].start.row == 0)
+ i++;
+ var endRow = range.end.row - range.start.row;
+ while (i < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)
+ j--;
+ ranges = ranges.slice(i, j + 1);
+ for (i = 0, j = ranges.length; i < j; i++) {
+ ranges[i].start.row += range.start.row;
+ ranges[i].end.row += range.start.row;
}
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removetolinestart",
- description: "Remove to line start",
- bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
- exec: function (editor) { editor.removeToLineStart(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removetolineend",
- description: "Remove to line end",
- bindKey: bindKey("Alt-Delete", "Ctrl-K|Command-Delete"),
- exec: function (editor) { editor.removeToLineEnd(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removetolinestarthard",
- description: "Remove to line start hard",
- bindKey: bindKey("Ctrl-Shift-Backspace", null),
- exec: function (editor) {
- var range = editor.selection.getRange();
- range.start.column = 0;
- editor.session.remove(range);
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removetolineendhard",
- description: "Remove to line end hard",
- bindKey: bindKey("Ctrl-Shift-Delete", null),
- exec: function (editor) {
- var range = editor.selection.getRange();
- range.end.column = Number.MAX_VALUE;
- editor.session.remove(range);
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removewordleft",
- description: "Remove word left",
- bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
- exec: function (editor) { editor.removeWordLeft(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "removewordright",
- description: "Remove word right",
- bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
- exec: function (editor) { editor.removeWordRight(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "outdent",
- description: "Outdent",
- bindKey: bindKey("Shift-Tab", "Shift-Tab"),
- exec: function (editor) { editor.blockOutdent(); },
- multiSelectAction: "forEach",
- scrollIntoView: "selectionPart"
- }, {
- name: "indent",
- description: "Indent",
- bindKey: bindKey("Tab", "Tab"),
- exec: function (editor) { editor.indent(); },
- multiSelectAction: "forEach",
- scrollIntoView: "selectionPart"
- }, {
- name: "blockoutdent",
- description: "Block outdent",
- bindKey: bindKey("Ctrl-[", "Ctrl-["),
- exec: function (editor) { editor.blockOutdent(); },
- multiSelectAction: "forEachLine",
- scrollIntoView: "selectionPart"
- }, {
- name: "blockindent",
- description: "Block indent",
- bindKey: bindKey("Ctrl-]", "Ctrl-]"),
- exec: function (editor) { editor.blockIndent(); },
- multiSelectAction: "forEachLine",
- scrollIntoView: "selectionPart"
- }, {
- name: "insertstring",
- description: "Insert string",
- exec: function (editor, str) { editor.insert(str); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "inserttext",
- description: "Insert text",
- exec: function (editor, args) {
- editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "splitline",
- description: "Split line",
- bindKey: bindKey(null, "Ctrl-O"),
- exec: function (editor) { editor.splitLine(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "transposeletters",
- description: "Transpose letters",
- bindKey: bindKey("Alt-Shift-X", "Ctrl-T"),
- exec: function (editor) { editor.transposeLetters(); },
- multiSelectAction: function (editor) { editor.transposeSelections(1); },
- scrollIntoView: "cursor"
- }, {
- name: "touppercase",
- description: "To uppercase",
- bindKey: bindKey("Ctrl-U", "Ctrl-U"),
- exec: function (editor) { editor.toUpperCase(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "tolowercase",
- description: "To lowercase",
- bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
- exec: function (editor) { editor.toLowerCase(); },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "autoindent",
- description: "Auto Indent",
- bindKey: bindKey(null, null),
- exec: function (editor) { editor.autoIndent(); },
- scrollIntoView: "animate"
- }, {
- name: "expandtoline",
- description: "Expand to line",
- bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"),
- exec: function (editor) {
- var range = editor.selection.getRange();
- range.start.column = range.end.column = 0;
- range.end.row++;
- editor.selection.setRange(range, false);
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor",
- readOnly: true
- }, {
- name: "openlink",
- bindKey: bindKey("Ctrl+F3", "F3"),
- exec: function (editor) { editor.openLink(); }
- }, {
- name: "joinlines",
- description: "Join lines",
- bindKey: bindKey(null, null),
- exec: function (editor) {
- var isBackwards = editor.selection.isBackwards();
- var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();
- var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();
- var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;
- var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());
- var selectedCount = selectedText.replace(/\n\s*/, " ").length;
- var insertLine = editor.session.doc.getLine(selectionStart.row);
- for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {
- var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));
- if (curLine.length !== 0) {
- curLine = " " + curLine;
+ }
+ return ranges;
+ };
+ Search.prototype.parseReplaceString = function (replaceString) {
+ var CharCode = {
+ DollarSign: 36,
+ Ampersand: 38,
+ Digit0: 48,
+ Digit1: 49,
+ Digit9: 57,
+ Backslash: 92,
+ n: 110,
+ t: 116
+ };
+ var replacement = '';
+ for (var i = 0, len = replaceString.length; i < len; i++) {
+ var chCode = replaceString.charCodeAt(i);
+ if (chCode === CharCode.Backslash) {
+ i++;
+ if (i >= len) {
+ replacement += "\\";
+ break;
}
- insertLine += curLine;
+ var nextChCode = replaceString.charCodeAt(i);
+ switch (nextChCode) {
+ case CharCode.Backslash:
+ replacement += "\\";
+ break;
+ case CharCode.n:
+ replacement += "\n";
+ break;
+ case CharCode.t:
+ replacement += "\t";
+ break;
+ }
+ continue;
}
- if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {
- insertLine += editor.session.doc.getNewLineCharacter();
+ if (chCode === CharCode.DollarSign) {
+ i++;
+ if (i >= len) {
+ replacement += "$";
+ break;
+ }
+ var nextChCode_1 = replaceString.charCodeAt(i);
+ if (nextChCode_1 === CharCode.DollarSign) {
+ replacement += "$$";
+ continue;
+ }
+ if (nextChCode_1 === CharCode.Digit0 || nextChCode_1 === CharCode.Ampersand) {
+ replacement += "$&";
+ continue;
+ }
+ if (CharCode.Digit1 <= nextChCode_1 && nextChCode_1 <= CharCode.Digit9) {
+ replacement += "$" + replaceString[i];
+ continue;
+ }
+ }
+ replacement += replaceString[i];
+ }
+ return replacement || replaceString;
+ };
+ Search.prototype.replace = function (input, replacement) {
+ var options = this.$options;
+ var re = this.$assembleRegExp(options);
+ if (options.$isMultiLine)
+ return replacement;
+ if (!re)
+ return;
+ var mtSearch = this.$isMultilineSearch(options);
+ if (mtSearch)
+ input = input.replace(/\r\n|\r|\n/g, "\n");
+ var match = re.exec(input);
+ if (!match || (!mtSearch && match[0].length != input.length))
+ return null;
+ replacement = options.regExp
+ ? this.parseReplaceString(replacement)
+ : replacement.replace(/\$/g, "$$$$");
+ replacement = input.replace(re, replacement);
+ if (options.preserveCase) {
+ replacement = replacement.split("");
+ for (var i = Math.min(input.length, input.length); i--;) {
+ var ch = input[i];
+ if (ch && ch.toLowerCase() != ch)
+ replacement[i] = replacement[i].toUpperCase();
+ else
+ replacement[i] = replacement[i].toLowerCase();
+ }
+ replacement = replacement.join("");
+ }
+ return replacement;
+ };
+ Search.prototype.$assembleRegExp = function (options, $disableFakeMultiline) {
+ if (options.needle instanceof RegExp)
+ return options.re = options.needle;
+ var needle = options.needle;
+ if (!options.needle)
+ return options.re = false;
+ if (!options.regExp)
+ needle = lang.escapeRegExp(needle);
+ var modifier = options.caseSensitive ? "gm" : "gmi";
+ try {
+ new RegExp(needle, "u");
+ options.$supportsUnicodeFlag = true;
+ modifier += "u";
+ }
+ catch (e) {
+ options.$supportsUnicodeFlag = false; //left for backward compatibility with previous versions for cases like /ab\{2}/gu
+ }
+ if (options.wholeWord)
+ needle = addWordBoundary(needle, options);
+ options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle);
+ if (options.$isMultiLine)
+ return options.re = this.$assembleMultilineRegExp(needle, modifier);
+ try {
+ var re = new RegExp(needle, modifier);
+ }
+ catch (e) {
+ re = false;
+ }
+ return options.re = re;
+ };
+ Search.prototype.$assembleMultilineRegExp = function (needle, modifier) {
+ var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n");
+ var re = [];
+ for (var i = 0; i < parts.length; i++)
+ try {
+ re.push(new RegExp(parts[i], modifier));
}
- editor.clearSelection();
- editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);
- if (selectedCount > 0) {
- editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);
- editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);
+ catch (e) {
+ return false;
}
- else {
- firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;
- editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);
+ return re;
+ };
+ Search.prototype.$isMultilineSearch = function (options) {
+ return options.re && /\\r\\n|\\r|\\n/.test(options.re.source) && options.regExp && !options.$isMultiLine;
+ };
+ Search.prototype.$multiLineForward = function (session, re, start, last) {
+ var line, chunk = chunkEnd(session, start);
+ for (var row = start; row <= last;) {
+ for (var i = 0; i < chunk; i++) {
+ if (row > last)
+ break;
+ var next = session.getLine(row++);
+ line = line == null ? next : line + "\n" + next;
+ }
+ var match = re.exec(line);
+ re.lastIndex = 0;
+ if (match) {
+ var beforeMatch = line.slice(0, match.index).split("\n");
+ var matchedText = match[0].split("\n");
+ var startRow = start + beforeMatch.length - 1;
+ var startCol = beforeMatch[beforeMatch.length - 1].length;
+ var endRow = startRow + matchedText.length - 1;
+ var endCol = matchedText.length == 1
+ ? startCol + matchedText[0].length
+ : matchedText[matchedText.length - 1].length;
+ return {
+ startRow: startRow,
+ startCol: startCol,
+ endRow: endRow,
+ endCol: endCol
+ };
}
- },
- multiSelectAction: "forEach",
- readOnly: true
- }, {
- name: "invertSelection",
- description: "Invert selection",
- bindKey: bindKey(null, null),
- exec: function (editor) {
- var endRow = editor.session.doc.getLength() - 1;
- var endCol = editor.session.doc.getLine(endRow).length;
- var ranges = editor.selection.rangeList.ranges;
- var newRanges = [];
- if (ranges.length < 1) {
- ranges = [editor.selection.getRange()];
+ }
+ return null;
+ };
+ Search.prototype.$multiLineBackward = function (session, re, endIndex, start, first) {
+ var line, chunk = chunkEnd(session, start), endMargin = session.getLine(start).length - endIndex;
+ for (var row = start; row >= first;) {
+ for (var i = 0; i < chunk && row >= first; i++) {
+ var next = session.getLine(row--);
+ line = line == null ? next : next + "\n" + line;
+ }
+ var match = multiLineBackwardMatch(line, re, endMargin);
+ if (match) {
+ var beforeMatch = line.slice(0, match.index).split("\n");
+ var matchedText = match[0].split("\n");
+ var startRow = row + beforeMatch.length;
+ var startCol = beforeMatch[beforeMatch.length - 1].length;
+ var endRow = startRow + matchedText.length - 1;
+ var endCol = matchedText.length == 1
+ ? startCol + matchedText[0].length
+ : matchedText[matchedText.length - 1].length;
+ return {
+ startRow: startRow,
+ startCol: startCol,
+ endRow: endRow,
+ endCol: endCol
+ };
}
- for (var i = 0; i < ranges.length; i++) {
- if (i == (ranges.length - 1)) {
- if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {
- newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));
+ }
+ return null;
+ };
+ Search.prototype.$matchIterator = function (session, options) {
+ var re = this.$assembleRegExp(options);
+ if (!re)
+ return false;
+ var mtSearch = this.$isMultilineSearch(options);
+ var mtForward = this.$multiLineForward;
+ var mtBackward = this.$multiLineBackward;
+ var backwards = options.backwards == true;
+ var skipCurrent = options.skipCurrent != false;
+ var supportsUnicodeFlag = re.unicode;
+ var range = options.range;
+ var start = options.start;
+ if (!start)
+ start = range ? range[backwards ? "end" : "start"] : session.selection.getRange();
+ if (start.start)
+ start = start[skipCurrent != backwards ? "end" : "start"];
+ var firstRow = range ? range.start.row : 0;
+ var lastRow = range ? range.end.row : session.getLength() - 1;
+ if (backwards) {
+ var forEach = function (callback) {
+ var row = start.row;
+ if (forEachInLine(row, start.column, callback))
+ return;
+ for (row--; row >= firstRow; row--)
+ if (forEachInLine(row, Number.MAX_VALUE, callback))
+ return;
+ if (options.wrap == false)
+ return;
+ for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
+ if (forEachInLine(row, Number.MAX_VALUE, callback))
+ return;
+ };
+ }
+ else {
+ var forEach = function (callback) {
+ var row = start.row;
+ if (forEachInLine(row, start.column, callback))
+ return;
+ for (row = row + 1; row <= lastRow; row++)
+ if (forEachInLine(row, 0, callback))
+ return;
+ if (options.wrap == false)
+ return;
+ for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
+ if (forEachInLine(row, 0, callback))
+ return;
+ };
+ }
+ if (options.$isMultiLine) {
+ var len = re.length;
+ var forEachInLine = function (row, offset, callback) {
+ var startRow = backwards ? row - len + 1 : row;
+ if (startRow < 0 || startRow + len > session.getLength())
+ return;
+ var line = session.getLine(startRow);
+ var startIndex = line.search(re[0]);
+ if (!backwards && startIndex < offset || startIndex === -1)
+ return;
+ for (var i = 1; i < len; i++) {
+ line = session.getLine(startRow + i);
+ if (line.search(re[i]) == -1)
+ return;
+ }
+ var endIndex = line.match(re[len - 1])[0].length;
+ if (backwards && endIndex > offset)
+ return;
+ if (callback(startRow, startIndex, startRow + len - 1, endIndex))
+ return true;
+ };
+ }
+ else if (backwards) {
+ var forEachInLine = function (row, endIndex, callback) {
+ if (mtSearch) {
+ var pos = mtBackward(session, re, endIndex, row, firstRow);
+ if (!pos)
+ return false;
+ if (callback(pos.startRow, pos.startCol, pos.endRow, pos.endCol))
+ return true;
+ }
+ else {
+ var line = session.getLine(row);
+ var matches = [];
+ var m, last = 0;
+ re.lastIndex = 0;
+ while ((m = re.exec(line))) {
+ var length = m[0].length;
+ last = m.index;
+ if (!length) {
+ if (last >= line.length)
+ break;
+ re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);
+ }
+ if (m.index + length > endIndex)
+ break;
+ matches.push(m.index, length);
+ }
+ for (var i = matches.length - 1; i >= 0; i -= 2) {
+ var column = matches[i - 1];
+ var length = matches[i];
+ if (callback(row, column, row, column + length))
+ return true;
}
}
- if (i === 0) {
- if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {
- newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));
+ };
+ }
+ else {
+ var forEachInLine = function (row, startIndex, callback) {
+ re.lastIndex = startIndex;
+ if (mtSearch) {
+ var pos = mtForward(session, re, row, lastRow);
+ if (pos) {
+ var end_row = pos.endRow <= lastRow ? pos.endRow - 1 : lastRow;
+ if (end_row > row)
+ row = end_row;
}
+ if (!pos)
+ return false;
+ if (callback(pos.startRow, pos.startCol, pos.endRow, pos.endCol))
+ return true;
}
else {
- newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column));
+ var line = session.getLine(row);
+ var last;
+ var m;
+ while ((m = re.exec(line))) {
+ var length = m[0].length;
+ last = m.index;
+ if (callback(row, last, row, last + length))
+ return true;
+ if (!length) {
+ re.lastIndex = last += lang.skipEmptyMatch(line, last, supportsUnicodeFlag);
+ if (last >= line.length)
+ return false;
+ }
+ }
}
+ };
+ }
+ return { forEach: forEach };
+ };
+ return Search;
+}());
+function addWordBoundary(needle, options) {
+ var supportsLookbehind = lang.supportsLookbehind();
+ function wordBoundary(c, firstChar) {
+ if (firstChar === void 0) { firstChar = true; }
+ var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp("[\\p{L}\\p{N}_]", "u") : new RegExp("\\w");
+ if (wordRegExp.test(c) || options.regExp) {
+ if (supportsLookbehind && options.$supportsUnicodeFlag) {
+ if (firstChar)
+ return "(?<=^|[^\\p{L}\\p{N}_])";
+ return "(?=[^\\p{L}\\p{N}_]|$)";
}
- editor.exitMultiSelectMode();
- editor.clearSelection();
- for (var i = 0; i < newRanges.length; i++) {
- editor.selection.addRange(newRanges[i], false);
- }
- },
- readOnly: true,
- scrollIntoView: "none"
- }, {
- name: "addLineAfter",
- description: "Add new line after the current line",
- exec: function (editor) {
- editor.selection.clearSelection();
- editor.navigateLineEnd();
- editor.insert("\n");
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "addLineBefore",
- description: "Add new line before the current line",
- exec: function (editor) {
- editor.selection.clearSelection();
- var cursor = editor.getCursorPosition();
- editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);
- editor.insert("\n");
- if (cursor.row === 0)
- editor.navigateUp();
- },
- multiSelectAction: "forEach",
- scrollIntoView: "cursor"
- }, {
- name: "openCommandPallete",
- exec: function (editor) {
- console.warn("This is an obsolete command. Please use `openCommandPalette` instead.");
- editor.prompt({ $type: "commands" });
- },
- readOnly: true
- }, {
- name: "openCommandPalette",
- description: "Open command palette",
- bindKey: bindKey("F1", "F1"),
- exec: function (editor) {
- editor.prompt({ $type: "commands" });
- },
- readOnly: true
- }, {
- name: "modeSelect",
- description: "Change language mode...",
- bindKey: bindKey(null, null),
- exec: function (editor) {
- editor.prompt({ $type: "modes" });
- },
- readOnly: true
- }];
-for (var i = 1; i < 9; i++) {
- exports.commands.push({
- name: "foldToLevel" + i,
- description: "Fold To Level " + i,
- level: i,
- exec: function (editor) { editor.session.foldToLevel(this.level); },
- scrollIntoView: "center",
- readOnly: true
- });
+ return "\\b";
+ }
+ return "";
+ }
+ var needleArray = Array.from(needle);
+ var firstChar = needleArray[0];
+ var lastChar = needleArray[needleArray.length - 1];
+ return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false);
+}
+function multiLineBackwardMatch(line, re, endMargin) {
+ var match = null;
+ var from = 0;
+ while (from <= line.length) {
+ re.lastIndex = from;
+ var newMatch = re.exec(line);
+ if (!newMatch)
+ break;
+ var end = newMatch.index + newMatch[0].length;
+ if (end > line.length - endMargin)
+ break;
+ if (!match || end > match.index + match[0].length)
+ match = newMatch;
+ from = newMatch.index + 1;
+ }
+ return match;
}
+function chunkEnd(session, start) {
+ var base = 5000, startPosition = { row: start, column: 0 }, startIndex = session.doc.positionToIndex(startPosition), targetIndex = startIndex + base, targetPosition = session.doc.indexToPosition(targetIndex), targetLine = targetPosition.row;
+ return targetLine + 1;
+}
+exports.Search = Search;
});
-ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"], function(require, exports, module){"use strict";
-var dom = require("./lib/dom");
-var LineWidgets = /** @class */ (function () {
- function LineWidgets(session) {
- this.session = session;
- this.session.widgetManager = this;
- this.session.getRowLength = this.getRowLength;
- this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;
- this.updateOnChange = this.updateOnChange.bind(this);
- this.renderWidgets = this.renderWidgets.bind(this);
- this.measureWidgets = this.measureWidgets.bind(this);
- this.session._changedWidgets = [];
- this.$onChangeEditor = this.$onChangeEditor.bind(this);
- this.session.on("change", this.updateOnChange);
- this.session.on("changeFold", this.updateOnFold);
- this.session.on("changeEditor", this.$onChangeEditor);
+ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"], function(require, exports, module){"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})(); var keyUtil = require("../lib/keys");
+var useragent = require("../lib/useragent");
+var KEY_MODS = keyUtil.KEY_MODS;
+var MultiHashHandler = /** @class */ (function () {
+ function MultiHashHandler(config, platform) {
+ this.$init(config, platform, false);
}
- LineWidgets.prototype.getRowLength = function (row) {
- var h;
- if (this.lineWidgets)
- h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
- else
- h = 0;
- if (!this["$useWrapMode"] || !this["$wrapData"][row]) {
- return 1 + h;
+ MultiHashHandler.prototype.$init = function (config, platform, $singleCommand) {
+ this.platform = platform || (useragent.isMac ? "mac" : "win");
+ this.commands = {};
+ this.commandKeyBinding = {};
+ this.addCommands(config);
+ this.$singleCommand = $singleCommand;
+ };
+ MultiHashHandler.prototype.addCommand = function (command) {
+ if (this.commands[command.name])
+ this.removeCommand(command);
+ this.commands[command.name] = command;
+ if (command.bindKey)
+ this._buildKeyHash(command);
+ };
+ MultiHashHandler.prototype.removeCommand = function (command, keepCommand) {
+ var name = command && (typeof command === 'string' ? command : command.name);
+ command = this.commands[name];
+ if (!keepCommand)
+ delete this.commands[name];
+ var ckb = this.commandKeyBinding;
+ for (var keyId in ckb) {
+ var cmdGroup = ckb[keyId];
+ if (cmdGroup == command) {
+ delete ckb[keyId];
+ }
+ else if (Array.isArray(cmdGroup)) {
+ var i = cmdGroup.indexOf(command);
+ if (i != -1) {
+ cmdGroup.splice(i, 1);
+ if (cmdGroup.length == 1)
+ ckb[keyId] = cmdGroup[0];
+ }
+ }
+ }
+ };
+ MultiHashHandler.prototype.bindKey = function (key, command, position) {
+ if (typeof key == "object" && key) {
+ if (position == undefined)
+ position = key.position;
+ key = key[this.platform];
+ }
+ if (!key)
+ return;
+ if (typeof command == "function")
+ return this.addCommand({ exec: command, bindKey: key, name: command.name || /**@type{string}*/ (key) }); (key).split("|").forEach(function (keyPart) {
+ var chain = "";
+ if (keyPart.indexOf(" ") != -1) {
+ var parts = keyPart.split(/\s+/);
+ keyPart = parts.pop();
+ parts.forEach(function (keyPart) {
+ var binding = this.parseKeys(keyPart);
+ var id = KEY_MODS[binding.hashId] + binding.key;
+ chain += (chain ? " " : "") + id;
+ this._addCommandToBinding(chain, "chainKeys");
+ }, this);
+ chain += " ";
+ }
+ var binding = this.parseKeys(keyPart);
+ var id = KEY_MODS[binding.hashId] + binding.key;
+ this._addCommandToBinding(chain + id, command, position);
+ }, this);
+ };
+ MultiHashHandler.prototype._addCommandToBinding = function (keyId, command, position) {
+ var ckb = this.commandKeyBinding, i;
+ if (!command) {
+ delete ckb[keyId];
+ }
+ else if (!ckb[keyId] || this.$singleCommand) {
+ ckb[keyId] = command;
}
else {
- return this["$wrapData"][row].length + 1 + h;
+ if (!Array.isArray(ckb[keyId])) {
+ ckb[keyId] = [ckb[keyId]];
+ }
+ else if ((i = ckb[keyId].indexOf(command)) != -1) {
+ ckb[keyId].splice(i, 1);
+ }
+ if (typeof position != "number") {
+ position = getPosition(command);
+ }
+ var commands = ckb[keyId];
+ for (i = 0; i < commands.length; i++) {
+ var other = commands[i];
+ var otherPos = getPosition(other);
+ if (otherPos > position)
+ break;
+ }
+ commands.splice(i, 0, command);
}
};
- LineWidgets.prototype.$getWidgetScreenLength = function () {
- var screenRows = 0;
- this.lineWidgets.forEach(function (w) {
- if (w && w.rowCount && !w.hidden)
- screenRows += w.rowCount;
- });
- return screenRows;
+ MultiHashHandler.prototype.addCommands = function (commands) {
+ commands && Object.keys(commands).forEach(function (name) {
+ var command = commands[name];
+ if (!command)
+ return;
+ if (typeof command === "string")
+ return this.bindKey(command, name);
+ if (typeof command === "function")
+ command = { exec: command };
+ if (typeof command !== "object")
+ return;
+ if (!command.name)
+ command.name = name;
+ this.addCommand(command);
+ }, this);
};
- LineWidgets.prototype.$onChangeEditor = function (e) {
- this.attach(e.editor);
+ MultiHashHandler.prototype.removeCommands = function (commands) {
+ Object.keys(commands).forEach(function (name) {
+ this.removeCommand(commands[name]);
+ }, this);
};
- LineWidgets.prototype.attach = function (editor) {
- if (editor && editor.widgetManager && editor.widgetManager != this)
- editor.widgetManager.detach();
- if (this.editor == editor)
- return;
- this.detach();
- this.editor = editor;
- if (editor) {
- editor.widgetManager = this;
- editor.renderer.on("beforeRender", this.measureWidgets);
- editor.renderer.on("afterRender", this.renderWidgets);
+ MultiHashHandler.prototype.bindKeys = function (keyList) {
+ Object.keys(keyList).forEach(function (key) {
+ this.bindKey(key, keyList[key]);
+ }, this);
+ };
+ MultiHashHandler.prototype._buildKeyHash = function (command) {
+ this.bindKey(command.bindKey, command);
+ };
+ MultiHashHandler.prototype.parseKeys = function (keys) {
+ var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function (x) { return x; });
+ var key = parts.pop();
+ var keyCode = keyUtil[key];
+ if (keyUtil.FUNCTION_KEYS[keyCode])
+ key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();
+ else if (!parts.length)
+ return { key: key, hashId: -1 };
+ else if (parts.length == 1 && parts[0] == "shift")
+ return { key: key.toUpperCase(), hashId: -1 };
+ var hashId = 0;
+ for (var i = parts.length; i--;) {
+ var modifier = keyUtil.KEY_MODS[parts[i]];
+ if (modifier == null) {
+ if (typeof console != "undefined")
+ console.error("invalid modifier " + parts[i] + " in " + keys);
+ return false;
+ }
+ hashId |= modifier;
}
+ return { key: key, hashId: hashId };
};
- LineWidgets.prototype.detach = function (e) {
- var editor = this.editor;
- if (!editor)
+ MultiHashHandler.prototype.findKeyCommand = function (hashId, keyString) {
+ var key = KEY_MODS[hashId] + keyString;
+ return this.commandKeyBinding[key];
+ };
+ MultiHashHandler.prototype.handleKeyboard = function (data, hashId, keyString, keyCode) {
+ if (keyCode < 0)
return;
- this.editor = null;
- editor.widgetManager = null;
- editor.renderer.off("beforeRender", this.measureWidgets);
- editor.renderer.off("afterRender", this.renderWidgets);
- var lineWidgets = this.session.lineWidgets;
- lineWidgets && lineWidgets.forEach(function (w) {
- if (w && w.el && w.el.parentNode) {
- w._inDocument = false;
- w.el.parentNode.removeChild(w.el);
+ var key = KEY_MODS[hashId] + keyString;
+ var command = this.commandKeyBinding[key];
+ if (data.$keyChain) {
+ data.$keyChain += " " + key;
+ command = this.commandKeyBinding[data.$keyChain] || command;
+ }
+ if (command) {
+ if (command == "chainKeys" || command[command.length - 1] == "chainKeys") {
+ data.$keyChain = data.$keyChain || key;
+ return { command: "null" };
+ }
+ }
+ if (data.$keyChain) {
+ if ((!hashId || hashId == 4) && keyString.length == 1)
+ data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input
+ else if (hashId == -1 || keyCode > 0)
+ data.$keyChain = ""; // reset keyChain
+ }
+ return { command: command };
+ };
+ MultiHashHandler.prototype.getStatusText = function (editor, data) {
+ return data.$keyChain || "";
+ };
+ return MultiHashHandler;
+}());
+function getPosition(command) {
+ return typeof command == "object" && command.bindKey
+ && command.bindKey.position
+ || (command.isDefault ? -100 : 0);
+}
+var HashHandler = /** @class */ (function (_super) {
+ __extends(HashHandler, _super);
+ function HashHandler(config, platform) {
+ var _this = _super.call(this, config, platform) || this;
+ _this.$singleCommand = true;
+ return _this;
+ }
+ return HashHandler;
+}(MultiHashHandler));
+HashHandler.call = function (thisArg, config, platform) {
+ MultiHashHandler.prototype.$init.call(thisArg, config, platform, true);
+};
+MultiHashHandler.call = function (thisArg, config, platform) {
+ MultiHashHandler.prototype.$init.call(thisArg, config, platform, false);
+};
+exports.HashHandler = HashHandler;
+exports.MultiHashHandler = MultiHashHandler;
+
+});
+
+ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"], function(require, exports, module){"use strict";
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var oop = require("../lib/oop");
+var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler;
+var EventEmitter = require("../lib/event_emitter").EventEmitter;
+var CommandManager = /** @class */ (function (_super) {
+ __extends(CommandManager, _super);
+ function CommandManager(platform, commands) {
+ var _this = _super.call(this, commands, platform) || this;
+ _this.byName = _this.commands;
+ _this.setDefaultHandler("exec", function (e) {
+ if (!e.args) {
+ return e.command.exec(e.editor, {}, e.event, true);
}
+ return e.command.exec(e.editor, e.args, e.event, false);
});
+ return _this;
+ }
+ CommandManager.prototype.exec = function (command, editor, args) {
+ if (Array.isArray(command)) {
+ for (var i = command.length; i--;) {
+ if (this.exec(command[i], editor, args))
+ return true;
+ }
+ return false;
+ }
+ if (typeof command === "string")
+ command = this.commands[command];
+ var e = { editor: editor, command: command, args: args };
+ if (!this.canExecute(command, editor)) {
+ this._signal("commandUnavailable", e);
+ return false;
+ }
+ e.returnValue = this._emit("exec", e);
+ this._signal("afterExec", e);
+ return e.returnValue === false ? false : true;
};
- LineWidgets.prototype.updateOnFold = function (e, session) {
- var lineWidgets = session.lineWidgets;
- if (!lineWidgets || !e.action)
+ CommandManager.prototype.canExecute = function (command, editor) {
+ if (typeof command === "string")
+ command = this.commands[command];
+ if (!command)
+ return false;
+ if (editor && editor.$readOnly && !command.readOnly)
+ return false;
+ if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))
+ return false;
+ return true;
+ };
+ CommandManager.prototype.toggleRecording = function (editor) {
+ if (this.$inReplay)
return;
- var fold = e.data;
- var start = fold.start.row;
- var end = fold.end.row;
- var hide = e.action == "add";
- for (var i = start + 1; i < end; i++) {
- if (lineWidgets[i])
- lineWidgets[i].hidden = hide;
+ editor && editor._emit("changeStatus");
+ if (this.recording) {
+ this.macro.pop();
+ this.off("exec", this.$addCommandToMacro);
+ if (!this.macro.length)
+ this.macro = this.oldMacro;
+ return this.recording = false;
}
- if (lineWidgets[end]) {
- if (hide) {
- if (!lineWidgets[start])
- lineWidgets[start] = lineWidgets[end];
- else
- lineWidgets[end].hidden = hide;
- }
- else {
- if (lineWidgets[start] == lineWidgets[end])
- lineWidgets[start] = undefined;
- lineWidgets[end].hidden = hide;
- }
+ if (!this.$addCommandToMacro) {
+ this.$addCommandToMacro = function (e) {
+ this.macro.push([e.command, e.args]);
+ }.bind(this);
}
+ this.oldMacro = this.macro;
+ this.macro = [];
+ this.on("exec", this.$addCommandToMacro);
+ return this.recording = true;
};
- LineWidgets.prototype.updateOnChange = function (delta) {
- var lineWidgets = this.session.lineWidgets;
- if (!lineWidgets)
+ CommandManager.prototype.replay = function (editor) {
+ if (this.$inReplay || !this.macro)
return;
- var startRow = delta.start.row;
- var len = delta.end.row - startRow;
- if (len === 0) {
- }
- else if (delta.action == "remove") {
- var removed = lineWidgets.splice(startRow + 1, len);
- if (!lineWidgets[startRow] && removed[removed.length - 1]) {
- lineWidgets[startRow] = removed.pop();
- }
- removed.forEach(function (w) {
- w && this.removeLineWidget(w);
+ if (this.recording)
+ return this.toggleRecording(editor);
+ try {
+ this.$inReplay = true;
+ this.macro.forEach(function (x) {
+ if (typeof x == "string")
+ this.exec(x, editor);
+ else
+ this.exec(x[0], editor, x[1]);
}, this);
- this.$updateRows();
}
- else {
- var args = new Array(len);
- if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {
- if (delta.start.column > lineWidgets[startRow].column)
- startRow++;
- }
- args.unshift(startRow, 0);
- lineWidgets.splice.apply(lineWidgets, args);
- this.$updateRows();
+ finally {
+ this.$inReplay = false;
}
};
- LineWidgets.prototype.$updateRows = function () {
- var lineWidgets = this.session.lineWidgets;
- if (!lineWidgets)
- return;
- var noWidgets = true;
- lineWidgets.forEach(function (w, i) {
- if (w) {
- noWidgets = false;
- w.row = i;
- while (w.$oldWidget) {
- w.$oldWidget.row = i;
- w = w.$oldWidget;
- }
- }
+ CommandManager.prototype.trimMacro = function (m) {
+ return m.map(function (x) {
+ if (typeof x[0] != "string")
+ x[0] = x[0].name;
+ if (!x[1])
+ x = x[0];
+ return x;
});
- if (noWidgets)
- this.session.lineWidgets = null;
};
- LineWidgets.prototype.$registerLineWidget = function (w) {
- if (!this.session.lineWidgets)
- this.session.lineWidgets = new Array(this.session.getLength());
- var old = this.session.lineWidgets[w.row];
- if (old) {
- w.$oldWidget = old;
- if (old.el && old.el.parentNode) {
- old.el.parentNode.removeChild(old.el);
- old._inDocument = false;
- }
- }
- this.session.lineWidgets[w.row] = w;
- return w;
- };
- LineWidgets.prototype.addLineWidget = function (w) {
- this.$registerLineWidget(w);
- w.session = this.session;
- if (!this.editor)
- return w;
- var renderer = this.editor.renderer;
- if (w.html && !w.el) {
- w.el = dom.createElement("div");
- w.el.innerHTML = w.html;
- }
- if (w.text && !w.el) {
- w.el = dom.createElement("div");
- w.el.textContent = w.text;
- }
- if (w.el) {
- dom.addCssClass(w.el, "ace_lineWidgetContainer");
- if (w.className) {
- dom.addCssClass(w.el, w.className);
- }
- w.el.style.position = "absolute";
- w.el.style.zIndex = "5";
- renderer.container.appendChild(w.el);
- w._inDocument = true;
- if (!w.coverGutter) {
- w.el.style.zIndex = "3";
- }
- if (w.pixelHeight == null) {
- w.pixelHeight = w.el.offsetHeight;
- }
- }
- if (w.rowCount == null) {
- w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;
- }
- var fold = this.session.getFoldAt(w.row, 0);
- w.$fold = fold;
- if (fold) {
- var lineWidgets = this.session.lineWidgets;
- if (w.row == fold.end.row && !lineWidgets[fold.start.row])
- lineWidgets[fold.start.row] = w;
+ return CommandManager;
+}(MultiHashHandler));
+oop.implement(CommandManager.prototype, EventEmitter);
+exports.CommandManager = CommandManager;
+
+});
+
+ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"], function(require, exports, module){"use strict";
+var lang = require("../lib/lang");
+var config = require("../config");
+var Range = require("../range").Range;
+function bindKey(win, mac) {
+ return { win: win, mac: mac };
+}
+exports.commands = [{
+ name: "showSettingsMenu",
+ description: "Show settings menu",
+ bindKey: bindKey("Ctrl-,", "Command-,"),
+ exec: function (editor) {
+ config.loadModule("ace/ext/settings_menu", function (module) {
+ module.init(editor);
+ editor.showSettingsMenu();
+ });
+ },
+ readOnly: true
+ }, {
+ name: "goToNextError",
+ description: "Go to next error",
+ bindKey: bindKey("Alt-E", "F4"),
+ exec: function (editor) {
+ config.loadModule("ace/ext/error_marker", function (module) {
+ module.showErrorMarker(editor, 1);
+ });
+ },
+ scrollIntoView: "animate",
+ readOnly: true
+ }, {
+ name: "goToPreviousError",
+ description: "Go to previous error",
+ bindKey: bindKey("Alt-Shift-E", "Shift-F4"),
+ exec: function (editor) {
+ config.loadModule("ace/ext/error_marker", function (module) {
+ module.showErrorMarker(editor, -1);
+ });
+ },
+ scrollIntoView: "animate",
+ readOnly: true
+ }, {
+ name: "selectall",
+ description: "Select all",
+ bindKey: bindKey("Ctrl-A", "Command-A"),
+ exec: function (editor) { editor.selectAll(); },
+ readOnly: true
+ }, {
+ name: "centerselection",
+ description: "Center selection",
+ bindKey: bindKey(null, "Ctrl-L"),
+ exec: function (editor) { editor.centerSelection(); },
+ readOnly: true
+ }, {
+ name: "gotoline",
+ description: "Go to line...",
+ bindKey: bindKey("Ctrl-L", "Command-L"),
+ exec: function (editor, line) {
+ if (typeof line === "number" && !isNaN(line))
+ editor.gotoLine(line);
+ editor.prompt({ $type: "gotoLine" });
+ },
+ readOnly: true
+ }, {
+ name: "fold",
+ bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
+ exec: function (editor) { editor.session.toggleFold(false); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "unfold",
+ bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
+ exec: function (editor) { editor.session.toggleFold(true); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "toggleFoldWidget",
+ description: "Toggle fold widget",
+ bindKey: bindKey("F2", "F2"),
+ exec: function (editor) { editor.session.toggleFoldWidget(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "toggleParentFoldWidget",
+ description: "Toggle parent fold widget",
+ bindKey: bindKey("Alt-F2", "Alt-F2"),
+ exec: function (editor) { editor.session.toggleFoldWidget(true); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "foldall",
+ description: "Fold all",
+ bindKey: bindKey(null, "Ctrl-Command-Option-0"),
+ exec: function (editor) { editor.session.foldAll(); },
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "foldAllComments",
+ description: "Fold all comments",
+ bindKey: bindKey(null, "Ctrl-Command-Option-0"),
+ exec: function (editor) { editor.session.foldAllComments(); },
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "foldOther",
+ description: "Fold other",
+ bindKey: bindKey("Alt-0", "Command-Option-0"),
+ exec: function (editor) {
+ editor.session.foldAll();
+ editor.session.unfold(editor.selection.getAllRanges());
+ },
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "unfoldall",
+ description: "Unfold all",
+ bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"),
+ exec: function (editor) { editor.session.unfold(); },
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "findnext",
+ description: "Find next",
+ bindKey: bindKey("Ctrl-K", "Command-G"),
+ exec: function (editor) { editor.findNext(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "findprevious",
+ description: "Find previous",
+ bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
+ exec: function (editor) { editor.findPrevious(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "center",
+ readOnly: true
+ }, {
+ name: "selectOrFindNext",
+ description: "Select or find next",
+ bindKey: bindKey("Alt-K", "Ctrl-G"),
+ exec: function (editor) {
+ if (editor.selection.isEmpty())
+ editor.selection.selectWord();
else
- w.hidden = true;
- }
- this.session._emit("changeFold", { data: { start: { row: w.row } } });
- this.$updateRows();
- this.renderWidgets(null, renderer);
- this.onWidgetChanged(w);
- return w;
- };
- LineWidgets.prototype.removeLineWidget = function (w) {
- w._inDocument = false;
- w.session = null;
- if (w.el && w.el.parentNode)
- w.el.parentNode.removeChild(w.el);
- if (w.editor && w.editor.destroy)
- try {
- w.editor.destroy();
- }
- catch (e) { }
- if (this.session.lineWidgets) {
- var w1 = this.session.lineWidgets[w.row];
- if (w1 == w) {
- this.session.lineWidgets[w.row] = w.$oldWidget;
- if (w.$oldWidget)
- this.onWidgetChanged(w.$oldWidget);
- }
- else {
- while (w1) {
- if (w1.$oldWidget == w) {
- w1.$oldWidget = w.$oldWidget;
- break;
- }
- w1 = w1.$oldWidget;
- }
- }
- }
- this.session._emit("changeFold", { data: { start: { row: w.row } } });
- this.$updateRows();
- };
- LineWidgets.prototype.getWidgetsAtRow = function (row) {
- var lineWidgets = this.session.lineWidgets;
- var w = lineWidgets && lineWidgets[row];
- var list = [];
- while (w) {
- list.push(w);
- w = w.$oldWidget;
+ editor.findNext();
+ },
+ readOnly: true
+ }, {
+ name: "selectOrFindPrevious",
+ description: "Select or find previous",
+ bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"),
+ exec: function (editor) {
+ if (editor.selection.isEmpty())
+ editor.selection.selectWord();
+ else
+ editor.findPrevious();
+ },
+ readOnly: true
+ }, {
+ name: "find",
+ description: "Find",
+ bindKey: bindKey("Ctrl-F", "Command-F"),
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor); });
+ },
+ readOnly: true
+ }, {
+ name: "overwrite",
+ description: "Overwrite",
+ bindKey: "Insert",
+ exec: function (editor) { editor.toggleOverwrite(); },
+ readOnly: true
+ }, {
+ name: "selecttostart",
+ description: "Select to start",
+ bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
+ exec: function (editor) { editor.getSelection().selectFileStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true,
+ scrollIntoView: "animate",
+ aceCommandGroup: "fileJump"
+ }, {
+ name: "gotostart",
+ description: "Go to start",
+ bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
+ exec: function (editor) { editor.navigateFileStart(); },
+ multiSelectAction: "forEach",
+ readOnly: true,
+ scrollIntoView: "animate",
+ aceCommandGroup: "fileJump"
+ }, {
+ name: "selectup",
+ description: "Select up",
+ bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
+ exec: function (editor) { editor.getSelection().selectUp(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "golineup",
+ description: "Go line up",
+ bindKey: bindKey("Up", "Up|Ctrl-P"),
+ exec: function (editor, args) { editor.navigateUp(args.times); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selecttoend",
+ description: "Select to end",
+ bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
+ exec: function (editor) { editor.getSelection().selectFileEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true,
+ scrollIntoView: "animate",
+ aceCommandGroup: "fileJump"
+ }, {
+ name: "gotoend",
+ description: "Go to end",
+ bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
+ exec: function (editor) { editor.navigateFileEnd(); },
+ multiSelectAction: "forEach",
+ readOnly: true,
+ scrollIntoView: "animate",
+ aceCommandGroup: "fileJump"
+ }, {
+ name: "selectdown",
+ description: "Select down",
+ bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
+ exec: function (editor) { editor.getSelection().selectDown(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "golinedown",
+ description: "Go line down",
+ bindKey: bindKey("Down", "Down|Ctrl-N"),
+ exec: function (editor, args) { editor.navigateDown(args.times); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectwordleft",
+ description: "Select word left",
+ bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
+ exec: function (editor) { editor.getSelection().selectWordLeft(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotowordleft",
+ description: "Go to word left",
+ bindKey: bindKey("Ctrl-Left", "Option-Left"),
+ exec: function (editor) { editor.navigateWordLeft(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selecttolinestart",
+ description: "Select to line start",
+ bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
+ exec: function (editor) { editor.getSelection().selectLineStart(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotolinestart",
+ description: "Go to line start",
+ bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
+ exec: function (editor) { editor.navigateLineStart(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectleft",
+ description: "Select left",
+ bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
+ exec: function (editor) { editor.getSelection().selectLeft(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotoleft",
+ description: "Go to left",
+ bindKey: bindKey("Left", "Left|Ctrl-B"),
+ exec: function (editor, args) { editor.navigateLeft(args.times); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectwordright",
+ description: "Select word right",
+ bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
+ exec: function (editor) { editor.getSelection().selectWordRight(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotowordright",
+ description: "Go to word right",
+ bindKey: bindKey("Ctrl-Right", "Option-Right"),
+ exec: function (editor) { editor.navigateWordRight(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selecttolineend",
+ description: "Select to line end",
+ bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"),
+ exec: function (editor) { editor.getSelection().selectLineEnd(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotolineend",
+ description: "Go to line end",
+ bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
+ exec: function (editor) { editor.navigateLineEnd(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectright",
+ description: "Select right",
+ bindKey: bindKey("Shift-Right", "Shift-Right"),
+ exec: function (editor) { editor.getSelection().selectRight(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "gotoright",
+ description: "Go to right",
+ bindKey: bindKey("Right", "Right|Ctrl-F"),
+ exec: function (editor, args) { editor.navigateRight(args.times); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectpagedown",
+ description: "Select page down",
+ bindKey: "Shift-PageDown",
+ exec: function (editor) { editor.selectPageDown(); },
+ readOnly: true
+ }, {
+ name: "pagedown",
+ description: "Page down",
+ bindKey: bindKey(null, "Option-PageDown"),
+ exec: function (editor) { editor.scrollPageDown(); },
+ readOnly: true
+ }, {
+ name: "gotopagedown",
+ description: "Go to page down",
+ bindKey: bindKey("PageDown", "PageDown|Ctrl-V"),
+ exec: function (editor) { editor.gotoPageDown(); },
+ readOnly: true
+ }, {
+ name: "selectpageup",
+ description: "Select page up",
+ bindKey: "Shift-PageUp",
+ exec: function (editor) { editor.selectPageUp(); },
+ readOnly: true
+ }, {
+ name: "pageup",
+ description: "Page up",
+ bindKey: bindKey(null, "Option-PageUp"),
+ exec: function (editor) { editor.scrollPageUp(); },
+ readOnly: true
+ }, {
+ name: "gotopageup",
+ description: "Go to page up",
+ bindKey: "PageUp",
+ exec: function (editor) { editor.gotoPageUp(); },
+ readOnly: true
+ }, {
+ name: "scrollup",
+ description: "Scroll up",
+ bindKey: bindKey("Ctrl-Up", null),
+ exec: function (e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); },
+ readOnly: true
+ }, {
+ name: "scrolldown",
+ description: "Scroll down",
+ bindKey: bindKey("Ctrl-Down", null),
+ exec: function (e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); },
+ readOnly: true
+ }, {
+ name: "selectlinestart",
+ description: "Select line start",
+ bindKey: "Shift-Home",
+ exec: function (editor) { editor.getSelection().selectLineStart(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "selectlineend",
+ description: "Select line end",
+ bindKey: "Shift-End",
+ exec: function (editor) { editor.getSelection().selectLineEnd(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "togglerecording",
+ description: "Toggle recording",
+ bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"),
+ exec: function (editor) { editor.commands.toggleRecording(editor); },
+ readOnly: true
+ }, {
+ name: "replaymacro",
+ description: "Replay macro",
+ bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"),
+ exec: function (editor) { editor.commands.replay(editor); },
+ readOnly: true
+ }, {
+ name: "jumptomatching",
+ description: "Jump to matching",
+ bindKey: bindKey("Ctrl-\\|Ctrl-P", "Command-\\"),
+ exec: function (editor) { editor.jumpToMatching(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "animate",
+ readOnly: true
+ }, {
+ name: "selecttomatching",
+ description: "Select to matching",
+ bindKey: bindKey("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"),
+ exec: function (editor) { editor.jumpToMatching(true); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "animate",
+ readOnly: true
+ }, {
+ name: "expandToMatching",
+ description: "Expand to matching",
+ bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"),
+ exec: function (editor) { editor.jumpToMatching(true, true); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "animate",
+ readOnly: true
+ }, {
+ name: "passKeysToBrowser",
+ description: "Pass keys to browser",
+ bindKey: bindKey(null, null),
+ exec: function () { },
+ passEvent: true,
+ readOnly: true
+ }, {
+ name: "copy",
+ description: "Copy",
+ exec: function (editor) {
+ },
+ readOnly: true
+ },
+ {
+ name: "cut",
+ description: "Cut",
+ exec: function (editor) {
+ var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();
+ var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();
+ editor._emit("cut", range);
+ if (!range.isEmpty())
+ editor.session.remove(range);
+ editor.clearSelection();
+ },
+ scrollIntoView: "cursor",
+ multiSelectAction: "forEach"
+ }, {
+ name: "paste",
+ description: "Paste",
+ exec: function (editor, args) {
+ editor.$handlePaste(args);
+ },
+ scrollIntoView: "cursor"
+ }, {
+ name: "removeline",
+ description: "Remove line",
+ bindKey: bindKey("Ctrl-D", "Command-D"),
+ exec: function (editor) { editor.removeLines(); },
+ scrollIntoView: "cursor",
+ multiSelectAction: "forEachLine"
+ }, {
+ name: "duplicateSelection",
+ description: "Duplicate selection",
+ bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
+ exec: function (editor) { editor.duplicateSelection(); },
+ scrollIntoView: "cursor",
+ multiSelectAction: "forEach"
+ }, {
+ name: "sortlines",
+ description: "Sort lines",
+ bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
+ exec: function (editor) { editor.sortLines(); },
+ scrollIntoView: "selection",
+ multiSelectAction: "forEachLine"
+ }, {
+ name: "togglecomment",
+ description: "Toggle comment",
+ bindKey: bindKey("Ctrl-/", "Command-/"),
+ exec: function (editor) { editor.toggleCommentLines(); },
+ multiSelectAction: "forEachLine",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "toggleBlockComment",
+ description: "Toggle block comment",
+ bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
+ exec: function (editor) { editor.toggleBlockComment(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "modifyNumberUp",
+ description: "Modify number up",
+ bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
+ exec: function (editor) { editor.modifyNumber(1); },
+ scrollIntoView: "cursor",
+ multiSelectAction: "forEach"
+ }, {
+ name: "modifyNumberDown",
+ description: "Modify number down",
+ bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"),
+ exec: function (editor) { editor.modifyNumber(-1); },
+ scrollIntoView: "cursor",
+ multiSelectAction: "forEach"
+ }, {
+ name: "replace",
+ description: "Replace",
+ bindKey: bindKey("Ctrl-H", "Command-Option-F"),
+ exec: function (editor) {
+ config.loadModule("ace/ext/searchbox", function (e) { e.Search(editor, true); });
}
- return list;
- };
- LineWidgets.prototype.onWidgetChanged = function (w) {
- this.session._changedWidgets.push(w);
- this.editor && this.editor.renderer.updateFull();
- };
- LineWidgets.prototype.measureWidgets = function (e, renderer) {
- var changedWidgets = this.session._changedWidgets;
- var config = renderer.layerConfig;
- if (!changedWidgets || !changedWidgets.length)
- return;
- var min = Infinity;
- for (var i = 0; i < changedWidgets.length; i++) {
- var w = changedWidgets[i];
- if (!w || !w.el)
- continue;
- if (w.session != this.session)
- continue;
- if (!w._inDocument) {
- if (this.session.lineWidgets[w.row] != w)
- continue;
- w._inDocument = true;
- renderer.container.appendChild(w.el);
+ }, {
+ name: "undo",
+ description: "Undo",
+ bindKey: bindKey("Ctrl-Z", "Command-Z"),
+ exec: function (editor) { editor.undo(); }
+ }, {
+ name: "redo",
+ description: "Redo",
+ bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
+ exec: function (editor) { editor.redo(); }
+ }, {
+ name: "copylinesup",
+ description: "Copy lines up",
+ bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
+ exec: function (editor) { editor.copyLinesUp(); },
+ scrollIntoView: "cursor"
+ }, {
+ name: "movelinesup",
+ description: "Move lines up",
+ bindKey: bindKey("Alt-Up", "Option-Up"),
+ exec: function (editor) { editor.moveLinesUp(); },
+ scrollIntoView: "cursor"
+ }, {
+ name: "copylinesdown",
+ description: "Copy lines down",
+ bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
+ exec: function (editor) { editor.copyLinesDown(); },
+ scrollIntoView: "cursor"
+ }, {
+ name: "movelinesdown",
+ description: "Move lines down",
+ bindKey: bindKey("Alt-Down", "Option-Down"),
+ exec: function (editor) { editor.moveLinesDown(); },
+ scrollIntoView: "cursor"
+ }, {
+ name: "del",
+ description: "Delete",
+ bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
+ exec: function (editor) { editor.remove("right"); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "backspace",
+ description: "Backspace",
+ bindKey: bindKey("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
+ exec: function (editor) { editor.remove("left"); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "cut_or_delete",
+ description: "Cut or delete",
+ bindKey: bindKey("Shift-Delete", null),
+ exec: function (editor) {
+ if (editor.selection.isEmpty()) {
+ editor.remove("left");
}
- w.h = w.el.offsetHeight;
- if (!w.fixedWidth) {
- w.w = w.el.offsetWidth;
- w.screenWidth = Math.ceil(w.w / config.characterWidth);
+ else {
+ return false;
}
- var rowCount = w.h / config.lineHeight;
- if (w.coverLine) {
- rowCount -= this.session.getRowLineCount(w.row);
- if (rowCount < 0)
- rowCount = 0;
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removetolinestart",
+ description: "Remove to line start",
+ bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
+ exec: function (editor) { editor.removeToLineStart(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removetolineend",
+ description: "Remove to line end",
+ bindKey: bindKey("Alt-Delete", "Ctrl-K|Command-Delete"),
+ exec: function (editor) { editor.removeToLineEnd(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removetolinestarthard",
+ description: "Remove to line start hard",
+ bindKey: bindKey("Ctrl-Shift-Backspace", null),
+ exec: function (editor) {
+ var range = editor.selection.getRange();
+ range.start.column = 0;
+ editor.session.remove(range);
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removetolineendhard",
+ description: "Remove to line end hard",
+ bindKey: bindKey("Ctrl-Shift-Delete", null),
+ exec: function (editor) {
+ var range = editor.selection.getRange();
+ range.end.column = Number.MAX_VALUE;
+ editor.session.remove(range);
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removewordleft",
+ description: "Remove word left",
+ bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
+ exec: function (editor) { editor.removeWordLeft(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "removewordright",
+ description: "Remove word right",
+ bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
+ exec: function (editor) { editor.removeWordRight(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "outdent",
+ description: "Outdent",
+ bindKey: bindKey("Shift-Tab", "Shift-Tab"),
+ exec: function (editor) { editor.blockOutdent(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "indent",
+ description: "Indent",
+ bindKey: bindKey("Tab", "Tab"),
+ exec: function (editor) { editor.indent(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "blockoutdent",
+ description: "Block outdent",
+ bindKey: bindKey("Ctrl-[", "Ctrl-["),
+ exec: function (editor) { editor.blockOutdent(); },
+ multiSelectAction: "forEachLine",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "blockindent",
+ description: "Block indent",
+ bindKey: bindKey("Ctrl-]", "Ctrl-]"),
+ exec: function (editor) { editor.blockIndent(); },
+ multiSelectAction: "forEachLine",
+ scrollIntoView: "selectionPart"
+ }, {
+ name: "insertstring",
+ description: "Insert string",
+ exec: function (editor, str) { editor.insert(str); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "inserttext",
+ description: "Insert text",
+ exec: function (editor, args) {
+ editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "splitline",
+ description: "Split line",
+ bindKey: bindKey(null, "Ctrl-O"),
+ exec: function (editor) { editor.splitLine(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "transposeletters",
+ description: "Transpose letters",
+ bindKey: bindKey("Alt-Shift-X", "Ctrl-T"),
+ exec: function (editor) { editor.transposeLetters(); },
+ multiSelectAction: function (editor) { editor.transposeSelections(1); },
+ scrollIntoView: "cursor"
+ }, {
+ name: "touppercase",
+ description: "To uppercase",
+ bindKey: bindKey("Ctrl-U", "Ctrl-U"),
+ exec: function (editor) { editor.toUpperCase(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "tolowercase",
+ description: "To lowercase",
+ bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
+ exec: function (editor) { editor.toLowerCase(); },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "autoindent",
+ description: "Auto Indent",
+ bindKey: bindKey(null, null),
+ exec: function (editor) { editor.autoIndent(); },
+ scrollIntoView: "animate"
+ }, {
+ name: "expandtoline",
+ description: "Expand to line",
+ bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"),
+ exec: function (editor) {
+ var range = editor.selection.getRange();
+ range.start.column = range.end.column = 0;
+ range.end.row++;
+ editor.selection.setRange(range, false);
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor",
+ readOnly: true
+ }, {
+ name: "openlink",
+ bindKey: bindKey("Ctrl+F3", "F3"),
+ exec: function (editor) { editor.openLink(); }
+ }, {
+ name: "joinlines",
+ description: "Join lines",
+ bindKey: bindKey(null, null),
+ exec: function (editor) {
+ var isBackwards = editor.selection.isBackwards();
+ var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();
+ var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();
+ var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;
+ var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());
+ var selectedCount = selectedText.replace(/\n\s*/, " ").length;
+ var insertLine = editor.session.doc.getLine(selectionStart.row);
+ for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) {
+ var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i)));
+ if (curLine.length !== 0) {
+ curLine = " " + curLine;
+ }
+ insertLine += curLine;
}
- if (w.rowCount != rowCount) {
- w.rowCount = rowCount;
- if (w.row < min)
- min = w.row;
+ if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) {
+ insertLine += editor.session.doc.getNewLineCharacter();
}
- }
- if (min != Infinity) {
- this.session._emit("changeFold", { data: { start: { row: min } } });
- this.session.lineWidgetWidth = null;
- }
- this.session._changedWidgets = [];
- };
- LineWidgets.prototype.renderWidgets = function (e, renderer) {
- var config = renderer.layerConfig;
- var lineWidgets = this.session.lineWidgets;
- if (!lineWidgets)
- return;
- var first = Math.min(this.firstRow, config.firstRow);
- var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length);
- while (first > 0 && !lineWidgets[first])
- first--;
- this.firstRow = config.firstRow;
- this.lastRow = config.lastRow;
- renderer.$cursorLayer.config = config;
- for (var i = first; i <= last; i++) {
- var w = lineWidgets[i];
- if (!w || !w.el)
- continue;
- if (w.hidden) {
- w.el.style.top = -100 - (w.pixelHeight || 0) + "px";
- continue;
+ editor.clearSelection();
+ editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);
+ if (selectedCount > 0) {
+ editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);
+ editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);
}
- if (!w._inDocument) {
- w._inDocument = true;
- renderer.container.appendChild(w.el);
+ else {
+ firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol;
+ editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);
}
- var top = renderer.$cursorLayer.getPixelPosition({ row: i, column: 0 }, true).top;
- if (!w.coverLine)
- top += config.lineHeight * this.session.getRowLineCount(w.row);
- w.el.style.top = top - config.offset + "px";
- var left = w.coverGutter ? 0 : renderer.gutterWidth;
- if (!w.fixedWidth)
- left -= renderer.scrollLeft;
- w.el.style.left = left + "px";
- if (w.fullWidth && w.screenWidth) {
- w.el.style.minWidth = config.width + 2 * config.padding + "px";
+ },
+ multiSelectAction: "forEach",
+ readOnly: true
+ }, {
+ name: "invertSelection",
+ description: "Invert selection",
+ bindKey: bindKey(null, null),
+ exec: function (editor) {
+ var endRow = editor.session.doc.getLength() - 1;
+ var endCol = editor.session.doc.getLine(endRow).length;
+ var ranges = editor.selection.rangeList.ranges;
+ var newRanges = [];
+ if (ranges.length < 1) {
+ ranges = [editor.selection.getRange()];
}
- if (w.fixedWidth) {
- w.el.style.right = renderer.scrollBar.getWidth() + "px";
+ for (var i = 0; i < ranges.length; i++) {
+ if (i == (ranges.length - 1)) {
+ if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) {
+ newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol));
+ }
+ }
+ if (i === 0) {
+ if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) {
+ newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column));
+ }
+ }
+ else {
+ newRanges.push(new Range(ranges[i - 1].end.row, ranges[i - 1].end.column, ranges[i].start.row, ranges[i].start.column));
+ }
}
- else {
- w.el.style.right = "";
+ editor.exitMultiSelectMode();
+ editor.clearSelection();
+ for (var i = 0; i < newRanges.length; i++) {
+ editor.selection.addRange(newRanges[i], false);
}
- }
- };
- return LineWidgets;
-}());
-exports.LineWidgets = LineWidgets;
+ },
+ readOnly: true,
+ scrollIntoView: "none"
+ }, {
+ name: "addLineAfter",
+ description: "Add new line after the current line",
+ exec: function (editor) {
+ editor.selection.clearSelection();
+ editor.navigateLineEnd();
+ editor.insert("\n");
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "addLineBefore",
+ description: "Add new line before the current line",
+ exec: function (editor) {
+ editor.selection.clearSelection();
+ var cursor = editor.getCursorPosition();
+ editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);
+ editor.insert("\n");
+ if (cursor.row === 0)
+ editor.navigateUp();
+ },
+ multiSelectAction: "forEach",
+ scrollIntoView: "cursor"
+ }, {
+ name: "openCommandPallete",
+ exec: function (editor) {
+ console.warn("This is an obsolete command. Please use `openCommandPalette` instead.");
+ editor.prompt({ $type: "commands" });
+ },
+ readOnly: true
+ }, {
+ name: "openCommandPalette",
+ description: "Open command palette",
+ bindKey: bindKey("F1", "F1"),
+ exec: function (editor) {
+ editor.prompt({ $type: "commands" });
+ },
+ readOnly: true
+ }, {
+ name: "modeSelect",
+ description: "Change language mode...",
+ bindKey: bindKey(null, null),
+ exec: function (editor) {
+ editor.prompt({ $type: "modes" });
+ },
+ readOnly: true
+ }];
+for (var i = 1; i < 9; i++) {
+ exports.commands.push({
+ name: "foldToLevel" + i,
+ description: "Fold To Level " + i,
+ level: i,
+ exec: function (editor) { editor.session.foldToLevel(this.level); },
+ scrollIntoView: "center",
+ readOnly: true
+ });
+}
});
@@ -13626,7 +14142,7 @@ exports.GutterKeyboardEvent = GutterKeyboardEvent;
});
-ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"], function(require, exports, module){"use strict";
+ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys","ace/lib/event","ace/tooltip"], function(require, exports, module){"use strict";
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
@@ -13654,11 +14170,12 @@ var CommandManager = require("./commands/command_manager").CommandManager;
var defaultCommands = require("./commands/default_commands").commands;
var config = require("./config");
var TokenIterator = require("./token_iterator").TokenIterator;
-var LineWidgets = require("./line_widgets").LineWidgets;
var GutterKeyboardHandler = require("./keyboard/gutter_handler").GutterKeyboardHandler;
var nls = require("./config").nls;
var clipboard = require("./clipboard");
var keys = require('./lib/keys');
+var event = require("./lib/event");
+var HoverTooltip = require("./tooltip").HoverTooltip;
var Editor = /** @class */ (function () {
function Editor(renderer, session, options) { this.session;
this.$toDestroy = [];
@@ -13697,46 +14214,27 @@ var Editor = /** @class */ (function () {
Editor.prototype.$initOperationListeners = function () {
this.commands.on("exec", this.startOperation.bind(this), true);
this.commands.on("afterExec", this.endOperation.bind(this), true);
- this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true));
- this.on("change", function () {
- if (!this.curOp) {
- this.startOperation();
- this.curOp.selectionBefore = this.$lastSel;
- }
- this.curOp.docChanged = true;
- }.bind(this), true);
- this.on("changeSelection", function () {
- if (!this.curOp) {
- this.startOperation();
- this.curOp.selectionBefore = this.$lastSel;
- }
- this.curOp.selectionChanged = true;
- }.bind(this), true);
};
Editor.prototype.startOperation = function (commandEvent) {
- if (this.curOp) {
- if (!commandEvent || this.curOp.command)
- return;
- this.prevOp = this.curOp;
- }
+ this.session.startOperation(commandEvent);
+ };
+ Editor.prototype.endOperation = function (e) {
+ this.session.endOperation(e);
+ };
+ Editor.prototype.onStartOperation = function (commandEvent) {
+ this.curOp = this.session.curOp;
+ this.curOp.scrollTop = this.renderer.scrollTop;
+ this.prevOp = this.session.prevOp;
if (!commandEvent) {
this.previousCommand = null;
- commandEvent = {};
}
- this.$opResetTimer.schedule();
- this.curOp = this.session.curOp = {
- command: commandEvent.command || {},
- args: commandEvent.args,
- scrollTop: this.renderer.scrollTop
- };
- this.curOp.selectionBefore = this.selection.toJSON();
};
- Editor.prototype.endOperation = function (e) {
+ Editor.prototype.onEndOperation = function (e) {
if (this.curOp && this.session) {
- if (e && e.returnValue === false || !this.session)
- return (this.curOp = null);
- if (e == true && this.curOp.command && this.curOp.command.name == "mouse")
+ if (e && e.returnValue === false) {
+ this.curOp = null;
return;
+ }
this._signal("beforeEndOperation");
if (!this.curOp)
return;
@@ -13766,10 +14264,7 @@ var Editor = /** @class */ (function () {
if (scrollIntoView == "animate")
this.renderer.animateScrolling(this.curOp.scrollTop);
}
- var sel = this.selection.toJSON();
- this.curOp.selectionAfter = sel;
- this.$lastSel = this.selection.toJSON();
- this.session.getUndoManager().addSelection(sel);
+ this.$lastSel = this.session.selection.toJSON();
this.prevOp = this.curOp;
this.curOp = null;
}
@@ -13843,6 +14338,8 @@ var Editor = /** @class */ (function () {
this.session.off("changeOverwrite", this.$onCursorChange);
this.session.off("changeScrollTop", this.$onScrollTopChange);
this.session.off("changeScrollLeft", this.$onScrollLeftChange);
+ this.session.off("startOperation", this.$onStartOperation);
+ this.session.off("endOperation", this.$onEndOperation);
var selection = this.session.getSelection();
selection.off("changeCursor", this.$onCursorChange);
selection.off("changeSelection", this.$onSelectionChange);
@@ -13882,6 +14379,10 @@ var Editor = /** @class */ (function () {
this.selection.on("changeCursor", this.$onCursorChange);
this.$onSelectionChange = this.onSelectionChange.bind(this);
this.selection.on("changeSelection", this.$onSelectionChange);
+ this.$onStartOperation = this.onStartOperation.bind(this);
+ this.session.on("startOperation", this.$onStartOperation);
+ this.$onEndOperation = this.onEndOperation.bind(this);
+ this.session.on("endOperation", this.$onEndOperation);
this.onChangeMode();
this.onCursorChange();
this.onScrollTopChange();
@@ -13904,7 +14405,11 @@ var Editor = /** @class */ (function () {
});
this.curOp = null;
oldSession && oldSession._signal("changeEditor", { oldEditor: this });
+ if (oldSession)
+ oldSession.$editor = null;
session && session._signal("changeEditor", { editor: this });
+ if (session)
+ session.$editor = this;
if (session && !session.destroyed)
session.bgTokenizer.scheduleStart();
};
@@ -13975,8 +14480,12 @@ var Editor = /** @class */ (function () {
var token = iterator.getCurrentToken();
if (token && /\b(?:tag-open|tag-name)/.test(token.type)) {
var tagNamesRanges = session.getMatchingTags(pos);
- if (tagNamesRanges)
- ranges = [tagNamesRanges.openTagName, tagNamesRanges.closeTagName];
+ if (tagNamesRanges) {
+ ranges = [
+ tagNamesRanges.openTagName.isEmpty() ? tagNamesRanges.openTag : tagNamesRanges.openTagName,
+ tagNamesRanges.closeTagName.isEmpty() ? tagNamesRanges.closeTag : tagNamesRanges.closeTagName
+ ];
+ }
}
}
if (!ranges && session.$mode.getMatching)
@@ -14526,15 +15035,9 @@ var Editor = /** @class */ (function () {
this.moveCursorToPosition(cursor);
};
Editor.prototype.setGhostText = function (text, position) {
- if (!this.session.widgetManager) {
- this.session.widgetManager = new LineWidgets(this.session);
- this.session.widgetManager.attach(this);
- }
this.renderer.setGhostText(text, position);
};
Editor.prototype.removeGhostText = function () {
- if (!this.session.widgetManager)
- return;
this.renderer.removeGhostText();
};
Editor.prototype.transposeLetters = function () {
@@ -15421,9 +15924,51 @@ config.defineOptions(Editor.prototype, "editor", {
initialValue: true
},
readOnly: {
- set: function (readOnly) {
+ set: function (/**@type{boolean}*/ readOnly) {
+ var _this = this;
this.textInput.setReadOnly(readOnly);
this.$resetCursorStyle();
+ if (!this.$readOnlyCallback) {
+ this.$readOnlyCallback = function (e) {
+ var shouldShow = false;
+ if (e && e.type == "keydown") {
+ shouldShow = e && e.key && e.key.length == 1 && !e.ctrlKey && !e.metaKey;
+ if (!shouldShow)
+ return;
+ }
+ else if (e && e.type !== "exec") {
+ shouldShow = true;
+ }
+ if (shouldShow) {
+ if (!_this.hoverTooltip) {
+ _this.hoverTooltip = new HoverTooltip();
+ }
+ var domNode = dom.createElement("div");
+ domNode.textContent = nls("editor.tooltip.disable-editing", "Editing is disabled");
+ if (!_this.hoverTooltip.isOpen) {
+ _this.hoverTooltip.showForRange(_this, _this.getSelectionRange(), domNode);
+ }
+ }
+ else if (_this.hoverTooltip && _this.hoverTooltip.isOpen) {
+ _this.hoverTooltip.hide();
+ }
+ };
+ }
+ var textArea = this.textInput.getElement();
+ if (readOnly) {
+ event.addListener(textArea, "keydown", this.$readOnlyCallback, this);
+ this.commands.on("exec", this.$readOnlyCallback);
+ this.commands.on("commandUnavailable", this.$readOnlyCallback);
+ }
+ else {
+ event.removeListener(textArea, "keydown", this.$readOnlyCallback);
+ this.commands.off("exec", this.$readOnlyCallback);
+ this.commands.off("commandUnavailable", this.$readOnlyCallback);
+ if (this.hoverTooltip) {
+ this.hoverTooltip.destroy();
+ this.hoverTooltip = null;
+ }
+ }
},
initialValue: false
},
@@ -15543,21 +16088,24 @@ config.defineOptions(Editor.prototype, "editor", {
this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0);
this.renderer.scroller.setAttribute("tabindex", 0);
this.renderer.scroller.setAttribute("role", "group");
- this.renderer.scroller.setAttribute("aria-roledescription", nls("editor"));
+ this.renderer.scroller.setAttribute("aria-roledescription", nls("editor.scroller.aria-roledescription", "editor"));
this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName);
- this.renderer.scroller.setAttribute("aria-label", nls("Editor content, press Enter to start editing, press Escape to exit"));
+ this.renderer.scroller.setAttribute("aria-label", nls("editor.scroller.aria-label", "Editor content, press Enter to start editing, press Escape to exit"));
this.renderer.scroller.addEventListener("keyup", focusOnEnterKeyup.bind(this));
this.commands.addCommand(blurCommand);
this.renderer.$gutter.setAttribute("tabindex", 0);
this.renderer.$gutter.setAttribute("aria-hidden", false);
this.renderer.$gutter.setAttribute("role", "group");
- this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor"));
- this.renderer.$gutter.setAttribute("aria-label", nls("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit"));
+ this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-roledescription", "editor gutter"));
+ this.renderer.$gutter.setAttribute("aria-label", nls("editor.gutter.aria-label", "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit"));
this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName);
this.renderer.content.setAttribute("aria-hidden", true);
if (!gutterKeyboardHandler)
gutterKeyboardHandler = new GutterKeyboardHandler(this);
gutterKeyboardHandler.addListener();
+ this.textInput.setAriaOptions({
+ setLabel: true
+ });
}
else {
this.renderer.enableKeyboardAccessibility = false;
@@ -15583,6 +16131,14 @@ config.defineOptions(Editor.prototype, "editor", {
},
initialValue: false
},
+ textInputAriaLabel: {
+ set: function (val) { this.$textInputAriaLabel = val; },
+ initialValue: ""
+ },
+ enableMobileMenu: {
+ set: function (val) { this.$enableMobileMenu = val; },
+ initialValue: true
+ },
customScrollbar: "renderer",
hScrollBarAlwaysVisible: "renderer",
vScrollBarAlwaysVisible: "renderer",
@@ -15800,23 +16356,36 @@ var Gutter = /** @class */ (function () {
var row = annotation.row;
var rowInfo = this.$annotations[row];
if (!rowInfo)
- rowInfo = this.$annotations[row] = { text: [], type: [] };
+ rowInfo = this.$annotations[row] = { text: [], type: [], displayText: [] };
var annoText = annotation.text;
+ var displayAnnoText = annotation.text;
var annoType = annotation.type;
annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || "";
+ displayAnnoText = displayAnnoText ? displayAnnoText : annotation.html || "";
if (rowInfo.text.indexOf(annoText) === -1) {
rowInfo.text.push(annoText);
rowInfo.type.push(annoType);
+ rowInfo.displayText.push(displayAnnoText);
}
var className = annotation.className;
- if (className)
+ if (className) {
rowInfo.className = className;
- else if (annoType == "error")
+ }
+ else if (annoType === "error") {
rowInfo.className = " ace_error";
- else if (annoType == "warning" && rowInfo.className != " ace_error")
+ }
+ else if (annoType === "security" && !/\bace_error\b/.test(rowInfo.className)) {
+ rowInfo.className = " ace_security";
+ }
+ else if (annoType === "warning" && !/\bace_(error|security)\b/.test(rowInfo.className)) {
rowInfo.className = " ace_warning";
- else if (annoType == "info" && (!rowInfo.className))
+ }
+ else if (annoType === "info" && !rowInfo.className) {
rowInfo.className = " ace_info";
+ }
+ else if (annoType === "hint" && !rowInfo.className) {
+ rowInfo.className = " ace_hint";
+ }
}
};
Gutter.prototype.$updateAnnotations = function (delta) {
@@ -16024,7 +16593,7 @@ var Gutter = /** @class */ (function () {
var isClosedFold = c == "start" && row == foldStart && row < fold.end.row;
if (isClosedFold) {
foldClass += " ace_closed";
- var foldAnnotationClass = '';
+ var foldAnnotationClass = "";
var annotationInFold = false;
for (var i = row + 1; i <= fold.end.row; i++) {
if (!this.$annotations[i])
@@ -16034,10 +16603,14 @@ var Gutter = /** @class */ (function () {
foldAnnotationClass = " ace_error_fold";
break;
}
- if (this.$annotations[i].className === " ace_warning") {
+ if (this.$annotations[i].className === " ace_security") {
+ annotationInFold = true;
+ foldAnnotationClass = " ace_security_fold";
+ }
+ else if (this.$annotations[i].className === " ace_warning" &&
+ foldAnnotationClass !== " ace_security_fold") {
annotationInFold = true;
foldAnnotationClass = " ace_warning_fold";
- continue;
}
}
className += foldAnnotationClass;
@@ -16052,20 +16625,26 @@ var Gutter = /** @class */ (function () {
foldWidget.setAttribute("tabindex", "-1");
var foldRange = session.getFoldWidgetRange(row);
if (foldRange)
- foldWidget.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1]));
+ foldWidget.setAttribute("aria-label", nls("gutter.code-folding.range.aria-label", "Toggle code folding, rows $0 through $1", [
+ foldRange.start.row + 1,
+ foldRange.end.row + 1
+ ]));
else {
if (fold)
- foldWidget.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1]));
+ foldWidget.setAttribute("aria-label", nls("gutter.code-folding.closed.aria-label", "Toggle code folding, rows $0 through $1", [
+ fold.start.row + 1,
+ fold.end.row + 1
+ ]));
else
- foldWidget.setAttribute("aria-label", nls("Toggle code folding, row $0", [row + 1]));
+ foldWidget.setAttribute("aria-label", nls("gutter.code-folding.open.aria-label", "Toggle code folding, row $0", [row + 1]));
}
if (isClosedFold) {
foldWidget.setAttribute("aria-expanded", "false");
- foldWidget.setAttribute("title", nls("Unfold code"));
+ foldWidget.setAttribute("title", nls("gutter.code-folding.closed.title", "Unfold code"));
}
else {
foldWidget.setAttribute("aria-expanded", "true");
- foldWidget.setAttribute("title", nls("Fold code"));
+ foldWidget.setAttribute("title", nls("gutter.code-folding.open.title", "Fold code"));
}
}
else {
@@ -16083,7 +16662,19 @@ var Gutter = /** @class */ (function () {
dom.setStyle(annotationIconNode.style, "height", lineHeight);
dom.setStyle(annotationNode.style, "display", "block");
dom.setStyle(annotationNode.style, "height", lineHeight);
- annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText]));
+ var ariaLabel;
+ switch (foldAnnotationClass) {
+ case " ace_error_fold":
+ ariaLabel = nls("gutter.annotation.aria-label.error", "Error, read annotations row $0", [rowText]);
+ break;
+ case " ace_security_fold":
+ ariaLabel = nls("gutter.annotation.aria-label.security", "Security finding, read annotations row $0", [rowText]);
+ break;
+ case " ace_warning_fold":
+ ariaLabel = nls("gutter.annotation.aria-label.warning", "Warning, read annotations row $0", [rowText]);
+ break;
+ }
+ annotationNode.setAttribute("aria-label", ariaLabel);
annotationNode.setAttribute("tabindex", "-1");
annotationNode.setAttribute("role", "button");
}
@@ -16097,7 +16688,25 @@ var Gutter = /** @class */ (function () {
dom.setStyle(annotationIconNode.style, "height", lineHeight);
dom.setStyle(annotationNode.style, "display", "block");
dom.setStyle(annotationNode.style, "height", lineHeight);
- annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText]));
+ var ariaLabel;
+ switch (this.$annotations[row].className) {
+ case " ace_error":
+ ariaLabel = nls("gutter.annotation.aria-label.error", "Error, read annotations row $0", [rowText]);
+ break;
+ case " ace_security":
+ ariaLabel = nls("gutter.annotation.aria-label.security", "Security finding, read annotations row $0", [rowText]);
+ break;
+ case " ace_warning":
+ ariaLabel = nls("gutter.annotation.aria-label.warning", "Warning, read annotations row $0", [rowText]);
+ break;
+ case " ace_info":
+ ariaLabel = nls("gutter.annotation.aria-label.info", "Info, read annotations row $0", [rowText]);
+ break;
+ case " ace_hint":
+ ariaLabel = nls("gutter.annotation.aria-label.hint", "Suggestion, read annotations row $0", [rowText]);
+ break;
+ }
+ annotationNode.setAttribute("aria-label", ariaLabel);
annotationNode.setAttribute("tabindex", "-1");
annotationNode.setAttribute("role", "button");
}
@@ -16295,7 +16904,7 @@ var Marker = /** @class */ (function () {
this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br1 ace_start", config, null, extraStyle);
}
else {
- this.elt(clazz + " ace_br1 ace_start", "height:" + height + "px;" + "right:0;" + "top:" + top + "px;left:" + left + "px;" + (extraStyle || ""));
+ this.elt(clazz + " ace_br1 ace_start", "height:" + height + "px;" + "right:" + padding + "px;" + "top:" + top + "px;left:" + left + "px;" + (extraStyle || ""));
}
if (this.session.$bidiHandler.isBidiRow(range.end.row)) {
var range1 = range.clone();
@@ -16317,7 +16926,7 @@ var Marker = /** @class */ (function () {
top = this.$getTop(range.start.row + 1, config);
var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8);
this.elt(clazz + (radiusClass ? " ace_br" + radiusClass : ""), "height:" + height + "px;" +
- "right:0;" +
+ "right:" + padding + "px;" +
"top:" + top + "px;" +
"left:" + padding + "px;" + (extraStyle || ""));
};
@@ -16622,7 +17231,7 @@ var Text = /** @class */ (function () {
};
Text.prototype.$renderToken = function (parent, screenColumn, token, value) {
var self = this;
- var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g;
+ var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g;
var valueFragment = this.dom.createFragment(this.element);
var m;
var i = 0;
@@ -16684,7 +17293,7 @@ var Text = /** @class */ (function () {
var span = this.dom.createElement("span");
if (token.type == "fold") {
span.style.width = (token.value.length * this.config.characterWidth) + "px";
- span.setAttribute("title", nls("Unfold code"));
+ span.setAttribute("title", nls("inline-fold.closed.title", "Unfold code"));
}
span.className = classes;
span.appendChild(valueFragment);
@@ -16742,7 +17351,7 @@ var Text = /** @class */ (function () {
var ranges = this.session.$bracketHighlight.ranges;
for (var i = 0; i < ranges.length; i++) {
if (cursor.row !== ranges[i].start.row) {
- this.$highlightIndentGuideMarker.end = ranges[i].start.row;
+ this.$highlightIndentGuideMarker.end = ranges[i].start.row + 1;
if (cursor.row > ranges[i].start.row) {
this.$highlightIndentGuideMarker.dir = -1;
}
@@ -16770,24 +17379,24 @@ var Text = /** @class */ (function () {
this.$renderHighlightIndentGuide();
};
Text.prototype.$clearActiveIndentGuide = function () {
- var cells = this.$lines.cells;
- for (var i = 0; i < cells.length; i++) {
- var cell = cells[i];
- var childNodes = cell.element.childNodes;
- if (childNodes.length > 0) {
- for (var j = 0; j < childNodes.length; j++) {
- if (childNodes[j].classList && childNodes[j].classList.contains("ace_indent-guide-active")) {
- childNodes[j].classList.remove("ace_indent-guide-active");
- break;
- }
- }
- }
+ var activeIndentGuides = this.element.querySelectorAll(".ace_indent-guide-active");
+ for (var i = 0; i < activeIndentGuides.length; i++) {
+ activeIndentGuides[i].classList.remove("ace_indent-guide-active");
}
};
Text.prototype.$setIndentGuideActive = function (cell, indentLevel) {
var line = this.session.doc.getLine(cell.row);
if (line !== "") {
- var childNodes = cell.element.childNodes;
+ var element = cell.element;
+ if (cell.element.classList && cell.element.classList.contains("ace_line_group")) {
+ if (cell.element.childNodes.length > 0) {
+ element = cell.element.childNodes[0];
+ }
+ else {
+ return;
+ }
+ }
+ var childNodes = element.childNodes;
if (childNodes) {
var node = childNodes[indentLevel - 1];
if (node && node.classList && node.classList.contains("ace_indent-guide"))
@@ -16817,7 +17426,7 @@ var Text = /** @class */ (function () {
for (var i = cells.length - 1; i >= 0; i--) {
var cell = cells[i];
if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {
- if (cell.row <= this.$highlightIndentGuideMarker.end)
+ if (cell.row < this.$highlightIndentGuideMarker.end)
break;
this.$setIndentGuideActive(cell, indentLevel);
}
@@ -17743,7 +18352,7 @@ var FontMetrics = /** @class */ (function () {
FontMetrics.prototype.$getZoom = function (element) {
if (!element || !element.parentElement)
return 1;
- return (window.getComputedStyle(element)["zoom"] || 1) * this.$getZoom(element.parentElement);
+ return (Number(window.getComputedStyle(element)["zoom"]) || 1) * this.$getZoom(element.parentElement);
};
FontMetrics.prototype.$initTransformMeasureNodes = function () {
var t = function (t, l) {
@@ -17810,7 +18419,7 @@ for (var i = 1; i < 16; i++) {
}
styles.join("\\n")
*/
-module.exports = "\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: '';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=\");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n white-space: pre;\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}";
+module.exports = "\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n forced-color-adjust: none;\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n.ace_invisible {\n font-variant-ligatures: none;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: '';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: royalblue;\n}\n.ace_icon_svg.ace_hint {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==\");\n background-color: silver;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=\");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(33em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n position: relative;\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n z-index: 1;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: \"\u21A9\";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}\n\n.ace_hidden_token {\n display: none;\n}";
});
@@ -17935,7 +18544,7 @@ exports.Decorator = Decorator;
});
-ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"], function(require, exports, module){"use strict";
+ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"], function(require, exports, module){"use strict";
var oop = require("./lib/oop");
var dom = require("./lib/dom");
var lang = require("./lib/lang");
@@ -17954,6 +18563,7 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
var editorCss = require("./css/editor-css");
var Decorator = require("./layer/decorators").Decorator;
var useragent = require("./lib/useragent");
+var isTextToken = require("./layer/text_util").isTextToken;
dom.importCssString(editorCss, "ace_editor.css", false);
var VirtualRenderer = /** @class */ (function () {
function VirtualRenderer(container, theme) {
@@ -18148,6 +18758,12 @@ var VirtualRenderer = /** @class */ (function () {
var el = this.container;
if (!height)
height = el.clientHeight || el.scrollHeight;
+ if (!height && this.$maxLines && this.lineHeight > 1) {
+ if (!el.style.height || el.style.height == "0px") {
+ el.style.height = "1px";
+ height = el.clientHeight || el.scrollHeight;
+ }
+ }
if (!width)
width = el.clientWidth || el.scrollWidth;
var changes = this.$updateCachedSize(force, gutterWidth, width, height);
@@ -18609,8 +19225,10 @@ var VirtualRenderer = /** @class */ (function () {
this.scrollBarH.setVisible(horizScroll);
}
var vScrollBefore = this.$vScroll; // autosize can change vscroll value in which case we need to update longestLine
- if (this.$maxLines && this.lineHeight > 1)
+ if (this.$maxLines && this.lineHeight > 1) {
this.$autosize();
+ hideScrollbars = size.height <= 2 * this.lineHeight;
+ }
var minHeight = size.scrollerHeight + this.lineHeight;
var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd
? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
@@ -18991,8 +19609,8 @@ var VirtualRenderer = /** @class */ (function () {
var cursor = this.session.selection.cursor;
var insertPosition = position || { row: cursor.row, column: cursor.column };
this.removeGhostText();
- var textLines = text.split("\n");
- this.addToken(textLines[0], "ghost_text", insertPosition.row, insertPosition.column);
+ var textChunks = this.$calculateWrappedTextChunks(text, insertPosition);
+ this.addToken(textChunks[0].text, "ghost_text", insertPosition.row, insertPosition.column);
this.$ghostText = {
text: text,
position: {
@@ -19000,28 +19618,75 @@ var VirtualRenderer = /** @class */ (function () {
column: insertPosition.column
}
};
- if (textLines.length > 1) {
+ var widgetDiv = dom.createElement("div");
+ if (textChunks.length > 1) {
+ var hiddenTokens = this.hideTokensAfterPosition(insertPosition.row, insertPosition.column);
+ var lastLineDiv;
+ textChunks.slice(1).forEach(function (el) {
+ var chunkDiv = dom.createElement("div");
+ var chunkSpan = dom.createElement("span");
+ chunkSpan.className = "ace_ghost_text";
+ if (el.wrapped)
+ chunkDiv.className = "ghost_text_line_wrapped";
+ if (el.text.length === 0)
+ el.text = " ";
+ chunkSpan.appendChild(dom.createTextNode(el.text));
+ chunkDiv.appendChild(chunkSpan);
+ widgetDiv.appendChild(chunkDiv);
+ lastLineDiv = chunkDiv;
+ });
+ hiddenTokens.forEach(function (token) {
+ var element = dom.createElement("span");
+ if (!isTextToken(token.type))
+ element.className = "ace_" + token.type.replace(/\./g, " ace_");
+ element.appendChild(dom.createTextNode(token.value));
+ lastLineDiv.appendChild(element);
+ });
this.$ghostTextWidget = {
- text: textLines.slice(1).join("\n"),
+ el: widgetDiv,
row: insertPosition.row,
column: insertPosition.column,
- className: "ace_ghost_text"
+ className: "ace_ghost_text_container"
};
this.session.widgetManager.addLineWidget(this.$ghostTextWidget);
var pixelPosition = this.$cursorLayer.getPixelPosition(insertPosition, true);
var el = this.container;
var height = el.getBoundingClientRect().height;
- var ghostTextHeight = textLines.length * this.lineHeight;
- var fitsY = ghostTextHeight < height - pixelPosition.top;
+ var ghostTextHeight = textChunks.length * this.lineHeight;
+ var fitsY = ghostTextHeight < (height - pixelPosition.top);
if (fitsY)
return;
if (ghostTextHeight < height) {
- this.scrollBy(0, (textLines.length - 1) * this.lineHeight);
+ this.scrollBy(0, (textChunks.length - 1) * this.lineHeight);
+ }
+ else {
+ this.scrollToRow(insertPosition.row);
+ }
+ }
+ };
+ VirtualRenderer.prototype.$calculateWrappedTextChunks = function (text, position) {
+ var availableWidth = this.$size.scrollerWidth - this.$padding * 2;
+ var limit = Math.floor(availableWidth / this.characterWidth) - 2;
+ limit = limit <= 0 ? 60 : limit; // this is a hack to prevent the editor from crashing when the window is too small
+ var textLines = text.split(/\r?\n/);
+ var textChunks = [];
+ for (var i = 0; i < textLines.length; i++) {
+ var displayTokens = this.session.$getDisplayTokens(textLines[i], position.column);
+ var wrapSplits = this.session.$computeWrapSplits(displayTokens, limit, this.session.$tabSize);
+ if (wrapSplits.length > 0) {
+ var start = 0;
+ wrapSplits.push(textLines[i].length);
+ for (var j = 0; j < wrapSplits.length; j++) {
+ var textSlice = textLines[i].slice(start, wrapSplits[j]);
+ textChunks.push({ text: textSlice, wrapped: true });
+ start = wrapSplits[j];
+ }
}
else {
- this.scrollBy(0, pixelPosition.top);
+ textChunks.push({ text: textLines[i], wrapped: false });
}
}
+ return textChunks;
};
VirtualRenderer.prototype.removeGhostText = function () {
if (!this.$ghostText)
@@ -19058,6 +19723,28 @@ var VirtualRenderer = /** @class */ (function () {
}
this.updateLines(row, row);
};
+ VirtualRenderer.prototype.hideTokensAfterPosition = function (row, column) {
+ var tokens = this.session.getTokens(row);
+ var l = 0;
+ var hasPassedCursor = false;
+ var hiddenTokens = [];
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ l += token.value.length;
+ if (token.type === "ghost_text")
+ continue;
+ if (hasPassedCursor) {
+ hiddenTokens.push({ type: token.type, value: token.value });
+ token.type = "hidden_token";
+ continue;
+ }
+ if (l === column) {
+ hasPassedCursor = true;
+ }
+ }
+ this.updateLines(row, row);
+ return hiddenTokens;
+ };
VirtualRenderer.prototype.removeExtraToken = function (row, column) {
this.session.bgTokenizer.lines[row] = null;
this.updateLines(row, row);
@@ -19097,6 +19784,10 @@ var VirtualRenderer = /** @class */ (function () {
}
_self._dispatchEvent('themeLoaded', { theme: module });
cb && cb();
+ if (useragent.isSafari && _self.scroller) {
+ _self.scroller.style.background = "red";
+ _self.scroller.style.background = "";
+ }
}
};
VirtualRenderer.prototype.getTheme = function () {
@@ -20822,8 +21513,7 @@ var FoldMode = exports.FoldMode = function () { };
});
-ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"], function(require, exports, module){"use strict";
-var LineWidgets = require("../line_widgets").LineWidgets;
+ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"], function(require, exports, module){"use strict";
var dom = require("../lib/dom");
var Range = require("../range").Range;
var nls = require("../config").nls;
@@ -20873,10 +21563,6 @@ function findAnnotations(session, row, dir) {
}
exports.showErrorMarker = function (editor, dir) {
var session = editor.session;
- if (!session.widgetManager) {
- session.widgetManager = new LineWidgets(session);
- session.widgetManager.attach(editor);
- }
var pos = editor.getCursorPosition();
var row = pos.row;
var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function (w) {
@@ -20903,7 +21589,7 @@ exports.showErrorMarker = function (editor, dir) {
}
else {
gutterAnno = {
- text: [nls("Looks good!")],
+ displayText: [nls("error-marker.good-state", "Looks good!")],
className: "ace_ok"
};
}
@@ -20924,7 +21610,12 @@ exports.showErrorMarker = function (editor, dir) {
arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px";
w.el.className = "error_widget_wrapper";
el.className = "error_widget " + gutterAnno.className;
- el.innerHTML = gutterAnno.text.join("
");
+ gutterAnno.displayText.forEach(function (annoTextLine, i) {
+ el.appendChild(dom.createTextNode(annoTextLine));
+ if (i < gutterAnno.displayText.length - 1) {
+ el.appendChild(dom.createElement("br"));
+ }
+ });
el.appendChild(dom.createElement("div"));
var kb = function (_, hashId, keyString) {
if (hashId === 0 && (keyString === "esc" || keyString === "return")) {
@@ -21021,7 +21712,8 @@ exports.Editor = Editor;
exports.EditSession = EditSession;
exports.UndoManager = UndoManager;
exports.VirtualRenderer = Renderer;
-exports.version = exports.config.version;
+var version = exports.config.version;
+exports.version = version;
}); (function() {
ace.require(["ace/ace"], function(a) {
diff --git a/modules/lib/ace/ext-code_lens.js b/modules/lib/ace/ext-code_lens.js
index a80e73e..5109ab8 100644
--- a/modules/lib/ace/ext-code_lens.js
+++ b/modules/lib/ace/ext-code_lens.js
@@ -1,5 +1,4 @@
-ace.define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"], function(require, exports, module){"use strict";
-var LineWidgets = require("../line_widgets").LineWidgets;
+ace.define("ace/ext/code_lens",["require","exports","module","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"], function(require, exports, module){"use strict";
var event = require("../lib/event");
var lang = require("../lib/lang");
var dom = require("../lib/dom");
@@ -121,10 +120,6 @@ function attachToEditor(editor) {
var session = editor.session;
if (!session)
return;
- if (!session.widgetManager) {
- session.widgetManager = new LineWidgets(session);
- session.widgetManager.attach(editor);
- }
var providersToWaitNum = editor.codeLensProviders.length;
var lenses = [];
editor.codeLensProviders.forEach(function (provider) {
diff --git a/modules/lib/ace/ext-inline_autocomplete.js b/modules/lib/ace/ext-inline_autocomplete.js
index b0ce0a1..93807fb 100644
--- a/modules/lib/ace/ext-inline_autocomplete.js
+++ b/modules/lib/ace/ext-inline_autocomplete.js
@@ -1135,8 +1135,8 @@ var AcePopup = /** @class */ (function () {
popup.renderer.content.style.cursor = "default";
popup.renderer.setStyle("ace_autocomplete");
popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole);
- popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("Autocomplete suggestions"));
- popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("autocomplete.popup.aria-roledescription", "Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-label", nls("autocomplete.popup.aria-label", "Autocomplete suggestions"));
popup.renderer.textarea.setAttribute("aria-hidden", "true");
popup.setOption("displayIndentGuides", false);
popup.setOption("dragDelay", 150);
@@ -1197,6 +1197,26 @@ var AcePopup = /** @class */ (function () {
setHoverMarker(row, true);
}
});
+ popup.renderer.on("afterRender", function () {
+ var t = popup.renderer.$textLayer;
+ for (var row = t.config.firstRow, l = t.config.lastRow; row <= l; row++) {
+ var popupRowElement = /** @type {HTMLElement|null} */ (t.element.childNodes[row - t.config.firstRow]);
+ popupRowElement.setAttribute("role", optionAriaRole);
+ popupRowElement.setAttribute("aria-roledescription", nls("autocomplete.popup.item.aria-roledescription", "item"));
+ popupRowElement.setAttribute("aria-setsize", popup.data.length);
+ popupRowElement.setAttribute("aria-describedby", "doc-tooltip");
+ popupRowElement.setAttribute("aria-posinset", row + 1);
+ var rowData = popup.getData(row);
+ if (rowData) {
+ var ariaLabel = "".concat(rowData.caption || rowData.value).concat(rowData.meta ? ", ".concat(rowData.meta) : '');
+ popupRowElement.setAttribute("aria-label", ariaLabel);
+ }
+ var highlightedSpans = popupRowElement.querySelectorAll(".ace_completion-highlight");
+ highlightedSpans.forEach(function (span) {
+ span.setAttribute("role", "mark");
+ });
+ }
+ });
popup.renderer.on("afterRender", function () {
var row = popup.getRow();
var t = popup.renderer.$textLayer;
@@ -1204,23 +1224,17 @@ var AcePopup = /** @class */ (function () {
var el = document.activeElement; // Active element is textarea of main editor
if (selected !== popup.selectedNode && popup.selectedNode) {
dom.removeCssClass(popup.selectedNode, "ace_selected");
- el.removeAttribute("aria-activedescendant");
popup.selectedNode.removeAttribute(ariaActiveState);
popup.selectedNode.removeAttribute("id");
}
+ el.removeAttribute("aria-activedescendant");
popup.selectedNode = selected;
if (selected) {
- dom.addCssClass(selected, "ace_selected");
var ariaId = getAriaId(row);
+ dom.addCssClass(selected, "ace_selected");
selected.id = ariaId;
t.element.setAttribute("aria-activedescendant", ariaId);
el.setAttribute("aria-activedescendant", ariaId);
- selected.setAttribute("role", optionAriaRole);
- selected.setAttribute("aria-roledescription", nls("item"));
- selected.setAttribute("aria-label", popup.getData(row).caption || popup.getData(row).value);
- selected.setAttribute("aria-setsize", popup.data.length);
- selected.setAttribute("aria-posinset", row + 1);
- selected.setAttribute("aria-describedby", "doc-tooltip");
selected.setAttribute(ariaActiveState, "true");
}
});
@@ -1345,8 +1359,9 @@ var AcePopup = /** @class */ (function () {
return true;
}
var el = this.container;
- var screenHeight = window.innerHeight;
- var screenWidth = window.innerWidth;
+ var scrollBarSize = this.renderer.scrollBar.width || 10;
+ var screenHeight = window.innerHeight - scrollBarSize;
+ var screenWidth = window.innerWidth - scrollBarSize;
var renderer = this.renderer;
var maxH = renderer.$maxLines * lineHeight * 1.4;
var dims = { top: 0, bottom: 0, left: 0 };
@@ -1385,7 +1400,7 @@ var AcePopup = /** @class */ (function () {
}
if (anchor === "top") {
el.style.top = "";
- el.style.bottom = (screenHeight - dims.bottom) + "px";
+ el.style.bottom = (screenHeight + scrollBarSize - dims.bottom) + "px";
popup.isTopdown = false;
}
else {
@@ -1439,7 +1454,7 @@ var AcePopup = /** @class */ (function () {
}
return AcePopup;
}());
-dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
+dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
exports.AcePopup = AcePopup;
exports.$singleLineEditor = $singleLineEditor;
exports.getAriaId = getAriaId;
@@ -1497,14 +1512,13 @@ exports.getCompletionPrefix = function (editor) {
}.bind(this));
return prefix || this.retrievePrecedingIdentifier(line, pos.column);
};
-exports.triggerAutocomplete = function (editor) {
- var pos = editor.getCursorPosition();
- var line = editor.session.getLine(pos.row);
- var column = (pos.column === 0) ? 0 : pos.column - 1;
- var previousChar = line[column];
- return editor.completers.some(function (el) {
- if (el.triggerCharacters && Array.isArray(el.triggerCharacters)) {
- return el.triggerCharacters.includes(previousChar);
+exports.triggerAutocomplete = function (editor, previousChar) {
+ var previousChar = previousChar == null
+ ? editor.session.getPrecedingCharacter()
+ : previousChar;
+ return editor.completers.some(function (completer) {
+ if (completer.triggerCharacters && Array.isArray(completer.triggerCharacters)) {
+ return completer.triggerCharacters.includes(previousChar);
}
});
};
@@ -1565,7 +1579,7 @@ var Autocomplete = /** @class */ (function () {
Object.defineProperty(Autocomplete, "completionsForLoading", {
get: function () {
return [{
- caption: config.nls("Loading..."),
+ caption: config.nls("autocomplete.loading", "Loading..."),
value: ""
}];
},
@@ -1755,9 +1769,6 @@ var Autocomplete = /** @class */ (function () {
this.updateDocTooltip();
}
}
- else if (keepPopupPosition && !prefix) {
- this.detach();
- }
this.changeTimer.cancel();
this.observeLayoutChanges();
};
@@ -1810,7 +1821,7 @@ var Autocomplete = /** @class */ (function () {
this.detach();
};
Autocomplete.prototype.mousewheelListener = function (e) {
- if (!this.popup.isMouseOver)
+ if (this.popup && !this.popup.isMouseOver)
this.detach();
};
Autocomplete.prototype.mouseOutListener = function (e) {
@@ -1912,6 +1923,7 @@ var Autocomplete = /** @class */ (function () {
this.completions = new FilteredList(completionsForEmpty);
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", false);
+ this.popup.renderer.setStyle("ace_empty-message", true);
return;
}
return this.detach();
@@ -1926,6 +1938,7 @@ var Autocomplete = /** @class */ (function () {
new FilteredList(Autocomplete.completionsForLoading.concat(filtered), completions.filterText) :
completions;
this.openPopup(this.editor, prefix, keepPopupPosition);
+ this.popup.renderer.setStyle("ace_empty-message", false);
this.popup.renderer.setStyle("ace_loading", !finished);
}.bind(this));
if (this.showLoadingState && !this.autoShown && !(this.popup && this.popup.isOpen)) {
@@ -1937,7 +1950,7 @@ var Autocomplete = /** @class */ (function () {
};
Autocomplete.prototype.updateDocTooltip = function () {
var popup = this.popup;
- var all = this.completions.filtered;
+ var all = this.completions && this.completions.filtered;
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
var doc = null;
if (!selected || !this.editor || !this.popup.isOpen)
@@ -1985,33 +1998,54 @@ var Autocomplete = /** @class */ (function () {
this.popup.container.appendChild(this.tooltipNode);
var popup = this.popup;
var rect = popup.container.getBoundingClientRect();
- tooltipNode.style.top = popup.container.style.top;
- tooltipNode.style.bottom = popup.container.style.bottom;
- tooltipNode.style.display = "block";
- if (window.innerWidth - rect.right < 320) {
- if (rect.left < 320) {
- if (popup.isTopdown) {
- tooltipNode.style.top = rect.bottom + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
- else {
- tooltipNode.style.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
+ var targetWidth = 400;
+ var targetHeight = 300;
+ var scrollBarSize = popup.renderer.scrollBar.width || 10;
+ var leftSize = rect.left;
+ var rightSize = window.innerWidth - rect.right - scrollBarSize;
+ var topSize = popup.isTopdown ? rect.top : window.innerHeight - scrollBarSize - rect.bottom;
+ var scores = [
+ Math.min(rightSize / targetWidth, 1),
+ Math.min(leftSize / targetWidth, 1),
+ Math.min(topSize / targetHeight * 0.9),
+ ];
+ var max = Math.max.apply(Math, scores);
+ var tooltipStyle = tooltipNode.style;
+ tooltipStyle.display = "block";
+ if (max == scores[0]) {
+ tooltipStyle.left = (rect.right + 1) + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[1]) {
+ tooltipStyle.right = window.innerWidth - rect.left + "px";
+ tooltipStyle.left = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[2]) {
+ tooltipStyle.left = window.innerWidth - rect.left + "px";
+ tooltipStyle.maxWidth = Math.min(targetWidth, window.innerWidth) + "px";
+ if (popup.isTopdown) {
+ tooltipStyle.top = rect.bottom + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.bottom, targetHeight) + "px";
}
else {
- tooltipNode.style.right = window.innerWidth - rect.left + "px";
- tooltipNode.style.left = "";
+ tooltipStyle.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(popup.container.offsetTop, targetHeight) + "px";
}
}
- else {
- tooltipNode.style.left = (rect.right + 1) + "px";
- tooltipNode.style.right = "";
- }
};
Autocomplete.prototype.hideDocTooltip = function () {
this.tooltipTimer.cancel();
@@ -2049,6 +2083,25 @@ var Autocomplete = /** @class */ (function () {
}
this.inlineRenderer = this.popup = this.editor = null;
};
+ Autocomplete.for = function (editor) {
+ if (editor.completer instanceof Autocomplete) {
+ return editor.completer;
+ }
+ if (editor.completer) {
+ editor.completer.destroy();
+ editor.completer = null;
+ }
+ if (config.get("sharedPopups")) {
+ if (!Autocomplete["$sharedInstance"])
+ Autocomplete["$sharedInstance"] = new Autocomplete();
+ editor.completer = Autocomplete["$sharedInstance"];
+ }
+ else {
+ editor.completer = new Autocomplete();
+ editor.once("destroy", destroyCompleter);
+ }
+ return editor.completer;
+ };
return Autocomplete;
}());
Autocomplete.prototype.commands = {
@@ -2066,28 +2119,15 @@ Autocomplete.prototype.commands = {
else
return result;
},
+ "Backspace": function (editor) {
+ editor.execCommand("backspace");
+ var prefix = util.getCompletionPrefix(editor);
+ if (!prefix && editor.completer)
+ editor.completer.detach();
+ },
"PageUp": function (editor) { editor.completer.popup.gotoPageUp(); },
"PageDown": function (editor) { editor.completer.popup.gotoPageDown(); }
};
-Autocomplete.for = function (editor) {
- if (editor.completer instanceof Autocomplete) {
- return editor.completer;
- }
- if (editor.completer) {
- editor.completer.destroy();
- editor.completer = null;
- }
- if (config.get("sharedPopups")) {
- if (!Autocomplete["$sharedInstance"])
- Autocomplete["$sharedInstance"] = new Autocomplete();
- editor.completer = Autocomplete["$sharedInstance"];
- }
- else {
- editor.completer = new Autocomplete();
- editor.once("destroy", destroyCompleter);
- }
- return editor.completer;
-};
Autocomplete.startCommand = {
name: "startAutocomplete",
exec: function (editor, options) {
@@ -2269,6 +2309,11 @@ var FilteredList = /** @class */ (function () {
var upper = needle.toUpperCase();
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
+ if (item.skipFilter) {
+ item.$score = item.score;
+ results.push(item);
+ continue;
+ }
var caption = (!this.ignoreCaption && item.caption) || item.value || item.snippet;
if (!caption)
continue;
@@ -2958,7 +3003,8 @@ var liveAutocompleteTimer = lang.delayedCall(function () {
var showLiveAutocomplete = function (e) {
var editor = e.editor;
var prefix = util.getCompletionPrefix(editor);
- var triggerAutocomplete = util.triggerAutocomplete(editor);
+ var previousChar = e.args;
+ var triggerAutocomplete = util.triggerAutocomplete(editor, previousChar);
if (prefix && prefix.length >= editor.$liveAutocompletionThreshold || triggerAutocomplete) {
var completer = Autocomplete.for(editor);
completer.autoShown = true;
diff --git a/modules/lib/ace/ext-language_tools.js b/modules/lib/ace/ext-language_tools.js
index 6e26714..d3f51e6 100644
--- a/modules/lib/ace/ext-language_tools.js
+++ b/modules/lib/ace/ext-language_tools.js
@@ -1021,8 +1021,8 @@ var AcePopup = /** @class */ (function () {
popup.renderer.content.style.cursor = "default";
popup.renderer.setStyle("ace_autocomplete");
popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole);
- popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("Autocomplete suggestions"));
- popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("autocomplete.popup.aria-roledescription", "Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-label", nls("autocomplete.popup.aria-label", "Autocomplete suggestions"));
popup.renderer.textarea.setAttribute("aria-hidden", "true");
popup.setOption("displayIndentGuides", false);
popup.setOption("dragDelay", 150);
@@ -1083,6 +1083,26 @@ var AcePopup = /** @class */ (function () {
setHoverMarker(row, true);
}
});
+ popup.renderer.on("afterRender", function () {
+ var t = popup.renderer.$textLayer;
+ for (var row = t.config.firstRow, l = t.config.lastRow; row <= l; row++) {
+ var popupRowElement = /** @type {HTMLElement|null} */ (t.element.childNodes[row - t.config.firstRow]);
+ popupRowElement.setAttribute("role", optionAriaRole);
+ popupRowElement.setAttribute("aria-roledescription", nls("autocomplete.popup.item.aria-roledescription", "item"));
+ popupRowElement.setAttribute("aria-setsize", popup.data.length);
+ popupRowElement.setAttribute("aria-describedby", "doc-tooltip");
+ popupRowElement.setAttribute("aria-posinset", row + 1);
+ var rowData = popup.getData(row);
+ if (rowData) {
+ var ariaLabel = "".concat(rowData.caption || rowData.value).concat(rowData.meta ? ", ".concat(rowData.meta) : '');
+ popupRowElement.setAttribute("aria-label", ariaLabel);
+ }
+ var highlightedSpans = popupRowElement.querySelectorAll(".ace_completion-highlight");
+ highlightedSpans.forEach(function (span) {
+ span.setAttribute("role", "mark");
+ });
+ }
+ });
popup.renderer.on("afterRender", function () {
var row = popup.getRow();
var t = popup.renderer.$textLayer;
@@ -1090,23 +1110,17 @@ var AcePopup = /** @class */ (function () {
var el = document.activeElement; // Active element is textarea of main editor
if (selected !== popup.selectedNode && popup.selectedNode) {
dom.removeCssClass(popup.selectedNode, "ace_selected");
- el.removeAttribute("aria-activedescendant");
popup.selectedNode.removeAttribute(ariaActiveState);
popup.selectedNode.removeAttribute("id");
}
+ el.removeAttribute("aria-activedescendant");
popup.selectedNode = selected;
if (selected) {
- dom.addCssClass(selected, "ace_selected");
var ariaId = getAriaId(row);
+ dom.addCssClass(selected, "ace_selected");
selected.id = ariaId;
t.element.setAttribute("aria-activedescendant", ariaId);
el.setAttribute("aria-activedescendant", ariaId);
- selected.setAttribute("role", optionAriaRole);
- selected.setAttribute("aria-roledescription", nls("item"));
- selected.setAttribute("aria-label", popup.getData(row).caption || popup.getData(row).value);
- selected.setAttribute("aria-setsize", popup.data.length);
- selected.setAttribute("aria-posinset", row + 1);
- selected.setAttribute("aria-describedby", "doc-tooltip");
selected.setAttribute(ariaActiveState, "true");
}
});
@@ -1231,8 +1245,9 @@ var AcePopup = /** @class */ (function () {
return true;
}
var el = this.container;
- var screenHeight = window.innerHeight;
- var screenWidth = window.innerWidth;
+ var scrollBarSize = this.renderer.scrollBar.width || 10;
+ var screenHeight = window.innerHeight - scrollBarSize;
+ var screenWidth = window.innerWidth - scrollBarSize;
var renderer = this.renderer;
var maxH = renderer.$maxLines * lineHeight * 1.4;
var dims = { top: 0, bottom: 0, left: 0 };
@@ -1271,7 +1286,7 @@ var AcePopup = /** @class */ (function () {
}
if (anchor === "top") {
el.style.top = "";
- el.style.bottom = (screenHeight - dims.bottom) + "px";
+ el.style.bottom = (screenHeight + scrollBarSize - dims.bottom) + "px";
popup.isTopdown = false;
}
else {
@@ -1325,7 +1340,7 @@ var AcePopup = /** @class */ (function () {
}
return AcePopup;
}());
-dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
+dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
exports.AcePopup = AcePopup;
exports.$singleLineEditor = $singleLineEditor;
exports.getAriaId = getAriaId;
@@ -1497,14 +1512,13 @@ exports.getCompletionPrefix = function (editor) {
}.bind(this));
return prefix || this.retrievePrecedingIdentifier(line, pos.column);
};
-exports.triggerAutocomplete = function (editor) {
- var pos = editor.getCursorPosition();
- var line = editor.session.getLine(pos.row);
- var column = (pos.column === 0) ? 0 : pos.column - 1;
- var previousChar = line[column];
- return editor.completers.some(function (el) {
- if (el.triggerCharacters && Array.isArray(el.triggerCharacters)) {
- return el.triggerCharacters.includes(previousChar);
+exports.triggerAutocomplete = function (editor, previousChar) {
+ var previousChar = previousChar == null
+ ? editor.session.getPrecedingCharacter()
+ : previousChar;
+ return editor.completers.some(function (completer) {
+ if (completer.triggerCharacters && Array.isArray(completer.triggerCharacters)) {
+ return completer.triggerCharacters.includes(previousChar);
}
});
};
@@ -1565,7 +1579,7 @@ var Autocomplete = /** @class */ (function () {
Object.defineProperty(Autocomplete, "completionsForLoading", {
get: function () {
return [{
- caption: config.nls("Loading..."),
+ caption: config.nls("autocomplete.loading", "Loading..."),
value: ""
}];
},
@@ -1755,9 +1769,6 @@ var Autocomplete = /** @class */ (function () {
this.updateDocTooltip();
}
}
- else if (keepPopupPosition && !prefix) {
- this.detach();
- }
this.changeTimer.cancel();
this.observeLayoutChanges();
};
@@ -1810,7 +1821,7 @@ var Autocomplete = /** @class */ (function () {
this.detach();
};
Autocomplete.prototype.mousewheelListener = function (e) {
- if (!this.popup.isMouseOver)
+ if (this.popup && !this.popup.isMouseOver)
this.detach();
};
Autocomplete.prototype.mouseOutListener = function (e) {
@@ -1912,6 +1923,7 @@ var Autocomplete = /** @class */ (function () {
this.completions = new FilteredList(completionsForEmpty);
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", false);
+ this.popup.renderer.setStyle("ace_empty-message", true);
return;
}
return this.detach();
@@ -1926,6 +1938,7 @@ var Autocomplete = /** @class */ (function () {
new FilteredList(Autocomplete.completionsForLoading.concat(filtered), completions.filterText) :
completions;
this.openPopup(this.editor, prefix, keepPopupPosition);
+ this.popup.renderer.setStyle("ace_empty-message", false);
this.popup.renderer.setStyle("ace_loading", !finished);
}.bind(this));
if (this.showLoadingState && !this.autoShown && !(this.popup && this.popup.isOpen)) {
@@ -1937,7 +1950,7 @@ var Autocomplete = /** @class */ (function () {
};
Autocomplete.prototype.updateDocTooltip = function () {
var popup = this.popup;
- var all = this.completions.filtered;
+ var all = this.completions && this.completions.filtered;
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
var doc = null;
if (!selected || !this.editor || !this.popup.isOpen)
@@ -1985,33 +1998,54 @@ var Autocomplete = /** @class */ (function () {
this.popup.container.appendChild(this.tooltipNode);
var popup = this.popup;
var rect = popup.container.getBoundingClientRect();
- tooltipNode.style.top = popup.container.style.top;
- tooltipNode.style.bottom = popup.container.style.bottom;
- tooltipNode.style.display = "block";
- if (window.innerWidth - rect.right < 320) {
- if (rect.left < 320) {
- if (popup.isTopdown) {
- tooltipNode.style.top = rect.bottom + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
- else {
- tooltipNode.style.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
+ var targetWidth = 400;
+ var targetHeight = 300;
+ var scrollBarSize = popup.renderer.scrollBar.width || 10;
+ var leftSize = rect.left;
+ var rightSize = window.innerWidth - rect.right - scrollBarSize;
+ var topSize = popup.isTopdown ? rect.top : window.innerHeight - scrollBarSize - rect.bottom;
+ var scores = [
+ Math.min(rightSize / targetWidth, 1),
+ Math.min(leftSize / targetWidth, 1),
+ Math.min(topSize / targetHeight * 0.9),
+ ];
+ var max = Math.max.apply(Math, scores);
+ var tooltipStyle = tooltipNode.style;
+ tooltipStyle.display = "block";
+ if (max == scores[0]) {
+ tooltipStyle.left = (rect.right + 1) + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[1]) {
+ tooltipStyle.right = window.innerWidth - rect.left + "px";
+ tooltipStyle.left = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[2]) {
+ tooltipStyle.left = window.innerWidth - rect.left + "px";
+ tooltipStyle.maxWidth = Math.min(targetWidth, window.innerWidth) + "px";
+ if (popup.isTopdown) {
+ tooltipStyle.top = rect.bottom + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.bottom, targetHeight) + "px";
}
else {
- tooltipNode.style.right = window.innerWidth - rect.left + "px";
- tooltipNode.style.left = "";
+ tooltipStyle.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(popup.container.offsetTop, targetHeight) + "px";
}
}
- else {
- tooltipNode.style.left = (rect.right + 1) + "px";
- tooltipNode.style.right = "";
- }
};
Autocomplete.prototype.hideDocTooltip = function () {
this.tooltipTimer.cancel();
@@ -2049,6 +2083,25 @@ var Autocomplete = /** @class */ (function () {
}
this.inlineRenderer = this.popup = this.editor = null;
};
+ Autocomplete.for = function (editor) {
+ if (editor.completer instanceof Autocomplete) {
+ return editor.completer;
+ }
+ if (editor.completer) {
+ editor.completer.destroy();
+ editor.completer = null;
+ }
+ if (config.get("sharedPopups")) {
+ if (!Autocomplete["$sharedInstance"])
+ Autocomplete["$sharedInstance"] = new Autocomplete();
+ editor.completer = Autocomplete["$sharedInstance"];
+ }
+ else {
+ editor.completer = new Autocomplete();
+ editor.once("destroy", destroyCompleter);
+ }
+ return editor.completer;
+ };
return Autocomplete;
}());
Autocomplete.prototype.commands = {
@@ -2066,28 +2119,15 @@ Autocomplete.prototype.commands = {
else
return result;
},
+ "Backspace": function (editor) {
+ editor.execCommand("backspace");
+ var prefix = util.getCompletionPrefix(editor);
+ if (!prefix && editor.completer)
+ editor.completer.detach();
+ },
"PageUp": function (editor) { editor.completer.popup.gotoPageUp(); },
"PageDown": function (editor) { editor.completer.popup.gotoPageDown(); }
};
-Autocomplete.for = function (editor) {
- if (editor.completer instanceof Autocomplete) {
- return editor.completer;
- }
- if (editor.completer) {
- editor.completer.destroy();
- editor.completer = null;
- }
- if (config.get("sharedPopups")) {
- if (!Autocomplete["$sharedInstance"])
- Autocomplete["$sharedInstance"] = new Autocomplete();
- editor.completer = Autocomplete["$sharedInstance"];
- }
- else {
- editor.completer = new Autocomplete();
- editor.once("destroy", destroyCompleter);
- }
- return editor.completer;
-};
Autocomplete.startCommand = {
name: "startAutocomplete",
exec: function (editor, options) {
@@ -2269,6 +2309,11 @@ var FilteredList = /** @class */ (function () {
var upper = needle.toUpperCase();
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
+ if (item.skipFilter) {
+ item.$score = item.score;
+ results.push(item);
+ continue;
+ }
var caption = (!this.ignoreCaption && item.caption) || item.value || item.snippet;
if (!caption)
continue;
@@ -2505,7 +2550,8 @@ var liveAutocompleteTimer = lang.delayedCall(function () {
var showLiveAutocomplete = function (e) {
var editor = e.editor;
var prefix = util.getCompletionPrefix(editor);
- var triggerAutocomplete = util.triggerAutocomplete(editor);
+ var previousChar = e.args;
+ var triggerAutocomplete = util.triggerAutocomplete(editor, previousChar);
if (prefix && prefix.length >= editor.$liveAutocompletionThreshold || triggerAutocomplete) {
var completer = Autocomplete.for(editor);
completer.autoShown = true;
diff --git a/modules/lib/ace/ext-modelist.js b/modules/lib/ace/ext-modelist.js
index 9d1ef3e..f18395f 100644
--- a/modules/lib/ace/ext-modelist.js
+++ b/modules/lib/ace/ext-modelist.js
@@ -24,7 +24,7 @@ var Mode = /** @class */ (function () {
}) + "$";
}
else {
- re = "^.*\\.(" + extensions + ")$";
+ re = "\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
@@ -49,6 +49,7 @@ var supportedModes = {
Astro: ["astro"],
AutoHotKey: ["ahk"],
BatchFile: ["bat|cmd"],
+ Basic: ["bas|bak"],
BibTeX: ["bib"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
C9Search: ["c9search_results"],
@@ -63,6 +64,7 @@ var supportedModes = {
Csound_Orchestra: ["orc"],
Csound_Score: ["sco"],
CSS: ["css"],
+ CSV: ["csv"],
Curly: ["curly"],
Cuttlefish: ["conf"],
D: ["d|di"],
@@ -205,6 +207,7 @@ var supportedModes = {
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
+ TSV: ["tsv"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
diff --git a/modules/lib/ace/ext-options.js b/modules/lib/ace/ext-options.js
index 6a8ee43..958d8db 100644
--- a/modules/lib/ace/ext-options.js
+++ b/modules/lib/ace/ext-options.js
@@ -85,7 +85,7 @@ var Mode = /** @class */ (function () {
}) + "$";
}
else {
- re = "^.*\\.(" + extensions + ")$";
+ re = "\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
@@ -110,6 +110,7 @@ var supportedModes = {
Astro: ["astro"],
AutoHotKey: ["ahk"],
BatchFile: ["bat|cmd"],
+ Basic: ["bas|bak"],
BibTeX: ["bib"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
C9Search: ["c9search_results"],
@@ -124,6 +125,7 @@ var supportedModes = {
Csound_Orchestra: ["orc"],
Csound_Score: ["sco"],
CSS: ["css"],
+ CSV: ["csv"],
Curly: ["curly"],
Cuttlefish: ["conf"],
D: ["d|di"],
@@ -266,6 +268,7 @@ var supportedModes = {
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
+ TSV: ["tsv"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
@@ -332,7 +335,8 @@ var themeData = [
["Dawn"],
["Dreamweaver"],
["Eclipse"],
- ["GitHub"],
+ ["GitHub Light Default"],
+ ["GitHub (Legacy)", "github", "light"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
diff --git a/modules/lib/ace/ext-prompt.js b/modules/lib/ace/ext-prompt.js
index 5d35895..4c04b69 100644
--- a/modules/lib/ace/ext-prompt.js
+++ b/modules/lib/ace/ext-prompt.js
@@ -36,8 +36,8 @@ var AcePopup = /** @class */ (function () {
popup.renderer.content.style.cursor = "default";
popup.renderer.setStyle("ace_autocomplete");
popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole);
- popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("Autocomplete suggestions"));
- popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("autocomplete.popup.aria-roledescription", "Autocomplete suggestions"));
+ popup.renderer.$textLayer.element.setAttribute("aria-label", nls("autocomplete.popup.aria-label", "Autocomplete suggestions"));
popup.renderer.textarea.setAttribute("aria-hidden", "true");
popup.setOption("displayIndentGuides", false);
popup.setOption("dragDelay", 150);
@@ -98,6 +98,26 @@ var AcePopup = /** @class */ (function () {
setHoverMarker(row, true);
}
});
+ popup.renderer.on("afterRender", function () {
+ var t = popup.renderer.$textLayer;
+ for (var row = t.config.firstRow, l = t.config.lastRow; row <= l; row++) {
+ var popupRowElement = /** @type {HTMLElement|null} */ (t.element.childNodes[row - t.config.firstRow]);
+ popupRowElement.setAttribute("role", optionAriaRole);
+ popupRowElement.setAttribute("aria-roledescription", nls("autocomplete.popup.item.aria-roledescription", "item"));
+ popupRowElement.setAttribute("aria-setsize", popup.data.length);
+ popupRowElement.setAttribute("aria-describedby", "doc-tooltip");
+ popupRowElement.setAttribute("aria-posinset", row + 1);
+ var rowData = popup.getData(row);
+ if (rowData) {
+ var ariaLabel = "".concat(rowData.caption || rowData.value).concat(rowData.meta ? ", ".concat(rowData.meta) : '');
+ popupRowElement.setAttribute("aria-label", ariaLabel);
+ }
+ var highlightedSpans = popupRowElement.querySelectorAll(".ace_completion-highlight");
+ highlightedSpans.forEach(function (span) {
+ span.setAttribute("role", "mark");
+ });
+ }
+ });
popup.renderer.on("afterRender", function () {
var row = popup.getRow();
var t = popup.renderer.$textLayer;
@@ -105,23 +125,17 @@ var AcePopup = /** @class */ (function () {
var el = document.activeElement; // Active element is textarea of main editor
if (selected !== popup.selectedNode && popup.selectedNode) {
dom.removeCssClass(popup.selectedNode, "ace_selected");
- el.removeAttribute("aria-activedescendant");
popup.selectedNode.removeAttribute(ariaActiveState);
popup.selectedNode.removeAttribute("id");
}
+ el.removeAttribute("aria-activedescendant");
popup.selectedNode = selected;
if (selected) {
- dom.addCssClass(selected, "ace_selected");
var ariaId = getAriaId(row);
+ dom.addCssClass(selected, "ace_selected");
selected.id = ariaId;
t.element.setAttribute("aria-activedescendant", ariaId);
el.setAttribute("aria-activedescendant", ariaId);
- selected.setAttribute("role", optionAriaRole);
- selected.setAttribute("aria-roledescription", nls("item"));
- selected.setAttribute("aria-label", popup.getData(row).caption || popup.getData(row).value);
- selected.setAttribute("aria-setsize", popup.data.length);
- selected.setAttribute("aria-posinset", row + 1);
- selected.setAttribute("aria-describedby", "doc-tooltip");
selected.setAttribute(ariaActiveState, "true");
}
});
@@ -246,8 +260,9 @@ var AcePopup = /** @class */ (function () {
return true;
}
var el = this.container;
- var screenHeight = window.innerHeight;
- var screenWidth = window.innerWidth;
+ var scrollBarSize = this.renderer.scrollBar.width || 10;
+ var screenHeight = window.innerHeight - scrollBarSize;
+ var screenWidth = window.innerWidth - scrollBarSize;
var renderer = this.renderer;
var maxH = renderer.$maxLines * lineHeight * 1.4;
var dims = { top: 0, bottom: 0, left: 0 };
@@ -286,7 +301,7 @@ var AcePopup = /** @class */ (function () {
}
if (anchor === "top") {
el.style.top = "";
- el.style.bottom = (screenHeight - dims.bottom) + "px";
+ el.style.bottom = (screenHeight + scrollBarSize - dims.bottom) + "px";
popup.isTopdown = false;
}
else {
@@ -340,7 +355,7 @@ var AcePopup = /** @class */ (function () {
}
return AcePopup;
}());
-dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
+dom.importCssString("\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n", "autocompletion.css", false);
exports.AcePopup = AcePopup;
exports.$singleLineEditor = $singleLineEditor;
exports.getAriaId = getAriaId;
@@ -1497,14 +1512,13 @@ exports.getCompletionPrefix = function (editor) {
}.bind(this));
return prefix || this.retrievePrecedingIdentifier(line, pos.column);
};
-exports.triggerAutocomplete = function (editor) {
- var pos = editor.getCursorPosition();
- var line = editor.session.getLine(pos.row);
- var column = (pos.column === 0) ? 0 : pos.column - 1;
- var previousChar = line[column];
- return editor.completers.some(function (el) {
- if (el.triggerCharacters && Array.isArray(el.triggerCharacters)) {
- return el.triggerCharacters.includes(previousChar);
+exports.triggerAutocomplete = function (editor, previousChar) {
+ var previousChar = previousChar == null
+ ? editor.session.getPrecedingCharacter()
+ : previousChar;
+ return editor.completers.some(function (completer) {
+ if (completer.triggerCharacters && Array.isArray(completer.triggerCharacters)) {
+ return completer.triggerCharacters.includes(previousChar);
}
});
};
@@ -1565,7 +1579,7 @@ var Autocomplete = /** @class */ (function () {
Object.defineProperty(Autocomplete, "completionsForLoading", {
get: function () {
return [{
- caption: config.nls("Loading..."),
+ caption: config.nls("autocomplete.loading", "Loading..."),
value: ""
}];
},
@@ -1755,9 +1769,6 @@ var Autocomplete = /** @class */ (function () {
this.updateDocTooltip();
}
}
- else if (keepPopupPosition && !prefix) {
- this.detach();
- }
this.changeTimer.cancel();
this.observeLayoutChanges();
};
@@ -1810,7 +1821,7 @@ var Autocomplete = /** @class */ (function () {
this.detach();
};
Autocomplete.prototype.mousewheelListener = function (e) {
- if (!this.popup.isMouseOver)
+ if (this.popup && !this.popup.isMouseOver)
this.detach();
};
Autocomplete.prototype.mouseOutListener = function (e) {
@@ -1912,6 +1923,7 @@ var Autocomplete = /** @class */ (function () {
this.completions = new FilteredList(completionsForEmpty);
this.openPopup(this.editor, prefix, keepPopupPosition);
this.popup.renderer.setStyle("ace_loading", false);
+ this.popup.renderer.setStyle("ace_empty-message", true);
return;
}
return this.detach();
@@ -1926,6 +1938,7 @@ var Autocomplete = /** @class */ (function () {
new FilteredList(Autocomplete.completionsForLoading.concat(filtered), completions.filterText) :
completions;
this.openPopup(this.editor, prefix, keepPopupPosition);
+ this.popup.renderer.setStyle("ace_empty-message", false);
this.popup.renderer.setStyle("ace_loading", !finished);
}.bind(this));
if (this.showLoadingState && !this.autoShown && !(this.popup && this.popup.isOpen)) {
@@ -1937,7 +1950,7 @@ var Autocomplete = /** @class */ (function () {
};
Autocomplete.prototype.updateDocTooltip = function () {
var popup = this.popup;
- var all = this.completions.filtered;
+ var all = this.completions && this.completions.filtered;
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
var doc = null;
if (!selected || !this.editor || !this.popup.isOpen)
@@ -1985,33 +1998,54 @@ var Autocomplete = /** @class */ (function () {
this.popup.container.appendChild(this.tooltipNode);
var popup = this.popup;
var rect = popup.container.getBoundingClientRect();
- tooltipNode.style.top = popup.container.style.top;
- tooltipNode.style.bottom = popup.container.style.bottom;
- tooltipNode.style.display = "block";
- if (window.innerWidth - rect.right < 320) {
- if (rect.left < 320) {
- if (popup.isTopdown) {
- tooltipNode.style.top = rect.bottom + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
- else {
- tooltipNode.style.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
- tooltipNode.style.left = rect.left + "px";
- tooltipNode.style.right = "";
- tooltipNode.style.bottom = "";
- }
+ var targetWidth = 400;
+ var targetHeight = 300;
+ var scrollBarSize = popup.renderer.scrollBar.width || 10;
+ var leftSize = rect.left;
+ var rightSize = window.innerWidth - rect.right - scrollBarSize;
+ var topSize = popup.isTopdown ? rect.top : window.innerHeight - scrollBarSize - rect.bottom;
+ var scores = [
+ Math.min(rightSize / targetWidth, 1),
+ Math.min(leftSize / targetWidth, 1),
+ Math.min(topSize / targetHeight * 0.9),
+ ];
+ var max = Math.max.apply(Math, scores);
+ var tooltipStyle = tooltipNode.style;
+ tooltipStyle.display = "block";
+ if (max == scores[0]) {
+ tooltipStyle.left = (rect.right + 1) + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[1]) {
+ tooltipStyle.right = window.innerWidth - rect.left + "px";
+ tooltipStyle.left = "";
+ tooltipStyle.maxWidth = targetWidth * max + "px";
+ tooltipStyle.top = rect.top + "px";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.top, targetHeight) + "px";
+ }
+ else if (max == scores[2]) {
+ tooltipStyle.left = window.innerWidth - rect.left + "px";
+ tooltipStyle.maxWidth = Math.min(targetWidth, window.innerWidth) + "px";
+ if (popup.isTopdown) {
+ tooltipStyle.top = rect.bottom + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(window.innerHeight - scrollBarSize - rect.bottom, targetHeight) + "px";
}
else {
- tooltipNode.style.right = window.innerWidth - rect.left + "px";
- tooltipNode.style.left = "";
+ tooltipStyle.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
+ tooltipStyle.left = rect.left + "px";
+ tooltipStyle.right = "";
+ tooltipStyle.bottom = "";
+ tooltipStyle.maxHeight = Math.min(popup.container.offsetTop, targetHeight) + "px";
}
}
- else {
- tooltipNode.style.left = (rect.right + 1) + "px";
- tooltipNode.style.right = "";
- }
};
Autocomplete.prototype.hideDocTooltip = function () {
this.tooltipTimer.cancel();
@@ -2049,6 +2083,25 @@ var Autocomplete = /** @class */ (function () {
}
this.inlineRenderer = this.popup = this.editor = null;
};
+ Autocomplete.for = function (editor) {
+ if (editor.completer instanceof Autocomplete) {
+ return editor.completer;
+ }
+ if (editor.completer) {
+ editor.completer.destroy();
+ editor.completer = null;
+ }
+ if (config.get("sharedPopups")) {
+ if (!Autocomplete["$sharedInstance"])
+ Autocomplete["$sharedInstance"] = new Autocomplete();
+ editor.completer = Autocomplete["$sharedInstance"];
+ }
+ else {
+ editor.completer = new Autocomplete();
+ editor.once("destroy", destroyCompleter);
+ }
+ return editor.completer;
+ };
return Autocomplete;
}());
Autocomplete.prototype.commands = {
@@ -2066,28 +2119,15 @@ Autocomplete.prototype.commands = {
else
return result;
},
+ "Backspace": function (editor) {
+ editor.execCommand("backspace");
+ var prefix = util.getCompletionPrefix(editor);
+ if (!prefix && editor.completer)
+ editor.completer.detach();
+ },
"PageUp": function (editor) { editor.completer.popup.gotoPageUp(); },
"PageDown": function (editor) { editor.completer.popup.gotoPageDown(); }
};
-Autocomplete.for = function (editor) {
- if (editor.completer instanceof Autocomplete) {
- return editor.completer;
- }
- if (editor.completer) {
- editor.completer.destroy();
- editor.completer = null;
- }
- if (config.get("sharedPopups")) {
- if (!Autocomplete["$sharedInstance"])
- Autocomplete["$sharedInstance"] = new Autocomplete();
- editor.completer = Autocomplete["$sharedInstance"];
- }
- else {
- editor.completer = new Autocomplete();
- editor.once("destroy", destroyCompleter);
- }
- return editor.completer;
-};
Autocomplete.startCommand = {
name: "startAutocomplete",
exec: function (editor, options) {
@@ -2269,6 +2309,11 @@ var FilteredList = /** @class */ (function () {
var upper = needle.toUpperCase();
var lower = needle.toLowerCase();
loop: for (var i = 0, item; item = items[i]; i++) {
+ if (item.skipFilter) {
+ item.$score = item.score;
+ results.push(item);
+ continue;
+ }
var caption = (!this.ignoreCaption && item.caption) || item.value || item.snippet;
if (!caption)
continue;
@@ -2405,7 +2450,7 @@ var Mode = /** @class */ (function () {
}) + "$";
}
else {
- re = "^.*\\.(" + extensions + ")$";
+ re = "\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
@@ -2430,6 +2475,7 @@ var supportedModes = {
Astro: ["astro"],
AutoHotKey: ["ahk"],
BatchFile: ["bat|cmd"],
+ Basic: ["bas|bak"],
BibTeX: ["bib"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
C9Search: ["c9search_results"],
@@ -2444,6 +2490,7 @@ var supportedModes = {
Csound_Orchestra: ["orc"],
Csound_Score: ["sco"],
CSS: ["css"],
+ CSV: ["csv"],
Curly: ["curly"],
Cuttlefish: ["conf"],
D: ["d|di"],
@@ -2586,6 +2633,7 @@ var supportedModes = {
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
+ TSV: ["tsv"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
@@ -3002,12 +3050,12 @@ prompt.commands = function (editor, callback) {
var otherCommands = getUniqueCommandList(shortcutsArray, recentlyUsedCommands);
otherCommands = getFilteredCompletions(otherCommands, prefix);
if (recentlyUsedCommands.length && otherCommands.length) {
- recentlyUsedCommands[0].message = nls("Recently used");
- otherCommands[0].message = nls("Other commands");
+ recentlyUsedCommands[0].message = nls("prompt.recently-used", "Recently used");
+ otherCommands[0].message = nls("prompt.other-commands", "Other commands");
}
var completions = recentlyUsedCommands.concat(otherCommands);
return completions.length > 0 ? completions : [{
- value: nls("No matching commands"),
+ value: nls("prompt.no-matching-commands", "No matching commands"),
error: 1
}];
}
diff --git a/modules/lib/ace/ext-searchbox.js b/modules/lib/ace/ext-searchbox.js
index 5003d0f..bdb3eaf 100644
--- a/modules/lib/ace/ext-searchbox.js
+++ b/modules/lib/ace/ext-searchbox.js
@@ -15,35 +15,35 @@ dom.importCssString(searchboxCss, "ace_searchbox", false);
var SearchBox = /** @class */ (function () {
function SearchBox(editor, range, showReplaceForm) {
this.activeInput;
- var div = dom.createElement("div");
- dom.buildDom(["div", { class: "ace_search right" },
+ this.element = dom.buildDom(["div", { class: "ace_search right" },
["span", { action: "hide", class: "ace_searchbtn_close" }],
["div", { class: "ace_search_form" },
- ["input", { class: "ace_search_field", placeholder: nls("Search for"), spellcheck: "false" }],
+ ["input", { class: "ace_search_field", placeholder: nls("search-box.find.placeholder", "Search for"), spellcheck: "false" }],
["span", { action: "findPrev", class: "ace_searchbtn prev" }, "\u200b"],
["span", { action: "findNext", class: "ace_searchbtn next" }, "\u200b"],
- ["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, nls("All")]
+ ["span", { action: "findAll", class: "ace_searchbtn", title: "Alt-Enter" }, nls("search-box.find-all.text", "All")]
],
["div", { class: "ace_replace_form" },
- ["input", { class: "ace_search_field", placeholder: nls("Replace with"), spellcheck: "false" }],
- ["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, nls("Replace")],
- ["span", { action: "replaceAll", class: "ace_searchbtn" }, nls("All")]
+ ["input", { class: "ace_search_field", placeholder: nls("search-box.replace.placeholder", "Replace with"), spellcheck: "false" }],
+ ["span", { action: "replaceAndFindNext", class: "ace_searchbtn" }, nls("search-box.replace-next.text", "Replace")],
+ ["span", { action: "replaceAll", class: "ace_searchbtn" }, nls("search-box.replace-all.text", "All")]
],
["div", { class: "ace_search_options" },
- ["span", { action: "toggleReplace", class: "ace_button", title: nls("Toggle Replace mode"),
+ ["span", { action: "toggleReplace", class: "ace_button", title: nls("search-box.toggle-replace.title", "Toggle Replace mode"),
style: "float:left;margin-top:-2px;padding:0 5px;" }, "+"],
["span", { class: "ace_search_counter" }],
- ["span", { action: "toggleRegexpMode", class: "ace_button", title: nls("RegExp Search") }, ".*"],
- ["span", { action: "toggleCaseSensitive", class: "ace_button", title: nls("CaseSensitive Search") }, "Aa"],
- ["span", { action: "toggleWholeWords", class: "ace_button", title: nls("Whole Word Search") }, "\\b"],
- ["span", { action: "searchInSelection", class: "ace_button", title: nls("Search In Selection") }, "S"]
+ ["span", { action: "toggleRegexpMode", class: "ace_button", title: nls("search-box.toggle-regexp.title", "RegExp Search") }, ".*"],
+ ["span", { action: "toggleCaseSensitive", class: "ace_button", title: nls("search-box.toggle-case.title", "CaseSensitive Search") }, "Aa"],
+ ["span", { action: "toggleWholeWords", class: "ace_button", title: nls("search-box.toggle-whole-word.title", "Whole Word Search") }, "\\b"],
+ ["span", { action: "searchInSelection", class: "ace_button", title: nls("search-box.toggle-in-selection.title", "Search In Selection") }, "S"]
]
- ], div);
- this.element = div.firstChild;
+ ]);
this.setSession = this.setSession.bind(this);
+ this.$onEditorInput = this.onEditorInput.bind(this);
this.$init();
this.setEditor(editor);
dom.importCssString(searchboxCss, "ace_searchbox", editor.container);
+ event.addListener(this.element, "touchstart", function (e) { e.stopPropagation(); }, editor);
}
SearchBox.prototype.setEditor = function (editor) {
editor.searchBox = this;
@@ -54,6 +54,9 @@ var SearchBox = /** @class */ (function () {
this.searchRange = null;
this.$syncOptions(true);
};
+ SearchBox.prototype.onEditorInput = function () {
+ this.find(false, false, true);
+ };
SearchBox.prototype.$initElements = function (sb) {
this.searchBox = sb.querySelector(".ace_search_form");
this.replaceBox = sb.querySelector(".ace_replace_form");
@@ -161,6 +164,10 @@ var SearchBox = /** @class */ (function () {
var value = this.searchRange
? editor.session.getTextRange(this.searchRange)
: editor.getValue();
+ if (editor.$search.$isMultilineSearch(editor.getLastSearchOptions())) {
+ value = value.replace(/\r\n|\r|\n/g, "\n");
+ editor.session.doc.$autoNewLine = "\n";
+ }
var offset = editor.session.doc.positionToIndex(editor.selection.anchor);
if (this.searchRange)
offset -= editor.session.doc.positionToIndex(this.searchRange.start);
@@ -180,7 +187,7 @@ var SearchBox = /** @class */ (function () {
}
}
}
- this.searchCounter.textContent = nls("$0 of $1", [before, (all > MAX_COUNT ? MAX_COUNT + "+" : all)]);
+ this.searchCounter.textContent = nls("search-box.search-counter", "$0 of $1", [before, (all > MAX_COUNT ? MAX_COUNT + "+" : all)]);
};
SearchBox.prototype.findNext = function () {
this.find(true, false);
@@ -218,6 +225,7 @@ var SearchBox = /** @class */ (function () {
this.active = false;
this.setSearchRange(null);
this.editor.off("changeSession", this.setSession);
+ this.editor.off("input", this.$onEditorInput);
this.element.style.display = "none";
this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb);
this.editor.focus();
@@ -225,8 +233,11 @@ var SearchBox = /** @class */ (function () {
SearchBox.prototype.show = function (value, isReplace) {
this.active = true;
this.editor.on("changeSession", this.setSession);
+ this.editor.on("input", this.$onEditorInput);
this.element.style.display = "";
this.replaceOption.checked = isReplace;
+ if (this.editor.$search.$options.regExp)
+ value = lang.escapeRegExp(value);
if (value)
this.searchInput.value = value;
this.searchInput.focus();
diff --git a/modules/lib/ace/ext-settings_menu.js b/modules/lib/ace/ext-settings_menu.js
index b4bdc0c..1714460 100644
--- a/modules/lib/ace/ext-settings_menu.js
+++ b/modules/lib/ace/ext-settings_menu.js
@@ -85,7 +85,7 @@ var Mode = /** @class */ (function () {
}) + "$";
}
else {
- re = "^.*\\.(" + extensions + ")$";
+ re = "\\.(" + extensions + ")$";
}
this.extRe = new RegExp(re, "gi");
}
@@ -110,6 +110,7 @@ var supportedModes = {
Astro: ["astro"],
AutoHotKey: ["ahk"],
BatchFile: ["bat|cmd"],
+ Basic: ["bas|bak"],
BibTeX: ["bib"],
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
C9Search: ["c9search_results"],
@@ -124,6 +125,7 @@ var supportedModes = {
Csound_Orchestra: ["orc"],
Csound_Score: ["sco"],
CSS: ["css"],
+ CSV: ["csv"],
Curly: ["curly"],
Cuttlefish: ["conf"],
D: ["d|di"],
@@ -266,6 +268,7 @@ var supportedModes = {
Text: ["txt"],
Textile: ["textile"],
Toml: ["toml"],
+ TSV: ["tsv"],
TSX: ["tsx"],
Turtle: ["ttl"],
Twig: ["twig|swig"],
@@ -332,7 +335,8 @@ var themeData = [
["Dawn"],
["Dreamweaver"],
["Eclipse"],
- ["GitHub"],
+ ["GitHub Light Default"],
+ ["GitHub (Legacy)", "github", "light"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
diff --git a/modules/lib/ace/ext-simple_tokenizer.js b/modules/lib/ace/ext-simple_tokenizer.js
index c45c1fc..f1de905 100644
--- a/modules/lib/ace/ext-simple_tokenizer.js
+++ b/modules/lib/ace/ext-simple_tokenizer.js
@@ -31,9 +31,7 @@ function tokenize(content, highlightRules) {
}
return result;
}
-module.exports = {
- tokenize: tokenize
-};
+exports.tokenize = tokenize;
}); (function() {
ace.require(["ace/ext/simple_tokenizer"], function(m) {
diff --git a/modules/lib/ace/ext-static_highlight.js b/modules/lib/ace/ext-static_highlight.js
index ab9b39f..815fd9a 100644
--- a/modules/lib/ace/ext-static_highlight.js
+++ b/modules/lib/ace/ext-static_highlight.js
@@ -125,7 +125,7 @@ highlight.render = function (input, mode, theme, lineStart, disableGutter, callb
});
}
function done() {
- var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);
+ var result = highlight.renderSync(input, mode, /**@type{Theme}*/ (theme), lineStart, disableGutter);
return callback ? callback(result) : result;
}
return --waiting || done();
diff --git a/modules/lib/ace/ext-themelist.js b/modules/lib/ace/ext-themelist.js
index a145b37..6c42f64 100644
--- a/modules/lib/ace/ext-themelist.js
+++ b/modules/lib/ace/ext-themelist.js
@@ -13,7 +13,8 @@ var themeData = [
["Dawn"],
["Dreamweaver"],
["Eclipse"],
- ["GitHub"],
+ ["GitHub Light Default"],
+ ["GitHub (Legacy)", "github", "light"],
["IPlastic"],
["Solarized Light"],
["TextMate"],
diff --git a/modules/lib/ace/keybinding-emacs.js b/modules/lib/ace/keybinding-emacs.js
index e4d9cb4..9945880 100644
--- a/modules/lib/ace/keybinding-emacs.js
+++ b/modules/lib/ace/keybinding-emacs.js
@@ -589,11 +589,11 @@ exports.handler.attach = function (editor) {
editor.pushEmacsMark = function (p, activate) {
var prevMark = this.session.$emacsMark;
if (prevMark)
- this.session.$emacsMarkRing.push(prevMark);
+ pushUnique(this.session.$emacsMarkRing, prevMark);
if (!p || activate)
this.setEmacsMark(p);
else
- this.session.$emacsMarkRing.push(p);
+ pushUnique(this.session.$emacsMarkRing, p);
};
editor.popEmacsMark = function () {
var mark = this.emacsMark();
@@ -625,6 +625,13 @@ exports.handler.attach = function (editor) {
editor.on('copy', this.onCopy);
editor.on('paste', this.onPaste);
};
+function pushUnique(ring, mark) {
+ var last = ring[ring.length - 1];
+ if (last && last.row === mark.row && last.column === mark.column) {
+ return;
+ }
+ ring.push(mark);
+}
exports.handler.detach = function (editor) {
editor.renderer.$blockCursor = false;
editor.session.$selectLongWords = $formerLongWords;
diff --git a/modules/lib/ace/keybinding-vim.js b/modules/lib/ace/keybinding-vim.js
index c67d7f4..2309895 100644
--- a/modules/lib/ace/keybinding-vim.js
+++ b/modules/lib/ace/keybinding-vim.js
@@ -3230,8 +3230,43 @@ var operators = {
},
indent: function (cm, args, ranges) {
var vim = cm.state.vim;
- if (cm.indentMore) {
- var repeat = (vim.visualMode) ? args.repeat : 1;
+ var repeat = (vim.visualMode) ? args.repeat : 1;
+ if (vim.visualBlock) {
+ var tabSize = cm.getOption('tabSize');
+ var indent = cm.getOption('indentWithTabs') ? '\t' : ' '.repeat(tabSize);
+ var cursor;
+ for (var i = ranges.length - 1; i >= 0; i--) {
+ cursor = cursorMin(ranges[i].anchor, ranges[i].head);
+ if (args.indentRight) {
+ cm.replaceRange(indent.repeat(repeat), cursor, cursor);
+ }
+ else {
+ var text = cm.getLine(cursor.line);
+ var end = 0;
+ for (var j = 0; j < repeat; j++) {
+ var ch = text[cursor.ch + end];
+ if (ch == '\t') {
+ end++;
+ }
+ else if (ch == ' ') {
+ end++;
+ for (var k = 1; k < indent.length; k++) {
+ ch = text[cursor.ch + end];
+ if (ch !== ' ')
+ break;
+ end++;
+ }
+ }
+ else {
+ break;
+ }
+ }
+ cm.replaceRange('', cursor, offsetCursor(cursor, 0, end));
+ }
+ }
+ return cursor;
+ }
+ else if (cm.indentMore) {
for (var j = 0; j < repeat; j++) {
if (args.indentRight)
cm.indentMore();
@@ -3244,7 +3279,6 @@ var operators = {
var endLine = vim.visualBlock ?
ranges[ranges.length - 1].anchor.line :
ranges[0].head.line;
- var repeat = (vim.visualMode) ? args.repeat : 1;
if (args.linewise) {
endLine--;
}
diff --git a/modules/lib/ace/mode-apex.js b/modules/lib/ace/mode-apex.js
index d716f33..7385623 100644
--- a/modules/lib/ace/mode-apex.js
+++ b/modules/lib/ace/mode-apex.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-asl.js b/modules/lib/ace/mode-asl.js
index 69a145f..0592ab6 100644
--- a/modules/lib/ace/mode-asl.js
+++ b/modules/lib/ace/mode-asl.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-astro.js b/modules/lib/ace/mode-astro.js
index 6c1a839..20073cd 100644
--- a/modules/lib/ace/mode-astro.js
+++ b/modules/lib/ace/mode-astro.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-basic.js b/modules/lib/ace/mode-basic.js
new file mode 100644
index 0000000..721114a
--- /dev/null
+++ b/modules/lib/ace/mode-basic.js
@@ -0,0 +1,201 @@
+ace.define("ace/mode/basic_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var BasicHighlightRules = function () {
+ var keywordMapper = this.createKeywordMapper({
+ "keyword.control": "FOR|TO|NEXT|GOSUB|RETURN|IF|THEN|ELSE|GOTO|ON|WHILE|WEND|TRON|TROFF",
+ "entity.name": "Auto|Call|Chain|Clear|Close|Common|Cont|Data|MERGE|ALL|Delete|DIM|EDIT|END|ERASE|ERROR|FIELD|"
+ + "GET|INPUT|KILL|LET|LIST|LLIST|LOAD|LSET|RSET|MERGE|NEW|NULL|OPEN|OUT|POKE|PRINT|PUT|RANDOMIZE|READ|"
+ + "RENUM|RESTORE|RESUME|RUN|SAVE|STOP|SWAP|WAIT|WIDTH",
+ "keyword.operator": "Mod|And|Not|Or|Xor|Eqv|Imp",
+ "support.function": "ABS|ASC|ATN|CDBL|CINT|COS|CSNG|CVI|CVS|CVD|EOF|EXP|FIX|FRE|INP|INSTR|INT|LEN|LOC|LOG|LPOS|"
+ + "PEEK|POS|RND|SGN|SIN|SPC|SQR|TAB|TAN|USR|VAL|VARPTR"
+ }, "identifier", true);
+ this.$rules = {
+ "start": [
+ {
+ token: "string",
+ regex: /"(?:\\.|[^"\\])*"/
+ },
+ {
+ token: "support.function",
+ regex: /(HEX|CHR|INPUT|LEFT|MID|MKI|MKS|MKD|OCT|RIGHT|SPACE|STR|STRING)\$/
+ }, {
+ token: "entity.name",
+ regex: /(?:DEF\s(?:SEG|USR|FN[a-zA-Z]+)|LINE\sINPUT|L?PRINT#?(?:\sUSING)?|MID\$|ON\sERROR\sGOTO|OPTION\sBASE|WRITE#?|DATE\$|INKEY\$|TIME\$)/
+ }, {
+ token: "variable",
+ regex: /[a-zA-Z][a-zA-Z0-9_]{0,38}[$%!#]?(?=\s*=)/
+ }, {
+ token: "keyword.operator",
+ regex: /\\|=|\^|\*|\/|\+|\-|<|>|-/
+ }, {
+ token: "paren.lparen",
+ regex: /[([]/
+ }, {
+ token: "paren.rparen",
+ regex: /[\)\]]/
+ }, {
+ token: "constant.numeric",
+ regex: /[+-]?\d+(\.\d+)?([ED][+-]?\d+)?(?:[!#])?/
+ }, {
+ token: "constant.numeric", //hexal, octal
+ regex: /&[HO]?[0-9A-F]+/
+ }, {
+ token: "comment",
+ regex: /REM\s+.*$/
+ }, {
+ regex: "\\w+",
+ token: keywordMapper
+ }, {
+ token: "punctiation",
+ regex: /[,;]/
+ }
+ ]
+ };
+ this.normalizeRules();
+};
+oop.inherits(BasicHighlightRules, TextHighlightRules);
+exports.BasicHighlightRules = BasicHighlightRules;
+
+});
+
+ace.define("ace/mode/folding/basic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var Range = require("../../range").Range;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var FoldMode = exports.FoldMode = function () { };
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.indentKeywords = {
+ "tron": 1,
+ "while": 1,
+ "for": 1,
+ "troff": -1,
+ "wend": -1,
+ "next": -1
+ };
+ this.foldingStartMarker = /(?:\s|^)(tron|while|for)\b/i;
+ this.foldingStopMarker = /(?:\b)(troff|next|wend)\b/i;
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ var isStart = this.foldingStartMarker.test(line);
+ var isEnd = this.foldingStopMarker.test(line);
+ if (isStart || isEnd) {
+ var match = (isEnd) ? this.foldingStopMarker.exec(line) : this.foldingStartMarker.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type === "keyword.control")
+ return this.basicBlock(session, row, match.index + 2);
+ }
+ }
+ };
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ var isStart = this.foldingStartMarker.test(line);
+ var isEnd = this.foldingStopMarker.test(line);
+ if (isStart && !isEnd) {
+ var match = this.foldingStartMarker.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type == "keyword.control") {
+ return "start";
+ }
+ }
+ }
+ if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
+ return "";
+ var match = line.match(this.foldingStopMarker);
+ var keyword = match && match[1].toLowerCase();
+ if (this.indentKeywords[keyword]) {
+ if (session.getTokenAt(row, match.index + 2).type === "keyword.control")
+ return "end";
+ }
+ return "";
+ };
+ this.basicBlock = function (session, row, column, tokenRange) {
+ var stream = new TokenIterator(session, row, column);
+ var token = stream.getCurrentToken();
+ if (!token || token.type != "keyword.control")
+ return;
+ var val = token.value.toLowerCase();
+ var stack = [val];
+ var dir = this.indentKeywords[val];
+ if (!dir)
+ return;
+ var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length;
+ var startRow = row;
+ stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
+ while (token = stream.step()) {
+ val = token.value.toLowerCase();
+ if (token.type !== "keyword.control" || !this.indentKeywords[val])
+ continue;
+ var level = dir * this.indentKeywords[val];
+ if (level > 0) {
+ stack.unshift(val);
+ }
+ else if (level <= 0) {
+ stack.shift();
+ }
+ if (stack.length === 0) {
+ break;
+ }
+ }
+ if (!token)
+ return null;
+ if (tokenRange)
+ return stream.getCurrentTokenRange();
+ var row = stream.getCurrentTokenRow();
+ if (dir === -1)
+ return new Range(row, session.getLine(row).length, startRow, startColumn);
+ else
+ return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn());
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/basic",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/basic_highlight_rules","ace/mode/folding/basic"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var BasicHighlightRules = require("./basic_highlight_rules").BasicHighlightRules;
+var FoldMode = require("./folding/basic").FoldMode;
+var Mode = function () {
+ this.HighlightRules = BasicHighlightRules;
+ this.foldingRules = new FoldMode();
+ this.$behaviour = this.$defaultBehaviour;
+ this.indentKeywords = this.foldingRules.indentKeywords;
+};
+oop.inherits(Mode, TextMode);
+(function () {
+ this.lineCommentStart = ["REM"];
+ this.getMatching = function (session, row, column, tokenRange) {
+ if (row == undefined) {
+ var pos = session.selection.lead;
+ column = pos.column;
+ row = pos.row;
+ }
+ if (tokenRange == undefined)
+ tokenRange = true;
+ var startToken = session.getTokenAt(row, column);
+ if (startToken) {
+ var val = startToken.value.toLowerCase();
+ if (val in this.indentKeywords)
+ return this.foldingRules.basicBlock(session, row, column, tokenRange);
+ }
+ };
+ this.$id = "ace/mode/basic";
+}).call(Mode.prototype);
+exports.Mode = Mode;
+
+}); (function() {
+ ace.require(["ace/mode/basic"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/mode-c_cpp.js b/modules/lib/ace/mode-c_cpp.js
index d7d9b17..9b8c647 100644
--- a/modules/lib/ace/mode-c_cpp.js
+++ b/modules/lib/ace/mode-c_cpp.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-coldfusion.js b/modules/lib/ace/mode-coldfusion.js
index 0e3f9aa..4fc3b5e 100644
--- a/modules/lib/ace/mode-coldfusion.js
+++ b/modules/lib/ace/mode-coldfusion.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-csharp.js b/modules/lib/ace/mode-csharp.js
index 89f4f6d..a743894 100644
--- a/modules/lib/ace/mode-csharp.js
+++ b/modules/lib/ace/mode-csharp.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-csound_document.js b/modules/lib/ace/mode-csound_document.js
index 31115af..8eb49de 100644
--- a/modules/lib/ace/mode-csound_document.js
+++ b/modules/lib/ace/mode-csound_document.js
@@ -454,7 +454,7 @@ var LuaHighlightRules = function () {
regex: /\]=*\]/,
next: "start"
}, {
- defaultToken: "comment"
+ defaultToken: "comment.body"
}
]
},
@@ -3018,6 +3018,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -3101,7 +3104,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -3161,7 +3164,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -3185,7 +3188,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -3206,7 +3209,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -3218,7 +3221,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -3226,7 +3229,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -3235,10 +3239,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -3253,53 +3263,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -3348,17 +3336,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -3583,7 +3581,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -3641,7 +3639,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -3654,8 +3652,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
diff --git a/modules/lib/ace/mode-csound_orchestra.js b/modules/lib/ace/mode-csound_orchestra.js
index b09dd1f..c85ead6 100644
--- a/modules/lib/ace/mode-csound_orchestra.js
+++ b/modules/lib/ace/mode-csound_orchestra.js
@@ -454,7 +454,7 @@ var LuaHighlightRules = function () {
regex: /\]=*\]/,
next: "start"
}, {
- defaultToken: "comment"
+ defaultToken: "comment.body"
}
]
},
diff --git a/modules/lib/ace/mode-css.js b/modules/lib/ace/mode-css.js
index 9e02363..e528a06 100644
--- a/modules/lib/ace/mode-css.js
+++ b/modules/lib/ace/mode-css.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-csv.js b/modules/lib/ace/mode-csv.js
new file mode 100644
index 0000000..bddcbd5
--- /dev/null
+++ b/modules/lib/ace/mode-csv.js
@@ -0,0 +1,97 @@
+ace.define("ace/mode/csv_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var CsvHighlightRules = function () {
+ TextHighlightRules.call(this);
+};
+oop.inherits(CsvHighlightRules, TextHighlightRules);
+exports.CsvHighlightRules = CsvHighlightRules;
+
+});
+
+ace.define("ace/mode/csv",["require","exports","module","ace/lib/oop","ace/mode/text","ace/lib/lang","ace/mode/csv_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var escapeRegExp = require("../lib/lang").escapeRegExp;
+var CsvHighlightRules = require("./csv_highlight_rules").CsvHighlightRules;
+var Mode = function (options) {
+ this.HighlightRules = CsvHighlightRules;
+ if (!options)
+ options = {};
+ var separatorRegex = [options.splitter || ",", options.quote || '"']
+ .map(escapeRegExp).join("|");
+ this.$tokenizer = {
+ getLineTokens: function (line, state, row) {
+ return tokenizeCsv(line, state, this.options);
+ },
+ options: {
+ quotes: options.quote || '"',
+ separatorRegex: new RegExp("(" + separatorRegex + ")"),
+ spliter: options.splitter || ","
+ },
+ states: {},
+ };
+ this.$highlightRules = new this.HighlightRules();
+};
+oop.inherits(Mode, TextMode);
+(function () {
+ this.getTokenizer = function () {
+ return this.$tokenizer;
+ };
+ this.$id = "ace/mode/csv";
+}).call(Mode.prototype);
+exports.Mode = Mode;
+var classNames = ["keyword", "text", "string", "string.regex", "variable", "constant.numeric"];
+function tokenizeCsv(line, state, options) {
+ var result = [];
+ var parts = line.split(options.separatorRegex);
+ var spliter = options.spliter;
+ var quote = options.quote || '"';
+ var stateParts = (state || "start").split("-");
+ var column = parseInt(stateParts[1]) || 0;
+ var inString = stateParts[0] == 'string';
+ var atColumnStart = !inString;
+ for (var i = 0; i < parts.length; i++) {
+ var value = parts[i];
+ if (value) {
+ var isSeparator = false;
+ if (value == spliter && !inString) {
+ column++;
+ atColumnStart = true;
+ isSeparator = true;
+ }
+ else if (value == quote) {
+ if (atColumnStart) {
+ inString = true;
+ atColumnStart = false;
+ }
+ else if (inString) {
+ if (parts[i + 1] == '' && parts[i + 2] == quote) {
+ value = quote + quote;
+ i += 2;
+ }
+ else {
+ inString = false;
+ }
+ }
+ }
+ else {
+ atColumnStart = false;
+ }
+ result.push({
+ value: value,
+ type: classNames[column % classNames.length] + ".csv_" + column + (isSeparator ? ".csv_separator" : "")
+ });
+ }
+ }
+ return { tokens: result, state: inString ? "string-" + column : "start" };
+}
+
+}); (function() {
+ ace.require(["ace/mode/csv"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/mode-curly.js b/modules/lib/ace/mode-curly.js
index 8fc56ee..6be1044 100644
--- a/modules/lib/ace/mode-curly.js
+++ b/modules/lib/ace/mode-curly.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-d.js b/modules/lib/ace/mode-d.js
index c3081a2..480be25 100644
--- a/modules/lib/ace/mode-d.js
+++ b/modules/lib/ace/mode-d.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-dart.js b/modules/lib/ace/mode-dart.js
index c30347c..00a1e2f 100644
--- a/modules/lib/ace/mode-dart.js
+++ b/modules/lib/ace/mode-dart.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-django.js b/modules/lib/ace/mode-django.js
index 12d4f9a..1aac3c6 100644
--- a/modules/lib/ace/mode-django.js
+++ b/modules/lib/ace/mode-django.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-dot.js b/modules/lib/ace/mode-dot.js
index e258db1..6f1663c 100644
--- a/modules/lib/ace/mode-dot.js
+++ b/modules/lib/ace/mode-dot.js
@@ -37,7 +37,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -53,7 +53,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-drools.js b/modules/lib/ace/mode-drools.js
index bda56ee..d52773f 100644
--- a/modules/lib/ace/mode-drools.js
+++ b/modules/lib/ace/mode-drools.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -55,10 +55,8 @@ var JavaHighlightRules = function () {
"char|final|interface|static|void|" +
"class|finally|long|strictfp|volatile|" +
"const|float|native|super|while|" +
- "var|exports|opens|requires|uses|yield|" +
- "module|permits|(?:non\\-)?sealed|var|" +
- "provides|to|when|" +
- "open|record|transitive|with");
+ "yield|when|record|var|" +
+ "permits|(?:non\\-)?sealed");
var buildinConstants = ("null|Infinity|NaN|undefined");
var langClasses = ("AbstractMethodError|AssertionError|ClassCircularityError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|" +
@@ -91,16 +89,7 @@ var JavaHighlightRules = function () {
}, "identifier");
this.$rules = {
"start": [
- {
- token: "comment",
- regex: "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token: "comment", // multi line comment
- regex: "\\/\\*",
- next: "comment"
- },
+ { include: "comments" },
{ include: "multiline-strings" },
{ include: "strings" },
{ include: "constants" },
@@ -110,14 +99,18 @@ var JavaHighlightRules = function () {
next: [{
regex: "{",
token: "paren.lparen",
- next: [{
+ push: [
+ {
regex: "}",
token: "paren.rparen",
- next: "start"
- }, {
+ next: "pop"
+ },
+ { include: "comments" },
+ {
regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
token: "keyword"
- }]
+ }
+ ]
}, {
token: "text",
regex: "\\s+"
@@ -137,14 +130,29 @@ var JavaHighlightRules = function () {
},
{ include: "statements" }
],
- "comment": [
+ "comments": [
{
- token: "comment", // closing comment
- regex: "\\*\\/",
- next: "start"
- }, {
- defaultToken: "comment"
- }
+ token: "comment",
+ regex: "\\/\\/.*$"
+ },
+ {
+ token: "comment.doc", // doc comment
+ regex: /\/\*\*(?!\/)/,
+ push: "doc-start"
+ },
+ {
+ token: "comment", // multi line comment
+ regex: "\\/\\*",
+ push: [
+ {
+ token: "comment", // closing comment
+ regex: "\\*\\/",
+ next: "pop"
+ }, {
+ defaultToken: "comment"
+ }
+ ]
+ },
],
"strings": [
{
@@ -287,7 +295,7 @@ var JavaHighlightRules = function () {
}
]
};
- this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
+ this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("pop")]);
this.normalizeRules();
};
oop.inherits(JavaHighlightRules, TextHighlightRules);
diff --git a/modules/lib/ace/mode-edifact.js b/modules/lib/ace/mode-edifact.js
index 1bdee57..e105d62 100644
--- a/modules/lib/ace/mode-edifact.js
+++ b/modules/lib/ace/mode-edifact.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-ejs.js b/modules/lib/ace/mode-ejs.js
index bdb410b..478dfa7 100644
--- a/modules/lib/ace/mode-ejs.js
+++ b/modules/lib/ace/mode-ejs.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1121,135 +1118,454 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
- if (commentRegex) {
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
- }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
- this._getFoldWidgetBase = this.getFoldWidget;
- this.getFoldWidget = function (session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.singleLineBlockCommentRe.test(line)) {
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
- return "";
- }
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
- if (!fw && this.startRegionRe.test(line))
- return "start"; // lineCommentRegionStart
- return fw;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
- var line = session.getLine(row);
- if (this.startRegionRe.test(line))
- return this.getCommentRegionBlock(session, line, row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
- if (range && !range.isMultiLine()) {
- if (forceMultiline) {
- range = this.getSectionRange(session, row);
- }
- else if (foldStyle != "all")
- range = null;
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
}
- return range;
}
- if (foldStyle === "markbegin")
- return;
- var match = line.match(this.foldingStopMarker);
- if (match) {
- var i = match.index + match[0].length;
- if (match[1])
- return this.closingBracketBlock(session, match[1], row, i);
- return session.getCommentFoldRange(row, i, -1);
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
}
- };
- this.getSectionRange = function (session, row) {
- var line = session.getLine(row);
- var startIndent = line.search(/\S/);
- var startRow = row;
- var startColumn = line.length;
- row = row + 1;
- var endRow = row;
- var maxRow = session.getLength();
- while (++row < maxRow) {
- line = session.getLine(row);
- var indent = line.search(/\S/);
- if (indent === -1)
- continue;
- if (startIndent > indent)
- break;
- var subRange = this.getFoldWidgetRange(session, "all", row);
- if (subRange) {
- if (subRange.start.row <= startRow) {
- break;
- }
- else if (subRange.isMultiLine()) {
- row = subRange.end.row;
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
}
- else if (startIndent == indent) {
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
break;
}
}
- endRow = row;
- }
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
- };
- this.getCommentRegionBlock = function (session, line, row) {
- var startColumn = line.search(/\s*$/);
- var maxRow = session.getLength();
- var startRow = row;
- var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
- var depth = 1;
- while (++row < maxRow) {
- line = session.getLine(row);
- var m = re.exec(line);
- if (!m)
- continue;
- if (m[1])
- depth--;
- else
- depth++;
- if (!depth)
- break;
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
}
- var endRow = row;
- if (endRow > startRow) {
- return new Range(startRow, startColumn, endRow, line.length);
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
}
- };
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ }
+ else if (foldStyle != "all")
+ range = null;
+ }
+ return range;
+ }
+ if (foldStyle === "markbegin")
+ return;
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+ this.getSectionRange = function (session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ }
+ else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ }
+ else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function (session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m)
+ continue;
+ if (m[1])
+ depth--;
+ else
+ depth++;
+ if (!depth)
+ break;
+ }
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
}).call(FoldMode.prototype);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1277,13 +1593,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -1609,154 +1918,6 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
@@ -2302,7 +2362,7 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
token: "constant.numeric",
regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
};
-var constantNumericOctal = exports.constantNumericDecimal = {
+var constantNumericOctal = exports.constantNumericOctal = {
token: "constant.numeric",
regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
};
diff --git a/modules/lib/ace/mode-erlang.js b/modules/lib/ace/mode-erlang.js
index 92119ff..a34d854 100644
--- a/modules/lib/ace/mode-erlang.js
+++ b/modules/lib/ace/mode-erlang.js
@@ -643,22 +643,22 @@ var ErlangHighlightRules = function () {
'constant.character.escape.erlang'],
regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
{ token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' },
- { token: ['punctuation.definition.placeholder.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'constant.other.placeholder.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'constant.other.placeholder.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'constant.other.placeholder.erlang',
- 'constant.other.placeholder.erlang'],
+ { token: ['punctuation.definition.erlang',
+ 'punctuation.separator.erlang',
+ 'constant.other.erlang',
+ 'punctuation.separator.erlang',
+ 'punctuation.separator.erlang',
+ 'constant.other.erlang',
+ 'punctuation.separator.erlang',
+ 'punctuation.separator.erlang',
+ 'punctuation.separator.erlang',
+ 'constant.other.erlang',
+ 'constant.other.erlang'],
regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' },
- { token: ['punctuation.definition.placeholder.erlang',
- 'punctuation.separator.placeholder-parts.erlang',
- 'constant.other.placeholder.erlang',
- 'constant.other.placeholder.erlang'],
+ { token: ['punctuation.definition.erlang',
+ 'punctuation.separator.erlang',
+ 'constant.other.erlang',
+ 'constant.other.erlang'],
regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' },
{ token: 'invalid.illegal.string.erlang', regex: '~.?' },
{ defaultToken: 'string.quoted.double.erlang' }] }],
diff --git a/modules/lib/ace/mode-ftl.js b/modules/lib/ace/mode-ftl.js
index 6cc08dd..884abd1 100644
--- a/modules/lib/ace/mode-ftl.js
+++ b/modules/lib/ace/mode-ftl.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
diff --git a/modules/lib/ace/mode-glsl.js b/modules/lib/ace/mode-glsl.js
index dc9b565..8e2cd06 100644
--- a/modules/lib/ace/mode-glsl.js
+++ b/modules/lib/ace/mode-glsl.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-gobstones.js b/modules/lib/ace/mode-gobstones.js
index ca0b0cd..3a3c94c 100644
--- a/modules/lib/ace/mode-gobstones.js
+++ b/modules/lib/ace/mode-gobstones.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-golang.js b/modules/lib/ace/mode-golang.js
index 4cef2b0..d0f7717 100644
--- a/modules/lib/ace/mode-golang.js
+++ b/modules/lib/ace/mode-golang.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-groovy.js b/modules/lib/ace/mode-groovy.js
index e67a178..b03822c 100644
--- a/modules/lib/ace/mode-groovy.js
+++ b/modules/lib/ace/mode-groovy.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -887,7 +1193,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -903,7 +1209,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-haml.js b/modules/lib/ace/mode-haml.js
index 9b93059..ec00e9e 100644
--- a/modules/lib/ace/mode-haml.js
+++ b/modules/lib/ace/mode-haml.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1123,7 +1120,7 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
token: "constant.numeric",
regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
};
-var constantNumericOctal = exports.constantNumericDecimal = {
+var constantNumericOctal = exports.constantNumericOctal = {
token: "constant.numeric",
regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
};
diff --git a/modules/lib/ace/mode-handlebars.js b/modules/lib/ace/mode-handlebars.js
index 13e967a..34fd612 100644
--- a/modules/lib/ace/mode-handlebars.js
+++ b/modules/lib/ace/mode-handlebars.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-haxe.js b/modules/lib/ace/mode-haxe.js
index 4f7eda5..2070e7f 100644
--- a/modules/lib/ace/mode-haxe.js
+++ b/modules/lib/ace/mode-haxe.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-html.js b/modules/lib/ace/mode-html.js
index 9377a07..2d7606a 100644
--- a/modules/lib/ace/mode-html.js
+++ b/modules/lib/ace/mode-html.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-html_elixir.js b/modules/lib/ace/mode-html_elixir.js
index f81c5eb..885963b 100644
--- a/modules/lib/ace/mode-html_elixir.js
+++ b/modules/lib/ace/mode-html_elixir.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1504,135 +1501,454 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
- if (commentRegex) {
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
- }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
- this._getFoldWidgetBase = this.getFoldWidget;
- this.getFoldWidget = function (session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.singleLineBlockCommentRe.test(line)) {
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
- return "";
- }
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
- if (!fw && this.startRegionRe.test(line))
- return "start"; // lineCommentRegionStart
- return fw;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
- var line = session.getLine(row);
- if (this.startRegionRe.test(line))
- return this.getCommentRegionBlock(session, line, row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
- if (range && !range.isMultiLine()) {
- if (forceMultiline) {
- range = this.getSectionRange(session, row);
- }
- else if (foldStyle != "all")
- range = null;
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
}
- return range;
}
- if (foldStyle === "markbegin")
- return;
- var match = line.match(this.foldingStopMarker);
- if (match) {
- var i = match.index + match[0].length;
- if (match[1])
- return this.closingBracketBlock(session, match[1], row, i);
- return session.getCommentFoldRange(row, i, -1);
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
}
- };
- this.getSectionRange = function (session, row) {
- var line = session.getLine(row);
- var startIndent = line.search(/\S/);
- var startRow = row;
- var startColumn = line.length;
- row = row + 1;
- var endRow = row;
- var maxRow = session.getLength();
- while (++row < maxRow) {
- line = session.getLine(row);
- var indent = line.search(/\S/);
- if (indent === -1)
- continue;
- if (startIndent > indent)
- break;
- var subRange = this.getFoldWidgetRange(session, "all", row);
- if (subRange) {
- if (subRange.start.row <= startRow) {
- break;
- }
- else if (subRange.isMultiLine()) {
- row = subRange.end.row;
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
}
- else if (startIndent == indent) {
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
break;
}
}
- endRow = row;
- }
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
- };
- this.getCommentRegionBlock = function (session, line, row) {
- var startColumn = line.search(/\s*$/);
- var maxRow = session.getLength();
- var startRow = row;
- var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
- var depth = 1;
- while (++row < maxRow) {
- line = session.getLine(row);
- var m = re.exec(line);
- if (!m)
- continue;
- if (m[1])
- depth--;
- else
- depth++;
- if (!depth)
- break;
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
}
- var endRow = row;
- if (endRow > startRow) {
- return new Range(startRow, startColumn, endRow, line.length);
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
}
- };
-}).call(FoldMode.prototype);
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ }
+ else if (foldStyle != "all")
+ range = null;
+ }
+ return range;
+ }
+ if (foldStyle === "markbegin")
+ return;
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+ this.getSectionRange = function (session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ }
+ else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ }
+ else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function (session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m)
+ continue;
+ if (m[1])
+ depth--;
+ else
+ depth++;
+ if (!depth)
+ break;
+ }
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+}).call(FoldMode.prototype);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1660,13 +1976,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -1992,154 +2301,6 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2179,107 +2340,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-html_ruby.js b/modules/lib/ace/mode-html_ruby.js
index a6bfe5c..12ee9c4 100644
--- a/modules/lib/ace/mode-html_ruby.js
+++ b/modules/lib/ace/mode-html_ruby.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1123,7 +1120,7 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
token: "constant.numeric",
regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
};
-var constantNumericOctal = exports.constantNumericDecimal = {
+var constantNumericOctal = exports.constantNumericOctal = {
token: "constant.numeric",
regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
};
@@ -1739,135 +1736,454 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
- if (commentRegex) {
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
- }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
- this._getFoldWidgetBase = this.getFoldWidget;
- this.getFoldWidget = function (session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.singleLineBlockCommentRe.test(line)) {
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
- return "";
- }
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
- if (!fw && this.startRegionRe.test(line))
- return "start"; // lineCommentRegionStart
- return fw;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
- var line = session.getLine(row);
- if (this.startRegionRe.test(line))
- return this.getCommentRegionBlock(session, line, row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
- if (range && !range.isMultiLine()) {
- if (forceMultiline) {
- range = this.getSectionRange(session, row);
- }
- else if (foldStyle != "all")
- range = null;
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
}
- return range;
}
- if (foldStyle === "markbegin")
- return;
- var match = line.match(this.foldingStopMarker);
- if (match) {
- var i = match.index + match[0].length;
- if (match[1])
- return this.closingBracketBlock(session, match[1], row, i);
- return session.getCommentFoldRange(row, i, -1);
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
}
- };
- this.getSectionRange = function (session, row) {
- var line = session.getLine(row);
- var startIndent = line.search(/\S/);
- var startRow = row;
- var startColumn = line.length;
- row = row + 1;
- var endRow = row;
- var maxRow = session.getLength();
- while (++row < maxRow) {
- line = session.getLine(row);
- var indent = line.search(/\S/);
- if (indent === -1)
- continue;
- if (startIndent > indent)
- break;
- var subRange = this.getFoldWidgetRange(session, "all", row);
- if (subRange) {
- if (subRange.start.row <= startRow) {
- break;
- }
- else if (subRange.isMultiLine()) {
- row = subRange.end.row;
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
}
- else if (startIndent == indent) {
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
break;
}
}
- endRow = row;
- }
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
- };
- this.getCommentRegionBlock = function (session, line, row) {
- var startColumn = line.search(/\s*$/);
- var maxRow = session.getLength();
- var startRow = row;
- var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
- var depth = 1;
- while (++row < maxRow) {
- line = session.getLine(row);
- var m = re.exec(line);
- if (!m)
- continue;
- if (m[1])
- depth--;
- else
- depth++;
- if (!depth)
- break;
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
}
- var endRow = row;
- if (endRow > startRow) {
- return new Range(startRow, startColumn, endRow, line.length);
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
}
- };
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ }
+ else if (foldStyle != "all")
+ range = null;
+ }
+ return range;
+ }
+ if (foldStyle === "markbegin")
+ return;
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+ this.getSectionRange = function (session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ }
+ else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ }
+ else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function (session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m)
+ continue;
+ if (m[1])
+ depth--;
+ else
+ depth++;
+ if (!depth)
+ break;
+ }
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
}).call(FoldMode.prototype);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1895,13 +2211,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -2227,154 +2536,6 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2414,107 +2575,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-jade.js b/modules/lib/ace/mode-jade.js
index 9c339c3..e717d12 100644
--- a/modules/lib/ace/mode-jade.js
+++ b/modules/lib/ace/mode-jade.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
diff --git a/modules/lib/ace/mode-java.js b/modules/lib/ace/mode-java.js
index 43191cf..56ff84e 100644
--- a/modules/lib/ace/mode-java.js
+++ b/modules/lib/ace/mode-java.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -887,7 +1193,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -903,7 +1209,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -934,10 +1240,8 @@ var JavaHighlightRules = function () {
"char|final|interface|static|void|" +
"class|finally|long|strictfp|volatile|" +
"const|float|native|super|while|" +
- "var|exports|opens|requires|uses|yield|" +
- "module|permits|(?:non\\-)?sealed|var|" +
- "provides|to|when|" +
- "open|record|transitive|with");
+ "yield|when|record|var|" +
+ "permits|(?:non\\-)?sealed");
var buildinConstants = ("null|Infinity|NaN|undefined");
var langClasses = ("AbstractMethodError|AssertionError|ClassCircularityError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|" +
@@ -970,16 +1274,7 @@ var JavaHighlightRules = function () {
}, "identifier");
this.$rules = {
"start": [
- {
- token: "comment",
- regex: "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token: "comment", // multi line comment
- regex: "\\/\\*",
- next: "comment"
- },
+ { include: "comments" },
{ include: "multiline-strings" },
{ include: "strings" },
{ include: "constants" },
@@ -989,14 +1284,18 @@ var JavaHighlightRules = function () {
next: [{
regex: "{",
token: "paren.lparen",
- next: [{
+ push: [
+ {
regex: "}",
token: "paren.rparen",
- next: "start"
- }, {
+ next: "pop"
+ },
+ { include: "comments" },
+ {
regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
token: "keyword"
- }]
+ }
+ ]
}, {
token: "text",
regex: "\\s+"
@@ -1016,14 +1315,29 @@ var JavaHighlightRules = function () {
},
{ include: "statements" }
],
- "comment": [
+ "comments": [
{
- token: "comment", // closing comment
- regex: "\\*\\/",
- next: "start"
- }, {
- defaultToken: "comment"
- }
+ token: "comment",
+ regex: "\\/\\/.*$"
+ },
+ {
+ token: "comment.doc", // doc comment
+ regex: /\/\*\*(?!\/)/,
+ push: "doc-start"
+ },
+ {
+ token: "comment", // multi line comment
+ regex: "\\/\\*",
+ push: [
+ {
+ token: "comment", // closing comment
+ regex: "\\*\\/",
+ next: "pop"
+ }, {
+ defaultToken: "comment"
+ }
+ ]
+ },
],
"strings": [
{
@@ -1166,7 +1480,7 @@ var JavaHighlightRules = function () {
}
]
};
- this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
+ this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("pop")]);
this.normalizeRules();
};
oop.inherits(JavaHighlightRules, TextHighlightRules);
@@ -1229,6 +1543,7 @@ var Mode = function () {
JavaScriptMode.call(this);
this.HighlightRules = JavaHighlightRules;
this.foldingRules = new JavaFoldMode();
+ this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, JavaScriptMode);
(function () {
diff --git a/modules/lib/ace/mode-javascript.js b/modules/lib/ace/mode-javascript.js
index 07289b2..a81f985 100644
--- a/modules/lib/ace/mode-javascript.js
+++ b/modules/lib/ace/mode-javascript.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-jsoniq.js b/modules/lib/ace/mode-jsoniq.js
index 6603306..283b842 100644
--- a/modules/lib/ace/mode-jsoniq.js
+++ b/modules/lib/ace/mode-jsoniq.js
@@ -2085,11 +2085,10 @@ exports.Lexer = function(Tokenizer, Rules) {
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -2178,7 +2177,7 @@ var XmlBehaviour = function () {
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return {
text: ">" + "" + element + ">",
@@ -2192,7 +2191,7 @@ var XmlBehaviour = function () {
var line = session.getLine(cursor.row);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
if (token.value == "/>")
return;
while (token && token.type.indexOf("tag-name") === -1) {
@@ -2207,7 +2206,7 @@ var XmlBehaviour = function () {
if (!token || token.type.indexOf("end-tag") !== -1) {
return;
}
- if (this.voidElements && !this.voidElements[tag]) {
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
var line = session.getLine(row);
var nextIndent = this.$getIndent(line);
diff --git a/modules/lib/ace/mode-jsp.js b/modules/lib/ace/mode-jsp.js
index 1a5a1fa..a82095e 100644
--- a/modules/lib/ace/mode-jsp.js
+++ b/modules/lib/ace/mode-jsp.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1102,7 +1099,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -1118,7 +1115,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -1149,10 +1146,8 @@ var JavaHighlightRules = function () {
"char|final|interface|static|void|" +
"class|finally|long|strictfp|volatile|" +
"const|float|native|super|while|" +
- "var|exports|opens|requires|uses|yield|" +
- "module|permits|(?:non\\-)?sealed|var|" +
- "provides|to|when|" +
- "open|record|transitive|with");
+ "yield|when|record|var|" +
+ "permits|(?:non\\-)?sealed");
var buildinConstants = ("null|Infinity|NaN|undefined");
var langClasses = ("AbstractMethodError|AssertionError|ClassCircularityError|" +
"ClassFormatError|Deprecated|EnumConstantNotPresentException|" +
@@ -1185,16 +1180,7 @@ var JavaHighlightRules = function () {
}, "identifier");
this.$rules = {
"start": [
- {
- token: "comment",
- regex: "\\/\\/.*$"
- },
- DocCommentHighlightRules.getStartRule("doc-start"),
- {
- token: "comment", // multi line comment
- regex: "\\/\\*",
- next: "comment"
- },
+ { include: "comments" },
{ include: "multiline-strings" },
{ include: "strings" },
{ include: "constants" },
@@ -1204,14 +1190,18 @@ var JavaHighlightRules = function () {
next: [{
regex: "{",
token: "paren.lparen",
- next: [{
+ push: [
+ {
regex: "}",
token: "paren.rparen",
- next: "start"
- }, {
+ next: "pop"
+ },
+ { include: "comments" },
+ {
regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
token: "keyword"
- }]
+ }
+ ]
}, {
token: "text",
regex: "\\s+"
@@ -1231,14 +1221,29 @@ var JavaHighlightRules = function () {
},
{ include: "statements" }
],
- "comment": [
+ "comments": [
{
- token: "comment", // closing comment
- regex: "\\*\\/",
- next: "start"
- }, {
- defaultToken: "comment"
- }
+ token: "comment",
+ regex: "\\/\\/.*$"
+ },
+ {
+ token: "comment.doc", // doc comment
+ regex: /\/\*\*(?!\/)/,
+ push: "doc-start"
+ },
+ {
+ token: "comment", // multi line comment
+ regex: "\\/\\*",
+ push: [
+ {
+ token: "comment", // closing comment
+ regex: "\\*\\/",
+ next: "pop"
+ }, {
+ defaultToken: "comment"
+ }
+ ]
+ },
],
"strings": [
{
@@ -1381,7 +1386,7 @@ var JavaHighlightRules = function () {
}
]
};
- this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
+ this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("pop")]);
this.normalizeRules();
};
oop.inherits(JavaHighlightRules, TextHighlightRules);
diff --git a/modules/lib/ace/mode-jsx.js b/modules/lib/ace/mode-jsx.js
index 0a477a3..dd19c57 100644
--- a/modules/lib/ace/mode-jsx.js
+++ b/modules/lib/ace/mode-jsx.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-latte.js b/modules/lib/ace/mode-latte.js
index c198238..9c76a7e 100644
--- a/modules/lib/ace/mode-latte.js
+++ b/modules/lib/ace/mode-latte.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-less.js b/modules/lib/ace/mode-less.js
index 04d348b..4b93ad3 100644
--- a/modules/lib/ace/mode-less.js
+++ b/modules/lib/ace/mode-less.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-liquid.js b/modules/lib/ace/mode-liquid.js
index 01ca02b..1fa7a01 100644
--- a/modules/lib/ace/mode-liquid.js
+++ b/modules/lib/ace/mode-liquid.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-lua.js b/modules/lib/ace/mode-lua.js
index 199822b..982f0d1 100644
--- a/modules/lib/ace/mode-lua.js
+++ b/modules/lib/ace/mode-lua.js
@@ -68,7 +68,7 @@ var LuaHighlightRules = function () {
regex: /\]=*\]/,
next: "start"
}, {
- defaultToken: "comment"
+ defaultToken: "comment.body"
}
]
},
diff --git a/modules/lib/ace/mode-luapage.js b/modules/lib/ace/mode-luapage.js
index 5632ea9..0c5533a 100644
--- a/modules/lib/ace/mode-luapage.js
+++ b/modules/lib/ace/mode-luapage.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
@@ -2341,7 +2401,7 @@ var LuaHighlightRules = function () {
regex: /\]=*\]/,
next: "start"
}, {
- defaultToken: "comment"
+ defaultToken: "comment.body"
}
]
},
diff --git a/modules/lib/ace/mode-markdown.js b/modules/lib/ace/mode-markdown.js
index 255c40c..de58bc4 100644
--- a/modules/lib/ace/mode-markdown.js
+++ b/modules/lib/ace/mode-markdown.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -202,7 +205,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -262,7 +265,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -286,7 +289,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -307,7 +310,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -319,7 +322,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -327,7 +330,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -336,10 +340,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -354,53 +364,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -449,17 +437,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -684,7 +682,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -742,7 +740,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -755,8 +753,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1373,135 +1370,454 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
- if (commentRegex) {
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
- }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
- this._getFoldWidgetBase = this.getFoldWidget;
- this.getFoldWidget = function (session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.singleLineBlockCommentRe.test(line)) {
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
- return "";
- }
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
- if (!fw && this.startRegionRe.test(line))
- return "start"; // lineCommentRegionStart
- return fw;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
- var line = session.getLine(row);
- if (this.startRegionRe.test(line))
- return this.getCommentRegionBlock(session, line, row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
- if (range && !range.isMultiLine()) {
- if (forceMultiline) {
- range = this.getSectionRange(session, row);
- }
- else if (foldStyle != "all")
- range = null;
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
}
- return range;
}
- if (foldStyle === "markbegin")
- return;
- var match = line.match(this.foldingStopMarker);
- if (match) {
- var i = match.index + match[0].length;
- if (match[1])
- return this.closingBracketBlock(session, match[1], row, i);
- return session.getCommentFoldRange(row, i, -1);
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
}
- };
- this.getSectionRange = function (session, row) {
- var line = session.getLine(row);
- var startIndent = line.search(/\S/);
- var startRow = row;
- var startColumn = line.length;
- row = row + 1;
- var endRow = row;
- var maxRow = session.getLength();
- while (++row < maxRow) {
- line = session.getLine(row);
- var indent = line.search(/\S/);
- if (indent === -1)
- continue;
- if (startIndent > indent)
- break;
- var subRange = this.getFoldWidgetRange(session, "all", row);
- if (subRange) {
- if (subRange.start.row <= startRow) {
- break;
- }
- else if (subRange.isMultiLine()) {
- row = subRange.end.row;
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
}
- else if (startIndent == indent) {
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
break;
}
}
- endRow = row;
- }
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
- };
- this.getCommentRegionBlock = function (session, line, row) {
- var startColumn = line.search(/\s*$/);
- var maxRow = session.getLength();
- var startRow = row;
- var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
- var depth = 1;
- while (++row < maxRow) {
- line = session.getLine(row);
- var m = re.exec(line);
- if (!m)
- continue;
- if (m[1])
- depth--;
- else
- depth++;
- if (!depth)
- break;
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
}
- var endRow = row;
- if (endRow > startRow) {
- return new Range(startRow, startColumn, endRow, line.length);
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
}
- };
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ }
+ else if (foldStyle != "all")
+ range = null;
+ }
+ return range;
+ }
+ if (foldStyle === "markbegin")
+ return;
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+ this.getSectionRange = function (session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ }
+ else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ }
+ else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function (session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m)
+ continue;
+ if (m[1])
+ depth--;
+ else
+ depth++;
+ if (!depth)
+ break;
+ }
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
}).call(FoldMode.prototype);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1529,13 +1845,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -1861,154 +2170,6 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2048,107 +2209,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-mask.js b/modules/lib/ace/mode-mask.js
index d2d54b9..a9ff1bc 100644
--- a/modules/lib/ace/mode-mask.js
+++ b/modules/lib/ace/mode-mask.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -779,6 +773,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-mysql.js b/modules/lib/ace/mode-mysql.js
index 9bfc5cd..e4fd4aa 100644
--- a/modules/lib/ace/mode-mysql.js
+++ b/modules/lib/ace/mode-mysql.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-nix.js b/modules/lib/ace/mode-nix.js
index 188fb82..2470fde 100644
--- a/modules/lib/ace/mode-nix.js
+++ b/modules/lib/ace/mode-nix.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-nunjucks.js b/modules/lib/ace/mode-nunjucks.js
index ff6ae64..a787ff3 100644
--- a/modules/lib/ace/mode-nunjucks.js
+++ b/modules/lib/ace/mode-nunjucks.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-objectivec.js b/modules/lib/ace/mode-objectivec.js
index b42c90d..3b81bf1 100644
--- a/modules/lib/ace/mode-objectivec.js
+++ b/modules/lib/ace/mode-objectivec.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-odin.js b/modules/lib/ace/mode-odin.js
index 19fec37..f261f2b 100644
--- a/modules/lib/ace/mode-odin.js
+++ b/modules/lib/ace/mode-odin.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-pgsql.js b/modules/lib/ace/mode-pgsql.js
index 8932879..52c8189 100644
--- a/modules/lib/ace/mode-pgsql.js
+++ b/modules/lib/ace/mode-pgsql.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -637,7 +637,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -697,7 +697,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -721,7 +721,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -742,7 +742,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -754,7 +754,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -762,7 +762,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -771,10 +772,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -789,53 +796,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -884,17 +869,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -1119,7 +1114,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -1177,7 +1172,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -1190,8 +1185,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
diff --git a/modules/lib/ace/mode-php.js b/modules/lib/ace/mode-php.js
index c2f0cde..1111ac3 100644
--- a/modules/lib/ace/mode-php.js
+++ b/modules/lib/ace/mode-php.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -160,6 +160,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -243,7 +246,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -303,7 +306,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -327,7 +330,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -348,7 +351,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -360,7 +363,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -368,7 +371,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -377,10 +381,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -395,53 +405,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -490,17 +478,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -725,7 +723,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -783,7 +781,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -796,8 +794,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -12745,383 +12742,284 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
- this.HighlightRules = JavaScriptHighlightRules;
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ace.define("ace/mode/folding/php",["require","exports","module","ace/lib/oop","ace/mode/folding/cstyle","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var CstyleFoldMode = require("./cstyle").FoldMode;
+var Range = require("../../range").Range;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var FoldMode = exports.FoldMode = function () {
};
-oop.inherits(Mode, TextMode);
+oop.inherits(FoldMode, CstyleFoldMode);
(function () {
- this.lineCommentStart = "//";
- this.blockComment = { start: "/*", end: "*/" };
- this.$quotes = { '"': '"', "'": "'", "`": "`" };
- this.$pairQuotesAfter = {
- "`": /\w/
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.indentKeywords = {
+ "if": 1,
+ "while": 1,
+ "for": 1,
+ "foreach": 1,
+ "switch": 1,
+ "else": 0,
+ "elseif": 0,
+ "endif": -1,
+ "endwhile": -1,
+ "endfor": -1,
+ "endforeach": -1,
+ "endswitch": -1
};
- this.getNextLineIndent = function (state, line, tab) {
- var indent = this.$getIndent(line);
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
- if (tokens.length && tokens[tokens.length - 1].type == "comment") {
- return indent;
+ this.foldingStartMarkerPhp = /(?:\s|^)(if|else|elseif|while|for|foreach|switch).*\:/i;
+ this.foldingStopMarkerPhp = /(?:\s|^)(endif|endwhile|endfor|endforeach|endswitch)\;/i;
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var line = session.doc.getLine(row);
+ var match = this.foldingStartMarkerPhp.exec(line);
+ if (match) {
+ return this.phpBlock(session, row, match.index + 2);
}
- if (state == "start" || state == "no_regex") {
- var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
+ var match = this.foldingStopMarkerPhp.exec(line);
+ if (match) {
+ return this.phpBlock(session, row, match.index + 2);
}
- else if (state == "doc-start") {
- if (endState == "start" || endState == "no_regex") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
+ return this.getFoldWidgetRangeBase(session, foldStyle, row);
+ };
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ var isStart = this.foldingStartMarkerPhp.test(line);
+ var isEnd = this.foldingStopMarkerPhp.test(line);
+ if (isStart && !isEnd) {
+ var match = this.foldingStartMarkerPhp.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type == "keyword") {
+ return "start";
}
- indent += "* ";
}
}
- return indent;
- };
- this.checkOutdent = function (state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
- this.autoOutdent = function (state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
- this.createWorker = function (session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
- worker.on("annotate", function (results) {
- session.setAnnotations(results.data);
- });
- worker.on("terminate", function () {
- session.clearAnnotations();
- });
- return worker;
- };
- this.$id = "ace/mode/javascript";
- this.snippetFileId = "ace/snippets/javascript";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});
-
-ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
-var propertyMap = {
- "background": { "#$0": 1 },
- "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
- "background-image": { "url('/$0')": 1 },
- "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
- "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
- "background-attachment": { "scroll": 1, "fixed": 1 },
- "background-size": { "cover": 1, "contain": 1 },
- "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
- "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
- "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
- "border-color": { "#$0": 1 },
- "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
- "border-collapse": { "collapse": 1, "separate": 1 },
- "bottom": { "px": 1, "em": 1, "%": 1 },
- "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
- "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
- "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
- "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
- "empty-cells": { "show": 1, "hide": 1 },
- "float": { "left": 1, "right": 1, "none": 1 },
- "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
- "font-size": { "px": 1, "em": 1, "%": 1 },
- "font-weight": { "bold": 1, "normal": 1 },
- "font-style": { "italic": 1, "normal": 1 },
- "font-variant": { "normal": 1, "small-caps": 1 },
- "height": { "px": 1, "em": 1, "%": 1 },
- "left": { "px": 1, "em": 1, "%": 1 },
- "letter-spacing": { "normal": 1 },
- "line-height": { "normal": 1 },
- "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
- "margin": { "px": 1, "em": 1, "%": 1 },
- "margin-right": { "px": 1, "em": 1, "%": 1 },
- "margin-left": { "px": 1, "em": 1, "%": 1 },
- "margin-top": { "px": 1, "em": 1, "%": 1 },
- "margin-bottom": { "px": 1, "em": 1, "%": 1 },
- "max-height": { "px": 1, "em": 1, "%": 1 },
- "max-width": { "px": 1, "em": 1, "%": 1 },
- "min-height": { "px": 1, "em": 1, "%": 1 },
- "min-width": { "px": 1, "em": 1, "%": 1 },
- "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "padding": { "px": 1, "em": 1, "%": 1 },
- "padding-top": { "px": 1, "em": 1, "%": 1 },
- "padding-right": { "px": 1, "em": 1, "%": 1 },
- "padding-bottom": { "px": 1, "em": 1, "%": 1 },
- "padding-left": { "px": 1, "em": 1, "%": 1 },
- "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
- "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
- "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
- "right": { "px": 1, "em": 1, "%": 1 },
- "table-layout": { "fixed": 1, "auto": 1 },
- "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
- "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
- "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
- "top": { "px": 1, "em": 1, "%": 1 },
- "vertical-align": { "top": 1, "bottom": 1 },
- "visibility": { "hidden": 1, "visible": 1 },
- "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
- "width": { "px": 1, "em": 1, "%": 1 },
- "word-spacing": { "normal": 1 },
- "filter": { "alpha(opacity=$0100)": 1 },
- "text-shadow": { "$02px 2px 2px #777": 1 },
- "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
- "-moz-border-radius": 1,
- "-moz-border-radius-topright": 1,
- "-moz-border-radius-bottomright": 1,
- "-moz-border-radius-topleft": 1,
- "-moz-border-radius-bottomleft": 1,
- "-webkit-border-radius": 1,
- "-webkit-border-top-right-radius": 1,
- "-webkit-border-top-left-radius": 1,
- "-webkit-border-bottom-right-radius": 1,
- "-webkit-border-bottom-left-radius": 1,
- "-moz-box-shadow": 1,
- "-webkit-box-shadow": 1,
- "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
- "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
- "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
-};
-var CssCompletions = function () {
-};
-(function () {
- this.completionsDefined = false;
- this.defineCompletions = function () {
- if (document) {
- var style = document.createElement('c').style;
- for (var i in style) {
- if (typeof style[i] !== 'string')
- continue;
- var name = i.replace(/[A-Z]/g, function (x) {
- return '-' + x.toLowerCase();
- });
- if (!propertyMap.hasOwnProperty(name))
- propertyMap[name] = 1;
+ if (isEnd && foldStyle === "markbeginend") {
+ var match = this.foldingStopMarkerPhp.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type == "keyword") {
+ return "end";
+ }
}
}
- this.completionsDefined = true;
+ return this.getFoldWidgetBase(session, foldStyle, row);
};
- this.getCompletions = function (state, session, pos, prefix) {
- if (!this.completionsDefined) {
- this.defineCompletions();
+ this.phpBlock = function (session, row, column, tokenRange) {
+ var stream = new TokenIterator(session, row, column);
+ var token = stream.getCurrentToken();
+ if (!token || token.type != "keyword")
+ return;
+ var val = token.value;
+ var stack = [val];
+ var dir = this.indentKeywords[val];
+ if (val === "else" || val === "elseif") {
+ dir = 1;
}
- if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
- var line = session.getLine(pos.row).substr(0, pos.column);
- var inParens = /\([^)]*$/.test(line);
- if (inParens) {
- line = line.substr(line.lastIndexOf('(') + 1);
- }
- if (/:[^;]+$/.test(line)) {
- /([\w\-]+):[^:]*$/.test(line);
- return this.getPropertyValueCompletions(state, session, pos, prefix);
+ if (!dir)
+ return;
+ var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length;
+ var startRow = row;
+ stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
+ while (token = stream.step()) {
+ if (token.type !== "keyword")
+ continue;
+ var level = dir * this.indentKeywords[token.value];
+ if (level > 0) {
+ stack.unshift(token.value);
}
- else {
- return this.getPropertyCompletions(state, session, pos, prefix, inParens);
+ else if (level <= 0) {
+ stack.shift();
+ if (!stack.length)
+ break;
+ if (level === 0)
+ stack.unshift(token.value);
}
}
- return [];
- };
- this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
- skipSemicolon = skipSemicolon || false;
- var properties = Object.keys(propertyMap);
- return properties.map(function (property) {
- return {
- caption: property,
- snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
- meta: "property",
- score: 1000000
- };
- });
- };
- this.getPropertyValueCompletions = function (state, session, pos, prefix) {
- var line = session.getLine(pos.row).substr(0, pos.column);
- var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
- if (!property)
- return [];
- var values = [];
- if (property in propertyMap && typeof propertyMap[property] === "object") {
- values = Object.keys(propertyMap[property]);
- }
- return values.map(function (value) {
- return {
- caption: value,
- snippet: value,
- meta: "property value",
- score: 1000000
- };
- });
+ if (!token)
+ return null;
+ if (tokenRange)
+ return stream.getCurrentTokenRange();
+ var row = stream.getCurrentTokenRow();
+ if (dir === -1)
+ return new Range(row, session.getLine(row).length, startRow, startColumn);
+ else
+ return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn());
};
-}).call(CssCompletions.prototype);
-exports.CssCompletions = CssCompletions;
+}).call(FoldMode.prototype);
});
-ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var CssBehaviour = function () {
- this.inherit(CstyleBehaviour);
- this.add("colon", "insertion", function (state, action, editor, session, text) {
- if (text === ':' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
- }
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ':') {
- return {
- text: '',
- selection: [1, 1]
- };
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
+ this.defaultMode = defaultMode;
+ this.subModes = subModes;
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.$getMode = function (state) {
+ if (typeof state != "string")
+ state = state[0];
+ for (var key in this.subModes) {
+ if (state.indexOf(key) === 0)
+ return this.subModes[key];
+ }
+ return null;
+ };
+ this.$tryMode = function (state, session, foldStyle, row) {
+ var mode = this.$getMode(state);
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
+ };
+ this.getFoldWidget = function (session, foldStyle, row) {
+ return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
+ this.defaultMode.getFoldWidget(session, foldStyle, row));
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var mode = this.$getMode(session.getState(row - 1));
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.$getMode(session.getState(row));
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.defaultMode;
+ return mode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
}
+ return tag;
}
- }
- });
- this.add("colon", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected === ':') {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
}
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar === ';') {
- range.end.column++;
- return range;
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
}
+ if (token && token.value == tagName)
+ return true;
}
}
- });
- this.add("semicolon", "insertion", function (state, action, editor, session, text) {
- if (text === ';' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ';') {
- return {
- text: '',
- selection: [1, 1]
- };
- }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
}
- });
- this.add("!important", "insertion", function (state, action, editor, session, text) {
- if (text === '!' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
- return {
- text: '!important',
- selection: [10, 10]
- };
- }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
}
- });
-};
-oop.inherits(CssBehaviour, CstyleBehaviour);
-exports.CssBehaviour = CssBehaviour;
+ };
+}).call(FoldMode.prototype);
});
-ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CssCompletions = require("./css_completions").CssCompletions;
-var CssBehaviour = require("./behaviour/css").CssBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
- this.HighlightRules = CssHighlightRules;
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CssBehaviour();
- this.$completer = new CssCompletions();
- this.foldingRules = new CStyleFoldMode();
+ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var MixedFoldMode = require("./mixed").FoldMode;
+var XmlFoldMode = require("./xml").FoldMode;
+var CStyleFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
+ "js-": new CStyleFoldMode(),
+ "css-": new CStyleFoldMode()
+ });
};
-oop.inherits(Mode, TextMode);
-(function () {
- this.foldingRules = "cStyle";
- this.blockComment = { start: "/*", end: "*/" };
- this.getNextLineIndent = function (state, line, tab) {
- var indent = this.$getIndent(line);
- var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
- if (tokens.length && tokens[tokens.length - 1].type == "comment") {
- return indent;
- }
- var match = line.match(/^.*\{\s*$/);
- if (match) {
- indent += tab;
- }
- return indent;
- };
- this.checkOutdent = function (state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
- this.autoOutdent = function (state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
- this.getCompletions = function (state, session, pos, prefix) {
- return this.$completer.getCompletions(state, session, pos, prefix);
- };
- this.createWorker = function (session) {
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
- worker.attachToDocument(session.getDocument());
- worker.on("annotate", function (e) {
- session.setAnnotations(e.data);
- });
- worker.on("terminate", function () {
- session.clearAnnotations();
- });
- return worker;
- };
- this.$id = "ace/mode/css";
- this.snippetFileId = "ace/snippets/css";
-}).call(Mode.prototype);
-exports.Mode = Mode;
+oop.inherits(FoldMode, MixedFoldMode);
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -13203,220 +13101,492 @@ var XmlBehaviour = function () {
break;
}
}
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
+var Mode = function () {
+ this.HighlightRules = JavaScriptHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
+};
+oop.inherits(Mode, TextMode);
+(function () {
+ this.lineCommentStart = "//";
+ this.blockComment = { start: "/*", end: "*/" };
+ this.$quotes = { '"': '"', "'": "'", "`": "`" };
+ this.$pairQuotesAfter = {
+ "`": /\w/
+ };
+ this.getNextLineIndent = function (state, line, tab) {
+ var indent = this.$getIndent(line);
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+ var endState = tokenizedLine.state;
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+ return indent;
+ }
+ if (state == "start" || state == "no_regex") {
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ }
+ else if (state == "doc-start") {
+ if (endState == "start" || endState == "no_regex") {
+ return "";
+ }
+ }
+ return indent;
+ };
+ this.checkOutdent = function (state, line, input) {
+ return this.$outdent.checkOutdent(line, input);
+ };
+ this.autoOutdent = function (state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
+ };
+ this.createWorker = function (session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
+ worker.attachToDocument(session.getDocument());
+ worker.on("annotate", function (results) {
+ session.setAnnotations(results.data);
+ });
+ worker.on("terminate", function () {
+ session.clearAnnotations();
+ });
+ return worker;
+ };
+ this.$id = "ace/mode/javascript";
+ this.snippetFileId = "ace/snippets/javascript";
+}).call(Mode.prototype);
+exports.Mode = Mode;
+
+});
+
+ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
+var propertyMap = {
+ "background": { "#$0": 1 },
+ "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
+ "background-image": { "url('/$0')": 1 },
+ "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
+ "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
+ "background-attachment": { "scroll": 1, "fixed": 1 },
+ "background-size": { "cover": 1, "contain": 1 },
+ "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
+ "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
+ "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
+ "border-color": { "#$0": 1 },
+ "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
+ "border-collapse": { "collapse": 1, "separate": 1 },
+ "bottom": { "px": 1, "em": 1, "%": 1 },
+ "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
+ "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
+ "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
+ "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
+ "empty-cells": { "show": 1, "hide": 1 },
+ "float": { "left": 1, "right": 1, "none": 1 },
+ "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
+ "font-size": { "px": 1, "em": 1, "%": 1 },
+ "font-weight": { "bold": 1, "normal": 1 },
+ "font-style": { "italic": 1, "normal": 1 },
+ "font-variant": { "normal": 1, "small-caps": 1 },
+ "height": { "px": 1, "em": 1, "%": 1 },
+ "left": { "px": 1, "em": 1, "%": 1 },
+ "letter-spacing": { "normal": 1 },
+ "line-height": { "normal": 1 },
+ "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
+ "margin": { "px": 1, "em": 1, "%": 1 },
+ "margin-right": { "px": 1, "em": 1, "%": 1 },
+ "margin-left": { "px": 1, "em": 1, "%": 1 },
+ "margin-top": { "px": 1, "em": 1, "%": 1 },
+ "margin-bottom": { "px": 1, "em": 1, "%": 1 },
+ "max-height": { "px": 1, "em": 1, "%": 1 },
+ "max-width": { "px": 1, "em": 1, "%": 1 },
+ "min-height": { "px": 1, "em": 1, "%": 1 },
+ "min-width": { "px": 1, "em": 1, "%": 1 },
+ "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "padding": { "px": 1, "em": 1, "%": 1 },
+ "padding-top": { "px": 1, "em": 1, "%": 1 },
+ "padding-right": { "px": 1, "em": 1, "%": 1 },
+ "padding-bottom": { "px": 1, "em": 1, "%": 1 },
+ "padding-left": { "px": 1, "em": 1, "%": 1 },
+ "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
+ "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
+ "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
+ "right": { "px": 1, "em": 1, "%": 1 },
+ "table-layout": { "fixed": 1, "auto": 1 },
+ "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
+ "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
+ "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
+ "top": { "px": 1, "em": 1, "%": 1 },
+ "vertical-align": { "top": 1, "bottom": 1 },
+ "visibility": { "hidden": 1, "visible": 1 },
+ "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
+ "width": { "px": 1, "em": 1, "%": 1 },
+ "word-spacing": { "normal": 1 },
+ "filter": { "alpha(opacity=$0100)": 1 },
+ "text-shadow": { "$02px 2px 2px #777": 1 },
+ "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
+ "-moz-border-radius": 1,
+ "-moz-border-radius-topright": 1,
+ "-moz-border-radius-bottomright": 1,
+ "-moz-border-radius-topleft": 1,
+ "-moz-border-radius-bottomleft": 1,
+ "-webkit-border-radius": 1,
+ "-webkit-border-top-right-radius": 1,
+ "-webkit-border-top-left-radius": 1,
+ "-webkit-border-bottom-right-radius": 1,
+ "-webkit-border-bottom-left-radius": 1,
+ "-moz-box-shadow": 1,
+ "-webkit-box-shadow": 1,
+ "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
+ "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
+ "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
+};
+var CssCompletions = function () {
+};
+(function () {
+ this.completionsDefined = false;
+ this.defineCompletions = function () {
+ if (document) {
+ var style = document.createElement('c').style;
+ for (var i in style) {
+ if (typeof style[i] !== 'string')
+ continue;
+ var name = i.replace(/[A-Z]/g, function (x) {
+ return '-' + x.toLowerCase();
+ });
+ if (!propertyMap.hasOwnProperty(name))
+ propertyMap[name] = 1;
+ }
+ }
+ this.completionsDefined = true;
+ };
+ this.getCompletions = function (state, session, pos, prefix) {
+ if (!this.completionsDefined) {
+ this.defineCompletions();
+ }
+ if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ var inParens = /\([^)]*$/.test(line);
+ if (inParens) {
+ line = line.substr(line.lastIndexOf('(') + 1);
+ }
+ if (/:[^;]+$/.test(line)) {
+ /([\w\-]+):[^:]*$/.test(line);
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
+ }
+ else {
+ return this.getPropertyCompletions(state, session, pos, prefix, inParens);
+ }
+ }
+ return [];
+ };
+ this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
+ skipSemicolon = skipSemicolon || false;
+ var properties = Object.keys(propertyMap);
+ return properties.map(function (property) {
+ return {
+ caption: property,
+ snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
+ meta: "property",
+ score: 1000000
+ };
+ });
+ };
+ this.getPropertyValueCompletions = function (state, session, pos, prefix) {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
+ if (!property)
+ return [];
+ var values = [];
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
+ values = Object.keys(propertyMap[property]);
+ }
+ return values.map(function (value) {
+ return {
+ caption: value,
+ snippet: value,
+ meta: "property value",
+ score: 1000000
+ };
+ });
+ };
+}).call(CssCompletions.prototype);
+exports.CssCompletions = CssCompletions;
+
+});
+
+ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CssBehaviour = function () {
+ this.inherit(CstyleBehaviour);
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
+ if (text === ':' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ':') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
+ return {
+ text: ':;',
+ selection: [1, 1]
+ };
+ }
+ }
+ }
+ });
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && selected === ':') {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
+ if (rightChar === ';') {
+ range.end.column++;
+ return range;
+ }
+ }
+ }
+ });
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
+ if (text === ';' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ';') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
}
});
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
+ this.add("!important", "insertion", function (state, action, editor, session, text) {
+ if (text === '!' && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
+ var line = session.doc.getLine(cursor.row);
+ if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
+ return {
+ text: '!important',
+ selection: [10, 10]
+ };
}
}
});
};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
+oop.inherits(CssBehaviour, CstyleBehaviour);
+exports.CssBehaviour = CssBehaviour;
});
-ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
- this.defaultMode = defaultMode;
- this.subModes = subModes;
+ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var CssCompletions = require("./css_completions").CssCompletions;
+var CssBehaviour = require("./behaviour/css").CssBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var Mode = function () {
+ this.HighlightRules = CssHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CssBehaviour();
+ this.$completer = new CssCompletions();
+ this.foldingRules = new CStyleFoldMode();
};
-oop.inherits(FoldMode, BaseFoldMode);
+oop.inherits(Mode, TextMode);
(function () {
- this.$getMode = function (state) {
- if (typeof state != "string")
- state = state[0];
- for (var key in this.subModes) {
- if (state.indexOf(key) === 0)
- return this.subModes[key];
+ this.foldingRules = "cStyle";
+ this.blockComment = { start: "/*", end: "*/" };
+ this.getNextLineIndent = function (state, line, tab) {
+ var indent = this.$getIndent(line);
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+ return indent;
}
- return null;
- };
- this.$tryMode = function (state, session, foldStyle, row) {
- var mode = this.$getMode(state);
- return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
- };
- this.getFoldWidget = function (session, foldStyle, row) {
- return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
- this.$tryMode(session.getState(row), session, foldStyle, row) ||
- this.defaultMode.getFoldWidget(session, foldStyle, row));
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var mode = this.$getMode(session.getState(row - 1));
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.$getMode(session.getState(row));
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.defaultMode;
- return mode.getFoldWidgetRange(session, foldStyle, row);
- };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
+ var match = line.match(/^.*\{\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ return indent;
};
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
+ this.autoOutdent = function (state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
};
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
+ this.getCompletions = function (state, session, pos, prefix) {
+ return this.$completer.getCompletions(state, session, pos, prefix);
};
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
+ this.createWorker = function (session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+ worker.on("annotate", function (e) {
+ session.setAnnotations(e.data);
+ });
+ worker.on("terminate", function () {
+ session.clearAnnotations();
+ });
+ return worker;
};
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var MixedFoldMode = require("./mixed").FoldMode;
-var XmlFoldMode = require("./xml").FoldMode;
-var CStyleFoldMode = require("./cstyle").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
- MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
- "js-": new CStyleFoldMode(),
- "css-": new CStyleFoldMode()
- });
-};
-oop.inherits(FoldMode, MixedFoldMode);
+ this.$id = "ace/mode/css";
+ this.snippetFileId = "ace/snippets/css";
+}).call(Mode.prototype);
+exports.Mode = Mode;
});
@@ -13779,7 +13949,7 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/php_completions","ace/mode/folding/cstyle","ace/unicode","ace/mode/html","ace/mode/javascript","ace/mode/css"], function(require, exports, module){"use strict";
+ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/php_completions","ace/mode/folding/php","ace/unicode","ace/mode/folding/mixed","ace/mode/folding/html","ace/mode/folding/cstyle","ace/mode/html","ace/mode/javascript","ace/mode/css"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
@@ -13787,8 +13957,11 @@ var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRul
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var PhpCompletions = require("./php_completions").PhpCompletions;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var PhpFoldMode = require("./folding/php").FoldMode;
var unicode = require("../unicode");
+var MixedFoldMode = require("./folding/mixed").FoldMode;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+var CstyleFoldMode = require("./folding/cstyle").FoldMode;
var HtmlMode = require("./html").Mode;
var JavaScriptMode = require("./javascript").Mode;
var CssMode = require("./css").Mode;
@@ -13797,7 +13970,11 @@ var PhpMode = function (opts) {
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.$completer = new PhpCompletions();
- this.foldingRules = new CStyleFoldMode();
+ this.foldingRules = new MixedFoldMode(new HtmlFoldMode(), {
+ "js-": new CstyleFoldMode(),
+ "css-": new CstyleFoldMode(),
+ "php-": new PhpFoldMode()
+ });
};
oop.inherits(PhpMode, TextMode);
(function () {
@@ -13858,7 +14035,11 @@ var Mode = function (opts) {
"css-": CssMode,
"php-": PhpMode
});
- this.foldingRules.subModes["php-"] = new CStyleFoldMode();
+ this.foldingRules = new MixedFoldMode(new HtmlFoldMode(), {
+ "js-": new CstyleFoldMode(),
+ "css-": new CstyleFoldMode(),
+ "php-": new PhpFoldMode()
+ });
};
oop.inherits(Mode, HtmlMode);
(function () {
diff --git a/modules/lib/ace/mode-php_laravel_blade.js b/modules/lib/ace/mode-php_laravel_blade.js
index 7c24fa4..89b1d38 100644
--- a/modules/lib/ace/mode-php_laravel_blade.js
+++ b/modules/lib/ace/mode-php_laravel_blade.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -160,6 +160,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -243,7 +246,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -303,7 +306,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -327,7 +330,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -348,7 +351,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -360,7 +363,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -368,7 +371,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -377,10 +381,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -395,53 +405,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -490,17 +478,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -725,7 +723,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -783,7 +781,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -796,8 +794,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -12909,383 +12906,284 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
- this.HighlightRules = JavaScriptHighlightRules;
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ace.define("ace/mode/folding/php",["require","exports","module","ace/lib/oop","ace/mode/folding/cstyle","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var CstyleFoldMode = require("./cstyle").FoldMode;
+var Range = require("../../range").Range;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var FoldMode = exports.FoldMode = function () {
};
-oop.inherits(Mode, TextMode);
+oop.inherits(FoldMode, CstyleFoldMode);
(function () {
- this.lineCommentStart = "//";
- this.blockComment = { start: "/*", end: "*/" };
- this.$quotes = { '"': '"', "'": "'", "`": "`" };
- this.$pairQuotesAfter = {
- "`": /\w/
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.indentKeywords = {
+ "if": 1,
+ "while": 1,
+ "for": 1,
+ "foreach": 1,
+ "switch": 1,
+ "else": 0,
+ "elseif": 0,
+ "endif": -1,
+ "endwhile": -1,
+ "endfor": -1,
+ "endforeach": -1,
+ "endswitch": -1
};
- this.getNextLineIndent = function (state, line, tab) {
- var indent = this.$getIndent(line);
- var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
- var tokens = tokenizedLine.tokens;
- var endState = tokenizedLine.state;
- if (tokens.length && tokens[tokens.length - 1].type == "comment") {
- return indent;
+ this.foldingStartMarkerPhp = /(?:\s|^)(if|else|elseif|while|for|foreach|switch).*\:/i;
+ this.foldingStopMarkerPhp = /(?:\s|^)(endif|endwhile|endfor|endforeach|endswitch)\;/i;
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var line = session.doc.getLine(row);
+ var match = this.foldingStartMarkerPhp.exec(line);
+ if (match) {
+ return this.phpBlock(session, row, match.index + 2);
}
- if (state == "start" || state == "no_regex") {
- var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
- if (match) {
- indent += tab;
- }
+ var match = this.foldingStopMarkerPhp.exec(line);
+ if (match) {
+ return this.phpBlock(session, row, match.index + 2);
}
- else if (state == "doc-start") {
- if (endState == "start" || endState == "no_regex") {
- return "";
- }
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
+ return this.getFoldWidgetRangeBase(session, foldStyle, row);
+ };
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ var isStart = this.foldingStartMarkerPhp.test(line);
+ var isEnd = this.foldingStopMarkerPhp.test(line);
+ if (isStart && !isEnd) {
+ var match = this.foldingStartMarkerPhp.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type == "keyword") {
+ return "start";
}
- indent += "* ";
}
}
- return indent;
- };
- this.checkOutdent = function (state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
- this.autoOutdent = function (state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
- this.createWorker = function (session) {
- var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
- worker.attachToDocument(session.getDocument());
- worker.on("annotate", function (results) {
- session.setAnnotations(results.data);
- });
- worker.on("terminate", function () {
- session.clearAnnotations();
- });
- return worker;
- };
- this.$id = "ace/mode/javascript";
- this.snippetFileId = "ace/snippets/javascript";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});
-
-ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
-var propertyMap = {
- "background": { "#$0": 1 },
- "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
- "background-image": { "url('/$0')": 1 },
- "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
- "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
- "background-attachment": { "scroll": 1, "fixed": 1 },
- "background-size": { "cover": 1, "contain": 1 },
- "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
- "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
- "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
- "border-color": { "#$0": 1 },
- "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
- "border-collapse": { "collapse": 1, "separate": 1 },
- "bottom": { "px": 1, "em": 1, "%": 1 },
- "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
- "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
- "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
- "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
- "empty-cells": { "show": 1, "hide": 1 },
- "float": { "left": 1, "right": 1, "none": 1 },
- "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
- "font-size": { "px": 1, "em": 1, "%": 1 },
- "font-weight": { "bold": 1, "normal": 1 },
- "font-style": { "italic": 1, "normal": 1 },
- "font-variant": { "normal": 1, "small-caps": 1 },
- "height": { "px": 1, "em": 1, "%": 1 },
- "left": { "px": 1, "em": 1, "%": 1 },
- "letter-spacing": { "normal": 1 },
- "line-height": { "normal": 1 },
- "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
- "margin": { "px": 1, "em": 1, "%": 1 },
- "margin-right": { "px": 1, "em": 1, "%": 1 },
- "margin-left": { "px": 1, "em": 1, "%": 1 },
- "margin-top": { "px": 1, "em": 1, "%": 1 },
- "margin-bottom": { "px": 1, "em": 1, "%": 1 },
- "max-height": { "px": 1, "em": 1, "%": 1 },
- "max-width": { "px": 1, "em": 1, "%": 1 },
- "min-height": { "px": 1, "em": 1, "%": 1 },
- "min-width": { "px": 1, "em": 1, "%": 1 },
- "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
- "padding": { "px": 1, "em": 1, "%": 1 },
- "padding-top": { "px": 1, "em": 1, "%": 1 },
- "padding-right": { "px": 1, "em": 1, "%": 1 },
- "padding-bottom": { "px": 1, "em": 1, "%": 1 },
- "padding-left": { "px": 1, "em": 1, "%": 1 },
- "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
- "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
- "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
- "right": { "px": 1, "em": 1, "%": 1 },
- "table-layout": { "fixed": 1, "auto": 1 },
- "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
- "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
- "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
- "top": { "px": 1, "em": 1, "%": 1 },
- "vertical-align": { "top": 1, "bottom": 1 },
- "visibility": { "hidden": 1, "visible": 1 },
- "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
- "width": { "px": 1, "em": 1, "%": 1 },
- "word-spacing": { "normal": 1 },
- "filter": { "alpha(opacity=$0100)": 1 },
- "text-shadow": { "$02px 2px 2px #777": 1 },
- "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
- "-moz-border-radius": 1,
- "-moz-border-radius-topright": 1,
- "-moz-border-radius-bottomright": 1,
- "-moz-border-radius-topleft": 1,
- "-moz-border-radius-bottomleft": 1,
- "-webkit-border-radius": 1,
- "-webkit-border-top-right-radius": 1,
- "-webkit-border-top-left-radius": 1,
- "-webkit-border-bottom-right-radius": 1,
- "-webkit-border-bottom-left-radius": 1,
- "-moz-box-shadow": 1,
- "-webkit-box-shadow": 1,
- "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
- "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
- "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
-};
-var CssCompletions = function () {
-};
-(function () {
- this.completionsDefined = false;
- this.defineCompletions = function () {
- if (document) {
- var style = document.createElement('c').style;
- for (var i in style) {
- if (typeof style[i] !== 'string')
- continue;
- var name = i.replace(/[A-Z]/g, function (x) {
- return '-' + x.toLowerCase();
- });
- if (!propertyMap.hasOwnProperty(name))
- propertyMap[name] = 1;
+ if (isEnd && foldStyle === "markbeginend") {
+ var match = this.foldingStopMarkerPhp.exec(line);
+ var keyword = match && match[1].toLowerCase();
+ if (keyword) {
+ var type = session.getTokenAt(row, match.index + 2).type;
+ if (type == "keyword") {
+ return "end";
+ }
}
}
- this.completionsDefined = true;
+ return this.getFoldWidgetBase(session, foldStyle, row);
};
- this.getCompletions = function (state, session, pos, prefix) {
- if (!this.completionsDefined) {
- this.defineCompletions();
+ this.phpBlock = function (session, row, column, tokenRange) {
+ var stream = new TokenIterator(session, row, column);
+ var token = stream.getCurrentToken();
+ if (!token || token.type != "keyword")
+ return;
+ var val = token.value;
+ var stack = [val];
+ var dir = this.indentKeywords[val];
+ if (val === "else" || val === "elseif") {
+ dir = 1;
}
- if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
- var line = session.getLine(pos.row).substr(0, pos.column);
- var inParens = /\([^)]*$/.test(line);
- if (inParens) {
- line = line.substr(line.lastIndexOf('(') + 1);
- }
- if (/:[^;]+$/.test(line)) {
- /([\w\-]+):[^:]*$/.test(line);
- return this.getPropertyValueCompletions(state, session, pos, prefix);
+ if (!dir)
+ return;
+ var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length;
+ var startRow = row;
+ stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
+ while (token = stream.step()) {
+ if (token.type !== "keyword")
+ continue;
+ var level = dir * this.indentKeywords[token.value];
+ if (level > 0) {
+ stack.unshift(token.value);
}
- else {
- return this.getPropertyCompletions(state, session, pos, prefix, inParens);
+ else if (level <= 0) {
+ stack.shift();
+ if (!stack.length)
+ break;
+ if (level === 0)
+ stack.unshift(token.value);
}
}
- return [];
- };
- this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
- skipSemicolon = skipSemicolon || false;
- var properties = Object.keys(propertyMap);
- return properties.map(function (property) {
- return {
- caption: property,
- snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
- meta: "property",
- score: 1000000
- };
- });
- };
- this.getPropertyValueCompletions = function (state, session, pos, prefix) {
- var line = session.getLine(pos.row).substr(0, pos.column);
- var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
- if (!property)
- return [];
- var values = [];
- if (property in propertyMap && typeof propertyMap[property] === "object") {
- values = Object.keys(propertyMap[property]);
- }
- return values.map(function (value) {
- return {
- caption: value,
- snippet: value,
- meta: "property value",
- score: 1000000
- };
- });
+ if (!token)
+ return null;
+ if (tokenRange)
+ return stream.getCurrentTokenRange();
+ var row = stream.getCurrentTokenRow();
+ if (dir === -1)
+ return new Range(row, session.getLine(row).length, startRow, startColumn);
+ else
+ return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn());
};
-}).call(CssCompletions.prototype);
-exports.CssCompletions = CssCompletions;
+}).call(FoldMode.prototype);
});
-ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var CssBehaviour = function () {
- this.inherit(CstyleBehaviour);
- this.add("colon", "insertion", function (state, action, editor, session, text) {
- if (text === ':' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
- }
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ':') {
- return {
- text: '',
- selection: [1, 1]
- };
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
+ this.defaultMode = defaultMode;
+ this.subModes = subModes;
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.$getMode = function (state) {
+ if (typeof state != "string")
+ state = state[0];
+ for (var key in this.subModes) {
+ if (state.indexOf(key) === 0)
+ return this.subModes[key];
+ }
+ return null;
+ };
+ this.$tryMode = function (state, session, foldStyle, row) {
+ var mode = this.$getMode(state);
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
+ };
+ this.getFoldWidget = function (session, foldStyle, row) {
+ return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
+ this.defaultMode.getFoldWidget(session, foldStyle, row));
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var mode = this.$getMode(session.getState(row - 1));
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.$getMode(session.getState(row));
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
+ mode = this.defaultMode;
+ return mode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
}
+ return tag;
}
- }
- });
- this.add("colon", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && selected === ':') {
- var cursor = editor.getCursorPosition();
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.value.match(/\s+/)) {
- token = iterator.stepBackward();
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
}
- if (token && token.type === 'support.type') {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.end.column, range.end.column + 1);
- if (rightChar === ';') {
- range.end.column++;
- return range;
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
}
+ if (token && token.value == tagName)
+ return true;
}
}
- });
- this.add("semicolon", "insertion", function (state, action, editor, session, text) {
- if (text === ';' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- if (rightChar === ';') {
- return {
- text: '',
- selection: [1, 1]
- };
- }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
}
- });
- this.add("!important", "insertion", function (state, action, editor, session, text) {
- if (text === '!' && editor.selection.isEmpty()) {
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
- return {
- text: '!important',
- selection: [10, 10]
- };
- }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
}
- });
-};
-oop.inherits(CssBehaviour, CstyleBehaviour);
-exports.CssBehaviour = CssBehaviour;
+ };
+}).call(FoldMode.prototype);
});
-ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CssCompletions = require("./css_completions").CssCompletions;
-var CssBehaviour = require("./behaviour/css").CssBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
- this.HighlightRules = CssHighlightRules;
- this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CssBehaviour();
- this.$completer = new CssCompletions();
- this.foldingRules = new CStyleFoldMode();
+ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var MixedFoldMode = require("./mixed").FoldMode;
+var XmlFoldMode = require("./xml").FoldMode;
+var CStyleFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
+ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
+ "js-": new CStyleFoldMode(),
+ "css-": new CStyleFoldMode()
+ });
};
-oop.inherits(Mode, TextMode);
-(function () {
- this.foldingRules = "cStyle";
- this.blockComment = { start: "/*", end: "*/" };
- this.getNextLineIndent = function (state, line, tab) {
- var indent = this.$getIndent(line);
- var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
- if (tokens.length && tokens[tokens.length - 1].type == "comment") {
- return indent;
- }
- var match = line.match(/^.*\{\s*$/);
- if (match) {
- indent += tab;
- }
- return indent;
- };
- this.checkOutdent = function (state, line, input) {
- return this.$outdent.checkOutdent(line, input);
- };
- this.autoOutdent = function (state, doc, row) {
- this.$outdent.autoOutdent(doc, row);
- };
- this.getCompletions = function (state, session, pos, prefix) {
- return this.$completer.getCompletions(state, session, pos, prefix);
- };
- this.createWorker = function (session) {
- var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
- worker.attachToDocument(session.getDocument());
- worker.on("annotate", function (e) {
- session.setAnnotations(e.data);
- });
- worker.on("terminate", function () {
- session.clearAnnotations();
- });
- return worker;
- };
- this.$id = "ace/mode/css";
- this.snippetFileId = "ace/snippets/css";
-}).call(Mode.prototype);
-exports.Mode = Mode;
+oop.inherits(FoldMode, MixedFoldMode);
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -13367,220 +13265,492 @@ var XmlBehaviour = function () {
break;
}
}
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
+var Mode = function () {
+ this.HighlightRules = JavaScriptHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
+};
+oop.inherits(Mode, TextMode);
+(function () {
+ this.lineCommentStart = "//";
+ this.blockComment = { start: "/*", end: "*/" };
+ this.$quotes = { '"': '"', "'": "'", "`": "`" };
+ this.$pairQuotesAfter = {
+ "`": /\w/
+ };
+ this.getNextLineIndent = function (state, line, tab) {
+ var indent = this.$getIndent(line);
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+ var tokens = tokenizedLine.tokens;
+ var endState = tokenizedLine.state;
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+ return indent;
+ }
+ if (state == "start" || state == "no_regex") {
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ }
+ else if (state == "doc-start") {
+ if (endState == "start" || endState == "no_regex") {
+ return "";
+ }
+ }
+ return indent;
+ };
+ this.checkOutdent = function (state, line, input) {
+ return this.$outdent.checkOutdent(line, input);
+ };
+ this.autoOutdent = function (state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
+ };
+ this.createWorker = function (session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
+ worker.attachToDocument(session.getDocument());
+ worker.on("annotate", function (results) {
+ session.setAnnotations(results.data);
+ });
+ worker.on("terminate", function () {
+ session.clearAnnotations();
+ });
+ return worker;
+ };
+ this.$id = "ace/mode/javascript";
+ this.snippetFileId = "ace/snippets/javascript";
+}).call(Mode.prototype);
+exports.Mode = Mode;
+
+});
+
+ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module){"use strict";
+var propertyMap = {
+ "background": { "#$0": 1 },
+ "background-color": { "#$0": 1, "transparent": 1, "fixed": 1 },
+ "background-image": { "url('/$0')": 1 },
+ "background-repeat": { "repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1 },
+ "background-position": { "bottom": 2, "center": 2, "left": 2, "right": 2, "top": 2, "inherit": 2 },
+ "background-attachment": { "scroll": 1, "fixed": 1 },
+ "background-size": { "cover": 1, "contain": 1 },
+ "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 },
+ "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 },
+ "border": { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 },
+ "border-color": { "#$0": 1 },
+ "border-style": { "solid": 2, "dashed": 2, "dotted": 2, "double": 2, "groove": 2, "hidden": 2, "inherit": 2, "inset": 2, "none": 2, "outset": 2, "ridged": 2 },
+ "border-collapse": { "collapse": 1, "separate": 1 },
+ "bottom": { "px": 1, "em": 1, "%": 1 },
+ "clear": { "left": 1, "right": 1, "both": 1, "none": 1 },
+ "color": { "#$0": 1, "rgb(#$00,0,0)": 1 },
+ "cursor": { "default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 },
+ "display": { "none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1 },
+ "empty-cells": { "show": 1, "hide": 1 },
+ "float": { "left": 1, "right": 1, "none": 1 },
+ "font-family": { "Arial": 2, "Comic Sans MS": 2, "Consolas": 2, "Courier New": 2, "Courier": 2, "Georgia": 2, "Monospace": 2, "Sans-Serif": 2, "Segoe UI": 2, "Tahoma": 2, "Times New Roman": 2, "Trebuchet MS": 2, "Verdana": 1 },
+ "font-size": { "px": 1, "em": 1, "%": 1 },
+ "font-weight": { "bold": 1, "normal": 1 },
+ "font-style": { "italic": 1, "normal": 1 },
+ "font-variant": { "normal": 1, "small-caps": 1 },
+ "height": { "px": 1, "em": 1, "%": 1 },
+ "left": { "px": 1, "em": 1, "%": 1 },
+ "letter-spacing": { "normal": 1 },
+ "line-height": { "normal": 1 },
+ "list-style-type": { "none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1 },
+ "margin": { "px": 1, "em": 1, "%": 1 },
+ "margin-right": { "px": 1, "em": 1, "%": 1 },
+ "margin-left": { "px": 1, "em": 1, "%": 1 },
+ "margin-top": { "px": 1, "em": 1, "%": 1 },
+ "margin-bottom": { "px": 1, "em": 1, "%": 1 },
+ "max-height": { "px": 1, "em": 1, "%": 1 },
+ "max-width": { "px": 1, "em": 1, "%": 1 },
+ "min-height": { "px": 1, "em": 1, "%": 1 },
+ "min-width": { "px": 1, "em": 1, "%": 1 },
+ "overflow": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "overflow-x": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "overflow-y": { "hidden": 1, "visible": 1, "auto": 1, "scroll": 1 },
+ "padding": { "px": 1, "em": 1, "%": 1 },
+ "padding-top": { "px": 1, "em": 1, "%": 1 },
+ "padding-right": { "px": 1, "em": 1, "%": 1 },
+ "padding-bottom": { "px": 1, "em": 1, "%": 1 },
+ "padding-left": { "px": 1, "em": 1, "%": 1 },
+ "page-break-after": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
+ "page-break-before": { "auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1 },
+ "position": { "absolute": 1, "relative": 1, "fixed": 1, "static": 1 },
+ "right": { "px": 1, "em": 1, "%": 1 },
+ "table-layout": { "fixed": 1, "auto": 1 },
+ "text-decoration": { "none": 1, "underline": 1, "line-through": 1, "blink": 1 },
+ "text-align": { "left": 1, "right": 1, "center": 1, "justify": 1 },
+ "text-transform": { "capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1 },
+ "top": { "px": 1, "em": 1, "%": 1 },
+ "vertical-align": { "top": 1, "bottom": 1 },
+ "visibility": { "hidden": 1, "visible": 1 },
+ "white-space": { "nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1 },
+ "width": { "px": 1, "em": 1, "%": 1 },
+ "word-spacing": { "normal": 1 },
+ "filter": { "alpha(opacity=$0100)": 1 },
+ "text-shadow": { "$02px 2px 2px #777": 1 },
+ "text-overflow": { "ellipsis-word": 1, "clip": 1, "ellipsis": 1 },
+ "-moz-border-radius": 1,
+ "-moz-border-radius-topright": 1,
+ "-moz-border-radius-bottomright": 1,
+ "-moz-border-radius-topleft": 1,
+ "-moz-border-radius-bottomleft": 1,
+ "-webkit-border-radius": 1,
+ "-webkit-border-top-right-radius": 1,
+ "-webkit-border-top-left-radius": 1,
+ "-webkit-border-bottom-right-radius": 1,
+ "-webkit-border-bottom-left-radius": 1,
+ "-moz-box-shadow": 1,
+ "-webkit-box-shadow": 1,
+ "transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
+ "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 },
+ "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }
+};
+var CssCompletions = function () {
+};
+(function () {
+ this.completionsDefined = false;
+ this.defineCompletions = function () {
+ if (document) {
+ var style = document.createElement('c').style;
+ for (var i in style) {
+ if (typeof style[i] !== 'string')
+ continue;
+ var name = i.replace(/[A-Z]/g, function (x) {
+ return '-' + x.toLowerCase();
+ });
+ if (!propertyMap.hasOwnProperty(name))
+ propertyMap[name] = 1;
+ }
+ }
+ this.completionsDefined = true;
+ };
+ this.getCompletions = function (state, session, pos, prefix) {
+ if (!this.completionsDefined) {
+ this.defineCompletions();
+ }
+ if (state === 'ruleset' || session.$mode.$id == "ace/mode/scss") {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ var inParens = /\([^)]*$/.test(line);
+ if (inParens) {
+ line = line.substr(line.lastIndexOf('(') + 1);
+ }
+ if (/:[^;]+$/.test(line)) {
+ /([\w\-]+):[^:]*$/.test(line);
+ return this.getPropertyValueCompletions(state, session, pos, prefix);
+ }
+ else {
+ return this.getPropertyCompletions(state, session, pos, prefix, inParens);
+ }
+ }
+ return [];
+ };
+ this.getPropertyCompletions = function (state, session, pos, prefix, skipSemicolon) {
+ skipSemicolon = skipSemicolon || false;
+ var properties = Object.keys(propertyMap);
+ return properties.map(function (property) {
+ return {
+ caption: property,
+ snippet: property + ': $0' + (skipSemicolon ? '' : ';'),
+ meta: "property",
+ score: 1000000
+ };
+ });
+ };
+ this.getPropertyValueCompletions = function (state, session, pos, prefix) {
+ var line = session.getLine(pos.row).substr(0, pos.column);
+ var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
+ if (!property)
+ return [];
+ var values = [];
+ if (property in propertyMap && typeof propertyMap[property] === "object") {
+ values = Object.keys(propertyMap[property]);
+ }
+ return values.map(function (value) {
+ return {
+ caption: value,
+ snippet: value,
+ meta: "property value",
+ score: 1000000
+ };
+ });
+ };
+}).call(CssCompletions.prototype);
+exports.CssCompletions = CssCompletions;
+
+});
+
+ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CssBehaviour = function () {
+ this.inherit(CstyleBehaviour);
+ this.add("colon", "insertion", function (state, action, editor, session, text) {
+ if (text === ':' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ':') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
+ if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
+ return {
+ text: ':;',
+ selection: [1, 1]
+ };
+ }
+ }
+ }
+ });
+ this.add("colon", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && selected === ':') {
+ var cursor = editor.getCursorPosition();
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (token && token.value.match(/\s+/)) {
+ token = iterator.stepBackward();
+ }
+ if (token && token.type === 'support.type') {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
+ if (rightChar === ';') {
+ range.end.column++;
+ return range;
+ }
+ }
+ }
+ });
+ this.add("semicolon", "insertion", function (state, action, editor, session, text) {
+ if (text === ';' && editor.selection.isEmpty()) {
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ if (rightChar === ';') {
+ return {
+ text: '',
+ selection: [1, 1]
+ };
+ }
}
});
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
+ this.add("!important", "insertion", function (state, action, editor, session, text) {
+ if (text === '!' && editor.selection.isEmpty()) {
var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
+ var line = session.doc.getLine(cursor.row);
+ if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
+ return {
+ text: '!important',
+ selection: [10, 10]
+ };
}
}
});
};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
+oop.inherits(CssBehaviour, CstyleBehaviour);
+exports.CssBehaviour = CssBehaviour;
});
-ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (defaultMode, subModes) {
- this.defaultMode = defaultMode;
- this.subModes = subModes;
+ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
+var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+var WorkerClient = require("../worker/worker_client").WorkerClient;
+var CssCompletions = require("./css_completions").CssCompletions;
+var CssBehaviour = require("./behaviour/css").CssBehaviour;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var Mode = function () {
+ this.HighlightRules = CssHighlightRules;
+ this.$outdent = new MatchingBraceOutdent();
+ this.$behaviour = new CssBehaviour();
+ this.$completer = new CssCompletions();
+ this.foldingRules = new CStyleFoldMode();
};
-oop.inherits(FoldMode, BaseFoldMode);
+oop.inherits(Mode, TextMode);
(function () {
- this.$getMode = function (state) {
- if (typeof state != "string")
- state = state[0];
- for (var key in this.subModes) {
- if (state.indexOf(key) === 0)
- return this.subModes[key];
+ this.foldingRules = "cStyle";
+ this.blockComment = { start: "/*", end: "*/" };
+ this.getNextLineIndent = function (state, line, tab) {
+ var indent = this.$getIndent(line);
+ var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+ return indent;
}
- return null;
- };
- this.$tryMode = function (state, session, foldStyle, row) {
- var mode = this.$getMode(state);
- return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
- };
- this.getFoldWidget = function (session, foldStyle, row) {
- return (this.$tryMode(session.getState(row - 1), session, foldStyle, row) ||
- this.$tryMode(session.getState(row), session, foldStyle, row) ||
- this.defaultMode.getFoldWidget(session, foldStyle, row));
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var mode = this.$getMode(session.getState(row - 1));
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.$getMode(session.getState(row));
- if (!mode || !mode.getFoldWidget(session, foldStyle, row))
- mode = this.defaultMode;
- return mode.getFoldWidgetRange(session, foldStyle, row);
- };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
+ var match = line.match(/^.*\{\s*$/);
+ if (match) {
+ indent += tab;
+ }
+ return indent;
};
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
+ this.autoOutdent = function (state, doc, row) {
+ this.$outdent.autoOutdent(doc, row);
};
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
+ this.getCompletions = function (state, session, pos, prefix) {
+ return this.$completer.getCompletions(state, session, pos, prefix);
};
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
+ this.createWorker = function (session) {
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
+ worker.attachToDocument(session.getDocument());
+ worker.on("annotate", function (e) {
+ session.setAnnotations(e.data);
+ });
+ worker.on("terminate", function () {
+ session.clearAnnotations();
+ });
+ return worker;
};
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var MixedFoldMode = require("./mixed").FoldMode;
-var XmlFoldMode = require("./xml").FoldMode;
-var CStyleFoldMode = require("./cstyle").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalTags) {
- MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
- "js-": new CStyleFoldMode(),
- "css-": new CStyleFoldMode()
- });
-};
-oop.inherits(FoldMode, MixedFoldMode);
+ this.$id = "ace/mode/css";
+ this.snippetFileId = "ace/snippets/css";
+}).call(Mode.prototype);
+exports.Mode = Mode;
});
@@ -13943,7 +14113,7 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/php_completions","ace/mode/folding/cstyle","ace/unicode","ace/mode/html","ace/mode/javascript","ace/mode/css"], function(require, exports, module){"use strict";
+ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/php_completions","ace/mode/folding/php","ace/unicode","ace/mode/folding/mixed","ace/mode/folding/html","ace/mode/folding/cstyle","ace/mode/html","ace/mode/javascript","ace/mode/css"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
@@ -13951,8 +14121,11 @@ var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRul
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
var PhpCompletions = require("./php_completions").PhpCompletions;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var PhpFoldMode = require("./folding/php").FoldMode;
var unicode = require("../unicode");
+var MixedFoldMode = require("./folding/mixed").FoldMode;
+var HtmlFoldMode = require("./folding/html").FoldMode;
+var CstyleFoldMode = require("./folding/cstyle").FoldMode;
var HtmlMode = require("./html").Mode;
var JavaScriptMode = require("./javascript").Mode;
var CssMode = require("./css").Mode;
@@ -13961,7 +14134,11 @@ var PhpMode = function (opts) {
this.$outdent = new MatchingBraceOutdent();
this.$behaviour = this.$defaultBehaviour;
this.$completer = new PhpCompletions();
- this.foldingRules = new CStyleFoldMode();
+ this.foldingRules = new MixedFoldMode(new HtmlFoldMode(), {
+ "js-": new CstyleFoldMode(),
+ "css-": new CstyleFoldMode(),
+ "php-": new PhpFoldMode()
+ });
};
oop.inherits(PhpMode, TextMode);
(function () {
@@ -14022,7 +14199,11 @@ var Mode = function (opts) {
"css-": CssMode,
"php-": PhpMode
});
- this.foldingRules.subModes["php-"] = new CStyleFoldMode();
+ this.foldingRules = new MixedFoldMode(new HtmlFoldMode(), {
+ "js-": new CstyleFoldMode(),
+ "css-": new CstyleFoldMode(),
+ "php-": new PhpFoldMode()
+ });
};
oop.inherits(Mode, HtmlMode);
(function () {
diff --git a/modules/lib/ace/mode-protobuf.js b/modules/lib/ace/mode-protobuf.js
index f7a77d5..87e4e6d 100644
--- a/modules/lib/ace/mode-protobuf.js
+++ b/modules/lib/ace/mode-protobuf.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-razor.js b/modules/lib/ace/mode-razor.js
index 736672e..d1d9f48 100644
--- a/modules/lib/ace/mode-razor.js
+++ b/modules/lib/ace/mode-razor.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
@@ -2281,7 +2341,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -2297,7 +2357,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-redshift.js b/modules/lib/ace/mode-redshift.js
index 040a523..cf213b2 100644
--- a/modules/lib/ace/mode-redshift.js
+++ b/modules/lib/ace/mode-redshift.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-rhtml.js b/modules/lib/ace/mode-rhtml.js
index f1541e4..13e5d5b 100644
--- a/modules/lib/ace/mode-rhtml.js
+++ b/modules/lib/ace/mode-rhtml.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-ruby.js b/modules/lib/ace/mode-ruby.js
index 0e983ed..55f67d7 100644
--- a/modules/lib/ace/mode-ruby.js
+++ b/modules/lib/ace/mode-ruby.js
@@ -29,7 +29,7 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
token: "constant.numeric",
regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
};
-var constantNumericOctal = exports.constantNumericDecimal = {
+var constantNumericOctal = exports.constantNumericOctal = {
token: "constant.numeric",
regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
};
diff --git a/modules/lib/ace/mode-rust.js b/modules/lib/ace/mode-rust.js
index 7aef303..4d2d75c 100644
--- a/modules/lib/ace/mode-rust.js
+++ b/modules/lib/ace/mode-rust.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -119,14 +119,14 @@ var RustHighlightRules = function () {
]
}, {
token: ['keyword.source.rust', 'text', 'entity.name.function.source.rust', 'punctuation'],
- regex: '\\b(fn)(\\s+)((?:r#)?' + wordPattern + ')(<)',
+ regex: '\\b(fn)(\\s+)((?:r#)?' + wordPattern + ')(<)(?!<)',
push: "generics"
}, {
token: ['keyword.source.rust', 'text', 'entity.name.function.source.rust'],
regex: '\\b(fn)(\\s+)((?:r#)?' + wordPattern + ')'
}, {
token: ['support.constant', "punctuation"],
- regex: "(" + wordPattern + '::)(<)',
+ regex: "(" + wordPattern + '::)(<)(?!<)',
push: "generics"
}, {
token: 'support.constant',
@@ -160,12 +160,15 @@ var RustHighlightRules = function () {
]
}, {
token: ["keyword.source.rust", "identifier", "punctuaction"],
- regex: "(?:(impl)|(" + wordPattern + "))(<)",
+ regex: "(?:(impl)|(" + wordPattern + "))(<)(?!<)",
stateName: 'generics',
push: [
{
+ token: 'keyword.operator',
+ regex: /<<|=/
+ }, {
token: "punctuaction",
- regex: "<",
+ regex: "<(?!<)",
push: "generics"
}, {
token: 'variable.other.source.rust', // `(?![\\\'])` to keep a lifetime name highlighting from continuing one character
@@ -173,9 +176,6 @@ var RustHighlightRules = function () {
}, {
token: "storage.type.source.rust",
regex: "\\b(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize|char|bool)\\b"
- }, {
- token: "punctuation.operator",
- regex: "[,:]"
}, {
token: "keyword",
regex: "\\b(?:const|dyn)\\b"
@@ -183,39 +183,46 @@ var RustHighlightRules = function () {
token: "punctuation",
regex: ">",
next: "pop"
- }, {
- token: "paren.lparen",
- regex: "[(]"
- }, {
- token: "paren.rparen",
- regex: "[)]"
- }, {
+ },
+ { include: "punctuation" },
+ { include: "operators" },
+ { include: "constants" },
+ {
token: "identifier",
regex: "\\b" + wordPattern + "\\b"
- }, {
- token: 'keyword.operator',
- regex: "="
}
]
}, {
token: keywordMapper,
regex: wordPattern
}, {
- token: 'keyword.operator', // `[*/](?![*/])=?` is separated because `//` and `/* */` become comments and must be
- regex: /\$|[-=]>|[-+%^=!&|<>]=?|[*/](?![*/])=?/
- }, {
- token: "punctuation.operator",
- regex: /[?:,;.]/
- }, {
+ token: 'meta.preprocessor.source.rust',
+ regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b'
+ },
+ { include: "punctuation" },
+ { include: "operators" },
+ { include: "constants" }
+ ],
+ punctuation: [
+ {
token: "paren.lparen",
regex: /[\[({]/
}, {
token: "paren.rparen",
regex: /[\])}]/
}, {
- token: 'meta.preprocessor.source.rust',
- regex: '\\b\\w\\(\\w\\)*!|#\\[[\\w=\\(\\)_]+\\]\\b'
- }, {
+ token: "punctuation.operator",
+ regex: /[?:,;.]/
+ }
+ ],
+ operators: [
+ {
+ token: 'keyword.operator', // `[*/](?![*/])=?` is separated because `//` and `/* */` become comments and must be
+ regex: /\$|[-=]>|[-+%^=!&|<>]=?|[*/](?![*/])=?/
+ }
+ ],
+ constants: [
+ {
token: 'constant.numeric.source.rust',
regex: /\b(?:0x[a-fA-F0-9_]+|0o[0-7_]+|0b[01_]+|[0-9][0-9_]*(?!\.))(?:[iu](?:size|8|16|32|64|128))?\b/
}, {
diff --git a/modules/lib/ace/mode-sac.js b/modules/lib/ace/mode-sac.js
index cf26bc0..4e8ddea 100644
--- a/modules/lib/ace/mode-sac.js
+++ b/modules/lib/ace/mode-sac.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-sass.js b/modules/lib/ace/mode-sass.js
index d0ba7d7..eedb149 100644
--- a/modules/lib/ace/mode-sass.js
+++ b/modules/lib/ace/mode-sass.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-scad.js b/modules/lib/ace/mode-scad.js
index 414367b..7a1eb2f 100644
--- a/modules/lib/ace/mode-scad.js
+++ b/modules/lib/ace/mode-scad.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-scala.js b/modules/lib/ace/mode-scala.js
index c7ad891..754061b 100644
--- a/modules/lib/ace/mode-scala.js
+++ b/modules/lib/ace/mode-scala.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -887,7 +1193,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -903,7 +1209,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -1068,6 +1374,7 @@ var ScalaHighlightRules = require("./scala_highlight_rules").ScalaHighlightRules
var Mode = function () {
JavaScriptMode.call(this);
this.HighlightRules = ScalaHighlightRules;
+ this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, JavaScriptMode);
(function () {
diff --git a/modules/lib/ace/mode-scrypt.js b/modules/lib/ace/mode-scrypt.js
index 4631c78..1a86c28 100644
--- a/modules/lib/ace/mode-scrypt.js
+++ b/modules/lib/ace/mode-scrypt.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-scss.js b/modules/lib/ace/mode-scss.js
index 4939f6d..c67bf4c 100644
--- a/modules/lib/ace/mode-scss.js
+++ b/modules/lib/ace/mode-scss.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-sjs.js b/modules/lib/ace/mode-sjs.js
index c70d89e..ac98ce9 100644
--- a/modules/lib/ace/mode-sjs.js
+++ b/modules/lib/ace/mode-sjs.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-slim.js b/modules/lib/ace/mode-slim.js
index 705ff08..c8b0754 100644
--- a/modules/lib/ace/mode-slim.js
+++ b/modules/lib/ace/mode-slim.js
@@ -216,7 +216,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -276,7 +276,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -300,7 +300,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -321,7 +321,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -333,7 +333,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -341,7 +341,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -350,10 +351,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -368,53 +375,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -463,17 +448,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -698,7 +693,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -756,7 +751,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -769,8 +764,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -881,6 +875,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -997,19 +1278,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1037,13 +1350,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -1192,6 +1498,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -2055,154 +2364,6 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -2242,107 +2403,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
@@ -3821,7 +3881,7 @@ var constantNumericDecimal = exports.constantNumericDecimal = {
token: "constant.numeric",
regex: /\b(0[dD](?:[1-9](?:[\d]|_(?=[\d]))*|0))\b/
};
-var constantNumericOctal = exports.constantNumericDecimal = {
+var constantNumericOctal = exports.constantNumericOctal = {
token: "constant.numeric",
regex: /\b(0[oO]?(?:[1-7](?:[0-7]|_(?=[0-7]))*|0))\b/
};
diff --git a/modules/lib/ace/mode-smarty.js b/modules/lib/ace/mode-smarty.js
index 92cf1a2..a1827fe 100644
--- a/modules/lib/ace/mode-smarty.js
+++ b/modules/lib/ace/mode-smarty.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-soy_template.js b/modules/lib/ace/mode-soy_template.js
index befa1d8..2f43b29 100644
--- a/modules/lib/ace/mode-soy_template.js
+++ b/modules/lib/ace/mode-soy_template.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-sqlserver.js b/modules/lib/ace/mode-sqlserver.js
index 7e61d3d..799d0d8 100644
--- a/modules/lib/ace/mode-sqlserver.js
+++ b/modules/lib/ace/mode-sqlserver.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
diff --git a/modules/lib/ace/mode-stylus.js b/modules/lib/ace/mode-stylus.js
index 4056107..9b39800 100644
--- a/modules/lib/ace/mode-stylus.js
+++ b/modules/lib/ace/mode-stylus.js
@@ -119,6 +119,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
diff --git a/modules/lib/ace/mode-svg.js b/modules/lib/ace/mode-svg.js
index f4dfec0..accbc7f 100644
--- a/modules/lib/ace/mode-svg.js
+++ b/modules/lib/ace/mode-svg.js
@@ -178,11 +178,10 @@ exports.XmlHighlightRules = XmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -271,7 +270,7 @@ var XmlBehaviour = function () {
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return {
text: ">" + "" + element + ">",
@@ -285,7 +284,7 @@ var XmlBehaviour = function () {
var line = session.getLine(cursor.row);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
if (token.value == "/>")
return;
while (token && token.type.indexOf("tag-name") === -1) {
@@ -300,7 +299,7 @@ var XmlBehaviour = function () {
if (!token || token.type.indexOf("end-tag") !== -1) {
return;
}
- if (this.voidElements && !this.voidElements[tag]) {
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
var line = session.getLine(row);
var nextIndent = this.$getIndent(line);
@@ -346,7 +345,7 @@ var Tag = function () {
this.end = { row: 0, column: 0 };
};
function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
}
(function () {
this.getFoldWidget = function (session, foldStyle, row) {
@@ -378,6 +377,12 @@ function is(token, type) {
if (!token)
return null;
tag.tagName = token.value;
+ if (token.value === "") { //skip empty tag name token for fragment
+ token = tokens[++i];
+ if (!token)
+ return null;
+ tag.tagName = token.value;
+ }
tag.end.column += token.value.length;
for (i++; i < tokens.length; i++) {
token = tokens[i];
@@ -403,10 +408,13 @@ function is(token, type) {
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
column += token.value.length;
- if (column < startColumn)
+ if (column < startColumn - 1)
continue;
if (is(token, "end-tag-open")) {
token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
if (token && token.value == tagName)
return true;
}
@@ -414,14 +422,14 @@ function is(token, type) {
return false;
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
var tags = session.getMatchingTags({ row: row, column: 0 });
if (tags) {
return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
}
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
};
}).call(FoldMode.prototype);
@@ -485,7 +493,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -545,7 +553,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -569,7 +577,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -590,7 +598,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -602,7 +610,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -610,7 +618,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -619,10 +628,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -637,53 +652,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -732,17 +725,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -967,7 +970,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -1025,7 +1028,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -1038,8 +1041,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1150,6 +1152,36 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -1266,19 +1298,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1306,13 +1370,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-swift.js b/modules/lib/ace/mode-swift.js
index 758524b..5041693 100644
--- a/modules/lib/ace/mode-swift.js
+++ b/modules/lib/ace/mode-swift.js
@@ -8,7 +8,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -24,7 +24,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -191,6 +191,7 @@ var SwiftHighlightRules = function () {
};
oop.inherits(SwiftHighlightRules, TextHighlightRules);
exports.HighlightRules = SwiftHighlightRules;
+exports.SwiftHighlightRules = SwiftHighlightRules;
});
diff --git a/modules/lib/ace/mode-tsv.js b/modules/lib/ace/mode-tsv.js
new file mode 100644
index 0000000..a110a3a
--- /dev/null
+++ b/modules/lib/ace/mode-tsv.js
@@ -0,0 +1,124 @@
+ace.define("ace/mode/csv_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var CsvHighlightRules = function () {
+ TextHighlightRules.call(this);
+};
+oop.inherits(CsvHighlightRules, TextHighlightRules);
+exports.CsvHighlightRules = CsvHighlightRules;
+
+});
+
+ace.define("ace/mode/csv",["require","exports","module","ace/lib/oop","ace/mode/text","ace/lib/lang","ace/mode/csv_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var escapeRegExp = require("../lib/lang").escapeRegExp;
+var CsvHighlightRules = require("./csv_highlight_rules").CsvHighlightRules;
+var Mode = function (options) {
+ this.HighlightRules = CsvHighlightRules;
+ if (!options)
+ options = {};
+ var separatorRegex = [options.splitter || ",", options.quote || '"']
+ .map(escapeRegExp).join("|");
+ this.$tokenizer = {
+ getLineTokens: function (line, state, row) {
+ return tokenizeCsv(line, state, this.options);
+ },
+ options: {
+ quotes: options.quote || '"',
+ separatorRegex: new RegExp("(" + separatorRegex + ")"),
+ spliter: options.splitter || ","
+ },
+ states: {},
+ };
+ this.$highlightRules = new this.HighlightRules();
+};
+oop.inherits(Mode, TextMode);
+(function () {
+ this.getTokenizer = function () {
+ return this.$tokenizer;
+ };
+ this.$id = "ace/mode/csv";
+}).call(Mode.prototype);
+exports.Mode = Mode;
+var classNames = ["keyword", "text", "string", "string.regex", "variable", "constant.numeric"];
+function tokenizeCsv(line, state, options) {
+ var result = [];
+ var parts = line.split(options.separatorRegex);
+ var spliter = options.spliter;
+ var quote = options.quote || '"';
+ var stateParts = (state || "start").split("-");
+ var column = parseInt(stateParts[1]) || 0;
+ var inString = stateParts[0] == 'string';
+ var atColumnStart = !inString;
+ for (var i = 0; i < parts.length; i++) {
+ var value = parts[i];
+ if (value) {
+ var isSeparator = false;
+ if (value == spliter && !inString) {
+ column++;
+ atColumnStart = true;
+ isSeparator = true;
+ }
+ else if (value == quote) {
+ if (atColumnStart) {
+ inString = true;
+ atColumnStart = false;
+ }
+ else if (inString) {
+ if (parts[i + 1] == '' && parts[i + 2] == quote) {
+ value = quote + quote;
+ i += 2;
+ }
+ else {
+ inString = false;
+ }
+ }
+ }
+ else {
+ atColumnStart = false;
+ }
+ result.push({
+ value: value,
+ type: classNames[column % classNames.length] + ".csv_" + column + (isSeparator ? ".csv_separator" : "")
+ });
+ }
+ }
+ return { tokens: result, state: inString ? "string-" + column : "start" };
+}
+
+});
+
+ace.define("ace/mode/tsv_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var TsvHighlightRules = function () {
+ TextHighlightRules.call(this);
+};
+oop.inherits(TsvHighlightRules, TextHighlightRules);
+exports.TsvHighlightRules = TsvHighlightRules;
+
+});
+
+ace.define("ace/mode/tsv",["require","exports","module","ace/mode/csv","ace/mode/tsv_highlight_rules"], function(require, exports, module){"use strict";
+var CSVMode = require("./csv").Mode;
+var TsvHighlightRules = require("./tsv_highlight_rules").TsvHighlightRules;
+var Mode = function (options) {
+ var mode = new CSVMode({
+ splitter: "\t",
+ quote: '"'
+ });
+ mode.HighlightRules = TsvHighlightRules;
+ mode.$id = "ace/mode/tsv";
+ return mode;
+};
+exports.Mode = Mode;
+
+}); (function() {
+ ace.require(["ace/mode/tsv"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/mode-tsx.js b/modules/lib/ace/mode-tsx.js
index 8dfac6a..4165026 100644
--- a/modules/lib/ace/mode-tsx.js
+++ b/modules/lib/ace/mode-tsx.js
@@ -1,3 +1,438 @@
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+(function () {
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+ this._getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var line = session.getLine(row);
+ if (this.singleLineBlockCommentRe.test(line)) {
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+ return "";
+ }
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
+ if (!fw && this.startRegionRe.test(line))
+ return "start"; // lineCommentRegionStart
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var line = session.getLine(row);
+ if (this.startRegionRe.test(line))
+ return this.getCommentRegionBlock(session, line, row);
+ var match = line.match(this.foldingStartMarker);
+ if (match) {
+ var i = match.index;
+ if (match[1])
+ return this.openingBracketBlock(session, match[1], row, i);
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+ if (range && !range.isMultiLine()) {
+ if (forceMultiline) {
+ range = this.getSectionRange(session, row);
+ }
+ else if (foldStyle != "all")
+ range = null;
+ }
+ return range;
+ }
+ if (foldStyle === "markbegin")
+ return;
+ var match = line.match(this.foldingStopMarker);
+ if (match) {
+ var i = match.index + match[0].length;
+ if (match[1])
+ return this.closingBracketBlock(session, match[1], row, i);
+ return session.getCommentFoldRange(row, i, -1);
+ }
+ };
+ this.getSectionRange = function (session, row) {
+ var line = session.getLine(row);
+ var startIndent = line.search(/\S/);
+ var startRow = row;
+ var startColumn = line.length;
+ row = row + 1;
+ var endRow = row;
+ var maxRow = session.getLength();
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var indent = line.search(/\S/);
+ if (indent === -1)
+ continue;
+ if (startIndent > indent)
+ break;
+ var subRange = this.getFoldWidgetRange(session, "all", row);
+ if (subRange) {
+ if (subRange.start.row <= startRow) {
+ break;
+ }
+ else if (subRange.isMultiLine()) {
+ row = subRange.end.row;
+ }
+ else if (startIndent == indent) {
+ break;
+ }
+ }
+ endRow = row;
+ }
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+ };
+ this.getCommentRegionBlock = function (session, line, row) {
+ var startColumn = line.search(/\s*$/);
+ var maxRow = session.getLength();
+ var startRow = row;
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+ var depth = 1;
+ while (++row < maxRow) {
+ line = session.getLine(row);
+ var m = re.exec(line);
+ if (!m)
+ continue;
+ if (m[1])
+ depth--;
+ else
+ depth++;
+ if (!depth)
+ break;
+ }
+ var endRow = row;
+ if (endRow > startRow) {
+ return new Range(startRow, startColumn, endRow, line.length);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/jsdoc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
@@ -22,7 +457,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +517,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +541,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +562,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +574,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +582,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +592,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +616,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +689,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +934,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +992,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +1005,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,135 +1116,19 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
- if (commentRegex) {
- this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
- this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
- }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
- this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
- this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
- this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
- this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
- this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
- this._getFoldWidgetBase = this.getFoldWidget;
- this.getFoldWidget = function (session, foldStyle, row) {
- var line = session.getLine(row);
- if (this.singleLineBlockCommentRe.test(line)) {
- if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
- return "";
- }
- var fw = this._getFoldWidgetBase(session, foldStyle, row);
- if (!fw && this.startRegionRe.test(line))
- return "start"; // lineCommentRegionStart
- return fw;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
- var line = session.getLine(row);
- if (this.startRegionRe.test(line))
- return this.getCommentRegionBlock(session, line, row);
- var match = line.match(this.foldingStartMarker);
- if (match) {
- var i = match.index;
- if (match[1])
- return this.openingBracketBlock(session, match[1], row, i);
- var range = session.getCommentFoldRange(row, i + match[0].length, 1);
- if (range && !range.isMultiLine()) {
- if (forceMultiline) {
- range = this.getSectionRange(session, row);
- }
- else if (foldStyle != "all")
- range = null;
- }
- return range;
- }
- if (foldStyle === "markbegin")
- return;
- var match = line.match(this.foldingStopMarker);
- if (match) {
- var i = match.index + match[0].length;
- if (match[1])
- return this.closingBracketBlock(session, match[1], row, i);
- return session.getCommentFoldRange(row, i, -1);
- }
- };
- this.getSectionRange = function (session, row) {
- var line = session.getLine(row);
- var startIndent = line.search(/\S/);
- var startRow = row;
- var startColumn = line.length;
- row = row + 1;
- var endRow = row;
- var maxRow = session.getLength();
- while (++row < maxRow) {
- line = session.getLine(row);
- var indent = line.search(/\S/);
- if (indent === -1)
- continue;
- if (startIndent > indent)
- break;
- var subRange = this.getFoldWidgetRange(session, "all", row);
- if (subRange) {
- if (subRange.start.row <= startRow) {
- break;
- }
- else if (subRange.isMultiLine()) {
- row = subRange.end.row;
- }
- else if (startIndent == indent) {
- break;
- }
- }
- endRow = row;
- }
- return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
- };
- this.getCommentRegionBlock = function (session, line, row) {
- var startColumn = line.search(/\s*$/);
- var maxRow = session.getLength();
- var startRow = row;
- var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
- var depth = 1;
- while (++row < maxRow) {
- line = session.getLine(row);
- var m = re.exec(line);
- if (!m)
- continue;
- if (m[1])
- depth--;
- else
- depth++;
- if (!depth)
- break;
- }
- var endRow = row;
- if (endRow > startRow) {
- return new Range(startRow, startColumn, endRow, line.length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -940,15 +1246,19 @@ exports.Mode = Mode;
});
-ace.define("ace/mode/tsx",["require","exports","module","ace/lib/oop","ace/mode/typescript"], function(require, exports, module){/*
+ace.define("ace/mode/tsx",["require","exports","module","ace/lib/oop","ace/mode/behaviour/javascript","ace/mode/folding/javascript","ace/mode/typescript"], function(require, exports, module){/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
"use strict";
var oop = require("../lib/oop");
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var tsMode = require("./typescript").Mode;
var Mode = function () {
tsMode.call(this);
this.$highlightRuleConfig = { jsx: true };
+ this.foldingRules = new JavaScriptFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
};
oop.inherits(Mode, tsMode);
(function () {
diff --git a/modules/lib/ace/mode-twig.js b/modules/lib/ace/mode-twig.js
index 3dd2d68..c52df55 100644
--- a/modules/lib/ace/mode-twig.js
+++ b/modules/lib/ace/mode-twig.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-typescript.js b/modules/lib/ace/mode-typescript.js
index e544c83..bc55c9f 100644
--- a/modules/lib/ace/mode-typescript.js
+++ b/modules/lib/ace/mode-typescript.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
diff --git a/modules/lib/ace/mode-velocity.js b/modules/lib/ace/mode-velocity.js
index a2a873a..a2e3e0d 100644
--- a/modules/lib/ace/mode-velocity.js
+++ b/modules/lib/ace/mode-velocity.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-visualforce.js b/modules/lib/ace/mode-visualforce.js
index 47ea493..d08d3c6 100644
--- a/modules/lib/ace/mode-visualforce.js
+++ b/modules/lib/ace/mode-visualforce.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -998,6 +1304,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -1609,154 +1918,6 @@ exports.HtmlHighlightRules = HtmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require("../behaviour").Behaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
-function is(token, type) {
- return token && token.type.lastIndexOf(type + ".xml") > -1;
-}
-var XmlBehaviour = function () {
- this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
- if (text == '"' || text == "'") {
- var quote = text;
- var selected = session.doc.getTextRange(editor.getSelectionRange());
- if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
- return {
- text: quote + selected + quote,
- selection: false
- };
- }
- var cursor = editor.getCursorPosition();
- var line = session.doc.getLine(cursor.row);
- var rightChar = line.substring(cursor.column, cursor.column + 1);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
- return {
- text: "",
- selection: [1, 1]
- };
- }
- if (!token)
- token = iterator.stepBackward();
- if (!token)
- return;
- while (is(token, "tag-whitespace") || is(token, "whitespace")) {
- token = iterator.stepBackward();
- }
- var rightSpace = !rightChar || rightChar.match(/\s/);
- if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
- return {
- text: quote + quote,
- selection: [1, 1]
- };
- }
- }
- });
- this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
- var selected = session.doc.getTextRange(range);
- if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
- var line = session.doc.getLine(range.start.row);
- var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
- if (rightChar == selected) {
- range.end.column++;
- return range;
- }
- }
- });
- this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
- if (text == '>') {
- var position = editor.getSelectionRange().start;
- var iterator = new TokenIterator(session, position.row, position.column);
- var token = iterator.getCurrentToken() || iterator.stepBackward();
- if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
- return;
- if (is(token, "reference.attribute-value"))
- return;
- if (is(token, "attribute-value")) {
- var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
- if (position.column < tokenEndColumn)
- return;
- if (position.column == tokenEndColumn) {
- var nextToken = iterator.stepForward();
- if (nextToken && is(nextToken, "attribute-value"))
- return;
- iterator.stepBackward();
- }
- }
- if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
- return;
- while (!is(token, "tag-name")) {
- token = iterator.stepBackward();
- if (token.value == "<") {
- token = iterator.stepForward();
- break;
- }
- }
- var tokenRow = iterator.getCurrentTokenRow();
- var tokenColumn = iterator.getCurrentTokenColumn();
- if (is(iterator.stepBackward(), "end-tag-open"))
- return;
- var element = token.value;
- if (tokenRow == position.row)
- element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
- return;
- return {
- text: ">" + "" + element + ">",
- selection: [1, 1]
- };
- }
- });
- this.add("autoindent", "insertion", function (state, action, editor, session, text) {
- if (text == "\n") {
- var cursor = editor.getCursorPosition();
- var line = session.getLine(cursor.row);
- var iterator = new TokenIterator(session, cursor.row, cursor.column);
- var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
- if (token.value == "/>")
- return;
- while (token && token.type.indexOf("tag-name") === -1) {
- token = iterator.stepBackward();
- }
- if (!token) {
- return;
- }
- var tag = token.value;
- var row = iterator.getCurrentTokenRow();
- token = iterator.stepBackward();
- if (!token || token.type.indexOf("end-tag") !== -1) {
- return;
- }
- if (this.voidElements && !this.voidElements[tag]) {
- var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
- var line = session.getLine(row);
- var nextIndent = this.$getIndent(line);
- var indent = nextIndent + session.getTabString();
- if (nextToken && nextToken.value === "") {
- return {
- text: "\n" + indent + "\n" + nextIndent,
- selection: [1, indent.length, 1, indent.length]
- };
- }
- else {
- return {
- text: "\n" + indent
- };
- }
- }
- }
- }
- });
-};
-oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
-
-});
-
ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
@@ -1796,107 +1957,6 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
- BaseFoldMode.call(this);
- this.voidElements = voidElements || {};
- this.optionalEndTags = oop.mixin({}, this.voidElements);
- if (optionalEndTags)
- oop.mixin(this.optionalEndTags, optionalEndTags);
-};
-oop.inherits(FoldMode, BaseFoldMode);
-var Tag = function () {
- this.tagName = "";
- this.closing = false;
- this.selfClosing = false;
- this.start = { row: 0, column: 0 };
- this.end = { row: 0, column: 0 };
-};
-function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
-}
-(function () {
- this.getFoldWidget = function (session, foldStyle, row) {
- var tag = this._getFirstTagInLine(session, row);
- if (!tag)
- return this.getCommentFoldWidget(session, row);
- if (tag.closing || (!tag.tagName && tag.selfClosing))
- return foldStyle === "markbeginend" ? "end" : "";
- if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
- return "";
- if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
- return "";
- return "start";
- };
- this.getCommentFoldWidget = function (session, row) {
- if (/comment/.test(session.getState(row)) && /';
- break;
- }
- }
- return tag;
- }
- else if (is(token, "tag-close")) {
- tag.selfClosing = token.value == '/>';
- return tag;
- }
- tag.start.column += token.value.length;
- }
- return null;
- };
- this._findEndTagInLine = function (session, row, tagName, startColumn) {
- var tokens = session.getTokens(row);
- var column = 0;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- column += token.value.length;
- if (column < startColumn)
- continue;
- if (is(token, "end-tag-open")) {
- token = tokens[i + 1];
- if (token && token.value == tagName)
- return true;
- }
- }
- return false;
- };
- this.getFoldWidgetRange = function (session, foldStyle, row) {
- var tags = session.getMatchingTags({ row: row, column: 0 });
- if (tags) {
- return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
- }
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
- };
-}).call(FoldMode.prototype);
-
-});
-
ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var MixedFoldMode = require("./mixed").FoldMode;
diff --git a/modules/lib/ace/mode-vue.js b/modules/lib/ace/mode-vue.js
index acbc62e..8f987de 100644
--- a/modules/lib/ace/mode-vue.js
+++ b/modules/lib/ace/mode-vue.js
@@ -57,7 +57,7 @@ var Tag = function () {
this.end = { row: 0, column: 0 };
};
function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
}
(function () {
this.getFoldWidget = function (session, foldStyle, row) {
@@ -89,6 +89,12 @@ function is(token, type) {
if (!token)
return null;
tag.tagName = token.value;
+ if (token.value === "") { //skip empty tag name token for fragment
+ token = tokens[++i];
+ if (!token)
+ return null;
+ tag.tagName = token.value;
+ }
tag.end.column += token.value.length;
for (i++; i < tokens.length; i++) {
token = tokens[i];
@@ -114,10 +120,13 @@ function is(token, type) {
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
column += token.value.length;
- if (column < startColumn)
+ if (column < startColumn - 1)
continue;
if (is(token, "end-tag-open")) {
token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
if (token && token.value == tagName)
return true;
}
@@ -125,14 +134,14 @@ function is(token, type) {
return false;
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
var tags = session.getMatchingTags({ row: row, column: 0 });
if (tags) {
return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
}
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
};
}).call(FoldMode.prototype);
@@ -269,11 +278,10 @@ oop.inherits(FoldMode, MixedFoldMode);
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -362,7 +370,7 @@ var XmlBehaviour = function () {
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return {
text: ">" + "" + element + ">",
@@ -376,7 +384,7 @@ var XmlBehaviour = function () {
var line = session.getLine(cursor.row);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
if (token.value == "/>")
return;
while (token && token.type.indexOf("tag-name") === -1) {
@@ -391,7 +399,7 @@ var XmlBehaviour = function () {
if (!token || token.type.indexOf("end-tag") !== -1) {
return;
}
- if (this.voidElements && !this.voidElements[tag]) {
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
var line = session.getLine(row);
var nextIndent = this.$getIndent(line);
@@ -741,7 +749,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -801,7 +809,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -825,7 +833,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -846,7 +854,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -858,7 +866,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -866,7 +874,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -875,10 +884,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -893,53 +908,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -988,17 +981,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
+ ],
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -1223,7 +1226,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -1281,7 +1284,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -1294,8 +1297,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -1406,19 +1408,81 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -1446,13 +1510,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -1601,6 +1658,9 @@ var CssHighlightRules = function () {
}, {
token: keywordMapper,
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
+ }, {
+ token: "paren.lparen",
+ regex: "\\{"
}, {
caseInsensitive: true
}],
@@ -3622,7 +3682,7 @@ var VueHighlightRules = function (options) {
var self = this;
VueRules.tag_stuff.unshift({
token: "string",
- regex: /(?:\b(v-)|(:|@))([a-zA-Z\-.]+)(?:\:([a-zA-Z\-]+))?(?:\.([a-zA-Z\-]+))*(\s*)(=)(\s*)(["'])/,
+ regex: /(?:\b(v-)|(:|@))(\[?[a-zA-Z\-.]+\]?)(?:(\:\[?[a-zA-Z\-]+\]?))?((?:\.[a-zA-Z\-]+)*)(\s*)(=)(\s*)(["'])/,
onMatch: function (value, currentState, stack) {
var quote = value[value.length - 1];
stack.unshift(quote, currentState);
diff --git a/modules/lib/ace/mode-wollok.js b/modules/lib/ace/mode-wollok.js
index 80dc270..dfd1380 100644
--- a/modules/lib/ace/mode-wollok.js
+++ b/modules/lib/ace/mode-wollok.js
@@ -22,7 +22,7 @@ var JsDocCommentHighlightRules = function () {
]
}, {
token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
- regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.\-\'\" ]+)(\])))/,
next: "pop"
}, {
token: "rparen.doc",
@@ -82,7 +82,7 @@ var JsDocCommentHighlightRules = function () {
},
JsDocCommentHighlightRules.getTagRule(),
{
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
],
@@ -106,7 +106,7 @@ JsDocCommentHighlightRules.getTagRule = function (start) {
JsDocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -127,7 +127,7 @@ var DocCommentHighlightRules = require("./jsdoc_comment_highlight_rules").JsDocC
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
var JavaScriptHighlightRules = function (options) {
- var keywordMapper = this.createKeywordMapper({
+ var keywords = {
"variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|" + // Constructors
"Namespace|QName|XML|XMLList|" + // E4X
"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
@@ -139,7 +139,7 @@ var JavaScriptHighlightRules = function (options) {
"JSON|Math|" + // Other
"this|arguments|prototype|window|document", // Pseudo
"keyword": "const|yield|import|get|set|async|await|" +
- "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
+ "break|case|catch|continue|default|delete|do|else|finally|for|" +
"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
"__parent__|__count__|escape|unescape|with|__proto__|" +
"class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
@@ -147,7 +147,8 @@ var JavaScriptHighlightRules = function (options) {
"constant.language": "null|Infinity|NaN|undefined",
"support.function": "alert",
"constant.language.boolean": "true|false"
- }, "identifier");
+ };
+ var keywordMapper = this.createKeywordMapper(keywords, "identifier");
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
"u[0-9a-fA-F]{4}|" + // unicode
@@ -156,10 +157,16 @@ var JavaScriptHighlightRules = function (options) {
"3[0-7][0-7]?|" + // oct
"[4-7][0-7]?|" + //oct
".)";
+ var anonymousFunctionRe = "(function)(\\s*)(\\*?)";
+ var functionCallStartRule = {
+ token: ["identifier", "text", "paren.lparen"],
+ regex: "(\\b(?!" + Object.values(keywords).join("|") + "\\b)" + identifierRe + ")(\\s*)(\\()"
+ };
this.$rules = {
"no_regex": [
DocCommentHighlightRules.getStartRule("doc-start"),
comments("no_regex"),
+ functionCallStartRule,
{
token: "string",
regex: "'(?=.)",
@@ -174,53 +181,31 @@ var JavaScriptHighlightRules = function (options) {
}, {
token: "constant.numeric", // decimal integers and floats
regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
- }, {
- token: [
- "storage.type", "punctuation.operator", "support.function",
- "punctuation.operator", "entity.name.function", "text", "keyword.operator"
- ],
- regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text", "storage.type", "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "keyword.operator", "text", "storage.type",
- "text", "paren.lparen"
- ],
- regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
- next: "function_arguments"
- }, {
- token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(" + identifierRe + ")(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
"entity.name.function", "text", "punctuation.operator",
- "text", "storage.type", "text", "paren.lparen"
+ "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: [
- "text", "text", "storage.type", "text", "paren.lparen"
+ "text", "text", "storage.type", "text", "storage.type", "text", "paren.lparen"
],
- regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
+ regex: "(:)(\\s*)" + anonymousFunctionRe + "(\\s*)(\\()",
next: "function_arguments"
}, {
token: "keyword",
@@ -269,17 +254,27 @@ var JavaScriptHighlightRules = function (options) {
property: [{
token: "text",
regex: "\\s+"
+ }, {
+ token: "keyword.operator",
+ regex: /=/
+ }, {
+ token: [
+ "storage.type", "text", "storage.type", "text", "paren.lparen"
+ ],
+ regex: anonymousFunctionRe + "(\\s*)(\\()",
+ next: "function_arguments"
}, {
token: [
- "storage.type", "punctuation.operator", "entity.name.function", "text",
- "keyword.operator", "text",
- "storage.type", "text", "entity.name.function", "text", "paren.lparen"
+ "storage.type", "text", "storage.type", "text", "text", "entity.name.function", "text", "paren.lparen"
],
- regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+ regex: "(function)(?:(?:(\\s*)(\\*)(\\s*))|(\\s+))(\\w+)(\\s*)(\\()",
next: "function_arguments"
}, {
token: "punctuation.operator",
regex: /[.](?![.])/
+ }, {
+ token: "support.function",
+ regex: "prototype"
}, {
token: "support.function",
regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
@@ -504,7 +499,7 @@ var JavaScriptHighlightRules = function (options) {
regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
}, {
token: "paren.lparen",
- regex: "(\\()(?=.+\\s*=>)",
+ regex: "(\\()(?=[^\\(]+\\s*=>)",
next: "function_arguments"
}, {
token: "variable.language",
@@ -562,7 +557,7 @@ function JSX() {
value: val.substr(offset)
}];
},
- regex: "?" + tagRegex + "",
+ regex: "?(?:" + tagRegex + "|(?=>))",
next: "jsxAttributes",
nextState: "jsx"
};
@@ -575,8 +570,7 @@ function JSX() {
this.$rules.jsx = [
jsxJsRule,
jsxTag,
- { include: "reference" },
- { defaultToken: "string" }
+ { include: "reference" }, { defaultToken: "string.xml" }
];
this.$rules.jsxAttributes = [{
token: "meta.tag.punctuation.tag-close.xml",
@@ -687,6 +681,293 @@ exports.MatchingBraceOutdent = MatchingBraceOutdent;
});
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Behaviour = require("../behaviour").Behaviour;
+var TokenIterator = require("../../token_iterator").TokenIterator;
+function is(token, type) {
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
+}
+var XmlBehaviour = function () {
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
+ if (text == '"' || text == "'") {
+ var quote = text;
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
+ return {
+ text: quote + selected + quote,
+ selection: false
+ };
+ }
+ var cursor = editor.getCursorPosition();
+ var line = session.doc.getLine(cursor.row);
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
+ return {
+ text: "",
+ selection: [1, 1]
+ };
+ }
+ if (!token)
+ token = iterator.stepBackward();
+ if (!token)
+ return;
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
+ token = iterator.stepBackward();
+ }
+ var rightSpace = !rightChar || rightChar.match(/\s/);
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
+ return {
+ text: quote + quote,
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+ var selected = session.doc.getTextRange(range);
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
+ var line = session.doc.getLine(range.start.row);
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
+ if (rightChar == selected) {
+ range.end.column++;
+ return range;
+ }
+ }
+ });
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
+ return;
+ if (is(token, "reference.attribute-value"))
+ return;
+ if (is(token, "attribute-value")) {
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
+ if (position.column < tokenEndColumn)
+ return;
+ if (position.column == tokenEndColumn) {
+ var nextToken = iterator.stepForward();
+ if (nextToken && is(nextToken, "attribute-value"))
+ return;
+ iterator.stepBackward();
+ }
+ }
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
+ return;
+ while (!is(token, "tag-name")) {
+ token = iterator.stepBackward();
+ if (token.value == "<") {
+ token = iterator.stepForward();
+ break;
+ }
+ }
+ var tokenRow = iterator.getCurrentTokenRow();
+ var tokenColumn = iterator.getCurrentTokenColumn();
+ if (is(iterator.stepBackward(), "end-tag-open"))
+ return;
+ var element = token.value;
+ if (tokenRow == position.row)
+ element = element.substring(0, position.column - tokenColumn);
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
+ return;
+ return {
+ text: ">" + "" + element + ">",
+ selection: [1, 1]
+ };
+ }
+ });
+ this.add("autoindent", "insertion", function (state, action, editor, session, text) {
+ if (text == "\n") {
+ var cursor = editor.getCursorPosition();
+ var line = session.getLine(cursor.row);
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
+ var token = iterator.getCurrentToken();
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
+ if (token.value == "/>")
+ return;
+ while (token && token.type.indexOf("tag-name") === -1) {
+ token = iterator.stepBackward();
+ }
+ if (!token) {
+ return;
+ }
+ var tag = token.value;
+ var row = iterator.getCurrentTokenRow();
+ token = iterator.stepBackward();
+ if (!token || token.type.indexOf("end-tag") !== -1) {
+ return;
+ }
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+ var line = session.getLine(row);
+ var nextIndent = this.$getIndent(line);
+ var indent = nextIndent + session.getTabString();
+ if (nextToken && nextToken.value === "") {
+ return {
+ text: "\n" + indent + "\n" + nextIndent,
+ selection: [1, indent.length, 1, indent.length]
+ };
+ }
+ else {
+ return {
+ text: "\n" + indent
+ };
+ }
+ }
+ }
+ }
+ });
+};
+oop.inherits(XmlBehaviour, Behaviour);
+exports.XmlBehaviour = XmlBehaviour;
+
+});
+
+ace.define("ace/mode/behaviour/javascript",["require","exports","module","ace/lib/oop","ace/token_iterator","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var TokenIterator = require("../../token_iterator").TokenIterator;
+var CstyleBehaviour = require("../behaviour/cstyle").CstyleBehaviour;
+var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+var JavaScriptBehaviour = function () {
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
+ this.addBehaviours(xmlBehaviours);
+ this.inherit(CstyleBehaviour);
+ this.add("autoclosing-fragment", "insertion", function (state, action, editor, session, text) {
+ if (text == '>') {
+ var position = editor.getSelectionRange().start;
+ var iterator = new TokenIterator(session, position.row, position.column);
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
+ if (!token)
+ return;
+ if (token.value == '<') {
+ return {
+ text: ">>",
+ selection: [1, 1]
+ };
+ }
+ }
+ });
+};
+oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
+exports.JavaScriptBehaviour = JavaScriptBehaviour;
+
+});
+
+ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+var FoldMode = exports.FoldMode = function (voidElements, optionalEndTags) {
+ BaseFoldMode.call(this);
+ this.voidElements = voidElements || {};
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
+ if (optionalEndTags)
+ oop.mixin(this.optionalEndTags, optionalEndTags);
+};
+oop.inherits(FoldMode, BaseFoldMode);
+var Tag = function () {
+ this.tagName = "";
+ this.closing = false;
+ this.selfClosing = false;
+ this.start = { row: 0, column: 0 };
+ this.end = { row: 0, column: 0 };
+};
+function is(token, type) {
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
+}
+(function () {
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var tag = this._getFirstTagInLine(session, row);
+ if (!tag)
+ return this.getCommentFoldWidget(session, row);
+ if (tag.closing || (!tag.tagName && tag.selfClosing))
+ return foldStyle === "markbeginend" ? "end" : "";
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
+ return "";
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
+ return "";
+ return "start";
+ };
+ this.getCommentFoldWidget = function (session, row) {
+ if (/comment/.test(session.getState(row)) && /';
+ break;
+ }
+ }
+ return tag;
+ }
+ else if (is(token, "tag-close")) {
+ tag.selfClosing = token.value == '/>';
+ return tag;
+ }
+ tag.start.column += token.value.length;
+ }
+ return null;
+ };
+ this._findEndTagInLine = function (session, row, tagName, startColumn) {
+ var tokens = session.getTokens(row);
+ var column = 0;
+ for (var i = 0; i < tokens.length; i++) {
+ var token = tokens[i];
+ column += token.value.length;
+ if (column < startColumn - 1)
+ continue;
+ if (is(token, "end-tag-open")) {
+ token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
+ if (token && token.value == tagName)
+ return true;
+ }
+ }
+ return false;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
+ var tags = session.getMatchingTags({ row: row, column: 0 });
+ if (tags) {
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
+ }
+ };
+}).call(FoldMode.prototype);
+
+});
+
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
@@ -803,19 +1084,51 @@ oop.inherits(FoldMode, BaseFoldMode);
});
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/javascript",["require","exports","module","ace/lib/oop","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+var oop = require("../../lib/oop");
+var XmlFoldMode = require("./xml").FoldMode;
+var CFoldMode = require("./cstyle").FoldMode;
+var FoldMode = exports.FoldMode = function (commentRegex) {
+ if (commentRegex) {
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+ }
+ this.xmlFoldMode = new XmlFoldMode();
+};
+oop.inherits(FoldMode, CFoldMode);
+(function () {
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
+ this.getFoldWidgetBase = this.getFoldWidget;
+ this.getFoldWidget = function (session, foldStyle, row) {
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
+ if (!fw) {
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
+ }
+ return fw;
+ };
+ this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
+ if (range)
+ return range;
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
+ };
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/javascript","ace/mode/folding/javascript"], function(require, exports, module){"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var WorkerClient = require("../worker/worker_client").WorkerClient;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var JavaScriptBehaviour = require("./behaviour/javascript").JavaScriptBehaviour;
+var JavaScriptFoldMode = require("./folding/javascript").FoldMode;
var Mode = function () {
this.HighlightRules = JavaScriptHighlightRules;
this.$outdent = new MatchingBraceOutdent();
- this.$behaviour = new CstyleBehaviour();
- this.foldingRules = new CStyleFoldMode();
+ this.$behaviour = new JavaScriptBehaviour();
+ this.foldingRules = new JavaScriptFoldMode();
};
oop.inherits(Mode, TextMode);
(function () {
@@ -843,13 +1156,6 @@ oop.inherits(Mode, TextMode);
if (endState == "start" || endState == "no_regex") {
return "";
}
- var match = line.match(/^\s*(\/?)\*/);
- if (match) {
- if (match[1]) {
- indent += " ";
- }
- indent += "* ";
- }
}
return indent;
};
@@ -887,7 +1193,7 @@ var DocCommentHighlightRules = function () {
token: "comment.doc.tag",
regex: "@\\w+(?=\\s|$)"
}, DocCommentHighlightRules.getTagRule(), {
- defaultToken: "comment.doc",
+ defaultToken: "comment.doc.body",
caseInsensitive: true
}
]
@@ -903,7 +1209,7 @@ DocCommentHighlightRules.getTagRule = function (start) {
DocCommentHighlightRules.getStartRule = function (start) {
return {
token: "comment.doc", // doc comment
- regex: "\\/\\*(?=\\*)",
+ regex: /\/\*\*(?!\/)/,
next: start
};
};
@@ -1001,6 +1307,7 @@ var WollokHighlightRules = require("./wollok_highlight_rules").WollokHighlightRu
var Mode = function () {
JavaScriptMode.call(this);
this.HighlightRules = WollokHighlightRules;
+ this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, JavaScriptMode);
(function () {
diff --git a/modules/lib/ace/mode-xml.js b/modules/lib/ace/mode-xml.js
index e5521d3..6a42bf2 100644
--- a/modules/lib/ace/mode-xml.js
+++ b/modules/lib/ace/mode-xml.js
@@ -178,11 +178,10 @@ exports.XmlHighlightRules = XmlHighlightRules;
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -271,7 +270,7 @@ var XmlBehaviour = function () {
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return {
text: ">" + "" + element + ">",
@@ -285,7 +284,7 @@ var XmlBehaviour = function () {
var line = session.getLine(cursor.row);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
if (token.value == "/>")
return;
while (token && token.type.indexOf("tag-name") === -1) {
@@ -300,7 +299,7 @@ var XmlBehaviour = function () {
if (!token || token.type.indexOf("end-tag") !== -1) {
return;
}
- if (this.voidElements && !this.voidElements[tag]) {
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
var line = session.getLine(row);
var nextIndent = this.$getIndent(line);
@@ -346,7 +345,7 @@ var Tag = function () {
this.end = { row: 0, column: 0 };
};
function is(token, type) {
- return token.type.lastIndexOf(type + ".xml") > -1;
+ return token && token.type && token.type.lastIndexOf(type + ".xml") > -1;
}
(function () {
this.getFoldWidget = function (session, foldStyle, row) {
@@ -378,6 +377,12 @@ function is(token, type) {
if (!token)
return null;
tag.tagName = token.value;
+ if (token.value === "") { //skip empty tag name token for fragment
+ token = tokens[++i];
+ if (!token)
+ return null;
+ tag.tagName = token.value;
+ }
tag.end.column += token.value.length;
for (i++; i < tokens.length; i++) {
token = tokens[i];
@@ -403,10 +408,13 @@ function is(token, type) {
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
column += token.value.length;
- if (column < startColumn)
+ if (column < startColumn - 1)
continue;
if (is(token, "end-tag-open")) {
token = tokens[i + 1];
+ if (is(token, "tag-name") && token.value === "") {
+ token = tokens[i + 2];
+ }
if (token && token.value == tagName)
return true;
}
@@ -414,14 +422,14 @@ function is(token, type) {
return false;
};
this.getFoldWidgetRange = function (session, foldStyle, row) {
+ var firstTag = this._getFirstTagInLine(session, row);
+ if (!firstTag) {
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
+ }
var tags = session.getMatchingTags({ row: row, column: 0 });
if (tags) {
return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
}
- else {
- return this.getCommentFoldWidget(session, row)
- && session.getCommentFoldRange(row, session.getLine(row).length);
- }
};
}).call(FoldMode.prototype);
diff --git a/modules/lib/ace/mode-xquery.js b/modules/lib/ace/mode-xquery.js
index b5e5685..e9b7ea5 100644
--- a/modules/lib/ace/mode-xquery.js
+++ b/modules/lib/ace/mode-xquery.js
@@ -2084,11 +2084,10 @@ exports.XQueryLexer = function(){ return new Lexer(XQueryTokenizer, Rules); };
});
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"], function(require, exports, module){"use strict";
var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
-var lang = require("../../lib/lang");
function is(token, type) {
return token && token.type.lastIndexOf(type + ".xml") > -1;
}
@@ -2177,7 +2176,7 @@ var XmlBehaviour = function () {
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
- if (this.voidElements.hasOwnProperty(element.toLowerCase()))
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return {
text: ">" + "" + element + ">",
@@ -2191,7 +2190,7 @@ var XmlBehaviour = function () {
var line = session.getLine(cursor.row);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
- if (token && token.type.indexOf("tag-close") !== -1) {
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
if (token.value == "/>")
return;
while (token && token.type.indexOf("tag-name") === -1) {
@@ -2206,7 +2205,7 @@ var XmlBehaviour = function () {
if (!token || token.type.indexOf("end-tag") !== -1) {
return;
}
- if (this.voidElements && !this.voidElements[tag]) {
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
var line = session.getLine(row);
var nextIndent = this.$getIndent(line);
diff --git a/modules/lib/ace/snippets/basic.js b/modules/lib/ace/snippets/basic.js
new file mode 100644
index 0000000..be42c73
--- /dev/null
+++ b/modules/lib/ace/snippets/basic.js
@@ -0,0 +1,9 @@
+
+; (function() {
+ ace.require(["ace/snippets/basic"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/snippets/csv.js b/modules/lib/ace/snippets/csv.js
new file mode 100644
index 0000000..3fb057c
--- /dev/null
+++ b/modules/lib/ace/snippets/csv.js
@@ -0,0 +1,9 @@
+
+; (function() {
+ ace.require(["ace/snippets/csv"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/snippets/tsv.js b/modules/lib/ace/snippets/tsv.js
new file mode 100644
index 0000000..1841ff6
--- /dev/null
+++ b/modules/lib/ace/snippets/tsv.js
@@ -0,0 +1,9 @@
+
+; (function() {
+ ace.require(["ace/snippets/tsv"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/theme-cloud_editor.js b/modules/lib/ace/theme-cloud_editor.js
index 6da78b9..62a8f98 100644
--- a/modules/lib/ace/theme-cloud_editor.js
+++ b/modules/lib/ace/theme-cloud_editor.js
@@ -1,4 +1,4 @@
-ace.define("ace/theme/cloud_editor-css",["require","exports","module"], function(require, exports, module){module.exports = "\n.ace-cloud_editor .ace_gutter {\n background: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_tooltip-marker-error.ace_tooltip-marker {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_tooltip-marker-warning.ace_tooltip-marker {\n background-color: #906806;\n}\n\n.ace-cloud_editor .ace_print-margin {\n width: 1px;\n background: #697077;\n}\n\n.ace-cloud_editor {\n background-color: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_cursor {\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_selection {\n background: #bfceff;\n}\n\n.ace-cloud_editor.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #ffffff;\n border-radius: 2px;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_step {\n background: #697077;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_bracket {\n margin: 0 0 0 -1px;\n border: 1px solid #697077;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_active-line {\n box-sizing: border-box;\n border-top: 1px solid #9191ac;\n border-bottom: 1px solid #9191ac;\n}\n\n.ace-cloud_editor .ace_gutter-cell_svg-icons {\n box-sizing: border-box;\n border-top: 1px solid #ffffff;\n border-bottom: 1px solid #ffffff;\n}\n\n.ace-cloud_editor .ace_gutter-active-line {\n background-repeat: no-repeat;\n box-sizing: border-box;\n border-top: 1px solid #9191ac;\n border-bottom: 1px solid #9191ac;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_selected-word {\n border: 1px solid #bfceff;\n}\n\n.ace-cloud_editor .ace_fold {\n background-color: #2963d6;\n border-color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_keyword {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_meta.ace_tag {\n color: #2963d6;\n}\n\n.ace-cloud_editor .ace_constant {\n color: #a26202;\n}\n\n.ace-cloud_editor .ace_constant.ace_numeric {\n color: #a26202;\n}\n\n.ace-cloud_editor .ace_constant.ace_character.ace_escape {\n color: #d91792;\n}\n\n.ace-cloud_editor .ace_support.ace_function {\n color: #d1000a;\n}\n\n.ace-cloud_editor .ace_support.ace_class {\n color: #a26202;\n}\n\n.ace-cloud_editor .ace_storage {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_invalid.ace_illegal {\n color: #ffffff;\n background-color: #2963d6;\n}\n\n.ace-cloud_editor .ace_invalid.ace_deprecated {\n color: #ffffff;\n background-color: #a26202;\n}\n\n.ace-cloud_editor .ace_string {\n color: #218000;\n}\n\n.ace-cloud_editor .ace_string.ace_regexp {\n color: #218000;\n}\n\n.ace-cloud_editor .ace_comment,\n.ace-cloud_editor .ace_ghost_text {\n color: #697077;\n opacity: 1;\n}\n\n.ace-cloud_editor .ace_variable {\n color: #2963d6;\n}\n\n.ace-cloud_editor .ace_meta.ace_selector {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_entity.ace_other.ace_attribute-name {\n color: #a26202;\n}\n\n.ace-cloud_editor .ace_entity.ace_name.ace_function {\n color: #d1000a;\n}\n\n.ace-cloud_editor .ace_entity.ace_name.ace_tag {\n color: #2963d6;\n}\n\n.ace-cloud_editor .ace_heading {\n color: #d1000a;\n}\n\n.ace-cloud_editor .ace_xml-pe {\n color: #a26202;\n}\n.ace-cloud_editor .ace_doctype {\n color: #2963d6;\n}\n\n.ace-cloud_editor .ace_tooltip {\n background-color: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_icon_svg.ace_error,\n.ace-cloud_editor .ace_icon_svg.ace_error_fold {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_icon_svg.ace_warning,\n.ace-cloud_editor .ace_icon_svg.ace_warning_fold {\n background-color: #906806;\n}\n.ace-cloud_editor .ace_icon_svg.ace_info {\n background-color: #0073bb;\n}\n.ace-cloud_editor .ace_highlight-marker {\n background: none;\n border: #2963d6 1px solid;\n}\n.ace-cloud_editor .ace_tooltip.ace_hover-tooltip:focus > div {\n outline: 1px solid #0073bb;\n}\n.ace-cloud_editor .ace_snippet-marker {\n background-color: #CED6E0;\n border: 0;\n}\n\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #f2f3f3;\n border: #0F68AE 1.5px solid;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #16191f;\n background: #f2f3f3;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_completion-meta {\n color: #545b64;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #0F68AE;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete {\n box-shadow: 0 1px 1px 0 #001c244d, 1px 1px 1px 0 #001c2426, -1px 1px 1px 0 #001c2426;\n line-height: 1.5;\n border: 1px solid #eaeded;\n background: #ffffff;\n color: #16191f;\n}\n\n";
+ace.define("ace/theme/cloud_editor-css",["require","exports","module"], function(require, exports, module){module.exports = "\n.ace-cloud_editor .ace_gutter {\n background: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_tooltip-marker-error.ace_tooltip-marker {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_tooltip-marker-security.ace_tooltip-marker {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_tooltip-marker-warning.ace_tooltip-marker {\n background-color: #906806;\n}\n\n.ace-cloud_editor .ace_print-margin {\n width: 1px;\n background: #697077;\n}\n\n.ace-cloud_editor {\n background-color: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_cursor {\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_selection {\n background: #bfceff;\n}\n\n.ace-cloud_editor.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #ffffff;\n border-radius: 2px;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_step {\n background: #697077;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_bracket {\n margin: 0 0 0 -1px;\n border: 1px solid #697077;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_active-line {\n box-sizing: border-box;\n border-top: 1px solid #9191ac;\n border-bottom: 1px solid #9191ac;\n}\n\n.ace-cloud_editor .ace_gutter-cell_svg-icons {\n box-sizing: border-box;\n border-top: 1px solid #ffffff;\n border-bottom: 1px solid #ffffff;\n}\n\n.ace-cloud_editor .ace_gutter-active-line {\n background-repeat: no-repeat;\n box-sizing: border-box;\n border-top: 1px solid #9191ac;\n border-bottom: 1px solid #9191ac;\n}\n\n.ace-cloud_editor .ace_marker-layer .ace_selected-word {\n border: 1px solid #bfceff;\n}\n\n.ace-cloud_editor .ace_fold {\n background-color: #0E45B4;\n border-color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_keyword {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_meta.ace_tag {\n color: #0E45B4;\n}\n\n.ace-cloud_editor .ace_constant {\n color: #A16101;\n}\n\n.ace-cloud_editor .ace_constant.ace_numeric {\n color: #A16101;\n}\n\n.ace-cloud_editor .ace_constant.ace_character.ace_escape {\n color: #BD1880;\n}\n\n.ace-cloud_editor .ace_support.ace_function {\n color: #A81700;\n}\n\n.ace-cloud_editor .ace_support.ace_class {\n color: #A16101;\n}\n\n.ace-cloud_editor .ace_storage {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_invalid.ace_illegal {\n color: #ffffff;\n background-color: #0E45B4;\n}\n\n.ace-cloud_editor .ace_invalid.ace_deprecated {\n color: #ffffff;\n background-color: #A16101;\n}\n\n.ace-cloud_editor .ace_string {\n color: #207A7F;\n}\n\n.ace-cloud_editor .ace_string.ace_regexp {\n color: #207A7F;\n}\n\n.ace-cloud_editor .ace_comment,\n.ace-cloud_editor .ace_ghost_text {\n color: #697077;\n opacity: 1;\n}\n\n.ace-cloud_editor .ace_variable {\n color: #0E45B4;\n}\n\n.ace-cloud_editor .ace_meta.ace_selector {\n color: #9749d1;\n}\n\n.ace-cloud_editor .ace_entity.ace_other.ace_attribute-name {\n color: #A16101;\n}\n\n.ace-cloud_editor .ace_entity.ace_name.ace_function {\n color: #A81700;\n}\n\n.ace-cloud_editor .ace_entity.ace_name.ace_tag {\n color: #0E45B4;\n}\n\n.ace-cloud_editor .ace_heading {\n color: #A81700;\n}\n\n.ace-cloud_editor .ace_xml-pe {\n color: #A16101;\n}\n.ace-cloud_editor .ace_doctype {\n color: #0E45B4;\n}\n\n.ace-cloud_editor .ace_tooltip {\n background-color: #ffffff;\n color: #3a3a42;\n}\n\n.ace-cloud_editor .ace_icon_svg.ace_error,\n.ace-cloud_editor .ace_icon_svg.ace_error_fold {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_icon_svg.ace_security,\n.ace-cloud_editor .ace_icon_svg.ace_security_fold {\n background-color: #d13212;\n}\n.ace-cloud_editor .ace_icon_svg.ace_warning,\n.ace-cloud_editor .ace_icon_svg.ace_warning_fold {\n background-color: #906806;\n}\n.ace-cloud_editor .ace_icon_svg.ace_info {\n background-color: #0073bb;\n}\n.ace-cloud_editor .ace_icon_svg.ace_hint {\n background-color: #0073bb;\n}\n.ace-cloud_editor .ace_highlight-marker {\n background: none;\n border: #0E45B4 1px solid;\n}\n.ace-cloud_editor .ace_tooltip.ace_hover-tooltip:focus > div {\n outline: 1px solid #0073bb;\n}\n.ace-cloud_editor .ace_snippet-marker {\n background-color: #CED6E0;\n border: 0;\n}\n\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #f2f3f3;\n border: #0F68AE 1.5px solid;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #16191f;\n background: #f2f3f3;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_completion-meta {\n color: #545b64;\n opacity: 1;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #0F68AE;\n}\n.ace-cloud_editor.ace_editor.ace_autocomplete {\n box-shadow: 0 1px 1px 0 #001c244d, 1px 1px 1px 0 #001c2426, -1px 1px 1px 0 #001c2426;\n line-height: 1.5;\n border: 1px solid #eaeded;\n background: #ffffff;\n color: #16191f;\n}\n\n";
});
diff --git a/modules/lib/ace/theme-cloud_editor_dark.js b/modules/lib/ace/theme-cloud_editor_dark.js
index 0bac343..2ef2fd1 100644
--- a/modules/lib/ace/theme-cloud_editor_dark.js
+++ b/modules/lib/ace/theme-cloud_editor_dark.js
@@ -1,4 +1,4 @@
-ace.define("ace/theme/cloud_editor_dark-css",["require","exports","module"], function(require, exports, module){module.exports = "\n.ace-cloud_editor_dark .ace_gutter {\n background: #282c34;\n color: #8e96a9;\n}\n\n.ace-cloud_editor_dark.ace_dark .ace_tooltip-marker-error.ace_tooltip-marker {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark.ace_dark .ace_tooltip-marker-warning.ace_tooltip-marker {\n background-color: #e0ca57;\n}\n\n.ace-cloud_editor_dark .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-cloud_editor_dark {\n background-color: #282c34;\n color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_cursor {\n color: #66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_selection {\n background: #213a70;\n}\n\n.ace-cloud_editor_dark.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #8e96a9;\n border-radius: 2px;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_step {\n background: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_bracket {\n margin: 0 0 0 -1px;\n border: 1px solid #e8e8e8;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_active-line {\n box-sizing: border-box;\n border-top: 1px solid #75777a;\n border-bottom: 1px solid #75777a;\n}\n\n.ace-cloud_editor_dark .ace_gutter-cell_svg-icons {\n box-sizing: border-box;\n border-top: 1px solid #282c34;\n border-bottom: 1px solid #282c34;\n}\n\n.ace-cloud_editor_dark .ace_gutter-active-line {\n background-repeat: no-repeat;\n box-sizing: border-box;\n border-top: 1px solid #75777a;\n border-bottom: 1px solid #75777a;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_selected-word {\n border: 1px solid #282c34;\n}\n\n.ace-cloud_editor_dark .ace_fold {\n background-color: #66b2f0;\n border-color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_keyword {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_constant {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_constant.ace_numeric {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_constant.ace_character.ace_escape {\n color: #71ccc7;\n}\n\n.ace-cloud_editor_dark .ace_support.ace_function {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_support.ace_class {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_storage {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_invalid.ace_illegal {\n color: #dcdfe4;\n background-color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_invalid.ace_deprecated {\n color: #dcdfe4;\n background-color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_string {\n color: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_string.ace_regexp {\n color: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_comment,\n.ace-cloud_editor_dark .ace_ghost_text {\n color: #b5bac0;\n opacity: 1;\n}\n\n.ace-cloud_editor_dark .ace_variable {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_meta.ace_selector {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_other.ace_attribute-name {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_function {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_tag {\n color:#66b2f0;\n}\n.ace-cloud_editor_dark .ace_heading {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_xml-pe {\n color: #e5c383;\n}\n.ace-cloud_editor_dark .ace_doctype {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_tag,\n.ace-cloud_editor_dark .ace_entity.ace_other.ace_attribute-name,\n.ace-cloud_editor_dark .ace_meta.ace_tag,\n.ace-cloud_editor_dark .ace_string.ace_regexp,\n.ace-cloud_editor_dark .ace_variable {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_tooltip {\n background-color: #282c34;\n color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_icon_svg.ace_error,\n.ace-cloud_editor_dark .ace_icon_svg.ace_error_fold {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_warning,\n.ace-cloud_editor_dark .ace_icon_svg.ace_warning_fold {\n background-color: #e0ca57;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_info {\n background-color: #44b9d6;\n}\n.ace-cloud_editor_dark .ace_highlight-marker {\n background: none;\n border: #66b2f0 1px solid;\n}\n.ace-cloud_editor_dark .ace_tooltip.ace_hover-tooltip:focus > div {\n outline: 1px solid #44b9d6;\n}\n.ace-cloud_editor_dark .ace_snippet-marker {\n background-color: #434650;\n border: 0;\n}\n\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #272A30;\n border: #299FBC 1.5px solid;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #d5dbdb;\n background: #272A30;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_completion-meta {\n color: #ACB8B9;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2AA0BC;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete {\n box-shadow: 0 1px 1px 0 #001c244d, 1px 1px 1px 0 #001c2426, -1px 1px 1px 0 #001c2426;\n line-height: 1.5;\n border: 1px solid #2a2e33;\n background: #050506;\n color: #ffffff;\n}\n\n";
+ace.define("ace/theme/cloud_editor_dark-css",["require","exports","module"], function(require, exports, module){module.exports = "\n.ace-cloud_editor_dark .ace_gutter {\n background: #282c34;\n color: #8e96a9;\n}\n\n.ace-cloud_editor_dark.ace_dark .ace_tooltip-marker-error.ace_tooltip-marker {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark.ace_dark .ace_tooltip-marker-security.ace_tooltip-marker {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark.ace_dark .ace_tooltip-marker-warning.ace_tooltip-marker {\n background-color: #e0ca57;\n}\n\n.ace-cloud_editor_dark .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-cloud_editor_dark {\n background-color: #282c34;\n color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_cursor {\n color: #66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_selection {\n background: #4376bd;\n}\n\n.ace-cloud_editor_dark.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #8e96a9;\n border-radius: 2px;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_step {\n background: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_bracket {\n margin: 0 0 0 -1px;\n border: 1px solid #e8e8e8;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_active-line {\n box-sizing: border-box;\n border-top: 1px solid #75777a;\n border-bottom: 1px solid #75777a;\n}\n\n.ace-cloud_editor_dark .ace_gutter-cell_svg-icons {\n box-sizing: border-box;\n border-top: 1px solid #282c34;\n border-bottom: 1px solid #282c34;\n}\n\n.ace-cloud_editor_dark .ace_gutter-active-line {\n background-repeat: no-repeat;\n box-sizing: border-box;\n border-top: 1px solid #75777a;\n border-bottom: 1px solid #75777a;\n}\n\n.ace-cloud_editor_dark .ace_marker-layer .ace_selected-word {\n border: 1px solid #9bd0f7;\n}\n\n.ace-cloud_editor_dark .ace_fold {\n background-color: #66b2f0;\n border-color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_keyword {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_constant {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_constant.ace_numeric {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_constant.ace_character.ace_escape {\n color: #71ccc7;\n}\n\n.ace-cloud_editor_dark .ace_support.ace_function {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_support.ace_class {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_storage {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_invalid.ace_illegal {\n color: #dcdfe4;\n background-color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_invalid.ace_deprecated {\n color: #dcdfe4;\n background-color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_string {\n color: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_string.ace_regexp {\n color: #6fb342;\n}\n\n.ace-cloud_editor_dark .ace_comment,\n.ace-cloud_editor_dark .ace_ghost_text {\n color: #b5bac0;\n opacity: 1;\n}\n\n.ace-cloud_editor_dark .ace_variable {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_meta.ace_selector {\n color: #c674dc;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_other.ace_attribute-name {\n color: #e5c383;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_function {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_tag {\n color:#66b2f0;\n}\n.ace-cloud_editor_dark .ace_heading {\n color: #e96a71;\n}\n\n.ace-cloud_editor_dark .ace_xml-pe {\n color: #e5c383;\n}\n.ace-cloud_editor_dark .ace_doctype {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_entity.ace_name.ace_tag,\n.ace-cloud_editor_dark .ace_entity.ace_other.ace_attribute-name,\n.ace-cloud_editor_dark .ace_meta.ace_tag,\n.ace-cloud_editor_dark .ace_string.ace_regexp,\n.ace-cloud_editor_dark .ace_variable {\n color:#66b2f0;\n}\n\n.ace-cloud_editor_dark .ace_tooltip {\n background-color: #282c34;\n color: #dcdfe4;\n}\n\n.ace-cloud_editor_dark .ace_icon_svg.ace_error,\n.ace-cloud_editor_dark .ace_icon_svg.ace_error_fold {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_security,\n.ace-cloud_editor_dark .ace_icon_svg.ace_security_fold {\n background-color: #ff5d64;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_warning,\n.ace-cloud_editor_dark .ace_icon_svg.ace_warning_fold {\n background-color: #e0ca57;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_info {\n background-color: #44b9d6;\n}\n.ace-cloud_editor_dark .ace_icon_svg.ace_hint {\n background-color: #44b9d6;\n}\n.ace-cloud_editor_dark .ace_highlight-marker {\n background: none;\n border: #66b2f0 1px solid;\n}\n.ace-cloud_editor_dark .ace_tooltip.ace_hover-tooltip:focus > div {\n outline: 1px solid #44b9d6;\n}\n.ace-cloud_editor_dark .ace_snippet-marker {\n background-color: #434650;\n border: 0;\n}\n\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #272A30;\n border: #299FBC 1.5px solid;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #d5dbdb;\n background: #272A30;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_completion-meta {\n color: #95a5a6;\n opacity: 1;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2AA0BC;\n}\n.ace-cloud_editor_dark.ace_dark.ace_editor.ace_autocomplete {\n box-shadow: 0 1px 1px 0 #001c244d, 1px 1px 1px 0 #001c2426, -1px 1px 1px 0 #001c2426;\n line-height: 1.5;\n border: 1px solid #2a2e33;\n background: #050506;\n color: #ffffff;\n}\n\n";
});
diff --git a/modules/lib/ace/theme-github_light_default.js b/modules/lib/ace/theme-github_light_default.js
new file mode 100644
index 0000000..9b6a3df
--- /dev/null
+++ b/modules/lib/ace/theme-github_light_default.js
@@ -0,0 +1,18 @@
+ace.define("ace/theme/github_light_default-css",["require","exports","module"], function(require, exports, module){module.exports = ".ace-github-light-default .ace_gutter {\n background: #ffffff;\n color: rgba(27, 31, 35, 0.3);\n}\n\n.ace-github-light-default .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-github-light-default {\n background-color: #FFFFFF;\n color: #24292E;\n}\n\n.ace-github-light-default .ace_cursor {\n color: #044289;\n background: none;\n}\n\n.ace-github-light-default .ace_marker-layer .ace_selection {\n background: rgba(3, 102, 214, 0.14);\n}\n\n.ace-github-light-default.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #FFFFFF;\n border-radius: 2px;\n}\n\n.ace-github-light-default .ace_marker-layer .ace_step {\n background: rgb(198, 219, 174);\n}\n\n.ace-github-light-default .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(52, 208, 88, 0);\n background: rgba(52, 208, 88, 0.25);\n}\n\n.ace-github-light-default .ace_marker-layer .ace_active-line {\n background: #f6f8fa;\n border: 2px solid #eeeeee;\n}\n\n.ace-github-light-default .ace_gutter-active-line {\n background-color: #f6f8fa;\n color: #24292e\n}\n\n.ace-github-light-default .ace_marker-layer .ace_selected-word {\n border: 1px solid rgba(3, 102, 214, 0.14);\n}\n\n.ace-github-light-default .ace_fold {\n background-color: #D73A49;\n border-color: #24292E;\n}\n\n.ace_tooltip.ace-github-light-default {\n background-color: #f6f8fa !important;\n color: #444d56 !important;\n border: 1px solid #444d56\n}\n\n.ace-github-light-default .language_highlight_error {\n border-bottom: dotted 1px #cb2431;\n background: none;\n}\n\n.ace-github-light-default .language_highlight_warning {\n border-bottom: solid 1px #f9c513;\n background: none;\n}\n\n.ace-github-light-default .language_highlight_info {\n border-bottom: dotted 1px #1a85ff;\n background: none;\n}\n\n.ace-github-light-default .ace_keyword {\n color: #D73A49;\n}\n\n.ace-github-light-default .ace_constant {\n color: #005CC5;\n}\n\n.ace-github-light-default .ace_support {\n color: #005CC5;\n}\n\n.ace-github-light-default .ace_support.ace_constant {\n color: #005CC5;\n}\n\n.ace-github-light-default .ace_support.ace_type {\n color: #D73A49;\n}\n\n.ace-github-light-default .ace_storage {\n color: #D73A49;\n}\n\n.ace-github-light-default .ace_storage.ace_type {\n color: #D73A49;\n}\n\n.ace-github-light-default .ace_invalid.ace_illegal {\n font-style: italic;\n color: #B31D28;\n}\n\n.ace-github-light-default .ace_invalid.ace_deprecated {\n font-style: italic;\n color: #B31D28;\n}\n\n.ace-github-light-default .ace_string {\n color: #032F62;\n}\n\n.ace-github-light-default .ace_string.ace_regexp {\n color: #032F62;\n}\n\n.ace-github-light-default .ace_comment {\n color: #6A737D;\n}\n\n.ace-github-light-default .ace_variable {\n color: #E36209;\n}\n\n.ace-github-light-default .ace_variable.ace_language {\n color: #005CC5;\n}\n\n.ace-github-light-default .ace_entity.ace_name {\n color: #6F42C1;\n}\n\n.ace-github-light-default .ace_entity {\n color: #6F42C1;\n}\n\n.ace-github-light-default .ace_entity.ace_name.ace_tag {\n color: #22863A;\n}\n\n.ace-github-light-default .ace_meta.ace_tag {\n color: #22863A;\n}\n\n.ace-github-light-default .ace_markup.ace_heading {\n color: #005CC5;\n}\n\n.ace-github-light-default .ace_indent-guide {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n}\n\n.ace-github-light-default .ace_indent-guide-active {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\") right repeat-y;\n}\n";
+
+});
+
+ace.define("ace/theme/github_light_default",["require","exports","module","ace/theme/github_light_default-css","ace/lib/dom"], function(require, exports, module){exports.isDark = false;
+exports.cssClass = "ace-github-light-default";
+exports.cssText = require("./github_light_default-css");
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass, false);
+
+}); (function() {
+ ace.require(["ace/theme/github_light_default"], function(m) {
+ if (typeof module == "object" && typeof exports == "object" && module) {
+ module.exports = m;
+ }
+ });
+ })();
+
\ No newline at end of file
diff --git a/modules/lib/ace/worker-javascript.js b/modules/lib/ace/worker-javascript.js
index a20ded8..7e9d807 100644
--- a/modules/lib/ace/worker-javascript.js
+++ b/modules/lib/ace/worker-javascript.js
@@ -2899,58 +2899,7 @@ module.exports = slice;
}
var bareIdentifier = /^\s*(\w|\$)+\s*$/;
function template(text, settings, oldSettings) {
- if (!settings && oldSettings) settings = oldSettings;
- settings = defaults({}, settings, _$1.templateSettings);
- var matcher = RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
- index = offset + match.length;
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- } else if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- } else if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
- return match;
- });
- source += "';\n";
-
- var argument = settings.variable;
- if (argument) {
- if (!bareIdentifier.test(argument)) throw new Error(
- 'variable is not a bare identifier: ' + argument
- );
- } else {
- source = 'with(obj||{}){\n' + source + '}\n';
- argument = 'obj';
- }
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + 'return __p;\n';
-
- var render;
- try {
- render = new Function(argument, '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- var template = function(data) {
- return render.call(this, data, _$1);
- };
- template.source = 'function(' + argument + '){\n' + source + '}';
-
- return template;
+ console.error("should not happen");
}
function result(obj, path, fallback) {
path = toPath(path);
diff --git a/modules/lib/ace/worker-yaml.js b/modules/lib/ace/worker-yaml.js
index 5875513..efba53f 100644
--- a/modules/lib/ace/worker-yaml.js
+++ b/modules/lib/ace/worker-yaml.js
@@ -4541,29 +4541,7 @@ function resolveJavascriptFunction(data) {
}
function constructJavascriptFunction(data) {
-
- var source = '(' + data + ')',
- ast = esprima.parse(source, { range: true }),
- params = [],
- body;
-
- if (ast.type !== 'Program' ||
- ast.body.length !== 1 ||
- ast.body[0].type !== 'ExpressionStatement' ||
- (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
- ast.body[0].expression.type !== 'FunctionExpression')) {
- throw new Error('Failed to resolve function');
- }
-
- ast.body[0].expression.params.forEach(function (param) {
- params.push(param.name);
- });
-
- body = ast.body[0].expression.body.range;
- if (ast.body[0].expression.body.type === 'BlockStatement') {
- return new Function(params, source.slice(body[0] + 1, body[1] - 1));
- }
- return new Function(params, 'return ' + source.slice(body[0], body[1]));
+ return function() {}
}
function representJavascriptFunction(object /*, style*/) {
diff --git a/modules/lib/foreign-resources.cdx.json b/modules/lib/foreign-resources.cdx.json
new file mode 100644
index 0000000..4a25b2a
--- /dev/null
+++ b/modules/lib/foreign-resources.cdx.json
@@ -0,0 +1,33 @@
+{
+ "$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
+ "bomFormat": "CycloneDX",
+ "specVersion": "1.6",
+ "serialNumber": "urn:uuid:0a34b5c5-de1c-4d86-a244-15e4426eed5d",
+ "version": 1,
+ "components": [
+ {
+ "type": "library",
+ "name": "ace",
+ "version": "1.39.1",
+ "licenses": [
+ {
+ "license": {
+ "id": "BSD-3-Clause"
+ }
+ }
+ ],
+ "purl": "pkg:github/ajaxorg/ace-builds@1.39.1",
+ "authors": [
+ {
+ "name": "Ace authors – https://ace.c9.io/"
+ }
+ ],
+ "externalReferences": [
+ {
+ "url": "https://github.com/ajaxorg/ace-builds",
+ "type": "website"
+ }
+ ]
+ }
+ ]
+}
diff --git a/modules/lib/foreign-resources.yaml b/modules/lib/foreign-resources.yaml
index b8abd40..3121862 100644
--- a/modules/lib/foreign-resources.yaml
+++ b/modules/lib/foreign-resources.yaml
@@ -1,8 +1,15 @@
ace:
license: BSD-3-Clause
homepage: https://github.com/ajaxorg/ace-builds
- version: 1.32.7
- type: doc-only
+ version: 1.39.1
+ purl: pkg:github/ajaxorg/ace-builds@1.39.1
+ type: tar
authors: Ace authors – https://ace.c9.io/
- src: https://codeload.github.com/ajaxorg/ace-builds/tar.gz/v1.32.7
- integrity: sha384-iXQLrzC3CnDx4a8SWF+JaB29bujwxssx+AayhWYUHUXgwU6N5WDFmtCz+6X8hfQP
+ src: https://codeload.github.com/ajaxorg/ace-builds/tar.gz/v1.39.1
+ integrity: sha384-H7Ib7B2/OYIfQJ97NgYu7dUPfbzoIeTwBkFkival//AiXJ0S7OGMYSASFw2JVHvE
+ dest:
+ ace-builds-*/CHANGELOG.md: .
+ ace-builds-*/LICENSE: .
+ ace-builds-*/README.md: .
+ ace-builds-*/src-noconflict/*.js: .
+ ace-builds-*/src-noconflict/snippets: .
diff --git a/package-lock.json b/package-lock.json
index fb23cea..183115f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,41 +1,29 @@
{
"name": "codeeditor",
"version": "0.0.0",
- "lockfileVersion": 2,
+ "lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeeditor",
"version": "0.0.0",
"devDependencies": {
- "ace-builds": "1.32.7",
- "eslint-config-wikimedia": "0.28.2",
+ "eslint-config-wikimedia": "0.31.0",
"grunt": "1.6.1",
"grunt-banana-checker": "0.13.0",
- "grunt-contrib-clean": "2.0.1",
- "grunt-contrib-copy": "1.0.0",
"grunt-eslint": "24.3.0",
- "grunt-exec": "3.0.0",
"grunt-stylelint": "0.20.1",
- "stylelint-config-wikimedia": "0.17.2"
- }
- },
- "node_modules/@aashutoshrathi/word-wrap": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
- "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
+ "stylelint-config-wikimedia": "0.18.0"
}
},
"node_modules/@babel/code-frame": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
- "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
+ "version": "7.26.2",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
+ "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
"dev": true,
"dependencies": {
- "@babel/highlight": "^7.24.7",
+ "@babel/helper-validator-identifier": "^7.25.9",
+ "js-tokens": "^4.0.0",
"picocolors": "^1.0.0"
},
"engines": {
@@ -43,104 +31,18 @@
}
},
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
- "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
+ "version": "7.25.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
+ "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
"dev": true,
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.24.7",
- "chalk": "^2.4.2",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.0.0"
- },
"engines": {
"node": ">=6.9.0"
}
},
- "node_modules/@babel/highlight/node_modules/ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
- "dev": true
- },
- "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/@csstools/css-parser-algorithms": {
- "version": "2.6.3",
- "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.6.3.tgz",
- "integrity": "sha512-xI/tL2zxzEbESvnSxwFgwvy5HS00oCXxL4MLs6HUiDcYfwowsoQaABKxUElp1ARITrINzBnsECOc1q0eg2GOrA==",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.4.tgz",
+ "integrity": "sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==",
"dev": true,
"funding": [
{
@@ -153,16 +55,16 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
- "@csstools/css-tokenizer": "^2.3.1"
+ "@csstools/css-tokenizer": "^3.0.3"
}
},
"node_modules/@csstools/css-tokenizer": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.3.1.tgz",
- "integrity": "sha512-iMNHTyxLbBlWIfGtabT157LH9DUx9X8+Y3oymFEuMj8HNc+rpE3dPFGFgHjpKfjeFDjLjYIAIhXPGvS2lKxL9g==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.3.tgz",
+ "integrity": "sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==",
"dev": true,
"funding": [
{
@@ -175,36 +77,13 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
}
},
"node_modules/@csstools/media-query-list-parser": {
- "version": "2.1.11",
- "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.11.tgz",
- "integrity": "sha512-uox5MVhvNHqitPP+SynrB1o8oPxPMt2JLgp5ghJOWf54WGQ5OKu47efne49r1SWqs3wRP8xSWjnO9MBKxhB1dA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/csstools"
- },
- {
- "type": "opencollective",
- "url": "https://opencollective.com/csstools"
- }
- ],
- "engines": {
- "node": "^14 || ^16 || >=18"
- },
- "peerDependencies": {
- "@csstools/css-parser-algorithms": "^2.6.3",
- "@csstools/css-tokenizer": "^2.3.1"
- }
- },
- "node_modules/@csstools/selector-specificity": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.1.1.tgz",
- "integrity": "sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-4.0.2.tgz",
+ "integrity": "sha512-EUos465uvVvMJehckATTlNqGj4UJWkTmdWuDMjqvSUkjGpmOyFZBVwb4knxCm/k2GMTXY+c/5RkdndzFYWeX5A==",
"dev": true,
"funding": [
{
@@ -217,10 +96,11 @@
}
],
"engines": {
- "node": "^14 || ^16 || >=18"
+ "node": ">=18"
},
"peerDependencies": {
- "postcss-selector-parser": "^6.0.13"
+ "@csstools/css-parser-algorithms": "^3.0.4",
+ "@csstools/css-tokenizer": "^3.0.3"
}
},
"node_modules/@dual-bundle/import-meta-resolve": {
@@ -250,25 +130,41 @@
"node": ">=16"
}
},
+ "node_modules/@es-joy/jsdoccomment/node_modules/@typescript-eslint/types": {
+ "version": "7.18.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz",
+ "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==",
+ "dev": true,
+ "engines": {
+ "node": "^18.18.0 || >=20.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
"node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
+ "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
"dev": true,
"dependencies": {
- "eslint-visitor-keys": "^3.3.0"
+ "eslint-visitor-keys": "^3.4.3"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
}
},
"node_modules/@eslint-community/regexpp": {
- "version": "4.10.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
- "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
+ "version": "4.12.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz",
+ "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
"dev": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
@@ -298,21 +194,22 @@
}
},
"node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
+ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
+ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
+ "deprecated": "Use @eslint/config-array instead",
"dev": true,
"dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
+ "@humanwhocodes/object-schema": "^2.0.3",
"debug": "^4.3.1",
"minimatch": "^3.0.5"
},
@@ -337,12 +234,22 @@
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
+ "deprecated": "Use @eslint/object-schema instead",
"dev": true
},
+ "node_modules/@keyv/serialize": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.0.3.tgz",
+ "integrity": "sha512-qnEovoOp5Np2JDGonIDL6Ayihw0RhnRh6vxPuHo4RDn1UOzwEo4AeIfpL6UGIrsceWrCMiVPgwRjbHu4vYFc3g==",
+ "dev": true,
+ "dependencies": {
+ "buffer": "^6.0.3"
+ }
+ },
"node_modules/@mdn/browser-compat-data": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.5.0.tgz",
- "integrity": "sha512-H+jO7BSlQAf7W1md2+CcBeWGhfOpuYSOemm0cCU3ffyWEodOJLIODaYSe6+Y1hQ8JxprsoXHFwGau8Hzudd70A==",
+ "version": "5.7.6",
+ "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.7.6.tgz",
+ "integrity": "sha512-7xdrMX0Wk7grrTZQwAoy1GkvPMFoizStUoL+VmtUkAxegbCCec+3FKwOM6yc/uGU5+BEczQHXAlWiqvM8JeENg==",
"dev": true
},
"node_modules/@nodelib/fs.scandir": {
@@ -380,41 +287,124 @@
"node": ">= 8"
}
},
+ "node_modules/@stylistic/eslint-plugin": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-3.1.0.tgz",
+ "integrity": "sha512-pA6VOrOqk0+S8toJYhQGv2MWpQQR0QpeUo9AhNkC49Y26nxBQ/nH1rta9bUU1rPw2fJ1zZEMV5oCX5AazT7J2g==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/utils": "^8.13.0",
+ "eslint-visitor-keys": "^4.2.0",
+ "espree": "^10.3.0",
+ "estraverse": "^5.3.0",
+ "picomatch": "^4.0.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "peerDependencies": {
+ "eslint": ">=8.40.0"
+ }
+ },
+ "node_modules/@stylistic/eslint-plugin/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@stylistic/eslint-plugin/node_modules/espree": {
+ "version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
+ "dev": true,
+ "dependencies": {
+ "acorn": "^8.15.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
"node_modules/@stylistic/stylelint-config": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@stylistic/stylelint-config/-/stylelint-config-1.0.1.tgz",
- "integrity": "sha512-JgFP88HZEyo34k9RpWVdcQJtLPrMxYE58IO3qypXhmvE/NmZohj+xjDtQ8UfaarnYsLecnldw57/GHum07Ctdw==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@stylistic/stylelint-config/-/stylelint-config-2.0.0.tgz",
+ "integrity": "sha512-8J4YAxggy2Nzkb8KJIOLbtMXTPZ5gpKVmyhiiuKEUgCl9XFND5lM0e/ZZBMGEYZ68h5qcsS/jgg1wh235erRAw==",
"dev": true,
"dependencies": {
- "@stylistic/stylelint-plugin": "^2.0.0"
+ "@stylistic/stylelint-plugin": "^3.0.0"
},
"engines": {
"node": "^18.12 || >=20.9"
},
"peerDependencies": {
- "stylelint": "^16.0.2"
+ "stylelint": "^16.8.0"
}
},
"node_modules/@stylistic/stylelint-plugin": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-2.0.0.tgz",
- "integrity": "sha512-dHKuT6PGd1WGZLOTuozAM7GdQzdmlmnFXYzvV1jYJXXpcCpV/OJ3+n8TXpMkoOeKHpJydY43EOoZTO1W/FOA4Q==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-3.1.1.tgz",
+ "integrity": "sha512-XagAHHIa528EvyGybv8EEYGK5zrVW74cHpsjhtovVATbhDRuJYfE+X4HCaAieW9lCkwbX6L+X0I4CiUG3w/hFw==",
"dev": true,
"dependencies": {
- "@csstools/css-parser-algorithms": "^2.3.2",
- "@csstools/css-tokenizer": "^2.2.1",
- "@csstools/media-query-list-parser": "^2.1.5",
+ "@csstools/css-parser-algorithms": "^3.0.1",
+ "@csstools/css-tokenizer": "^3.0.1",
+ "@csstools/media-query-list-parser": "^3.0.1",
"is-plain-object": "^5.0.0",
- "postcss-selector-parser": "^6.0.13",
+ "postcss-selector-parser": "^6.1.2",
"postcss-value-parser": "^4.2.0",
"style-search": "^0.1.0",
- "stylelint": "^16.0.2"
+ "stylelint": "^16.8.2"
},
"engines": {
"node": "^18.12 || >=20.9"
},
"peerDependencies": {
- "stylelint": "^16.0.2"
+ "stylelint": "^16.8.0"
+ }
+ },
+ "node_modules/@stylistic/stylelint-plugin/node_modules/@csstools/media-query-list-parser": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-3.0.1.tgz",
+ "integrity": "sha512-HNo8gGD02kHmcbX6PvCoUuOQvn4szyB9ca63vZHKX5A81QytgDG4oxG4IaEfHTlEZSZ6MjPEMWIVU+zF2PZcgw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@csstools/css-parser-algorithms": "^3.0.1",
+ "@csstools/css-tokenizer": "^3.0.1"
}
},
"node_modules/@stylistic/stylelint-plugin/node_modules/is-plain-object": {
@@ -427,9 +417,9 @@
}
},
"node_modules/@types/eslint": {
- "version": "8.56.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz",
- "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==",
+ "version": "8.56.12",
+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz",
+ "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==",
"dev": true,
"dependencies": {
"@types/estree": "*",
@@ -437,9 +427,9 @@
}
},
"node_modules/@types/estree": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
+ "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
"dev": true
},
"node_modules/@types/json-schema": {
@@ -460,170 +450,299 @@
"integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==",
"dev": true
},
- "node_modules/@typescript-eslint/scope-manager": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz",
- "integrity": "sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==",
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.35.1.tgz",
+ "integrity": "sha512-9XNTlo7P7RJxbVeICaIIIEipqxLKguyh+3UbXuT2XQuFp6d8VOeDEGuz5IiX0dgZo8CiI6aOFLg4e8cF71SFVg==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/visitor-keys": "7.12.0"
+ "@eslint-community/regexpp": "^4.10.0",
+ "@typescript-eslint/scope-manager": "8.35.1",
+ "@typescript-eslint/type-utils": "8.35.1",
+ "@typescript-eslint/utils": "8.35.1",
+ "@typescript-eslint/visitor-keys": "8.35.1",
+ "graphemer": "^1.4.0",
+ "ignore": "^7.0.0",
+ "natural-compare": "^1.4.0",
+ "ts-api-utils": "^2.1.0"
},
"engines": {
- "node": "^18.18.0 || >=20.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^8.35.1",
+ "eslint": "^8.57.0 || ^9.0.0",
+ "typescript": ">=4.8.4 <5.9.0"
}
},
- "node_modules/@typescript-eslint/types": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.12.0.tgz",
- "integrity": "sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==",
+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
+ "version": "7.0.5",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
"dev": true,
"engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
+ "node": ">= 4"
}
},
- "node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz",
- "integrity": "sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==",
+ "node_modules/@typescript-eslint/parser": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.35.1.tgz",
+ "integrity": "sha512-3MyiDfrfLeK06bi/g9DqJxP5pV74LNv4rFTyvGDmT3x2p1yp1lOd+qYZfiRPIOf/oON+WRZR5wxxuF85qOar+w==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/visitor-keys": "7.12.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "minimatch": "^9.0.4",
- "semver": "^7.6.0",
- "ts-api-utils": "^1.3.0"
+ "@typescript-eslint/scope-manager": "8.35.1",
+ "@typescript-eslint/types": "8.35.1",
+ "@typescript-eslint/typescript-estree": "8.35.1",
+ "@typescript-eslint/visitor-keys": "8.35.1",
+ "debug": "^4.3.4"
},
"engines": {
- "node": "^18.18.0 || >=20.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0",
+ "typescript": ">=4.8.4 <5.9.0"
}
},
- "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "node_modules/@typescript-eslint/project-service": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.35.1.tgz",
+ "integrity": "sha512-VYxn/5LOpVxADAuP3NrnxxHYfzVtQzLKeldIhDhzC8UHaiQvYlXvKuVho1qLduFbJjjy5U5bkGwa3rUGUb1Q6Q==",
"dev": true,
"dependencies": {
- "balanced-match": "^1.0.0"
+ "@typescript-eslint/tsconfig-utils": "^8.35.1",
+ "@typescript-eslint/types": "^8.35.1",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <5.9.0"
}
},
- "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.35.1.tgz",
+ "integrity": "sha512-s/Bpd4i7ht2934nG+UoSPlYXd08KYz3bmjLEb7Ye1UVob0d1ENiT3lY8bsCmik4RqfSbPw9xJJHbugpPpP5JUg==",
"dev": true,
"dependencies": {
- "brace-expansion": "^2.0.1"
+ "@typescript-eslint/types": "8.35.1",
+ "@typescript-eslint/visitor-keys": "8.35.1"
},
"engines": {
- "node": ">=16 || 14 >=14.17"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
- "url": "https://github.com/sponsors/isaacs"
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
}
},
- "node_modules/@typescript-eslint/utils": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.12.0.tgz",
- "integrity": "sha512-Y6hhwxwDx41HNpjuYswYp6gDbkiZ8Hin9Bf5aJQn1bpTs3afYY4GX+MPYxma8jtoIV2GRwTM/UJm/2uGCVv+DQ==",
+ "node_modules/@typescript-eslint/tsconfig-utils": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.35.1.tgz",
+ "integrity": "sha512-K5/U9VmT9dTHoNowWZpz+/TObS3xqC5h0xAIjXPw+MNcKV9qg6eSatEnmeAwkjHijhACH0/N7bkhKvbt1+DXWQ==",
"dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "@typescript-eslint/scope-manager": "7.12.0",
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/typescript-estree": "7.12.0"
- },
"engines": {
- "node": "^18.18.0 || >=20.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
- "eslint": "^8.56.0"
+ "typescript": ">=4.8.4 <5.9.0"
}
},
- "node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz",
- "integrity": "sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==",
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.35.1.tgz",
+ "integrity": "sha512-HOrUBlfVRz5W2LIKpXzZoy6VTZzMu2n8q9C2V/cFngIC5U1nStJgv0tMV4sZPzdf4wQm9/ToWUFPMN9Vq9VJQQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.12.0",
- "eslint-visitor-keys": "^3.4.3"
+ "@typescript-eslint/typescript-estree": "8.35.1",
+ "@typescript-eslint/utils": "8.35.1",
+ "debug": "^4.3.4",
+ "ts-api-utils": "^2.1.0"
},
"engines": {
- "node": "^18.18.0 || >=20.0.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0",
+ "typescript": ">=4.8.4 <5.9.0"
}
},
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "node_modules/abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
- },
- "node_modules/ace-builds": {
- "version": "1.32.7",
- "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.32.7.tgz",
- "integrity": "sha512-ziv35kaYELFw4suWlotz/Xsl1/1LhWAbwFoD3zIgCgP9gXGECEsAM4GhiB0T0xZdmQjyv6hmAzO280g0+n4vGw==",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
+ "node_modules/@typescript-eslint/types": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.35.1.tgz",
+ "integrity": "sha512-q/O04vVnKHfrrhNAscndAn1tuQhIkwqnaW+eu5waD5IPts2eX1dgJxgqcPx5BX109/qAz7IG6VrEPTOYKCNfRQ==",
"dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
"engines": {
- "node": ">=0.4.0"
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
}
},
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.35.1.tgz",
+ "integrity": "sha512-Vvpuvj4tBxIka7cPs6Y1uvM7gJgdF5Uu9F+mBJBPY4MhvjrjWGK4H0lVgLJd/8PWZ23FTqsaJaLEkBCFUk8Y9g==",
"dev": true,
- "peerDependencies": {
+ "dependencies": {
+ "@typescript-eslint/project-service": "8.35.1",
+ "@typescript-eslint/tsconfig-utils": "8.35.1",
+ "@typescript-eslint/types": "8.35.1",
+ "@typescript-eslint/visitor-keys": "8.35.1",
+ "debug": "^4.3.4",
+ "fast-glob": "^3.3.2",
+ "is-glob": "^4.0.3",
+ "minimatch": "^9.0.4",
+ "semver": "^7.6.0",
+ "ts-api-utils": "^2.1.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <5.9.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.35.1.tgz",
+ "integrity": "sha512-lhnwatFmOFcazAsUm3ZnZFpXSxiwoa1Lj50HphnDe1Et01NF4+hrdXONSUHIcbVu2eFb1bAf+5yjXkGVkXBKAQ==",
+ "dev": true,
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.7.0",
+ "@typescript-eslint/scope-manager": "8.35.1",
+ "@typescript-eslint/types": "8.35.1",
+ "@typescript-eslint/typescript-estree": "8.35.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0",
+ "typescript": ">=4.8.4 <5.9.0"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "8.35.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.35.1.tgz",
+ "integrity": "sha512-VRwixir4zBWCSTP/ljEo091lbpypz57PoeAQ9imjG+vbeof9LplljsL1mos4ccG6H9IjfrVGM359RozUnuFhpw==",
+ "dev": true,
+ "dependencies": {
+ "@typescript-eslint/types": "8.35.1",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@ungap/structured-clone": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
+ "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
+ "dev": true
+ },
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "dev": true
+ },
+ "node_modules/acorn": {
+ "version": "8.15.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
+ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
+ "dev": true,
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "dev": true,
+ "peerDependencies": {
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
"node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "version": "6.14.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz",
+ "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
@@ -721,12 +840,12 @@
}
},
"node_modules/ast-metadata-inferer": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.8.0.tgz",
- "integrity": "sha512-jOMKcHht9LxYIEQu+RVd22vtgrPaVCtDRQ/16IGmurdzxvYbDd5ynxjnyrzLnieG96eTcAyaoj/wN/4/1FyyeA==",
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.8.1.tgz",
+ "integrity": "sha512-ht3Dm6Zr7SXv6t1Ra6gFo0+kLDglHGrEbYihTkcycrbHw7WCcuhBzPlJYHEsIpycaUwzsJHje+vUcxXUX4ztTA==",
"dev": true,
"dependencies": {
- "@mdn/browser-compat-data": "^5.2.34"
+ "@mdn/browser-compat-data": "^5.6.19"
}
},
"node_modules/astral-regex": {
@@ -739,9 +858,9 @@
}
},
"node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==",
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
+ "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
"dev": true
},
"node_modules/balanced-match": {
@@ -750,6 +869,26 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -757,9 +896,9 @@
"dev": true
},
"node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"dev": true,
"dependencies": {
"balanced-match": "^1.0.0",
@@ -779,9 +918,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.23.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
- "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
+ "version": "4.24.4",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz",
+ "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==",
"dev": true,
"funding": [
{
@@ -798,10 +937,10 @@
}
],
"dependencies": {
- "caniuse-lite": "^1.0.30001587",
- "electron-to-chromium": "^1.4.668",
- "node-releases": "^2.0.14",
- "update-browserslist-db": "^1.0.13"
+ "caniuse-lite": "^1.0.30001688",
+ "electron-to-chromium": "^1.5.73",
+ "node-releases": "^2.0.19",
+ "update-browserslist-db": "^1.1.1"
},
"bin": {
"browserslist": "cli.js"
@@ -816,6 +955,30 @@
"integrity": "sha512-CTa0lv78dXKEgrYsOLCkqO+9UUS3CV9MWEOYHcymgEvx4mYxB80sCoKRCR7wW2SOMNxjaP9hohrZripjnKuRTA==",
"dev": true
},
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
"node_modules/builtin-modules": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
@@ -828,6 +991,25 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/cacheable": {
+ "version": "1.8.9",
+ "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-1.8.9.tgz",
+ "integrity": "sha512-FicwAUyWnrtnd4QqYAoRlNs44/a1jTL7XDKqm5gJ90wz1DQPlC7U2Rd1Tydpv+E7WAr4sQHuw8Q8M3nZMAyecQ==",
+ "dev": true,
+ "dependencies": {
+ "hookified": "^1.7.1",
+ "keyv": "^5.3.1"
+ }
+ },
+ "node_modules/cacheable/node_modules/keyv": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.3.2.tgz",
+ "integrity": "sha512-Lji2XRxqqa5Wg+CHLVfFKBImfJZ4pCSccu9eVWK6w4c2SDFLd8JAn1zqTuSFnsxb7ope6rMsnIHfp+eBbRBRZQ==",
+ "dev": true,
+ "dependencies": {
+ "@keyv/serialize": "^1.0.3"
+ }
+ },
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
@@ -838,9 +1020,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001610",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz",
- "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==",
+ "version": "1.0.30001707",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz",
+ "integrity": "sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==",
"dev": true,
"funding": [
{
@@ -874,9 +1056,9 @@
}
},
"node_modules/ci-info": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz",
- "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz",
+ "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==",
"dev": true,
"funding": [
{
@@ -972,12 +1154,12 @@
"dev": true
},
"node_modules/core-js-compat": {
- "version": "3.37.1",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz",
- "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==",
+ "version": "3.41.0",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.41.0.tgz",
+ "integrity": "sha512-RFsU9LySVue9RTwdDVX/T0e2Y6jRYWXERKElIjpuEOEnxaXffI0X7RUwVzfYLfzuLXSNJDYoRYUAmRUcyln20A==",
"dev": true,
"dependencies": {
- "browserslist": "^4.23.0"
+ "browserslist": "^4.24.4"
},
"funding": {
"type": "opencollective",
@@ -1017,9 +1199,9 @@
}
},
"node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
@@ -1031,9 +1213,9 @@
}
},
"node_modules/css-functions-list": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.2.tgz",
- "integrity": "sha512-c+N0v6wbKVxTu5gOBBFkr9BEdBWaqqjQeiJ8QvSRIJOf+UxlJh930m8e6/WNeODIK0mYLFkoONrnj16i2EcvfQ==",
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.3.tgz",
+ "integrity": "sha512-IQOkD3hbR5KrN93MtcYuad6YPuTSUhntLHDuLEbFWE+ff2/XSZNdZG+LcbbIW5AXKg/WFIfYItIzVoHngHXZzA==",
"dev": true,
"engines": {
"node": ">=12 || >=16"
@@ -1050,12 +1232,12 @@
}
},
"node_modules/css-tree": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
- "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.1.0.tgz",
+ "integrity": "sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==",
"dev": true,
"dependencies": {
- "mdn-data": "2.0.30",
+ "mdn-data": "2.12.2",
"source-map-js": "^1.0.1"
},
"engines": {
@@ -1084,12 +1266,12 @@
}
},
"node_modules/debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+ "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"dev": true,
"dependencies": {
- "ms": "2.1.2"
+ "ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
@@ -1140,20 +1322,19 @@
}
},
"node_modules/doiuse": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/doiuse/-/doiuse-6.0.2.tgz",
- "integrity": "sha512-eBTs23NOX+EAYPr4RbCR6J4DRW/TML3uMo37y0X1whlkersDYFCk9HmCl09KX98cis22VKsV1QaxfVNauJ3NBw==",
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/doiuse/-/doiuse-6.0.5.tgz",
+ "integrity": "sha512-ljuf9ndGqKST0GlPAYyCg04hbQAeR1xIIWVDjQaDDkoTY/Y1Vb+8FNoy6NuVuJIEEKe/nKUH8NRWjG7JJxZ9Eg==",
"dev": true,
"dependencies": {
- "browserslist": "^4.21.5",
- "caniuse-lite": "^1.0.30001487",
+ "browserslist": "^4.24.0",
+ "caniuse-lite": "^1.0.30001669",
"css-tokenize": "^1.0.1",
- "duplexify": "^4.1.2",
- "ldjson-stream": "^1.2.1",
+ "duplexify": "^4.1.3",
"multimatch": "^5.0.0",
- "postcss": "^8.4.21",
+ "postcss": "^8.4.47",
"source-map": "^0.7.4",
- "yargs": "^17.7.1"
+ "yargs": "^17.7.2"
},
"bin": {
"doiuse": "bin/cli.js"
@@ -1204,9 +1385,9 @@
}
},
"node_modules/domutils": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
- "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz",
+ "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==",
"dev": true,
"dependencies": {
"dom-serializer": "^2.0.0",
@@ -1253,9 +1434,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.4.737",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.737.tgz",
- "integrity": "sha512-QvLTxaLHKdy5YxvixAw/FfHq2eWLUL9KvsPjp0aHK1gI5d3EDuDgITkvj0nFO2c6zUY3ZqVAJQiBYyQP9tQpfw==",
+ "version": "1.5.128",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.128.tgz",
+ "integrity": "sha512-bo1A4HH/NS522Ws0QNFIzyPcyUUNV/yyy70Ho1xqfGYzPUme2F/xr4tlEOuM6/A538U1vDA7a4XfCd1CKRegKQ==",
"dev": true
},
"node_modules/emoji-regex": {
@@ -1274,9 +1455,9 @@
}
},
"node_modules/enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
+ "version": "5.18.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz",
+ "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
@@ -1317,9 +1498,9 @@
}
},
"node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
"dev": true,
"engines": {
"node": ">=6"
@@ -1338,16 +1519,17 @@
}
},
"node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
+ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
+ "@eslint/js": "8.57.1",
+ "@humanwhocodes/config-array": "^0.13.0",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
"@ungap/structured-clone": "^1.2.0",
@@ -1393,9 +1575,9 @@
}
},
"node_modules/eslint-compat-utils": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.0.tgz",
- "integrity": "sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==",
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz",
+ "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==",
"dev": true,
"dependencies": {
"semver": "^7.5.4"
@@ -1408,11 +1590,14 @@
}
},
"node_modules/eslint-config-wikimedia": {
- "version": "0.28.2",
- "resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
- "integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
+ "version": "0.31.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.31.0.tgz",
+ "integrity": "sha512-Z/t/zGPdxs/ehxb0EM6THNWAzueT7GtuqzjUvmBpkxcTKzZPJEXWnnpswdj/hgv8Ce8PIeDp0zwQxR4e3c9CIw==",
"dev": true,
"dependencies": {
+ "@stylistic/eslint-plugin": "^3.1.0",
+ "@typescript-eslint/eslint-plugin": "8.35.1",
+ "@typescript-eslint/parser": "8.35.1",
"browserslist-config-wikimedia": "^0.7.0",
"eslint": "^8.57.0",
"eslint-plugin-compat": "^4.2.0",
@@ -1423,13 +1608,16 @@
"eslint-plugin-mediawiki": "^0.7.0",
"eslint-plugin-mocha": "^10.4.3",
"eslint-plugin-n": "^17.7.0",
- "eslint-plugin-no-jquery": "^3.0.1",
+ "eslint-plugin-no-jquery": "^3.1.1",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-unicorn": "^53.0.0",
"eslint-plugin-vue": "^9.26.0",
"eslint-plugin-wdio": "^8.24.12",
"eslint-plugin-yml": "^1.14.0"
+ },
+ "engines": {
+ "node": ">=18 <25"
}
},
"node_modules/eslint-plugin-compat": {
@@ -1454,38 +1642,39 @@
}
},
"node_modules/eslint-plugin-es-x": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.6.0.tgz",
- "integrity": "sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==",
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz",
+ "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==",
"dev": true,
+ "funding": [
+ "https://github.com/sponsors/ota-meshi",
+ "https://opencollective.com/eslint"
+ ],
"dependencies": {
"@eslint-community/eslint-utils": "^4.1.2",
- "@eslint-community/regexpp": "^4.6.0",
- "eslint-compat-utils": "^0.5.0"
+ "@eslint-community/regexpp": "^4.11.0",
+ "eslint-compat-utils": "^0.5.1"
},
"engines": {
"node": "^14.18.0 || >=16.0.0"
},
- "funding": {
- "url": "https://github.com/sponsors/ota-meshi"
- },
"peerDependencies": {
"eslint": ">=8"
}
},
"node_modules/eslint-plugin-jest": {
- "version": "28.5.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.5.0.tgz",
- "integrity": "sha512-6np6DGdmNq/eBbA7HOUNV8fkfL86PYwBfwyb8n23FXgJNTR8+ot3smRHjza9LGsBBZRypK3qyF79vMjohIL8eQ==",
+ "version": "28.11.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz",
+ "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==",
"dev": true,
"dependencies": {
- "@typescript-eslint/utils": "^6.0.0 || ^7.0.0"
+ "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0"
},
"engines": {
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
},
"peerDependencies": {
- "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0",
+ "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0",
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0",
"jest": "*"
},
@@ -1548,9 +1737,9 @@
}
},
"node_modules/eslint-plugin-mocha": {
- "version": "10.4.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.3.tgz",
- "integrity": "sha512-emc4TVjq5Ht0/upR+psftuz6IBG5q279p+1dSRDeHf+NS9aaerBi3lXKo1SEzwC29hFIW21gO89CEWSvRsi8IQ==",
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.5.0.tgz",
+ "integrity": "sha512-F2ALmQVPT1GoP27O1JTZGrV9Pqg8k79OeIuvw63UxMtQKREZtmkK1NFgkZQ2TW7L2JSSFKHFPTtHu5z8R9QNRw==",
"dev": true,
"dependencies": {
"eslint-utils": "^3.0.0",
@@ -1565,19 +1754,19 @@
}
},
"node_modules/eslint-plugin-n": {
- "version": "17.8.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.8.0.tgz",
- "integrity": "sha512-XefSXUtrnA2R4L0NGLZP2Nq8fCk3ffrg6oALXMLiZFKTlwUIu23tIe4loxEbdO2wtLqO2sU70m5Fm3bj9zdGSg==",
+ "version": "17.17.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.17.0.tgz",
+ "integrity": "sha512-2VvPK7Mo73z1rDFb6pTvkH6kFibAmnTubFq5l83vePxu0WiY1s0LOtj2WHb6Sa40R3w4mnh8GFYbHBQyMlotKw==",
"dev": true,
"dependencies": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "enhanced-resolve": "^5.17.0",
- "eslint-plugin-es-x": "^7.5.0",
- "get-tsconfig": "^4.7.0",
- "globals": "^15.0.0",
- "ignore": "^5.2.4",
- "minimatch": "^9.0.0",
- "semver": "^7.5.3"
+ "@eslint-community/eslint-utils": "^4.5.0",
+ "enhanced-resolve": "^5.17.1",
+ "eslint-plugin-es-x": "^7.8.0",
+ "get-tsconfig": "^4.8.1",
+ "globals": "^15.11.0",
+ "ignore": "^5.3.2",
+ "minimatch": "^9.0.5",
+ "semver": "^7.6.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1590,18 +1779,18 @@
}
},
"node_modules/eslint-plugin-n/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
"dev": true,
"dependencies": {
"balanced-match": "^1.0.0"
}
},
"node_modules/eslint-plugin-n/node_modules/globals": {
- "version": "15.3.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-15.3.0.tgz",
- "integrity": "sha512-cCdyVjIUVTtX8ZsPkq1oCsOsLmGIswqnjZYMJJTGaNApj1yHtLSymKhwH51ttirREn75z3p4k051clwg7rvNKA==",
+ "version": "15.15.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
+ "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==",
"dev": true,
"engines": {
"node": ">=18"
@@ -1611,12 +1800,12 @@
}
},
"node_modules/eslint-plugin-n/node_modules/minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
"dev": true,
"dependencies": {
- "brace-expansion": "^2.0.1"
+ "brace-expansion": "^2.0.2"
},
"engines": {
"node": ">=16 || 14 >=14.17"
@@ -1626,18 +1815,18 @@
}
},
"node_modules/eslint-plugin-no-jquery": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.1.tgz",
- "integrity": "sha512-GrzdjIxox/3x8hpSwpxiMuEQFipiJHTGiVsp0T1TI6GH+KVSbXa4z/56xTV1WiIe66u3iRgvCIipu9CRthecpQ==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.1.1.tgz",
+ "integrity": "sha512-LTLO3jH/Tjr1pmxCEqtV6qmt+OChv8La4fwgG470JRpgxyFF4NOzoC9CRy92GIWD3Yjl0qLEgPmD2FLQWcNEjg==",
"dev": true,
"peerDependencies": {
"eslint": ">=8.0.0"
}
},
"node_modules/eslint-plugin-qunit": {
- "version": "8.1.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-qunit/-/eslint-plugin-qunit-8.1.1.tgz",
- "integrity": "sha512-j3xhiAf2Wvr8Dfwl5T6tlJ+F55vqYE9ZdAHUOTzq1lGerYrXzOS46RvK4SSWug2D8sl3ZYr2lA4/hgVXgLloxw==",
+ "version": "8.1.2",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-qunit/-/eslint-plugin-qunit-8.1.2.tgz",
+ "integrity": "sha512-2gDQdHlQW8GVXD7YYkO8vbm9Ldc60JeGMuQN5QlD48OeZ8znBvvoHWZZMeXjvoDPReGaLEvyuWrDtrI8bDbcqw==",
"dev": true,
"dependencies": {
"eslint-utils": "^3.0.0",
@@ -1690,9 +1879,9 @@
}
},
"node_modules/eslint-plugin-unicorn/node_modules/@eslint/eslintrc": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz",
- "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",
+ "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==",
"dev": true,
"dependencies": {
"ajv": "^6.12.4",
@@ -1713,9 +1902,9 @@
}
},
"node_modules/eslint-plugin-unicorn/node_modules/eslint-visitor-keys": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz",
- "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+ "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1725,14 +1914,14 @@
}
},
"node_modules/eslint-plugin-unicorn/node_modules/espree": {
- "version": "10.0.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz",
- "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==",
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
+ "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
"dev": true,
"dependencies": {
- "acorn": "^8.11.3",
+ "acorn": "^8.14.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^4.0.0"
+ "eslint-visitor-keys": "^4.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1754,9 +1943,9 @@
}
},
"node_modules/eslint-plugin-vue": {
- "version": "9.26.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.26.0.tgz",
- "integrity": "sha512-eTvlxXgd4ijE1cdur850G6KalZqk65k1JKoOI2d1kT3hr8sPD07j1q98FRFdNnpxBELGPWxZmInxeHGF/GxtqQ==",
+ "version": "9.33.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.33.0.tgz",
+ "integrity": "sha512-174lJKuNsuDIlLpjeXc5E2Tss8P44uIimAfGD0b90k0NoirJqpG7stLuU9Vp/9ioTOrQdWVREc4mRd1BD+CvGw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
@@ -1764,8 +1953,8 @@
"natural-compare": "^1.4.0",
"nth-check": "^2.1.1",
"postcss-selector-parser": "^6.0.15",
- "semver": "^7.6.0",
- "vue-eslint-parser": "^9.4.2",
+ "semver": "^7.6.3",
+ "vue-eslint-parser": "^9.4.3",
"xml-name-validator": "^4.0.0"
},
"engines": {
@@ -1776,23 +1965,23 @@
}
},
"node_modules/eslint-plugin-wdio": {
- "version": "8.24.12",
- "resolved": "https://registry.npmjs.org/eslint-plugin-wdio/-/eslint-plugin-wdio-8.24.12.tgz",
- "integrity": "sha512-OmzGteXFOQnJDdkTNnTfksaVa18WlFCyeLjZXHvDpkbomLWAg9wc296Pr0wnTCagqNj8qfEHpy+N2XVew5VCMA==",
+ "version": "8.37.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-wdio/-/eslint-plugin-wdio-8.37.0.tgz",
+ "integrity": "sha512-X217zXxSqj1IPWu3bxN7D/xEUmNk7Jg5lBf2JwYH3mCogaqL2tnHZnwt0EQ5D9oEejfEl2+4zqHSzhXq1X7F2A==",
"dev": true,
"engines": {
"node": "^16.13 || >=18"
}
},
"node_modules/eslint-plugin-yml": {
- "version": "1.14.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.14.0.tgz",
- "integrity": "sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ==",
+ "version": "1.17.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.17.0.tgz",
+ "integrity": "sha512-Q3LXFRnNpGYAK/PM0BY1Xs0IY1xTLfM0kC986nNQkx1l8tOGz+YS50N6wXkAJkrBpeUN9OxEMB7QJ+9MTDAqIQ==",
"dev": true,
"dependencies": {
"debug": "^4.3.2",
- "eslint-compat-utils": "^0.5.0",
- "lodash": "^4.17.21",
+ "escape-string-regexp": "4.0.0",
+ "eslint-compat-utils": "^0.6.0",
"natural-compare": "^1.4.0",
"yaml-eslint-parser": "^1.2.1"
},
@@ -1806,6 +1995,21 @@
"eslint": ">=6.0.0"
}
},
+ "node_modules/eslint-plugin-yml/node_modules/eslint-compat-utils": {
+ "version": "0.6.4",
+ "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.4.tgz",
+ "integrity": "sha512-/u+GQt8NMfXO8w17QendT4gvO5acfxQsAKirAt0LVxDnr2N8YLCVbregaNc/Yhp7NM128DwCaRvr8PLDfeNkQw==",
+ "dev": true,
+ "dependencies": {
+ "semver": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "peerDependencies": {
+ "eslint": ">=6.0.0"
+ }
+ },
"node_modules/eslint-scope": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
@@ -1892,9 +2096,9 @@
}
},
"node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz",
+ "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==",
"dev": true,
"dependencies": {
"estraverse": "^5.1.0"
@@ -1973,16 +2177,16 @@
"dev": true
},
"node_modules/fast-glob": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
- "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
- "micromatch": "^4.0.4"
+ "micromatch": "^4.0.8"
},
"engines": {
"node": ">=8.6.0"
@@ -2012,6 +2216,22 @@
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
+ "node_modules/fast-uri": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
+ "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ]
+ },
"node_modules/fastest-levenshtein": {
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz",
@@ -2022,9 +2242,9 @@
}
},
"node_modules/fastq": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
- "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
+ "version": "1.19.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
+ "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
@@ -2042,12 +2262,6 @@
"node": "^10.12.0 || >=12.0.0"
}
},
- "node_modules/file-sync-cmp": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",
- "integrity": "sha512-0k45oWBokCqh2MOexeYKpyqmGKG+8mQ2Wd8iawx+uWd/weWJQAZ6SoPybagdCI4xFisag8iAR77WPm4h3pTfxA==",
- "dev": true
- },
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
@@ -2131,9 +2345,9 @@
}
},
"node_modules/flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
+ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
"dev": true
},
"node_modules/for-in": {
@@ -2182,9 +2396,9 @@
}
},
"node_modules/get-tsconfig": {
- "version": "4.7.5",
- "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz",
- "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==",
+ "version": "4.10.0",
+ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz",
+ "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==",
"dev": true,
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
@@ -2206,6 +2420,7 @@
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "deprecated": "Glob versions prior to v9 are no longer supported",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
@@ -2235,29 +2450,33 @@
}
},
"node_modules/global-modules": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
- "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
"dev": true,
"dependencies": {
- "global-prefix": "^3.0.0"
+ "global-prefix": "^1.0.1",
+ "is-windows": "^1.0.1",
+ "resolve-dir": "^1.0.0"
},
"engines": {
- "node": ">=6"
+ "node": ">=0.10.0"
}
},
"node_modules/global-prefix": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
- "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
+ "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==",
"dev": true,
"dependencies": {
- "ini": "^1.3.5",
- "kind-of": "^6.0.2",
- "which": "^1.3.1"
+ "expand-tilde": "^2.0.2",
+ "homedir-polyfill": "^1.0.1",
+ "ini": "^1.3.4",
+ "is-windows": "^1.0.1",
+ "which": "^1.2.14"
},
"engines": {
- "node": ">=6"
+ "node": ">=0.10.0"
}
},
"node_modules/global-prefix/node_modules/which": {
@@ -2399,146 +2618,29 @@
"nopt": "bin/nopt.js"
}
},
- "node_modules/grunt-contrib-clean": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.1.tgz",
- "integrity": "sha512-uRvnXfhiZt8akb/ZRDHJpQQtkkVkqc/opWO4Po/9ehC2hPxgptB9S6JHDC/Nxswo4CJSM0iFPT/Iym3cEMWzKA==",
+ "node_modules/grunt-eslint": {
+ "version": "24.3.0",
+ "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz",
+ "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==",
"dev": true,
"dependencies": {
- "async": "^3.2.3",
- "rimraf": "^2.6.2"
+ "chalk": "^4.1.2",
+ "eslint": "^8.44.0"
},
"engines": {
"node": ">=12"
},
- "peerDependencies": {
- "grunt": ">=0.4.5"
- }
- },
- "node_modules/grunt-contrib-clean/node_modules/rimraf": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
- "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
},
- "bin": {
- "rimraf": "bin.js"
+ "peerDependencies": {
+ "grunt": ">=1"
}
},
- "node_modules/grunt-contrib-copy": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
- "integrity": "sha512-gFRFUB0ZbLcjKb67Magz1yOHGBkyU6uL29hiEW1tdQ9gQt72NuMKIy/kS6dsCbV0cZ0maNCb0s6y+uT1FKU7jA==",
- "dev": true,
- "dependencies": {
- "chalk": "^1.1.1",
- "file-sync-cmp": "^0.1.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
- "dev": true,
- "dependencies": {
- "ansi-regex": "^2.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/grunt-contrib-copy/node_modules/supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
- },
- "node_modules/grunt-eslint": {
- "version": "24.3.0",
- "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz",
- "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==",
- "dev": true,
- "dependencies": {
- "chalk": "^4.1.2",
- "eslint": "^8.44.0"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- },
- "peerDependencies": {
- "grunt": ">=1"
- }
- },
- "node_modules/grunt-exec": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-3.0.0.tgz",
- "integrity": "sha512-cgAlreXf3muSYS5LzW0Cc4xHK03BjFOYk0MqCQ/MZ3k1Xz2GU7D+IAJg4UKicxpO+XdONJdx/NJ6kpy2wI+uHg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- },
- "peerDependencies": {
- "grunt": ">=0.4"
- }
- },
- "node_modules/grunt-known-options": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz",
- "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==",
+ "node_modules/grunt-known-options": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz",
+ "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -2615,9 +2717,9 @@
}
},
"node_modules/grunt/node_modules/js-yaml": {
- "version": "3.14.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
- "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+ "version": "3.14.2",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",
+ "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",
"dev": true,
"dependencies": {
"argparse": "^1.0.7",
@@ -2645,27 +2747,6 @@
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true
},
- "node_modules/has-ansi": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
- "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==",
- "dev": true,
- "dependencies": {
- "ansi-regex": "^2.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/has-ansi/node_modules/ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -2676,9 +2757,9 @@
}
},
"node_modules/hasown": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
- "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.2"
@@ -2708,6 +2789,12 @@
"node": "*"
}
},
+ "node_modules/hookified": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.8.1.tgz",
+ "integrity": "sha512-GrO2l93P8xCWBSTBX9l2BxI78VU/MAAYag+pG8curS3aBGy0++ZlxrQ7PdUOUVMbn5BwkGb6+eRrnf43ipnFEA==",
+ "dev": true
+ },
"node_modules/hosted-git-info": {
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
@@ -2757,19 +2844,39 @@
"node": ">=0.10.0"
}
},
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
"node_modules/ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
"dev": true,
"dependencies": {
"parent-module": "^1.0.0",
@@ -2804,6 +2911,7 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
"dev": true,
"dependencies": {
"once": "^1.3.0",
@@ -2863,12 +2971,15 @@
}
},
"node_modules/is-core-module": {
- "version": "2.13.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
- "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
+ "version": "2.16.1",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
+ "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
"dev": true,
"dependencies": {
- "hasown": "^2.0.0"
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@@ -2995,9 +3106,9 @@
"dev": true
},
"node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"dependencies": {
"argparse": "^2.0.1"
@@ -3016,9 +3127,9 @@
}
},
"node_modules/jsesc": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
- "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
"dev": true,
"bin": {
"jsesc": "bin/jsesc"
@@ -3070,21 +3181,11 @@
}
},
"node_modules/known-css-properties": {
- "version": "0.31.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.31.0.tgz",
- "integrity": "sha512-sBPIUGTNF0czz0mwGGUoKKJC8Q7On1GPbCSFPfyEsfHb2DyBG0Y4QtV+EVWpINSaiGKZblDNuF5AezxSgOhesQ==",
+ "version": "0.35.0",
+ "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.35.0.tgz",
+ "integrity": "sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==",
"dev": true
},
- "node_modules/ldjson-stream": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ldjson-stream/-/ldjson-stream-1.2.1.tgz",
- "integrity": "sha512-xw/nNEXafuPSLu8NjjG3+atVVw+8U1APZAQylmwQn19Hgw6rC7QjHvP6MupnHWCrzSm9m0xs5QWkCLuRvBPjgQ==",
- "dev": true,
- "dependencies": {
- "split2": "^0.2.1",
- "through2": "^0.6.1"
- }
- },
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -3154,9 +3255,9 @@
}
},
"node_modules/lodash": {
- "version": "4.17.21",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
+ "version": "4.17.23",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
+ "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"dev": true
},
"node_modules/lodash.memoize": {
@@ -3209,9 +3310,9 @@
}
},
"node_modules/mdn-data": {
- "version": "2.0.30",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
- "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
+ "version": "2.12.2",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz",
+ "integrity": "sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==",
"dev": true
},
"node_modules/meow": {
@@ -3258,9 +3359,9 @@
}
},
"node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"dev": true,
"dependencies": {
"brace-expansion": "^1.1.7"
@@ -3270,9 +3371,9 @@
}
},
"node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true
},
"node_modules/multimatch": {
@@ -3295,9 +3396,9 @@
}
},
"node_modules/nanoid": {
- "version": "3.3.7",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+ "version": "3.3.11",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
"dev": true,
"funding": [
{
@@ -3319,9 +3420,9 @@
"dev": true
},
"node_modules/node-releases": {
- "version": "2.0.14",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
- "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==",
+ "version": "2.0.19",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz",
+ "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==",
"dev": true
},
"node_modules/nopt": {
@@ -3428,17 +3529,17 @@
}
},
"node_modules/optionator": {
- "version": "0.9.3",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
- "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
+ "version": "0.9.4",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
+ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
"dev": true,
"dependencies": {
- "@aashutoshrathi/word-wrap": "^1.2.3",
"deep-is": "^0.1.3",
"fast-levenshtein": "^2.0.6",
"levn": "^0.4.1",
"prelude-ls": "^1.2.1",
- "type-check": "^0.4.0"
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.5"
},
"engines": {
"node": ">= 0.8.0"
@@ -3466,6 +3567,7 @@
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
+ "deprecated": "This package is no longer supported.",
"dev": true,
"dependencies": {
"os-homedir": "^1.0.0",
@@ -3628,9 +3730,9 @@
}
},
"node_modules/picocolors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"dev": true
},
"node_modules/picomatch": {
@@ -3655,9 +3757,9 @@
}
},
"node_modules/postcss": {
- "version": "8.4.38",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
- "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
+ "version": "8.5.3",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
+ "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
"dev": true,
"funding": [
{
@@ -3674,22 +3776,22 @@
}
],
"dependencies": {
- "nanoid": "^3.3.7",
- "picocolors": "^1.0.0",
- "source-map-js": "^1.2.0"
+ "nanoid": "^3.3.8",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/postcss-html": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-1.6.0.tgz",
- "integrity": "sha512-OWgQ9/Pe23MnNJC0PL4uZp8k0EDaUvqpJFSiwFxOLClAhmD7UEisyhO3x5hVsD4xFrjReVTXydlrMes45dJ71w==",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-1.7.0.tgz",
+ "integrity": "sha512-MfcMpSUIaR/nNgeVS8AyvyDugXlADjN9AcV7e5rDfrF1wduIAGSkL4q2+wgrZgA3sHVAHLDO9FuauHhZYW2nBw==",
"dev": true,
"dependencies": {
"htmlparser2": "^8.0.0",
- "js-tokens": "^8.0.0",
+ "js-tokens": "^9.0.0",
"postcss": "^8.4.0",
"postcss-safe-parser": "^6.0.0"
},
@@ -3698,9 +3800,9 @@
}
},
"node_modules/postcss-html/node_modules/js-tokens": {
- "version": "8.0.3",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz",
- "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==",
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz",
+ "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==",
"dev": true
},
"node_modules/postcss-html/node_modules/postcss-safe-parser": {
@@ -3732,15 +3834,15 @@
}
},
"node_modules/postcss-resolve-nested-selector": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz",
- "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==",
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz",
+ "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==",
"dev": true
},
"node_modules/postcss-safe-parser": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.0.0.tgz",
- "integrity": "sha512-ovehqRNVCpuFzbXoTb4qLtyzK3xn3t/CUBxOs8LsnQjQrShaB4lKiHoVqY8ANaC0hBMHq5QVWk77rwGklFUDrg==",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.0.1.tgz",
+ "integrity": "sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A==",
"dev": true,
"funding": [
{
@@ -3764,9 +3866,9 @@
}
},
"node_modules/postcss-selector-parser": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz",
- "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==",
+ "version": "6.1.2",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
+ "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==",
"dev": true,
"dependencies": {
"cssesc": "^3.0.0",
@@ -3792,9 +3894,9 @@
}
},
"node_modules/punycode": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true,
"engines": {
"node": ">=6"
@@ -4010,18 +4112,21 @@
}
},
"node_modules/resolve": {
- "version": "1.22.8",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
- "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
+ "version": "1.22.10",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
+ "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==",
"dev": true,
"dependencies": {
- "is-core-module": "^2.13.0",
+ "is-core-module": "^2.16.0",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"bin": {
"resolve": "bin/resolve"
},
+ "engines": {
+ "node": ">= 0.4"
+ },
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -4039,48 +4144,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/resolve-dir/node_modules/global-modules": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
- "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
- "dev": true,
- "dependencies": {
- "global-prefix": "^1.0.1",
- "is-windows": "^1.0.1",
- "resolve-dir": "^1.0.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve-dir/node_modules/global-prefix": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
- "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
- "dev": true,
- "dependencies": {
- "expand-tilde": "^2.0.2",
- "homedir-polyfill": "^1.0.1",
- "ini": "^1.3.4",
- "is-windows": "^1.0.1",
- "which": "^1.2.14"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve-dir/node_modules/which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "which": "bin/which"
- }
- },
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@@ -4100,9 +4163,9 @@
}
},
"node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
"dev": true,
"engines": {
"iojs": ">=1.0.0",
@@ -4113,6 +4176,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
+ "deprecated": "Rimraf versions prior to v4 are no longer supported",
"dev": true,
"dependencies": {
"glob": "^7.1.3"
@@ -4183,9 +4247,9 @@
"dev": true
},
"node_modules/semver": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
- "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
+ "version": "7.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
+ "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
"dev": true,
"bin": {
"semver": "bin/semver.js"
@@ -4263,9 +4327,9 @@
}
},
"node_modules/source-map-js": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
- "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -4308,24 +4372,15 @@
}
},
"node_modules/spdx-license-ids": {
- "version": "3.0.18",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz",
- "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==",
+ "version": "3.0.21",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz",
+ "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==",
"dev": true
},
- "node_modules/split2": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz",
- "integrity": "sha512-D/oTExYAkC9nWleOCTOyNmAuzfAT/6rHGBA9LIK7FVnGo13CSvrKCUzKenwH6U1s2znY9MqH6v0UQTEDa3vJmg==",
- "dev": true,
- "dependencies": {
- "through2": "~0.6.1"
- }
- },
"node_modules/sprintf-js": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
- "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
+ "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==",
"dev": true
},
"node_modules/stream-shift": {
@@ -4397,9 +4452,9 @@
"dev": true
},
"node_modules/stylelint": {
- "version": "16.6.1",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.6.1.tgz",
- "integrity": "sha512-yNgz2PqWLkhH2hw6X9AweV9YvoafbAD5ZsFdKN9BvSDVwGvPh+AUIrn7lYwy1S7IHmtFin75LLfX1m0D2tHu8Q==",
+ "version": "16.17.0",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.17.0.tgz",
+ "integrity": "sha512-I9OwVIWRMqVm2Br5iTbrfSqGRPWQUlvm6oXO1xZuYYu0Gpduy67N8wXOZv15p6E/JdlZiAtQaIoLKZEWk5hrjw==",
"dev": true,
"funding": [
{
@@ -4412,44 +4467,43 @@
}
],
"dependencies": {
- "@csstools/css-parser-algorithms": "^2.6.3",
- "@csstools/css-tokenizer": "^2.3.1",
- "@csstools/media-query-list-parser": "^2.1.11",
- "@csstools/selector-specificity": "^3.1.1",
+ "@csstools/css-parser-algorithms": "^3.0.4",
+ "@csstools/css-tokenizer": "^3.0.3",
+ "@csstools/media-query-list-parser": "^4.0.2",
+ "@csstools/selector-specificity": "^5.0.0",
"@dual-bundle/import-meta-resolve": "^4.1.0",
"balanced-match": "^2.0.0",
"colord": "^2.9.3",
"cosmiconfig": "^9.0.0",
- "css-functions-list": "^3.2.2",
- "css-tree": "^2.3.1",
- "debug": "^4.3.4",
- "fast-glob": "^3.3.2",
+ "css-functions-list": "^3.2.3",
+ "css-tree": "^3.1.0",
+ "debug": "^4.3.7",
+ "fast-glob": "^3.3.3",
"fastest-levenshtein": "^1.0.16",
- "file-entry-cache": "^9.0.0",
+ "file-entry-cache": "^10.0.7",
"global-modules": "^2.0.0",
"globby": "^11.1.0",
"globjoin": "^0.1.4",
"html-tags": "^3.3.1",
- "ignore": "^5.3.1",
+ "ignore": "^7.0.3",
"imurmurhash": "^0.1.4",
"is-plain-object": "^5.0.0",
- "known-css-properties": "^0.31.0",
+ "known-css-properties": "^0.35.0",
"mathml-tag-names": "^2.1.3",
"meow": "^13.2.0",
- "micromatch": "^4.0.7",
+ "micromatch": "^4.0.8",
"normalize-path": "^3.0.0",
- "picocolors": "^1.0.1",
- "postcss": "^8.4.38",
- "postcss-resolve-nested-selector": "^0.1.1",
- "postcss-safe-parser": "^7.0.0",
- "postcss-selector-parser": "^6.1.0",
+ "picocolors": "^1.1.1",
+ "postcss": "^8.5.3",
+ "postcss-resolve-nested-selector": "^0.1.6",
+ "postcss-safe-parser": "^7.0.1",
+ "postcss-selector-parser": "^7.1.0",
"postcss-value-parser": "^4.2.0",
"resolve-from": "^5.0.0",
"string-width": "^4.2.3",
- "strip-ansi": "^7.1.0",
- "supports-hyperlinks": "^3.0.0",
+ "supports-hyperlinks": "^3.2.0",
"svg-tags": "^1.0.0",
- "table": "^6.8.2",
+ "table": "^6.9.0",
"write-file-atomic": "^5.0.1"
},
"bin": {
@@ -4460,46 +4514,66 @@
}
},
"node_modules/stylelint-config-recommended": {
- "version": "14.0.0",
- "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-14.0.0.tgz",
- "integrity": "sha512-jSkx290CglS8StmrLp2TxAppIajzIBZKYm3IxT89Kg6fGlxbPiTiyH9PS5YUuVAFwaJLl1ikiXX0QWjI0jmgZQ==",
+ "version": "14.0.1",
+ "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-14.0.1.tgz",
+ "integrity": "sha512-bLvc1WOz/14aPImu/cufKAZYfXs/A/owZfSMZ4N+16WGXLoX5lOir53M6odBxvhgmgdxCVnNySJmZKx73T93cg==",
"dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stylelint"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/stylelint"
+ }
+ ],
"engines": {
"node": ">=18.12.0"
},
"peerDependencies": {
- "stylelint": "^16.0.0"
+ "stylelint": "^16.1.0"
}
},
"node_modules/stylelint-config-wikimedia": {
- "version": "0.17.2",
- "resolved": "https://registry.npmjs.org/stylelint-config-wikimedia/-/stylelint-config-wikimedia-0.17.2.tgz",
- "integrity": "sha512-cc3PYhe1O/GTgsMOp+Ri3ru579YBbZ3Me0oU7xNb06n4iwyXYPz8qO5G4iQ13UH19UW2NIS8Tk0goPRrJ1RAfw==",
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-wikimedia/-/stylelint-config-wikimedia-0.18.0.tgz",
+ "integrity": "sha512-Lr45NIe7pG8i7BPcMc6EddO1pRK8/KNG8gp4o/oOG1Ez10hglJuJb/QT17BlzX8NPkhtP2KdY63NS2f/Wcj6Ww==",
"dev": true,
"dependencies": {
- "@stylistic/stylelint-config": "1.0.1",
- "@stylistic/stylelint-plugin": "2.0.0",
+ "@stylistic/stylelint-config": "2.0.0",
+ "@stylistic/stylelint-plugin": "3.1.1",
"browserslist-config-wikimedia": "0.7.0",
- "postcss-html": "1.6.0",
+ "postcss-html": "1.7.0",
"postcss-less": "6.0.0",
- "stylelint": "16.2.0",
- "stylelint-config-recommended": "14.0.0",
- "stylelint-no-unsupported-browser-features": "8.0.1"
+ "stylelint": "16.12.0",
+ "stylelint-config-recommended": "14.0.1",
+ "stylelint-no-unsupported-browser-features": "8.0.2"
},
"peerDependencies": {
"postcss-less": "^6.0.0"
}
},
- "node_modules/stylelint-config-wikimedia/node_modules/ansi-regex": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
- "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
+ "node_modules/stylelint-config-wikimedia/node_modules/@csstools/selector-specificity": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz",
+ "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==",
"dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
"engines": {
- "node": ">=12"
+ "node": ">=18"
},
- "funding": {
- "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ "peerDependencies": {
+ "postcss-selector-parser": "^7.0.0"
}
},
"node_modules/stylelint-config-wikimedia/node_modules/balanced-match": {
@@ -4509,112 +4583,149 @@
"dev": true
},
"node_modules/stylelint-config-wikimedia/node_modules/file-entry-cache": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
- "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.1.0.tgz",
+ "integrity": "sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg==",
"dev": true,
"dependencies": {
- "flat-cache": "^4.0.0"
+ "flat-cache": "^5.0.0"
},
"engines": {
- "node": ">=16.0.0"
+ "node": ">=18"
}
},
"node_modules/stylelint-config-wikimedia/node_modules/flat-cache": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
- "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz",
+ "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==",
"dev": true,
"dependencies": {
- "flatted": "^3.2.9",
+ "flatted": "^3.3.1",
"keyv": "^4.5.4"
},
"engines": {
- "node": ">=16"
+ "node": ">=18"
}
},
- "node_modules/stylelint-config-wikimedia/node_modules/is-plain-object": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
- "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "node_modules/stylelint-config-wikimedia/node_modules/global-modules": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
+ "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
"dev": true,
+ "dependencies": {
+ "global-prefix": "^3.0.0"
+ },
"engines": {
- "node": ">=0.10.0"
+ "node": ">=6"
}
},
- "node_modules/stylelint-config-wikimedia/node_modules/known-css-properties": {
- "version": "0.29.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz",
- "integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==",
- "dev": true
- },
- "node_modules/stylelint-config-wikimedia/node_modules/resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "node_modules/stylelint-config-wikimedia/node_modules/global-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+ "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
"dev": true,
+ "dependencies": {
+ "ini": "^1.3.5",
+ "kind-of": "^6.0.2",
+ "which": "^1.3.1"
+ },
"engines": {
- "node": ">=8"
+ "node": ">=6"
}
},
- "node_modules/stylelint-config-wikimedia/node_modules/strip-ansi": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
- "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "node_modules/stylelint-config-wikimedia/node_modules/ignore": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-6.0.2.tgz",
+ "integrity": "sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/stylelint-config-wikimedia/node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/stylelint-config-wikimedia/node_modules/postcss-selector-parser": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz",
+ "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
"dev": true,
"dependencies": {
- "ansi-regex": "^6.0.1"
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
},
"engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ "node": ">=4"
+ }
+ },
+ "node_modules/stylelint-config-wikimedia/node_modules/resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
}
},
"node_modules/stylelint-config-wikimedia/node_modules/stylelint": {
- "version": "16.2.0",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.2.0.tgz",
- "integrity": "sha512-gwqU5AkIb52wrAzzn+359S3NIJDMl02TXLUaV2tzA/L6jUdpTwNt+MCxHlc8+Hb2bUHlYVo92YeSIryF2gJthA==",
+ "version": "16.12.0",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.12.0.tgz",
+ "integrity": "sha512-F8zZ3L/rBpuoBZRvI4JVT20ZanPLXfQLzMOZg1tzPflRVh9mKpOZ8qcSIhh1my3FjAjZWG4T2POwGnmn6a6hbg==",
"dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/stylelint"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/stylelint"
+ }
+ ],
"dependencies": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/media-query-list-parser": "^2.1.7",
- "@csstools/selector-specificity": "^3.0.1",
+ "@csstools/css-parser-algorithms": "^3.0.4",
+ "@csstools/css-tokenizer": "^3.0.3",
+ "@csstools/media-query-list-parser": "^4.0.2",
+ "@csstools/selector-specificity": "^5.0.0",
+ "@dual-bundle/import-meta-resolve": "^4.1.0",
"balanced-match": "^2.0.0",
"colord": "^2.9.3",
"cosmiconfig": "^9.0.0",
- "css-functions-list": "^3.2.1",
- "css-tree": "^2.3.1",
- "debug": "^4.3.4",
+ "css-functions-list": "^3.2.3",
+ "css-tree": "^3.0.1",
+ "debug": "^4.3.7",
"fast-glob": "^3.3.2",
"fastest-levenshtein": "^1.0.16",
- "file-entry-cache": "^8.0.0",
+ "file-entry-cache": "^9.1.0",
"global-modules": "^2.0.0",
"globby": "^11.1.0",
"globjoin": "^0.1.4",
"html-tags": "^3.3.1",
- "ignore": "^5.3.0",
+ "ignore": "^6.0.2",
"imurmurhash": "^0.1.4",
"is-plain-object": "^5.0.0",
- "known-css-properties": "^0.29.0",
+ "known-css-properties": "^0.35.0",
"mathml-tag-names": "^2.1.3",
- "meow": "^13.1.0",
- "micromatch": "^4.0.5",
+ "meow": "^13.2.0",
+ "micromatch": "^4.0.8",
"normalize-path": "^3.0.0",
- "picocolors": "^1.0.0",
- "postcss": "^8.4.33",
- "postcss-resolve-nested-selector": "^0.1.1",
- "postcss-safe-parser": "^7.0.0",
- "postcss-selector-parser": "^6.0.15",
+ "picocolors": "^1.1.1",
+ "postcss": "^8.4.49",
+ "postcss-resolve-nested-selector": "^0.1.6",
+ "postcss-safe-parser": "^7.0.1",
+ "postcss-selector-parser": "^7.0.0",
"postcss-value-parser": "^4.2.0",
"resolve-from": "^5.0.0",
"string-width": "^4.2.3",
- "strip-ansi": "^7.1.0",
- "supports-hyperlinks": "^3.0.0",
+ "supports-hyperlinks": "^3.1.0",
"svg-tags": "^1.0.0",
- "table": "^6.8.1",
+ "table": "^6.9.0",
"write-file-atomic": "^5.0.1"
},
"bin": {
@@ -4622,19 +4733,27 @@
},
"engines": {
"node": ">=18.12.0"
+ }
+ },
+ "node_modules/stylelint-config-wikimedia/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "dev": true,
+ "dependencies": {
+ "isexe": "^2.0.0"
},
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/stylelint"
+ "bin": {
+ "which": "bin/which"
}
},
"node_modules/stylelint-no-unsupported-browser-features": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/stylelint-no-unsupported-browser-features/-/stylelint-no-unsupported-browser-features-8.0.1.tgz",
- "integrity": "sha512-tc8Xn5DaqJhxTmbA4H8gZbYdAz027NfuSZv5+cVieQb7BtBrF/1/iKYdpcGwXPl3GtqkQrisiXuGqKkKnzWcLw==",
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/stylelint-no-unsupported-browser-features/-/stylelint-no-unsupported-browser-features-8.0.2.tgz",
+ "integrity": "sha512-4PY2qJ3ZTEje9RgGfaQ82eJoPioXxs6hazeKpji/wzLNVzTX2wd4b0Ds3ewdLkH3ID+o63IInuTquU2MNJO3YQ==",
"dev": true,
"dependencies": {
- "doiuse": "^6.0.2",
+ "doiuse": "^6.0.5",
"postcss": "^8.4.32"
},
"engines": {
@@ -4644,16 +4763,26 @@
"stylelint": "^16.0.2"
}
},
- "node_modules/stylelint/node_modules/ansi-regex": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
- "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
+ "node_modules/stylelint/node_modules/@csstools/selector-specificity": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz",
+ "integrity": "sha512-PCqQV3c4CoVm3kdPhyeZ07VmBRdH2EpMFA/pd9OASpOEC3aXNGoqPDAZ80D0cLpMBxnmk0+yNhGsEx31hq7Gtw==",
"dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/csstools"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/csstools"
+ }
+ ],
"engines": {
- "node": ">=12"
+ "node": ">=18"
},
- "funding": {
- "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ "peerDependencies": {
+ "postcss-selector-parser": "^7.0.0"
}
},
"node_modules/stylelint/node_modules/balanced-match": {
@@ -4663,28 +4792,58 @@
"dev": true
},
"node_modules/stylelint/node_modules/file-entry-cache": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz",
- "integrity": "sha512-6MgEugi8p2tiUhqO7GnPsmbCCzj0YRCwwaTbpGRyKZesjRSzkqkAE9fPp7V2yMs5hwfgbQLgdvSSkGNg1s5Uvw==",
+ "version": "10.0.7",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-10.0.7.tgz",
+ "integrity": "sha512-txsf5fu3anp2ff3+gOJJzRImtrtm/oa9tYLN0iTuINZ++EyVR/nRrg2fKYwvG/pXDofcrvvb0scEbX3NyW/COw==",
"dev": true,
"dependencies": {
- "flat-cache": "^5.0.0"
+ "flat-cache": "^6.1.7"
+ }
+ },
+ "node_modules/stylelint/node_modules/flat-cache": {
+ "version": "6.1.7",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.7.tgz",
+ "integrity": "sha512-qwZ4xf1v1m7Rc9XiORly31YaChvKt6oNVHuqqZcoED/7O+ToyNVGobKsIAopY9ODcWpEDKEBAbrSOCBHtNQvew==",
+ "dev": true,
+ "dependencies": {
+ "cacheable": "^1.8.9",
+ "flatted": "^3.3.3",
+ "hookified": "^1.7.1"
+ }
+ },
+ "node_modules/stylelint/node_modules/global-modules": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
+ "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
+ "dev": true,
+ "dependencies": {
+ "global-prefix": "^3.0.0"
},
"engines": {
- "node": ">=18"
+ "node": ">=6"
}
},
- "node_modules/stylelint/node_modules/flat-cache": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz",
- "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==",
+ "node_modules/stylelint/node_modules/global-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+ "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
"dev": true,
"dependencies": {
- "flatted": "^3.3.1",
- "keyv": "^4.5.4"
+ "ini": "^1.3.5",
+ "kind-of": "^6.0.2",
+ "which": "^1.3.1"
},
"engines": {
- "node": ">=18"
+ "node": ">=6"
+ }
+ },
+ "node_modules/stylelint/node_modules/ignore": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.3.tgz",
+ "integrity": "sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4"
}
},
"node_modules/stylelint/node_modules/is-plain-object": {
@@ -4696,6 +4855,19 @@
"node": ">=0.10.0"
}
},
+ "node_modules/stylelint/node_modules/postcss-selector-parser": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz",
+ "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
+ "dev": true,
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/stylelint/node_modules/resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@@ -4705,19 +4877,16 @@
"node": ">=8"
}
},
- "node_modules/stylelint/node_modules/strip-ansi": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
- "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "node_modules/stylelint/node_modules/which": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"dependencies": {
- "ansi-regex": "^6.0.1"
- },
- "engines": {
- "node": ">=12"
+ "isexe": "^2.0.0"
},
- "funding": {
- "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ "bin": {
+ "which": "bin/which"
}
},
"node_modules/supports-color": {
@@ -4733,9 +4902,9 @@
}
},
"node_modules/supports-hyperlinks": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz",
- "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.2.0.tgz",
+ "integrity": "sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==",
"dev": true,
"dependencies": {
"has-flag": "^4.0.0",
@@ -4743,6 +4912,9 @@
},
"engines": {
"node": ">=14.18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-hyperlinks?sponsor=1"
}
},
"node_modules/supports-preserve-symlinks-flag": {
@@ -4764,9 +4936,9 @@
"dev": true
},
"node_modules/table": {
- "version": "6.8.2",
- "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz",
- "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==",
+ "version": "6.9.0",
+ "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz",
+ "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==",
"dev": true,
"dependencies": {
"ajv": "^8.0.1",
@@ -4780,15 +4952,15 @@
}
},
"node_modules/table/node_modules/ajv": {
- "version": "8.16.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz",
- "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==",
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
+ "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
"json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2",
- "uri-js": "^4.4.1"
+ "require-from-string": "^2.0.2"
},
"funding": {
"type": "github",
@@ -4816,28 +4988,6 @@
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true
},
- "node_modules/through2": {
- "version": "0.6.5",
- "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
- "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==",
- "dev": true,
- "dependencies": {
- "readable-stream": ">=1.0.33-1 <1.1.0-0",
- "xtend": ">=4.0.0 <4.1.0-0"
- }
- },
- "node_modules/through2/node_modules/readable-stream": {
- "version": "1.0.34",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
- "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==",
- "dev": true,
- "dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.1",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x"
- }
- },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -4851,15 +5001,15 @@
}
},
"node_modules/ts-api-utils": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
- "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz",
+ "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==",
"dev": true,
"engines": {
- "node": ">=16"
+ "node": ">=18.12"
},
"peerDependencies": {
- "typescript": ">=4.2.0"
+ "typescript": ">=4.8.4"
}
},
"node_modules/type-check": {
@@ -4887,9 +5037,9 @@
}
},
"node_modules/typescript": {
- "version": "5.4.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
- "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
+ "version": "5.8.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz",
+ "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==",
"dev": true,
"peer": true,
"bin": {
@@ -4933,9 +5083,9 @@
}
},
"node_modules/update-browserslist-db": {
- "version": "1.0.13",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
- "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz",
+ "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==",
"dev": true,
"funding": [
{
@@ -4952,8 +5102,8 @@
}
],
"dependencies": {
- "escalade": "^3.1.1",
- "picocolors": "^1.0.0"
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
},
"bin": {
"update-browserslist-db": "cli.js"
@@ -5048,6 +5198,15 @@
"node": ">= 8"
}
},
+ "node_modules/word-wrap": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
+ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -5093,15 +5252,6 @@
"node": ">=12"
}
},
- "node_modules/xtend": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
- "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
- "dev": true,
- "engines": {
- "node": ">=0.4"
- }
- },
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
@@ -5112,9 +5262,9 @@
}
},
"node_modules/yaml": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",
- "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==",
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz",
+ "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==",
"dev": true,
"bin": {
"yaml": "bin.mjs"
@@ -5124,13 +5274,12 @@
}
},
"node_modules/yaml-eslint-parser": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.2.2.tgz",
- "integrity": "sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.3.0.tgz",
+ "integrity": "sha512-E/+VitOorXSLiAqtTd7Yqax0/pAS3xaYMP+AUUJGOK1OZG3rhcj9fcJOM5HJ2VrP1FrStVCWr1muTfQCdj4tAA==",
"dev": true,
"dependencies": {
"eslint-visitor-keys": "^3.0.0",
- "lodash": "^4.17.21",
"yaml": "^2.0.0"
},
"engines": {
@@ -5179,3725 +5328,5 @@
"url": "https://github.com/sponsors/sindresorhus"
}
}
- },
- "dependencies": {
- "@aashutoshrathi/word-wrap": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
- "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
- "dev": true
- },
- "@babel/code-frame": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
- "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.24.7",
- "picocolors": "^1.0.0"
- }
- },
- "@babel/helper-validator-identifier": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
- "dev": true
- },
- "@babel/highlight": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
- "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.24.7",
- "chalk": "^2.4.2",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "^1.9.0"
- }
- },
- "chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- }
- },
- "color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "requires": {
- "color-name": "1.1.3"
- }
- },
- "color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
- "dev": true
- },
- "escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
- "dev": true
- },
- "supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
- }
- },
- "@csstools/css-parser-algorithms": {
- "version": "2.6.3",
- "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.6.3.tgz",
- "integrity": "sha512-xI/tL2zxzEbESvnSxwFgwvy5HS00oCXxL4MLs6HUiDcYfwowsoQaABKxUElp1ARITrINzBnsECOc1q0eg2GOrA==",
- "dev": true,
- "requires": {}
- },
- "@csstools/css-tokenizer": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.3.1.tgz",
- "integrity": "sha512-iMNHTyxLbBlWIfGtabT157LH9DUx9X8+Y3oymFEuMj8HNc+rpE3dPFGFgHjpKfjeFDjLjYIAIhXPGvS2lKxL9g==",
- "dev": true
- },
- "@csstools/media-query-list-parser": {
- "version": "2.1.11",
- "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.1.11.tgz",
- "integrity": "sha512-uox5MVhvNHqitPP+SynrB1o8oPxPMt2JLgp5ghJOWf54WGQ5OKu47efne49r1SWqs3wRP8xSWjnO9MBKxhB1dA==",
- "dev": true,
- "requires": {}
- },
- "@csstools/selector-specificity": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-3.1.1.tgz",
- "integrity": "sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==",
- "dev": true,
- "requires": {}
- },
- "@dual-bundle/import-meta-resolve": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz",
- "integrity": "sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==",
- "dev": true
- },
- "@es-joy/jsdoccomment": {
- "version": "0.43.1",
- "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz",
- "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==",
- "dev": true,
- "requires": {
- "@types/eslint": "^8.56.5",
- "@types/estree": "^1.0.5",
- "@typescript-eslint/types": "^7.2.0",
- "comment-parser": "1.4.1",
- "esquery": "^1.5.0",
- "jsdoc-type-pratt-parser": "~4.0.0"
- }
- },
- "@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^3.3.0"
- }
- },
- "@eslint-community/regexpp": {
- "version": "4.10.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
- "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
- "dev": true
- },
- "@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
- "dev": true,
- "requires": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- }
- },
- "@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
- "dev": true
- },
- "@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "dev": true,
- "requires": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
- }
- },
- "@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
- "dev": true
- },
- "@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "dev": true
- },
- "@mdn/browser-compat-data": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.5.0.tgz",
- "integrity": "sha512-H+jO7BSlQAf7W1md2+CcBeWGhfOpuYSOemm0cCU3ffyWEodOJLIODaYSe6+Y1hQ8JxprsoXHFwGau8Hzudd70A==",
- "dev": true
- },
- "@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "requires": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- }
- },
- "@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true
- },
- "@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "dev": true,
- "requires": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- }
- },
- "@stylistic/stylelint-config": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@stylistic/stylelint-config/-/stylelint-config-1.0.1.tgz",
- "integrity": "sha512-JgFP88HZEyo34k9RpWVdcQJtLPrMxYE58IO3qypXhmvE/NmZohj+xjDtQ8UfaarnYsLecnldw57/GHum07Ctdw==",
- "dev": true,
- "requires": {
- "@stylistic/stylelint-plugin": "^2.0.0"
- }
- },
- "@stylistic/stylelint-plugin": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@stylistic/stylelint-plugin/-/stylelint-plugin-2.0.0.tgz",
- "integrity": "sha512-dHKuT6PGd1WGZLOTuozAM7GdQzdmlmnFXYzvV1jYJXXpcCpV/OJ3+n8TXpMkoOeKHpJydY43EOoZTO1W/FOA4Q==",
- "dev": true,
- "requires": {
- "@csstools/css-parser-algorithms": "^2.3.2",
- "@csstools/css-tokenizer": "^2.2.1",
- "@csstools/media-query-list-parser": "^2.1.5",
- "is-plain-object": "^5.0.0",
- "postcss-selector-parser": "^6.0.13",
- "postcss-value-parser": "^4.2.0",
- "style-search": "^0.1.0",
- "stylelint": "^16.0.2"
- },
- "dependencies": {
- "is-plain-object": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
- "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
- "dev": true
- }
- }
- },
- "@types/eslint": {
- "version": "8.56.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz",
- "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==",
- "dev": true,
- "requires": {
- "@types/estree": "*",
- "@types/json-schema": "*"
- }
- },
- "@types/estree": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
- "dev": true
- },
- "@types/json-schema": {
- "version": "7.0.15",
- "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
- "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
- "dev": true
- },
- "@types/minimatch": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
- "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
- "dev": true
- },
- "@types/normalize-package-data": {
- "version": "2.4.4",
- "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz",
- "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==",
- "dev": true
- },
- "@typescript-eslint/scope-manager": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz",
- "integrity": "sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==",
- "dev": true,
- "requires": {
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/visitor-keys": "7.12.0"
- }
- },
- "@typescript-eslint/types": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.12.0.tgz",
- "integrity": "sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==",
- "dev": true
- },
- "@typescript-eslint/typescript-estree": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz",
- "integrity": "sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==",
- "dev": true,
- "requires": {
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/visitor-keys": "7.12.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "minimatch": "^9.0.4",
- "semver": "^7.6.0",
- "ts-api-utils": "^1.3.0"
- },
- "dependencies": {
- "brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0"
- }
- },
- "minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
- "dev": true,
- "requires": {
- "brace-expansion": "^2.0.1"
- }
- }
- }
- },
- "@typescript-eslint/utils": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.12.0.tgz",
- "integrity": "sha512-Y6hhwxwDx41HNpjuYswYp6gDbkiZ8Hin9Bf5aJQn1bpTs3afYY4GX+MPYxma8jtoIV2GRwTM/UJm/2uGCVv+DQ==",
- "dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "@typescript-eslint/scope-manager": "7.12.0",
- "@typescript-eslint/types": "7.12.0",
- "@typescript-eslint/typescript-estree": "7.12.0"
- }
- },
- "@typescript-eslint/visitor-keys": {
- "version": "7.12.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz",
- "integrity": "sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==",
- "dev": true,
- "requires": {
- "@typescript-eslint/types": "7.12.0",
- "eslint-visitor-keys": "^3.4.3"
- }
- },
- "@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "abbrev": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
- "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
- "dev": true
- },
- "ace-builds": {
- "version": "1.32.7",
- "resolved": "https://registry.npmjs.org/ace-builds/-/ace-builds-1.32.7.tgz",
- "integrity": "sha512-ziv35kaYELFw4suWlotz/Xsl1/1LhWAbwFoD3zIgCgP9gXGECEsAM4GhiB0T0xZdmQjyv6hmAzO280g0+n4vGw==",
- "dev": true
- },
- "acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
- "dev": true
- },
- "acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "requires": {}
- },
- "ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dev": true,
- "requires": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- }
- },
- "ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true
- },
- "ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
- "requires": {
- "color-convert": "^2.0.1"
- }
- },
- "are-docs-informative": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz",
- "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==",
- "dev": true
- },
- "argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "array-differ": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",
- "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",
- "dev": true
- },
- "array-each": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
- "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==",
- "dev": true
- },
- "array-slice": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
- "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
- "dev": true
- },
- "array-union": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
- "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
- "dev": true
- },
- "arrify": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
- "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
- "dev": true
- },
- "ast-metadata-inferer": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.8.0.tgz",
- "integrity": "sha512-jOMKcHht9LxYIEQu+RVd22vtgrPaVCtDRQ/16IGmurdzxvYbDd5ynxjnyrzLnieG96eTcAyaoj/wN/4/1FyyeA==",
- "dev": true,
- "requires": {
- "@mdn/browser-compat-data": "^5.2.34"
- }
- },
- "astral-regex": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
- "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
- "dev": true
- },
- "async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==",
- "dev": true
- },
- "balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "boolbase": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
- "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
- "dev": true
- },
- "brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "requires": {
- "fill-range": "^7.1.1"
- }
- },
- "browserslist": {
- "version": "4.23.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
- "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
- "dev": true,
- "requires": {
- "caniuse-lite": "^1.0.30001587",
- "electron-to-chromium": "^1.4.668",
- "node-releases": "^2.0.14",
- "update-browserslist-db": "^1.0.13"
- }
- },
- "browserslist-config-wikimedia": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/browserslist-config-wikimedia/-/browserslist-config-wikimedia-0.7.0.tgz",
- "integrity": "sha512-CTa0lv78dXKEgrYsOLCkqO+9UUS3CV9MWEOYHcymgEvx4mYxB80sCoKRCR7wW2SOMNxjaP9hohrZripjnKuRTA==",
- "dev": true
- },
- "builtin-modules": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz",
- "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==",
- "dev": true
- },
- "callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true
- },
- "caniuse-lite": {
- "version": "1.0.30001610",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001610.tgz",
- "integrity": "sha512-QFutAY4NgaelojVMjY63o6XlZyORPaLfyMnsl3HgnWdJUcX6K0oaJymHjH8PT5Gk7sTm8rvC/c5COUQKXqmOMA==",
- "dev": true
- },
- "chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- }
- },
- "ci-info": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz",
- "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==",
- "dev": true
- },
- "clean-regexp": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz",
- "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==",
- "dev": true,
- "requires": {
- "escape-string-regexp": "^1.0.5"
- },
- "dependencies": {
- "escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true
- }
- }
- },
- "cliui": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
- "dev": true,
- "requires": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^7.0.0"
- }
- },
- "color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
- "requires": {
- "color-name": "~1.1.4"
- }
- },
- "color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true
- },
- "colord": {
- "version": "2.9.3",
- "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz",
- "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==",
- "dev": true
- },
- "colors": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
- "integrity": "sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==",
- "dev": true
- },
- "comment-parser": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz",
- "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==",
- "dev": true
- },
- "concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "core-js-compat": {
- "version": "3.37.1",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz",
- "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==",
- "dev": true,
- "requires": {
- "browserslist": "^4.23.0"
- }
- },
- "core-util-is": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
- "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
- "dev": true
- },
- "cosmiconfig": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz",
- "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==",
- "dev": true,
- "requires": {
- "env-paths": "^2.2.1",
- "import-fresh": "^3.3.0",
- "js-yaml": "^4.1.0",
- "parse-json": "^5.2.0"
- }
- },
- "cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "requires": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- }
- },
- "css-functions-list": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/css-functions-list/-/css-functions-list-3.2.2.tgz",
- "integrity": "sha512-c+N0v6wbKVxTu5gOBBFkr9BEdBWaqqjQeiJ8QvSRIJOf+UxlJh930m8e6/WNeODIK0mYLFkoONrnj16i2EcvfQ==",
- "dev": true
- },
- "css-tokenize": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/css-tokenize/-/css-tokenize-1.0.1.tgz",
- "integrity": "sha512-gLmmbJdwH9HLY4bcA17lnZ8GgPwEXRbvxBJGHnkiB6gLhRpTzjkjtMIvz7YORGW/Ptv2oMk8b5g+u7mRD6Dd7A==",
- "dev": true,
- "requires": {
- "inherits": "^2.0.1",
- "readable-stream": "^1.0.33"
- }
- },
- "css-tree": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz",
- "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==",
- "dev": true,
- "requires": {
- "mdn-data": "2.0.30",
- "source-map-js": "^1.0.1"
- }
- },
- "cssesc": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
- "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
- "dev": true
- },
- "dateformat": {
- "version": "4.6.3",
- "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
- "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
- "dev": true
- },
- "debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dev": true,
- "requires": {
- "ms": "2.1.2"
- }
- },
- "deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "detect-file": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
- "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==",
- "dev": true
- },
- "dir-glob": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
- "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
- "dev": true,
- "requires": {
- "path-type": "^4.0.0"
- }
- },
- "doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2"
- }
- },
- "doiuse": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/doiuse/-/doiuse-6.0.2.tgz",
- "integrity": "sha512-eBTs23NOX+EAYPr4RbCR6J4DRW/TML3uMo37y0X1whlkersDYFCk9HmCl09KX98cis22VKsV1QaxfVNauJ3NBw==",
- "dev": true,
- "requires": {
- "browserslist": "^4.21.5",
- "caniuse-lite": "^1.0.30001487",
- "css-tokenize": "^1.0.1",
- "duplexify": "^4.1.2",
- "ldjson-stream": "^1.2.1",
- "multimatch": "^5.0.0",
- "postcss": "^8.4.21",
- "source-map": "^0.7.4",
- "yargs": "^17.7.1"
- }
- },
- "dom-serializer": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
- "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.3.0",
- "domhandler": "^5.0.2",
- "entities": "^4.2.0"
- }
- },
- "domelementtype": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
- "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==",
- "dev": true
- },
- "domhandler": {
- "version": "5.0.3",
- "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
- "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.3.0"
- }
- },
- "domutils": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz",
- "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==",
- "dev": true,
- "requires": {
- "dom-serializer": "^2.0.0",
- "domelementtype": "^2.3.0",
- "domhandler": "^5.0.3"
- }
- },
- "duplexify": {
- "version": "4.1.3",
- "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz",
- "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==",
- "dev": true,
- "requires": {
- "end-of-stream": "^1.4.1",
- "inherits": "^2.0.3",
- "readable-stream": "^3.1.1",
- "stream-shift": "^1.0.2"
- },
- "dependencies": {
- "readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dev": true,
- "requires": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dev": true,
- "requires": {
- "safe-buffer": "~5.2.0"
- }
- }
- }
- },
- "electron-to-chromium": {
- "version": "1.4.737",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.737.tgz",
- "integrity": "sha512-QvLTxaLHKdy5YxvixAw/FfHq2eWLUL9KvsPjp0aHK1gI5d3EDuDgITkvj0nFO2c6zUY3ZqVAJQiBYyQP9tQpfw==",
- "dev": true
- },
- "emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true
- },
- "end-of-stream": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
- "dev": true,
- "requires": {
- "once": "^1.4.0"
- }
- },
- "enhanced-resolve": {
- "version": "5.17.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.2.4",
- "tapable": "^2.2.0"
- }
- },
- "entities": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
- "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
- "dev": true
- },
- "env-paths": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
- "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
- "dev": true
- },
- "error-ex": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
- "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
- "dev": true,
- "requires": {
- "is-arrayish": "^0.2.1"
- }
- },
- "escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
- "dev": true
- },
- "escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true
- },
- "eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
- "dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- }
- },
- "eslint-compat-utils": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.0.tgz",
- "integrity": "sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg==",
- "dev": true,
- "requires": {
- "semver": "^7.5.4"
- }
- },
- "eslint-config-wikimedia": {
- "version": "0.28.2",
- "resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.28.2.tgz",
- "integrity": "sha512-5+rdnT7wH1gpKAO6tHYThg78eMhZMruJzvqku3Y5iaEY/A7kSKLFpA/vOj/snys9fKjDHC9BXmArQh+agkOoJQ==",
- "dev": true,
- "requires": {
- "browserslist-config-wikimedia": "^0.7.0",
- "eslint": "^8.57.0",
- "eslint-plugin-compat": "^4.2.0",
- "eslint-plugin-es-x": "^7.6.0",
- "eslint-plugin-jest": "^28.5.0",
- "eslint-plugin-jsdoc": "48.2.5",
- "eslint-plugin-json-es": "^1.6.0",
- "eslint-plugin-mediawiki": "^0.7.0",
- "eslint-plugin-mocha": "^10.4.3",
- "eslint-plugin-n": "^17.7.0",
- "eslint-plugin-no-jquery": "^3.0.1",
- "eslint-plugin-qunit": "^8.1.1",
- "eslint-plugin-security": "^1.7.1",
- "eslint-plugin-unicorn": "^53.0.0",
- "eslint-plugin-vue": "^9.26.0",
- "eslint-plugin-wdio": "^8.24.12",
- "eslint-plugin-yml": "^1.14.0"
- }
- },
- "eslint-plugin-compat": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-compat/-/eslint-plugin-compat-4.2.0.tgz",
- "integrity": "sha512-RDKSYD0maWy5r7zb5cWQS+uSPc26mgOzdORJ8hxILmWM7S/Ncwky7BcAtXVY5iRbKjBdHsWU8Yg7hfoZjtkv7w==",
- "dev": true,
- "requires": {
- "@mdn/browser-compat-data": "^5.3.13",
- "ast-metadata-inferer": "^0.8.0",
- "browserslist": "^4.21.10",
- "caniuse-lite": "^1.0.30001524",
- "find-up": "^5.0.0",
- "lodash.memoize": "^4.1.2",
- "semver": "^7.5.4"
- }
- },
- "eslint-plugin-es-x": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.6.0.tgz",
- "integrity": "sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==",
- "dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.1.2",
- "@eslint-community/regexpp": "^4.6.0",
- "eslint-compat-utils": "^0.5.0"
- }
- },
- "eslint-plugin-jest": {
- "version": "28.5.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.5.0.tgz",
- "integrity": "sha512-6np6DGdmNq/eBbA7HOUNV8fkfL86PYwBfwyb8n23FXgJNTR8+ot3smRHjza9LGsBBZRypK3qyF79vMjohIL8eQ==",
- "dev": true,
- "requires": {
- "@typescript-eslint/utils": "^6.0.0 || ^7.0.0"
- }
- },
- "eslint-plugin-jsdoc": {
- "version": "48.2.5",
- "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.5.tgz",
- "integrity": "sha512-ZeTfKV474W1N9niWfawpwsXGu+ZoMXu4417eBROX31d7ZuOk8zyG66SO77DpJ2+A9Wa2scw/jRqBPnnQo7VbcQ==",
- "dev": true,
- "requires": {
- "@es-joy/jsdoccomment": "~0.43.0",
- "are-docs-informative": "^0.0.2",
- "comment-parser": "1.4.1",
- "debug": "^4.3.4",
- "escape-string-regexp": "^4.0.0",
- "esquery": "^1.5.0",
- "is-builtin-module": "^3.2.1",
- "semver": "^7.6.1",
- "spdx-expression-parse": "^4.0.0"
- }
- },
- "eslint-plugin-json-es": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-json-es/-/eslint-plugin-json-es-1.6.0.tgz",
- "integrity": "sha512-xVn6hufGQH1Aa+yqOhQ43Cq28GuitTcMpQh+uaUh27U2qnVLBrvkN+2xQSnv6zpdLEPS35JCNhq4kvhR+PQCgw==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^3.3.0",
- "espree": "^9.3.1"
- }
- },
- "eslint-plugin-mediawiki": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-mediawiki/-/eslint-plugin-mediawiki-0.7.0.tgz",
- "integrity": "sha512-1Y2nsFDPp96xOZCB5ivZAgqYe9i6w2u64VoCIaAzPyZnd/2h8VQR3CtD+u4Yk/KrpbKq9AAJjrs5LS8VAz6KOA==",
- "dev": true,
- "requires": {
- "eslint-plugin-vue": "^9.23.0",
- "upath": "^2.0.1"
- }
- },
- "eslint-plugin-mocha": {
- "version": "10.4.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.3.tgz",
- "integrity": "sha512-emc4TVjq5Ht0/upR+psftuz6IBG5q279p+1dSRDeHf+NS9aaerBi3lXKo1SEzwC29hFIW21gO89CEWSvRsi8IQ==",
- "dev": true,
- "requires": {
- "eslint-utils": "^3.0.0",
- "globals": "^13.24.0",
- "rambda": "^7.4.0"
- }
- },
- "eslint-plugin-n": {
- "version": "17.8.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.8.0.tgz",
- "integrity": "sha512-XefSXUtrnA2R4L0NGLZP2Nq8fCk3ffrg6oALXMLiZFKTlwUIu23tIe4loxEbdO2wtLqO2sU70m5Fm3bj9zdGSg==",
- "dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "enhanced-resolve": "^5.17.0",
- "eslint-plugin-es-x": "^7.5.0",
- "get-tsconfig": "^4.7.0",
- "globals": "^15.0.0",
- "ignore": "^5.2.4",
- "minimatch": "^9.0.0",
- "semver": "^7.5.3"
- },
- "dependencies": {
- "brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "requires": {
- "balanced-match": "^1.0.0"
- }
- },
- "globals": {
- "version": "15.3.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-15.3.0.tgz",
- "integrity": "sha512-cCdyVjIUVTtX8ZsPkq1oCsOsLmGIswqnjZYMJJTGaNApj1yHtLSymKhwH51ttirREn75z3p4k051clwg7rvNKA==",
- "dev": true
- },
- "minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
- "dev": true,
- "requires": {
- "brace-expansion": "^2.0.1"
- }
- }
- }
- },
- "eslint-plugin-no-jquery": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-3.0.1.tgz",
- "integrity": "sha512-GrzdjIxox/3x8hpSwpxiMuEQFipiJHTGiVsp0T1TI6GH+KVSbXa4z/56xTV1WiIe66u3iRgvCIipu9CRthecpQ==",
- "dev": true,
- "requires": {}
- },
- "eslint-plugin-qunit": {
- "version": "8.1.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-qunit/-/eslint-plugin-qunit-8.1.1.tgz",
- "integrity": "sha512-j3xhiAf2Wvr8Dfwl5T6tlJ+F55vqYE9ZdAHUOTzq1lGerYrXzOS46RvK4SSWug2D8sl3ZYr2lA4/hgVXgLloxw==",
- "dev": true,
- "requires": {
- "eslint-utils": "^3.0.0",
- "requireindex": "^1.2.0"
- }
- },
- "eslint-plugin-security": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.7.1.tgz",
- "integrity": "sha512-sMStceig8AFglhhT2LqlU5r+/fn9OwsA72O5bBuQVTssPCdQAOQzL+oMn/ZcpeUY6KcNfLJArgcrsSULNjYYdQ==",
- "dev": true,
- "requires": {
- "safe-regex": "^2.1.1"
- }
- },
- "eslint-plugin-unicorn": {
- "version": "53.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-53.0.0.tgz",
- "integrity": "sha512-kuTcNo9IwwUCfyHGwQFOK/HjJAYzbODHN3wP0PgqbW+jbXqpNWxNVpVhj2tO9SixBwuAdmal8rVcWKBxwFnGuw==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.24.5",
- "@eslint-community/eslint-utils": "^4.4.0",
- "@eslint/eslintrc": "^3.0.2",
- "ci-info": "^4.0.0",
- "clean-regexp": "^1.0.0",
- "core-js-compat": "^3.37.0",
- "esquery": "^1.5.0",
- "indent-string": "^4.0.0",
- "is-builtin-module": "^3.2.1",
- "jsesc": "^3.0.2",
- "pluralize": "^8.0.0",
- "read-pkg-up": "^7.0.1",
- "regexp-tree": "^0.1.27",
- "regjsparser": "^0.10.0",
- "semver": "^7.6.1",
- "strip-indent": "^3.0.0"
- },
- "dependencies": {
- "@eslint/eslintrc": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz",
- "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==",
- "dev": true,
- "requires": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^10.0.1",
- "globals": "^14.0.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- }
- },
- "eslint-visitor-keys": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz",
- "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==",
- "dev": true
- },
- "espree": {
- "version": "10.0.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz",
- "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==",
- "dev": true,
- "requires": {
- "acorn": "^8.11.3",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^4.0.0"
- }
- },
- "globals": {
- "version": "14.0.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
- "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
- "dev": true
- }
- }
- },
- "eslint-plugin-vue": {
- "version": "9.26.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.26.0.tgz",
- "integrity": "sha512-eTvlxXgd4ijE1cdur850G6KalZqk65k1JKoOI2d1kT3hr8sPD07j1q98FRFdNnpxBELGPWxZmInxeHGF/GxtqQ==",
- "dev": true,
- "requires": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "globals": "^13.24.0",
- "natural-compare": "^1.4.0",
- "nth-check": "^2.1.1",
- "postcss-selector-parser": "^6.0.15",
- "semver": "^7.6.0",
- "vue-eslint-parser": "^9.4.2",
- "xml-name-validator": "^4.0.0"
- }
- },
- "eslint-plugin-wdio": {
- "version": "8.24.12",
- "resolved": "https://registry.npmjs.org/eslint-plugin-wdio/-/eslint-plugin-wdio-8.24.12.tgz",
- "integrity": "sha512-OmzGteXFOQnJDdkTNnTfksaVa18WlFCyeLjZXHvDpkbomLWAg9wc296Pr0wnTCagqNj8qfEHpy+N2XVew5VCMA==",
- "dev": true
- },
- "eslint-plugin-yml": {
- "version": "1.14.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.14.0.tgz",
- "integrity": "sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ==",
- "dev": true,
- "requires": {
- "debug": "^4.3.2",
- "eslint-compat-utils": "^0.5.0",
- "lodash": "^4.17.21",
- "natural-compare": "^1.4.0",
- "yaml-eslint-parser": "^1.2.1"
- }
- },
- "eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
- "dev": true,
- "requires": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- }
- },
- "eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^2.0.0"
- },
- "dependencies": {
- "eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true
- }
- }
- },
- "eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true
- },
- "espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
- "requires": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
- }
- },
- "esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "dev": true
- },
- "esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
- "dev": true,
- "requires": {
- "estraverse": "^5.1.0"
- }
- },
- "esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "requires": {
- "estraverse": "^5.2.0"
- }
- },
- "estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true
- },
- "esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true
- },
- "eventemitter2": {
- "version": "0.4.14",
- "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz",
- "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==",
- "dev": true
- },
- "exit": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
- "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==",
- "dev": true
- },
- "expand-tilde": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz",
- "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==",
- "dev": true,
- "requires": {
- "homedir-polyfill": "^1.0.1"
- }
- },
- "extend": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
- "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
- "dev": true
- },
- "fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true
- },
- "fast-glob": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
- "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
- "dev": true,
- "requires": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.4"
- },
- "dependencies": {
- "glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "requires": {
- "is-glob": "^4.0.1"
- }
- }
- }
- },
- "fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
- "dev": true
- },
- "fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
- "dev": true
- },
- "fastest-levenshtein": {
- "version": "1.0.16",
- "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz",
- "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==",
- "dev": true
- },
- "fastq": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
- "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
- "dev": true,
- "requires": {
- "reusify": "^1.0.4"
- }
- },
- "file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "requires": {
- "flat-cache": "^3.0.4"
- }
- },
- "file-sync-cmp": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",
- "integrity": "sha512-0k45oWBokCqh2MOexeYKpyqmGKG+8mQ2Wd8iawx+uWd/weWJQAZ6SoPybagdCI4xFisag8iAR77WPm4h3pTfxA==",
- "dev": true
- },
- "fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "requires": {
- "to-regex-range": "^5.0.1"
- }
- },
- "find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "requires": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- }
- },
- "findup-sync": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz",
- "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==",
- "dev": true,
- "requires": {
- "detect-file": "^1.0.0",
- "is-glob": "^4.0.3",
- "micromatch": "^4.0.4",
- "resolve-dir": "^1.0.1"
- }
- },
- "fined": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz",
- "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.2",
- "is-plain-object": "^2.0.3",
- "object.defaults": "^1.1.0",
- "object.pick": "^1.2.0",
- "parse-filepath": "^1.0.1"
- }
- },
- "flagged-respawn": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
- "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
- "dev": true
- },
- "flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
- "dev": true,
- "requires": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
- }
- },
- "flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
- "dev": true
- },
- "for-in": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
- "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
- "dev": true
- },
- "for-own": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz",
- "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==",
- "dev": true,
- "requires": {
- "for-in": "^1.0.1"
- }
- },
- "fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
- "dev": true
- },
- "get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true
- },
- "get-tsconfig": {
- "version": "4.7.5",
- "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz",
- "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==",
- "dev": true,
- "requires": {
- "resolve-pkg-maps": "^1.0.0"
- }
- },
- "getobject": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz",
- "integrity": "sha512-2zblDBaFcb3rB4rF77XVnuINOE2h2k/OnqXAiy0IrTxUfV1iFp3la33oAQVY9pCpWU268WFYVt2t71hlMuLsOg==",
- "dev": true
- },
- "glob": {
- "version": "7.1.7",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
- "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "requires": {
- "is-glob": "^4.0.3"
- }
- },
- "global-modules": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
- "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
- "dev": true,
- "requires": {
- "global-prefix": "^3.0.0"
- }
- },
- "global-prefix": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
- "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
- "dev": true,
- "requires": {
- "ini": "^1.3.5",
- "kind-of": "^6.0.2",
- "which": "^1.3.1"
- },
- "dependencies": {
- "which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- }
- }
- },
- "globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "requires": {
- "type-fest": "^0.20.2"
- }
- },
- "globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
- "dev": true,
- "requires": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
- }
- },
- "globjoin": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz",
- "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==",
- "dev": true
- },
- "graceful-fs": {
- "version": "4.2.11",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
- "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
- "dev": true
- },
- "graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "grunt": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz",
- "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==",
- "dev": true,
- "requires": {
- "dateformat": "~4.6.2",
- "eventemitter2": "~0.4.13",
- "exit": "~0.1.2",
- "findup-sync": "~5.0.0",
- "glob": "~7.1.6",
- "grunt-cli": "~1.4.3",
- "grunt-known-options": "~2.0.0",
- "grunt-legacy-log": "~3.0.0",
- "grunt-legacy-util": "~2.0.1",
- "iconv-lite": "~0.6.3",
- "js-yaml": "~3.14.0",
- "minimatch": "~3.0.4",
- "nopt": "~3.0.6"
- },
- "dependencies": {
- "argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "requires": {
- "sprintf-js": "~1.0.2"
- }
- },
- "js-yaml": {
- "version": "3.14.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
- "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
- "dev": true,
- "requires": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
- }
- },
- "minimatch": {
- "version": "3.0.8",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
- "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
- "dev": true
- }
- }
- },
- "grunt-banana-checker": {
- "version": "0.13.0",
- "resolved": "https://registry.npmjs.org/grunt-banana-checker/-/grunt-banana-checker-0.13.0.tgz",
- "integrity": "sha512-uAUKILcP69Q4OJHHV2wzxqVaoXB8G3Uh/XuSJLn0Bk/9+WiUY/Q4+OX7dUhrPPeDZPtoGh37qqJLVvZlDTUecg==",
- "dev": true,
- "requires": {
- "chalk": "4.1.2"
- }
- },
- "grunt-cli": {
- "version": "1.4.3",
- "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz",
- "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==",
- "dev": true,
- "requires": {
- "grunt-known-options": "~2.0.0",
- "interpret": "~1.1.0",
- "liftup": "~3.0.1",
- "nopt": "~4.0.1",
- "v8flags": "~3.2.0"
- },
- "dependencies": {
- "nopt": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz",
- "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==",
- "dev": true,
- "requires": {
- "abbrev": "1",
- "osenv": "^0.1.4"
- }
- }
- }
- },
- "grunt-contrib-clean": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.1.tgz",
- "integrity": "sha512-uRvnXfhiZt8akb/ZRDHJpQQtkkVkqc/opWO4Po/9ehC2hPxgptB9S6JHDC/Nxswo4CJSM0iFPT/Iym3cEMWzKA==",
- "dev": true,
- "requires": {
- "async": "^3.2.3",
- "rimraf": "^2.6.2"
- },
- "dependencies": {
- "rimraf": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
- "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- }
- }
- },
- "grunt-contrib-copy": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz",
- "integrity": "sha512-gFRFUB0ZbLcjKb67Magz1yOHGBkyU6uL29hiEW1tdQ9gQt72NuMKIy/kS6dsCbV0cZ0maNCb0s6y+uT1FKU7jA==",
- "dev": true,
- "requires": {
- "chalk": "^1.1.1",
- "file-sync-cmp": "^0.1.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
- "dev": true
- },
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==",
- "dev": true,
- "requires": {
- "ansi-styles": "^2.2.1",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
- }
- },
- "escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true
- },
- "strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==",
- "dev": true
- }
- }
- },
- "grunt-eslint": {
- "version": "24.3.0",
- "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz",
- "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==",
- "dev": true,
- "requires": {
- "chalk": "^4.1.2",
- "eslint": "^8.44.0"
- }
- },
- "grunt-exec": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-3.0.0.tgz",
- "integrity": "sha512-cgAlreXf3muSYS5LzW0Cc4xHK03BjFOYk0MqCQ/MZ3k1Xz2GU7D+IAJg4UKicxpO+XdONJdx/NJ6kpy2wI+uHg==",
- "dev": true,
- "requires": {}
- },
- "grunt-known-options": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz",
- "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==",
- "dev": true
- },
- "grunt-legacy-log": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz",
- "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==",
- "dev": true,
- "requires": {
- "colors": "~1.1.2",
- "grunt-legacy-log-utils": "~2.1.0",
- "hooker": "~0.2.3",
- "lodash": "~4.17.19"
- }
- },
- "grunt-legacy-log-utils": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz",
- "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==",
- "dev": true,
- "requires": {
- "chalk": "~4.1.0",
- "lodash": "~4.17.19"
- }
- },
- "grunt-legacy-util": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz",
- "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==",
- "dev": true,
- "requires": {
- "async": "~3.2.0",
- "exit": "~0.1.2",
- "getobject": "~1.0.0",
- "hooker": "~0.2.3",
- "lodash": "~4.17.21",
- "underscore.string": "~3.3.5",
- "which": "~2.0.2"
- }
- },
- "grunt-stylelint": {
- "version": "0.20.1",
- "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.20.1.tgz",
- "integrity": "sha512-tDep9ceEerB+fK6CkzPBXu5qPM7RuwCRgfrtwugEyYYnxINreMZktqQU5eoTW+MhhFj81uWQQnxf+c4geyAmQg==",
- "dev": true,
- "requires": {
- "chalk": "^4.1.2"
- }
- },
- "has-ansi": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
- "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
- "dev": true
- }
- }
- },
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
- },
- "hasown": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
- "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.2"
- }
- },
- "homedir-polyfill": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
- "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==",
- "dev": true,
- "requires": {
- "parse-passwd": "^1.0.0"
- }
- },
- "hooker": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
- "integrity": "sha512-t+UerCsQviSymAInD01Pw+Dn/usmz1sRO+3Zk1+lx8eg+WKpD2ulcwWqHHL0+aseRBr+3+vIhiG1K1JTwaIcTA==",
- "dev": true
- },
- "hosted-git-info": {
- "version": "2.8.9",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
- "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
- "dev": true
- },
- "html-tags": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz",
- "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==",
- "dev": true
- },
- "htmlparser2": {
- "version": "8.0.2",
- "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz",
- "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==",
- "dev": true,
- "requires": {
- "domelementtype": "^2.3.0",
- "domhandler": "^5.0.3",
- "domutils": "^3.0.1",
- "entities": "^4.4.0"
- }
- },
- "iconv-lite": {
- "version": "0.6.3",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
- "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
- "dev": true,
- "requires": {
- "safer-buffer": ">= 2.1.2 < 3.0.0"
- }
- },
- "ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
- "dev": true
- },
- "import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "requires": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- }
- },
- "imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
- "dev": true
- },
- "indent-string": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
- "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
- "dev": true
- },
- "ini": {
- "version": "1.3.8",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
- "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
- "dev": true
- },
- "interpret": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz",
- "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==",
- "dev": true
- },
- "is-absolute": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
- "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
- "dev": true,
- "requires": {
- "is-relative": "^1.0.0",
- "is-windows": "^1.0.1"
- }
- },
- "is-arrayish": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
- "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
- "dev": true
- },
- "is-builtin-module": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz",
- "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==",
- "dev": true,
- "requires": {
- "builtin-modules": "^3.3.0"
- }
- },
- "is-core-module": {
- "version": "2.13.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
- "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
- "dev": true,
- "requires": {
- "hasown": "^2.0.0"
- }
- },
- "is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true
- },
- "is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "requires": {
- "is-extglob": "^2.1.1"
- }
- },
- "is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true
- },
- "is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true
- },
- "is-plain-object": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
- "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
- "dev": true,
- "requires": {
- "isobject": "^3.0.1"
- }
- },
- "is-relative": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
- "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
- "dev": true,
- "requires": {
- "is-unc-path": "^1.0.0"
- }
- },
- "is-unc-path": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
- "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
- "dev": true,
- "requires": {
- "unc-path-regex": "^0.1.2"
- }
- },
- "is-windows": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
- "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
- "dev": true
- },
- "isarray": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
- "dev": true
- },
- "isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
- "dev": true
- },
- "isobject": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
- "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
- "dev": true
- },
- "js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true
- },
- "js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "requires": {
- "argparse": "^2.0.1"
- }
- },
- "jsdoc-type-pratt-parser": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz",
- "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==",
- "dev": true
- },
- "jsesc": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
- "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
- "dev": true
- },
- "json-buffer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
- },
- "json-parse-even-better-errors": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
- "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
- "dev": true
- },
- "json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
- "dev": true
- },
- "json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
- "dev": true
- },
- "keyv": {
- "version": "4.5.4",
- "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
- "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
- "dev": true,
- "requires": {
- "json-buffer": "3.0.1"
- }
- },
- "kind-of": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
- "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
- "dev": true
- },
- "known-css-properties": {
- "version": "0.31.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.31.0.tgz",
- "integrity": "sha512-sBPIUGTNF0czz0mwGGUoKKJC8Q7On1GPbCSFPfyEsfHb2DyBG0Y4QtV+EVWpINSaiGKZblDNuF5AezxSgOhesQ==",
- "dev": true
- },
- "ldjson-stream": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ldjson-stream/-/ldjson-stream-1.2.1.tgz",
- "integrity": "sha512-xw/nNEXafuPSLu8NjjG3+atVVw+8U1APZAQylmwQn19Hgw6rC7QjHvP6MupnHWCrzSm9m0xs5QWkCLuRvBPjgQ==",
- "dev": true,
- "requires": {
- "split2": "^0.2.1",
- "through2": "^0.6.1"
- }
- },
- "levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "requires": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- }
- },
- "liftup": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz",
- "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==",
- "dev": true,
- "requires": {
- "extend": "^3.0.2",
- "findup-sync": "^4.0.0",
- "fined": "^1.2.0",
- "flagged-respawn": "^1.0.1",
- "is-plain-object": "^2.0.4",
- "object.map": "^1.0.1",
- "rechoir": "^0.7.0",
- "resolve": "^1.19.0"
- },
- "dependencies": {
- "findup-sync": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz",
- "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==",
- "dev": true,
- "requires": {
- "detect-file": "^1.0.0",
- "is-glob": "^4.0.0",
- "micromatch": "^4.0.2",
- "resolve-dir": "^1.0.1"
- }
- }
- }
- },
- "lines-and-columns": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
- "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
- "dev": true
- },
- "locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "requires": {
- "p-locate": "^5.0.0"
- }
- },
- "lodash": {
- "version": "4.17.21",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
- "dev": true
- },
- "lodash.memoize": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
- "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",
- "dev": true
- },
- "lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "lodash.truncate": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
- "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==",
- "dev": true
- },
- "make-iterator": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz",
- "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==",
- "dev": true,
- "requires": {
- "kind-of": "^6.0.2"
- }
- },
- "map-cache": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
- "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==",
- "dev": true
- },
- "mathml-tag-names": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
- "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==",
- "dev": true
- },
- "mdn-data": {
- "version": "2.0.30",
- "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
- "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==",
- "dev": true
- },
- "meow": {
- "version": "13.2.0",
- "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz",
- "integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==",
- "dev": true
- },
- "merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true
- },
- "micromatch": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
- "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
- "dev": true,
- "requires": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- }
- },
- "min-indent": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
- "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
- "dev": true
- },
- "minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "requires": {
- "brace-expansion": "^1.1.7"
- }
- },
- "ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- },
- "multimatch": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz",
- "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==",
- "dev": true,
- "requires": {
- "@types/minimatch": "^3.0.3",
- "array-differ": "^3.0.0",
- "array-union": "^2.1.0",
- "arrify": "^2.0.1",
- "minimatch": "^3.0.4"
- }
- },
- "nanoid": {
- "version": "3.3.7",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
- "dev": true
- },
- "natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
- "dev": true
- },
- "node-releases": {
- "version": "2.0.14",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
- "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==",
- "dev": true
- },
- "nopt": {
- "version": "3.0.6",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
- "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==",
- "dev": true,
- "requires": {
- "abbrev": "1"
- }
- },
- "normalize-package-data": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
- "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
- "dev": true,
- "requires": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- },
- "dependencies": {
- "semver": {
- "version": "5.7.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
- "dev": true
- }
- }
- },
- "normalize-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
- "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true
- },
- "nth-check": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
- "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
- "dev": true,
- "requires": {
- "boolbase": "^1.0.0"
- }
- },
- "object.defaults": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz",
- "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==",
- "dev": true,
- "requires": {
- "array-each": "^1.0.1",
- "array-slice": "^1.0.0",
- "for-own": "^1.0.0",
- "isobject": "^3.0.0"
- }
- },
- "object.map": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz",
- "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==",
- "dev": true,
- "requires": {
- "for-own": "^1.0.0",
- "make-iterator": "^1.0.0"
- }
- },
- "object.pick": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
- "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==",
- "dev": true,
- "requires": {
- "isobject": "^3.0.1"
- }
- },
- "once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "requires": {
- "wrappy": "1"
- }
- },
- "optionator": {
- "version": "0.9.3",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
- "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
- "dev": true,
- "requires": {
- "@aashutoshrathi/word-wrap": "^1.2.3",
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0"
- }
- },
- "os-homedir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
- "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==",
- "dev": true
- },
- "os-tmpdir": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
- "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
- "dev": true
- },
- "osenv": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
- "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
- "dev": true,
- "requires": {
- "os-homedir": "^1.0.0",
- "os-tmpdir": "^1.0.0"
- }
- },
- "p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "requires": {
- "yocto-queue": "^0.1.0"
- }
- },
- "p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "requires": {
- "p-limit": "^3.0.2"
- }
- },
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
- "parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "requires": {
- "callsites": "^3.0.0"
- }
- },
- "parse-filepath": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
- "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==",
- "dev": true,
- "requires": {
- "is-absolute": "^1.0.0",
- "map-cache": "^0.2.0",
- "path-root": "^0.1.1"
- }
- },
- "parse-json": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
- "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.0.0",
- "error-ex": "^1.3.1",
- "json-parse-even-better-errors": "^2.3.0",
- "lines-and-columns": "^1.1.6"
- }
- },
- "parse-passwd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
- "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==",
- "dev": true
- },
- "path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true
- },
- "path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true
- },
- "path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true
- },
- "path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true
- },
- "path-root": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz",
- "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==",
- "dev": true,
- "requires": {
- "path-root-regex": "^0.1.0"
- }
- },
- "path-root-regex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz",
- "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==",
- "dev": true
- },
- "path-type": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
- "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
- "dev": true
- },
- "picocolors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
- "dev": true
- },
- "picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true
- },
- "pluralize": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
- "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",
- "dev": true
- },
- "postcss": {
- "version": "8.4.38",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz",
- "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
- "dev": true,
- "requires": {
- "nanoid": "^3.3.7",
- "picocolors": "^1.0.0",
- "source-map-js": "^1.2.0"
- }
- },
- "postcss-html": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-1.6.0.tgz",
- "integrity": "sha512-OWgQ9/Pe23MnNJC0PL4uZp8k0EDaUvqpJFSiwFxOLClAhmD7UEisyhO3x5hVsD4xFrjReVTXydlrMes45dJ71w==",
- "dev": true,
- "requires": {
- "htmlparser2": "^8.0.0",
- "js-tokens": "^8.0.0",
- "postcss": "^8.4.0",
- "postcss-safe-parser": "^6.0.0"
- },
- "dependencies": {
- "js-tokens": {
- "version": "8.0.3",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz",
- "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==",
- "dev": true
- },
- "postcss-safe-parser": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz",
- "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==",
- "dev": true,
- "requires": {}
- }
- }
- },
- "postcss-less": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-6.0.0.tgz",
- "integrity": "sha512-FPX16mQLyEjLzEuuJtxA8X3ejDLNGGEG503d2YGZR5Ask1SpDN8KmZUMpzCvyalWRywAn1n1VOA5dcqfCLo5rg==",
- "dev": true,
- "requires": {}
- },
- "postcss-resolve-nested-selector": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz",
- "integrity": "sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==",
- "dev": true
- },
- "postcss-safe-parser": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-7.0.0.tgz",
- "integrity": "sha512-ovehqRNVCpuFzbXoTb4qLtyzK3xn3t/CUBxOs8LsnQjQrShaB4lKiHoVqY8ANaC0hBMHq5QVWk77rwGklFUDrg==",
- "dev": true,
- "requires": {}
- },
- "postcss-selector-parser": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz",
- "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==",
- "dev": true,
- "requires": {
- "cssesc": "^3.0.0",
- "util-deprecate": "^1.0.2"
- }
- },
- "postcss-value-parser": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
- "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
- "dev": true
- },
- "prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true
- },
- "punycode": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
- "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
- "dev": true
- },
- "queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true
- },
- "rambda": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/rambda/-/rambda-7.5.0.tgz",
- "integrity": "sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==",
- "dev": true
- },
- "read-pkg": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
- "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",
- "dev": true,
- "requires": {
- "@types/normalize-package-data": "^2.4.0",
- "normalize-package-data": "^2.5.0",
- "parse-json": "^5.0.0",
- "type-fest": "^0.6.0"
- },
- "dependencies": {
- "type-fest": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
- "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==",
- "dev": true
- }
- }
- },
- "read-pkg-up": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz",
- "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==",
- "dev": true,
- "requires": {
- "find-up": "^4.1.0",
- "read-pkg": "^5.2.0",
- "type-fest": "^0.8.1"
- },
- "dependencies": {
- "find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "requires": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- }
- },
- "locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "requires": {
- "p-locate": "^4.1.0"
- }
- },
- "p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "requires": {
- "p-try": "^2.0.0"
- }
- },
- "p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "requires": {
- "p-limit": "^2.2.0"
- }
- },
- "type-fest": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
- "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
- "dev": true
- }
- }
- },
- "readable-stream": {
- "version": "1.1.14",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
- "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
- "dev": true,
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.1",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x"
- }
- },
- "rechoir": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
- "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
- "dev": true,
- "requires": {
- "resolve": "^1.9.0"
- }
- },
- "regexp-tree": {
- "version": "0.1.27",
- "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz",
- "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==",
- "dev": true
- },
- "regjsparser": {
- "version": "0.10.0",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.10.0.tgz",
- "integrity": "sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==",
- "dev": true,
- "requires": {
- "jsesc": "~0.5.0"
- },
- "dependencies": {
- "jsesc": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
- "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==",
- "dev": true
- }
- }
- },
- "require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "dev": true
- },
- "require-from-string": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
- "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
- "dev": true
- },
- "requireindex": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
- "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
- "dev": true
- },
- "resolve": {
- "version": "1.22.8",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
- "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
- "dev": true,
- "requires": {
- "is-core-module": "^2.13.0",
- "path-parse": "^1.0.7",
- "supports-preserve-symlinks-flag": "^1.0.0"
- }
- },
- "resolve-dir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz",
- "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.0",
- "global-modules": "^1.0.0"
- },
- "dependencies": {
- "global-modules": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
- "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
- "dev": true,
- "requires": {
- "global-prefix": "^1.0.1",
- "is-windows": "^1.0.1",
- "resolve-dir": "^1.0.0"
- }
- },
- "global-prefix": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz",
- "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=",
- "dev": true,
- "requires": {
- "expand-tilde": "^2.0.2",
- "homedir-polyfill": "^1.0.1",
- "ini": "^1.3.4",
- "is-windows": "^1.0.1",
- "which": "^1.2.14"
- }
- },
- "which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- }
- }
- },
- "resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true
- },
- "resolve-pkg-maps": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
- "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
- "dev": true
- },
- "reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true
- },
- "rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- },
- "run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "requires": {
- "queue-microtask": "^1.2.2"
- }
- },
- "safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "dev": true
- },
- "safe-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-2.1.1.tgz",
- "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==",
- "dev": true,
- "requires": {
- "regexp-tree": "~0.1.1"
- }
- },
- "safer-buffer": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
- "dev": true
- },
- "semver": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
- "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
- "dev": true
- },
- "shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "requires": {
- "shebang-regex": "^3.0.0"
- }
- },
- "shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true
- },
- "signal-exit": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
- "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
- "dev": true
- },
- "slash": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
- "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
- "dev": true
- },
- "slice-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
- "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.0.0",
- "astral-regex": "^2.0.0",
- "is-fullwidth-code-point": "^3.0.0"
- }
- },
- "source-map": {
- "version": "0.7.4",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
- "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==",
- "dev": true
- },
- "source-map-js": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
- "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
- "dev": true
- },
- "spdx-correct": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
- "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==",
- "dev": true,
- "requires": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- },
- "dependencies": {
- "spdx-expression-parse": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
- "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
- "dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- }
- }
- },
- "spdx-exceptions": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz",
- "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==",
- "dev": true
- },
- "spdx-expression-parse": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz",
- "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==",
- "dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-license-ids": {
- "version": "3.0.18",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz",
- "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==",
- "dev": true
- },
- "split2": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz",
- "integrity": "sha512-D/oTExYAkC9nWleOCTOyNmAuzfAT/6rHGBA9LIK7FVnGo13CSvrKCUzKenwH6U1s2znY9MqH6v0UQTEDa3vJmg==",
- "dev": true,
- "requires": {
- "through2": "~0.6.1"
- }
- },
- "sprintf-js": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
- "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
- "dev": true
- },
- "stream-shift": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz",
- "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==",
- "dev": true
- },
- "string_decoder": {
- "version": "0.10.31",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
- "dev": true
- },
- "string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dev": true,
- "requires": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- }
- },
- "strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dev": true,
- "requires": {
- "ansi-regex": "^5.0.1"
- }
- },
- "strip-indent": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
- "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
- "dev": true,
- "requires": {
- "min-indent": "^1.0.0"
- }
- },
- "strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true
- },
- "style-search": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz",
- "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==",
- "dev": true
- },
- "stylelint": {
- "version": "16.6.1",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.6.1.tgz",
- "integrity": "sha512-yNgz2PqWLkhH2hw6X9AweV9YvoafbAD5ZsFdKN9BvSDVwGvPh+AUIrn7lYwy1S7IHmtFin75LLfX1m0D2tHu8Q==",
- "dev": true,
- "requires": {
- "@csstools/css-parser-algorithms": "^2.6.3",
- "@csstools/css-tokenizer": "^2.3.1",
- "@csstools/media-query-list-parser": "^2.1.11",
- "@csstools/selector-specificity": "^3.1.1",
- "@dual-bundle/import-meta-resolve": "^4.1.0",
- "balanced-match": "^2.0.0",
- "colord": "^2.9.3",
- "cosmiconfig": "^9.0.0",
- "css-functions-list": "^3.2.2",
- "css-tree": "^2.3.1",
- "debug": "^4.3.4",
- "fast-glob": "^3.3.2",
- "fastest-levenshtein": "^1.0.16",
- "file-entry-cache": "^9.0.0",
- "global-modules": "^2.0.0",
- "globby": "^11.1.0",
- "globjoin": "^0.1.4",
- "html-tags": "^3.3.1",
- "ignore": "^5.3.1",
- "imurmurhash": "^0.1.4",
- "is-plain-object": "^5.0.0",
- "known-css-properties": "^0.31.0",
- "mathml-tag-names": "^2.1.3",
- "meow": "^13.2.0",
- "micromatch": "^4.0.7",
- "normalize-path": "^3.0.0",
- "picocolors": "^1.0.1",
- "postcss": "^8.4.38",
- "postcss-resolve-nested-selector": "^0.1.1",
- "postcss-safe-parser": "^7.0.0",
- "postcss-selector-parser": "^6.1.0",
- "postcss-value-parser": "^4.2.0",
- "resolve-from": "^5.0.0",
- "string-width": "^4.2.3",
- "strip-ansi": "^7.1.0",
- "supports-hyperlinks": "^3.0.0",
- "svg-tags": "^1.0.0",
- "table": "^6.8.2",
- "write-file-atomic": "^5.0.1"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
- "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
- "dev": true
- },
- "balanced-match": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz",
- "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
- "dev": true
- },
- "file-entry-cache": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-9.0.0.tgz",
- "integrity": "sha512-6MgEugi8p2tiUhqO7GnPsmbCCzj0YRCwwaTbpGRyKZesjRSzkqkAE9fPp7V2yMs5hwfgbQLgdvSSkGNg1s5Uvw==",
- "dev": true,
- "requires": {
- "flat-cache": "^5.0.0"
- }
- },
- "flat-cache": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-5.0.0.tgz",
- "integrity": "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==",
- "dev": true,
- "requires": {
- "flatted": "^3.3.1",
- "keyv": "^4.5.4"
- }
- },
- "is-plain-object": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
- "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
- "dev": true
- },
- "resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
- "dev": true
- },
- "strip-ansi": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
- "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
- "dev": true,
- "requires": {
- "ansi-regex": "^6.0.1"
- }
- }
- }
- },
- "stylelint-config-recommended": {
- "version": "14.0.0",
- "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-14.0.0.tgz",
- "integrity": "sha512-jSkx290CglS8StmrLp2TxAppIajzIBZKYm3IxT89Kg6fGlxbPiTiyH9PS5YUuVAFwaJLl1ikiXX0QWjI0jmgZQ==",
- "dev": true,
- "requires": {}
- },
- "stylelint-config-wikimedia": {
- "version": "0.17.2",
- "resolved": "https://registry.npmjs.org/stylelint-config-wikimedia/-/stylelint-config-wikimedia-0.17.2.tgz",
- "integrity": "sha512-cc3PYhe1O/GTgsMOp+Ri3ru579YBbZ3Me0oU7xNb06n4iwyXYPz8qO5G4iQ13UH19UW2NIS8Tk0goPRrJ1RAfw==",
- "dev": true,
- "requires": {
- "@stylistic/stylelint-config": "1.0.1",
- "@stylistic/stylelint-plugin": "2.0.0",
- "browserslist-config-wikimedia": "0.7.0",
- "postcss-html": "1.6.0",
- "postcss-less": "6.0.0",
- "stylelint": "16.2.0",
- "stylelint-config-recommended": "14.0.0",
- "stylelint-no-unsupported-browser-features": "8.0.1"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
- "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
- "dev": true
- },
- "balanced-match": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-2.0.0.tgz",
- "integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
- "dev": true
- },
- "file-entry-cache": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
- "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
- "dev": true,
- "requires": {
- "flat-cache": "^4.0.0"
- }
- },
- "flat-cache": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
- "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
- "dev": true,
- "requires": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.4"
- }
- },
- "is-plain-object": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
- "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
- "dev": true
- },
- "known-css-properties": {
- "version": "0.29.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.29.0.tgz",
- "integrity": "sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==",
- "dev": true
- },
- "resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
- "dev": true
- },
- "strip-ansi": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
- "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
- "dev": true,
- "requires": {
- "ansi-regex": "^6.0.1"
- }
- },
- "stylelint": {
- "version": "16.2.0",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.2.0.tgz",
- "integrity": "sha512-gwqU5AkIb52wrAzzn+359S3NIJDMl02TXLUaV2tzA/L6jUdpTwNt+MCxHlc8+Hb2bUHlYVo92YeSIryF2gJthA==",
- "dev": true,
- "requires": {
- "@csstools/css-parser-algorithms": "^2.5.0",
- "@csstools/css-tokenizer": "^2.2.3",
- "@csstools/media-query-list-parser": "^2.1.7",
- "@csstools/selector-specificity": "^3.0.1",
- "balanced-match": "^2.0.0",
- "colord": "^2.9.3",
- "cosmiconfig": "^9.0.0",
- "css-functions-list": "^3.2.1",
- "css-tree": "^2.3.1",
- "debug": "^4.3.4",
- "fast-glob": "^3.3.2",
- "fastest-levenshtein": "^1.0.16",
- "file-entry-cache": "^8.0.0",
- "global-modules": "^2.0.0",
- "globby": "^11.1.0",
- "globjoin": "^0.1.4",
- "html-tags": "^3.3.1",
- "ignore": "^5.3.0",
- "imurmurhash": "^0.1.4",
- "is-plain-object": "^5.0.0",
- "known-css-properties": "^0.29.0",
- "mathml-tag-names": "^2.1.3",
- "meow": "^13.1.0",
- "micromatch": "^4.0.5",
- "normalize-path": "^3.0.0",
- "picocolors": "^1.0.0",
- "postcss": "^8.4.33",
- "postcss-resolve-nested-selector": "^0.1.1",
- "postcss-safe-parser": "^7.0.0",
- "postcss-selector-parser": "^6.0.15",
- "postcss-value-parser": "^4.2.0",
- "resolve-from": "^5.0.0",
- "string-width": "^4.2.3",
- "strip-ansi": "^7.1.0",
- "supports-hyperlinks": "^3.0.0",
- "svg-tags": "^1.0.0",
- "table": "^6.8.1",
- "write-file-atomic": "^5.0.1"
- }
- }
- }
- },
- "stylelint-no-unsupported-browser-features": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/stylelint-no-unsupported-browser-features/-/stylelint-no-unsupported-browser-features-8.0.1.tgz",
- "integrity": "sha512-tc8Xn5DaqJhxTmbA4H8gZbYdAz027NfuSZv5+cVieQb7BtBrF/1/iKYdpcGwXPl3GtqkQrisiXuGqKkKnzWcLw==",
- "dev": true,
- "requires": {
- "doiuse": "^6.0.2",
- "postcss": "^8.4.32"
- }
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- },
- "supports-hyperlinks": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-3.0.0.tgz",
- "integrity": "sha512-QBDPHyPQDRTy9ku4URNGY5Lah8PAaXs6tAAwp55sL5WCsSW7GIfdf6W5ixfziW+t7wh3GVvHyHHyQ1ESsoRvaA==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0",
- "supports-color": "^7.0.0"
- }
- },
- "supports-preserve-symlinks-flag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
- "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
- "dev": true
- },
- "svg-tags": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz",
- "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
- "dev": true
- },
- "table": {
- "version": "6.8.2",
- "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz",
- "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==",
- "dev": true,
- "requires": {
- "ajv": "^8.0.1",
- "lodash.truncate": "^4.4.2",
- "slice-ansi": "^4.0.0",
- "string-width": "^4.2.3",
- "strip-ansi": "^6.0.1"
- },
- "dependencies": {
- "ajv": {
- "version": "8.16.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz",
- "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==",
- "dev": true,
- "requires": {
- "fast-deep-equal": "^3.1.3",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2",
- "uri-js": "^4.4.1"
- }
- },
- "json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "dev": true
- }
- }
- },
- "tapable": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
- "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
- "dev": true
- },
- "text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true
- },
- "through2": {
- "version": "0.6.5",
- "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
- "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==",
- "dev": true,
- "requires": {
- "readable-stream": ">=1.0.33-1 <1.1.0-0",
- "xtend": ">=4.0.0 <4.1.0-0"
- },
- "dependencies": {
- "readable-stream": {
- "version": "1.0.34",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
- "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==",
- "dev": true,
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.1",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x"
- }
- }
- }
- },
- "to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "requires": {
- "is-number": "^7.0.0"
- }
- },
- "ts-api-utils": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
- "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==",
- "dev": true,
- "requires": {}
- },
- "type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "requires": {
- "prelude-ls": "^1.2.1"
- }
- },
- "type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true
- },
- "typescript": {
- "version": "5.4.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
- "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
- "dev": true,
- "peer": true
- },
- "unc-path-regex": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
- "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==",
- "dev": true
- },
- "underscore.string": {
- "version": "3.3.6",
- "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz",
- "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==",
- "dev": true,
- "requires": {
- "sprintf-js": "^1.1.1",
- "util-deprecate": "^1.0.2"
- }
- },
- "upath": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz",
- "integrity": "sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==",
- "dev": true
- },
- "update-browserslist-db": {
- "version": "1.0.13",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
- "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",
- "dev": true,
- "requires": {
- "escalade": "^3.1.1",
- "picocolors": "^1.0.0"
- }
- },
- "uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dev": true,
- "requires": {
- "punycode": "^2.1.0"
- }
- },
- "util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
- "dev": true
- },
- "v8flags": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz",
- "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==",
- "dev": true,
- "requires": {
- "homedir-polyfill": "^1.0.1"
- }
- },
- "validate-npm-package-license": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
- "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
- "dev": true,
- "requires": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
- },
- "dependencies": {
- "spdx-expression-parse": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
- "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
- "dev": true,
- "requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
- }
- }
- }
- },
- "vue-eslint-parser": {
- "version": "9.4.3",
- "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz",
- "integrity": "sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==",
- "dev": true,
- "requires": {
- "debug": "^4.3.4",
- "eslint-scope": "^7.1.1",
- "eslint-visitor-keys": "^3.3.0",
- "espree": "^9.3.1",
- "esquery": "^1.4.0",
- "lodash": "^4.17.21",
- "semver": "^7.3.6"
- }
- },
- "which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
- "wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- }
- },
- "wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "write-file-atomic": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz",
- "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==",
- "dev": true,
- "requires": {
- "imurmurhash": "^0.1.4",
- "signal-exit": "^4.0.1"
- }
- },
- "xml-name-validator": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz",
- "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==",
- "dev": true
- },
- "xtend": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
- "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
- "dev": true
- },
- "y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "dev": true
- },
- "yaml": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",
- "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==",
- "dev": true
- },
- "yaml-eslint-parser": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.2.2.tgz",
- "integrity": "sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^3.0.0",
- "lodash": "^4.17.21",
- "yaml": "^2.0.0"
- }
- },
- "yargs": {
- "version": "17.7.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
- "dev": true,
- "requires": {
- "cliui": "^8.0.1",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.3",
- "y18n": "^5.0.5",
- "yargs-parser": "^21.1.1"
- }
- },
- "yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "dev": true
- },
- "yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true
- }
}
}
diff --git a/package.json b/package.json
index 36b59ed..9b1fda3 100644
--- a/package.json
+++ b/package.json
@@ -7,15 +7,11 @@
"test": "grunt test"
},
"devDependencies": {
- "ace-builds": "1.32.7",
- "eslint-config-wikimedia": "0.28.2",
+ "eslint-config-wikimedia": "0.31.0",
"grunt": "1.6.1",
"grunt-banana-checker": "0.13.0",
- "grunt-contrib-clean": "2.0.1",
- "grunt-contrib-copy": "1.0.0",
"grunt-eslint": "24.3.0",
- "grunt-exec": "3.0.0",
"grunt-stylelint": "0.20.1",
- "stylelint-config-wikimedia": "0.17.2"
+ "stylelint-config-wikimedia": "0.18.0"
}
}