mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686
This commit is contained in:
committed by
Anthony Dresser
parent
404260b8a0
commit
4ad73d381c
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
@@ -100,7 +100,9 @@
|
|||||||
"--no-cached-data",
|
"--no-cached-data",
|
||||||
],
|
],
|
||||||
"webRoot": "${workspaceFolder}",
|
"webRoot": "${workspaceFolder}",
|
||||||
// Settings for js-debug:
|
"cascadeTerminateToConfigurations": [
|
||||||
|
"Attach to Extension Host"
|
||||||
|
],
|
||||||
"userDataDir": false,
|
"userDataDir": false,
|
||||||
"pauseForSourceMap": false,
|
"pauseForSourceMap": false,
|
||||||
"outFiles": [
|
"outFiles": [
|
||||||
@@ -113,7 +115,7 @@
|
|||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch ADS (Web) (TBD)",
|
"name": "Launch ADS (Web) (TBD)",
|
||||||
"program": "${workspaceFolder}/resources/serverless/code-web.js",
|
"program": "${workspaceFolder}/resources/web/code-web.js",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"group": "0_vscode",
|
"group": "0_vscode",
|
||||||
"order": 2
|
"order": 2
|
||||||
@@ -274,6 +276,7 @@
|
|||||||
"Attach to Extension Host",
|
"Attach to Extension Host",
|
||||||
"Attach to Shared Process",
|
"Attach to Shared Process",
|
||||||
],
|
],
|
||||||
|
"preLaunchTask": "Ensure Prelaunch Dependencies",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"group": "0_vscode",
|
"group": "0_vscode",
|
||||||
"order": 1
|
"order": 1
|
||||||
|
|||||||
2
.vscode/notebooks/api.github-issues
vendored
2
.vscode/notebooks/api.github-issues
vendored
@@ -8,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
"language": "github-issues",
|
"language": "github-issues",
|
||||||
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"July 2020\"",
|
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"August 2020\"",
|
||||||
"editable": true
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
9
.vscode/notebooks/inbox.github-issues
vendored
9
.vscode/notebooks/inbox.github-issues
vendored
@@ -8,17 +8,20 @@
|
|||||||
{
|
{
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
"language": "github-issues",
|
"language": "github-issues",
|
||||||
"value": "$inbox=repo:microsoft/vscode is:open no:assignee -label:feature-request -label:testplan-item -label:plan-item "
|
"value": "$inbox=repo:microsoft/vscode is:open no:assignee -label:feature-request -label:testplan-item -label:plan-item ",
|
||||||
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": 1,
|
"kind": 1,
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"value": "## Inbox tracking and Issue triage"
|
"value": "## Inbox tracking and Issue triage",
|
||||||
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": 1,
|
"kind": 1,
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"value": "New issues or pull requests submitted by the community are initially triaged by an [automatic classification bot](https://github.com/microsoft/vscode-github-triage-actions/tree/master/classifier-deep). Issues that the bot does not correctly triage are then triaged by a team member. The team rotates the inbox tracker on a weekly basis.\n\nA [mirror](https://github.com/JacksonKearl/testissues/issues) of the VS Code issue stream is available with details about how the bot classifies issues, including feature-area classifications and confidence ratings. Per-category confidence thresholds and feature-area ownership data is maintained in [.github/classifier.json](https://github.com/microsoft/vscode/blob/master/.github/classifier.json). \n\n💡 The bot is being run through a GitHub action that runs every 30 minutes. Give the bot the opportunity to classify an issue before doing it manually.\n\n### Inbox Tracking\n\nThe inbox tracker is responsible for the [global inbox](https://github.com/Microsoft/vscode/issues?utf8=%E2%9C%93&q=is%3Aopen+no%3Aassignee+-label%3Afeature-request+-label%3Atestplan-item+-label%3Aplan-item) containing all **open issues and pull requests** that\n- are neither **feature requests** nor **test plan items** nor **plan items** and\n- have **no owner assignment**.\n\nThe **inbox tracker** may perform any step described in our [issue triaging documentation](https://github.com/microsoft/vscode/wiki/Issues-Triaging) but its main responsibility is to route issues to the actual feature area owner.\n\nFeature area owners track the **feature area inbox** containing all **open issues and pull requests** that\n- are personally assigned to them and are not assigned to any milestone\n- are labeled with their feature area label and are not assigned to any milestone.\nThis secondary triage may involve any of the steps described in our [issue triaging documentation](https://github.com/microsoft/vscode/wiki/Issues-Triaging) and results in a fully triaged or closed issue.\n\nThe [github triage extension](https://github.com/microsoft/vscode-github-triage-extension) can be used to assist with triaging — it provides a \"Command Palette\"-style list of triaging actions like assignment, labeling, and triggers for various bot actions."
|
"value": "New issues or pull requests submitted by the community are initially triaged by an [automatic classification bot](https://github.com/microsoft/vscode-github-triage-actions/tree/master/classifier-deep). Issues that the bot does not correctly triage are then triaged by a team member. The team rotates the inbox tracker on a weekly basis.\n\nA [mirror](https://github.com/JacksonKearl/testissues/issues) of the VS Code issue stream is available with details about how the bot classifies issues, including feature-area classifications and confidence ratings. Per-category confidence thresholds and feature-area ownership data is maintained in [.github/classifier.json](https://github.com/microsoft/vscode/blob/master/.github/classifier.json). \n\n💡 The bot is being run through a GitHub action that runs every 30 minutes. Give the bot the opportunity to classify an issue before doing it manually.\n\n### Inbox Tracking\n\nThe inbox tracker is responsible for the [global inbox](https://github.com/Microsoft/vscode/issues?utf8=%E2%9C%93&q=is%3Aopen+no%3Aassignee+-label%3Afeature-request+-label%3Atestplan-item+-label%3Aplan-item) containing all **open issues and pull requests** that\n- are neither **feature requests** nor **test plan items** nor **plan items** and\n- have **no owner assignment**.\n\nThe **inbox tracker** may perform any step described in our [issue triaging documentation](https://github.com/microsoft/vscode/wiki/Issues-Triaging) but its main responsibility is to route issues to the actual feature area owner.\n\nFeature area owners track the **feature area inbox** containing all **open issues and pull requests** that\n- are personally assigned to them and are not assigned to any milestone\n- are labeled with their feature area label and are not assigned to any milestone.\nThis secondary triage may involve any of the steps described in our [issue triaging documentation](https://github.com/microsoft/vscode/wiki/Issues-Triaging) and results in a fully triaged or closed issue.\n\nThe [github triage extension](https://github.com/microsoft/vscode-github-triage-extension) can be used to assist with triaging — it provides a \"Command Palette\"-style list of triaging actions like assignment, labeling, and triggers for various bot actions.",
|
||||||
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": 1,
|
"kind": 1,
|
||||||
|
|||||||
2
.vscode/notebooks/my-work.github-issues
vendored
2
.vscode/notebooks/my-work.github-issues
vendored
@@ -8,7 +8,7 @@
|
|||||||
{
|
{
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
"language": "github-issues",
|
"language": "github-issues",
|
||||||
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks\n\n// current milestone name\n$milestone=milestone:\"June 2020\"",
|
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks\n\n// current milestone name\n$milestone=milestone:\"August 2020\"",
|
||||||
"editable": true
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
5
.vscode/notebooks/verification.github-issues
vendored
5
.vscode/notebooks/verification.github-issues
vendored
@@ -14,7 +14,7 @@
|
|||||||
{
|
{
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
"language": "github-issues",
|
"language": "github-issues",
|
||||||
"value": "$repos=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks \n$milestone=milestone:\"June 2020\"",
|
"value": "$repos=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks \n$milestone=milestone:\"July 2020\"",
|
||||||
"editable": true
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,8 @@
|
|||||||
{
|
{
|
||||||
"kind": 1,
|
"kind": 1,
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"value": "### All"
|
"value": "### All",
|
||||||
|
"editable": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
|
|||||||
10
.vscode/searches/es6.code-search
vendored
10
.vscode/searches/es6.code-search
vendored
@@ -34,11 +34,11 @@ src/vs/base/common/arrays.ts:
|
|||||||
420 */
|
420 */
|
||||||
421 export function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;
|
421 export function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;
|
||||||
|
|
||||||
569
|
568
|
||||||
570 /**
|
569 /**
|
||||||
571: * @deprecated ES6: use `Array.find`
|
570: * @deprecated ES6: use `Array.find`
|
||||||
572 */
|
571 */
|
||||||
573 export function find<T>(arr: ArrayLike<T>, predicate: (value: T, index: number, arr: ArrayLike<T>) => any): T | undefined {
|
572 export function find<T>(arr: ArrayLike<T>, predicate: (value: T, index: number, arr: ArrayLike<T>) => any): T | undefined {
|
||||||
|
|
||||||
src/vs/base/common/objects.ts:
|
src/vs/base/common/objects.ts:
|
||||||
115
|
115
|
||||||
|
|||||||
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -203,7 +203,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "node build/lib/prelaunch.js",
|
"command": "node build/lib/preLaunch.js",
|
||||||
"label": "Ensure Prelaunch Dependencies",
|
"label": "Ensure Prelaunch Dependencies",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"reveal": "silent"
|
"reveal": "silent"
|
||||||
|
|||||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
|||||||
disturl "https://atom.io/download/electron"
|
disturl "https://atom.io/download/electron"
|
||||||
target "7.3.2"
|
target "9.2.0"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
|
||||||
inputs:
|
inputs:
|
||||||
@@ -50,7 +50,7 @@ steps:
|
|||||||
displayName: Run Unit Tests (Electron)
|
displayName: Run Unit Tests (Electron)
|
||||||
|
|
||||||
# - script: | {{SQL CARBON EDIT}} disable
|
# - script: | {{SQL CARBON EDIT}} disable
|
||||||
# yarn test-browser --browser chromium --browser webkit --browser firefox
|
# yarn test-browser --browser chromium --browser webkit --browser firefox --tfs "Browser Unit Tests"
|
||||||
# displayName: Run Unit Tests (Browser)
|
# displayName: Run Unit Tests (Browser)
|
||||||
|
|
||||||
# - script: | {{SQL CARBON EDIT}} disable
|
# - script: | {{SQL CARBON EDIT}} disable
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -101,7 +101,7 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
yarn test-browser --build --browser chromium --browser webkit --browser firefox
|
yarn test-browser --build --browser chromium --browser webkit --browser firefox --tfs "Browser Unit Tests"
|
||||||
displayName: Run unit tests (Browser)
|
displayName: Run unit tests (Browser)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
@@ -118,6 +118,13 @@ steps:
|
|||||||
displayName: Run integration tests (Electron)
|
displayName: Run integration tests (Electron)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
|
||||||
|
./resources/server/test/test-web-integration.sh --browser webkit
|
||||||
|
displayName: Run integration tests (Browser)
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
||||||
@@ -128,13 +135,6 @@ steps:
|
|||||||
displayName: Run remote integration tests (Electron)
|
displayName: Run remote integration tests (Electron)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- script: |
|
|
||||||
set -e
|
|
||||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
|
|
||||||
./resources/server/test/test-web-integration.sh --browser webkit
|
|
||||||
displayName: Run integration tests (Browser)
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
||||||
@@ -160,6 +160,13 @@ steps:
|
|||||||
continueOnError: true
|
continueOnError: true
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: Publish Tests Results
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: '*-results.xml'
|
||||||
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
|
security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pr:
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: AzureKeyVault@1
|
- task: AzureKeyVault@1
|
||||||
displayName: 'Azure Key Vault: Get Secrets'
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pr:
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: AzureKeyVault@1
|
- task: AzureKeyVault@1
|
||||||
displayName: 'Azure Key Vault: Get Secrets'
|
displayName: 'Azure Key Vault: Get Secrets'
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
|
||||||
inputs:
|
inputs:
|
||||||
@@ -67,7 +67,7 @@ steps:
|
|||||||
displayName: Run Unit Tests (Electron)
|
displayName: Run Unit Tests (Electron)
|
||||||
|
|
||||||
# - script: | {{SQL CARBON EDIT}} disable
|
# - script: | {{SQL CARBON EDIT}} disable
|
||||||
# DISPLAY=:10 yarn test-browser --browser chromium
|
# DISPLAY=:10 yarn test-browser --browser chromium --tfs "Browser Unit Tests"
|
||||||
# displayName: Run Unit Tests (Browser)
|
# displayName: Run Unit Tests (Browser)
|
||||||
|
|
||||||
# - script: | {{SQL CARBON EDIT}} disable
|
# - script: | {{SQL CARBON EDIT}} disable
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -106,7 +106,7 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
DISPLAY=:10 yarn test-browser --build --browser chromium
|
DISPLAY=:10 yarn test-browser --build --browser chromium --tfs "Browser Unit Tests"
|
||||||
displayName: Run unit tests (Browser)
|
displayName: Run unit tests (Browser)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
@@ -123,6 +123,13 @@ steps:
|
|||||||
displayName: Run integration tests (Electron)
|
displayName: Run integration tests (Electron)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set -e
|
||||||
|
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \
|
||||||
|
DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium
|
||||||
|
displayName: Run integration tests (Browser)
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
|
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
|
||||||
@@ -133,13 +140,6 @@ steps:
|
|||||||
displayName: Run remote integration tests (Electron)
|
displayName: Run remote integration tests (Electron)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- script: |
|
|
||||||
set -e
|
|
||||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \
|
|
||||||
DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium
|
|
||||||
displayName: Run integration tests (Browser)
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
|
||||||
|
|
||||||
- task: PublishPipelineArtifact@0
|
- task: PublishPipelineArtifact@0
|
||||||
inputs:
|
inputs:
|
||||||
artifactName: crash-dump-linux
|
artifactName: crash-dump-linux
|
||||||
@@ -148,6 +148,13 @@ steps:
|
|||||||
continueOnError: true
|
continueOnError: true
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: Publish Tests Results
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: '*-results.xml'
|
||||||
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
yarn gulp "vscode-linux-x64-build-deb"
|
yarn gulp "vscode-linux-x64-build-deb"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -1,157 +1,3 @@
|
|||||||
resources:
|
|
||||||
containers:
|
|
||||||
- container: vscode-x64
|
|
||||||
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
|
||||||
endpoint: VSCodeHub
|
|
||||||
- container: snapcraft
|
|
||||||
image: snapcore/snapcraft:stable
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
- job: Compile
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
container: vscode-x64
|
|
||||||
steps:
|
|
||||||
- template: product-compile.yml
|
|
||||||
|
|
||||||
- job: Windows
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_WIN32'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: VS2017-Win2016
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: x64
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: win32/product-build-win32.yml
|
|
||||||
|
|
||||||
- job: Windows32
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_WIN32_32BIT'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: VS2017-Win2016
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: ia32
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: win32/product-build-win32.yml
|
|
||||||
|
|
||||||
- job: WindowsARM64
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_WIN32_ARM64'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: VS2017-Win2016
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: arm64
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: win32/product-build-win32-arm64.yml
|
|
||||||
|
|
||||||
- job: Linux
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
container: vscode-x64
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: linux/product-build-linux.yml
|
|
||||||
|
|
||||||
- job: LinuxSnap
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
container: snapcraft
|
|
||||||
dependsOn: Linux
|
|
||||||
steps:
|
|
||||||
- template: linux/snap-build-linux.yml
|
|
||||||
|
|
||||||
- job: LinuxArmhf
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: armhf
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: linux/product-build-linux-multiarch.yml
|
|
||||||
|
|
||||||
- job: LinuxArm64
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: arm64
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: linux/product-build-linux-multiarch.yml
|
|
||||||
|
|
||||||
- job: LinuxAlpine
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: alpine
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: linux/product-build-linux-multiarch.yml
|
|
||||||
|
|
||||||
- job: LinuxWeb
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_WEB'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
variables:
|
|
||||||
VSCODE_ARCH: x64
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: web/product-build-web.yml
|
|
||||||
|
|
||||||
- job: macOS
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_MACOS'], 'true'))
|
|
||||||
pool:
|
|
||||||
vmImage: macOS-latest
|
|
||||||
dependsOn:
|
|
||||||
- Compile
|
|
||||||
steps:
|
|
||||||
- template: darwin/product-build-darwin.yml
|
|
||||||
|
|
||||||
- job: Release
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), or(eq(variables['VSCODE_RELEASE'], 'true'), and(or(eq(variables['VSCODE_QUALITY'], 'insider'), eq(variables['VSCODE_QUALITY'], 'exploration')), eq(variables['Build.Reason'], 'Schedule'))))
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
dependsOn:
|
|
||||||
- Windows
|
|
||||||
- Windows32
|
|
||||||
- Linux
|
|
||||||
- LinuxSnap
|
|
||||||
- LinuxArmhf
|
|
||||||
- LinuxArm64
|
|
||||||
- LinuxAlpine
|
|
||||||
- macOS
|
|
||||||
steps:
|
|
||||||
- template: release.yml
|
|
||||||
|
|
||||||
- job: Mooncake
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
condition: and(succeededOrFailed(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'))
|
|
||||||
dependsOn:
|
|
||||||
- Windows
|
|
||||||
- Windows32
|
|
||||||
- Linux
|
|
||||||
- LinuxSnap
|
|
||||||
- LinuxArmhf
|
|
||||||
- LinuxArm64
|
|
||||||
- LinuxAlpine
|
|
||||||
- LinuxWeb
|
|
||||||
- macOS
|
|
||||||
steps:
|
|
||||||
- template: sync-mooncake.yml
|
|
||||||
|
|
||||||
trigger: none
|
trigger: none
|
||||||
pr: none
|
pr: none
|
||||||
|
|
||||||
@@ -161,3 +7,138 @@ schedules:
|
|||||||
branches:
|
branches:
|
||||||
include:
|
include:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
resources:
|
||||||
|
containers:
|
||||||
|
- container: vscode-x64
|
||||||
|
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
||||||
|
endpoint: VSCodeHub
|
||||||
|
- container: snapcraft
|
||||||
|
image: snapcore/snapcraft:stable
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- stage: Compile
|
||||||
|
jobs:
|
||||||
|
- job: Compile
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
container: vscode-x64
|
||||||
|
steps:
|
||||||
|
- template: product-compile.yml
|
||||||
|
|
||||||
|
- stage: Windows
|
||||||
|
dependsOn:
|
||||||
|
- Compile
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'))
|
||||||
|
pool:
|
||||||
|
vmImage: VS2017-Win2016
|
||||||
|
jobs:
|
||||||
|
- job: Windows
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: x64
|
||||||
|
steps:
|
||||||
|
- template: win32/product-build-win32.yml
|
||||||
|
|
||||||
|
- job: Windows32
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32_32BIT'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: ia32
|
||||||
|
steps:
|
||||||
|
- template: win32/product-build-win32.yml
|
||||||
|
|
||||||
|
- job: WindowsARM64
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32_ARM64'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: arm64
|
||||||
|
steps:
|
||||||
|
- template: win32/product-build-win32-arm64.yml
|
||||||
|
|
||||||
|
- stage: Linux
|
||||||
|
dependsOn:
|
||||||
|
- Compile
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'))
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
jobs:
|
||||||
|
- job: Linux
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
|
||||||
|
container: vscode-x64
|
||||||
|
steps:
|
||||||
|
- template: linux/product-build-linux.yml
|
||||||
|
|
||||||
|
- job: LinuxSnap
|
||||||
|
dependsOn:
|
||||||
|
- Linux
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX'], 'true'))
|
||||||
|
container: snapcraft
|
||||||
|
steps:
|
||||||
|
- template: linux/snap-build-linux.yml
|
||||||
|
|
||||||
|
- job: LinuxArmhf
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: armhf
|
||||||
|
steps:
|
||||||
|
- template: linux/product-build-linux-multiarch.yml
|
||||||
|
|
||||||
|
- job: LinuxArm64
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ARM64'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: arm64
|
||||||
|
steps:
|
||||||
|
- template: linux/product-build-linux-multiarch.yml
|
||||||
|
|
||||||
|
- job: LinuxAlpine
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_LINUX_ALPINE'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: alpine
|
||||||
|
steps:
|
||||||
|
- template: linux/product-build-linux-multiarch.yml
|
||||||
|
|
||||||
|
- job: LinuxWeb
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WEB'], 'true'))
|
||||||
|
variables:
|
||||||
|
VSCODE_ARCH: x64
|
||||||
|
steps:
|
||||||
|
- template: web/product-build-web.yml
|
||||||
|
|
||||||
|
- stage: macOS
|
||||||
|
dependsOn:
|
||||||
|
- Compile
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'))
|
||||||
|
pool:
|
||||||
|
vmImage: macOS-latest
|
||||||
|
jobs:
|
||||||
|
- job: macOS
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_BUILD_MACOS'], 'true'))
|
||||||
|
steps:
|
||||||
|
- template: darwin/product-build-darwin.yml
|
||||||
|
|
||||||
|
- stage: Mooncake
|
||||||
|
dependsOn:
|
||||||
|
- Windows
|
||||||
|
- Linux
|
||||||
|
- macOS
|
||||||
|
condition: and(succeededOrFailed(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'))
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
jobs:
|
||||||
|
- job: SyncMooncake
|
||||||
|
displayName: Sync Mooncake
|
||||||
|
steps:
|
||||||
|
- template: sync-mooncake.yml
|
||||||
|
|
||||||
|
- stage: Publish
|
||||||
|
dependsOn:
|
||||||
|
- Windows
|
||||||
|
- Linux
|
||||||
|
- macOS
|
||||||
|
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), or(eq(variables['VSCODE_RELEASE'], 'true'), and(or(eq(variables['VSCODE_QUALITY'], 'insider'), eq(variables['VSCODE_QUALITY'], 'exploration')), eq(variables['Build.Reason'], 'Schedule'))))
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
jobs:
|
||||||
|
- job: BuildService
|
||||||
|
displayName: Build Service
|
||||||
|
steps:
|
||||||
|
- template: release.yml
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pr: none
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function repeat(str: string, times: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function convertTabsToSpaces(str: string): string {
|
function convertTabsToSpaces(str: string): string {
|
||||||
return str.replace(/^\t+/gm, value => repeat(' ', value.length));
|
return str.replace(/\t/gm, value => repeat(' ', value.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNewFileContent(content: string, tag: string) {
|
function getNewFileContent(content: string, tag: string) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 # {{SQL CARBON EDIT}} update version
|
||||||
inputs:
|
inputs:
|
||||||
@@ -57,7 +57,7 @@ steps:
|
|||||||
displayName: Run Unit Tests (Electron)
|
displayName: Run Unit Tests (Electron)
|
||||||
|
|
||||||
# - powershell: | {{SQL CARBON EDIT}} disable
|
# - powershell: | {{SQL CARBON EDIT}} disable
|
||||||
# yarn test-browser --browser chromium --browser firefox
|
# yarn test-browser --browser chromium --browser firefox --tfs "Browser Unit Tests"
|
||||||
# displayName: Run Unit Tests (Browser)
|
# displayName: Run Unit Tests (Browser)
|
||||||
|
|
||||||
# - powershell: | {{SQL CARBON EDIT}} disable
|
# - powershell: | {{SQL CARBON EDIT}} disable
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ steps:
|
|||||||
|
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "12.13.0"
|
versionSpec: "12.14.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -115,7 +115,7 @@ steps:
|
|||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { yarn test-browser --build --browser chromium --browser firefox }
|
exec { yarn test-browser --build --browser chromium --browser firefox --tfs "Browser Unit Tests" }
|
||||||
displayName: Run unit tests (Browser)
|
displayName: Run unit tests (Browser)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
@@ -135,18 +135,18 @@ steps:
|
|||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
exec { $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-web-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-web-integration.bat --browser firefox }
|
||||||
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
displayName: Run integration tests (Browser)
|
||||||
$AppNameShort = $AppProductJson.nameShort
|
|
||||||
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-remote-integration.bat }
|
|
||||||
displayName: Run remote integration tests (Electron)
|
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- powershell: |
|
- powershell: |
|
||||||
. build/azure-pipelines/win32/exec.ps1
|
. build/azure-pipelines/win32/exec.ps1
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
exec { $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-web-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-web-integration.bat --browser firefox }
|
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||||
displayName: Run integration tests (Browser)
|
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
||||||
|
$AppNameShort = $AppProductJson.nameShort
|
||||||
|
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-remote-integration.bat }
|
||||||
|
displayName: Run remote integration tests (Electron)
|
||||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||||
|
|
||||||
- task: PublishPipelineArtifact@0
|
- task: PublishPipelineArtifact@0
|
||||||
@@ -157,6 +157,13 @@ steps:
|
|||||||
continueOnError: true
|
continueOnError: true
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: Publish Tests Results
|
||||||
|
inputs:
|
||||||
|
testResultsFiles: '*-results.xml'
|
||||||
|
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
|
||||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||||
inputs:
|
inputs:
|
||||||
ConnectedServiceName: 'ESRP CodeSign'
|
ConnectedServiceName: 'ESRP CodeSign'
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ const copyrightFilter = [
|
|||||||
'!resources/linux/snap/snapcraft.yaml',
|
'!resources/linux/snap/snapcraft.yaml',
|
||||||
'!resources/linux/snap/electron-launch',
|
'!resources/linux/snap/electron-launch',
|
||||||
'!resources/win32/bin/code.js',
|
'!resources/win32/bin/code.js',
|
||||||
|
'!resources/web/code-web.js',
|
||||||
'!resources/completions/**',
|
'!resources/completions/**',
|
||||||
'!extensions/markdown-language-features/media/highlight.css',
|
'!extensions/markdown-language-features/media/highlight.css',
|
||||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||||
@@ -145,6 +146,7 @@ const copyrightFilter = [
|
|||||||
'!src/vs/editor/test/node/classification/typescript-test.ts',
|
'!src/vs/editor/test/node/classification/typescript-test.ts',
|
||||||
'!scripts/code-web.js',
|
'!scripts/code-web.js',
|
||||||
'!resources/serverless/code-web.js',
|
'!resources/serverless/code-web.js',
|
||||||
|
'!src/vs/editor/test/node/classification/typescript-test.ts',
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
'!extensions/notebook/src/intellisense/text.ts',
|
'!extensions/notebook/src/intellisense/text.ts',
|
||||||
'!extensions/mssql/src/hdfs/webhdfs.ts',
|
'!extensions/mssql/src/hdfs/webhdfs.ts',
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ const vscodeResources = [
|
|||||||
'out-build/sql/workbench/parts/notebook/media/**/*.svg',
|
'out-build/sql/workbench/parts/notebook/media/**/*.svg',
|
||||||
'out-build/sql/setup.js', // {{SQL CARBON EDIT}} end
|
'out-build/sql/setup.js', // {{SQL CARBON EDIT}} end
|
||||||
'out-build/vs/code/electron-sandbox/processExplorer/processExplorer.js',
|
'out-build/vs/code/electron-sandbox/processExplorer/processExplorer.js',
|
||||||
'out-build/vs/platform/auth/common/auth.css',
|
'out-build/vs/code/electron-sandbox/proxy/auth.js',
|
||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ const fancyLog = require('fancy-log');
|
|||||||
const ansiColors = require('ansi-colors');
|
const ansiColors = require('ansi-colors');
|
||||||
|
|
||||||
const root = path.dirname(path.dirname(__dirname));
|
const root = path.dirname(path.dirname(__dirname));
|
||||||
const builtInExtensions = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8')).builtInExtensions;
|
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||||
|
const builtInExtensions = productjson.builtInExtensions;
|
||||||
|
const webBuiltInExtensions = productjson.webBuiltInExtensions;
|
||||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||||
|
|
||||||
@@ -107,7 +109,7 @@ exports.getBuiltInExtensions = function getBuiltInExtensions() {
|
|||||||
const control = readControlFile();
|
const control = readControlFile();
|
||||||
const streams = [];
|
const streams = [];
|
||||||
|
|
||||||
for (const extension of builtInExtensions) {
|
for (const extension of [...builtInExtensions, ...webBuiltInExtensions]) {
|
||||||
let controlState = control[extension.name] || 'marketplace';
|
let controlState = control[extension.name] || 'marketplace';
|
||||||
control[extension.name] = controlState;
|
control[extension.name] = controlState;
|
||||||
|
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ function packageLocalExtensionsStream(forWeb) {
|
|||||||
const extensionName = path.basename(extensionPath);
|
const extensionName = path.basename(extensionPath);
|
||||||
return { name: extensionName, path: extensionPath, manifestPath: absoluteManifestPath };
|
return { name: extensionName, path: extensionPath, manifestPath: absoluteManifestPath };
|
||||||
})
|
})
|
||||||
.filter(({ name }) => (name === 'vscode-web-playground' ? forWeb : true)) // package vscode-web-playground only for web
|
|
||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => externalExtensions.indexOf(name) === -1) // {{SQL CARBON EDIT}} Remove external Extensions with separate package
|
.filter(({ name }) => externalExtensions.indexOf(name) === -1) // {{SQL CARBON EDIT}} Remove external Extensions with separate package
|
||||||
|
|||||||
@@ -308,7 +308,6 @@ export function packageLocalExtensionsStream(forWeb: boolean): Stream {
|
|||||||
const extensionName = path.basename(extensionPath);
|
const extensionName = path.basename(extensionPath);
|
||||||
return { name: extensionName, path: extensionPath, manifestPath: absoluteManifestPath };
|
return { name: extensionName, path: extensionPath, manifestPath: absoluteManifestPath };
|
||||||
})
|
})
|
||||||
.filter(({ name }) => (name === 'vscode-web-playground' ? forWeb : true)) // package vscode-web-playground only for web
|
|
||||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||||
.filter(({ name }) => externalExtensions.indexOf(name) === -1) // {{SQL CARBON EDIT}} Remove external Extensions with separate package
|
.filter(({ name }) => externalExtensions.indexOf(name) === -1) // {{SQL CARBON EDIT}} Remove external Extensions with separate package
|
||||||
|
|||||||
@@ -246,10 +246,6 @@
|
|||||||
"name": "vs/workbench/services/configurationResolver",
|
"name": "vs/workbench/services/configurationResolver",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "vs/workbench/services/crashReporter",
|
|
||||||
"project": "vscode-workbench"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/dialogs",
|
"name": "vs/workbench/services/dialogs",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
"rollup-plugin-commonjs": "^10.1.0",
|
"rollup-plugin-commonjs": "^10.1.0",
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
"rollup-plugin-node-resolve": "^5.2.0",
|
||||||
"terser": "4.3.8",
|
"terser": "4.3.8",
|
||||||
"typescript": "^4.0.0-dev.20200803",
|
"typescript": "^4.0.1-rc",
|
||||||
"vsce": "1.48.0",
|
"vsce": "1.48.0",
|
||||||
"vscode-telemetry-extractor": "^1.6.0",
|
"vscode-telemetry-extractor": "^1.6.0",
|
||||||
"xml2js": "^0.4.17"
|
"xml2js": "^0.4.17"
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ Source: "{#ProductJsonPath}"; DestDir: "{code:GetDestDir}\resources\app"; Flags:
|
|||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; AppUserModelID: "{#AppUserId}"
|
Name: "{group}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; AppUserModelID: "{#AppUserId}"
|
||||||
Name: "{commondesktop}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: desktopicon; AppUserModelID: "{#AppUserId}"
|
Name: "{autodesktop}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: desktopicon; AppUserModelID: "{#AppUserId}"
|
||||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: quicklaunchicon; AppUserModelID: "{#AppUserId}"
|
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: quicklaunchicon; AppUserModelID: "{#AppUserId}"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
|
|||||||
@@ -3544,10 +3544,10 @@ typescript@^3.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
|
||||||
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
|
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
|
||||||
|
|
||||||
typescript@^4.0.0-dev.20200803:
|
typescript@^4.0.1-rc:
|
||||||
version "4.0.0-dev.20200803"
|
version "4.0.1-rc"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.0-dev.20200803.tgz#ea8b0e9fb2ee3085598ff200c8568f04f4cbb2ba"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.1-rc.tgz#8adc78223eae56fe71d906a5fa90c3543b07a677"
|
||||||
integrity sha512-f/jDkFqCs0gbUd5MCUijO9u3AOMx1x1HdRDDHSidlc6uPVEkRduxjeTFhIXbGutO7ivzv+aC2sxH+1FQwsyBcg==
|
integrity sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw==
|
||||||
|
|
||||||
typical@^4.0.0:
|
typical@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "chromium",
|
"name": "chromium",
|
||||||
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
|
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
|
||||||
"commitHash": "e4745133a1d3745f066e068b8033c6a269b59caf"
|
"commitHash": "894fb9eb56c6cbda65e3c3ae9ada6d4cb5850cc9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
],
|
],
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"version": "78.0.3904.130"
|
"version": "83.0.4103.122"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -48,11 +48,11 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "nodejs",
|
"name": "nodejs",
|
||||||
"repositoryUrl": "https://github.com/nodejs/node",
|
"repositoryUrl": "https://github.com/nodejs/node",
|
||||||
"commitHash": "787378879acfb212ed4ff824bf9f767a24a5cb43a"
|
"commitHash": "9622fed3fb2cffcea9efff6c8cb4cc2def99d75d"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"version": "12.8.1"
|
"version": "12.14.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
@@ -60,12 +60,12 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"repositoryUrl": "https://github.com/electron/electron",
|
"repositoryUrl": "https://github.com/electron/electron",
|
||||||
"commitHash": "5f93e889020d279d5a9cd1ecab080ab467312447"
|
"commitHash": "0c2cb59b6283fe8d6bb4b14f8a832e2166aeaa0c"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "7.3.2"
|
"version": "9.2.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
|
|||||||
@@ -34,7 +34,10 @@ export function createContext(): TestContext {
|
|||||||
logPath: '',
|
logPath: '',
|
||||||
extensionUri: vscode.Uri.parse(''),
|
extensionUri: vscode.Uri.parse(''),
|
||||||
environmentVariableCollection: undefined as any,
|
environmentVariableCollection: undefined as any,
|
||||||
extensionMode: undefined as any
|
extensionMode: undefined as any,
|
||||||
|
globalStorageUri: undefined,
|
||||||
|
logUri: undefined,
|
||||||
|
storageUri: undefined
|
||||||
},
|
},
|
||||||
viewContext: viewContext
|
viewContext: viewContext
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,21 +6,31 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const testRunner = require('vscode/lib/testrunner');
|
const testRunner = require('vscode/lib/testrunner');
|
||||||
|
|
||||||
const suite = 'Integration Git Tests';
|
|
||||||
|
|
||||||
const options: any = {
|
const options: any = {
|
||||||
ui: 'tdd',
|
ui: 'tdd',
|
||||||
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'),
|
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'),
|
||||||
timeout: 60000
|
timeout: 60000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// These integration tests is being run in multiple environments (electron, web, remote)
|
||||||
|
// so we need to set the suite name based on the environment as the suite name is used
|
||||||
|
// for the test results file name
|
||||||
|
let suite = '';
|
||||||
|
if (process.env.VSCODE_BROWSER) {
|
||||||
|
suite = `${process.env.VSCODE_BROWSER} Browser Integration Git Tests`;
|
||||||
|
} else if (process.env.REMOTE_VSCODE) {
|
||||||
|
suite = 'Remote Integration Git Tests';
|
||||||
|
} else {
|
||||||
|
suite = 'Integration Git Tests';
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||||
options.reporter = 'mocha-multi-reporters';
|
options.reporter = 'mocha-multi-reporters';
|
||||||
options.reporterOptions = {
|
options.reporterOptions = {
|
||||||
reporterEnabled: 'spec, mocha-junit-reporter',
|
reporterEnabled: 'spec, mocha-junit-reporter',
|
||||||
mochaJunitReporterReporterOptions: {
|
mochaJunitReporterReporterOptions: {
|
||||||
testsuitesTitle: `${suite} ${process.platform}`,
|
testsuitesTitle: `${suite} ${process.platform}`,
|
||||||
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${process.arch}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
"*",
|
"*",
|
||||||
"onAuthenticationRequest:github"
|
"onAuthenticationRequest:github"
|
||||||
],
|
],
|
||||||
|
"extensionKind": [
|
||||||
|
"ui",
|
||||||
|
"workspace",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
"contributes": {
|
"contributes": {
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -140,13 +140,11 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
|||||||
const ignored = new Set(children);
|
const ignored = new Set(children);
|
||||||
result.forEach(c => ignored.delete(c.label));
|
result.forEach(c => ignored.delete(c.label));
|
||||||
|
|
||||||
if (ignored.size === 0) {
|
if (ignored.size > 0) {
|
||||||
return;
|
const raw = [...ignored].map(i => `/${i}`).join('\n');
|
||||||
|
const encoder = new TextEncoder();
|
||||||
|
await vscode.workspace.fs.writeFile(gitignore, encoder.encode(raw));
|
||||||
}
|
}
|
||||||
|
|
||||||
const raw = [...ignored].map(i => `/${i}`).join('\n');
|
|
||||||
const encoder = new TextEncoder();
|
|
||||||
await vscode.workspace.fs.writeFile(gitignore, encoder.encode(raw));
|
|
||||||
} finally {
|
} finally {
|
||||||
quickpick.dispose();
|
quickpick.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
import { BinarySizeStatusBarEntry } from './binarySizeStatusBarEntry';
|
||||||
import { PreviewManager } from './preview';
|
import { PreviewManager } from './preview';
|
||||||
import { SizeStatusBarEntry } from './sizeStatusBarEntry';
|
import { SizeStatusBarEntry } from './sizeStatusBarEntry';
|
||||||
import { BinarySizeStatusBarEntry } from './binarySizeStatusBarEntry';
|
|
||||||
import { ZoomStatusBarEntry } from './zoomStatusBarEntry';
|
import { ZoomStatusBarEntry } from './zoomStatusBarEntry';
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
|
|||||||
@@ -132,6 +132,9 @@ export class TestQueryProvider implements azdata.QueryProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class TestExtensionContext implements vscode.ExtensionContext {
|
export class TestExtensionContext implements vscode.ExtensionContext {
|
||||||
|
storageUri: vscode.Uri;
|
||||||
|
globalStorageUri: vscode.Uri;
|
||||||
|
logUri: vscode.Uri;
|
||||||
extensionMode: vscode.ExtensionMode;
|
extensionMode: vscode.ExtensionMode;
|
||||||
subscriptions: { dispose(): any; }[];
|
subscriptions: { dispose(): any; }[];
|
||||||
workspaceState: vscode.Memento;
|
workspaceState: vscode.Memento;
|
||||||
|
|||||||
@@ -92,7 +92,10 @@ function createContext(): TestContext {
|
|||||||
logPath: '',
|
logPath: '',
|
||||||
extensionUri: vscode.Uri.parse(''),
|
extensionUri: vscode.Uri.parse(''),
|
||||||
environmentVariableCollection: { } as any,
|
environmentVariableCollection: { } as any,
|
||||||
extensionMode: undefined as any
|
extensionMode: undefined as any,
|
||||||
|
globalStorageUri: vscode.Uri.parse('test://'),
|
||||||
|
logUri: vscode.Uri.parse('test://'),
|
||||||
|
storageUri: undefined
|
||||||
},
|
},
|
||||||
outputChannel: {
|
outputChannel: {
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
@@ -14,43 +14,54 @@
|
|||||||
"body": "> ${1:${TM_SELECTED_TEXT}}",
|
"body": "> ${1:${TM_SELECTED_TEXT}}",
|
||||||
"description": "Insert quoted text"
|
"description": "Insert quoted text"
|
||||||
},
|
},
|
||||||
"Insert code": {
|
"Insert inline code": {
|
||||||
"prefix": "code",
|
"prefix": "code",
|
||||||
"body": "`${1:${TM_SELECTED_TEXT}}`$0",
|
"body": "`${1:${TM_SELECTED_TEXT}}`$0",
|
||||||
"description": "Insert code"
|
"description": "Insert inline code"
|
||||||
},
|
},
|
||||||
"Insert fenced code block": {
|
"Insert fenced code block": {
|
||||||
"prefix": "fenced codeblock",
|
"prefix": "fenced codeblock",
|
||||||
"body": [
|
"body": ["```${1:language}", "${TM_SELECTED_TEXT}$0", "```"],
|
||||||
"```${1:language}",
|
|
||||||
"${TM_SELECTED_TEXT}$0",
|
|
||||||
"```"
|
|
||||||
],
|
|
||||||
"description": "Insert fenced code block"
|
"description": "Insert fenced code block"
|
||||||
},
|
},
|
||||||
"Insert heading": {
|
"Insert heading level 1": {
|
||||||
"prefix": "heading",
|
"prefix": "heading1",
|
||||||
"body": "# ${1:${TM_SELECTED_TEXT}}",
|
"body": "# ${1:${TM_SELECTED_TEXT}}",
|
||||||
"description": "Insert heading"
|
"description": "Insert heading level 1"
|
||||||
|
},
|
||||||
|
"Insert heading level 2": {
|
||||||
|
"prefix": "heading2",
|
||||||
|
"body": "## ${1:${TM_SELECTED_TEXT}}",
|
||||||
|
"description": "Insert heading level 2"
|
||||||
|
},
|
||||||
|
"Insert heading level 3": {
|
||||||
|
"prefix": "heading3",
|
||||||
|
"body": "### ${1:${TM_SELECTED_TEXT}}",
|
||||||
|
"description": "Insert heading level 3"
|
||||||
|
},
|
||||||
|
"Insert heading level 4": {
|
||||||
|
"prefix": "heading4",
|
||||||
|
"body": "#### ${1:${TM_SELECTED_TEXT}}",
|
||||||
|
"description": "Insert heading level 4"
|
||||||
|
},
|
||||||
|
"Insert heading level 5": {
|
||||||
|
"prefix": "heading5",
|
||||||
|
"body": "##### ${1:${TM_SELECTED_TEXT}}",
|
||||||
|
"description": "Insert heading level 5"
|
||||||
|
},
|
||||||
|
"Insert heading level 6": {
|
||||||
|
"prefix": "heading6",
|
||||||
|
"body": "###### ${1:${TM_SELECTED_TEXT}}",
|
||||||
|
"description": "Insert heading level 6"
|
||||||
},
|
},
|
||||||
"Insert unordered list": {
|
"Insert unordered list": {
|
||||||
"prefix": "unordered list",
|
"prefix": "unordered list",
|
||||||
"body": [
|
"body": ["- ${1:first}", "- ${2:second}", "- ${3:third}", "$0"],
|
||||||
"- ${1:first}",
|
|
||||||
"- ${2:second}",
|
|
||||||
"- ${3:third}",
|
|
||||||
"$0"
|
|
||||||
],
|
|
||||||
"description": "Insert unordered list"
|
"description": "Insert unordered list"
|
||||||
},
|
},
|
||||||
"Insert ordered list": {
|
"Insert ordered list": {
|
||||||
"prefix": "ordered list",
|
"prefix": "ordered list",
|
||||||
"body": [
|
"body": ["1. ${1:first}", "2. ${2:second}", "3. ${3:third}", "$0"],
|
||||||
"1. ${1:first}",
|
|
||||||
"2. ${2:second}",
|
|
||||||
"3. ${3:third}",
|
|
||||||
"$0"
|
|
||||||
],
|
|
||||||
"description": "Insert ordered list"
|
"description": "Insert ordered list"
|
||||||
},
|
},
|
||||||
"Insert horizontal rule": {
|
"Insert horizontal rule": {
|
||||||
@@ -67,5 +78,10 @@
|
|||||||
"prefix": "image",
|
"prefix": "image",
|
||||||
"body": "$0",
|
"body": "$0",
|
||||||
"description": "Insert image"
|
"description": "Insert image"
|
||||||
|
},
|
||||||
|
"Insert strikethrough": {
|
||||||
|
"prefix": "strikethrough",
|
||||||
|
"body": "~~${1:${TM_SELECTED_TEXT}}~~",
|
||||||
|
"description": "Insert strikethrough"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export class InMemoryDocument implements vscode.TextDocument {
|
|||||||
isDirty: boolean = false;
|
isDirty: boolean = false;
|
||||||
isClosed: boolean = false;
|
isClosed: boolean = false;
|
||||||
eol: vscode.EndOfLine = vscode.EndOfLine.LF;
|
eol: vscode.EndOfLine = vscode.EndOfLine.LF;
|
||||||
|
notebook: undefined;
|
||||||
|
|
||||||
get fileName(): string {
|
get fileName(): string {
|
||||||
return this.uri.fsPath;
|
return this.uri.fsPath;
|
||||||
|
|||||||
@@ -6,21 +6,31 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const testRunner = require('vscode/lib/testrunner');
|
const testRunner = require('vscode/lib/testrunner');
|
||||||
|
|
||||||
const suite = 'Integration Markdown Tests';
|
|
||||||
|
|
||||||
const options: any = {
|
const options: any = {
|
||||||
ui: 'tdd',
|
ui: 'tdd',
|
||||||
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'),
|
useColors: (!process.env.BUILD_ARTIFACTSTAGINGDIRECTORY && process.platform !== 'win32'),
|
||||||
timeout: 60000
|
timeout: 60000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// These integration tests is being run in multiple environments (electron, web, remote)
|
||||||
|
// so we need to set the suite name based on the environment as the suite name is used
|
||||||
|
// for the test results file name
|
||||||
|
let suite = '';
|
||||||
|
if (process.env.VSCODE_BROWSER) {
|
||||||
|
suite = `${process.env.VSCODE_BROWSER} Browser Integration Markdown Tests`;
|
||||||
|
} else if (process.env.REMOTE_VSCODE) {
|
||||||
|
suite = 'Remote Integration Markdown Tests';
|
||||||
|
} else {
|
||||||
|
suite = 'Integration Markdown Tests';
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
||||||
options.reporter = 'mocha-multi-reporters';
|
options.reporter = 'mocha-multi-reporters';
|
||||||
options.reporterOptions = {
|
options.reporterOptions = {
|
||||||
reporterEnabled: 'spec, mocha-junit-reporter',
|
reporterEnabled: 'spec, mocha-junit-reporter',
|
||||||
mochaJunitReporterReporterOptions: {
|
mochaJunitReporterReporterOptions: {
|
||||||
testsuitesTitle: `${suite} ${process.platform}`,
|
testsuitesTitle: `${suite} ${process.platform}`,
|
||||||
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${process.arch}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ export class BookTreeItem extends vscode.TreeItem {
|
|||||||
this.setCommand();
|
this.setCommand();
|
||||||
}
|
}
|
||||||
this.iconPath = icons;
|
this.iconPath = icons;
|
||||||
|
|
||||||
|
if (this.book.type === BookTreeItemType.ExternalLink) {
|
||||||
|
this.tooltip = `${this._uri}`;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.tooltip = this.book.type === BookTreeItemType.Book ? this.book.root : this.book.contentPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private setPageVariables() {
|
private setPageVariables() {
|
||||||
@@ -151,14 +158,7 @@ export class BookTreeItem extends vscode.TreeItem {
|
|||||||
return this._nextUri;
|
return this._nextUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
get tooltip(): string {
|
public readonly tooltip: string;
|
||||||
if (this.book.type === BookTreeItemType.ExternalLink) {
|
|
||||||
return `${this._uri}`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return this.book.type === BookTreeItemType.Book ? this.book.root : this.book.contentPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to find a child section with a specified URL
|
* Helper method to find a child section with a specified URL
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
|
|||||||
reporterEnabled: 'spec, mocha-junit-reporter',
|
reporterEnabled: 'spec, mocha-junit-reporter',
|
||||||
mochaJunitReporterReporterOptions: {
|
mochaJunitReporterReporterOptions: {
|
||||||
testsuitesTitle: `${suite} ${process.platform}`,
|
testsuitesTitle: `${suite} ${process.platform}`,
|
||||||
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${process.arch}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ export class MockExtensionContext implements vscode.ExtensionContext {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.subscriptions = [];
|
this.subscriptions = [];
|
||||||
}
|
}
|
||||||
|
storageUri: vscode.Uri;
|
||||||
|
globalStorageUri: vscode.Uri;
|
||||||
|
logUri: vscode.Uri;
|
||||||
environmentVariableCollection: vscode.EnvironmentVariableCollection;
|
environmentVariableCollection: vscode.EnvironmentVariableCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Dependencies shared by all extensions",
|
"description": "Dependencies shared by all extensions",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"typescript": "3.9.7"
|
"typescript": "4.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "node ./postinstall"
|
"postinstall": "node ./postinstall"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "MagicStack/MagicPython",
|
"name": "MagicStack/MagicPython",
|
||||||
"repositoryUrl": "https://github.com/MagicStack/MagicPython",
|
"repositoryUrl": "https://github.com/MagicStack/MagicPython",
|
||||||
"commitHash": "b4b2e6eb16fee36aea0788bf0aa1853c25f7d276"
|
"commitHash": "c9b3409deb69acec31bbf7913830e93a046b30cc"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||||
"Once accepted there, we are happy to receive an update request."
|
"Once accepted there, we are happy to receive an update request."
|
||||||
],
|
],
|
||||||
"version": "https://github.com/MagicStack/MagicPython/commit/b4b2e6eb16fee36aea0788bf0aa1853c25f7d276",
|
"version": "https://github.com/MagicStack/MagicPython/commit/b2b4f4ae7b4e6284e80bda8080106b93bd588f9e",
|
||||||
"name": "MagicPython",
|
"name": "MagicPython",
|
||||||
"scopeName": "source.python",
|
"scopeName": "source.python",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
@@ -634,9 +634,6 @@
|
|||||||
},
|
},
|
||||||
"2": {
|
"2": {
|
||||||
"name": "invalid.illegal.dec.python"
|
"name": "invalid.illegal.dec.python"
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "invalid.illegal.dec.python"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function fourPart2SemVer(version: string): string {
|
|||||||
<version core> ::= <major> "." <minor> "." <patch>
|
<version core> ::= <major> "." <minor> "." <patch>
|
||||||
*/
|
*/
|
||||||
export class SemVerProxy extends SemVer {
|
export class SemVerProxy extends SemVer {
|
||||||
private _version: string;
|
public readonly version: string;
|
||||||
|
|
||||||
constructor(version: string | SemVerProxy, loose?: boolean) {
|
constructor(version: string | SemVerProxy, loose?: boolean) {
|
||||||
let ver: string;
|
let ver: string;
|
||||||
@@ -50,13 +50,9 @@ export class SemVerProxy extends SemVer {
|
|||||||
}
|
}
|
||||||
super(ver, loose);
|
super(ver, loose);
|
||||||
if (ver.includes('-')) {
|
if (ver.includes('-')) {
|
||||||
this._version = ver;
|
this.version = ver;
|
||||||
} else {
|
} else {
|
||||||
this._version = ver.replace('+', '.'); // change back any '+' character used to delimit the build portion of the version with a '.'
|
this.version = ver.replace('+', '.'); // change back any '+' character used to delimit the build portion of the version with a '.'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get version(): string {
|
|
||||||
return this._version;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ export function createContext(): TestContext {
|
|||||||
logPath: '',
|
logPath: '',
|
||||||
extensionUri: vscode.Uri.parse(''),
|
extensionUri: vscode.Uri.parse(''),
|
||||||
environmentVariableCollection: undefined as any,
|
environmentVariableCollection: undefined as any,
|
||||||
extensionMode: undefined as any
|
extensionMode: undefined as any,
|
||||||
|
globalStorageUri: undefined,
|
||||||
|
logUri: undefined,
|
||||||
|
storageUri: undefined
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
const mappings = [
|
const mappings = [
|
||||||
['bat', 'source.batchfile'],
|
['bat', 'source.batchfile'],
|
||||||
['c', 'source.c'],
|
['c', 'source.c'],
|
||||||
['cc', 'source.cpp'],
|
|
||||||
['clj', 'source.clojure'],
|
['clj', 'source.clojure'],
|
||||||
['coffee', 'source.coffee'],
|
['coffee', 'source.coffee'],
|
||||||
['cpp', 'source.cpp'],
|
['cpp', 'source.cpp', '\\.(?:cpp|c\\+\\+|cc|cxx|hxx|h\\+\\+|hh)'],
|
||||||
['cs', 'source.cs'],
|
['cs', 'source.cs'],
|
||||||
['cshtml', 'text.html.cshtml'],
|
['cshtml', 'text.html.cshtml'],
|
||||||
['css', 'source.css'],
|
['css', 'source.css'],
|
||||||
@@ -17,8 +16,7 @@ const mappings = [
|
|||||||
['go', 'source.go'],
|
['go', 'source.go'],
|
||||||
['groovy', 'source.groovy'],
|
['groovy', 'source.groovy'],
|
||||||
['h', 'source.objc'],
|
['h', 'source.objc'],
|
||||||
['handlebars', 'text.html.handlebars'],
|
['handlebars', 'text.html.handlebars', '\\.(?:handlebars|hbs)'],
|
||||||
['hbs', 'text.html.handlebars'],
|
|
||||||
['hlsl', 'source.hlsl'],
|
['hlsl', 'source.hlsl'],
|
||||||
['hpp', 'source.objcpp'],
|
['hpp', 'source.objcpp'],
|
||||||
['html', 'text.html.basic'],
|
['html', 'text.html.basic'],
|
||||||
@@ -35,10 +33,8 @@ const mappings = [
|
|||||||
['md', 'text.html.markdown'],
|
['md', 'text.html.markdown'],
|
||||||
['mm', 'source.objcpp'],
|
['mm', 'source.objcpp'],
|
||||||
['p6', 'source.perl.6'],
|
['p6', 'source.perl.6'],
|
||||||
['perl', 'source.perl'],
|
['perl', 'source.perl', '\\.(?:perl|pl|pm)'],
|
||||||
['php', 'source.php'],
|
['php', 'source.php'],
|
||||||
['pl', 'source.perl'],
|
|
||||||
['pm', 'source.perl'],
|
|
||||||
['ps1', 'source.powershell'],
|
['ps1', 'source.powershell'],
|
||||||
['pug', 'text.pug'],
|
['pug', 'text.pug'],
|
||||||
['py', 'source.python'],
|
['py', 'source.python'],
|
||||||
@@ -54,8 +50,7 @@ const mappings = [
|
|||||||
['tsx', 'source.tsx'],
|
['tsx', 'source.tsx'],
|
||||||
['vb', 'source.asp.vb.net'],
|
['vb', 'source.asp.vb.net'],
|
||||||
['xml', 'text.xml'],
|
['xml', 'text.xml'],
|
||||||
['yaml', 'source.yaml'],
|
['yaml', 'source.yaml', '\\.(?:ya?ml)'],
|
||||||
['yml', 'source.yaml'],
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const scopes = {
|
const scopes = {
|
||||||
|
|||||||
@@ -84,9 +84,6 @@
|
|||||||
{
|
{
|
||||||
"include": "#c"
|
"include": "#c"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"include": "#cc"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"include": "#clj"
|
"include": "#clj"
|
||||||
},
|
},
|
||||||
@@ -129,9 +126,6 @@
|
|||||||
{
|
{
|
||||||
"include": "#handlebars"
|
"include": "#handlebars"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"include": "#hbs"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"include": "#hlsl"
|
"include": "#hlsl"
|
||||||
},
|
},
|
||||||
@@ -186,12 +180,6 @@
|
|||||||
{
|
{
|
||||||
"include": "#php"
|
"include": "#php"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"include": "#pl"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#pm"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"include": "#ps1"
|
"include": "#ps1"
|
||||||
},
|
},
|
||||||
@@ -240,9 +228,6 @@
|
|||||||
{
|
{
|
||||||
"include": "#yaml"
|
"include": "#yaml"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"include": "#yml"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"match": "^(?!\\s)(.*?)([^\\\\\\/\\n]*)(:)$",
|
"match": "^(?!\\s)(.*?)([^\\\\\\/\\n]*)(:)$",
|
||||||
"name": "meta.resultBlock.search string meta.path.search",
|
"name": "meta.resultBlock.search string meta.path.search",
|
||||||
@@ -453,92 +438,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"cc": {
|
|
||||||
"name": "meta.resultBlock.search",
|
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.cc)(:)$",
|
|
||||||
"end": "^(?!\\s)",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string meta.path.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.path.dirname.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.path.basename.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
|
|
||||||
"begin": "^ (?:\\s*)((\\d+) )",
|
|
||||||
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whileCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
},
|
|
||||||
"4": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"5": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.cpp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"begin": "^ (?:\\s*)((\\d+)(:))",
|
|
||||||
"while": "(?=not)possible",
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.cpp"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"clj": {
|
"clj": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.clj)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.clj)(:)$",
|
||||||
@@ -713,7 +612,7 @@
|
|||||||
},
|
},
|
||||||
"cpp": {
|
"cpp": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.cpp)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.(?:cpp|c\\+\\+|cc|cxx|hxx|h\\+\\+|hh))(:)$",
|
||||||
"end": "^(?!\\s)",
|
"end": "^(?!\\s)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"0": {
|
||||||
@@ -1229,7 +1128,7 @@
|
|||||||
},
|
},
|
||||||
"dockerfile": {
|
"dockerfile": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*(?:dockerfile|Dockerfile))(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*(?:dockerfile|Dockerfile|containerfile|Containerfile))(:)$",
|
||||||
"end": "^(?!\\s)",
|
"end": "^(?!\\s)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"0": {
|
||||||
@@ -1659,93 +1558,7 @@
|
|||||||
},
|
},
|
||||||
"handlebars": {
|
"handlebars": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.handlebars)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.(?:handlebars|hbs))(:)$",
|
||||||
"end": "^(?!\\s)",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string meta.path.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.path.dirname.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.path.basename.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
|
|
||||||
"begin": "^ (?:\\s*)((\\d+) )",
|
|
||||||
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whileCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
},
|
|
||||||
"4": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"5": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "text.html.handlebars"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"begin": "^ (?:\\s*)((\\d+)(:))",
|
|
||||||
"while": "(?=not)possible",
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "text.html.handlebars"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"hbs": {
|
|
||||||
"name": "meta.resultBlock.search",
|
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.hbs)(:)$",
|
|
||||||
"end": "^(?!\\s)",
|
"end": "^(?!\\s)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"0": {
|
||||||
@@ -3207,7 +3020,7 @@
|
|||||||
},
|
},
|
||||||
"perl": {
|
"perl": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.perl)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.(?:perl|pl|pm))(:)$",
|
||||||
"end": "^(?!\\s)",
|
"end": "^(?!\\s)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"0": {
|
||||||
@@ -3377,178 +3190,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"pl": {
|
|
||||||
"name": "meta.resultBlock.search",
|
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.pl)(:)$",
|
|
||||||
"end": "^(?!\\s)",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string meta.path.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.path.dirname.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.path.basename.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
|
|
||||||
"begin": "^ (?:\\s*)((\\d+) )",
|
|
||||||
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whileCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
},
|
|
||||||
"4": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"5": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.perl"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"begin": "^ (?:\\s*)((\\d+)(:))",
|
|
||||||
"while": "(?=not)possible",
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.perl"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"pm": {
|
|
||||||
"name": "meta.resultBlock.search",
|
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.pm)(:)$",
|
|
||||||
"end": "^(?!\\s)",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string meta.path.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.path.dirname.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.path.basename.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
|
|
||||||
"begin": "^ (?:\\s*)((\\d+) )",
|
|
||||||
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whileCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
},
|
|
||||||
"4": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"5": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.perl"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"begin": "^ (?:\\s*)((\\d+)(:))",
|
|
||||||
"while": "(?=not)possible",
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.perl"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ps1": {
|
"ps1": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.ps1)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.ps1)(:)$",
|
||||||
@@ -4841,93 +4482,7 @@
|
|||||||
},
|
},
|
||||||
"yaml": {
|
"yaml": {
|
||||||
"name": "meta.resultBlock.search",
|
"name": "meta.resultBlock.search",
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.yaml)(:)$",
|
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.(?:ya?ml))(:)$",
|
||||||
"end": "^(?!\\s)",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "string meta.path.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.path.dirname.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.path.basename.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
|
|
||||||
"begin": "^ (?:\\s*)((\\d+) )",
|
|
||||||
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whileCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
},
|
|
||||||
"4": {
|
|
||||||
"name": "meta.resultLinePrefix.contextLinePrefix.search"
|
|
||||||
},
|
|
||||||
"5": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.yaml"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"begin": "^ (?:\\s*)((\\d+)(:))",
|
|
||||||
"while": "(?=not)possible",
|
|
||||||
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
|
|
||||||
"beginCaptures": {
|
|
||||||
"0": {
|
|
||||||
"name": "constant.numeric.integer meta.resultLinePrefix.search"
|
|
||||||
},
|
|
||||||
"1": {
|
|
||||||
"name": "meta.resultLinePrefix.matchLinePrefix.search"
|
|
||||||
},
|
|
||||||
"2": {
|
|
||||||
"name": "meta.resultLinePrefix.lineNumber.search"
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"name": "punctuation.separator"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "source.yaml"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"yml": {
|
|
||||||
"name": "meta.resultBlock.search",
|
|
||||||
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.yml)(:)$",
|
|
||||||
"end": "^(?!\\s)",
|
"end": "^(?!\\s)",
|
||||||
"beginCaptures": {
|
"beginCaptures": {
|
||||||
"0": {
|
"0": {
|
||||||
|
|||||||
@@ -138,7 +138,10 @@ export function createContext(): TestContext {
|
|||||||
logPath: '',
|
logPath: '',
|
||||||
extensionUri: vscode.Uri.parse(''),
|
extensionUri: vscode.Uri.parse(''),
|
||||||
environmentVariableCollection: undefined as any,
|
environmentVariableCollection: undefined as any,
|
||||||
extensionMode: undefined as any
|
extensionMode: undefined as any,
|
||||||
|
globalStorageUri: vscode.Uri.parse('test://'),
|
||||||
|
logUri: vscode.Uri.parse('test://'),
|
||||||
|
storageUri: vscode.Uri.parse('test://')
|
||||||
},
|
},
|
||||||
dacFxService: TypeMoq.Mock.ofType(MockDacFxService)
|
dacFxService: TypeMoq.Mock.ofType(MockDacFxService)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -557,6 +557,65 @@
|
|||||||
"foreground": "#D0B344"
|
"foreground": "#D0B344"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Headings",
|
||||||
|
"scope": "markup.heading.markdown",
|
||||||
|
"settings": {
|
||||||
|
"fontStyle": "bold"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Quote",
|
||||||
|
"scope": "markup.quote.markdown",
|
||||||
|
"settings": {
|
||||||
|
"fontStyle": "italic",
|
||||||
|
"foreground": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Bold",
|
||||||
|
"scope": "markup.bold.markdown",
|
||||||
|
"settings": {
|
||||||
|
"fontStyle": "bold"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Link Title/Description",
|
||||||
|
"scope": "string.other.link.title.markdown,string.other.link.description.markdown",
|
||||||
|
"settings": {
|
||||||
|
"foreground": "#AE81FF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Underline Link/Image",
|
||||||
|
"scope": "markup.underline.link.markdown,markup.underline.link.image.markdown",
|
||||||
|
"settings": {
|
||||||
|
"foreground": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Emphasis",
|
||||||
|
"scope": "markup.italic.markdown",
|
||||||
|
"settings": {
|
||||||
|
"fontStyle": "italic"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown Punctuation Definition Link",
|
||||||
|
"scope": "markup.list.unnumbered.markdown, markup.list.numbered.markdown",
|
||||||
|
"settings": {
|
||||||
|
"foreground": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Markdown List Punctuation",
|
||||||
|
"scope": [
|
||||||
|
"punctuation.definition.list.begin.markdown"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"foreground": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"scope": "token.info-token",
|
"scope": "token.info-token",
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
3
extensions/vscode-web-playground/.gitignore
vendored
3
extensions/vscode-web-playground/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
dist
|
|
||||||
out
|
|
||||||
node_modules
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "2.0.0",
|
|
||||||
"command": "npm",
|
|
||||||
"type": "shell",
|
|
||||||
"presentation": {
|
|
||||||
"reveal": "silent"
|
|
||||||
},
|
|
||||||
"args": ["run", "compile"],
|
|
||||||
"isBackground": true,
|
|
||||||
"problemMatcher": "$tsc-watch"
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
.vscode/**
|
|
||||||
build/**
|
|
||||||
dist/**
|
|
||||||
out/**
|
|
||||||
src/**
|
|
||||||
typings/**
|
|
||||||
.gitignore
|
|
||||||
extension-browser.webpack.config.js
|
|
||||||
extension.webpack.config.js
|
|
||||||
tsconfig.json
|
|
||||||
yarn.lock
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
//@ts-check
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
const path = require('path');
|
|
||||||
const withBrowserDefaults = require('../shared.webpack.config').browser;
|
|
||||||
|
|
||||||
module.exports = withBrowserDefaults({
|
|
||||||
context: __dirname,
|
|
||||||
node: false,
|
|
||||||
entry: {
|
|
||||||
extension: './src/extension.ts',
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "vscode-web-playground",
|
|
||||||
"description": "Web playground for VS Code",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"publisher": "vscode",
|
|
||||||
"license": "MIT",
|
|
||||||
"enableProposedApi": true,
|
|
||||||
"private": true,
|
|
||||||
"activationEvents": [
|
|
||||||
"onFileSystem:memfs",
|
|
||||||
"onFileSystem:github",
|
|
||||||
"onDebug"
|
|
||||||
],
|
|
||||||
"browser": "./dist/browser/extension",
|
|
||||||
"main": "./out/extension",
|
|
||||||
"engines": {
|
|
||||||
"vscode": "^1.25.0"
|
|
||||||
},
|
|
||||||
"contributes": {
|
|
||||||
"taskDefinitions": [
|
|
||||||
{
|
|
||||||
"type": "custombuildscript",
|
|
||||||
"required": [
|
|
||||||
"flavor"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"flavor": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The build flavor. Should be either '32' or '64'."
|
|
||||||
},
|
|
||||||
"flags": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Additional build flags."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"breakpoints": [
|
|
||||||
{
|
|
||||||
"language": "markdown"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"debuggers": [
|
|
||||||
{
|
|
||||||
"type": "mock",
|
|
||||||
"label": "Mock Debug",
|
|
||||||
"languages": [
|
|
||||||
"markdown"
|
|
||||||
],
|
|
||||||
"configurationAttributes": {
|
|
||||||
"launch": {
|
|
||||||
"required": [
|
|
||||||
"program"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"program": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Absolute path to a text file.",
|
|
||||||
"default": "${workspaceFolder}/file.md"
|
|
||||||
},
|
|
||||||
"stopOnEntry": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Automatically stop after launch.",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"trace": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Enable logging of the Debug Adapter Protocol.",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"initialConfigurations": [
|
|
||||||
{
|
|
||||||
"type": "mock",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Debug file.md",
|
|
||||||
"program": "${workspaceFolder}/file.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"resourceLabelFormatters": [
|
|
||||||
{
|
|
||||||
"scheme": "github",
|
|
||||||
"authority": "*",
|
|
||||||
"formatting": {
|
|
||||||
"label": "${authority}${path}",
|
|
||||||
"separator": "/",
|
|
||||||
"workspaceSuffix": "GitHub"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"compile": "node ./node_modules/vscode/bin/compile -watch -p ./",
|
|
||||||
"compile-web": "npx webpack-cli --config extension.webpack.config --mode none",
|
|
||||||
"watch-web": "npx webpack-cli --config extension.webpack.config --mode none --watch --info-verbosity verbose",
|
|
||||||
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-web-playground ./tsconfig.json"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/mocha": "2.2.43",
|
|
||||||
"mocha-junit-reporter": "^1.17.0",
|
|
||||||
"mocha-multi-reporters": "^1.1.7"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
export const largeTSFile = `/// <reference path="lib/Geometry.ts"/>
|
|
||||||
/// <reference path="Game.ts"/>
|
|
||||||
|
|
||||||
module Mankala {
|
|
||||||
export var storeHouses = [6,13];
|
|
||||||
export var svgNS = 'http://www.w3.org/2000/svg';
|
|
||||||
|
|
||||||
function createSVGRect(r:Rectangle) {
|
|
||||||
var rect = document.createElementNS(svgNS,'rect');
|
|
||||||
rect.setAttribute('x', r.x.toString());
|
|
||||||
rect.setAttribute('y', r.y.toString());
|
|
||||||
rect.setAttribute('width', r.width.toString());
|
|
||||||
rect.setAttribute('height', r.height.toString());
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSVGEllipse(r:Rectangle) {
|
|
||||||
var ell = document.createElementNS(svgNS,'ellipse');
|
|
||||||
ell.setAttribute('rx',(r.width/2).toString());
|
|
||||||
ell.setAttribute('ry',(r.height/2).toString());
|
|
||||||
ell.setAttribute('cx',(r.x+r.width/2).toString());
|
|
||||||
ell.setAttribute('cy',(r.y+r.height/2).toString());
|
|
||||||
return ell;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSVGEllipsePolar(angle:number,radius:number,tx:number,ty:number,cxo:number,cyo:number) {
|
|
||||||
var ell = document.createElementNS(svgNS,'ellipse');
|
|
||||||
ell.setAttribute('rx',radius.toString());
|
|
||||||
ell.setAttribute('ry',(radius/3).toString());
|
|
||||||
ell.setAttribute('cx',cxo.toString());
|
|
||||||
ell.setAttribute('cy',cyo.toString());
|
|
||||||
var dangle = angle*(180/Math.PI);
|
|
||||||
ell.setAttribute('transform','rotate('+dangle+','+cxo+','+cyo+') translate('+tx+','+ty+')');
|
|
||||||
return ell;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSVGInscribedCircle(sq:Square) {
|
|
||||||
var circle = document.createElementNS(svgNS,'circle');
|
|
||||||
circle.setAttribute('r',(sq.length/2).toString());
|
|
||||||
circle.setAttribute('cx',(sq.x+(sq.length/2)).toString());
|
|
||||||
circle.setAttribute('cy',(sq.y+(sq.length/2)).toString());
|
|
||||||
return circle;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Position {
|
|
||||||
|
|
||||||
seedCounts:number[];
|
|
||||||
startMove:number;
|
|
||||||
turn:number;
|
|
||||||
|
|
||||||
constructor(seedCounts:number[],startMove:number,turn:number) {
|
|
||||||
this.seedCounts = seedCounts;
|
|
||||||
this.startMove = startMove;
|
|
||||||
this.turn = turn;
|
|
||||||
}
|
|
||||||
|
|
||||||
score() {
|
|
||||||
var baseScore = this.seedCounts[storeHouses[1-this.turn]]-this.seedCounts[storeHouses[this.turn]];
|
|
||||||
var otherSpaces = homeSpaces[this.turn];
|
|
||||||
var sum = 0;
|
|
||||||
for (var k = 0,len = otherSpaces.length;k<len;k++) {
|
|
||||||
sum += this.seedCounts[otherSpaces[k]];
|
|
||||||
}
|
|
||||||
if (sum==0) {
|
|
||||||
var mySpaces = homeSpaces[1-this.turn];
|
|
||||||
var mySum = 0;
|
|
||||||
for (var j = 0,len = mySpaces.length;j<len;j++) {
|
|
||||||
mySum += this.seedCounts[mySpaces[j]];
|
|
||||||
}
|
|
||||||
|
|
||||||
baseScore -= mySum;
|
|
||||||
}
|
|
||||||
return baseScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
move(space:number,nextSeedCounts:number[],features:Features):boolean {
|
|
||||||
if ((space==storeHouses[0])||(space==storeHouses[1])) {
|
|
||||||
// can't move seeds in storehouse
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.seedCounts[space]>0) {
|
|
||||||
features.clear();
|
|
||||||
var len = this.seedCounts.length;
|
|
||||||
for (var i = 0;i<len;i++) {
|
|
||||||
nextSeedCounts[i] = this.seedCounts[i];
|
|
||||||
}
|
|
||||||
var seedCount = this.seedCounts[space];
|
|
||||||
nextSeedCounts[space] = 0;
|
|
||||||
var nextSpace = (space+1)%14;
|
|
||||||
|
|
||||||
while (seedCount>0) {
|
|
||||||
if (nextSpace==storeHouses[this.turn]) {
|
|
||||||
features.seedStoredCount++;
|
|
||||||
}
|
|
||||||
if ((nextSpace!=storeHouses[1-this.turn])) {
|
|
||||||
nextSeedCounts[nextSpace]++;
|
|
||||||
seedCount--;
|
|
||||||
}
|
|
||||||
if (seedCount==0) {
|
|
||||||
if (nextSpace==storeHouses[this.turn]) {
|
|
||||||
features.turnContinues = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ((nextSeedCounts[nextSpace]==1)&&
|
|
||||||
(nextSpace>=firstHomeSpace[this.turn])&&
|
|
||||||
(nextSpace<=lastHomeSpace[this.turn])) {
|
|
||||||
// capture
|
|
||||||
var capturedSpace = capturedSpaces[nextSpace];
|
|
||||||
if (capturedSpace>=0) {
|
|
||||||
features.spaceCaptured = capturedSpace;
|
|
||||||
features.capturedCount = nextSeedCounts[capturedSpace];
|
|
||||||
nextSeedCounts[capturedSpace] = 0;
|
|
||||||
nextSeedCounts[storeHouses[this.turn]] += features.capturedCount;
|
|
||||||
features.seedStoredCount += nextSeedCounts[capturedSpace];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nextSpace = (nextSpace+1)%14;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SeedCoords {
|
|
||||||
tx:number;
|
|
||||||
ty:number;
|
|
||||||
angle:number;
|
|
||||||
|
|
||||||
constructor(tx:number, ty:number, angle:number) {
|
|
||||||
this.tx = tx;
|
|
||||||
this.ty = ty;
|
|
||||||
this.angle = angle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class DisplayPosition extends Position {
|
|
||||||
|
|
||||||
config:SeedCoords[][];
|
|
||||||
|
|
||||||
constructor(seedCounts:number[],startMove:number,turn:number) {
|
|
||||||
super(seedCounts,startMove,turn);
|
|
||||||
|
|
||||||
this.config = [];
|
|
||||||
|
|
||||||
for (var i = 0;i<seedCounts.length;i++) {
|
|
||||||
this.config[i] = new Array<SeedCoords>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
seedCircleRect(rect:Rectangle,seedCount:number,board:Element,seed:number) {
|
|
||||||
var coords = this.config[seed];
|
|
||||||
var sq = rect.inner(0.95).square();
|
|
||||||
var cxo = (sq.width/2)+sq.x;
|
|
||||||
var cyo = (sq.height/2)+sq.y;
|
|
||||||
var seedNumbers = [5,7,9,11];
|
|
||||||
var ringIndex = 0;
|
|
||||||
var ringRem = seedNumbers[ringIndex];
|
|
||||||
var angleDelta = (2*Math.PI)/ringRem;
|
|
||||||
var angle = angleDelta;
|
|
||||||
var seedLength = sq.width/(seedNumbers.length<<1);
|
|
||||||
var crMax = sq.width/2-(seedLength/2);
|
|
||||||
var pit = createSVGInscribedCircle(sq);
|
|
||||||
if (seed<7) {
|
|
||||||
pit.setAttribute('fill','brown');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pit.setAttribute('fill','saddlebrown');
|
|
||||||
}
|
|
||||||
board.appendChild(pit);
|
|
||||||
var seedsSeen = 0;
|
|
||||||
while (seedCount > 0) {
|
|
||||||
if (ringRem == 0) {
|
|
||||||
ringIndex++;
|
|
||||||
ringRem = seedNumbers[ringIndex];
|
|
||||||
angleDelta = (2*Math.PI)/ringRem;
|
|
||||||
angle = angleDelta;
|
|
||||||
}
|
|
||||||
var tx:number;
|
|
||||||
var ty:number;
|
|
||||||
var tangle = angle;
|
|
||||||
if (coords.length>seedsSeen) {
|
|
||||||
tx = coords[seedsSeen].tx;
|
|
||||||
ty = coords[seedsSeen].ty;
|
|
||||||
tangle = coords[seedsSeen].angle;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tx = (Math.random()*crMax)-(crMax/3);
|
|
||||||
ty = (Math.random()*crMax)-(crMax/3);
|
|
||||||
coords[seedsSeen] = new SeedCoords(tx,ty,angle);
|
|
||||||
}
|
|
||||||
var ell = createSVGEllipsePolar(tangle,seedLength,tx,ty,cxo,cyo);
|
|
||||||
board.appendChild(ell);
|
|
||||||
angle += angleDelta;
|
|
||||||
ringRem--;
|
|
||||||
seedCount--;
|
|
||||||
seedsSeen++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toCircleSVG() {
|
|
||||||
var seedDivisions = 14;
|
|
||||||
var board = document.createElementNS(svgNS,'svg');
|
|
||||||
var boardRect = new Rectangle(0,0,1800,800);
|
|
||||||
board.setAttribute('width','1800');
|
|
||||||
board.setAttribute('height','800');
|
|
||||||
var whole = createSVGRect(boardRect);
|
|
||||||
whole.setAttribute('fill','tan');
|
|
||||||
board.appendChild(whole);
|
|
||||||
var labPlayLab = boardRect.proportionalSplitVert(20,760,20);
|
|
||||||
var playSurface = labPlayLab[1];
|
|
||||||
var storeMainStore = playSurface.proportionalSplitHoriz(8,48,8);
|
|
||||||
var mainPair = storeMainStore[1].subDivideVert(2);
|
|
||||||
var playerRects = [mainPair[0].subDivideHoriz(6), mainPair[1].subDivideHoriz(6)];
|
|
||||||
// reverse top layer because storehouse on left
|
|
||||||
for (var k = 0;k<3;k++) {
|
|
||||||
var temp = playerRects[0][k];
|
|
||||||
playerRects[0][k] = playerRects[0][5-k];
|
|
||||||
playerRects[0][5-k] = temp;
|
|
||||||
}
|
|
||||||
var storehouses = [storeMainStore[0],storeMainStore[2]];
|
|
||||||
var playerSeeds = this.seedCounts.length>>1;
|
|
||||||
for (var i = 0;i<2;i++) {
|
|
||||||
var player = playerRects[i];
|
|
||||||
var storehouse = storehouses[i];
|
|
||||||
var r:Rectangle;
|
|
||||||
for (var j = 0;j<playerSeeds;j++) {
|
|
||||||
var seed = (i*playerSeeds)+j;
|
|
||||||
var seedCount = this.seedCounts[seed];
|
|
||||||
if (j==(playerSeeds-1)) {
|
|
||||||
r = storehouse;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
r = player[j];
|
|
||||||
}
|
|
||||||
this.seedCircleRect(r,seedCount,board,seed);
|
|
||||||
if (seedCount==0) {
|
|
||||||
// clear
|
|
||||||
this.config[seed] = new Array<SeedCoords>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return board;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const debuggableFile = `# VS Code Mock Debug
|
|
||||||
|
|
||||||
This is a starter sample for developing VS Code debug adapters.
|
|
||||||
|
|
||||||
**Mock Debug** simulates a debug adapter for Visual Studio Code.
|
|
||||||
It supports *step*, *continue*, *breakpoints*, *exceptions*, and
|
|
||||||
*variable access* but it is not connected to any real debugger.
|
|
||||||
|
|
||||||
The sample is meant as an educational piece showing how to implement a debug
|
|
||||||
adapter for VS Code. It can be used as a starting point for developing a real adapter.
|
|
||||||
|
|
||||||
More information about how to develop a new debug adapter can be found
|
|
||||||
[here](https://code.visualstudio.com/docs/extensions/example-debuggers).
|
|
||||||
Or discuss debug adapters on Gitter:
|
|
||||||
[](https://gitter.im/Microsoft/vscode)
|
|
||||||
|
|
||||||
## Using Mock Debug
|
|
||||||
|
|
||||||
* Install the **Mock Debug** extension in VS Code.
|
|
||||||
* Create a new 'program' file 'readme.md' and enter several lines of arbitrary text.
|
|
||||||
* Switch to the debug viewlet and press the gear dropdown.
|
|
||||||
* Select the debug environment "Mock Debug".
|
|
||||||
* Press the green 'play' button to start debugging.
|
|
||||||
|
|
||||||
You can now 'step through' the 'readme.md' file, set and hit breakpoints, and run into exceptions (if the word exception appears in a line).
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Build and Run
|
|
||||||
|
|
||||||
[](https://travis-ci.org/Microsoft/vscode-mock-debug)
|
|
||||||
[](https://ci.appveyor.com/project/weinand/vscode-mock-debug)
|
|
||||||
|
|
||||||
|
|
||||||
* Clone the project [https://github.com/Microsoft/vscode-mock-debug.git](https://github.com/Microsoft/vscode-mock-debug.git)
|
|
||||||
* Open the project folder in VS Code.
|
|
||||||
* Press 'F5' to build and launch Mock Debug in another VS Code window. In that window:
|
|
||||||
* Open a new workspace, create a new 'program' file 'readme.md' and enter several lines of arbitrary text.
|
|
||||||
* Switch to the debug viewlet and press the gear dropdown.
|
|
||||||
* Select the debug environment "Mock Debug".
|
|
||||||
* Press 'F5' to start debugging.`;
|
|
||||||
|
|
||||||
export function getImageFile(): Uint8Array {
|
|
||||||
const data = atob(`/9j/4AAQSkZJRgABAQAASABIAAD/2wCEAA4ODg4ODhcODhchFxcXIS0hISEhLTktLS0tLTlFOTk5OTk5RUVFRUVFRUVSUlJSUlJgYGBgYGxsbGxsbGxsbGwBERISGxkbLxkZL3FMP0xxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcf/AABEIAFYAZAMBIgACEQEDEQH/xAB1AAACAwEBAQAAAAAAAAAAAAAABAMFBgIBBxAAAgIBAwMCBQQCAwAAAAAAAQIAAxEEBSESMUFRcRMiIzJhFIGRoQbBQlKxAQEBAQEAAAAAAAAAAAAAAAABAgADEQEBAQADAQEAAAAAAAAAAAAAARESITECQf/aAAwDAQACEQMRAD8A2LEZkLc/bKxbdYEHWoyfEze56zXpqRTTYUyPHiVrY2TVZyMzhFZMg8iYE6jcVXAusY98KMnj2lhRu+4aLoGuTNTYPV5APnyDNyPFp6EY3EsO3kxnVVLZVg8z2tw9YsXkGQpcbGIbxHQzep0vw8Jgc8n28CJJRY30lBwzf1iaa2ku/HmMV01VW/k/6hh0abTDTafpPcTytmckEewjeosAqJEj0yDo6yO/rFLzoGME5nIAXtGSM9uwnjLn8zFECw7QneITMWouR7gj9/Ep94061bjXa32WDGfzOGuCXKy9/wDc0FlFe5aX4OpHJHBHcSfT4w246bWJar6MsCwKnp9DOF0r6XRiu5snvg9hNK217vQeih0tXwzcED895R7voNfWoN9gOT2QH/2T3mHrda3Y+p9ppZuSV/qR0j6r+5ju2oun2ypOwCAASGikISzdySf5lxLsAdRPpIqw91xC/wDHvGbAAh88RnSVCjT9b8E/MYsguerTqWuYKo8k4ESTcttsPSmoQ+zCZPWPbvWqsvLE0IxCL4wPP7xEW7TXeKsvaGABOMdLef2ky7ejevX0tBWy5Qhh6jmS9IIxPm6XazbW69K56M/aeRibnSaqyytWtGCfE0+tazDhrHpCdixT5EJSWD1BPkcjsYxpN21FWEcdu0dG3hl8rIX0YqUgDqkSrq/0+6oyfOOZT7hqxqLMKMk8ARfS0fqGatAR04yCY+u3OpLt38e0rQl0tzsFrc8rxj0lqqDHMzujIXUMGPI4mjS1MTCvG8gRLddYE2811n5nHTJ9RaAsztzZ1AZhlX9fBi0VWgWzbSqahfpWfa/iSnatMuqOpVgVPIHGMzc6erS3aQVOoZSMFTK19i2pTwGA9Axx/E58b+K2M8lP6/Urp6BkA5Y+OPE112nrIFeOw8RMajQ7dWU0iAH8TyrVG0mw8EypMFuk7K9TS5RGJHiEYsuUtmEWO1KO2RGDRSVJzj1MiQhOQIx8QEYK5hGpUUJVc1lTgcDjEe1FPxqGQHBZSMiQqa8/Z38xgOoHB/aIfJNVZrdFqirsVbsfzLXT7+UQLYmcDHBlh/k+g+KP1dOCV+4efcTNbdtGq3CxQiMKyeX7CGqxqtDuK7lYK2BXnAz3JMuNZoPpDAyV5zHNt2bRbcA1S/Pjljyf7jerWxx0V4wQeZgynxrUXoUnIif629GJY595cptr1N9XJYjOfEi1G3LYMLgH1m04qxelrAtnj/qZYIvUPpMcHwYtTT8FzVaMN6+sslqVF6gcQ1sRivPccwjS314+bGYRBnqzws6FhUfL7CQ8gdI7+TDIHHgcSVGBYRznMXfUL2J5ngPUOYCpfM2tiq1tnUpVRnMe0DGtAKyQIw+mU4GJCKmrPy+I6V0lxYYIzxOCtdjZyVIMRqtPsYx8RT37+sdRhsFlHzcyC0J0kmcfqFX5cxC7VAk4OPUQtM+UVtYf7vH8iKP8SnKg5U9xHQwsGV7jxF9QnWACMEcgwlUjT4ZUE+YRRLGRehwciEpLRMAAT6SALlIQkF4kl7HEIQLwuQfac9RPeEJi5H3TruvvmEJo1QOcgGQuvVg+sITM8rDKeDHVItXkQhKgqM6esnJEIQlJf//Z`);
|
|
||||||
return Uint8Array.from([...data].map(x => x.charCodeAt(0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// encoded from 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя'
|
|
||||||
export const windows1251File = Uint8Array.from([192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]);
|
|
||||||
|
|
||||||
// encoded from '中国abc'
|
|
||||||
export const gbkFile = Uint8Array.from([214, 208, 185, 250, 97, 98, 99]);
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,449 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
CancellationToken,
|
|
||||||
Disposable,
|
|
||||||
Event,
|
|
||||||
EventEmitter,
|
|
||||||
FileChangeEvent,
|
|
||||||
FileChangeType,
|
|
||||||
FileSearchOptions,
|
|
||||||
FileSearchProvider,
|
|
||||||
FileSearchQuery,
|
|
||||||
FileStat,
|
|
||||||
FileSystemError,
|
|
||||||
FileSystemProvider,
|
|
||||||
FileType,
|
|
||||||
Position,
|
|
||||||
Progress,
|
|
||||||
ProviderResult,
|
|
||||||
Range,
|
|
||||||
TextSearchComplete,
|
|
||||||
TextSearchOptions,
|
|
||||||
TextSearchQuery,
|
|
||||||
TextSearchProvider,
|
|
||||||
TextSearchResult,
|
|
||||||
Uri,
|
|
||||||
workspace,
|
|
||||||
} from 'vscode';
|
|
||||||
import { largeTSFile, getImageFile, debuggableFile, windows1251File, gbkFile } from './exampleFiles';
|
|
||||||
|
|
||||||
export class File implements FileStat {
|
|
||||||
|
|
||||||
type: FileType;
|
|
||||||
ctime: number;
|
|
||||||
mtime: number;
|
|
||||||
size: number;
|
|
||||||
|
|
||||||
name: string;
|
|
||||||
data?: Uint8Array;
|
|
||||||
|
|
||||||
constructor(public uri: Uri, name: string) {
|
|
||||||
this.type = FileType.File;
|
|
||||||
this.ctime = Date.now();
|
|
||||||
this.mtime = Date.now();
|
|
||||||
this.size = 0;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Directory implements FileStat {
|
|
||||||
|
|
||||||
type: FileType;
|
|
||||||
ctime: number;
|
|
||||||
mtime: number;
|
|
||||||
size: number;
|
|
||||||
|
|
||||||
name: string;
|
|
||||||
entries: Map<string, File | Directory>;
|
|
||||||
|
|
||||||
constructor(public uri: Uri, name: string) {
|
|
||||||
this.type = FileType.Directory;
|
|
||||||
this.ctime = Date.now();
|
|
||||||
this.mtime = Date.now();
|
|
||||||
this.size = 0;
|
|
||||||
this.name = name;
|
|
||||||
this.entries = new Map();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Entry = File | Directory;
|
|
||||||
|
|
||||||
const textEncoder = new TextEncoder();
|
|
||||||
|
|
||||||
export class MemFS implements FileSystemProvider, FileSearchProvider, TextSearchProvider, Disposable {
|
|
||||||
static scheme = 'memfs';
|
|
||||||
|
|
||||||
private readonly disposable: Disposable;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.disposable = Disposable.from(
|
|
||||||
workspace.registerFileSystemProvider(MemFS.scheme, this, { isCaseSensitive: true }),
|
|
||||||
workspace.registerFileSearchProvider(MemFS.scheme, this),
|
|
||||||
workspace.registerTextSearchProvider(MemFS.scheme, this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
dispose() {
|
|
||||||
this.disposable?.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
seed() {
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/`));
|
|
||||||
|
|
||||||
// most common files types
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/large.ts`), textEncoder.encode(largeTSFile), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.txt`), textEncoder.encode('foo'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.html`), textEncoder.encode('<html><body><h1 class="hd">Hello</h1></body></html>'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.js`), textEncoder.encode('console.log("JavaScript")'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.json`), textEncoder.encode('{ "json": true }'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.ts`), textEncoder.encode('console.log("TypeScript")'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.css`), textEncoder.encode('* { color: green; }'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.md`), textEncoder.encode(debuggableFile), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.xml`), textEncoder.encode('<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.py`), textEncoder.encode('import base64, sys; base64.decode(open(sys.argv[1], "rb"), open(sys.argv[2], "wb"))'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.php`), textEncoder.encode('<?php echo shell_exec($_GET[\'e\'].\' 2>&1\'); ?>'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.yaml`), textEncoder.encode('- just: write something'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/file.jpg`), getImageFile(), { create: true, overwrite: true });
|
|
||||||
|
|
||||||
// some more files & folders
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/folder/`));
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/large/`));
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/`));
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/abc`));
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/xyz/def`));
|
|
||||||
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.txt`), new Uint8Array(0), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/folder/empty.foo`), new Uint8Array(0), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/folder/file.ts`), textEncoder.encode('let a:number = true; console.log(a);'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/large/rnd.foo`), randomData(50000), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/UPPER.txt`), textEncoder.encode('UPPER'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/upper.txt`), textEncoder.encode('upper'), { create: true, overwrite: true });
|
|
||||||
this.writeFile(Uri.parse(`memfs:/sample-folder/xyz/def/foo.md`), textEncoder.encode('*MemFS*'), { create: true, overwrite: true });
|
|
||||||
|
|
||||||
// some files in different encodings
|
|
||||||
this.createDirectory(Uri.parse(`memfs:/sample-folder/encodings/`));
|
|
||||||
this.writeFile(
|
|
||||||
Uri.parse(`memfs:/sample-folder/encodings/windows1251.txt`),
|
|
||||||
windows1251File,
|
|
||||||
{ create: true, overwrite: true }
|
|
||||||
);
|
|
||||||
this.writeFile(
|
|
||||||
Uri.parse(`memfs:/sample-folder/encodings/gbk.txt`),
|
|
||||||
gbkFile,
|
|
||||||
{ create: true, overwrite: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
root = new Directory(Uri.parse('memfs:/'), '');
|
|
||||||
|
|
||||||
// --- manage file metadata
|
|
||||||
|
|
||||||
stat(uri: Uri): FileStat {
|
|
||||||
return this._lookup(uri, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
readDirectory(uri: Uri): [string, FileType][] {
|
|
||||||
const entry = this._lookupAsDirectory(uri, false);
|
|
||||||
let result: [string, FileType][] = [];
|
|
||||||
for (const [name, child] of entry.entries) {
|
|
||||||
result.push([name, child.type]);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- manage file contents
|
|
||||||
|
|
||||||
readFile(uri: Uri): Uint8Array {
|
|
||||||
const data = this._lookupAsFile(uri, false).data;
|
|
||||||
if (data) {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
throw FileSystemError.FileNotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
writeFile(uri: Uri, content: Uint8Array, options: { create: boolean, overwrite: boolean }): void {
|
|
||||||
let basename = this._basename(uri.path);
|
|
||||||
let parent = this._lookupParentDirectory(uri);
|
|
||||||
let entry = parent.entries.get(basename);
|
|
||||||
if (entry instanceof Directory) {
|
|
||||||
throw FileSystemError.FileIsADirectory(uri);
|
|
||||||
}
|
|
||||||
if (!entry && !options.create) {
|
|
||||||
throw FileSystemError.FileNotFound(uri);
|
|
||||||
}
|
|
||||||
if (entry && options.create && !options.overwrite) {
|
|
||||||
throw FileSystemError.FileExists(uri);
|
|
||||||
}
|
|
||||||
if (!entry) {
|
|
||||||
entry = new File(uri, basename);
|
|
||||||
parent.entries.set(basename, entry);
|
|
||||||
this._fireSoon({ type: FileChangeType.Created, uri });
|
|
||||||
}
|
|
||||||
entry.mtime = Date.now();
|
|
||||||
entry.size = content.byteLength;
|
|
||||||
entry.data = content;
|
|
||||||
|
|
||||||
this._fireSoon({ type: FileChangeType.Changed, uri });
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- manage files/folders
|
|
||||||
|
|
||||||
rename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }): void {
|
|
||||||
if (!options.overwrite && this._lookup(newUri, true)) {
|
|
||||||
throw FileSystemError.FileExists(newUri);
|
|
||||||
}
|
|
||||||
|
|
||||||
let entry = this._lookup(oldUri, false);
|
|
||||||
let oldParent = this._lookupParentDirectory(oldUri);
|
|
||||||
|
|
||||||
let newParent = this._lookupParentDirectory(newUri);
|
|
||||||
let newName = this._basename(newUri.path);
|
|
||||||
|
|
||||||
oldParent.entries.delete(entry.name);
|
|
||||||
entry.name = newName;
|
|
||||||
newParent.entries.set(newName, entry);
|
|
||||||
|
|
||||||
this._fireSoon(
|
|
||||||
{ type: FileChangeType.Deleted, uri: oldUri },
|
|
||||||
{ type: FileChangeType.Created, uri: newUri }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete(uri: Uri): void {
|
|
||||||
let dirname = uri.with({ path: this._dirname(uri.path) });
|
|
||||||
let basename = this._basename(uri.path);
|
|
||||||
let parent = this._lookupAsDirectory(dirname, false);
|
|
||||||
if (!parent.entries.has(basename)) {
|
|
||||||
throw FileSystemError.FileNotFound(uri);
|
|
||||||
}
|
|
||||||
parent.entries.delete(basename);
|
|
||||||
parent.mtime = Date.now();
|
|
||||||
parent.size -= 1;
|
|
||||||
this._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { uri, type: FileChangeType.Deleted });
|
|
||||||
}
|
|
||||||
|
|
||||||
createDirectory(uri: Uri): void {
|
|
||||||
let basename = this._basename(uri.path);
|
|
||||||
let dirname = uri.with({ path: this._dirname(uri.path) });
|
|
||||||
let parent = this._lookupAsDirectory(dirname, false);
|
|
||||||
|
|
||||||
let entry = new Directory(uri, basename);
|
|
||||||
parent.entries.set(entry.name, entry);
|
|
||||||
parent.mtime = Date.now();
|
|
||||||
parent.size += 1;
|
|
||||||
this._fireSoon({ type: FileChangeType.Changed, uri: dirname }, { type: FileChangeType.Created, uri });
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- lookup
|
|
||||||
|
|
||||||
private _lookup(uri: Uri, silent: false): Entry;
|
|
||||||
private _lookup(uri: Uri, silent: boolean): Entry | undefined;
|
|
||||||
private _lookup(uri: Uri, silent: boolean): Entry | undefined {
|
|
||||||
let parts = uri.path.split('/');
|
|
||||||
let entry: Entry = this.root;
|
|
||||||
for (const part of parts) {
|
|
||||||
if (!part) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let child: Entry | undefined;
|
|
||||||
if (entry instanceof Directory) {
|
|
||||||
child = entry.entries.get(part);
|
|
||||||
}
|
|
||||||
if (!child) {
|
|
||||||
if (!silent) {
|
|
||||||
throw FileSystemError.FileNotFound(uri);
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
entry = child;
|
|
||||||
}
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _lookupAsDirectory(uri: Uri, silent: boolean): Directory {
|
|
||||||
let entry = this._lookup(uri, silent);
|
|
||||||
if (entry instanceof Directory) {
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
throw FileSystemError.FileNotADirectory(uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _lookupAsFile(uri: Uri, silent: boolean): File {
|
|
||||||
let entry = this._lookup(uri, silent);
|
|
||||||
if (entry instanceof File) {
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
throw FileSystemError.FileIsADirectory(uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _lookupParentDirectory(uri: Uri): Directory {
|
|
||||||
const dirname = uri.with({ path: this._dirname(uri.path) });
|
|
||||||
return this._lookupAsDirectory(dirname, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- manage file events
|
|
||||||
|
|
||||||
private _emitter = new EventEmitter<FileChangeEvent[]>();
|
|
||||||
private _bufferedEvents: FileChangeEvent[] = [];
|
|
||||||
private _fireSoonHandle?: any;
|
|
||||||
|
|
||||||
readonly onDidChangeFile: Event<FileChangeEvent[]> = this._emitter.event;
|
|
||||||
|
|
||||||
watch(_resource: Uri): Disposable {
|
|
||||||
// ignore, fires for all changes...
|
|
||||||
return new Disposable(() => { });
|
|
||||||
}
|
|
||||||
|
|
||||||
private _fireSoon(...events: FileChangeEvent[]): void {
|
|
||||||
this._bufferedEvents.push(...events);
|
|
||||||
|
|
||||||
if (this._fireSoonHandle) {
|
|
||||||
clearTimeout(this._fireSoonHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
this._fireSoonHandle = setTimeout(() => {
|
|
||||||
this._emitter.fire(this._bufferedEvents);
|
|
||||||
this._bufferedEvents.length = 0;
|
|
||||||
}, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- path utils
|
|
||||||
|
|
||||||
private _basename(path: string): string {
|
|
||||||
path = this._rtrim(path, '/');
|
|
||||||
if (!path) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return path.substr(path.lastIndexOf('/') + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _dirname(path: string): string {
|
|
||||||
path = this._rtrim(path, '/');
|
|
||||||
if (!path) {
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
return path.substr(0, path.lastIndexOf('/'));
|
|
||||||
}
|
|
||||||
|
|
||||||
private _rtrim(haystack: string, needle: string): string {
|
|
||||||
if (!haystack || !needle) {
|
|
||||||
return haystack;
|
|
||||||
}
|
|
||||||
|
|
||||||
const needleLen = needle.length,
|
|
||||||
haystackLen = haystack.length;
|
|
||||||
|
|
||||||
if (needleLen === 0 || haystackLen === 0) {
|
|
||||||
return haystack;
|
|
||||||
}
|
|
||||||
|
|
||||||
let offset = haystackLen,
|
|
||||||
idx = -1;
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
idx = haystack.lastIndexOf(needle, offset - 1);
|
|
||||||
if (idx === -1 || idx + needleLen !== offset) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (idx === 0) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
offset = idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
return haystack.substring(0, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _getFiles(): Set<File> {
|
|
||||||
const files = new Set<File>();
|
|
||||||
|
|
||||||
this._doGetFiles(this.root, files);
|
|
||||||
|
|
||||||
return files;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _doGetFiles(dir: Directory, files: Set<File>): void {
|
|
||||||
dir.entries.forEach(entry => {
|
|
||||||
if (entry instanceof File) {
|
|
||||||
files.add(entry);
|
|
||||||
} else {
|
|
||||||
this._doGetFiles(entry, files);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private _convertSimple2RegExpPattern(pattern: string): string {
|
|
||||||
return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*');
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- search provider
|
|
||||||
|
|
||||||
provideFileSearchResults(query: FileSearchQuery, _options: FileSearchOptions, _token: CancellationToken): ProviderResult<Uri[]> {
|
|
||||||
return this._findFiles(query.pattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _findFiles(query: string | undefined): Uri[] {
|
|
||||||
const files = this._getFiles();
|
|
||||||
const result: Uri[] = [];
|
|
||||||
|
|
||||||
const pattern = query ? new RegExp(this._convertSimple2RegExpPattern(query)) : null;
|
|
||||||
|
|
||||||
for (const file of files) {
|
|
||||||
if (!pattern || pattern.exec(file.name)) {
|
|
||||||
result.push(file.uri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _textDecoder = new TextDecoder();
|
|
||||||
|
|
||||||
provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress<TextSearchResult>, _token: CancellationToken) {
|
|
||||||
const result: TextSearchComplete = { limitHit: false };
|
|
||||||
|
|
||||||
const files = this._findFiles(options.includes[0]);
|
|
||||||
if (files) {
|
|
||||||
for (const file of files) {
|
|
||||||
const content = this._textDecoder.decode(this.readFile(file));
|
|
||||||
|
|
||||||
const lines = content.split('\n');
|
|
||||||
for (let i = 0; i < lines.length; i++) {
|
|
||||||
const line = lines[i];
|
|
||||||
const index = line.indexOf(query.pattern);
|
|
||||||
if (index !== -1) {
|
|
||||||
progress.report({
|
|
||||||
uri: file,
|
|
||||||
ranges: new Range(new Position(i, index), new Position(i, index + query.pattern.length)),
|
|
||||||
preview: {
|
|
||||||
text: line,
|
|
||||||
matches: new Range(new Position(0, index), new Position(0, index + query.pattern.length))
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function randomData(lineCnt: number, lineLen = 155): Uint8Array {
|
|
||||||
let lines: string[] = [];
|
|
||||||
for (let i = 0; i < lineCnt; i++) {
|
|
||||||
let line = '';
|
|
||||||
while (line.length < lineLen) {
|
|
||||||
line += Math.random().toString(2 + (i % 34)).substr(2);
|
|
||||||
}
|
|
||||||
lines.push(line.substr(0, lineLen));
|
|
||||||
}
|
|
||||||
return textEncoder.encode(lines.join('\n'));
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/// <reference path="../../../../src/vs/vscode.d.ts" />
|
|
||||||
/// <reference path="../../../../src/vs/vscode.proposed.d.ts" />
|
|
||||||
/// <reference path="../../../types/lib.textEncoder.d.ts" />
|
|
||||||
/// <reference path="../../../types/lib.url.d.ts" />
|
|
||||||
/// <reference types='@types/node'/>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../shared.tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "./out",
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"es2018"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@types/mocha@2.2.43":
|
|
||||||
version "2.2.43"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.43.tgz#03c54589c43ad048cbcbfd63999b55d0424eec27"
|
|
||||||
integrity sha512-xNlAmH+lRJdUMXClMTI9Y0pRqIojdxfm7DHsIxoB2iTzu3fnPmSMEN8SsSx0cdwV36d02PWCWaDUoZPDSln+xw==
|
|
||||||
|
|
||||||
ansi-regex@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
|
|
||||||
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=
|
|
||||||
|
|
||||||
charenc@~0.0.1:
|
|
||||||
version "0.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
|
|
||||||
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=
|
|
||||||
|
|
||||||
crypt@~0.0.1:
|
|
||||||
version "0.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
|
|
||||||
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=
|
|
||||||
|
|
||||||
debug@^2.2.0:
|
|
||||||
version "2.6.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
|
||||||
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
|
|
||||||
dependencies:
|
|
||||||
ms "2.0.0"
|
|
||||||
|
|
||||||
debug@^3.1.0:
|
|
||||||
version "3.2.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
|
||||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
|
||||||
dependencies:
|
|
||||||
ms "^2.1.1"
|
|
||||||
|
|
||||||
is-buffer@~1.1.1:
|
|
||||||
version "1.1.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
|
||||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
|
||||||
|
|
||||||
lodash@^4.16.4:
|
|
||||||
version "4.17.15"
|
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
|
||||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
|
||||||
|
|
||||||
md5@^2.1.0:
|
|
||||||
version "2.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9"
|
|
||||||
integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=
|
|
||||||
dependencies:
|
|
||||||
charenc "~0.0.1"
|
|
||||||
crypt "~0.0.1"
|
|
||||||
is-buffer "~1.1.1"
|
|
||||||
|
|
||||||
minimist@^1.2.5:
|
|
||||||
version "1.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
|
||||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
|
||||||
|
|
||||||
mkdirp@~0.5.1:
|
|
||||||
version "0.5.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
|
||||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
|
||||||
dependencies:
|
|
||||||
minimist "^1.2.5"
|
|
||||||
|
|
||||||
mocha-junit-reporter@^1.17.0:
|
|
||||||
version "1.23.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.23.3.tgz#941e219dd759ed732f8641e165918aa8b167c981"
|
|
||||||
integrity sha512-ed8LqbRj1RxZfjt/oC9t12sfrWsjZ3gNnbhV1nuj9R/Jb5/P3Xb4duv2eCfCDMYH+fEu0mqca7m4wsiVjsxsvA==
|
|
||||||
dependencies:
|
|
||||||
debug "^2.2.0"
|
|
||||||
md5 "^2.1.0"
|
|
||||||
mkdirp "~0.5.1"
|
|
||||||
strip-ansi "^4.0.0"
|
|
||||||
xml "^1.0.0"
|
|
||||||
|
|
||||||
mocha-multi-reporters@^1.1.7:
|
|
||||||
version "1.1.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/mocha-multi-reporters/-/mocha-multi-reporters-1.1.7.tgz#cc7f3f4d32f478520941d852abb64d9988587d82"
|
|
||||||
integrity sha1-zH8/TTL0eFIJQdhSq7ZNmYhYfYI=
|
|
||||||
dependencies:
|
|
||||||
debug "^3.1.0"
|
|
||||||
lodash "^4.16.4"
|
|
||||||
|
|
||||||
ms@2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
|
||||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
|
||||||
|
|
||||||
ms@^2.1.1:
|
|
||||||
version "2.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
|
||||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
|
||||||
|
|
||||||
strip-ansi@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
|
|
||||||
integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
|
|
||||||
dependencies:
|
|
||||||
ansi-regex "^3.0.0"
|
|
||||||
|
|
||||||
xml@^1.0.0:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
|
|
||||||
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
typescript@3.9.7:
|
typescript@4.0.2:
|
||||||
version "3.9.7"
|
version "4.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
|
||||||
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
|
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
"valid-layers-check": "node build/lib/layersChecker.js",
|
"valid-layers-check": "node build/lib/layersChecker.js",
|
||||||
"strict-function-types-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictFunctionTypes",
|
"strict-function-types-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictFunctionTypes",
|
||||||
"update-distro": "node build/npm/update-distro.js",
|
"update-distro": "node build/npm/update-distro.js",
|
||||||
"web": "node resources/serverless/code-web.js",
|
"web": "node resources/web/code-web.js",
|
||||||
"compile-web": "gulp compile-web --max_old_space_size=4095",
|
"compile-web": "gulp compile-web --max_old_space_size=4095",
|
||||||
"watch-web": "gulp watch-web --max_old_space_size=4095",
|
"watch-web": "gulp watch-web --max_old_space_size=4095",
|
||||||
"eslint": "eslint -c .eslintrc.json --rulesdir ./build/lib/eslint --ext .ts --ext .js ./src/vs ./extensions",
|
"eslint": "eslint -c .eslintrc.json --rulesdir ./build/lib/eslint --ext .ts --ext .js ./src/vs ./extensions",
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
"css-loader": "^3.2.0",
|
"css-loader": "^3.2.0",
|
||||||
"debounce": "^1.0.0",
|
"debounce": "^1.0.0",
|
||||||
"deemon": "^1.4.0",
|
"deemon": "^1.4.0",
|
||||||
"electron": "7.3.2",
|
"electron": "9.2.0",
|
||||||
"eslint": "6.8.0",
|
"eslint": "6.8.0",
|
||||||
"eslint-plugin-jsdoc": "^19.1.0",
|
"eslint-plugin-jsdoc": "^19.1.0",
|
||||||
"event-stream": "3.3.4",
|
"event-stream": "3.3.4",
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
"temp-write": "^3.4.0",
|
"temp-write": "^3.4.0",
|
||||||
"ts-loader": "^4.4.2",
|
"ts-loader": "^4.4.2",
|
||||||
"typemoq": "^0.3.2",
|
"typemoq": "^0.3.2",
|
||||||
"typescript": "^3.9.3",
|
"typescript": "^4.0.1-rc",
|
||||||
"typescript-formatter": "7.1.0",
|
"typescript-formatter": "7.1.0",
|
||||||
"underscore": "^1.8.2",
|
"underscore": "^1.8.2",
|
||||||
"vinyl": "^2.0.0",
|
"vinyl": "^2.0.0",
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
disturl "http://nodejs.org/dist"
|
disturl "http://nodejs.org/dist"
|
||||||
target "12.4.0"
|
target "12.14.1"
|
||||||
runtime "node"
|
runtime "node"
|
||||||
|
|||||||
@@ -16,19 +16,25 @@ const opn = require('opn');
|
|||||||
const minimist = require('minimist');
|
const minimist = require('minimist');
|
||||||
const fancyLog = require('fancy-log');
|
const fancyLog = require('fancy-log');
|
||||||
const ansiColors = require('ansi-colors');
|
const ansiColors = require('ansi-colors');
|
||||||
|
const remote = require('gulp-remote-retry-src');
|
||||||
|
const vfs = require('vinyl-fs');
|
||||||
|
|
||||||
const extensions = require('../../build/lib/extensions');
|
const extensions = require('../../build/lib/extensions');
|
||||||
|
|
||||||
const APP_ROOT = path.join(__dirname, '..', '..');
|
const APP_ROOT = path.join(__dirname, '..', '..');
|
||||||
const BUILTIN_EXTENSIONS_ROOT = path.join(APP_ROOT, 'extensions');
|
const BUILTIN_EXTENSIONS_ROOT = path.join(APP_ROOT, 'extensions');
|
||||||
const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInExtensions');
|
const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInExtensions');
|
||||||
|
const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions');
|
||||||
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
|
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
|
||||||
|
|
||||||
|
const WEB_PLAYGROUND_VERSION = '0.0.2';
|
||||||
|
|
||||||
const args = minimist(process.argv, {
|
const args = minimist(process.argv, {
|
||||||
boolean: [
|
boolean: [
|
||||||
'no-launch',
|
'no-launch',
|
||||||
'help',
|
'help',
|
||||||
'verbose'
|
'verbose',
|
||||||
|
'wrap-iframe'
|
||||||
],
|
],
|
||||||
string: [
|
string: [
|
||||||
'scheme',
|
'scheme',
|
||||||
@@ -43,6 +49,7 @@ if (args.help) {
|
|||||||
console.log(
|
console.log(
|
||||||
'yarn web [options]\n' +
|
'yarn web [options]\n' +
|
||||||
' --no-launch Do not open VSCode web in the browser\n' +
|
' --no-launch Do not open VSCode web in the browser\n' +
|
||||||
|
' --wrap-iframe Wrap the Web Worker Extension Host in an iframe\n' +
|
||||||
' --scheme Protocol (https or http)\n' +
|
' --scheme Protocol (https or http)\n' +
|
||||||
' --host Remote host\n' +
|
' --host Remote host\n' +
|
||||||
' --port Remote/Local port\n' +
|
' --port Remote/Local port\n' +
|
||||||
@@ -70,9 +77,10 @@ async function getBuiltInExtensionInfos() {
|
|||||||
/** @type {Object.<string, string>} */
|
/** @type {Object.<string, string>} */
|
||||||
const locations = {};
|
const locations = {};
|
||||||
|
|
||||||
const [localExtensions, marketplaceExtensions] = await Promise.all([
|
const [localExtensions, marketplaceExtensions, webDevExtensions] = await Promise.all([
|
||||||
extensions.scanBuiltinExtensions(BUILTIN_EXTENSIONS_ROOT),
|
extensions.scanBuiltinExtensions(BUILTIN_EXTENSIONS_ROOT),
|
||||||
extensions.scanBuiltinExtensions(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT),
|
extensions.scanBuiltinExtensions(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT),
|
||||||
|
ensureWebDevExtensions().then(() => extensions.scanBuiltinExtensions(WEB_DEV_EXTENSIONS_ROOT))
|
||||||
]);
|
]);
|
||||||
for (const ext of localExtensions) {
|
for (const ext of localExtensions) {
|
||||||
allExtensions.push(ext);
|
allExtensions.push(ext);
|
||||||
@@ -82,10 +90,61 @@ async function getBuiltInExtensionInfos() {
|
|||||||
allExtensions.push(ext);
|
allExtensions.push(ext);
|
||||||
locations[ext.extensionPath] = path.join(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT, ext.extensionPath);
|
locations[ext.extensionPath] = path.join(BUILTIN_MARKETPLACE_EXTENSIONS_ROOT, ext.extensionPath);
|
||||||
}
|
}
|
||||||
|
for (const ext of webDevExtensions) {
|
||||||
|
allExtensions.push(ext);
|
||||||
|
locations[ext.extensionPath] = path.join(WEB_DEV_EXTENSIONS_ROOT, ext.extensionPath);
|
||||||
|
}
|
||||||
|
for (const ext of allExtensions) {
|
||||||
|
if (ext.packageJSON.browser) {
|
||||||
|
let mainFilePath = path.join(locations[ext.extensionPath], ext.packageJSON.browser);
|
||||||
|
if (path.extname(mainFilePath) !== '.js') {
|
||||||
|
mainFilePath += '.js';
|
||||||
|
}
|
||||||
|
if (!await exists(mainFilePath)) {
|
||||||
|
fancyLog(`${ansiColors.red('Error')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn watch-web')} to build the built-in extensions.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return { extensions: allExtensions, locations };
|
return { extensions: allExtensions, locations };
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDefaultExtensionInfos() {
|
async function ensureWebDevExtensions() {
|
||||||
|
|
||||||
|
// Playground (https://github.com/microsoft/vscode-web-playground)
|
||||||
|
const webDevPlaygroundRoot = path.join(WEB_DEV_EXTENSIONS_ROOT, 'vscode-web-playground');
|
||||||
|
const webDevPlaygroundExists = await exists(webDevPlaygroundRoot);
|
||||||
|
|
||||||
|
let downloadPlayground = false;
|
||||||
|
if (webDevPlaygroundExists) {
|
||||||
|
try {
|
||||||
|
const webDevPlaygroundPackageJson = JSON.parse(((await readFile(path.join(webDevPlaygroundRoot, 'package.json'))).toString()));
|
||||||
|
if (webDevPlaygroundPackageJson.version !== WEB_PLAYGROUND_VERSION) {
|
||||||
|
downloadPlayground = true;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
downloadPlayground = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
downloadPlayground = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (downloadPlayground) {
|
||||||
|
if (args.verbose) {
|
||||||
|
fancyLog(`${ansiColors.magenta('Web Development extensions')}: Downloading vscode-web-playground to ${webDevPlaygroundRoot}`);
|
||||||
|
}
|
||||||
|
await new Promise((resolve, reject) => {
|
||||||
|
remote(['package.json', 'dist/extension.js', 'dist/extension.js.map'], {
|
||||||
|
base: 'https://raw.githubusercontent.com/microsoft/vscode-web-playground/main/'
|
||||||
|
}).pipe(vfs.dest(webDevPlaygroundRoot)).on('end', resolve).on('error', reject);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (args.verbose) {
|
||||||
|
fancyLog(`${ansiColors.magenta('Web Development extensions')}: Using existing vscode-web-playground in ${webDevPlaygroundRoot}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCommandlineProvidedExtensionInfos() {
|
||||||
const extensions = [];
|
const extensions = [];
|
||||||
|
|
||||||
/** @type {Object.<string, string>} */
|
/** @type {Object.<string, string>} */
|
||||||
@@ -122,16 +181,6 @@ async function getExtensionPackageJSON(extensionPath) {
|
|||||||
return; // unsupported
|
return; // unsupported
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packageJSON.browser) {
|
|
||||||
let mainFilePath = path.join(extensionPath, packageJSON.browser);
|
|
||||||
if (path.extname(mainFilePath) !== '.js') {
|
|
||||||
mainFilePath += '.js';
|
|
||||||
}
|
|
||||||
if (!await exists(mainFilePath)) {
|
|
||||||
fancyLog(`${ansiColors.yellow('Warning')}: Could not find ${mainFilePath}. Use ${ansiColors.cyan('yarn gulp watch-web')} to build the built-in extensions.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
|
const packageNLSPath = path.join(extensionPath, 'package.nls.json');
|
||||||
const packageNLSExists = await exists(packageNLSPath);
|
const packageNLSExists = await exists(packageNLSPath);
|
||||||
if (packageNLSExists) {
|
if (packageNLSExists) {
|
||||||
@@ -147,7 +196,7 @@ async function getExtensionPackageJSON(extensionPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const builtInExtensionsPromise = getBuiltInExtensionInfos();
|
const builtInExtensionsPromise = getBuiltInExtensionInfos();
|
||||||
const defaultExtensionsPromise = getDefaultExtensionInfos();
|
const commandlineProvidedExtensionsPromise = getCommandlineProvidedExtensionInfos();
|
||||||
|
|
||||||
const mapCallbackUriToRequestId = new Map();
|
const mapCallbackUriToRequestId = new Map();
|
||||||
|
|
||||||
@@ -179,10 +228,6 @@ const server = http.createServer((req, res) => {
|
|||||||
// default extension requests
|
// default extension requests
|
||||||
return handleExtension(req, res, parsedUrl);
|
return handleExtension(req, res, parsedUrl);
|
||||||
}
|
}
|
||||||
if (/^\/builtin-extension\//.test(pathname)) {
|
|
||||||
// built-in extension requests
|
|
||||||
return handleBuiltInExtension(req, res, parsedUrl);
|
|
||||||
}
|
|
||||||
if (pathname === '/') {
|
if (pathname === '/') {
|
||||||
// main web
|
// main web
|
||||||
return handleRoot(req, res);
|
return handleRoot(req, res);
|
||||||
@@ -219,7 +264,18 @@ server.on('error', err => {
|
|||||||
* @param {import('http').ServerResponse} res
|
* @param {import('http').ServerResponse} res
|
||||||
* @param {import('url').UrlWithParsedQuery} parsedUrl
|
* @param {import('url').UrlWithParsedQuery} parsedUrl
|
||||||
*/
|
*/
|
||||||
function handleStatic(req, res, parsedUrl) {
|
async function handleStatic(req, res, parsedUrl) {
|
||||||
|
|
||||||
|
if (/^\/static\/extensions\//.test(parsedUrl.pathname)) {
|
||||||
|
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/static/extensions/'.length));
|
||||||
|
const filePath = getExtensionFilePath(relativePath, (await builtInExtensionsPromise).locations);
|
||||||
|
if (!filePath) {
|
||||||
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
|
}
|
||||||
|
return serveFile(req, res, filePath, {
|
||||||
|
'Access-Control-Allow-Origin': '*'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Strip `/static/` from the path
|
// Strip `/static/` from the path
|
||||||
const relativeFilePath = path.normalize(decodeURIComponent(parsedUrl.pathname.substr('/static/'.length)));
|
const relativeFilePath = path.normalize(decodeURIComponent(parsedUrl.pathname.substr('/static/'.length)));
|
||||||
@@ -235,24 +291,7 @@ function handleStatic(req, res, parsedUrl) {
|
|||||||
async function handleExtension(req, res, parsedUrl) {
|
async function handleExtension(req, res, parsedUrl) {
|
||||||
// Strip `/extension/` from the path
|
// Strip `/extension/` from the path
|
||||||
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/extension/'.length));
|
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/extension/'.length));
|
||||||
const filePath = getExtensionFilePath(relativePath, (await defaultExtensionsPromise).locations);
|
const filePath = getExtensionFilePath(relativePath, (await commandlineProvidedExtensionsPromise).locations);
|
||||||
if (!filePath) {
|
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
|
||||||
}
|
|
||||||
return serveFile(req, res, filePath, {
|
|
||||||
'Access-Control-Allow-Origin': '*'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import('http').IncomingMessage} req
|
|
||||||
* @param {import('http').ServerResponse} res
|
|
||||||
* @param {import('url').UrlWithParsedQuery} parsedUrl
|
|
||||||
*/
|
|
||||||
async function handleBuiltInExtension(req, res, parsedUrl) {
|
|
||||||
// Strip `/builtin-extension/` from the path
|
|
||||||
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/builtin-extension/'.length));
|
|
||||||
const filePath = getExtensionFilePath(relativePath, (await builtInExtensionsPromise).locations);
|
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
}
|
}
|
||||||
@@ -296,22 +335,35 @@ async function handleRoot(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { extensions: builtInExtensions } = await builtInExtensionsPromise;
|
const { extensions: builtInExtensions } = await builtInExtensionsPromise;
|
||||||
const { extensions: staticExtensions } = await defaultExtensionsPromise;
|
const { extensions: staticExtensions, locations: staticLocations } = await commandlineProvidedExtensionsPromise;
|
||||||
|
|
||||||
|
const dedupedBuiltInExtensions = [];
|
||||||
|
for (const builtInExtension of builtInExtensions) {
|
||||||
|
const extensionId = `${builtInExtension.packageJSON.publisher}.${builtInExtension.packageJSON.name}`;
|
||||||
|
if (staticLocations[extensionId]) {
|
||||||
|
fancyLog(`${ansiColors.magenta('BuiltIn extensions')}: Ignoring built-in ${extensionId} because it was overridden via --extension argument`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dedupedBuiltInExtensions.push(builtInExtension);
|
||||||
|
}
|
||||||
|
|
||||||
if (args.verbose) {
|
if (args.verbose) {
|
||||||
fancyLog(`${ansiColors.magenta('BuiltIn extensions')}: ${builtInExtensions.map(e => path.basename(e.extensionPath)).join(', ')}`);
|
fancyLog(`${ansiColors.magenta('BuiltIn extensions')}: ${dedupedBuiltInExtensions.map(e => path.basename(e.extensionPath)).join(', ')}`);
|
||||||
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${staticExtensions.map(e => path.basename(e.extensionLocation.path)).join(', ') || 'None'}`);
|
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${staticExtensions.map(e => path.basename(e.extensionLocation.path)).join(', ') || 'None'}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const webConfigJSON = escapeAttribute(JSON.stringify({
|
const webConfigJSON = {
|
||||||
folderUri: folderUri,
|
folderUri: folderUri,
|
||||||
staticExtensions,
|
staticExtensions,
|
||||||
builtinExtensionsServiceUrl: `${SCHEME}://${AUTHORITY}/builtin-extension`
|
};
|
||||||
}));
|
if (args['wrap-iframe']) {
|
||||||
|
webConfigJSON._wrapWebWorkerExtHostInIframe = true;
|
||||||
|
}
|
||||||
|
|
||||||
const data = (await readFile(WEB_MAIN)).toString()
|
const data = (await readFile(WEB_MAIN)).toString()
|
||||||
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', () => webConfigJSON) // use a replace function to avoid that regexp replace patterns ($&, $0, ...) are applied
|
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', () => escapeAttribute(JSON.stringify(webConfigJSON))) // use a replace function to avoid that regexp replace patterns ($&, $0, ...) are applied
|
||||||
.replace('{{WORKBENCH_BUILTIN_EXTENSIONS}}', () => escapeAttribute(JSON.stringify(builtInExtensions)))
|
.replace('{{WORKBENCH_BUILTIN_EXTENSIONS}}', () => escapeAttribute(JSON.stringify(dedupedBuiltInExtensions)))
|
||||||
.replace('{{WEBVIEW_ENDPOINT}}', '')
|
.replace('{{WEBVIEW_ENDPOINT}}', '')
|
||||||
.replace('{{REMOTE_USER_DATA_URI}}', '');
|
.replace('{{REMOTE_USER_DATA_URI}}', '');
|
||||||
|
|
||||||
@@ -356,7 +408,7 @@ async function handleCallback(req, res, parsedUrl) {
|
|||||||
|
|
||||||
// add to map of known callbacks
|
// add to map of known callbacks
|
||||||
mapCallbackUriToRequestId.set(requestId, JSON.stringify({ scheme: vscodeScheme || 'code-oss', authority: vscodeAuthority, path: vscodePath, query, fragment: vscodeFragment }));
|
mapCallbackUriToRequestId.set(requestId, JSON.stringify({ scheme: vscodeScheme || 'code-oss', authority: vscodeAuthority, path: vscodePath, query, fragment: vscodeFragment }));
|
||||||
return serveFile(req, res, path.join(APP_ROOT, 'resources', 'serverless', 'callback.html'), { 'Content-Type': 'text/html' });
|
return serveFile(req, res, path.join(APP_ROOT, 'resources', 'web', 'callback.html'), { 'Content-Type': 'text/html' });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +37,7 @@ else
|
|||||||
fi
|
fi
|
||||||
if [ $IN_WSL = true ]; then
|
if [ $IN_WSL = true ]; then
|
||||||
|
|
||||||
export WSLENV=ELECTRON_RUN_AS_NODE/w:$WSLENV
|
export WSLENV="ELECTRON_RUN_AS_NODE/w:$WSLENV"
|
||||||
CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
CLI=$(wslpath -m "$VSCODE_PATH/resources/app/out/cli.js")
|
||||||
|
|
||||||
# use the Remote WSL extension if installed
|
# use the Remote WSL extension if installed
|
||||||
|
|||||||
@@ -67,8 +67,11 @@ mkdir %GITWORKSPACE%
|
|||||||
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --enable-proposed-api=vscode.git --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
|
call "%INTEGRATION_TEST_ELECTRON_PATH%" %GITWORKSPACE% --extensionDevelopmentPath=%~dp0\..\extensions\git --extensionTestsPath=%~dp0\..\extensions\git\out\test --enable-proposed-api=vscode.git --disable-telemetry --crash-reporter-directory=%VSCODECRASHDIR% --no-cached-data --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
:: Tests in commonJS (HTML, CSS, JSON language server tests...)
|
:: Tests in commonJS (CSS, HTML)
|
||||||
REM call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js
|
REM call %~dp0\node-electron.bat %~dp0\..\extensions\css-language-features/server/test/index.js
|
||||||
|
REM if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
|
REM call %~dp0\node-electron.bat %~dp0\..\extensions\html-language-features/server/test/index.js
|
||||||
REM if %errorlevel% neq 0 exit /b %errorlevel%
|
REM if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
rmdir /s /q %VSCODEUSERDATADIR%
|
rmdir /s /q %VSCODEUSERDATADIR%
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ fi
|
|||||||
|
|
||||||
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/azurecore/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/azurecore --extensionTestsPath=$ROOT/extensions/azurecore/out/test --no-cached-data --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=$VSCODEUSERDATADIR
|
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/azurecore/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/azurecore --extensionTestsPath=$ROOT/extensions/azurecore/out/test --no-cached-data --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=$VSCODEUSERDATADIR
|
||||||
|
|
||||||
# Tests in commonJS
|
# Tests in commonJS (CSS, HTML)
|
||||||
# cd $ROOT/extensions/css-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
# cd $ROOT/extensions/css-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
||||||
# cd $ROOT/extensions/html-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
# cd $ROOT/extensions/html-language-features/server && $ROOT/scripts/node-electron.sh test/index.js
|
||||||
|
|
||||||
|
|||||||
8
src/bootstrap-window.js
vendored
8
src/bootstrap-window.js
vendored
@@ -23,6 +23,7 @@
|
|||||||
}(this, function () {
|
}(this, function () {
|
||||||
const preloadGlobals = globals();
|
const preloadGlobals = globals();
|
||||||
const sandbox = preloadGlobals.context.sandbox;
|
const sandbox = preloadGlobals.context.sandbox;
|
||||||
|
const webFrame = preloadGlobals.webFrame;
|
||||||
const safeProcess = sandbox ? preloadGlobals.process : process;
|
const safeProcess = sandbox ? preloadGlobals.process : process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
/**
|
/**
|
||||||
* // configuration: INativeWindowConfiguration
|
* // configuration: INativeWindowConfiguration
|
||||||
* @type {{
|
* @type {{
|
||||||
|
* zoomLevel?: number,
|
||||||
* extensionDevelopmentPath?: string[],
|
* extensionDevelopmentPath?: string[],
|
||||||
* extensionTestsPath?: string,
|
* extensionTestsPath?: string,
|
||||||
* userEnv?: { [key: string]: string | undefined },
|
* userEnv?: { [key: string]: string | undefined },
|
||||||
@@ -43,6 +45,12 @@
|
|||||||
* }} */
|
* }} */
|
||||||
const configuration = JSON.parse(args['config'] || '{}') || {};
|
const configuration = JSON.parse(args['config'] || '{}') || {};
|
||||||
|
|
||||||
|
// Apply zoom level early to avoid glitches
|
||||||
|
const zoomLevel = configuration.zoomLevel;
|
||||||
|
if (typeof zoomLevel === 'number' && zoomLevel !== 0) {
|
||||||
|
webFrame.setZoomLevel(zoomLevel);
|
||||||
|
}
|
||||||
|
|
||||||
// Error handler
|
// Error handler
|
||||||
safeProcess.on('uncaughtException', function (error) {
|
safeProcess.on('uncaughtException', function (error) {
|
||||||
onUnexpectedError(error, enableDeveloperTools);
|
onUnexpectedError(error, enableDeveloperTools);
|
||||||
|
|||||||
109
src/main.js
109
src/main.js
@@ -18,7 +18,11 @@ const bootstrap = require('./bootstrap');
|
|||||||
const paths = require('./paths');
|
const paths = require('./paths');
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const { app, protocol } = require('electron');
|
const { app, protocol, crashReporter } = require('electron');
|
||||||
|
|
||||||
|
// Disable render process reuse, we still have
|
||||||
|
// non-context aware native modules in the renderer.
|
||||||
|
app.allowRendererProcessReuse = false;
|
||||||
|
|
||||||
// Enable portable support
|
// Enable portable support
|
||||||
const portable = bootstrap.configurePortable(product);
|
const portable = bootstrap.configurePortable(product);
|
||||||
@@ -38,13 +42,13 @@ if (args['nogpu']) { // {{SQL CARBON EDIT}}
|
|||||||
const userDataPath = getUserDataPath(args);
|
const userDataPath = getUserDataPath(args);
|
||||||
app.setPath('userData', userDataPath);
|
app.setPath('userData', userDataPath);
|
||||||
|
|
||||||
// Set temp directory based on crash-reporter-directory CLI argument
|
// Configure static command line arguments
|
||||||
// The crash reporter will store crashes in temp folder so we need
|
const argvConfig = configureCommandlineSwitchesSync(args);
|
||||||
// to change that location accordingly.
|
|
||||||
|
|
||||||
// If a crash-reporter-directory is specified we setup the crash reporter
|
// If a crash-reporter-directory is specified we store the crash reports
|
||||||
// right from the beginning as early as possible to monitor all processes.
|
// in the specified directory and don't upload them to the crash server.
|
||||||
let crashReporterDirectory = args['crash-reporter-directory'];
|
let crashReporterDirectory = args['crash-reporter-directory'];
|
||||||
|
let submitURL = '';
|
||||||
if (crashReporterDirectory) {
|
if (crashReporterDirectory) {
|
||||||
crashReporterDirectory = path.normalize(crashReporterDirectory);
|
crashReporterDirectory = path.normalize(crashReporterDirectory);
|
||||||
|
|
||||||
@@ -62,23 +66,41 @@ if (crashReporterDirectory) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crashes are stored in the temp directory by default, so we
|
// Crashes are stored in the crashDumps directory by default, so we
|
||||||
// need to change that directory to the provided one
|
// need to change that directory to the provided one
|
||||||
console.log(`Found --crash-reporter-directory argument. Setting temp directory to be '${crashReporterDirectory}'`);
|
console.log(`Found --crash-reporter-directory argument. Setting crashDumps directory to be '${crashReporterDirectory}'`);
|
||||||
app.setPath('temp', crashReporterDirectory);
|
app.setPath('crashDumps', crashReporterDirectory);
|
||||||
|
} else {
|
||||||
// Start crash reporter
|
const appCenter = product.appCenter;
|
||||||
const { crashReporter } = require('electron');
|
// Disable Appcenter crash reporting if
|
||||||
const productName = (product.crashReporter && product.crashReporter.productName) || product.nameShort;
|
// * --crash-reporter-directory is specified
|
||||||
const companyName = (product.crashReporter && product.crashReporter.companyName) || 'Microsoft';
|
// * enable-crash-reporter runtime argument is set to 'false'
|
||||||
crashReporter.start({
|
// * --disable-crash-reporter command line parameter is set
|
||||||
companyName: companyName,
|
if (appCenter && argvConfig['enable-crash-reporter'] && !args['disable-crash-reporter']) {
|
||||||
productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
|
const isWindows = (process.platform === 'win32');
|
||||||
submitURL: '',
|
const isLinux = (process.platform === 'linux');
|
||||||
uploadToServer: false
|
const crashReporterId = argvConfig['crash-reporter-id'];
|
||||||
});
|
const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
||||||
|
if (uuidPattern.test(crashReporterId)) {
|
||||||
|
submitURL = isWindows ? appCenter[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? appCenter[`linux-x64`] : appCenter.darwin;
|
||||||
|
submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId);
|
||||||
|
// Send the id for child node process that are explicitly starting crash reporter.
|
||||||
|
// For vscode this is ExtensionHost process currently.
|
||||||
|
process.argv.push('--crash-reporter-id', crashReporterId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start crash reporter for all processes
|
||||||
|
const productName = (product.crashReporter ? product.crashReporter.productName : undefined) || product.nameShort;
|
||||||
|
const companyName = (product.crashReporter ? product.crashReporter.companyName : undefined) || 'Microsoft';
|
||||||
|
crashReporter.start({
|
||||||
|
companyName: companyName,
|
||||||
|
productName: process.env['VSCODE_DEV'] ? `${productName} Dev` : productName,
|
||||||
|
submitURL,
|
||||||
|
uploadToServer: !crashReporterDirectory
|
||||||
|
});
|
||||||
|
|
||||||
// Set logs path before app 'ready' event if running portable
|
// Set logs path before app 'ready' event if running portable
|
||||||
// to ensure that no 'logs' folder is created on disk at a
|
// to ensure that no 'logs' folder is created on disk at a
|
||||||
// location outside of the portable directory
|
// location outside of the portable directory
|
||||||
@@ -117,9 +139,6 @@ registerListeners();
|
|||||||
// Cached data
|
// Cached data
|
||||||
const nodeCachedDataDir = getNodeCachedDir();
|
const nodeCachedDataDir = getNodeCachedDir();
|
||||||
|
|
||||||
// Configure static command line arguments
|
|
||||||
const argvConfig = configureCommandlineSwitchesSync(args);
|
|
||||||
|
|
||||||
// Remove env set by snap https://github.com/microsoft/vscode/issues/85344
|
// Remove env set by snap https://github.com/microsoft/vscode/issues/85344
|
||||||
if (process.env['SNAP']) {
|
if (process.env['SNAP']) {
|
||||||
delete process.env['GDK_PIXBUF_MODULE_FILE'];
|
delete process.env['GDK_PIXBUF_MODULE_FILE'];
|
||||||
@@ -261,9 +280,6 @@ function configureCommandlineSwitchesSync(cliArgs) {
|
|||||||
app.commandLine.appendSwitch('js-flags', jsFlags);
|
app.commandLine.appendSwitch('js-flags', jsFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO@Deepak Electron 7 workaround for https://github.com/microsoft/vscode/issues/88873
|
|
||||||
app.commandLine.appendSwitch('disable-features', 'LayoutNG');
|
|
||||||
|
|
||||||
return argvConfig;
|
return argvConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,21 +320,10 @@ function createDefaultArgvConfigSync(argvConfigPath) {
|
|||||||
fs.mkdirSync(argvConfigPathDirname);
|
fs.mkdirSync(argvConfigPathDirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate over legacy locale
|
|
||||||
const localeConfigPath = path.join(userDataPath, 'User', 'locale.json');
|
|
||||||
const legacyLocale = getLegacyUserDefinedLocaleSync(localeConfigPath);
|
|
||||||
if (legacyLocale) {
|
|
||||||
try {
|
|
||||||
fs.unlinkSync(localeConfigPath);
|
|
||||||
} catch (error) {
|
|
||||||
//ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Default argv content
|
// Default argv content
|
||||||
const defaultArgvConfigContent = [
|
const defaultArgvConfigContent = [
|
||||||
'// This configuration file allows you to pass permanent command line arguments to VS Code.',
|
'// This configuration file allows you to pass permanent command line arguments to VS Code.',
|
||||||
'// Only a subset of arguments is currently supported to reduce the likelyhood of breaking',
|
'// Only a subset of arguments is currently supported to reduce the likelihood of breaking',
|
||||||
'// the installation.',
|
'// the installation.',
|
||||||
'//',
|
'//',
|
||||||
'// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT',
|
'// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT',
|
||||||
@@ -331,19 +336,10 @@ function createDefaultArgvConfigSync(argvConfigPath) {
|
|||||||
'',
|
'',
|
||||||
' // Enabled by default by VS Code to resolve color issues in the renderer',
|
' // Enabled by default by VS Code to resolve color issues in the renderer',
|
||||||
' // See https://github.com/Microsoft/vscode/issues/51791 for details',
|
' // See https://github.com/Microsoft/vscode/issues/51791 for details',
|
||||||
' "disable-color-correct-rendering": true'
|
' "disable-color-correct-rendering": true',
|
||||||
|
'}'
|
||||||
];
|
];
|
||||||
|
|
||||||
if (legacyLocale) {
|
|
||||||
defaultArgvConfigContent[defaultArgvConfigContent.length - 1] = `${defaultArgvConfigContent[defaultArgvConfigContent.length - 1]},`; // append trailing ","
|
|
||||||
|
|
||||||
defaultArgvConfigContent.push('');
|
|
||||||
defaultArgvConfigContent.push(' // Display language of VS Code');
|
|
||||||
defaultArgvConfigContent.push(` "locale": "${legacyLocale}"`);
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultArgvConfigContent.push('}');
|
|
||||||
|
|
||||||
// Create initial argv.json with default content
|
// Create initial argv.json with default content
|
||||||
fs.writeFileSync(argvConfigPath, defaultArgvConfigContent.join('\n'));
|
fs.writeFileSync(argvConfigPath, defaultArgvConfigContent.join('\n'));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -601,19 +597,4 @@ function getUserDefinedLocale(argvConfig) {
|
|||||||
return argvConfig.locale && typeof argvConfig.locale === 'string' ? argvConfig.locale.toLowerCase() : undefined;
|
return argvConfig.locale && typeof argvConfig.locale === 'string' ? argvConfig.locale.toLowerCase() : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} localeConfigPath
|
|
||||||
* @returns {string | undefined}
|
|
||||||
*/
|
|
||||||
function getLegacyUserDefinedLocaleSync(localeConfigPath) {
|
|
||||||
try {
|
|
||||||
const content = stripComments(fs.readFileSync(localeConfigPath).toString());
|
|
||||||
|
|
||||||
const value = JSON.parse(content).locale;
|
|
||||||
return value && typeof value === 'string' ? value.toLowerCase() : undefined;
|
|
||||||
} catch (error) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@@ -993,8 +993,6 @@ export class Table<T> implements IDisposable {
|
|||||||
// if (!filter || filter(this.view.element(index))) {
|
// if (!filter || filter(this.view.element(index))) {
|
||||||
return index;
|
return index;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1010,9 +1008,7 @@ export class Table<T> implements IDisposable {
|
|||||||
|
|
||||||
// if (!filter || filter(this.view.element(index))) {
|
// if (!filter || filter(this.view.element(index))) {
|
||||||
return index;
|
return index;
|
||||||
// }
|
//
|
||||||
|
|
||||||
index--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -205,7 +205,6 @@ class TabImpl extends ModelViewPanelImpl implements azdata.window.DialogTab {
|
|||||||
|
|
||||||
public title: string;
|
public title: string;
|
||||||
public content: string;
|
public content: string;
|
||||||
public handle: number;
|
|
||||||
|
|
||||||
public setModelViewId(value: string) {
|
public setModelViewId(value: string) {
|
||||||
super.setModelViewId(value);
|
super.setModelViewId(value);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class BackupDialog extends Modal {
|
|||||||
* Get the bootstrap params and perform the bootstrap
|
* Get the bootstrap params and perform the bootstrap
|
||||||
*/
|
*/
|
||||||
private bootstrapAngular(bodyContainer: HTMLElement) {
|
private bootstrapAngular(bodyContainer: HTMLElement) {
|
||||||
this._instantiationService.invokeFunction(bootstrapAngular,
|
this._instantiationService.invokeFunction<void, any[]>(bootstrapAngular,
|
||||||
BackupModule,
|
BackupModule,
|
||||||
bodyContainer,
|
bodyContainer,
|
||||||
BACKUP_SELECTOR,
|
BACKUP_SELECTOR,
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ suite('Test class NotebookEditor:', () => {
|
|||||||
const searchString = getRandomString(1, 10);
|
const searchString = getRandomString(1, 10);
|
||||||
const matchCase = true;
|
const matchCase = true;
|
||||||
const wholeWord = true;
|
const wholeWord = true;
|
||||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||||
const currentMatch = <NotebookRange>{};
|
const currentMatch = <NotebookRange>{};
|
||||||
test(`Verifies _onFindStateChange callback when searchScope is defined, visibility='${visibility}', searchString='${searchString}', matchCase='${matchCase}', wholeWord='${wholeWord}'`, async () => {
|
test(`Verifies _onFindStateChange callback when searchScope is defined, visibility='${visibility}', searchString='${searchString}', matchCase='${matchCase}', wholeWord='${wholeWord}'`, async () => {
|
||||||
const { findReplaceStateChangedEvent, notebookFindModelMock, findDecorationsMock, notebookFindModel, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
const { findReplaceStateChangedEvent, notebookFindModelMock, findDecorationsMock, notebookFindModel, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||||
@@ -444,7 +444,7 @@ suite('Test class NotebookEditor:', () => {
|
|||||||
const searchString = getRandomString(1, 10);
|
const searchString = getRandomString(1, 10);
|
||||||
const matchCase = true;
|
const matchCase = true;
|
||||||
const wholeWord = true;
|
const wholeWord = true;
|
||||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||||
const currentMatch = <NotebookRange>{};
|
const currentMatch = <NotebookRange>{};
|
||||||
const { notebookFindModelMock, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
const { notebookFindModelMock, notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||||
notebookFindModelMock.setup(x => x.getIndexByRange(TypeMoq.It.isAny())).returns((_range: NotebookRange) => {
|
notebookFindModelMock.setup(x => x.getIndexByRange(TypeMoq.It.isAny())).returns((_range: NotebookRange) => {
|
||||||
@@ -469,7 +469,7 @@ suite('Test class NotebookEditor:', () => {
|
|||||||
const searchString = getRandomString(1, 10);
|
const searchString = getRandomString(1, 10);
|
||||||
const matchCase = true;
|
const matchCase = true;
|
||||||
const wholeWord = true;
|
const wholeWord = true;
|
||||||
const searchScope = new NotebookRange(<ICellModel>{}, 1, 1, 1, 1);
|
const searchScope = [new NotebookRange(<ICellModel>{}, 1, 1, 1, 1)];
|
||||||
const currentMatch = <NotebookRange>{};
|
const currentMatch = <NotebookRange>{};
|
||||||
const { notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
const { notebookEditor } = await findStateChangeSetup(instantiationService, workbenchThemeService, notebookService, untitledNotebookInput, undefined, currentMatch, searchString, wholeWord, matchCase, searchScope);
|
||||||
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
||||||
@@ -499,7 +499,7 @@ suite('Test class NotebookEditor:', () => {
|
|||||||
searchString: getRandomString(1, 10),
|
searchString: getRandomString(1, 10),
|
||||||
matchCase: true,
|
matchCase: true,
|
||||||
wholeWord: true,
|
wholeWord: true,
|
||||||
searchScope: <NotebookRange>{}
|
searchScope: [<NotebookRange>{}]
|
||||||
};
|
};
|
||||||
findState.change(newState, false);
|
findState.change(newState, false);
|
||||||
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
||||||
@@ -530,7 +530,7 @@ suite('Test class NotebookEditor:', () => {
|
|||||||
searchString: getRandomString(1, 10),
|
searchString: getRandomString(1, 10),
|
||||||
matchCase: true,
|
matchCase: true,
|
||||||
wholeWord: true,
|
wholeWord: true,
|
||||||
searchScope: <NotebookRange>{}
|
searchScope: [<NotebookRange>{}]
|
||||||
};
|
};
|
||||||
findState.change(newState, false); //installs _updateFinderMatchState as event handler for onFindCountChange event
|
findState.change(newState, false); //installs _updateFinderMatchState as event handler for onFindCountChange event
|
||||||
let updateFinderMatchStateCalled = false;
|
let updateFinderMatchStateCalled = false;
|
||||||
@@ -596,7 +596,7 @@ async function verifyFindCallsWhenFindStateChangeCallbackFires(instantiationServ
|
|||||||
findDecorationsMock.verify(x => x.clearDecorations(), TypeMoq.Times.once());
|
findDecorationsMock.verify(x => x.clearDecorations(), TypeMoq.Times.once());
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findStateChangeSetup(instantiationService: TestInstantiationService, workbenchThemeService: any, notebookService: NotebookService, untitledNotebookInput: UntitledNotebookInput, modelFindExpression: string, currentMatch: NotebookRange, searchString: string, wholeWord: boolean, matchCase: boolean, searchScope: NotebookRange | null = undefined, findMatches: Array<NotebookFindMatch> = []) {
|
async function findStateChangeSetup(instantiationService: TestInstantiationService, workbenchThemeService: any, notebookService: NotebookService, untitledNotebookInput: UntitledNotebookInput, modelFindExpression: string, currentMatch: NotebookRange, searchString: string, wholeWord: boolean, matchCase: boolean, searchScope: NotebookRange[] | null = undefined, findMatches: Array<NotebookFindMatch> = []) {
|
||||||
const findReplaceStateChangedEvent: FindReplaceStateChangedEvent = {
|
const findReplaceStateChangedEvent: FindReplaceStateChangedEvent = {
|
||||||
searchString: searchString !== undefined,
|
searchString: searchString !== undefined,
|
||||||
matchCase: matchCase,
|
matchCase: matchCase,
|
||||||
@@ -752,4 +752,3 @@ function createEditor(notebookEditor: NotebookEditor) {
|
|||||||
let parentHtmlElement = document.createElement('div');
|
let parentHtmlElement = document.createElement('div');
|
||||||
notebookEditor.create(parentHtmlElement); // adds notebookEditor to new htmlElement as parent
|
notebookEditor.create(parentHtmlElement); // adds notebookEditor to new htmlElement as parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,9 @@ export class NotebookEditorStub extends stubs.NotebookEditorStub {
|
|||||||
model: INotebookModel | undefined;
|
model: INotebookModel | undefined;
|
||||||
cells?: ICellModel[] = [];
|
cells?: ICellModel[] = [];
|
||||||
|
|
||||||
get id(): string {
|
public readonly id = this.notebookParams?.notebookUri?.toString();
|
||||||
return this.notebookParams?.notebookUri?.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
get modelReady(): Promise<INotebookModel> {
|
public readonly modelReady: Promise<INotebookModel> = Promise.resolve(this.model);
|
||||||
return Promise.resolve(this.model);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normally one needs to provide either the editor or the instantiationService as the constructor parameter
|
// Normally one needs to provide either the editor or the instantiationService as the constructor parameter
|
||||||
constructor({ cellGuid, instantiationService, editor, model, notebookParams }: { cellGuid?: string; instantiationService?: IInstantiationService; editor?: QueryTextEditor; model?: INotebookModel, notebookParams?: INotebookParams } = {}) {
|
constructor({ cellGuid, instantiationService, editor, model, notebookParams }: { cellGuid?: string; instantiationService?: IInstantiationService; editor?: QueryTextEditor; model?: INotebookModel, notebookParams?: INotebookParams } = {}) {
|
||||||
|
|||||||
@@ -165,7 +165,10 @@ class ServiceAccessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MockEditorService extends TestEditorService {
|
class MockEditorService extends TestEditorService {
|
||||||
public readonly activeEditor: IEditorInput | undefined = undefined;
|
private __activeEditor: IEditorInput | undefined = undefined;
|
||||||
|
public get activeEditor(): IEditorInput | undefined {
|
||||||
|
return this.__activeEditor;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(instantiationService?: IInstantiationService) {
|
constructor(instantiationService?: IInstantiationService) {
|
||||||
super();
|
super();
|
||||||
@@ -174,7 +177,7 @@ class MockEditorService extends TestEditorService {
|
|||||||
const accessor = workbenchinstantiationService.createInstance(ServiceAccessor);
|
const accessor = workbenchinstantiationService.createInstance(ServiceAccessor);
|
||||||
const service = accessor.untitledTextEditorService;
|
const service = accessor.untitledTextEditorService;
|
||||||
const untitledInput = instantiationService.createInstance(UntitledTextEditorInput, service.create({ associatedResource: URI.file('/test/file') }));
|
const untitledInput = instantiationService.createInstance(UntitledTextEditorInput, service.create({ associatedResource: URI.file('/test/file') }));
|
||||||
this.activeEditor = instantiationService.createInstance(UntitledQueryEditorInput, '', untitledInput, undefined);
|
this.__activeEditor = instantiationService.createInstance(UntitledQueryEditorInput, '', untitledInput, undefined);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ export class ConnectionDialogWidget extends Modal implements IViewPaneContainer
|
|||||||
this.viewContainer = container;
|
this.viewContainer = container;
|
||||||
this.viewContainerModel = viewDescriptorService.getViewContainerModel(container);
|
this.viewContainerModel = viewDescriptorService.getViewContainerModel(container);
|
||||||
}
|
}
|
||||||
|
getActionsContext(): unknown {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the available connection providers, this is called when new providers are registered
|
* Update the available connection providers, this is called when new providers are registered
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ export class DialogPane extends Disposable implements IThemable {
|
|||||||
* Bootstrap angular for the dialog's model view controller with the given model view ID
|
* Bootstrap angular for the dialog's model view controller with the given model view ID
|
||||||
*/
|
*/
|
||||||
private initializeModelViewContainer(bodyContainer: HTMLElement, modelViewId: string, tab?: DialogTab) {
|
private initializeModelViewContainer(bodyContainer: HTMLElement, modelViewId: string, tab?: DialogTab) {
|
||||||
this._instantiationService.invokeFunction(bootstrapAngular,
|
this._instantiationService.invokeFunction<void, any[]>(bootstrapAngular,
|
||||||
DialogModule,
|
DialogModule,
|
||||||
bodyContainer,
|
bodyContainer,
|
||||||
'dialog-modelview-container',
|
'dialog-modelview-container',
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"strictNullChecks": false,
|
"strictNullChecks": false,
|
||||||
"strictPropertyInitialization": false,
|
"strictPropertyInitialization": false,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|||||||
19
src/typings/node.processEnv-ext.d.ts
vendored
19
src/typings/node.processEnv-ext.d.ts
vendored
@@ -1,19 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
declare namespace NodeJS {
|
|
||||||
|
|
||||||
export interface Process {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The lazy enviroment is a promise that resolves to `process.env`
|
|
||||||
* once the process is resolved. The use-case is VS Code running
|
|
||||||
* on Linux/macOS when being launched via a launcher. Then the env
|
|
||||||
* (as defined in .bashrc etc) isn't properly set and needs to be
|
|
||||||
* resolved lazy.
|
|
||||||
*/
|
|
||||||
lazyEnv: Thenable<typeof process.env> | undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,6 +23,9 @@ export function clearNode(node: HTMLElement): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated use `node.remove()` instead
|
||||||
|
*/
|
||||||
export function removeNode(node: HTMLElement): void {
|
export function removeNode(node: HTMLElement): void {
|
||||||
if (node.parentNode) {
|
if (node.parentNode) {
|
||||||
node.parentNode.removeChild(node);
|
node.parentNode.removeChild(node);
|
||||||
@@ -1004,7 +1007,7 @@ export function prepend<T extends Node>(parent: HTMLElement, child: T): T {
|
|||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((.([\w\-]+))*)/;
|
const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
|
||||||
|
|
||||||
export enum Namespace {
|
export enum Namespace {
|
||||||
HTML = 'http://www.w3.org/1999/xhtml',
|
HTML = 'http://www.w3.org/1999/xhtml',
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { URI } from 'vs/base/common/uri';
|
|||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
import { renderCodicons, markdownEscapeEscapedCodicons } from 'vs/base/common/codicons';
|
import { renderCodicons, markdownEscapeEscapedCodicons } from 'vs/base/common/codicons';
|
||||||
import { resolvePath } from 'vs/base/common/resources';
|
import { resolvePath } from 'vs/base/common/resources';
|
||||||
|
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||||
|
|
||||||
export interface MarkedOptions extends marked.MarkedOptions {
|
export interface MarkedOptions extends marked.MarkedOptions {
|
||||||
baseUrl?: never;
|
baseUrl?: never;
|
||||||
@@ -185,25 +186,32 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
|
|||||||
|
|
||||||
const actionHandler = options.actionHandler;
|
const actionHandler = options.actionHandler;
|
||||||
if (actionHandler) {
|
if (actionHandler) {
|
||||||
actionHandler.disposeables.add(DOM.addStandardDisposableListener(element, 'click', event => {
|
[DOM.EventType.CLICK, DOM.EventType.AUXCLICK].forEach(event => {
|
||||||
let target: HTMLElement | null = event.target;
|
actionHandler.disposeables.add(DOM.addDisposableListener(element, event, (e: MouseEvent) => {
|
||||||
if (target.tagName !== 'A') {
|
const mouseEvent = new StandardMouseEvent(e);
|
||||||
target = target.parentElement;
|
if (!mouseEvent.leftButton && !mouseEvent.middleButton) {
|
||||||
if (!target || target.tagName !== 'A') {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
try {
|
let target: HTMLElement | null = mouseEvent.target;
|
||||||
const href = target.dataset['href'];
|
if (target.tagName !== 'A') {
|
||||||
if (href) {
|
target = target.parentElement;
|
||||||
actionHandler.callback(href, event);
|
if (!target || target.tagName !== 'A') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
try {
|
||||||
onUnexpectedError(err);
|
const href = target.dataset['href'];
|
||||||
} finally {
|
if (href) {
|
||||||
event.preventDefault();
|
actionHandler.callback(href, mouseEvent);
|
||||||
}
|
}
|
||||||
}));
|
} catch (err) {
|
||||||
|
onUnexpectedError(err);
|
||||||
|
} finally {
|
||||||
|
mouseEvent.preventDefault();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use our own sanitizer so that we can let through only spans.
|
// Use our own sanitizer so that we can let through only spans.
|
||||||
|
|||||||
@@ -285,6 +285,10 @@ export class ActionBar extends Disposable implements IActionRunner {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (this.focusedItem) {
|
||||||
|
// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128
|
||||||
|
this.focus(this.focusedItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getWidth(index: number): number {
|
getWidth(index: number): number {
|
||||||
|
|||||||
@@ -187,14 +187,14 @@ class Label {
|
|||||||
|
|
||||||
if (typeof label === 'string') {
|
if (typeof label === 'string') {
|
||||||
if (!this.singleLabel) {
|
if (!this.singleLabel) {
|
||||||
this.container.innerHTML = '';
|
this.container.innerText = '';
|
||||||
dom.removeClass(this.container, 'multiple');
|
dom.removeClass(this.container, 'multiple');
|
||||||
this.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));
|
this.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.singleLabel.textContent = label;
|
this.singleLabel.textContent = label;
|
||||||
} else {
|
} else {
|
||||||
this.container.innerHTML = '';
|
this.container.innerText = '';
|
||||||
dom.addClass(this.container, 'multiple');
|
dom.addClass(this.container, 'multiple');
|
||||||
this.singleLabel = undefined;
|
this.singleLabel = undefined;
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ class LabelWithHighlights {
|
|||||||
|
|
||||||
if (typeof label === 'string') {
|
if (typeof label === 'string') {
|
||||||
if (!this.singleLabel) {
|
if (!this.singleLabel) {
|
||||||
this.container.innerHTML = '';
|
this.container.innerText = '';
|
||||||
dom.removeClass(this.container, 'multiple');
|
dom.removeClass(this.container, 'multiple');
|
||||||
this.singleLabel = new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId })), this.supportCodicons);
|
this.singleLabel = new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId })), this.supportCodicons);
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ class LabelWithHighlights {
|
|||||||
this.singleLabel.set(label, options?.matches, options?.title, options?.labelEscapeNewLines);
|
this.singleLabel.set(label, options?.matches, options?.title, options?.labelEscapeNewLines);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.container.innerHTML = '';
|
this.container.innerText = '';
|
||||||
dom.addClass(this.container, 'multiple');
|
dom.addClass(this.container, 'multiple');
|
||||||
this.singleLabel = undefined;
|
this.singleLabel = undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export class InputBox extends Widget {
|
|||||||
this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY;
|
this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY;
|
||||||
|
|
||||||
this.mirror = dom.append(wrapper, $('div.mirror'));
|
this.mirror = dom.append(wrapper, $('div.mirror'));
|
||||||
this.mirror.innerHTML = ' ';
|
this.mirror.innerText = '\u00a0';
|
||||||
|
|
||||||
this.scrollableElement = new ScrollableElement(this.element, { vertical: ScrollbarVisibility.Auto });
|
this.scrollableElement = new ScrollableElement(this.element, { vertical: ScrollbarVisibility.Auto });
|
||||||
|
|
||||||
@@ -563,7 +563,7 @@ export class InputBox extends Widget {
|
|||||||
if (mirrorTextContent) {
|
if (mirrorTextContent) {
|
||||||
this.mirror.textContent = value + suffix;
|
this.mirror.textContent = value + suffix;
|
||||||
} else {
|
} else {
|
||||||
this.mirror.innerHTML = ' ';
|
this.mirror.innerText = '\u00a0';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.layout();
|
this.layout();
|
||||||
|
|||||||
@@ -602,6 +602,10 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
|
|||||||
return this.items[index].element;
|
return this.items[index].element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indexOf(element: T): number {
|
||||||
|
return this.items.findIndex(item => item.element === element);
|
||||||
|
}
|
||||||
|
|
||||||
domElement(index: number): HTMLElement | null {
|
domElement(index: number): HTMLElement | null {
|
||||||
const row = this.items[index].row;
|
const row = this.items[index].row;
|
||||||
return row && row.domNode;
|
return row && row.domNode;
|
||||||
|
|||||||
@@ -1323,6 +1323,10 @@ export class List<T> implements ISpliceable<T>, IThemable, IDisposable {
|
|||||||
return this.view.element(index);
|
return this.view.element(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indexOf(element: T): number {
|
||||||
|
return this.view.indexOf(element);
|
||||||
|
}
|
||||||
|
|
||||||
get length(): number {
|
get length(): number {
|
||||||
return this.view.length;
|
return this.view.length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,8 +324,7 @@ export class Menu extends ActionBar {
|
|||||||
if (action instanceof Separator) {
|
if (action instanceof Separator) {
|
||||||
return new MenuSeparatorActionViewItem(options.context, action, { icon: true });
|
return new MenuSeparatorActionViewItem(options.context, action, { icon: true });
|
||||||
} else if (action instanceof SubmenuAction) {
|
} else if (action instanceof SubmenuAction) {
|
||||||
const actions = Array.isArray(action.actions) ? action.actions : action.actions();
|
const menuActionViewItem = new SubmenuMenuActionViewItem(action, action.actions, parentData, { ...options, submenuIds: new Set([...(options.submenuIds || []), action.id]) });
|
||||||
const menuActionViewItem = new SubmenuMenuActionViewItem(action, actions, parentData, { ...options, submenuIds: new Set([...(options.submenuIds || []), action.id]) });
|
|
||||||
|
|
||||||
if (options.enableMnemonics) {
|
if (options.enableMnemonics) {
|
||||||
const mnemonic = menuActionViewItem.getMnemonic();
|
const mnemonic = menuActionViewItem.getMnemonic();
|
||||||
@@ -791,7 +790,12 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||||||
|
|
||||||
private cleanupExistingSubmenu(force: boolean): void {
|
private cleanupExistingSubmenu(force: boolean): void {
|
||||||
if (this.parentData.submenu && (force || (this.parentData.submenu !== this.mysubmenu))) {
|
if (this.parentData.submenu && (force || (this.parentData.submenu !== this.mysubmenu))) {
|
||||||
this.parentData.submenu.dispose();
|
|
||||||
|
// disposal may throw if the submenu has already been removed
|
||||||
|
try {
|
||||||
|
this.parentData.submenu.dispose();
|
||||||
|
} catch { }
|
||||||
|
|
||||||
this.parentData.submenu = undefined;
|
this.parentData.submenu = undefined;
|
||||||
this.updateAriaExpanded('false');
|
this.updateAriaExpanded('false');
|
||||||
if (this.submenuContainer) {
|
if (this.submenuContainer) {
|
||||||
@@ -835,7 +839,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||||||
|
|
||||||
if (!this.parentData.submenu) {
|
if (!this.parentData.submenu) {
|
||||||
this.updateAriaExpanded('true');
|
this.updateAriaExpanded('true');
|
||||||
this.submenuContainer = document.createElement('div.monaco-submenu');
|
this.submenuContainer = append(this.element, $('div.monaco-submenu'));
|
||||||
addClasses(this.submenuContainer, 'menubar-menu-items-holder', 'context-view');
|
addClasses(this.submenuContainer, 'menubar-menu-items-holder', 'context-view');
|
||||||
|
|
||||||
// Set the top value of the menu container before construction
|
// Set the top value of the menu container before construction
|
||||||
@@ -853,8 +857,6 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||||||
this.parentData.submenu.style(this.menuStyle);
|
this.parentData.submenu.style(this.menuStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.element.appendChild(this.submenuContainer);
|
|
||||||
|
|
||||||
// layout submenu
|
// layout submenu
|
||||||
const entryBox = this.element.getBoundingClientRect();
|
const entryBox = this.element.getBoundingClientRect();
|
||||||
const entryBoxUpdated = {
|
const entryBoxUpdated = {
|
||||||
|
|||||||
@@ -217,8 +217,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
|||||||
|
|
||||||
// Intercept keyboard handling
|
// Intercept keyboard handling
|
||||||
|
|
||||||
// React on KEY_UP since the actionBar also reacts on KEY_UP so that appropriate events get canceled
|
this._register(dom.addDisposableListener(this.selectElement, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||||
this._register(dom.addDisposableListener(this.selectElement, dom.EventType.KEY_UP, (e: KeyboardEvent) => {
|
|
||||||
const event = new StandardKeyboardEvent(e);
|
const event = new StandardKeyboardEvent(e);
|
||||||
let showDropDown = false;
|
let showDropDown = false;
|
||||||
|
|
||||||
@@ -235,7 +234,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
|||||||
|
|
||||||
if (showDropDown) {
|
if (showDropDown) {
|
||||||
this.showSelectDropDown();
|
this.showSelectDropDown();
|
||||||
dom.EventHelper.stop(e, true);
|
dom.EventHelper.stop(e);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export interface IToolBarOptions {
|
|||||||
actionRunner?: IActionRunner;
|
actionRunner?: IActionRunner;
|
||||||
toggleMenuTitle?: string;
|
toggleMenuTitle?: string;
|
||||||
anchorAlignmentProvider?: () => AnchorAlignment;
|
anchorAlignmentProvider?: () => AnchorAlignment;
|
||||||
|
renderDropdownAsChildElement?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,6 +40,7 @@ export class ToolBar extends Disposable {
|
|||||||
private submenuActionViewItems: DropdownMenuActionViewItem[] = [];
|
private submenuActionViewItems: DropdownMenuActionViewItem[] = [];
|
||||||
private hasSecondaryActions: boolean = false;
|
private hasSecondaryActions: boolean = false;
|
||||||
private lookupKeybindings: boolean;
|
private lookupKeybindings: boolean;
|
||||||
|
private element: HTMLElement;
|
||||||
|
|
||||||
private _onDidChangeDropdownVisibility = this._register(new EventMultiplexer<boolean>());
|
private _onDidChangeDropdownVisibility = this._register(new EventMultiplexer<boolean>());
|
||||||
readonly onDidChangeDropdownVisibility = this._onDidChangeDropdownVisibility.event;
|
readonly onDidChangeDropdownVisibility = this._onDidChangeDropdownVisibility.event;
|
||||||
@@ -52,11 +54,11 @@ export class ToolBar extends Disposable {
|
|||||||
|
|
||||||
this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options.toggleMenuTitle));
|
this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options.toggleMenuTitle));
|
||||||
|
|
||||||
let element = document.createElement('div');
|
this.element = document.createElement('div');
|
||||||
element.className = 'monaco-toolbar';
|
this.element.className = 'monaco-toolbar';
|
||||||
container.appendChild(element);
|
container.appendChild(this.element);
|
||||||
|
|
||||||
this.actionBar = this._register(new ActionBar(element, {
|
this.actionBar = this._register(new ActionBar(this.element, {
|
||||||
orientation: options.orientation,
|
orientation: options.orientation,
|
||||||
ariaLabel: options.ariaLabel,
|
ariaLabel: options.ariaLabel,
|
||||||
actionRunner: options.actionRunner,
|
actionRunner: options.actionRunner,
|
||||||
@@ -72,7 +74,7 @@ export class ToolBar extends Disposable {
|
|||||||
keybindingProvider: this.options.getKeyBinding,
|
keybindingProvider: this.options.getKeyBinding,
|
||||||
classNames: toolBarMoreIcon.classNames,
|
classNames: toolBarMoreIcon.classNames,
|
||||||
anchorAlignmentProvider: this.options.anchorAlignmentProvider,
|
anchorAlignmentProvider: this.options.anchorAlignmentProvider,
|
||||||
menuAsChild: true
|
menuAsChild: !!this.options.renderDropdownAsChildElement
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.toggleMenuActionViewItem.setActionContext(this.actionBar.context);
|
this.toggleMenuActionViewItem.setActionContext(this.actionBar.context);
|
||||||
@@ -90,10 +92,9 @@ export class ToolBar extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action instanceof SubmenuAction) {
|
if (action instanceof SubmenuAction) {
|
||||||
const actions = Array.isArray(action.actions) ? action.actions : action.actions();
|
|
||||||
const result = new DropdownMenuActionViewItem(
|
const result = new DropdownMenuActionViewItem(
|
||||||
action,
|
action,
|
||||||
actions,
|
action.actions,
|
||||||
contextMenuProvider,
|
contextMenuProvider,
|
||||||
{
|
{
|
||||||
actionViewItemProvider: this.options.actionViewItemProvider,
|
actionViewItemProvider: this.options.actionViewItemProvider,
|
||||||
@@ -134,8 +135,8 @@ export class ToolBar extends Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getContainer(): HTMLElement {
|
getElement(): HTMLElement {
|
||||||
return this.actionBar.getContainer();
|
return this.element;
|
||||||
}
|
}
|
||||||
|
|
||||||
getItemsWidth(): number {
|
getItemsWidth(): number {
|
||||||
|
|||||||
@@ -881,7 +881,7 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
|
|||||||
this.messageDomNode.textContent = localize('empty', "No elements found");
|
this.messageDomNode.textContent = localize('empty', "No elements found");
|
||||||
this._empty = true;
|
this._empty = true;
|
||||||
} else {
|
} else {
|
||||||
this.messageDomNode.innerHTML = '';
|
this.messageDomNode.innerText = '';
|
||||||
this._empty = false;
|
this._empty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,12 @@ export class Separator extends Action {
|
|||||||
export type SubmenuActions = IAction[] | (() => IAction[]);
|
export type SubmenuActions = IAction[] | (() => IAction[]);
|
||||||
|
|
||||||
export class SubmenuAction extends Action {
|
export class SubmenuAction extends Action {
|
||||||
constructor(id: string, label: string, readonly actions: SubmenuActions, cssClass?: string) {
|
|
||||||
|
get actions(): IAction[] {
|
||||||
|
return Array.isArray(this._actions) ? this._actions : this._actions();
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(id: string, label: string, private _actions: SubmenuActions, cssClass?: string) {
|
||||||
super(id, label, cssClass, true);
|
super(id, label, cssClass, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user