From 1c19118f82e61b0e0ec2bd7dded0aafb5afbb2aa Mon Sep 17 00:00:00 2001 From: "Juan C. Diaz" Date: Mon, 3 Jan 2022 08:27:23 -0500 Subject: [PATCH 1/9] Fix bug #2851 --- src/basic-languages/shell/shell.test.ts | 34 +++++++++++++++++++++++++ src/basic-languages/shell/shell.ts | 12 ++++++--- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/basic-languages/shell/shell.test.ts b/src/basic-languages/shell/shell.test.ts index 71ce92b0..20bb0124 100644 --- a/src/basic-languages/shell/shell.test.ts +++ b/src/basic-languages/shell/shell.test.ts @@ -33,6 +33,40 @@ testTokenization('shell', [ { startIndex: 14, type: 'white.shell' }, { startIndex: 15, type: '' } ] + }, + // Tests for case reported in bug #2851, do not confuse identifier(with dashes) with attribute + { + line: 'foo-bar --baz gorp -123 --abc-123', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 7, type: 'white.shell' }, + { startIndex: 8, type: 'attribute.name.shell' }, + { startIndex: 13, type: 'white.shell' }, + { startIndex: 14, type: '' }, + { startIndex: 18, type: 'white.shell' }, + { startIndex: 19, type: 'attribute.name.shell' }, + { startIndex: 23, type: 'white.shell' }, + { startIndex: 24, type: 'attribute.name.shell' } + ] + }, + // Bug #2851 add new definition 'Identifiers with dashes', here one test + { + line: 'foo | foo-bar | foo-bar-1 | foo-bar-2021-1', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 3, type: 'white.shell' }, + { startIndex: 4, type: 'delimiter.shell' }, + { startIndex: 5, type: 'white.shell' }, + { startIndex: 6, type: '' }, + { startIndex: 13, type: 'white.shell' }, + { startIndex: 14, type: 'delimiter.shell' }, + { startIndex: 15, type: 'white.shell' }, + { startIndex: 16, type: '' }, + { startIndex: 25, type: 'white.shell' }, + { startIndex: 26, type: 'delimiter.shell' }, + { startIndex: 27, type: 'white.shell' }, + { startIndex: 28, type: '' } + ] } ], diff --git a/src/basic-languages/shell/shell.ts b/src/basic-languages/shell/shell.ts index 20a465a1..8c347d08 100644 --- a/src/basic-languages/shell/shell.ts +++ b/src/basic-languages/shell/shell.ts @@ -134,13 +134,19 @@ export const language = { 'zsh' ], + startingWithDash: /\-+\w+/, + + identifiersWithDashes: /[a-zA-Z]\w+(?:@startingWithDash)+/, + // we include these common regular expressions symbols: /[=>{ } ], + { include: '@whitespace' }, + { include: '@strings' }, { include: '@parameters' }, { include: '@heredoc' }, [/[{}\[\]()]/, '@brackets'], - [/-+\w+/, 'attribute.name'], - [/@symbols/, 'delimiter'], { include: '@numbers' }, From c8be2f878218025ee9f8f69feab20c04bd967587 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 27 Jan 2022 12:47:43 +0100 Subject: [PATCH 2/9] Creates an issue if npm publish task fails. --- .github/publish-failure-issue-template.md | 7 +++++++ .github/workflows/publish.yml | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 .github/publish-failure-issue-template.md diff --git a/.github/publish-failure-issue-template.md b/.github/publish-failure-issue-template.md new file mode 100644 index 00000000..2b9ead2d --- /dev/null +++ b/.github/publish-failure-issue-template.md @@ -0,0 +1,7 @@ +--- +title: NPM Publishing Failed +assignees: [] +labels: bug +--- + +NPM publishing failed. Check the last GitHub Action log. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f6d1729..9c339c38 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -224,3 +224,11 @@ jobs: if: ${{ steps.state.outputs.skip_monaco_editor == 'false' }} working-directory: './monaco-editor/release' run: npm publish --tag ${{ steps.state.outputs.dist_tag }} + + - name: Create Issue On Failure + if: failure() + uses: JasonEtco/create-an-issue@c796bdce77b0eebb39e2f4cb359893d764d4aa91 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: .github/publish-failure-issue-template.md From f3dda000c6c37bb443e58cea63ec50b42ec5882d Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 27 Jan 2022 14:01:22 +0100 Subject: [PATCH 3/9] Fixes create-an-issue commit hash. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9c339c38..0c30fbc2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -227,7 +227,7 @@ jobs: - name: Create Issue On Failure if: failure() - uses: JasonEtco/create-an-issue@c796bdce77b0eebb39e2f4cb359893d764d4aa91 + uses: JasonEtco/create-an-issue@9e6213aec58987fa7d2f4deb8b256b99e63107a2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 22c629374eea839a577393a8cdb41828cfc4fcce Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Thu, 27 Jan 2022 14:17:43 +0100 Subject: [PATCH 4/9] Fixes path to template for create-an-issue action. --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0c30fbc2..36d260c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -231,4 +231,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - filename: .github/publish-failure-issue-template.md + filename: ./monaco-editor/.github/publish-failure-issue-template.md From 8f2bc4ac98bbbce140594eca0a1e11aa493771bc Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 27 Jan 2022 16:54:31 +0100 Subject: [PATCH 5/9] Add support to run from source using `tsc -w` --- metadata.js | 5 +++++ test/manual/dev-setup.js | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/metadata.js b/metadata.js index d74f298a..6215731d 100644 --- a/metadata.js +++ b/metadata.js @@ -18,6 +18,7 @@ rootPath: './out/release/typescript', paths: { // use ./ to indicate it is relative to the `rootPath` + src: './../../amd/typescript', dev: './dev', min: './min', esm: './esm' @@ -30,6 +31,7 @@ rootPath: './out/release/css', paths: { // use ./ to indicate it is relative to the `rootPath` + src: './../../amd/css', dev: './dev', min: './min', esm: './esm' @@ -42,6 +44,7 @@ rootPath: './out/release/json', paths: { // use ./ to indicate it is relative to the `rootPath` + src: './../../amd/json', dev: './dev', min: './min', esm: './esm' @@ -54,6 +57,7 @@ rootPath: './out/release/html', paths: { // use ./ to indicate it is relative to the `rootPath` + src: './../../amd/html', dev: './dev', min: './min', esm: './esm' @@ -66,6 +70,7 @@ rootPath: './out/release/basic-languages', paths: { // use ./ to indicate it is relative to the `rootPath` + src: './../../amd/basic-languages', dev: './dev', min: './min', esm: './esm' diff --git a/test/manual/dev-setup.js b/test/manual/dev-setup.js index 034e5afe..ff95c1eb 100644 --- a/test/manual/dev-setup.js +++ b/test/manual/dev-setup.js @@ -207,6 +207,18 @@ loadScript(RESOLVED_CORE.getResolvedPath(PATH_PREFIX) + '/loader.js', function () { let loaderPathsConfig = {}; + window.AMD = true; + if (IS_FILE_PROTOCOL) { + loaderPathsConfig['vs/language/fillers/monaco-editor-core'] = + DIRNAME + '/.././out/amd/fillers/monaco-editor-core-amd'; + loaderPathsConfig['vs/fillers/monaco-editor-core'] = + DIRNAME + '/.././out/amd/fillers/monaco-editor-core-amd'; + } else { + loaderPathsConfig['vs/language/fillers/monaco-editor-core'] = + PATH_PREFIX + '/monaco-editor/./out/amd/fillers/monaco-editor-core-amd'; + loaderPathsConfig['vs/fillers/monaco-editor-core'] = + PATH_PREFIX + '/monaco-editor/./out/amd/fillers/monaco-editor-core-amd'; + } if (!RESOLVED_CORE.isRelease()) { RESOLVED_PLUGINS.forEach(function (plugin) { plugin.generateLoaderConfig(loaderPathsConfig, PATH_PREFIX); From 75af762db9888df33cf055649316fdf3935a23e4 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 27 Jan 2022 16:56:54 +0100 Subject: [PATCH 6/9] Fix paths when running from `file://` --- test/manual/dev-setup.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/manual/dev-setup.js b/test/manual/dev-setup.js index ff95c1eb..2ebaf5a3 100644 --- a/test/manual/dev-setup.js +++ b/test/manual/dev-setup.js @@ -71,7 +71,7 @@ if (/\.\//.test(resolvedPath)) { // starts with ./ => treat as relative to the root path if (IS_FILE_PROTOCOL) { - resolvedPath = DIRNAME + '/../' + this.rootPath + '/' + resolvedPath; + resolvedPath = DIRNAME + '/../../' + this.rootPath + '/' + resolvedPath; } else { resolvedPath = PATH_PREFIX + '/monaco-editor/' + this.rootPath + '/' + resolvedPath; } @@ -81,13 +81,13 @@ this.isRelease() ) { if (IS_FILE_PROTOCOL) { - resolvedPath = DIRNAME + '/../' + resolvedPath; + resolvedPath = DIRNAME + '/../../' + resolvedPath; } else { resolvedPath = PATH_PREFIX + '/monaco-editor/' + resolvedPath; } } else { if (IS_FILE_PROTOCOL) { - resolvedPath = DIRNAME + '/../..' + resolvedPath; + resolvedPath = DIRNAME + '/../../../' + resolvedPath; } else { resolvedPath = PATH_PREFIX + resolvedPath; } @@ -210,9 +210,9 @@ window.AMD = true; if (IS_FILE_PROTOCOL) { loaderPathsConfig['vs/language/fillers/monaco-editor-core'] = - DIRNAME + '/.././out/amd/fillers/monaco-editor-core-amd'; + DIRNAME + '/../.././out/amd/fillers/monaco-editor-core-amd'; loaderPathsConfig['vs/fillers/monaco-editor-core'] = - DIRNAME + '/.././out/amd/fillers/monaco-editor-core-amd'; + DIRNAME + '/../.././out/amd/fillers/monaco-editor-core-amd'; } else { loaderPathsConfig['vs/language/fillers/monaco-editor-core'] = PATH_PREFIX + '/monaco-editor/./out/amd/fillers/monaco-editor-core-amd'; From 743073476a7a8d667d9bc728dac47690a7a94e07 Mon Sep 17 00:00:00 2001 From: Philip Turner Date: Thu, 27 Jan 2022 19:08:45 -0500 Subject: [PATCH 7/9] Update swift.ts --- src/basic-languages/swift/swift.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/basic-languages/swift/swift.ts b/src/basic-languages/swift/swift.ts index 4a4e7a10..54ed852e 100644 --- a/src/basic-languages/swift/swift.ts +++ b/src/basic-languages/swift/swift.ts @@ -57,8 +57,8 @@ export const language = { '@asyncHandler', '@available', '@convention', - '@derivative', // Swift for TensorFlow - '@differentiable', // Swift for TensorFlow + '@derivative', + '@differentiable', '@discardableResult', '@dynamicCallable', '@dynamicMemberLookup', @@ -72,6 +72,7 @@ export const language = { '@noreturn', '@objc', '@objcMembers', + '@preconcurrency', '@propertyWrapper', '@requires_stored_property_inits', '@resultBuilder', @@ -318,11 +319,6 @@ export const language = { [/./, 'identifier'] ], - // symbol: [ - // [ /@symbols/, 'operator' ], - // [ /@operators/, 'operator' ] - // ], - invokedmethod: [ [ /([.])(@identifier)/, From 4268f423e83c44ef772202d22fd0b2002ae2894d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 28 Jan 2022 20:16:11 +0100 Subject: [PATCH 8/9] Add locker action --- .github/workflows/locker.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/locker.yml diff --git a/.github/workflows/locker.yml b/.github/workflows/locker.yml new file mode 100644 index 00000000..4f1a2d90 --- /dev/null +++ b/.github/workflows/locker.yml @@ -0,0 +1,28 @@ +name: Locker +on: + schedule: + - cron: 21 23 * * * # 5:20pm Redmond + repository_dispatch: + types: [trigger-locker] + # enable users to manually trigger with workflow_dispatch + workflow_dispatch: {} + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions + uses: actions/checkout@v2 + with: + repository: 'microsoft/vscode-github-triage-actions' + path: ./actions + ref: stable + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Run Locker + uses: ./actions/locker + with: + daysSinceClose: 45 + appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} + daysSinceUpdate: 3 + ignoredLabel: '*out-of-scope' From bcc7fd43aae8a739d0b4df437623f5d2eda9de76 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Fri, 28 Jan 2022 20:29:05 +0100 Subject: [PATCH 9/9] Add 'Needs More Info Closer' --- .github/workflows/locker.yml | 3 +- .github/workflows/needs-more-info-closer.yml | 30 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/needs-more-info-closer.yml diff --git a/.github/workflows/locker.yml b/.github/workflows/locker.yml index 4f1a2d90..cf8986b5 100644 --- a/.github/workflows/locker.yml +++ b/.github/workflows/locker.yml @@ -4,8 +4,7 @@ on: - cron: 21 23 * * * # 5:20pm Redmond repository_dispatch: types: [trigger-locker] - # enable users to manually trigger with workflow_dispatch - workflow_dispatch: {} + workflow_dispatch: jobs: main: diff --git a/.github/workflows/needs-more-info-closer.yml b/.github/workflows/needs-more-info-closer.yml new file mode 100644 index 00000000..88de1919 --- /dev/null +++ b/.github/workflows/needs-more-info-closer.yml @@ -0,0 +1,30 @@ +name: Needs More Info Closer +on: + schedule: + - cron: 20 12 * * * # 5:20am Redmond + repository_dispatch: + types: [trigger-needs-more-info] + workflow_dispatch: + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions + uses: actions/checkout@v2 + with: + repository: 'microsoft/vscode-github-triage-actions' + path: ./actions + ref: stable + - name: Install Actions + run: npm install --production --prefix ./actions + - name: Run Needs More Info Closer + uses: ./actions/needs-more-info-closer + with: + appInsightsKey: ${{secrets.TRIAGE_ACTIONS_APP_INSIGHTS}} + label: needs more info + closeDays: 7 + additionalTeam: 'spahnke|rcjsuen' + closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity. See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!" + pingDays: 120 + pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information."