From 54a4e45a10abc8c7edf2dd9febaa5ffc19734892 Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Mon, 3 Oct 2022 12:12:01 -0400 Subject: [PATCH 1/6] Fix the color provider's columns Fix the example so that the document colors' ranges encompass the entire word. Signed-off-by: Remy Suen --- .../color-provider-example/sample.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/playground/new-samples/extending-language-services/color-provider-example/sample.js b/website/playground/new-samples/extending-language-services/color-provider-example/sample.js index 3ce40628..f3c70057 100644 --- a/website/playground/new-samples/extending-language-services/color-provider-example/sample.js +++ b/website/playground/new-samples/extending-language-services/color-provider-example/sample.js @@ -34,27 +34,27 @@ monaco.languages.registerColorProvider('colorLanguage', { color: { red: 1, blue: 0, green: 0, alpha: 1 }, range: { startLineNumber: 1, - startColumn: 0, + startColumn: 1, endLineNumber: 1, - endColumn: 0 + endColumn: 4 } }, { color: { red: 0, blue: 1, green: 0, alpha: 1 }, range: { startLineNumber: 2, - startColumn: 0, + startColumn: 1, endLineNumber: 2, - endColumn: 0 + endColumn: 5 } }, { color: { red: 0, blue: 0, green: 1, alpha: 1 }, range: { startLineNumber: 3, - startColumn: 0, + startColumn: 1, endLineNumber: 3, - endColumn: 0 + endColumn: 6 } } ]; From eac891f9bf7137732df25ce0b645b819983e75b1 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 13 Dec 2022 17:08:03 +0100 Subject: [PATCH 2/6] Fixes CI --- package-lock.json | 14 +++++++------- package.json | 2 +- test/unit/all.js | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index a646e6c2..7e99facc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "0.35.0-dev.20221018.2", + "monaco-editor-core": "0.35.0-dev.20221208", "parcel": "^2.7.0", "playwright": "^1.18.1", "prettier": "^2.5.1", @@ -4519,9 +4519,9 @@ "dev": true }, "node_modules/monaco-editor-core": { - "version": "0.35.0-dev.20221018.2", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.35.0-dev.20221018.2.tgz", - "integrity": "sha512-RHx0zCV7y7WZHL6o4AWDd+SlXaXOegWVcg+tDxnyCrttqGfyh8q2Lwdx6Js+hKdCM2MFiiOkJoROMPQqiDIhbQ==", + "version": "0.35.0-dev.20221208", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.35.0-dev.20221208.tgz", + "integrity": "sha512-XQpKe+FoGoIWDqn/xiz5+Iyi1PrVWArlrBqqkQuWu4IBjUvs7/krZLqnsy/Vfoflu9Ldtoc1JU9wNu0tyDv66A==", "dev": true }, "node_modules/mri": { @@ -9999,9 +9999,9 @@ } }, "monaco-editor-core": { - "version": "0.35.0-dev.20221018.2", - "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.35.0-dev.20221018.2.tgz", - "integrity": "sha512-RHx0zCV7y7WZHL6o4AWDd+SlXaXOegWVcg+tDxnyCrttqGfyh8q2Lwdx6Js+hKdCM2MFiiOkJoROMPQqiDIhbQ==", + "version": "0.35.0-dev.20221208", + "resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.35.0-dev.20221208.tgz", + "integrity": "sha512-XQpKe+FoGoIWDqn/xiz5+Iyi1PrVWArlrBqqkQuWu4IBjUvs7/krZLqnsy/Vfoflu9Ldtoc1JU9wNu0tyDv66A==", "dev": true }, "mri": { diff --git a/package.json b/package.json index fde0e2f3..23039443 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "jsdom": "^19.0.0", "jsonc-parser": "^3.0.0", "mocha": "^9.2.0", - "monaco-editor-core": "0.35.0-dev.20221018.2", + "monaco-editor-core": "0.35.0-dev.20221208", "parcel": "^2.7.0", "playwright": "^1.18.1", "prettier": "^2.5.1", diff --git a/test/unit/all.js b/test/unit/all.js index 4314e146..00cc27a2 100644 --- a/test/unit/all.js +++ b/test/unit/all.js @@ -21,6 +21,7 @@ global.self = global; global.document.queryCommandSupported = function () { return false; }; +global.UIEvent = tmp.window.UIEvent; global.window = { location: {}, From 366b9c38ff23acad2598f5e843bcc388a0224830 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Tue, 13 Dec 2022 17:17:55 +0100 Subject: [PATCH 3/6] Fixes playwright setup issues. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1758728e..abeacf57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: name: CI - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 From b5df92554d770fe21ad324d4087b0bd86f9586ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:40:24 +0000 Subject: [PATCH 4/6] Bump electron from 19.1.6 to 19.1.8 in /samples Bumps [electron](https://github.com/electron/electron) from 19.1.6 to 19.1.8. - [Release notes](https://github.com/electron/electron/releases) - [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md) - [Commits](https://github.com/electron/electron/compare/v19.1.6...v19.1.8) --- updated-dependencies: - dependency-name: electron dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- samples/package-lock.json | 14 +++++++------- samples/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/package-lock.json b/samples/package-lock.json index ab2c69ff..3d303f3c 100644 --- a/samples/package-lock.json +++ b/samples/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "css-loader": "^5.2.7", - "electron": "^19.1.6", + "electron": "^19.1.8", "file-loader": "^6.2.0", "glob": "^7.2.0", "html-webpack-plugin": "^5.5.0", @@ -1372,9 +1372,9 @@ "license": "MIT" }, "node_modules/electron": { - "version": "19.1.6", - "resolved": "https://registry.npmjs.org/electron/-/electron-19.1.6.tgz", - "integrity": "sha512-bT6Mr7JbHbONpr/U7R47lwTkMUvuAyOfnoLlbDqvGocQyZCCN3JB436wtf2+r3/IpMEz3T+dHLweFDY5i2wuxw==", + "version": "19.1.8", + "resolved": "https://registry.npmjs.org/electron/-/electron-19.1.8.tgz", + "integrity": "sha512-UfPQdFjgKI0xCm1V5sV3iAVOs0kCwAE91xWzV5tI7ij14yOkxTdXp9BqTzFaSbQYLYxn6q1BUUe1nlzjJjzAnw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -5427,9 +5427,9 @@ "dev": true }, "electron": { - "version": "19.1.6", - "resolved": "https://registry.npmjs.org/electron/-/electron-19.1.6.tgz", - "integrity": "sha512-bT6Mr7JbHbONpr/U7R47lwTkMUvuAyOfnoLlbDqvGocQyZCCN3JB436wtf2+r3/IpMEz3T+dHLweFDY5i2wuxw==", + "version": "19.1.8", + "resolved": "https://registry.npmjs.org/electron/-/electron-19.1.8.tgz", + "integrity": "sha512-UfPQdFjgKI0xCm1V5sV3iAVOs0kCwAE91xWzV5tI7ij14yOkxTdXp9BqTzFaSbQYLYxn6q1BUUe1nlzjJjzAnw==", "dev": true, "requires": { "@electron/get": "2.0.0", diff --git a/samples/package.json b/samples/package.json index 923fde19..89bb8b98 100644 --- a/samples/package.json +++ b/samples/package.json @@ -11,7 +11,7 @@ "license": "MIT", "devDependencies": { "css-loader": "^5.2.7", - "electron": "^19.1.6", + "electron": "^19.1.8", "file-loader": "^6.2.0", "glob": "^7.2.0", "html-webpack-plugin": "^5.5.0", From 6d9c7ea306dcbf168a33b88345f1ba1a9424f77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 8 Dec 2022 12:00:10 +0100 Subject: [PATCH 5/6] Fix tokenization of bitstrings without spacing --- src/basic-languages/elixir/elixir.test.ts | 27 +++++++++++++++++++++++ src/basic-languages/elixir/elixir.ts | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/basic-languages/elixir/elixir.test.ts b/src/basic-languages/elixir/elixir.test.ts index bd60257e..fe68c922 100644 --- a/src/basic-languages/elixir/elixir.test.ts +++ b/src/basic-languages/elixir/elixir.test.ts @@ -383,5 +383,32 @@ testTokenization('elixir', [ { startIndex: 15, type: 'delimiter.square.elixir' } ] } + ], + // Bitstrings + [ + { + line: '<>', + tokens: [ + { startIndex: 0, type: 'delimiter.angle.special.elixir' }, + { startIndex: 2, type: 'identifier.elixir' }, + { startIndex: 8, type: 'operator.elixir' }, + { startIndex: 10, type: 'number.elixir' }, + { startIndex: 12, type: 'operator.elixir' }, + { startIndex: 13, type: 'identifier.elixir' }, + { startIndex: 20, type: 'punctuation.elixir' }, + { startIndex: 21, type: 'white.elixir' }, + { startIndex: 22, type: 'identifier.elixir' }, + { startIndex: 27, type: 'operator.elixir' }, + { startIndex: 29, type: 'number.elixir' }, + { startIndex: 31, type: 'operator.elixir' }, + { startIndex: 32, type: 'identifier.elixir' }, + { startIndex: 39, type: 'punctuation.elixir' }, + { startIndex: 40, type: 'white.elixir' }, + { startIndex: 41, type: 'identifier.elixir' }, + { startIndex: 45, type: 'operator.elixir' }, + { startIndex: 47, type: 'identifier.elixir' }, + { startIndex: 53, type: 'delimiter.angle.special.elixir' } + ] + } ] ]); diff --git a/src/basic-languages/elixir/elixir.ts b/src/basic-languages/elixir/elixir.ts index ad974a20..210ac6bc 100644 --- a/src/basic-languages/elixir/elixir.ts +++ b/src/basic-languages/elixir/elixir.ts @@ -167,7 +167,7 @@ export const language = { // Keyword list shorthand keywordsShorthand: [ - [/(@atomName)(:)/, ['constant', 'constant.punctuation']], + [/(@atomName)(:)(\s+)/, ['constant', 'constant.punctuation', 'white']], // Use positive look-ahead to ensure the string is followed by : // and should be considered a keyword. [ From b70454a6b9c91933eebe3be7a1a7cacae01377fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 8 Dec 2022 12:11:39 +0100 Subject: [PATCH 6/6] Tokenizer single-quote docstrings as documentation comments --- src/basic-languages/elixir/elixir.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/basic-languages/elixir/elixir.ts b/src/basic-languages/elixir/elixir.ts index 210ac6bc..078d1030 100644 --- a/src/basic-languages/elixir/elixir.ts +++ b/src/basic-languages/elixir/elixir.ts @@ -532,6 +532,13 @@ export const language = { next: '@doubleQuotedHeredocDocstring' } ], + [ + /\@(module|type)?doc (~[sS])?'''/, + { + token: 'comment.block.documentation', + next: '@singleQuotedHeredocDocstring' + } + ], [ /\@(module|type)?doc (~[sS])?"/, { @@ -539,6 +546,13 @@ export const language = { next: '@doubleQuotedStringDocstring' } ], + [ + /\@(module|type)?doc (~[sS])?'/, + { + token: 'comment.block.documentation', + next: '@singleQuotedStringDocstring' + } + ], [/\@(module|type)?doc false/, 'comment.block.documentation'], // Module attributes [/\@(@variableName)/, 'variable'] @@ -549,11 +563,21 @@ export const language = { { include: '@docstringContent' } ], + singleQuotedHeredocDocstring: [ + [/'''/, { token: 'comment.block.documentation', next: '@pop' }], + { include: '@docstringContent' } + ], + doubleQuotedStringDocstring: [ [/"/, { token: 'comment.block.documentation', next: '@pop' }], { include: '@docstringContent' } ], + singleQuotedStringDocstring: [ + [/'/, { token: 'comment.block.documentation', next: '@pop' }], + { include: '@docstringContent' } + ], + // Operators, punctuation, brackets symbols: [