ソースを参照

Merge branch 'microsoft:main' into main

Spencer Williams 3 年 前
コミット
27c31112a6

+ 1 - 3
.vscode/launch.json

@@ -5,11 +5,9 @@
 			"name": "Unit Tests",
 			"type": "node",
 			"request": "launch",
-			"program": "${workspaceRoot}/node_modules/.bin/tape",
+			"program": "./test/all.js",
 			"stopOnEntry": false,
 			"args": [
-				"-r",
-				"./test/all.js"
 				// "--grep",
 				// "typescript"
 			],

ファイルの差分が大きいため隠しています
+ 302 - 345
package-lock.json


+ 11 - 11
package.json

@@ -1,12 +1,12 @@
 {
 	"name": "monaco-languages",
-	"version": "2.8.1",
+	"version": "2.9.0",
 	"description": "Bundle of many languages for the Monaco Editor.",
 	"scripts": {
 		"compile": "mrmdir ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json",
 		"watch": "tsc -p ./src --watch",
 		"watch-esm": "tsc -p ./src/tsconfig.esm.json --watch",
-		"test": "tape -r ./test/all.js",
+		"test": "node ./test/all.js",
 		"prepublishOnly": "mrmdir ./release && npm run compile && node ./scripts/release.js && node ./scripts/bundle",
 		"prettier": "prettier --write ."
 	},
@@ -20,18 +20,18 @@
 		"url": "https://github.com/Microsoft/monaco-languages/issues"
 	},
 	"devDependencies": {
-		"@types/tape": "^4.13.0",
-		"glob": "^7.1.6",
+		"@types/tape": "^4.13.2",
+		"glob": "^7.2.0",
 		"husky": "^4.3.8",
-		"jsdom": "^16.4.0",
-		"monaco-editor-core": "0.28.1",
+		"jsdom": "^17.0.0",
+		"monaco-editor-core": "0.29.1",
 		"monaco-plugin-helpers": "^1.0.3",
-		"prettier": "^2.2.1",
-		"pretty-quick": "^3.1.0",
+		"prettier": "^2.4.1",
+		"pretty-quick": "^3.1.1",
 		"requirejs": "^2.3.6",
-		"tape": "^5.1.1",
-		"terser": "^5.5.1",
-		"typescript": "4.1.3"
+		"tape": "^5.3.1",
+		"terser": "^5.9.0",
+		"typescript": "4.4.3"
 	},
 	"husky": {
 		"hooks": {

+ 162 - 8
src/abap/abap.test.ts

@@ -40,7 +40,7 @@ testTokenization('abap', [
 				{ startIndex: 2, type: '' },
 				{ startIndex: 3, type: 'number.abap' },
 				{ startIndex: 4, type: '' },
-				{ startIndex: 5, type: 'operator.abap' },
+				{ startIndex: 5, type: 'key.abap' },
 				{ startIndex: 6, type: '' },
 				{ startIndex: 7, type: 'number.abap' },
 				{ startIndex: 8, type: 'delimiter.abap' }
@@ -121,7 +121,7 @@ testTokenization('abap', [
 				{ startIndex: 6, type: '' },
 				{ startIndex: 7, type: 'keyword.abap' },
 				{ startIndex: 9, type: '' },
-				{ startIndex: 10, type: 'operator.abap' },
+				{ startIndex: 10, type: 'keyword.abap' },
 				{ startIndex: 13, type: '' },
 				{ startIndex: 14, type: 'keyword.abap' },
 				{ startIndex: 21, type: 'delimiter.abap' }
@@ -156,11 +156,11 @@ testTokenization('abap', [
 			tokens: [
 				{ startIndex: 0, type: 'identifier.abap' },
 				{ startIndex: 3, type: '' },
-				{ startIndex: 4, type: 'operator.abap' },
+				{ startIndex: 4, type: 'key.abap' },
 				{ startIndex: 5, type: '' },
 				{ startIndex: 6, type: 'keyword.abap' },
 				{ startIndex: 10, type: '' },
-				{ startIndex: 11, type: 'operator.abap' },
+				{ startIndex: 11, type: 'key.abap' },
 				{ startIndex: 12, type: 'delimiter.parenthesis.abap' },
 				{ startIndex: 13, type: '' },
 				{ startIndex: 14, type: 'number.abap' },
@@ -178,7 +178,7 @@ testTokenization('abap', [
 				{ startIndex: 5, type: '' },
 				{ startIndex: 6, type: 'identifier.abap' },
 				{ startIndex: 9, type: '' },
-				{ startIndex: 12, type: 'identifier.abap' },
+				{ startIndex: 10, type: 'comment.abap' },
 				{ startIndex: 18, type: 'delimiter.abap' }
 			]
 		}
@@ -189,7 +189,7 @@ testTokenization('abap', [
 			tokens: [
 				{ startIndex: 0, type: 'keyword.abap' },
 				{ startIndex: 6, type: '' },
-				{ startIndex: 7, type: 'operator.abap' },
+				{ startIndex: 7, type: 'key.abap' },
 				{ startIndex: 8, type: '' },
 				{ startIndex: 9, type: 'keyword.abap' },
 				{ startIndex: 13, type: '' },
@@ -197,10 +197,164 @@ testTokenization('abap', [
 				{ startIndex: 19, type: '' },
 				{ startIndex: 20, type: 'keyword.abap' },
 				{ startIndex: 24, type: '' },
-				{ startIndex: 25, type: 'operator.abap' },
-				{ startIndex: 26, type: 'identifier.abap' },
+				{ startIndex: 25, type: 'identifier.abap' },
 				{ startIndex: 29, type: 'delimiter.abap' }
 			]
 		}
+	],
+	[
+		{
+			line: 'li = lines( itab ).',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.abap' },
+				{ startIndex: 2, type: '' },
+				{ startIndex: 3, type: 'key.abap' },
+				{ startIndex: 4, type: '' },
+				{ startIndex: 5, type: 'keyword.abap' },
+				{ startIndex: 10, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 11, type: '' },
+				{ startIndex: 12, type: 'identifier.abap' },
+				{ startIndex: 16, type: '' },
+				{ startIndex: 17, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 18, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: "foo = 'bar' && 'baz'.",
+			tokens: [
+				{ startIndex: 0, type: 'identifier.abap' },
+				{ startIndex: 3, type: '' },
+				{ startIndex: 4, type: 'key.abap' },
+				{ startIndex: 5, type: '' },
+				{ startIndex: 6, type: 'string.abap' },
+				{ startIndex: 11, type: '' },
+				{ startIndex: 12, type: 'key.abap' },
+				{ startIndex: 14, type: '' },
+				{ startIndex: 15, type: 'string.abap' },
+				{ startIndex: 20, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'DATA num TYPE n.',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.abap' },
+				{ startIndex: 4, type: '' },
+				{ startIndex: 5, type: 'identifier.abap' },
+				{ startIndex: 8, type: '' },
+				{ startIndex: 9, type: 'keyword.abap' },
+				{ startIndex: 13, type: '' },
+				{ startIndex: 14, type: 'type.abap' },
+				{ startIndex: 15, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'CLASS-METHODS class_constructor.',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.abap' },
+				{ startIndex: 13, type: '' },
+				{ startIndex: 14, type: 'type.abap' },
+				{ startIndex: 31, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'super->constructor( ).',
+			tokens: [
+				{ startIndex: 0, type: 'type.abap' },
+				{ startIndex: 5, type: 'tag.abap' },
+				{ startIndex: 7, type: 'type.abap' },
+				{ startIndex: 18, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 19, type: '' },
+				{ startIndex: 20, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 21, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'foo->my_method( ).',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.abap' },
+				{ startIndex: 3, type: 'tag.abap' },
+				{ startIndex: 5, type: 'identifier.abap' },
+				{ startIndex: 14, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 15, type: '' },
+				{ startIndex: 16, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 17, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'foo=>const_bar.',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.abap' },
+				{ startIndex: 3, type: 'tag.abap' },
+				{ startIndex: 5, type: 'identifier.abap' },
+				{ startIndex: 14, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'foo-bar+42(42).',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.abap' },
+				{ startIndex: 7, type: '' },
+				{ startIndex: 8, type: 'number.abap' },
+				{ startIndex: 10, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 11, type: 'number.abap' },
+				{ startIndex: 13, type: 'delimiter.parenthesis.abap' },
+				{ startIndex: 14, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: "@EndUserText.label: 'hallo'",
+			tokens: [
+				{ startIndex: 0, type: 'annotation.abap' },
+				{ startIndex: 12, type: 'delimiter.abap' },
+				{ startIndex: 13, type: 'identifier.abap' },
+				{ startIndex: 18, type: 'delimiter.abap' },
+				{ startIndex: 19, type: '' },
+				{ startIndex: 20, type: 'string.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'IF foo = abap_true.',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.abap' },
+				{ startIndex: 2, type: '' },
+				{ startIndex: 3, type: 'identifier.abap' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'key.abap' },
+				{ startIndex: 8, type: '' },
+				{ startIndex: 9, type: 'type.abap' },
+				{ startIndex: 18, type: 'delimiter.abap' }
+			]
+		}
+	],
+	[
+		{
+			line: 'LOOP AT screen.',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.abap' },
+				{ startIndex: 4, type: '' },
+				{ startIndex: 5, type: 'keyword.abap' },
+				{ startIndex: 7, type: '' },
+				{ startIndex: 8, type: 'type.abap' },
+				{ startIndex: 14, type: 'delimiter.abap' }
+			]
+		}
 	]
 ]);

ファイルの差分が大きいため隠しています
+ 1093 - 921
src/abap/abap.ts


+ 2 - 1
src/apex/apex.ts

@@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	// the default separators except `@$`
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['/*', '*/']

+ 2 - 1
src/bat/bat.ts

@@ -44,7 +44,8 @@ export const language = <languages.IMonarchLanguage>{
 		{ token: 'delimiter.square', open: '[', close: ']' }
 	],
 
-	keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
+	keywords:
+		/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
 
 	// we include these common regular expressions
 	symbols: /[=><!~?&|+\-*\/\^;\.,]+/,

+ 6 - 12
src/bicep/bicep.test.ts

@@ -66,8 +66,7 @@ testTokenization('bicep', [
 			]
 		},
 		{
-			line:
-				"    domainConfigurationType/*comment*/:/*comment*/'as//notacomment!d/* also not a comment */fsdf'// test!/*",
+			line: "    domainConfigurationType/*comment*/:/*comment*/'as//notacomment!d/* also not a comment */fsdf'// test!/*",
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 4, type: 'identifier.bicep' },
@@ -374,8 +373,7 @@ testTokenization('bicep', [
 			tokens: [{ startIndex: 0, type: '' }]
 		},
 		{
-			line:
-				"resource secrets1 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = if (secrets0.id == '') {",
+			line: "resource secrets1 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = if (secrets0.id == '') {",
 			tokens: [
 				{ startIndex: 0, type: 'keyword.bicep' },
 				{ startIndex: 8, type: '' },
@@ -429,8 +427,7 @@ testTokenization('bicep', [
 			tokens: []
 		},
 		{
-			line:
-				"resource secrets2 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
+			line: "resource secrets2 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
 			tokens: [
 				{ startIndex: 0, type: 'keyword.bicep' },
 				{ startIndex: 8, type: '' },
@@ -478,8 +475,7 @@ testTokenization('bicep', [
 			tokens: []
 		},
 		{
-			line:
-				"resource secrets3 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
+			line: "resource secrets3 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
 			tokens: [
 				{ startIndex: 0, type: 'keyword.bicep' },
 				{ startIndex: 8, type: '' },
@@ -551,8 +547,7 @@ testTokenization('bicep', [
 			tokens: []
 		},
 		{
-			line:
-				"resource secrets4 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: if (true) {",
+			line: "resource secrets4 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: if (true) {",
 			tokens: [
 				{ startIndex: 0, type: 'keyword.bicep' },
 				{ startIndex: 8, type: '' },
@@ -609,8 +604,7 @@ testTokenization('bicep', [
 			tokens: []
 		},
 		{
-			line:
-				"resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-08-01' existing = {",
+			line: "resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-08-01' existing = {",
 			tokens: [
 				{ startIndex: 0, type: 'keyword.bicep' },
 				{ startIndex: 8, type: '' },

+ 6 - 6
src/cameligo/cameligo.ts

@@ -22,8 +22,8 @@ export const conf: languages.LanguageConfiguration = {
 		{ open: '(', close: ')' },
 		{ open: '<', close: '>' },
 		{ open: "'", close: "'" },
-		{ open: "\"", close: "\""},
-		{ open: "(*", close: "*)"},
+		{ open: '"', close: '"' },
+		{ open: '(*', close: '*)' }
 	],
 	surroundingPairs: [
 		{ open: '{', close: '}' },
@@ -31,8 +31,8 @@ export const conf: languages.LanguageConfiguration = {
 		{ open: '(', close: ')' },
 		{ open: '<', close: '>' },
 		{ open: "'", close: "'" },
-		{ open: "\"", close: "\""},
-		{ open: "(*", close: "*)"},
+		{ open: '"', close: '"' },
+		{ open: '(*', close: '*)' }
 	]
 };
 
@@ -88,7 +88,7 @@ export const language = <languages.IMonarchLanguage>{
 		'to',
 		'true',
 		'type',
-		'with',
+		'with'
 	],
 
 	typeKeywords: ['int', 'unit', 'string', 'tz', 'nat', 'bool'],
@@ -116,7 +116,7 @@ export const language = <languages.IMonarchLanguage>{
 		'->',
 		'<-',
 		'&&',
-		'||',
+		'||'
 	],
 
 	// we include these common regular expressions

+ 6 - 3
src/clojure/clojure.ts

@@ -46,16 +46,19 @@ export const language = <languages.IMonarchLanguage>{
 
 	// delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/,
 
-	numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
+	numbers:
+		/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
 
-	characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
+	characters:
+		/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
 
 	escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
 
 	// simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/
 	// simple-symbol    := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/
 	// qualified-symbol := (<simple-namespace>(<.><simple-namespace>)*</>)?<simple-symbol>
-	qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
+	qualifiedSymbols:
+		/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
 
 	specialForms: [
 		'.',

+ 1 - 2
src/coffee/coffee.test.ts

@@ -809,8 +809,7 @@ testTokenization('coffeescript', [
 	// syntax highligting issue with {} - bug 16176
 	[
 		{
-			line:
-				'"/api/v2/course/#{ $stateParams.courseId }/grading/student/#{$stateParams.studentId}",',
+			line: '"/api/v2/course/#{ $stateParams.courseId }/grading/student/#{$stateParams.studentId}",',
 			tokens: [
 				{ startIndex: 0, type: 'string.coffee' },
 				{ startIndex: 18, type: '' },

+ 2 - 1
src/coffee/coffee.ts

@@ -6,7 +6,8 @@
 import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		blockComment: ['###', '###'],
 		lineComment: '#'

+ 2 - 1
src/csharp/csharp.ts

@@ -6,7 +6,8 @@
 import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['/*', '*/']

+ 2 - 4
src/css/css.test.ts

@@ -484,8 +484,7 @@ testTokenization('css', [
 	// .a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}
 	[
 		{
-			line:
-				'.a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}',
+			line: '.a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}',
 			tokens: [
 				{ startIndex: 0, type: 'tag.css' },
 				{ startIndex: 2, type: 'delimiter.bracket.css' },
@@ -515,8 +514,7 @@ testTokenization('css', [
 	//.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}
 	[
 		{
-			line:
-				'.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}',
+			line: '.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}',
 			tokens: [
 				{ startIndex: 0, type: 'tag.css' },
 				{ startIndex: 5, type: '' },

+ 4 - 8
src/dockerfile/dockerfile.test.ts

@@ -53,8 +53,7 @@ testTokenization('dockerfile', [
 			tokens: []
 		},
 		{
-			line:
-				'ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh',
+			line: 'ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh',
 			tokens: [
 				{ startIndex: 0, type: 'keyword.dockerfile' },
 				{ startIndex: 7, type: '' },
@@ -79,8 +78,7 @@ testTokenization('dockerfile', [
 			tokens: [{ startIndex: 0, type: 'string.dockerfile' }]
 		},
 		{
-			line:
-				'    && kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"',
+			line: '    && kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"',
 			tokens: [
 				{ startIndex: 0, type: 'string.dockerfile' },
 				{ startIndex: 42, type: 'variable.dockerfile' },
@@ -94,8 +92,7 @@ testTokenization('dockerfile', [
 			tokens: []
 		},
 		{
-			line:
-				'# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)',
+			line: '# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)',
 			tokens: [{ startIndex: 0, type: 'comment.dockerfile' }]
 		},
 		{
@@ -129,8 +126,7 @@ testTokenization('dockerfile', [
 			]
 		},
 		{
-			line:
-				'    && curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \\',
+			line: '    && curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \\',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 58, type: 'variable.dockerfile' },

+ 2 - 1
src/elixir/elixir.ts

@@ -108,7 +108,8 @@ export const language = <languages.IMonarchLanguage>{
 
 	// Matches any of the operator names:
 	// <<< >>> ||| &&& ^^^ ~~~ === !== ~>> <~> |~> <|> == != <= >= && || \\ <> ++ -- |> =~ -> <- ~> <~ :: .. = < > + - * / | . ^ & !
-	operator: /-[->]?|!={0,2}|\*|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
+	operator:
+		/-[->]?|!={0,2}|\*|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
 
 	// See https://hexdocs.pm/elixir/syntax-reference.html#variables
 	variableName: /[a-z_][a-zA-Z0-9_]*[?!]?/,

+ 13 - 0
src/flow9/flow9.contribution.ts

@@ -0,0 +1,13 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { registerLanguage } from '../_.contribution';
+
+registerLanguage({
+	id: 'flow9',
+	extensions: ['.flow'],
+	aliases: ['Flow9', 'Flow', 'flow9', 'flow'],
+	loader: () => import('./flow9')
+});

+ 148 - 0
src/flow9/flow9.test.ts

@@ -0,0 +1,148 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import { testTokenization } from '../test/testRunner';
+
+testTokenization('flow9', [
+	[
+		{
+			line: '//',
+			tokens: [{ startIndex: 0, type: 'comment.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '    // a comment',
+			tokens: [
+				{ startIndex: 0, type: '' },
+				{ startIndex: 4, type: 'comment.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: '/* //*/ a',
+			tokens: [
+				{ startIndex: 0, type: 'comment.flow' },
+				{ startIndex: 7, type: '' },
+				{ startIndex: 8, type: 'identifier.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: '/import file 1',
+			tokens: [
+				{ startIndex: 0, type: 'delimiter.flow' },
+				{ startIndex: 1, type: 'keyword.flow' },
+				{ startIndex: 7, type: '' },
+				{ startIndex: 8, type: 'identifier.flow' },
+				{ startIndex: 12, type: '' },
+				{ startIndex: 13, type: 'number.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'getDefaults() -> [int] {}',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.flow' },
+				{ startIndex: 11, type: 'delimiter.flow' },
+				{ startIndex: 13, type: '' },
+				{ startIndex: 14, type: 'delimiter.flow' },
+				{ startIndex: 16, type: '' },
+				{ startIndex: 17, type: 'delimiter.flow' },
+				{ startIndex: 18, type: 'type.flow' },
+				{ startIndex: 21, type: 'delimiter.flow' },
+				{ startIndex: 22, type: '' },
+				{ startIndex: 23, type: 'delimiter.flow' }
+			]
+		}
+	],
+
+	// Numbers
+	[
+		{
+			line: '0',
+			tokens: [{ startIndex: 0, type: 'number.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '0.10',
+			tokens: [{ startIndex: 0, type: 'number.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '0x123',
+			tokens: [{ startIndex: 0, type: 'number.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '052_',
+			tokens: [
+				{ startIndex: 0, type: 'number.flow' },
+				{ startIndex: 3, type: 'identifier.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: '0+0',
+			tokens: [
+				{ startIndex: 0, type: 'number.flow' },
+				{ startIndex: 1, type: 'delimiter.flow' },
+				{ startIndex: 2, type: 'number.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: '0 + 0',
+			tokens: [
+				{ startIndex: 0, type: 'number.flow' },
+				{ startIndex: 1, type: '' },
+				{ startIndex: 2, type: 'delimiter.flow' },
+				{ startIndex: 3, type: '' },
+				{ startIndex: 4, type: 'number.flow' }
+			]
+		}
+	],
+
+	[
+		{
+			line: '"simple string"',
+			tokens: [{ startIndex: 0, type: 'string.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '""',
+			tokens: [{ startIndex: 0, type: 'string.flow' }]
+		}
+	],
+
+	[
+		{
+			line: '"""',
+			tokens: [
+				{ startIndex: 0, type: 'string.flow' },
+				{ startIndex: 2, type: 'string.invalid.flow' }
+			]
+		}
+	]
+]);

+ 163 - 0
src/flow9/flow9.ts

@@ -0,0 +1,163 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License. See License.txt in the project root for license information.
+ *--------------------------------------------------------------------------------------------*/
+
+import type { languages } from '../fillers/monaco-editor-core';
+
+export const conf: languages.LanguageConfiguration = {
+	comments: {
+		blockComment: ['/*', '*/'],
+		lineComment: '//'
+	},
+	brackets: [
+		['{', '}'],
+		['[', ']'],
+		['(', ')']
+	],
+	autoClosingPairs: [
+		{ open: '{', close: '}', notIn: ['string'] },
+		{ open: '[', close: ']', notIn: ['string'] },
+		{ open: '(', close: ')', notIn: ['string'] },
+		{ open: '"', close: '"', notIn: ['string'] },
+		{ open: "'", close: "'", notIn: ['string'] }
+	],
+	surroundingPairs: [
+		{ open: '{', close: '}' },
+		{ open: '[', close: ']' },
+		{ open: '(', close: ')' },
+		{ open: '"', close: '"' },
+		{ open: "'", close: "'" },
+		{ open: '<', close: '>' }
+	]
+};
+
+export const language = <languages.IMonarchLanguage>{
+	defaultToken: '',
+	tokenPostfix: '.flow',
+
+	keywords: [
+		'import',
+		'require',
+		'export',
+		'forbid',
+		'native',
+		'if',
+		'else',
+		'cast',
+		'unsafe',
+		'switch',
+		'default'
+	],
+
+	types: [
+		'io',
+		'mutable',
+		'bool',
+		'int',
+		'double',
+		'string',
+		'flow',
+		'void',
+		'ref',
+		'true',
+		'false',
+		'with'
+	],
+
+	operators: [
+		'=',
+		'>',
+		'<',
+		'<=',
+		'>=',
+		'==',
+		'!',
+		'!=',
+		':=',
+		'::=',
+		'&&',
+		'||',
+		'+',
+		'-',
+		'*',
+		'/',
+		'@',
+		'&',
+		'%',
+		':',
+		'->',
+		'\\',
+		'$',
+		'??',
+		'^'
+	],
+
+	symbols: /[@$=><!~?:&|+\-*\\\/\^%]+/,
+	escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
+
+	// The main tokenizer for our languages
+	tokenizer: {
+		root: [
+			// identifiers and keywords
+			[
+				/[a-zA-Z_]\w*/,
+				{
+					cases: {
+						'@keywords': 'keyword',
+						'@types': 'type',
+						'@default': 'identifier'
+					}
+				}
+			],
+
+			// whitespace
+			{ include: '@whitespace' },
+
+			// delimiters and operators
+			[/[{}()\[\]]/, 'delimiter'],
+			[/[<>](?!@symbols)/, 'delimiter'],
+			[
+				/@symbols/,
+				{
+					cases: {
+						'@operators': 'delimiter',
+						'@default': ''
+					}
+				}
+			],
+
+			// numbers
+			[
+				/((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)/,
+				'number'
+			],
+
+			// delimiter: after number because of .\d floats
+			[/[;,.]/, 'delimiter'],
+
+			// strings
+			[/"([^"\\]|\\.)*$/, 'string.invalid'],
+			[/"/, 'string', '@string']
+		],
+
+		whitespace: [
+			[/[ \t\r\n]+/, ''],
+			[/\/\*/, 'comment', '@comment'],
+			[/\/\/.*$/, 'comment']
+		],
+
+		comment: [
+			[/[^\/*]+/, 'comment'],
+			[/\*\//, 'comment', '@pop'],
+			[/[\/*]/, 'comment']
+		],
+
+		string: [
+			[/[^\\"]+/, 'string'],
+			[/@escapes/, 'string.escape'],
+			[/\\./, 'string.escape.invalid'],
+			[/"/, 'string', '@pop']
+		]
+	}
+};

+ 3 - 2
src/hcl/hcl.ts

@@ -7,7 +7,7 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	comments: {
-		lineComment: '//',
+		lineComment: '#',
 		blockComment: ['/*', '*/']
 	},
 	brackets: [
@@ -76,7 +76,8 @@ export const language = <languages.IMonarchLanguage>{
 
 	symbols: /[=><!~?:&|+\-*\/\^%]+/,
 	escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
-	terraformFunctions: /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
+	terraformFunctions:
+		/(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
 	terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
 	tokenizer: {
 		root: [

+ 146 - 0
src/java/java.test.ts

@@ -728,5 +728,151 @@ testTokenization('java', [
 				{ startIndex: 29, type: 'keyword.private.java' }
 			]
 		}
+	],
+
+	[
+		{
+			line: 'String s = """Multiline string""";',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.java' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'identifier.java' },
+				{ startIndex: 8, type: '' },
+				{ startIndex: 9, type: 'delimiter.java' },
+				{ startIndex: 10, type: '' },
+				{ startIndex: 11, type: 'string.java' },
+				{ startIndex: 33, type: 'delimiter.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'String s = """',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.java' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'identifier.java' },
+				{ startIndex: 8, type: '' },
+				{ startIndex: 9, type: 'delimiter.java' },
+				{ startIndex: 10, type: '' },
+				{ startIndex: 11, type: 'string.java' }
+			]
+		},
+		{
+			line: '     <html></html>',
+			tokens: [{ startIndex: 0, type: 'string.java' }]
+		},
+		{
+			line: '     """;',
+			tokens: [
+				{ startIndex: 0, type: 'string.java' },
+				{ startIndex: 8, type: 'delimiter.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'String s = """',
+			tokens: [
+				{ startIndex: 0, type: 'identifier.java' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'identifier.java' },
+				{ startIndex: 8, type: '' },
+				{ startIndex: 9, type: 'delimiter.java' },
+				{ startIndex: 10, type: '' },
+				{ startIndex: 11, type: 'string.java' }
+			]
+		},
+
+		{
+			line: '     \\"""Triple quoted string inside text block\\"""',
+			tokens: [
+				{ startIndex: 0, type: 'string.java' },
+				{ startIndex: 5, type: 'string.escape.java' },
+				{ startIndex: 7, type: 'string.java' },
+				{ startIndex: 47, type: 'string.escape.java' },
+				{ startIndex: 49, type: 'string.java' }
+			]
+		},
+
+		{
+			line: '     """;',
+			tokens: [
+				{ startIndex: 0, type: 'string.java' },
+				{ startIndex: 8, type: 'delimiter.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'yield "123"',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.yield.java' },
+				{ startIndex: 5, type: '' },
+				{ startIndex: 6, type: 'string.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'public sealed class Shape permits Circle, Square { }',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.public.java' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'keyword.sealed.java' },
+				{ startIndex: 13, type: '' },
+				{ startIndex: 14, type: 'keyword.class.java' },
+				{ startIndex: 19, type: '' },
+				{ startIndex: 20, type: 'identifier.java' },
+				{ startIndex: 25, type: '' },
+				{ startIndex: 26, type: 'keyword.permits.java' },
+				{ startIndex: 33, type: '' },
+				{ startIndex: 34, type: 'identifier.java' },
+				{ startIndex: 40, type: 'delimiter.java' },
+				{ startIndex: 41, type: '' },
+				{ startIndex: 42, type: 'identifier.java' },
+				{ startIndex: 48, type: '' },
+				{ startIndex: 49, type: 'delimiter.curly.java' },
+				{ startIndex: 50, type: '' },
+				{ startIndex: 51, type: 'delimiter.curly.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'public non-sealed class Shape',
+			tokens: [
+				{ startIndex: 0, type: 'keyword.public.java' },
+				{ startIndex: 6, type: '' },
+				{ startIndex: 7, type: 'keyword.non-sealed.java' },
+				{ startIndex: 17, type: '' },
+				{ startIndex: 18, type: 'keyword.class.java' },
+				{ startIndex: 23, type: '' },
+				{ startIndex: 24, type: 'identifier.java' }
+			]
+		}
+	],
+
+	[
+		{
+			line: 'int x = y-z;', // Make sure "y-z" is not identifier
+			tokens: [
+				{ startIndex: 0, type: 'keyword.int.java' },
+				{ startIndex: 3, type: '' },
+				{ startIndex: 4, type: 'identifier.java' },
+				{ startIndex: 5, type: '' },
+				{ startIndex: 6, type: 'delimiter.java' },
+				{ startIndex: 7, type: '' },
+				{ startIndex: 8, type: 'identifier.java' },
+				{ startIndex: 9, type: 'delimiter.java' },
+				{ startIndex: 10, type: 'identifier.java' },
+				{ startIndex: 11, type: 'delimiter.java' }
+			]
+		}
 	]
 ]);

+ 20 - 2
src/java/java.ts

@@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	// the default separators except `@$`
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['/*', '*/']
@@ -96,7 +97,12 @@ export const language = <languages.IMonarchLanguage>{
 		'super',
 		'while',
 		'true',
-		'false'
+		'false',
+		'yield',
+		'record',
+		'sealed',
+		'non-sealed',
+		'permits'
 	],
 
 	operators: [
@@ -150,6 +156,9 @@ export const language = <languages.IMonarchLanguage>{
 	// The main tokenizer for our languages
 	tokenizer: {
 		root: [
+			// Special keyword with a dash
+			['non-sealed', 'keyword.non-sealed'],
+
 			// identifiers and keywords
 			[
 				/[a-zA-Z_$][\w$]*/,
@@ -194,6 +203,7 @@ export const language = <languages.IMonarchLanguage>{
 
 			// strings
 			[/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string
+			[/"""/, 'string', '@multistring'],
 			[/"/, 'string', '@string'],
 
 			// characters
@@ -230,6 +240,14 @@ export const language = <languages.IMonarchLanguage>{
 			[/@escapes/, 'string.escape'],
 			[/\\./, 'string.escape.invalid'],
 			[/"/, 'string', '@pop']
+		],
+
+		multistring: [
+			[/[^\\"]+/, 'string'],
+			[/@escapes/, 'string.escape'],
+			[/\\./, 'string.escape.invalid'],
+			[/"""/, 'string', '@pop'],
+			[/./, 'string']
 		]
 	}
 };

+ 2 - 1
src/kotlin/kotlin.ts

@@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	// the default separators except `@$`
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['/*', '*/']

+ 1 - 2
src/less/less.test.ts

@@ -1001,8 +1001,7 @@ testTokenization(
 
 		[
 			{
-				line:
-					'.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { background: -webkit-gradient(color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop))); }',
+				line: '.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { background: -webkit-gradient(color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop))); }',
 				tokens: [
 					{ startIndex: 0, type: 'tag.class.less' },
 					{ startIndex: 12, type: 'delimiter.parenthesis.less' },

+ 2 - 4
src/liquid/liquid.test.ts

@@ -118,8 +118,7 @@ testTokenization(
 		// If tag / keywords / block style tags
 		[
 			{
-				line:
-					'<div>{% if true=false %}<div>True</div>{% else %}<div>False</div>{% endif %}</div>',
+				line: '<div>{% if true=false %}<div>True</div>{% else %}<div>False</div>{% endif %}</div>',
 				tokens: [
 					{ startIndex: 0, type: 'delimiter.html' },
 					{ startIndex: 1, type: 'tag.html' },
@@ -187,8 +186,7 @@ testTokenization(
 		// Raw tag
 		[
 			{
-				line:
-					'<div>Everything here should be escaped {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %}</div>',
+				line: '<div>Everything here should be escaped {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %}</div>',
 				tokens: [
 					{ startIndex: 0, type: 'delimiter.html' },
 					{ startIndex: 1, type: 'tag.html' },

+ 1 - 1
src/liquid/liquid.ts

@@ -216,7 +216,7 @@ export const language = <languages.IMonarchLanguage>{
 			[/^(?!\{\%\s*endraw\s*\%\}).+/],
 			[/\{\%/, 'delimiter.tag.liquid'],
 			[/@identifier/],
-			[/\%\}/, { token: 'delimiter.tag.liquid', next: '@root' }],
+			[/\%\}/, { token: 'delimiter.tag.liquid', next: '@root' }]
 		],
 
 		liquidRoot: [

+ 2 - 1
src/mips/mips.ts

@@ -6,7 +6,8 @@
 import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		blockComment: ['###', '###'],
 		lineComment: '#'

+ 1 - 0
src/monaco.contribution.ts

@@ -19,6 +19,7 @@ import './dart/dart.contribution';
 import './dockerfile/dockerfile.contribution';
 import './ecl/ecl.contribution';
 import './elixir/elixir.contribution';
+import './flow9/flow9.contribution';
 import './fsharp/fsharp.contribution';
 import './go/go.contribution';
 import './graphql/graphql.contribution';

+ 1 - 2
src/objective-c/objective-c.test.ts

@@ -9,8 +9,7 @@ testTokenization('objective-c', [
 	// Keywords
 	[
 		{
-			line:
-				'-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager',
+			line: '-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 1, type: 'delimiter.parenthesis.objective-c' },

+ 2 - 1
src/pascal/pascal.ts

@@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	// the default separators except `@$`
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['{', '}']

+ 1 - 2
src/php/php.test.ts

@@ -2258,8 +2258,7 @@ testTokenization(
 		// HTML (CSS (PHP)), HTML ( PHP, JS (PHP), PHP)
 		[
 			{
-				line:
-					'<html><style><?="div"?> { color:blue; }</style><!--<?="HTML Comment"?>--><script>var x = 3;/* <?="JS Comment"/*</script>*/?> */var y = 4;</script></html><? $x = 3;?>',
+				line: '<html><style><?="div"?> { color:blue; }</style><!--<?="HTML Comment"?>--><script>var x = 3;/* <?="JS Comment"/*</script>*/?> */var y = 4;</script></html><? $x = 3;?>',
 				tokens: [
 					{ startIndex: 0, type: 'delimiter.html' },
 					{ startIndex: 1, type: 'tag.html' },

+ 2 - 1
src/php/php.ts

@@ -6,7 +6,8 @@
 import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 
 	comments: {
 		lineComment: '//',

+ 2 - 1
src/postiats/postiats.ts

@@ -459,7 +459,8 @@ export const language = <languages.IMonarchLanguage>{
 	fexponent_bin: /[pP][+-]?[0-9]+/,
 	deciexp: /\.[0-9]*@fexponent?/,
 	hexiexp: /\.[0-9a-zA-Z]*@fexponent_bin?/,
-	irregular_keywords: /val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
+	irregular_keywords:
+		/val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
 	ESCHAR: /[ntvbrfa\\\?'"\(\[\{]/,
 
 	start: 'root',

+ 6 - 12
src/powershell/powershell.test.ts

@@ -480,8 +480,7 @@ testTokenization('powershell', [
 			]
 		},
 		{
-			line:
-				'#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list',
+			line: '#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list',
 			tokens: [{ startIndex: 0, type: 'comment.ps1' }]
 		},
 		{
@@ -527,8 +526,7 @@ testTokenization('powershell', [
 			]
 		},
 		{
-			line:
-				'		#When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
+			line: '		#When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 2, type: 'comment.ps1' }
@@ -622,8 +620,7 @@ testTokenization('powershell', [
 			]
 		},
 		{
-			line:
-				'		#When a disconnected server is selected there is no session information, we get null for everything except class',
+			line: '		#When a disconnected server is selected there is no session information, we get null for everything except class',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 2, type: 'comment.ps1' }
@@ -662,8 +659,7 @@ testTokenization('powershell', [
 			]
 		},
 		{
-			line:
-				'		Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
+			line: '		Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 20, type: 'delimiter.ps1' },
@@ -689,16 +685,14 @@ testTokenization('powershell', [
 			]
 		},
 		{
-			line:
-				'		#-properties allows us to filter the results to just include the selected object',
+			line: '		#-properties allows us to filter the results to just include the selected object',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 2, type: 'comment.ps1' }
 			]
 		},
 		{
-			line:
-				'		$exp = "Get-XenServer:{0} -properties @{{uuid=\'{1}\'}}" -f $parameterSet["class"], $parameterSet["objUuid"]',
+			line: '		$exp = "Get-XenServer:{0} -properties @{{uuid=\'{1}\'}}" -f $parameterSet["class"], $parameterSet["objUuid"]',
 			tokens: [
 				{ startIndex: 0, type: '' },
 				{ startIndex: 2, type: 'variable.ps1' },

+ 4 - 2
src/powershell/powershell.ts

@@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
 	// the default separators except `$-`
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 	comments: {
 		lineComment: '#',
 		blockComment: ['<#', '#>']
@@ -90,7 +91,8 @@ export const language = <languages.IMonarchLanguage>{
 		'configuration'
 	],
 
-	helpKeywords: /SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
+	helpKeywords:
+		/SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
 
 	// we include these common regular expressions
 	symbols: /[=><!~?&%|+\-*\/\^;\.,]+/,

+ 1 - 2
src/pug/pug.test.ts

@@ -380,8 +380,7 @@ testTokenization('pug', [
 			]
 		},
 		{
-			line:
-				'        // Disclaimer: You will need to turn insertSpaces to true in order for the',
+			line: '        // Disclaimer: You will need to turn insertSpaces to true in order for the',
 			tokens: [{ startIndex: 0, type: 'comment.pug' }]
 		},
 		{

+ 3 - 5
src/r/r.test.ts

@@ -107,13 +107,11 @@ testTokenization('r', [
 			tokens: [
 				{ startIndex: 0, type: 'white.r' },
 				{ startIndex: 1, type: 'comment.doc.r' }
-			]			
+			]
 		},
 		{
-			line: " ",
-			tokens: [
-				{ startIndex: 0, type: 'white.r' },
-			]
+			line: ' ',
+			tokens: [{ startIndex: 0, type: 'white.r' }]
 		}
 	],
 

+ 60 - 60
src/r/r.ts

@@ -33,66 +33,66 @@ export const language = <languages.IMonarchLanguage>{
 	tokenPostfix: '.r',
 
 	roxygen: [
-    '@alias',
-    '@aliases',
-    '@assignee',
-    '@author',
-    '@backref',
-    '@callGraph',
-    '@callGraphDepth',
-    '@callGraphPrimitives',
-    '@concept',
-    '@describeIn',
-    '@description',
-    '@details',
-    '@docType',
-    '@encoding',
-    '@evalNamespace',
-    '@evalRd',
-    '@example',
-    '@examples',
-    '@export',
-    '@exportClass',
-    '@exportMethod',
-    '@exportPattern',
-    '@family',
-    '@field',
-    '@formals',
-    '@format',
-    '@import',
-    '@importClassesFrom',
-    '@importFrom',
-    '@importMethodsFrom',
-    '@include',
-    '@inherit',
-    '@inheritDotParams',
-    '@inheritParams',
-    '@inheritSection',
-    '@keywords',
-    '@md',
-    '@method',
-    '@name',
-    '@noMd',
-    '@noRd',
-    '@note',
-    '@param',
-    '@rawNamespace',
-    '@rawRd',
-    '@rdname',
-    '@references',
-    '@return',
-    '@S3method',
-    '@section',
-    '@seealso',
-    '@setClass',
-    '@slot',
-    '@source',
-    '@template',
-    '@templateVar',
-    '@title',
-    '@TODO',
-    '@usage',
-    '@useDynLib'
+		'@alias',
+		'@aliases',
+		'@assignee',
+		'@author',
+		'@backref',
+		'@callGraph',
+		'@callGraphDepth',
+		'@callGraphPrimitives',
+		'@concept',
+		'@describeIn',
+		'@description',
+		'@details',
+		'@docType',
+		'@encoding',
+		'@evalNamespace',
+		'@evalRd',
+		'@example',
+		'@examples',
+		'@export',
+		'@exportClass',
+		'@exportMethod',
+		'@exportPattern',
+		'@family',
+		'@field',
+		'@formals',
+		'@format',
+		'@import',
+		'@importClassesFrom',
+		'@importFrom',
+		'@importMethodsFrom',
+		'@include',
+		'@inherit',
+		'@inheritDotParams',
+		'@inheritParams',
+		'@inheritSection',
+		'@keywords',
+		'@md',
+		'@method',
+		'@name',
+		'@noMd',
+		'@noRd',
+		'@note',
+		'@param',
+		'@rawNamespace',
+		'@rawRd',
+		'@rdname',
+		'@references',
+		'@return',
+		'@S3method',
+		'@section',
+		'@seealso',
+		'@setClass',
+		'@slot',
+		'@source',
+		'@template',
+		'@templateVar',
+		'@title',
+		'@TODO',
+		'@usage',
+		'@useDynLib'
 	],
 
 	constants: [

+ 1 - 1
src/rust/rust.test.ts

@@ -50,7 +50,7 @@ testTokenization('rust', [
 			tokens: [{ startIndex: 0, type: 'string.byteliteral.rust' }]
 		}
 	],
-	
+
 	// Comment
 	[
 		{

+ 2 - 1
src/scala/scala.ts

@@ -12,7 +12,8 @@ export const conf: languages.LanguageConfiguration = {
 	 * unary_<op> is allowed as an identifier.
 	 * <name>_= is allowed as an identifier.
 	 */
-	wordPattern: /(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
+	wordPattern:
+		/(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
 	comments: {
 		lineComment: '//',
 		blockComment: ['/*', '*/']

+ 4 - 2
src/swift/swift.ts

@@ -143,8 +143,10 @@ export const language = <languages.IMonarchLanguage>{
 	symbols: /[=(){}\[\].,:;@#\_&\-<>`?!+*\\\/]/,
 
 	// Moved . to operatorstart so it can be a delimiter
-	operatorstart: /[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,
-	operatorend: /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,
+	operatorstart:
+		/[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,
+	operatorend:
+		/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,
 	operators: /(@operatorstart)((@operatorstart)|(@operatorend))*/,
 
 	// TODO(owensd): These are borrowed from C#; need to validate correctness for Swift.

+ 1 - 2
src/systemverilog/systemverilog.test.ts

@@ -335,8 +335,7 @@ testTokenization('systemverilog', [
 	],
 	[
 		{
-			line:
-				'typedef enum int {FAST_SIM = 0, RANDOM = 1, NOMINAL = 2, START_UP = 3} clock_plan_e;',
+			line: 'typedef enum int {FAST_SIM = 0, RANDOM = 1, NOMINAL = 2, START_UP = 3} clock_plan_e;',
 			tokens: [
 				{ startIndex: 0, type: 'keyword.typedef.sv' },
 				{ startIndex: 7, type: '' },

+ 10 - 10
src/test/testRunner.ts

@@ -18,6 +18,12 @@ export interface ITestItem {
 	tokens: IRelaxedToken[];
 }
 
+function timeout(ms: number) {
+	return new Promise((resolve, reject) => {
+		setTimeout(resolve, ms);
+	});
+}
+
 export function testTokenization(_language: string | string[], tests: ITestItem[][]): void {
 	let languages: string[];
 	if (typeof _language === 'string') {
@@ -27,16 +33,10 @@ export function testTokenization(_language: string | string[], tests: ITestItem[
 	}
 	let mainLanguage = languages[0];
 
-	test(mainLanguage + ' tokenization', (t: test.Test) => {
-		Promise.all(languages.map((l) => loadLanguage(l)))
-			.then(() => {
-				// clean stack
-				setTimeout(() => {
-					runTests(t, mainLanguage, tests);
-					t.end();
-				});
-			})
-			.then(null, () => t.end());
+	test(mainLanguage + ' tokenization', async (t: test.Test) => {
+		await Promise.all(languages.map((l) => loadLanguage(l)));
+		await timeout(0);
+		runTests(t, mainLanguage, tests);
 	});
 }
 

+ 2 - 1
src/typescript/typescript.ts

@@ -6,7 +6,8 @@
 import { languages } from '../fillers/monaco-editor-core';
 
 export const conf: languages.LanguageConfiguration = {
-	wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
+	wordPattern:
+		/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
 
 	comments: {
 		lineComment: '//',

+ 1 - 2
src/yaml/yaml.test.ts

@@ -452,8 +452,7 @@ testTokenization('yaml', [
 	],
 	[
 		{
-			line:
-				"text: Pretty vector drawing. #this is comment doesn't have proper syntax higlighting",
+			line: "text: Pretty vector drawing. #this is comment doesn't have proper syntax higlighting",
 			tokens: [
 				{ startIndex: 0, type: 'type.yaml' },
 				{ startIndex: 4, type: 'operators.yaml' },

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません