mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-07 08:06:35 +01:00
Merge remote-tracking branch 'origin/master' into tyriar/node-pty-up
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
# cleanup rules for native node modules, .gitignore style
|
||||
|
||||
fsevents/binding.gyp
|
||||
fsevents/fsevents.cc
|
||||
fsevents/build/**
|
||||
fsevents/src/**
|
||||
fsevents/test/**
|
||||
!fsevents/**/*.node
|
||||
|
||||
vscode-sqlite3/binding.gyp
|
||||
vscode-sqlite3/benchmark/**
|
||||
vscode-sqlite3/cloudformation/**
|
||||
vscode-sqlite3/deps/**
|
||||
vscode-sqlite3/test/**
|
||||
vscode-sqlite3/build/**
|
||||
vscode-sqlite3/src/**
|
||||
!vscode-sqlite3/build/Release/*.node
|
||||
|
||||
oniguruma/binding.gyp
|
||||
oniguruma/build/**
|
||||
oniguruma/src/**
|
||||
oniguruma/deps/**
|
||||
!oniguruma/build/Release/*.node
|
||||
!oniguruma/src/*.js
|
||||
|
||||
windows-mutex/binding.gyp
|
||||
windows-mutex/build/**
|
||||
windows-mutex/src/**
|
||||
!windows-mutex/**/*.node
|
||||
|
||||
native-keymap/binding.gyp
|
||||
native-keymap/build/**
|
||||
native-keymap/src/**
|
||||
native-keymap/deps/**
|
||||
!native-keymap/build/Release/*.node
|
||||
|
||||
native-is-elevated/binding.gyp
|
||||
native-is-elevated/build/**
|
||||
native-is-elevated/src/**
|
||||
native-is-elevated/deps/**
|
||||
!native-is-elevated/build/Release/*.node
|
||||
|
||||
native-watchdog/binding.gyp
|
||||
native-watchdog/build/**
|
||||
native-watchdog/src/**
|
||||
!native-watchdog/build/Release/*.node
|
||||
|
||||
spdlog/binding.gyp
|
||||
spdlog/build/**
|
||||
spdlog/deps/**
|
||||
spdlog/src/**
|
||||
spdlog/test/**
|
||||
!spdlog/build/Release/*.node
|
||||
|
||||
jschardet/dist/**
|
||||
|
||||
windows-foreground-love/binding.gyp
|
||||
windows-foreground-love/build/**
|
||||
windows-foreground-love/src/**
|
||||
!windows-foreground-love/**/*.node
|
||||
|
||||
windows-process-tree/binding.gyp
|
||||
windows-process-tree/build/**
|
||||
windows-process-tree/src/**
|
||||
!windows-process-tree/**/*.node
|
||||
|
||||
gc-signals/binding.gyp
|
||||
gc-signals/build/**
|
||||
gc-signals/src/**
|
||||
gc-signals/deps/**
|
||||
|
||||
!gc-signals/build/Release/*.node
|
||||
!gc-signals/src/index.js
|
||||
|
||||
keytar/binding.gyp
|
||||
keytar/build/**
|
||||
keytar/src/**
|
||||
keytar/script/**
|
||||
keytar/node_modules/**
|
||||
!keytar/**/*.node
|
||||
|
||||
node-pty/binding.gyp
|
||||
node-pty/build/**
|
||||
node-pty/src/**
|
||||
node-pty/tools/**
|
||||
!node-pty/build/Release/*.exe
|
||||
!node-pty/build/Release/*.dll
|
||||
!node-pty/build/Release/*.node
|
||||
|
||||
vscode-nsfw/binding.gyp
|
||||
vscode-nsfw/build/**
|
||||
vscode-nsfw/src/**
|
||||
vscode-nsfw/openpa/**
|
||||
vscode-nsfw/includes/**
|
||||
!vscode-nsfw/build/Release/*.node
|
||||
!vscode-nsfw/**/*.a
|
||||
|
||||
vsda/binding.gyp
|
||||
vsda/README.md
|
||||
vsda/build/**
|
||||
vsda/*.bat
|
||||
vsda/*.sh
|
||||
vsda/*.cpp
|
||||
vsda/*.h
|
||||
!vsda/build/Release/vsda.node
|
||||
|
||||
vscode-windows-ca-certs/**/*
|
||||
!vscode-windows-ca-certs/package.json
|
||||
!vscode-windows-ca-certs/**/*.node
|
||||
|
||||
node-addon-api/**/*
|
||||
@@ -7,15 +7,21 @@ steps:
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
password $(VSO_PAT)
|
||||
password $(devops-pat)
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(VSCODE_MIXIN_PASSWORD)
|
||||
password $(github-distro-mixin-password)
|
||||
EOF
|
||||
|
||||
git config user.email "vscode@microsoft.com"
|
||||
@@ -34,8 +40,8 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
./build/azure-pipelines/darwin/build.sh
|
||||
displayName: Build
|
||||
|
||||
@@ -77,11 +83,11 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
VSCODE_HOCKEYAPP_TOKEN="$(VSCODE_HOCKEYAPP_TOKEN)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||
./build/azure-pipelines/darwin/publish.sh
|
||||
displayName: Publish
|
||||
|
||||
|
||||
@@ -10,13 +10,19 @@ steps:
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(VSCODE_MIXIN_PASSWORD)
|
||||
password $(github-distro-mixin-password)
|
||||
EOF
|
||||
|
||||
git config user.email "vscode@microsoft.com"
|
||||
|
||||
@@ -7,6 +7,12 @@ steps:
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
export npm_config_arch="$(VSCODE_ARCH)"
|
||||
@@ -16,10 +22,10 @@ steps:
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
password $(VSO_PAT)
|
||||
password $(devops-pat)
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(VSCODE_MIXIN_PASSWORD)
|
||||
password $(github-distro-mixin-password)
|
||||
EOF
|
||||
|
||||
git config user.email "vscode@microsoft.com"
|
||||
@@ -38,7 +44,7 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
./build/azure-pipelines/linux/build.sh
|
||||
displayName: Build
|
||||
|
||||
@@ -55,10 +61,10 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
VSCODE_HOCKEYAPP_TOKEN="$(VSCODE_HOCKEYAPP_TOKEN)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
|
||||
./build/azure-pipelines/linux/publish.sh
|
||||
displayName: Publish
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@ steps:
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact'
|
||||
inputs:
|
||||
@@ -44,6 +50,6 @@ steps:
|
||||
(cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
|
||||
|
||||
# Publish snap package
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
||||
@@ -1,9 +1,11 @@
|
||||
resources:
|
||||
containers:
|
||||
- container: vscode-x64
|
||||
image: joaomoreno/vscode-linux-build-agent:x64
|
||||
endpoint: VSCodeHub
|
||||
image: vscodehub.azurecr.io/vscode-linux-build-agent:x64
|
||||
- container: vscode-ia32
|
||||
image: joaomoreno/vscode-linux-build-agent:ia32
|
||||
endpoint: VSCodeHub
|
||||
image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32
|
||||
- container: snapcraft
|
||||
image: snapcore/snapcraft
|
||||
|
||||
|
||||
@@ -7,12 +7,18 @@ steps:
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
(cd build ; yarn)
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
|
||||
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"
|
||||
|
||||
@@ -12,10 +12,16 @@ steps:
|
||||
versionSpec: '2.x'
|
||||
addToPath: true
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: 'Azure Key Vault: Get Secrets'
|
||||
inputs:
|
||||
azureSubscription: 'vscode-builds-subscription'
|
||||
KeyVaultName: vscode
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
"machine monacotools.visualstudio.com`npassword $(VSO_PAT)`nmachine github.com`nlogin vscode`npassword $(VSCODE_MIXIN_PASSWORD)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||
"machine monacotools.visualstudio.com`npassword $(devops-pat)`nmachine github.com`nlogin vscode`npassword $(github-distro-mixin-password)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||
$env:CHILD_CONCURRENCY="1"
|
||||
|
||||
@@ -36,7 +42,7 @@ steps:
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
|
||||
.\build\azure-pipelines\win32\build.ps1
|
||||
displayName: Build
|
||||
|
||||
@@ -126,15 +132,15 @@ steps:
|
||||
|
||||
- powershell: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
|
||||
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(esrp-auth-certificate) -AuthCertificateKey $(esrp-auth-certificate-key)
|
||||
displayName: Import ESRP Auth Certificate
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
||||
$env:VSCODE_HOCKEYAPP_TOKEN = "$(VSCODE_HOCKEYAPP_TOKEN)"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$env:VSCODE_HOCKEYAPP_TOKEN = "$(vscode-hockeyapp-token)"
|
||||
.\build\azure-pipelines\win32\publish.ps1
|
||||
displayName: Publish
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"name": "ms-vscode.references-view",
|
||||
"version": "0.0.26",
|
||||
"version": "0.0.27",
|
||||
"repo": "https://github.com/Microsoft/vscode-reference-view",
|
||||
"metadata": {
|
||||
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",
|
||||
|
||||
@@ -323,28 +323,11 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
|
||||
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', '!**/package-lock.json']))
|
||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('vscode-sqlite3', ['binding.gyp', 'benchmark/**', 'cloudformation/**', 'deps/**', 'test/**', 'build/**', 'src/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/*.js']))
|
||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
|
||||
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/index.js']))
|
||||
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['build/Release/*.node', '**/*.a']))
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
||||
.pipe(util.cleanNodeModule('vscode-windows-ca-certs', ['**/*'], ['package.json', '**/*.node']))
|
||||
.pipe(util.cleanNodeModule('node-addon-api', ['**/*']))
|
||||
.pipe(util.cleanNodeModules(path.join(__dirname, '.nativeignore')))
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
packageJsonStream,
|
||||
productJsonStream,
|
||||
license,
|
||||
api,
|
||||
|
||||
+9
-14
@@ -8,7 +8,6 @@ const es = require("event-stream");
|
||||
const debounce = require("debounce");
|
||||
const _filter = require("gulp-filter");
|
||||
const rename = require("gulp-rename");
|
||||
const _ = require("underscore");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const _rimraf = require("rimraf");
|
||||
@@ -100,22 +99,18 @@ function skipDirectories() {
|
||||
});
|
||||
}
|
||||
exports.skipDirectories = skipDirectories;
|
||||
function cleanNodeModule(name, excludes, includes) {
|
||||
const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : '');
|
||||
const negate = (str) => '!' + str;
|
||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob)));
|
||||
function cleanNodeModules(rulePath) {
|
||||
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||
.split(/\r?\n/g)
|
||||
.map(line => line.trim())
|
||||
.filter(line => line && !/^#/.test(line));
|
||||
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||
const input = es.through();
|
||||
const nodeModuleInput = input.pipe(allFilter);
|
||||
let output = nodeModuleInput.pipe(_filter(globs));
|
||||
if (includes) {
|
||||
const includeGlobs = includes.map(toGlob);
|
||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
||||
}
|
||||
output = output.pipe(allFilter.restore);
|
||||
const output = es.merge(input.pipe(_filter(['**', ...excludes])), input.pipe(_filter(includes)));
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
exports.cleanNodeModule = cleanNodeModule;
|
||||
exports.cleanNodeModules = cleanNodeModules;
|
||||
function loadSourcemaps() {
|
||||
const input = es.through();
|
||||
const output = input
|
||||
|
||||
+11
-13
@@ -132,23 +132,21 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
|
||||
});
|
||||
}
|
||||
|
||||
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
|
||||
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
|
||||
const negate = (str: string) => '!' + str;
|
||||
export function cleanNodeModules(rulePath: string): NodeJS.ReadWriteStream {
|
||||
const rules = fs.readFileSync(rulePath, 'utf8')
|
||||
.split(/\r?\n/g)
|
||||
.map(line => line.trim())
|
||||
.filter(line => line && !/^#/.test(line));
|
||||
|
||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob) as (x: string) => string));
|
||||
const excludes = rules.filter(line => !/^!/.test(line)).map(line => `!**/node_modules/${line}`);
|
||||
const includes = rules.filter(line => /^!/.test(line)).map(line => `**/node_modules/${line.substr(1)}`);
|
||||
|
||||
const input = es.through();
|
||||
const nodeModuleInput = input.pipe(allFilter);
|
||||
let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs));
|
||||
const output = es.merge(
|
||||
input.pipe(_filter(['**', ...excludes])),
|
||||
input.pipe(_filter(includes))
|
||||
);
|
||||
|
||||
if (includes) {
|
||||
const includeGlobs = includes.map(toGlob);
|
||||
output = es.merge(output, nodeModuleInput.pipe(_filter(includeGlobs)));
|
||||
}
|
||||
|
||||
output = output.pipe(allFilter.restore);
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
"git": {
|
||||
"name": "atom/language-clojure",
|
||||
"repositoryUrl": "https://github.com/atom/language-clojure",
|
||||
"commitHash": "ecc790326bc8e14220e4d2d72a392a30876c3219"
|
||||
"commitHash": "de877502aa4a77ccdc2c7f0c9180436aea3effff"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.22.6",
|
||||
"version": "0.22.7",
|
||||
"description": "The file syntaxes/clojure.tmLanguage.json was derived from the Atom package https://github.com/atom/language-clojure which was originally converted from the TextMate bundle https://github.com/mmcgrana/textmate-clojure."
|
||||
}
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/atom/language-clojure/commit/ecc790326bc8e14220e4d2d72a392a30876c3219",
|
||||
"version": "https://github.com/atom/language-clojure/commit/de877502aa4a77ccdc2c7f0c9180436aea3effff",
|
||||
"name": "Clojure",
|
||||
"scopeName": "source.clojure",
|
||||
"patterns": [
|
||||
@@ -83,7 +83,7 @@
|
||||
"name": "constant.numeric.ratio.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+[rR][0-9a-zA-Z]+)",
|
||||
"match": "(-?\\d+[rR]\\w+)",
|
||||
"name": "constant.numeric.arbitrary-radix.clojure"
|
||||
},
|
||||
{
|
||||
@@ -116,17 +116,17 @@
|
||||
]
|
||||
},
|
||||
"keyword": {
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)):[a-zA-Z0-9\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
|
||||
"name": "constant.keyword.clojure"
|
||||
},
|
||||
"keyfn": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(if(-[-a-z\\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\\?]*)?|binding|loop|recur|fn|throw[a-z\\-]*|try|catch|finally|([a-z]*case))(?=(\\s|\\)|\\]|\\}))",
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(if(-[-\\p{Ll}\\?]*)?|when(-[-\\p{Ll}]*)?|for(-[-\\p{Ll}]*)?|cond|do|let(-[-\\p{Ll}\\?]*)?|binding|loop|recur|fn|throw[\\p{Ll}\\-]*|try|catch|finally|([\\p{Ll}]*case))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "storage.control.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\\-]*))(?=(\\s|\\)|\\]|\\}))",
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "keyword.control.clojure"
|
||||
}
|
||||
]
|
||||
@@ -309,7 +309,7 @@
|
||||
"include": "#dynamic-variables"
|
||||
},
|
||||
{
|
||||
"match": "([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "entity.global.clojure"
|
||||
},
|
||||
{
|
||||
@@ -387,7 +387,7 @@
|
||||
"namespace-symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "meta.symbol.namespace.clojure"
|
||||
@@ -399,13 +399,13 @@
|
||||
"symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "([a-zA-Z\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "meta.symbol.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"var": {
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)\\#)'[a-zA-Z0-9\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "meta.var.clojure"
|
||||
},
|
||||
"vector": {
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
"git": {
|
||||
"name": "jeff-hykin/cpp-textmate-grammar",
|
||||
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
|
||||
"commitHash": "3fa2a8862b6a06ca381f8e46eb782e5dd014d426"
|
||||
"commitHash": "dc404ccf4eb08a5f76434e759b519f59051a32e5"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "1.8.8",
|
||||
"version": "1.8.13",
|
||||
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
|
||||
},
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/98cbae6aca391825a7612825f9677f22fe70dd68",
|
||||
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/48734a7a8b365c12aeb7551aed0090b49601ed70",
|
||||
"name": "C",
|
||||
"scopeName": "source.c",
|
||||
"patterns": [
|
||||
@@ -570,13 +570,13 @@
|
||||
}
|
||||
},
|
||||
"match": "^// =(\\s*.*?)\\s*=\\s*$\\n?",
|
||||
"name": "comment.line.banner.cpp.c"
|
||||
"name": "comment.line.banner.c"
|
||||
},
|
||||
{
|
||||
"begin": "(^[ \\t]+)?(?=//)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.whitespace.comment.leading.cpp.c"
|
||||
"name": "punctuation.whitespace.comment.leading.c"
|
||||
}
|
||||
},
|
||||
"end": "(?!\\G)",
|
||||
@@ -585,11 +585,11 @@
|
||||
"begin": "//",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.cpp.c"
|
||||
"name": "punctuation.definition.comment.c"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\n)",
|
||||
"name": "comment.line.double-slash.cpp.c",
|
||||
"name": "comment.line.double-slash.c",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#line_continuation_character"
|
||||
@@ -624,14 +624,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"numbers": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\b((0(x|X)[0-9a-fA-F]([0-9a-fA-F']*[0-9a-fA-F])?)|(0(b|B)[01]([01']*[01])?)|(([0-9]([0-9']*[0-9])?\\.?[0-9]*([0-9']*[0-9])?)|(\\.[0-9]([0-9']*[0-9])?))((e|E)(\\+|-)?[0-9]([0-9']*[0-9])?)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b",
|
||||
"name": "constant.numeric.c"
|
||||
}
|
||||
]
|
||||
},
|
||||
"parens": {
|
||||
"name": "meta.parens.c",
|
||||
"begin": "\\(",
|
||||
@@ -672,7 +664,7 @@
|
||||
},
|
||||
{
|
||||
"match": "(?-mix:(?<!:):(?!:))",
|
||||
"name": "punctuation.range-based.cpp.c"
|
||||
"name": "punctuation.range-based.c"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2086,13 +2078,13 @@
|
||||
"begin": "((?<!\\w)default(?!\\w))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.default.cpp.c"
|
||||
"name": "keyword.control.default.c"
|
||||
}
|
||||
},
|
||||
"end": "(:)",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "colon.cpp.c punctuation.separator.case.default.cpp.c"
|
||||
"name": "colon.c punctuation.separator.case.default.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
@@ -2106,13 +2098,13 @@
|
||||
"begin": "((?<!\\w)case(?!\\w))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.case.cpp.c"
|
||||
"name": "keyword.control.case.c"
|
||||
}
|
||||
},
|
||||
"end": "(:)",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "colon.cpp.c punctuation.separator.case.cpp.c"
|
||||
"name": "colon.c punctuation.separator.case.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
@@ -2126,24 +2118,21 @@
|
||||
"begin": "(((?<!\\w)switch(?!\\w)))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.head.switch.cpp.c"
|
||||
"name": "meta.head.switch.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "keyword.control.switch.cpp.c"
|
||||
"name": "keyword.control.switch.c"
|
||||
}
|
||||
},
|
||||
"end": "(?:(?<=\\})|(?=[;>\\[\\]=]))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#switch_conditional_parentheses"
|
||||
},
|
||||
{
|
||||
"name": "meta.head.switch.cpp.c",
|
||||
"begin": "\\G| ",
|
||||
"name": "meta.head.switch.c",
|
||||
"begin": "\\G ?",
|
||||
"end": "((?:\\{|(?=;)))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.block.begin.bracket.curly.switch.cpp.c"
|
||||
"name": "punctuation.section.block.begin.bracket.curly.switch.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
@@ -2156,12 +2145,12 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.body.switch.cpp.c",
|
||||
"name": "meta.body.switch.c",
|
||||
"begin": "(?<=\\{)",
|
||||
"end": "(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.block.end.bracket.curly.switch.cpp.c"
|
||||
"name": "punctuation.section.block.end.bracket.curly.switch.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
@@ -2177,7 +2166,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "meta.tail.switch.cpp.c",
|
||||
"name": "meta.tail.switch.c",
|
||||
"begin": "(?<=})[\\s\\n]*",
|
||||
"end": "[\\s\\n]*(?=;)",
|
||||
"patterns": [
|
||||
@@ -2193,13 +2182,13 @@
|
||||
"begin": "(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.cpp.c"
|
||||
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c"
|
||||
}
|
||||
},
|
||||
"end": "(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.parens.end.bracket.round.conditional.switch.cpp.c"
|
||||
"name": "punctuation.section.parens.end.bracket.round.conditional.switch.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
@@ -2208,6 +2197,46 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"static_assert": {
|
||||
"begin": "(static_assert|_Static_assert)\\s*(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.other.static_assert.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.arguments.begin.bracket.round.c"
|
||||
}
|
||||
},
|
||||
"end": "(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.arguments.end.bracket.round.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"name": "meta.static_assert.message.c",
|
||||
"begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "comma.c punctuation.separator.delimiter.c"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\))",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#string_context"
|
||||
},
|
||||
{
|
||||
"include": "#string_context_c"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#function_call_context_c"
|
||||
}
|
||||
]
|
||||
},
|
||||
"conditional_context": {
|
||||
"patterns": [
|
||||
{
|
||||
@@ -2311,6 +2340,250 @@
|
||||
"include": "#function-call-innards"
|
||||
}
|
||||
]
|
||||
},
|
||||
"numbers": {
|
||||
"begin": "(?<!\\w)(?=\\d|\\.\\d)",
|
||||
"end": "(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(\\G0[xX])(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.unit.hexadecimal.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.numeric.hexadecimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"4": {
|
||||
"name": "constant.numeric.hexadecimal.c"
|
||||
},
|
||||
"5": {
|
||||
"name": "constant.numeric.hexadecimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"8": {
|
||||
"name": "keyword.other.unit.exponent.hexadecimal.c"
|
||||
},
|
||||
"9": {
|
||||
"name": "keyword.operator.plus.exponent.hexadecimal.c"
|
||||
},
|
||||
"10": {
|
||||
"name": "keyword.operator.minus.exponent.hexadecimal.c"
|
||||
},
|
||||
"11": {
|
||||
"name": "constant.numeric.exponent.hexadecimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"name": "keyword.other.unit.suffix.floating-point.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(\\G(?=[0-9.])(?!0[xXbB]))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9])\\.|\\.(?=[0-9])))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"2": {
|
||||
"name": "constant.numeric.decimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"4": {
|
||||
"name": "constant.numeric.decimal.point.c"
|
||||
},
|
||||
"5": {
|
||||
"name": "constant.numeric.decimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"8": {
|
||||
"name": "keyword.other.unit.exponent.decimal.c"
|
||||
},
|
||||
"9": {
|
||||
"name": "keyword.operator.plus.exponent.decimal.c"
|
||||
},
|
||||
"10": {
|
||||
"name": "keyword.operator.minus.exponent.decimal.c"
|
||||
},
|
||||
"11": {
|
||||
"name": "constant.numeric.exponent.decimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"name": "keyword.other.unit.suffix.floating-point.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(\\G0[bB])([01](?:(?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.unit.binary.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.numeric.binary.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"4": {
|
||||
"name": "keyword.other.unit.suffix.integer.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(\\G0)((?:(?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))+)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.unit.octal.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.numeric.octal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"4": {
|
||||
"name": "keyword.other.unit.suffix.integer.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(\\G0[xX])([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.other.unit.hexadecimal.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "constant.numeric.hexadecimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.other.unit.exponent.hexadecimal.c"
|
||||
},
|
||||
"6": {
|
||||
"name": "keyword.operator.plus.exponent.hexadecimal.c"
|
||||
},
|
||||
"7": {
|
||||
"name": "keyword.operator.minus.exponent.hexadecimal.c"
|
||||
},
|
||||
"8": {
|
||||
"name": "constant.numeric.exponent.hexadecimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"name": "keyword.other.unit.suffix.integer.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
|
||||
"captures": {
|
||||
"2": {
|
||||
"name": "constant.numeric.decimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
},
|
||||
"5": {
|
||||
"name": "keyword.other.unit.exponent.decimal.c"
|
||||
},
|
||||
"6": {
|
||||
"name": "keyword.operator.plus.exponent.decimal.c"
|
||||
},
|
||||
"7": {
|
||||
"name": "keyword.operator.minus.exponent.decimal.c"
|
||||
},
|
||||
"8": {
|
||||
"name": "constant.numeric.exponent.decimal.c",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
|
||||
"name": "punctuation.separator.constant.numeric"
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"name": "keyword.other.unit.suffix.integer.c"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "(?:(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))+",
|
||||
"name": "invalid.illegal.constant.numeric"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -848,7 +848,7 @@
|
||||
},
|
||||
{
|
||||
"c": "4",
|
||||
"t": "source.c meta.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -980,7 +980,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1178,7 +1178,7 @@
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1387,7 +1387,7 @@
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1717,7 +1717,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1860,7 +1860,7 @@
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -2223,7 +2223,7 @@
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -2388,7 +2388,7 @@
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -2762,7 +2762,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.c meta.block.c constant.numeric.c",
|
||||
"t": "source.c meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
|
||||
@@ -286,8 +286,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "public:",
|
||||
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public:.cpp",
|
||||
"c": "public",
|
||||
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
"dark_vs": "storage.type: #569CD6",
|
||||
"light_vs": "storage.type: #0000FF",
|
||||
"hc_black": "storage.type: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ":",
|
||||
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp colon.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "ionide/ionide-fsgrammar",
|
||||
"repositoryUrl": "https://github.com/ionide/ionide-fsgrammar",
|
||||
"commitHash": "be0bdfd1e272b6633f5edf1429052fe9fa4df7c1"
|
||||
"commitHash": "b2100c95d7857c5421d111a860fcdd20954a0263"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/ionide/ionide-fsgrammar/commit/be0bdfd1e272b6633f5edf1429052fe9fa4df7c1",
|
||||
"version": "https://github.com/ionide/ionide-fsgrammar/commit/b2100c95d7857c5421d111a860fcdd20954a0263",
|
||||
"name": "fsharp",
|
||||
"scopeName": "source.fsharp",
|
||||
"patterns": [
|
||||
@@ -285,6 +285,33 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(\\()",
|
||||
"end": "(\\))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.symbol.fsharp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.symbol.fsharp"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(([?[:alpha:]0-9'`^._ ]+))+",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.type.fsharp"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": "#tuple_signature"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "(?!when|and|or\\b)\\b([\\w0-9'`^._]+)",
|
||||
"comments": "Here we need the \\w modifier in order to check that the words isn't blacklisted",
|
||||
@@ -571,7 +598,7 @@
|
||||
"include": "#common_declaration"
|
||||
},
|
||||
{
|
||||
"match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)(\\s*([[:alpha:]0-9'`^._ ]+)){0,1}",
|
||||
"match": "(\\?{0,1})([[:alpha:]0-9'`^._ ]+)\\s*(:)((?!with\\b)\\b([\\w0-9'`^._ ]+)){0,1}",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.symbol.fsharp"
|
||||
@@ -772,9 +799,9 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"begin": "(<(?![[:space:]]*\\)))",
|
||||
"begin": "(<+(?![[:space:]]*\\)))",
|
||||
"beginComment": "The group (?![[:space:]]*\\) is for protection against overload operator. static member (<)",
|
||||
"end": "((?<!:)>)",
|
||||
"end": "((?<!:)>|\\))",
|
||||
"endComment": "The group (?<!:) prevent us from stopping on :> when using SRTP synthax",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -814,6 +841,14 @@
|
||||
{
|
||||
"include": "#definition"
|
||||
},
|
||||
{
|
||||
"match": "(?<=>)\\s*(``([[:alpha:]0-9'^._ ]+)``|[[:alpha:]0-9'`^._]+)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.type.fsharp"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
@@ -826,7 +861,7 @@
|
||||
"patterns": [
|
||||
{
|
||||
"name": "binding.fsharp",
|
||||
"begin": "\\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?",
|
||||
"begin": "\\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
|
||||
"end": "\\s*(with\\b|=|\\n+=|(?<=\\=))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
@@ -856,6 +891,26 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "binding.fsharp",
|
||||
"begin": "\\b((get|set)\\s*(?=\\())(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
|
||||
"end": "\\s*(=|\\n+=|(?<=\\=))",
|
||||
"beginCaptures": {
|
||||
"3": {
|
||||
"name": "variable.fsharp"
|
||||
}
|
||||
},
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.fsharp"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#common_binding_definition"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "binding.fsharp",
|
||||
"begin": "\\b(static val mutable|val mutable|val)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9,\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\\._`\\s]+|(?<=,)\\s)*)?",
|
||||
@@ -920,7 +975,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``",
|
||||
"match": "(``([[:alpha:]0-9'^._ ]+)``|[[:alpha:]0-9'`^._]+)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.type.fsharp"
|
||||
@@ -1142,7 +1197,7 @@
|
||||
"match": "\\(\\)"
|
||||
},
|
||||
{
|
||||
"match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|[[:alpha:]0-9'`<>^._ ]\\w*)",
|
||||
"match": "(\\?{0,1})(``[[:alpha:]0-9'`^:,._ ]+``|(?!private\\b)\\b[\\w[:alpha:]0-9'`<>^._ ]+)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.symbol.fsharp"
|
||||
|
||||
@@ -604,28 +604,6 @@
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " get",
|
||||
"t": "source.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "()",
|
||||
"t": "source.fsharp constant.language.unit.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "constant.language: #569CD6",
|
||||
"light_plus": "constant.language: #0000FF",
|
||||
"dark_vs": "constant.language: #569CD6",
|
||||
"light_vs": "constant.language: #0000FF",
|
||||
"hc_black": "constant.language: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.fsharp",
|
||||
@@ -637,9 +615,42 @@
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "get",
|
||||
"t": "source.fsharp binding.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "()",
|
||||
"t": "source.fsharp binding.fsharp constant.language.unit.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "constant.language: #569CD6",
|
||||
"light_plus": "constant.language: #0000FF",
|
||||
"dark_vs": "constant.language: #569CD6",
|
||||
"light_vs": "constant.language: #0000FF",
|
||||
"hc_black": "constant.language: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.fsharp binding.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "=",
|
||||
"t": "source.fsharp keyword.symbol.fsharp",
|
||||
"t": "source.fsharp binding.fsharp keyword.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
@@ -681,50 +692,6 @@
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " set",
|
||||
"t": "source.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.fsharp keyword.symbol.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
"dark_vs": "keyword: #569CD6",
|
||||
"light_vs": "keyword: #0000FF",
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "value",
|
||||
"t": "source.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.fsharp keyword.symbol.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
"dark_vs": "keyword: #569CD6",
|
||||
"light_vs": "keyword: #0000FF",
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.fsharp",
|
||||
@@ -736,9 +703,64 @@
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "set",
|
||||
"t": "source.fsharp binding.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.fsharp binding.fsharp keyword.symbol.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
"dark_vs": "keyword: #569CD6",
|
||||
"light_vs": "keyword: #0000FF",
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "value",
|
||||
"t": "source.fsharp binding.fsharp variable.parameter.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.fsharp binding.fsharp keyword.symbol.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
"dark_vs": "keyword: #569CD6",
|
||||
"light_vs": "keyword: #0000FF",
|
||||
"hc_black": "keyword: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.fsharp binding.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "=",
|
||||
"t": "source.fsharp keyword.symbol.fsharp",
|
||||
"t": "source.fsharp binding.fsharp keyword.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
@@ -979,7 +1001,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " targetAge",
|
||||
"c": " targetAge ",
|
||||
"t": "source.fsharp binding.fsharp variable.parameter.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
@@ -989,17 +1011,6 @@
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.fsharp binding.fsharp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "=",
|
||||
"t": "source.fsharp binding.fsharp keyword.fsharp",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "daaain/Handlebars",
|
||||
"repositoryUrl": "https://github.com/daaain/Handlebars",
|
||||
"commitHash": "790f2b0222098a3a236bd9e91bb9a039eeca4d8e"
|
||||
"commitHash": "85a153a6f759df4e8da7533e1b3651f007867c51"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
@@ -29,7 +29,7 @@
|
||||
"THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
||||
],
|
||||
"license": "MIT",
|
||||
"version": "1.7.1"
|
||||
"version": "1.8.0"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/daaain/Handlebars/commit/790f2b0222098a3a236bd9e91bb9a039eeca4d8e",
|
||||
"version": "https://github.com/daaain/Handlebars/commit/85a153a6f759df4e8da7533e1b3651f007867c51",
|
||||
"name": "Handlebars",
|
||||
"scopeName": "text.html.handlebars",
|
||||
"patterns": [
|
||||
@@ -653,7 +653,7 @@
|
||||
]
|
||||
},
|
||||
"else_token": {
|
||||
"begin": "(\\{\\{)(~?else)(@?\\s(if)\\s([-a-zA-Z0-9_\\./]+))?",
|
||||
"begin": "(\\{\\{)(~?else)(@?\\s(if)\\s([-a-zA-Z0-9_\\.\\(\\s\\)/]+))?",
|
||||
"end": "(~?\\}\\}\\}*)",
|
||||
"name": "meta.function.inline.else.handlebars",
|
||||
"beginCaptures": {
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
"git": {
|
||||
"name": "atom/language-java",
|
||||
"repositoryUrl": "https://github.com/atom/language-java",
|
||||
"commitHash": "a91b17906a2142bc61c06c6f214f135a2e3cdc96"
|
||||
"commitHash": "9fc8f699e55284c0a8ddf03d929504064eb4f757"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.31.1"
|
||||
"version": "0.31.2"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/atom/language-java/commit/a91b17906a2142bc61c06c6f214f135a2e3cdc96",
|
||||
"version": "https://github.com/atom/language-java/commit/9fc8f699e55284c0a8ddf03d929504064eb4f757",
|
||||
"name": "Java",
|
||||
"scopeName": "source.java",
|
||||
"patterns": [
|
||||
@@ -1576,7 +1576,7 @@
|
||||
]
|
||||
},
|
||||
"variables": {
|
||||
"begin": "(?x)\n(?=\n (\n \\b(void|boolean|byte|char|short|int|float|long|double)\\b\n |\n (?>(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n (\n <[\\w<>,\\.?\\s\\[\\]]*> # e.g. `HashMap<Integer, String>`, or `List<java.lang.String>`\n )?\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|:|;)\n)",
|
||||
"begin": "(?x)\n(?=\n (\n \\b(void|boolean|byte|char|short|int|float|long|double)\\b\n |\n (?>(\\w+\\.)*[A-Z]+\\w*) # e.g. `javax.ws.rs.Response`, or `String`\n )\n \\s*\n (\n <[\\w<>,\\.?\\s\\[\\]]*> # e.g. `HashMap<Integer, String>`, or `List<java.lang.String>`\n )?\n \\s*\n (\n (\\[\\])* # int[][]\n )?\n \\s+\n [A-Za-z_$][\\w$]* # At least one identifier after space\n ([\\w\\[\\],$][\\w\\[\\],\\s]*)? # possibly primitive array or additional identifiers\n \\s*(=|:|;)\n)",
|
||||
"end": "(?=\\=|:|;)",
|
||||
"name": "meta.definition.variable.java",
|
||||
"patterns": [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"c": "//",
|
||||
"t": "source.objc comment.line.double-slash.cpp.c punctuation.definition.comment.cpp.c",
|
||||
"t": "source.objc comment.line.double-slash.c punctuation.definition.comment.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"c": "//",
|
||||
"t": "source.objc comment.line.double-slash.cpp.c punctuation.definition.comment.cpp.c",
|
||||
"t": "source.objc comment.line.double-slash.c punctuation.definition.comment.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
{
|
||||
"c": " Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"t": "source.objc comment.line.double-slash.cpp.c",
|
||||
"t": "source.objc comment.line.double-slash.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
{
|
||||
"c": "//",
|
||||
"t": "source.objc comment.line.double-slash.cpp.c punctuation.definition.comment.cpp.c",
|
||||
"t": "source.objc comment.line.double-slash.c punctuation.definition.comment.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
@@ -749,7 +749,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c constant.numeric.c",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1727,8 +1727,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "0xFEF1F0F",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.c",
|
||||
"c": "0x",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.hexadecimal.c",
|
||||
"r": {
|
||||
"dark_plus": "keyword.other.unit: #B5CEA8",
|
||||
"light_plus": "keyword.other.unit: #09885A",
|
||||
"dark_vs": "keyword.other.unit: #B5CEA8",
|
||||
"light_vs": "keyword.other.unit: #09885A",
|
||||
"hc_black": "keyword.other.unit: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "FEF1F0F",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.hexadecimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1804,8 +1815,30 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "3.14",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.c",
|
||||
"c": "3",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "14",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1859,8 +1892,52 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "3.14e0",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.c",
|
||||
"c": "3",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "14",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "e",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.exponent.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "keyword.other.unit: #B5CEA8",
|
||||
"light_plus": "keyword.other.unit: #09885A",
|
||||
"dark_vs": "keyword.other.unit: #B5CEA8",
|
||||
"light_vs": "keyword.other.unit: #09885A",
|
||||
"hc_black": "keyword.other.unit: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.exponent.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1914,8 +1991,63 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "31.4e-2",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.c",
|
||||
"c": "31",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "4",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
"dark_vs": "constant.numeric: #B5CEA8",
|
||||
"light_vs": "constant.numeric: #09885A",
|
||||
"hc_black": "constant.numeric: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "e",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.exponent.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "keyword.other.unit: #B5CEA8",
|
||||
"light_plus": "keyword.other.unit: #09885A",
|
||||
"dark_vs": "keyword.other.unit: #B5CEA8",
|
||||
"light_vs": "keyword.other.unit: #09885A",
|
||||
"hc_black": "keyword.other.unit: #B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "-",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.minus.exponent.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "keyword.operator: #D4D4D4",
|
||||
"light_plus": "keyword.operator: #000000",
|
||||
"dark_vs": "keyword.operator: #D4D4D4",
|
||||
"light_vs": "keyword.operator: #000000",
|
||||
"hc_black": "keyword.operator: #D4D4D4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "2",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.exponent.decimal.c",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -2245,7 +2377,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.whitespace.comment.leading.cpp.c",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.whitespace.comment.leading.c",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -2256,7 +2388,7 @@
|
||||
},
|
||||
{
|
||||
"c": "//",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.cpp.c punctuation.definition.comment.cpp.c",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.c punctuation.definition.comment.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
@@ -2267,7 +2399,7 @@
|
||||
},
|
||||
{
|
||||
"c": " add a tap gesture recognizer",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.cpp.c",
|
||||
"t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.c",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
"version": "0.0.1",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "3.4.5"
|
||||
"typescript": "3.5.0-dev.20190515"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"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."
|
||||
],
|
||||
"version": "https://github.com/PowerShell/EditorSyntax/commit/12b7d7257eb493e45a9af0af9094ec0c2a996712",
|
||||
"version": "https://github.com/PowerShell/EditorSyntax/commit/44eac8702f3cbe55a4ec70c1fdb163d42b4162fc",
|
||||
"name": "PowerShell",
|
||||
"scopeName": "source.powershell",
|
||||
"patterns": [
|
||||
@@ -274,7 +274,7 @@
|
||||
]
|
||||
},
|
||||
"attribute": {
|
||||
"begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength)\\b",
|
||||
"begin": "(\\[)\\s*\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\\b",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.bracket.begin.powershell"
|
||||
@@ -305,33 +305,6 @@
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#variableNoProperty"
|
||||
},
|
||||
{
|
||||
"include": "#hashtable"
|
||||
},
|
||||
{
|
||||
"include": "#scriptblock"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedStringEscapes"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedString"
|
||||
},
|
||||
{
|
||||
"include": "#type"
|
||||
},
|
||||
{
|
||||
"include": "#numericConstant"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedString"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
},
|
||||
@@ -345,27 +318,6 @@
|
||||
"name": "keyword.operator.assignment.powershell"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"begin": "(?<!')'",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.powershell"
|
||||
}
|
||||
},
|
||||
"end": "'(?!')",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.powershell"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.single.powershell",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "''",
|
||||
"name": "constant.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -434,15 +386,31 @@
|
||||
"doubleQuotedStringEscapes": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "`[0abnfrvt\"'$`]",
|
||||
"match": "`[`0abefnrtv\"'$]",
|
||||
"name": "constant.character.escape.powershell"
|
||||
},
|
||||
{
|
||||
"include": "#unicodeEscape"
|
||||
},
|
||||
{
|
||||
"match": "\"\"",
|
||||
"name": "constant.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
"unicodeEscape": {
|
||||
"comment": "`u{xxxx} added in PowerShell 6.0",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "`u\\{(?:(?:10)?([0-9a-fA-F]){1,4}|0?\\g<1>{1,5})}",
|
||||
"name": "constant.character.escape.powershell"
|
||||
},
|
||||
{
|
||||
"match": "`u(?:\\{[0-9a-fA-F]{,6}.)?",
|
||||
"name": "invalid.character.escape.powershell"
|
||||
}
|
||||
]
|
||||
},
|
||||
"function": {
|
||||
"begin": "^(?:\\s*+)(?i)(function|filter|configuration|workflow)\\s+(?:(global|local|script|private):)?((?:\\p{L}|\\d|_|-|\\.)+)",
|
||||
"beginCaptures": {
|
||||
@@ -677,7 +645,7 @@
|
||||
{
|
||||
"captures": {
|
||||
"0": {
|
||||
"name": "support.constant.automatic.powershell"
|
||||
"name": "support.variable.automatic.powershell"
|
||||
},
|
||||
"1": {
|
||||
"name": "punctuation.definition.variable.powershell"
|
||||
@@ -687,7 +655,7 @@
|
||||
}
|
||||
},
|
||||
"comment": "Automatic variables are not constants, but they are read-only. In monokai (default) color schema support.variable doesn't have color, so we use constant.",
|
||||
"match": "(\\$)(?i:(\\$|\\^|\\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?\\b"
|
||||
"match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)((?:\\.(?:\\p{L}|\\d|_)+)*\\b)?"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -865,7 +833,7 @@
|
||||
}
|
||||
},
|
||||
"comment": "Automatic variables are not constants, but they are read-only...",
|
||||
"match": "(\\$)(?i:(\\$|\\^|\\?|_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This))\\b"
|
||||
"match": "(\\$)((?:[$^?])|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\b)"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -897,7 +865,7 @@
|
||||
"name": "variable.other.member.powershell"
|
||||
}
|
||||
},
|
||||
"match": "(?i:(\\$|@)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
|
||||
"match": "(?i:(\\$)(global|local|private|script|using|workflow):((?:\\p{L}|\\d|_)+))"
|
||||
},
|
||||
{
|
||||
"captures": {
|
||||
@@ -1023,9 +991,6 @@
|
||||
{
|
||||
"include": "#variableNoProperty"
|
||||
},
|
||||
{
|
||||
"include": "#variable"
|
||||
},
|
||||
{
|
||||
"include": "#doubleQuotedStringEscapes"
|
||||
},
|
||||
|
||||
@@ -716,24 +716,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.constant.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.constant.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell support.variable.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1090,24 +1090,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1299,24 +1299,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "_",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1486,24 +1486,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "matches",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1563,24 +1563,24 @@
|
||||
},
|
||||
{
|
||||
"c": "$",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell punctuation.definition.variable.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "matches",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.constant.automatic.powershell",
|
||||
"t": "source.powershell meta.scriptblock.powershell meta.scriptblock.powershell meta.scriptblock.powershell interpolated.simple.source.powershell support.variable.automatic.powershell",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_plus": "support.variable: #9CDCFE",
|
||||
"light_plus": "support.variable: #001080",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
"hc_black": "support.variable: #9CDCFE"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ class Survey {
|
||||
}
|
||||
|
||||
private get triggerCount(): number {
|
||||
const count = this.memento.get(this.triggerCountMementoKey);
|
||||
const count = this.memento.get<number>(this.triggerCountMementoKey);
|
||||
return !count || isNaN(+count) ? 0 : +count;
|
||||
}
|
||||
|
||||
|
||||
@@ -287,6 +287,30 @@ suite('workspace-namespace', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('events: onDidSaveTextDocument fires even for non dirty file when saved', () => {
|
||||
return createRandomFile().then(file => {
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
|
||||
let onDidSaveTextDocument = false;
|
||||
disposables.push(vscode.workspace.onDidSaveTextDocument(e => {
|
||||
assert.ok(pathEquals(e.uri.fsPath, file.fsPath));
|
||||
onDidSaveTextDocument = true;
|
||||
}));
|
||||
|
||||
return vscode.workspace.openTextDocument(file).then(doc => {
|
||||
return vscode.window.showTextDocument(doc).then(() => {
|
||||
return vscode.commands.executeCommand('workbench.action.files.save').then(() => {
|
||||
assert.ok(onDidSaveTextDocument);
|
||||
|
||||
disposeAll(disposables);
|
||||
|
||||
return deleteFile(file);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('openTextDocument, with selection', function () {
|
||||
return createRandomFile('foo\nbar\nbar').then(file => {
|
||||
return vscode.workspace.openTextDocument(file).then(doc => {
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
"vscode": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-colorize-tests ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^10.12.21",
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/// <reference types='@types/node'/>
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
typescript@3.4.5:
|
||||
version "3.4.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
|
||||
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
|
||||
typescript@3.5.0-dev.20190515:
|
||||
version "3.5.0-dev.20190515"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.0-dev.20190515.tgz#e34d9f4ae5352ecbb7bbc2f67db6cef3d5f7d58e"
|
||||
integrity sha512-pE5yxFLdt5gT8PEX1Ra7vWU6HCdo4039be182oeWk8PTBWCWqr/XxlTjRxWfYgycNrI1vMjOux+n2y0aFJ9eUg==
|
||||
|
||||
+6
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.35.0",
|
||||
"distro": "b9fb31b7caa6d9f506aa458342ab71183bc90b52",
|
||||
"distro": "a80429a5120c955df4bd2dd95b1cff71b72ab556",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
@@ -23,7 +23,8 @@
|
||||
"smoketest": "cd test/smoke && node test/index.js",
|
||||
"download-builtin-extensions": "node build/lib/builtInExtensions.js",
|
||||
"monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit",
|
||||
"strict-initialization-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictPropertyInitialization"
|
||||
"strict-initialization-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictPropertyInitialization",
|
||||
"web": "node scripts/code-web.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"applicationinsights": "1.0.8",
|
||||
@@ -51,7 +52,7 @@
|
||||
"vscode-ripgrep": "^1.2.5",
|
||||
"vscode-sqlite3": "4.0.7",
|
||||
"vscode-textmate": "^4.0.1",
|
||||
"vscode-xterm": "3.13.0-beta3",
|
||||
"vscode-xterm": "3.14.0-beta2",
|
||||
"yauzl": "^2.9.1",
|
||||
"yazl": "^2.4.3"
|
||||
},
|
||||
@@ -102,6 +103,7 @@
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"gulp-untar": "^0.0.7",
|
||||
"gulp-vinyl-zip": "^2.1.2",
|
||||
"http-server": "^0.11.1",
|
||||
"husky": "^0.13.1",
|
||||
"innosetup-compiler": "^5.5.60",
|
||||
"is": "^3.1.0",
|
||||
@@ -114,6 +116,7 @@
|
||||
"mkdirp": "^0.5.0",
|
||||
"mocha": "^2.2.5",
|
||||
"mocha-junit-reporter": "^1.17.0",
|
||||
"opn": "^5.4.0",
|
||||
"optimist": "0.3.5",
|
||||
"p-all": "^1.0.0",
|
||||
"pump": "^1.0.1",
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const httpServer = require('http-server');
|
||||
const opn = require('opn');
|
||||
|
||||
const url = 'http://127.0.0.1:8080/out/vs/code/browser/workbench/workbench.html';
|
||||
|
||||
httpServer.createServer({ root: '.', cache: 5 }).listen(8080);
|
||||
console.log(`Open ${url} in your browser`);
|
||||
|
||||
opn(url);
|
||||
+1
-1
@@ -12,7 +12,7 @@ exports.base = [{
|
||||
}];
|
||||
|
||||
exports.workbench = require('./vs/workbench/buildfile').collectModules(['vs/workbench/workbench.main']);
|
||||
exports.workbenchNodeless = require('./vs/workbench/buildfile').collectModules(['vs/workbench/workbench.nodeless.main']);
|
||||
exports.workbenchWeb = require('./vs/workbench/buildfile').collectModules(['vs/workbench/workbench.web.main']);
|
||||
|
||||
exports.code = require('./vs/code/buildfile').collectModules();
|
||||
|
||||
|
||||
Vendored
+303
-44
@@ -101,17 +101,6 @@ declare module 'vscode-xterm' {
|
||||
*/
|
||||
experimentalCharAtlas?: 'none' | 'static' | 'dynamic';
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Defines which implementation to use for buffer lines.
|
||||
*
|
||||
* - 'JsArray': The default/stable implementation.
|
||||
* - 'TypedArray': The new experimental implementation based on TypedArrays that is expected to
|
||||
* significantly boost performance and memory consumption. Use at your own risk.
|
||||
*
|
||||
* @deprecated This option will be removed in the future.
|
||||
*/
|
||||
experimentalBufferLineImpl?: 'JsArray' | 'TypedArray';
|
||||
|
||||
/**
|
||||
* The font size used to render text.
|
||||
*/
|
||||
@@ -199,6 +188,18 @@ declare module 'vscode-xterm' {
|
||||
* The color theme of the terminal.
|
||||
*/
|
||||
theme?: ITheme;
|
||||
|
||||
/**
|
||||
* Whether "Windows mode" is enabled. Because Windows backends winpty and
|
||||
* conpty operate by doing line wrapping on their side, xterm.js does not
|
||||
* have access to wrapped lines. When Windows mode is enabled the following
|
||||
* changes will be in effect:
|
||||
*
|
||||
* - Reflow is disabled.
|
||||
* - Lines are assumed to be wrapped if the last character of the line is
|
||||
* not whitespace.
|
||||
*/
|
||||
windowsMode?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -274,7 +275,7 @@ declare module 'vscode-xterm' {
|
||||
* A callback that fires when the mouse leaves a link. Note that this can
|
||||
* happen even when tooltipCallback hasn't fired for the link yet.
|
||||
*/
|
||||
leaveCallback?: (event: MouseEvent, uri: string) => boolean | void;
|
||||
leaveCallback?: () => void;
|
||||
|
||||
/**
|
||||
* The priority of the link matcher, this defines the order in which the link
|
||||
@@ -306,6 +307,14 @@ declare module 'vscode-xterm' {
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* An event that can be listened to.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
export interface IEvent<T> {
|
||||
(listener: (e: T) => any): IDisposable;
|
||||
}
|
||||
|
||||
export interface IMarker extends IDisposable {
|
||||
readonly id: number;
|
||||
readonly isDisposed: boolean;
|
||||
@@ -325,28 +334,39 @@ declare module 'vscode-xterm' {
|
||||
/**
|
||||
* The element containing the terminal.
|
||||
*/
|
||||
element: HTMLElement;
|
||||
readonly element: HTMLElement;
|
||||
|
||||
/**
|
||||
* The textarea that accepts input for the terminal.
|
||||
*/
|
||||
textarea: HTMLTextAreaElement;
|
||||
readonly textarea: HTMLTextAreaElement;
|
||||
|
||||
/**
|
||||
* The number of rows in the terminal's viewport.
|
||||
* The number of rows in the terminal's viewport. Use
|
||||
* `ITerminalOptions.rows` to set this in the constructor and
|
||||
* `Terminal.resize` for when the terminal exists.
|
||||
*/
|
||||
rows: number;
|
||||
readonly rows: number;
|
||||
|
||||
/**
|
||||
* The number of columns in the terminal's viewport.
|
||||
* The number of columns in the terminal's viewport. Use
|
||||
* `ITerminalOptions.cols` to set this in the constructor and
|
||||
* `Terminal.resize` for when the terminal exists.
|
||||
*/
|
||||
cols: number;
|
||||
readonly cols: number;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) The terminal's current buffer, this might be either the
|
||||
* normal buffer or the alt buffer depending on what's running in the
|
||||
* terminal.
|
||||
*/
|
||||
readonly buffer: IBuffer;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
|
||||
* buffer is active this will always return [].
|
||||
*/
|
||||
markers: IMarker[];
|
||||
readonly markers: ReadonlyArray<IMarker>;
|
||||
|
||||
/**
|
||||
* Natural language strings that can be localized.
|
||||
@@ -360,6 +380,70 @@ declare module 'vscode-xterm' {
|
||||
*/
|
||||
constructor(options?: ITerminalOptions);
|
||||
|
||||
/**
|
||||
* Adds an event listener for the cursor moves.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onCursorMove: IEvent<void>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when a data event fires. This happens for
|
||||
* example when the user types or pastes into the terminal. The event value
|
||||
* is whatever `string` results, in a typical setup, this should be passed
|
||||
* on to the backing pty.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onData: IEvent<string>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for a key is pressed. The event value contains the
|
||||
* string that will be sent in the data event as well as the DOM event that
|
||||
* triggered it.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onKey: IEvent<{ key: string, domEvent: KeyboardEvent }>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when a line feed is added.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onLineFeed: IEvent<void>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when a scroll occurs. The event value is the
|
||||
* new position of the viewport.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onScroll: IEvent<number>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when a selection change occurs.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onSelectionChange: IEvent<void>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when rows are rendered. The event value
|
||||
* contains the start row and end rows of the rendered area (ranges from `0`
|
||||
* to `Terminal.rows - 1`).
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onRender: IEvent<{ start: number, end: number }>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when the terminal is resized. The event value
|
||||
* contains the new size.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onResize: IEvent<{ cols: number, rows: number }>;
|
||||
|
||||
/**
|
||||
* Adds an event listener for when an OSC 0 or OSC 2 title change occurs.
|
||||
* The event value is the new title.
|
||||
* @returns an `IDisposable` to stop listening.
|
||||
*/
|
||||
onTitleChange: IEvent<string>;
|
||||
|
||||
/**
|
||||
* Unfocus the terminal.
|
||||
*/
|
||||
@@ -374,54 +458,63 @@ declare module 'vscode-xterm' {
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'blur' | 'focus' | 'linefeed' | 'selection', listener: () => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'data', listener: (...args: any[]) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'key', listener: (key: string, event: KeyboardEvent) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'keypress' | 'keydown', listener: (event: KeyboardEvent) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'refresh', listener: (data: { start: number, end: number }) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'resize', listener: (data: { cols: number, rows: number }) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'scroll', listener: (ydisp: number) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: 'title', listener: (title: string) => void): void;
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
on(type: string, listener: (...args: any[]) => void): void;
|
||||
|
||||
@@ -429,6 +522,7 @@ declare module 'vscode-xterm' {
|
||||
* Deregisters an event listener.
|
||||
* @param type The type of the event.
|
||||
* @param listener The listener.
|
||||
* @deprecated use `Terminal.onEvent(listener).dispose()` instead.
|
||||
*/
|
||||
off(type: 'blur' | 'focus' | 'linefeed' | 'selection' | 'data' | 'key' | 'keypress' | 'keydown' | 'refresh' | 'resize' | 'scroll' | 'title' | string, listener: (...args: any[]) => void): void;
|
||||
|
||||
@@ -446,22 +540,19 @@ declare module 'vscode-xterm' {
|
||||
* be used to conveniently remove the event listener.
|
||||
* @param type The type of event.
|
||||
* @param handler The event handler.
|
||||
* @deprecated use `Terminal.onEvent(listener)` instead.
|
||||
*/
|
||||
addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable;
|
||||
|
||||
/**
|
||||
* Resizes the terminal.
|
||||
* Resizes the terminal. It's best practice to debounce calls to resize,
|
||||
* this will help ensure that the pty can respond to the resize event
|
||||
* before another one occurs.
|
||||
* @param x The number of columns to resize to.
|
||||
* @param y The number of rows to resize to.
|
||||
*/
|
||||
resize(columns: number, rows: number): void;
|
||||
|
||||
/**
|
||||
* Writes text to the terminal, followed by a break line character (\n).
|
||||
* @param data The text to write to the terminal.
|
||||
*/
|
||||
writeln(data: string): void;
|
||||
|
||||
/**
|
||||
* Opens the terminal within an element.
|
||||
* @param parent The element to create the terminal within. This element
|
||||
@@ -476,11 +567,35 @@ declare module 'vscode-xterm' {
|
||||
* should be processed by the terminal and what keys should not.
|
||||
* @param customKeyEventHandler The custom KeyboardEvent handler to attach.
|
||||
* This is a function that takes a KeyboardEvent, allowing consumers to stop
|
||||
* propogation and/or prevent the default action. The function returns
|
||||
* propagation and/or prevent the default action. The function returns
|
||||
* whether the event should be processed by xterm.js.
|
||||
*/
|
||||
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Adds a handler for CSI escape sequences.
|
||||
* @param flag The flag should be one-character string, which specifies the
|
||||
* final character (e.g "m" for SGR) of the CSI sequence.
|
||||
* @param callback The function to handle the escape sequence. The callback
|
||||
* is called with the numerical params, as well as the special characters
|
||||
* (e.g. "$" for DECSCPP). Return true if the sequence was handled; false if
|
||||
* we should try a previous handler (set by addCsiHandler or setCsiHandler).
|
||||
* The most recently-added handler is tried first.
|
||||
* @return An IDisposable you can call to remove this handler.
|
||||
*/
|
||||
addCsiHandler(flag: string, callback: (params: number[], collect: string) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Adds a handler for OSC escape sequences.
|
||||
* @param ident The number (first parameter) of the sequence.
|
||||
* @param callback The function to handle the escape sequence. The callback
|
||||
* is called with OSC data string. Return true if the sequence was handled;
|
||||
* false if we should try a previous handler (set by addOscHandler or
|
||||
* setOscHandler). The most recently-added handler is tried first.
|
||||
* @return An IDisposable you can call to remove this handler.
|
||||
*/
|
||||
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Registers a link matcher, allowing custom link patterns to
|
||||
* be matched and handled.
|
||||
@@ -555,11 +670,24 @@ declare module 'vscode-xterm' {
|
||||
*/
|
||||
getSelection(): string;
|
||||
|
||||
/**
|
||||
* Gets the selection position or undefined if there is no selection.
|
||||
*/
|
||||
getSelectionPosition(): ISelectionPosition | undefined;
|
||||
|
||||
/**
|
||||
* Clears the current terminal selection.
|
||||
*/
|
||||
clearSelection(): void;
|
||||
|
||||
/**
|
||||
* Selects text within the terminal.
|
||||
* @param column The column the selection starts at..
|
||||
* @param row The row the selection starts at.
|
||||
* @param length The length of the selection.
|
||||
*/
|
||||
select(column: number, row: number, length: number): void;
|
||||
|
||||
/**
|
||||
* Selects all text within the terminal.
|
||||
*/
|
||||
@@ -624,6 +752,20 @@ declare module 'vscode-xterm' {
|
||||
*/
|
||||
write(data: string): void;
|
||||
|
||||
/**
|
||||
* Writes text to the terminal, followed by a break line character (\n).
|
||||
* @param data The text to write to the terminal.
|
||||
*/
|
||||
writeln(data: string): void;
|
||||
|
||||
/**
|
||||
* Writes UTF8 data to the terminal.
|
||||
* This has a slight performance advantage over the string based write method
|
||||
* due to lesser data conversions needed on the way from the pty to xterm.js.
|
||||
* @param data The data to write to the terminal.
|
||||
*/
|
||||
writeUtf8(data: Uint8Array): void;
|
||||
|
||||
/**
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param key The option key.
|
||||
@@ -633,7 +775,7 @@ declare module 'vscode-xterm' {
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param key The option key.
|
||||
*/
|
||||
getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell'): boolean;
|
||||
getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean;
|
||||
/**
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param key The option key.
|
||||
@@ -684,7 +826,7 @@ declare module 'vscode-xterm' {
|
||||
* @param key The option key.
|
||||
* @param value The option value.
|
||||
*/
|
||||
setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell', value: boolean): void;
|
||||
setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void;
|
||||
/**
|
||||
* Sets an option on the terminal.
|
||||
* @param key The option key.
|
||||
@@ -739,8 +881,134 @@ declare module 'vscode-xterm' {
|
||||
* Applies an addon to the Terminal prototype, making it available to all
|
||||
* newly created Terminals.
|
||||
* @param addon The addon to apply.
|
||||
* @deprecated Use the new loadAddon API/addon format.
|
||||
*/
|
||||
static applyAddon(addon: any): void;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Loads an addon into this instance of xterm.js.
|
||||
* @param addon The addon to load.
|
||||
*/
|
||||
loadAddon(addon: ITerminalAddon): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* An addon that can provide additional functionality to the terminal.
|
||||
*/
|
||||
export interface ITerminalAddon extends IDisposable {
|
||||
/**
|
||||
* (EXPERIMENTAL) This is called when the addon is activated within xterm.js.
|
||||
*/
|
||||
activate(terminal: Terminal): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* An object representing a selecrtion within the terminal.
|
||||
*/
|
||||
interface ISelectionPosition {
|
||||
/**
|
||||
* The start column of the selection.
|
||||
*/
|
||||
startColumn: number;
|
||||
|
||||
/**
|
||||
* The start row of the selection.
|
||||
*/
|
||||
startRow: number;
|
||||
|
||||
/**
|
||||
* The end column of the selection.
|
||||
*/
|
||||
endColumn: number;
|
||||
|
||||
/**
|
||||
* The end row of the selection.
|
||||
*/
|
||||
endRow: number;
|
||||
}
|
||||
|
||||
interface IBuffer {
|
||||
/**
|
||||
* The y position of the cursor. This ranges between `0` (when the
|
||||
* cursor is at baseY) and `Terminal.rows - 1` (when the cursor is on the
|
||||
* last row).
|
||||
*/
|
||||
readonly cursorY: number;
|
||||
|
||||
/**
|
||||
* The x position of the cursor. This ranges between `0` (left side) and
|
||||
* `Terminal.cols - 1` (right side).
|
||||
*/
|
||||
readonly cursorX: number;
|
||||
|
||||
/**
|
||||
* The line within the buffer where the top of the viewport is.
|
||||
*/
|
||||
readonly viewportY: number;
|
||||
|
||||
/**
|
||||
* The line within the buffer where the top of the bottom page is (when
|
||||
* fully scrolled down);
|
||||
*/
|
||||
readonly baseY: number;
|
||||
|
||||
/**
|
||||
* The amount of lines in the buffer.
|
||||
*/
|
||||
readonly length: number;
|
||||
|
||||
/**
|
||||
* Gets a line from the buffer, or undefined if the line index does not exist.
|
||||
*
|
||||
* Note that the result of this function should be used immediately after calling as when the
|
||||
* terminal updates it could lead to unexpected behavior.
|
||||
*
|
||||
* @param y The line index to get.
|
||||
*/
|
||||
getLine(y: number): IBufferLine | undefined;
|
||||
}
|
||||
|
||||
interface IBufferLine {
|
||||
/**
|
||||
* Whether the line is wrapped from the previous line.
|
||||
*/
|
||||
readonly isWrapped: boolean;
|
||||
|
||||
/**
|
||||
* Gets a cell from the line, or undefined if the line index does not exist.
|
||||
*
|
||||
* Note that the result of this function should be used immediately after calling as when the
|
||||
* terminal updates it could lead to unexpected behavior.
|
||||
*
|
||||
* @param x The character index to get.
|
||||
*/
|
||||
getCell(x: number): IBufferCell;
|
||||
|
||||
/**
|
||||
* Gets the line as a string. Note that this is gets only the string for the line, not taking
|
||||
* isWrapped into account.
|
||||
*
|
||||
* @param trimRight Whether to trim any whitespace at the right of the line.
|
||||
* @param startColumn The column to start from (inclusive).
|
||||
* @param endColumn The column to end at (exclusive).
|
||||
*/
|
||||
translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string;
|
||||
}
|
||||
|
||||
interface IBufferCell {
|
||||
/**
|
||||
* The character within the cell.
|
||||
*/
|
||||
readonly char: string;
|
||||
|
||||
/**
|
||||
* The width of the character. Some examples:
|
||||
*
|
||||
* - This is `1` for most cells.
|
||||
* - This is `2` for wide character like CJK glyphs.
|
||||
* - This is `0` for cells immediately following cells with a width of `2`.
|
||||
*/
|
||||
readonly width: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,22 +1018,10 @@ declare module 'vscode-xterm' {
|
||||
interface TerminalCore {
|
||||
debug: boolean;
|
||||
|
||||
buffer: {
|
||||
y: number;
|
||||
ybase: number;
|
||||
ydisp: number;
|
||||
x: number;
|
||||
lines: any[];
|
||||
|
||||
translateBufferLineToString(lineIndex: number, trimRight: boolean): string;
|
||||
};
|
||||
|
||||
handler(text: string): void;
|
||||
|
||||
/**
|
||||
* Emit an event on the terminal.
|
||||
*/
|
||||
emit(type: string, data: any): void;
|
||||
_onScroll: IEventEmitter2<number>;
|
||||
_onKey: IEventEmitter2<{ key: string }>;
|
||||
|
||||
charMeasure?: { height: number, width: number };
|
||||
|
||||
@@ -775,6 +1031,10 @@ declare module 'vscode-xterm' {
|
||||
};
|
||||
}
|
||||
|
||||
interface IEventEmitter2<T> {
|
||||
fire(e: T): void;
|
||||
}
|
||||
|
||||
interface ISearchOptions {
|
||||
/**
|
||||
* Whether the find should be done as a regex.
|
||||
@@ -794,7 +1054,6 @@ declare module 'vscode-xterm' {
|
||||
_core: TerminalCore;
|
||||
|
||||
webLinksInit(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): void;
|
||||
winptyCompatInit(): void;
|
||||
|
||||
/**
|
||||
* Find the next instance of the term, then scroll to and select it. If it
|
||||
|
||||
@@ -45,13 +45,13 @@ class WindowManager {
|
||||
|
||||
// --- Pixel Ratio
|
||||
public getPixelRatio(): number {
|
||||
let ctx = document.createElement('canvas').getContext('2d');
|
||||
let ctx: any = document.createElement('canvas').getContext('2d');
|
||||
let dpr = window.devicePixelRatio || 1;
|
||||
let bsr = (<any>ctx).webkitBackingStorePixelRatio ||
|
||||
(<any>ctx).mozBackingStorePixelRatio ||
|
||||
(<any>ctx).msBackingStorePixelRatio ||
|
||||
(<any>ctx).oBackingStorePixelRatio ||
|
||||
(<any>ctx).backingStorePixelRatio || 1;
|
||||
let bsr = ctx.webkitBackingStorePixelRatio ||
|
||||
ctx.mozBackingStorePixelRatio ||
|
||||
ctx.msBackingStorePixelRatio ||
|
||||
ctx.oBackingStorePixelRatio ||
|
||||
ctx.backingStorePixelRatio || 1;
|
||||
return dpr / bsr;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IAction, IActionRunner } from 'vs/base/common/actions';
|
||||
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
||||
import { SubmenuAction } from 'vs/base/browser/ui/menu/menu';
|
||||
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
@@ -25,7 +25,7 @@ export class ContextSubMenu extends SubmenuAction {
|
||||
export interface IContextMenuDelegate {
|
||||
getAnchor(): HTMLElement | { x: number; y: number; width?: number; height?: number; };
|
||||
getActions(): Array<IAction | ContextSubMenu>;
|
||||
getActionItem?(action: IAction): IActionItem | undefined;
|
||||
getActionViewItem?(action: IAction): IActionViewItem | undefined;
|
||||
getActionsContext?(event?: IContextMenuEvent): any;
|
||||
getKeyBinding?(action: IAction): ResolvedKeybinding | undefined;
|
||||
getMenuClassName?(): string;
|
||||
|
||||
@@ -315,7 +315,7 @@ function parseFormattedText(content: string): IFormatParseTree {
|
||||
children: []
|
||||
};
|
||||
|
||||
let actionItemIndex = 0;
|
||||
let actionViewItemIndex = 0;
|
||||
let current = root;
|
||||
const stack: IFormatParseTree[] = [];
|
||||
const stream = new StringStream(content);
|
||||
@@ -345,8 +345,8 @@ function parseFormattedText(content: string): IFormatParseTree {
|
||||
};
|
||||
|
||||
if (type === FormatType.Action) {
|
||||
newCurrent.index = actionItemIndex;
|
||||
actionItemIndex++;
|
||||
newCurrent.index = actionViewItemIndex;
|
||||
actionViewItemIndex++;
|
||||
}
|
||||
|
||||
current.children!.push(newCurrent);
|
||||
|
||||
@@ -18,7 +18,7 @@ import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { asArray } from 'vs/base/common/arrays';
|
||||
|
||||
export interface IActionItem {
|
||||
export interface IActionViewItem {
|
||||
actionRunner: IActionRunner;
|
||||
setActionContext(context: any): void;
|
||||
render(element: HTMLElement): void;
|
||||
@@ -28,12 +28,12 @@ export interface IActionItem {
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export interface IBaseActionItemOptions {
|
||||
export interface IBaseActionViewItemOptions {
|
||||
draggable?: boolean;
|
||||
isMenu?: boolean;
|
||||
}
|
||||
|
||||
export class BaseActionItem extends Disposable implements IActionItem {
|
||||
export class BaseActionViewItem extends Disposable implements IActionViewItem {
|
||||
|
||||
element?: HTMLElement;
|
||||
_context: any;
|
||||
@@ -41,7 +41,7 @@ export class BaseActionItem extends Disposable implements IActionItem {
|
||||
|
||||
private _actionRunner: IActionRunner;
|
||||
|
||||
constructor(context: any, action: IAction, protected options?: IBaseActionItemOptions) {
|
||||
constructor(context: any, action: IAction, protected options?: IBaseActionViewItemOptions) {
|
||||
super();
|
||||
|
||||
this._context = context || this;
|
||||
@@ -226,20 +226,20 @@ export class Separator extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
export interface IActionItemOptions extends IBaseActionItemOptions {
|
||||
export interface IActionViewItemOptions extends IBaseActionViewItemOptions {
|
||||
icon?: boolean;
|
||||
label?: boolean;
|
||||
keybinding?: string | null;
|
||||
}
|
||||
|
||||
export class ActionItem extends BaseActionItem {
|
||||
export class ActionViewItem extends BaseActionViewItem {
|
||||
|
||||
protected label: HTMLElement;
|
||||
protected options: IActionItemOptions;
|
||||
protected options: IActionViewItemOptions;
|
||||
|
||||
private cssClass?: string;
|
||||
|
||||
constructor(context: any, action: IAction, options: IActionItemOptions = {}) {
|
||||
constructor(context: any, action: IAction, options: IActionViewItemOptions = {}) {
|
||||
super(context, action, options);
|
||||
|
||||
this.options = options;
|
||||
@@ -363,14 +363,14 @@ export interface ActionTrigger {
|
||||
keyDown: boolean;
|
||||
}
|
||||
|
||||
export interface IActionItemProvider {
|
||||
(action: IAction): IActionItem | undefined;
|
||||
export interface IActionViewItemProvider {
|
||||
(action: IAction): IActionViewItem | undefined;
|
||||
}
|
||||
|
||||
export interface IActionBarOptions {
|
||||
orientation?: ActionsOrientation;
|
||||
context?: any;
|
||||
actionItemProvider?: IActionItemProvider;
|
||||
actionViewItemProvider?: IActionViewItemProvider;
|
||||
actionRunner?: IActionRunner;
|
||||
ariaLabel?: string;
|
||||
animated?: boolean;
|
||||
@@ -386,7 +386,7 @@ const defaultOptions: IActionBarOptions = {
|
||||
}
|
||||
};
|
||||
|
||||
export interface IActionOptions extends IActionItemOptions {
|
||||
export interface IActionOptions extends IActionViewItemOptions {
|
||||
index?: number;
|
||||
}
|
||||
|
||||
@@ -397,8 +397,8 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
private _actionRunner: IActionRunner;
|
||||
private _context: any;
|
||||
|
||||
// Items
|
||||
items: IActionItem[];
|
||||
// View Items
|
||||
viewItems: IActionViewItem[];
|
||||
protected focusedItem?: number;
|
||||
private focusTracker: DOM.IFocusTracker;
|
||||
|
||||
@@ -438,7 +438,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
this._register(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));
|
||||
this._register(this._actionRunner.onDidBeforeRun(e => this._onDidBeforeRun.fire(e)));
|
||||
|
||||
this.items = [];
|
||||
this.viewItems = [];
|
||||
this.focusedItem = undefined;
|
||||
|
||||
this.domNode = document.createElement('div');
|
||||
@@ -575,7 +575,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
|
||||
set context(context: any) {
|
||||
this._context = context;
|
||||
this.items.forEach(i => i.setActionContext(context));
|
||||
this.viewItems.forEach(i => i.setActionContext(context));
|
||||
}
|
||||
|
||||
get actionRunner(): IActionRunner {
|
||||
@@ -585,7 +585,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
set actionRunner(actionRunner: IActionRunner) {
|
||||
if (actionRunner) {
|
||||
this._actionRunner = actionRunner;
|
||||
this.items.forEach(item => item.actionRunner = actionRunner);
|
||||
this.viewItems.forEach(item => item.actionRunner = actionRunner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,36 +599,36 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
let index = types.isNumber(options.index) ? options.index : null;
|
||||
|
||||
actions.forEach((action: IAction) => {
|
||||
const actionItemElement = document.createElement('li');
|
||||
actionItemElement.className = 'action-item';
|
||||
actionItemElement.setAttribute('role', 'presentation');
|
||||
const actionViewItemElement = document.createElement('li');
|
||||
actionViewItemElement.className = 'action-item';
|
||||
actionViewItemElement.setAttribute('role', 'presentation');
|
||||
|
||||
// Prevent native context menu on actions
|
||||
this._register(DOM.addDisposableListener(actionItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {
|
||||
this._register(DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}));
|
||||
|
||||
let item: IActionItem | undefined;
|
||||
let item: IActionViewItem | undefined;
|
||||
|
||||
if (this.options.actionItemProvider) {
|
||||
item = this.options.actionItemProvider(action);
|
||||
if (this.options.actionViewItemProvider) {
|
||||
item = this.options.actionViewItemProvider(action);
|
||||
}
|
||||
|
||||
if (!item) {
|
||||
item = new ActionItem(this.context, action, options);
|
||||
item = new ActionViewItem(this.context, action, options);
|
||||
}
|
||||
|
||||
item.actionRunner = this._actionRunner;
|
||||
item.setActionContext(this.context);
|
||||
item.render(actionItemElement);
|
||||
item.render(actionViewItemElement);
|
||||
|
||||
if (index === null || index < 0 || index >= this.actionsList.children.length) {
|
||||
this.actionsList.appendChild(actionItemElement);
|
||||
this.items.push(item);
|
||||
this.actionsList.appendChild(actionViewItemElement);
|
||||
this.viewItems.push(item);
|
||||
} else {
|
||||
this.actionsList.insertBefore(actionItemElement, this.actionsList.children[index]);
|
||||
this.items.splice(index, 0, item);
|
||||
this.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);
|
||||
this.viewItems.splice(index, 0, item);
|
||||
index++;
|
||||
}
|
||||
});
|
||||
@@ -657,23 +657,23 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
}
|
||||
|
||||
pull(index: number): void {
|
||||
if (index >= 0 && index < this.items.length) {
|
||||
if (index >= 0 && index < this.viewItems.length) {
|
||||
this.actionsList.removeChild(this.actionsList.childNodes[index]);
|
||||
dispose(this.items.splice(index, 1));
|
||||
dispose(this.viewItems.splice(index, 1));
|
||||
}
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.items = dispose(this.items);
|
||||
this.viewItems = dispose(this.viewItems);
|
||||
DOM.clearNode(this.actionsList);
|
||||
}
|
||||
|
||||
length(): number {
|
||||
return this.items.length;
|
||||
return this.viewItems.length;
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
return this.items.length === 0;
|
||||
return this.viewItems.length === 0;
|
||||
}
|
||||
|
||||
focus(index?: number): void;
|
||||
@@ -691,7 +691,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
|
||||
if (selectFirst && typeof this.focusedItem === 'undefined') {
|
||||
// Focus the first enabled item
|
||||
this.focusedItem = this.items.length - 1;
|
||||
this.focusedItem = this.viewItems.length - 1;
|
||||
this.focusNext();
|
||||
} else {
|
||||
if (index !== undefined) {
|
||||
@@ -704,15 +704,15 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
|
||||
protected focusNext(): void {
|
||||
if (typeof this.focusedItem === 'undefined') {
|
||||
this.focusedItem = this.items.length - 1;
|
||||
this.focusedItem = this.viewItems.length - 1;
|
||||
}
|
||||
|
||||
const startIndex = this.focusedItem;
|
||||
let item: IActionItem;
|
||||
let item: IActionViewItem;
|
||||
|
||||
do {
|
||||
this.focusedItem = (this.focusedItem + 1) % this.items.length;
|
||||
item = this.items[this.focusedItem];
|
||||
this.focusedItem = (this.focusedItem + 1) % this.viewItems.length;
|
||||
item = this.viewItems[this.focusedItem];
|
||||
} while (this.focusedItem !== startIndex && !item.isEnabled());
|
||||
|
||||
if (this.focusedItem === startIndex && !item.isEnabled()) {
|
||||
@@ -728,16 +728,16 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
}
|
||||
|
||||
const startIndex = this.focusedItem;
|
||||
let item: IActionItem;
|
||||
let item: IActionViewItem;
|
||||
|
||||
do {
|
||||
this.focusedItem = this.focusedItem - 1;
|
||||
|
||||
if (this.focusedItem < 0) {
|
||||
this.focusedItem = this.items.length - 1;
|
||||
this.focusedItem = this.viewItems.length - 1;
|
||||
}
|
||||
|
||||
item = this.items[this.focusedItem];
|
||||
item = this.viewItems[this.focusedItem];
|
||||
} while (this.focusedItem !== startIndex && !item.isEnabled());
|
||||
|
||||
if (this.focusedItem === startIndex && !item.isEnabled()) {
|
||||
@@ -752,21 +752,21 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
this.actionsList.focus();
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.items.length; i++) {
|
||||
const item = this.items[i];
|
||||
const actionItem = item;
|
||||
for (let i = 0; i < this.viewItems.length; i++) {
|
||||
const item = this.viewItems[i];
|
||||
const actionViewItem = item;
|
||||
|
||||
if (i === this.focusedItem) {
|
||||
if (types.isFunction(actionItem.isEnabled)) {
|
||||
if (actionItem.isEnabled() && types.isFunction(actionItem.focus)) {
|
||||
actionItem.focus(fromRight);
|
||||
if (types.isFunction(actionViewItem.isEnabled)) {
|
||||
if (actionViewItem.isEnabled() && types.isFunction(actionViewItem.focus)) {
|
||||
actionViewItem.focus(fromRight);
|
||||
} else {
|
||||
this.actionsList.focus();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (types.isFunction(actionItem.blur)) {
|
||||
actionItem.blur();
|
||||
if (types.isFunction(actionViewItem.blur)) {
|
||||
actionViewItem.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,16 +778,16 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
}
|
||||
|
||||
// trigger action
|
||||
const actionItem = this.items[this.focusedItem];
|
||||
if (actionItem instanceof BaseActionItem) {
|
||||
const context = (actionItem._context === null || actionItem._context === undefined) ? event : actionItem._context;
|
||||
this.run(actionItem._action, context);
|
||||
const actionViewItem = this.viewItems[this.focusedItem];
|
||||
if (actionViewItem instanceof BaseActionViewItem) {
|
||||
const context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;
|
||||
this.run(actionViewItem._action, context);
|
||||
}
|
||||
}
|
||||
|
||||
private cancel(): void {
|
||||
if (document.activeElement instanceof HTMLElement) {
|
||||
(<HTMLElement>document.activeElement).blur(); // remove focus from focused action
|
||||
document.activeElement.blur(); // remove focus from focused action
|
||||
}
|
||||
|
||||
this._onDidCancel.fire();
|
||||
@@ -798,8 +798,8 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
dispose(this.items);
|
||||
this.items = [];
|
||||
dispose(this.viewItems);
|
||||
this.viewItems = [];
|
||||
|
||||
DOM.removeNode(this.getContainer());
|
||||
|
||||
@@ -807,7 +807,7 @@ export class ActionBar extends Disposable implements IActionRunner {
|
||||
}
|
||||
}
|
||||
|
||||
export class SelectActionItem extends BaseActionItem {
|
||||
export class SelectActionViewItem extends BaseActionViewItem {
|
||||
protected selectBox: SelectBox;
|
||||
|
||||
constructor(ctx: any, action: IAction, options: ISelectOptionItem[], selected: number, contextViewProvider: IContextViewProvider, selectBoxOptions?: ISelectBoxOptions) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Color } from 'vs/base/common/color';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { BaseActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface ICheckboxOpts extends ICheckboxStyles {
|
||||
@@ -28,7 +28,7 @@ const defaultOpts = {
|
||||
inputActiveOptionBorder: Color.fromHex('#007ACC')
|
||||
};
|
||||
|
||||
export class CheckboxActionItem extends BaseActionItem {
|
||||
export class CheckboxActionViewItem extends BaseActionViewItem {
|
||||
|
||||
private checkbox: Checkbox;
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
@@ -132,13 +132,13 @@ export class ContextView extends Disposable {
|
||||
|
||||
ContextView.BUBBLE_UP_EVENTS.forEach(event => {
|
||||
toDisposeOnSetContainer.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
this.onDOMEvent(e, <HTMLElement>document.activeElement, false);
|
||||
this.onDOMEvent(e, false);
|
||||
}));
|
||||
});
|
||||
|
||||
ContextView.BUBBLE_DOWN_EVENTS.forEach(event => {
|
||||
toDisposeOnSetContainer.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
this.onDOMEvent(e, <HTMLElement>document.activeElement, true);
|
||||
this.onDOMEvent(e, true);
|
||||
}, true));
|
||||
});
|
||||
|
||||
@@ -213,13 +213,11 @@ export class ContextView extends Disposable {
|
||||
height: elementPosition.height
|
||||
};
|
||||
} else {
|
||||
let realAnchor = <IAnchor>anchor;
|
||||
|
||||
around = {
|
||||
top: realAnchor.y,
|
||||
left: realAnchor.x,
|
||||
width: realAnchor.width || 1,
|
||||
height: realAnchor.height || 2
|
||||
top: anchor.y,
|
||||
left: anchor.x,
|
||||
width: anchor.width || 1,
|
||||
height: anchor.height || 2
|
||||
};
|
||||
}
|
||||
|
||||
@@ -277,7 +275,7 @@ export class ContextView extends Disposable {
|
||||
return !!this.delegate;
|
||||
}
|
||||
|
||||
private onDOMEvent(e: Event, element: HTMLElement, onCapture: boolean): void {
|
||||
private onDOMEvent(e: Event, onCapture: boolean): void {
|
||||
if (this.delegate) {
|
||||
if (this.delegate.onDOMEvent) {
|
||||
this.delegate.onDOMEvent(e, <HTMLElement>document.activeElement);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./dropdown';
|
||||
import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch';
|
||||
import { ActionRunner, IAction, IActionRunner } from 'vs/base/common/actions';
|
||||
import { BaseActionItem, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { BaseActionViewItem, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextViewProvider, IAnchor, AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { IMenuOptions } from 'vs/base/browser/ui/menu/menu';
|
||||
@@ -247,7 +247,7 @@ export class DropdownMenu extends BaseDropdown {
|
||||
getAnchor: () => this.element,
|
||||
getActions: () => this.actions,
|
||||
getActionsContext: () => this.menuOptions ? this.menuOptions.context : null,
|
||||
getActionItem: action => this.menuOptions && this.menuOptions.actionItemProvider ? this.menuOptions.actionItemProvider(action) : undefined,
|
||||
getActionViewItem: action => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action) : undefined,
|
||||
getKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,
|
||||
getMenuClassName: () => this.menuClassName,
|
||||
onHide: () => this.onHide(),
|
||||
@@ -266,23 +266,23 @@ export class DropdownMenu extends BaseDropdown {
|
||||
}
|
||||
}
|
||||
|
||||
export class DropdownMenuActionItem extends BaseActionItem {
|
||||
export class DropdownMenuActionViewItem extends BaseActionViewItem {
|
||||
private menuActionsOrProvider: any;
|
||||
private dropdownMenu: DropdownMenu;
|
||||
private contextMenuProvider: IContextMenuProvider;
|
||||
private actionItemProvider?: IActionItemProvider;
|
||||
private actionViewItemProvider?: IActionViewItemProvider;
|
||||
private keybindings?: (action: IAction) => ResolvedKeybinding | undefined;
|
||||
private clazz: string | undefined;
|
||||
private anchorAlignmentProvider: (() => AnchorAlignment) | undefined;
|
||||
|
||||
constructor(action: IAction, menuActions: IAction[], contextMenuProvider: IContextMenuProvider, actionItemProvider: IActionItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
|
||||
constructor(action: IAction, actionProvider: IActionProvider, contextMenuProvider: IContextMenuProvider, actionItemProvider: IActionItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
|
||||
constructor(action: IAction, menuActionsOrProvider: any, contextMenuProvider: IContextMenuProvider, actionItemProvider: IActionItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment) {
|
||||
constructor(action: IAction, menuActions: IAction[], contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
|
||||
constructor(action: IAction, actionProvider: IActionProvider, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
|
||||
constructor(action: IAction, menuActionsOrProvider: any, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment) {
|
||||
super(null, action);
|
||||
|
||||
this.menuActionsOrProvider = menuActionsOrProvider;
|
||||
this.contextMenuProvider = contextMenuProvider;
|
||||
this.actionItemProvider = actionItemProvider;
|
||||
this.actionViewItemProvider = actionViewItemProvider;
|
||||
this.actionRunner = actionRunner;
|
||||
this.keybindings = keybindings;
|
||||
this.clazz = clazz;
|
||||
@@ -319,7 +319,7 @@ export class DropdownMenuActionItem extends BaseActionItem {
|
||||
this.dropdownMenu = this._register(new DropdownMenu(container, options));
|
||||
|
||||
this.dropdownMenu.menuOptions = {
|
||||
actionItemProvider: this.actionItemProvider,
|
||||
actionViewItemProvider: this.actionViewItemProvider,
|
||||
actionRunner: this.actionRunner,
|
||||
getKeyBinding: this.keybindings,
|
||||
context: this._context
|
||||
|
||||
@@ -150,7 +150,7 @@ export class InputBox extends Widget {
|
||||
let tagName = this.options.flexibleHeight ? 'textarea' : 'input';
|
||||
|
||||
let wrapper = dom.append(this.element, $('.wrapper'));
|
||||
this.input = <HTMLInputElement>dom.append(wrapper, $(tagName + '.input'));
|
||||
this.input = dom.append(wrapper, $(tagName + '.input'));
|
||||
this.input.setAttribute('autocorrect', 'off');
|
||||
this.input.setAttribute('autocapitalize', 'off');
|
||||
this.input.setAttribute('spellcheck', 'false');
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'vs/css!./menu';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { IActionRunner, IAction, Action } from 'vs/base/common/actions';
|
||||
import { ActionBar, IActionItemProvider, ActionsOrientation, Separator, ActionItem, IActionItemOptions, BaseActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ActionBar, IActionViewItemProvider, ActionsOrientation, Separator, ActionViewItem, IActionViewItemOptions, BaseActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { addClass, EventType, EventHelper, EventLike, removeTabIndexAndUpdateFocus, isAncestor, hasClass, addDisposableListener, removeClass, append, $, addClasses, removeClasses } from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
@@ -39,7 +39,7 @@ export const MENU_ESCAPED_MNEMONIC_REGEX: RegExp = createMenuEscapedMnemonicRegE
|
||||
|
||||
export interface IMenuOptions {
|
||||
context?: any;
|
||||
actionItemProvider?: IActionItemProvider;
|
||||
actionViewItemProvider?: IActionViewItemProvider;
|
||||
actionRunner?: IActionRunner;
|
||||
getKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;
|
||||
ariaLabel?: string;
|
||||
@@ -70,7 +70,7 @@ interface ISubMenuData {
|
||||
}
|
||||
|
||||
export class Menu extends ActionBar {
|
||||
private mnemonics: Map<string, Array<MenuActionItem>>;
|
||||
private mnemonics: Map<string, Array<BaseMenuActionViewItem>>;
|
||||
private menuDisposables: IDisposable[];
|
||||
private scrollableElement: DomScrollableElement;
|
||||
private menuElement: HTMLElement;
|
||||
@@ -88,7 +88,7 @@ export class Menu extends ActionBar {
|
||||
|
||||
super(menuElement, {
|
||||
orientation: ActionsOrientation.VERTICAL,
|
||||
actionItemProvider: action => this.doGetActionItem(action, options, parentData),
|
||||
actionViewItemProvider: action => this.doGetActionViewItem(action, options, parentData),
|
||||
context: options.context,
|
||||
actionRunner: options.actionRunner,
|
||||
ariaLabel: options.ariaLabel,
|
||||
@@ -113,7 +113,7 @@ export class Menu extends ActionBar {
|
||||
const actions = this.mnemonics.get(key)!;
|
||||
|
||||
if (actions.length === 1) {
|
||||
if (actions[0] instanceof SubmenuActionItem) {
|
||||
if (actions[0] instanceof SubmenuMenuActionViewItem) {
|
||||
this.focusItemByElement(actions[0].container);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ export class Menu extends ActionBar {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
|
||||
if (event.equals(KeyCode.Home) || event.equals(KeyCode.PageUp)) {
|
||||
this.focusedItem = this.items.length - 1;
|
||||
this.focusedItem = this.viewItems.length - 1;
|
||||
this.focusNext();
|
||||
EventHelper.stop(e, true);
|
||||
} else if (event.equals(KeyCode.End) || event.equals(KeyCode.PageDown)) {
|
||||
@@ -189,7 +189,7 @@ export class Menu extends ActionBar {
|
||||
parent: this
|
||||
};
|
||||
|
||||
this.mnemonics = new Map<string, Array<MenuActionItem>>();
|
||||
this.mnemonics = new Map<string, Array<BaseMenuActionViewItem>>();
|
||||
|
||||
this.push(actions, { icon: true, label: true, isMenu: true });
|
||||
|
||||
@@ -223,7 +223,7 @@ export class Menu extends ActionBar {
|
||||
container.appendChild(this.scrollableElement.getDomNode());
|
||||
this.scrollableElement.scanDomNode();
|
||||
|
||||
this.items.filter(item => !(item instanceof MenuSeparatorActionItem)).forEach((item: MenuActionItem, index: number, array: any[]) => {
|
||||
this.viewItems.filter(item => !(item instanceof MenuSeparatorActionViewItem)).forEach((item: BaseMenuActionViewItem, index: number, array: any[]) => {
|
||||
item.updatePositionInSet(index + 1, array.length);
|
||||
});
|
||||
}
|
||||
@@ -241,9 +241,9 @@ export class Menu extends ActionBar {
|
||||
this.domNode.style.backgroundColor = bgColor;
|
||||
container.style.boxShadow = shadow;
|
||||
|
||||
if (this.items) {
|
||||
this.items.forEach(item => {
|
||||
if (item instanceof MenuActionItem || item instanceof MenuSeparatorActionItem) {
|
||||
if (this.viewItems) {
|
||||
this.viewItems.forEach(item => {
|
||||
if (item instanceof BaseMenuActionViewItem || item instanceof MenuSeparatorActionViewItem) {
|
||||
item.style(style);
|
||||
}
|
||||
});
|
||||
@@ -263,12 +263,12 @@ export class Menu extends ActionBar {
|
||||
}
|
||||
|
||||
trigger(index: number): void {
|
||||
if (index <= this.items.length && index >= 0) {
|
||||
const item = this.items[index];
|
||||
if (item instanceof SubmenuActionItem) {
|
||||
if (index <= this.viewItems.length && index >= 0) {
|
||||
const item = this.viewItems[index];
|
||||
if (item instanceof SubmenuMenuActionViewItem) {
|
||||
super.focus(index);
|
||||
item.open(true);
|
||||
} else if (item instanceof MenuActionItem) {
|
||||
} else if (item instanceof BaseMenuActionViewItem) {
|
||||
super.run(item._action, item._context);
|
||||
} else {
|
||||
return;
|
||||
@@ -295,27 +295,27 @@ export class Menu extends ActionBar {
|
||||
}
|
||||
}
|
||||
|
||||
private doGetActionItem(action: IAction, options: IMenuOptions, parentData: ISubMenuData): BaseActionItem {
|
||||
private doGetActionViewItem(action: IAction, options: IMenuOptions, parentData: ISubMenuData): BaseActionViewItem {
|
||||
if (action instanceof Separator) {
|
||||
return new MenuSeparatorActionItem(options.context, action, { icon: true });
|
||||
return new MenuSeparatorActionViewItem(options.context, action, { icon: true });
|
||||
} else if (action instanceof SubmenuAction) {
|
||||
const menuActionItem = new SubmenuActionItem(action, action.entries, parentData, options);
|
||||
const menuActionViewItem = new SubmenuMenuActionViewItem(action, action.entries, parentData, options);
|
||||
|
||||
if (options.enableMnemonics) {
|
||||
const mnemonic = menuActionItem.getMnemonic();
|
||||
if (mnemonic && menuActionItem.isEnabled()) {
|
||||
let actionItems: MenuActionItem[] = [];
|
||||
const mnemonic = menuActionViewItem.getMnemonic();
|
||||
if (mnemonic && menuActionViewItem.isEnabled()) {
|
||||
let actionViewItems: BaseMenuActionViewItem[] = [];
|
||||
if (this.mnemonics.has(mnemonic)) {
|
||||
actionItems = this.mnemonics.get(mnemonic)!;
|
||||
actionViewItems = this.mnemonics.get(mnemonic)!;
|
||||
}
|
||||
|
||||
actionItems.push(menuActionItem);
|
||||
actionViewItems.push(menuActionViewItem);
|
||||
|
||||
this.mnemonics.set(mnemonic, actionItems);
|
||||
this.mnemonics.set(mnemonic, actionViewItems);
|
||||
}
|
||||
}
|
||||
|
||||
return menuActionItem;
|
||||
return menuActionViewItem;
|
||||
} else {
|
||||
const menuItemOptions: IMenuItemOptions = { enableMnemonics: options.enableMnemonics };
|
||||
if (options.getKeyBinding) {
|
||||
@@ -329,32 +329,32 @@ export class Menu extends ActionBar {
|
||||
}
|
||||
}
|
||||
|
||||
const menuActionItem = new MenuActionItem(options.context, action, menuItemOptions);
|
||||
const menuActionViewItem = new BaseMenuActionViewItem(options.context, action, menuItemOptions);
|
||||
|
||||
if (options.enableMnemonics) {
|
||||
const mnemonic = menuActionItem.getMnemonic();
|
||||
if (mnemonic && menuActionItem.isEnabled()) {
|
||||
let actionItems: MenuActionItem[] = [];
|
||||
const mnemonic = menuActionViewItem.getMnemonic();
|
||||
if (mnemonic && menuActionViewItem.isEnabled()) {
|
||||
let actionViewItems: BaseMenuActionViewItem[] = [];
|
||||
if (this.mnemonics.has(mnemonic)) {
|
||||
actionItems = this.mnemonics.get(mnemonic)!;
|
||||
actionViewItems = this.mnemonics.get(mnemonic)!;
|
||||
}
|
||||
|
||||
actionItems.push(menuActionItem);
|
||||
actionViewItems.push(menuActionViewItem);
|
||||
|
||||
this.mnemonics.set(mnemonic, actionItems);
|
||||
this.mnemonics.set(mnemonic, actionViewItems);
|
||||
}
|
||||
}
|
||||
|
||||
return menuActionItem;
|
||||
return menuActionViewItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface IMenuItemOptions extends IActionItemOptions {
|
||||
interface IMenuItemOptions extends IActionViewItemOptions {
|
||||
enableMnemonics?: boolean;
|
||||
}
|
||||
|
||||
class MenuActionItem extends BaseActionItem {
|
||||
class BaseMenuActionViewItem extends BaseActionViewItem {
|
||||
|
||||
public container: HTMLElement;
|
||||
|
||||
@@ -562,7 +562,7 @@ class MenuActionItem extends BaseActionItem {
|
||||
}
|
||||
}
|
||||
|
||||
class SubmenuActionItem extends MenuActionItem {
|
||||
class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
||||
private mysubmenu: Menu | null;
|
||||
private submenuContainer: HTMLElement | undefined;
|
||||
private submenuIndicator: HTMLElement;
|
||||
@@ -778,7 +778,7 @@ class SubmenuActionItem extends MenuActionItem {
|
||||
}
|
||||
}
|
||||
|
||||
class MenuSeparatorActionItem extends ActionItem {
|
||||
class MenuSeparatorActionViewItem extends ActionViewItem {
|
||||
style(style: IMenuStyles): void {
|
||||
this.label.style.borderBottomColor = style.separatorColor ? `${style.separatorColor}` : null;
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
|
||||
constructor() { }
|
||||
|
||||
renderTemplate(container: HTMLElement): any {
|
||||
const data = <ISelectListTemplateData>Object.create(null);
|
||||
renderTemplate(container: HTMLElement): ISelectListTemplateData {
|
||||
const data: ISelectListTemplateData = Object.create(null);
|
||||
data.disposables = [];
|
||||
data.root = container;
|
||||
data.text = dom.append(container, $('.option-text'));
|
||||
@@ -51,10 +51,10 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
}
|
||||
|
||||
renderElement(element: ISelectOptionItem, index: number, templateData: ISelectListTemplateData): void {
|
||||
const data = <ISelectListTemplateData>templateData;
|
||||
const text = (<ISelectOptionItem>element).text;
|
||||
const decoratorRight = (<ISelectOptionItem>element).decoratorRight;
|
||||
const isDisabled = (<ISelectOptionItem>element).isDisabled;
|
||||
const data: ISelectListTemplateData = templateData;
|
||||
const text = element.text;
|
||||
const decoratorRight = element.decoratorRight;
|
||||
const isDisabled = element.isDisabled;
|
||||
|
||||
data.text.textContent = text;
|
||||
data.decoratorRight.innerText = (!!decoratorRight ? decoratorRight : '');
|
||||
@@ -68,10 +68,10 @@ class SelectListRenderer implements IListRenderer<ISelectOptionItem, ISelectList
|
||||
|
||||
// pseudo-select disabled option
|
||||
if (isDisabled) {
|
||||
dom.addClass((<HTMLElement>data.root), 'option-disabled');
|
||||
dom.addClass(data.root, 'option-disabled');
|
||||
} else {
|
||||
// Make sure we do class removal from prior template rendering
|
||||
dom.removeClass((<HTMLElement>data.root), 'option-disabled');
|
||||
dom.removeClass(data.root, 'option-disabled');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,9 +820,9 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
||||
private renderDescriptionMarkdown(text: string): HTMLElement {
|
||||
const cleanRenderedMarkdown = (element: Node) => {
|
||||
for (let i = 0; i < element.childNodes.length; i++) {
|
||||
const child = element.childNodes.item(i);
|
||||
const child = <Element>element.childNodes.item(i);
|
||||
|
||||
const tagName = (<Element>child).tagName && (<Element>child).tagName.toLowerCase();
|
||||
const tagName = child.tagName && child.tagName.toLowerCase();
|
||||
if (tagName === 'img') {
|
||||
element.removeChild(child);
|
||||
} else {
|
||||
|
||||
@@ -234,8 +234,8 @@ export class SplitView extends Disposable {
|
||||
});
|
||||
|
||||
const sashEventMapper = this.orientation === Orientation.VERTICAL
|
||||
? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey } as ISashEvent)
|
||||
: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey } as ISashEvent);
|
||||
? (e: IBaseSashEvent) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey })
|
||||
: (e: IBaseSashEvent) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey });
|
||||
|
||||
const onStart = Event.map(sash.onDidStart, sashEventMapper);
|
||||
const onStartDisposable = onStart(this.onSashStart, this);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import 'vs/css!./toolbar';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action, IActionRunner, IAction } from 'vs/base/common/actions';
|
||||
import { ActionBar, ActionsOrientation, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IContextMenuProvider, DropdownMenuActionItem } from 'vs/base/browser/ui/dropdown/dropdown';
|
||||
import { ActionBar, ActionsOrientation, IActionViewItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IContextMenuProvider, DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdown';
|
||||
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
@@ -17,7 +17,7 @@ export const CONTEXT = 'context.toolbar';
|
||||
|
||||
export interface IToolBarOptions {
|
||||
orientation?: ActionsOrientation;
|
||||
actionItemProvider?: IActionItemProvider;
|
||||
actionViewItemProvider?: IActionViewItemProvider;
|
||||
ariaLabel?: string;
|
||||
getKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;
|
||||
actionRunner?: IActionRunner;
|
||||
@@ -32,7 +32,7 @@ export class ToolBar extends Disposable {
|
||||
private options: IToolBarOptions;
|
||||
private actionBar: ActionBar;
|
||||
private toggleMenuAction: ToggleMenuAction;
|
||||
private toggleMenuActionItem?: DropdownMenuActionItem;
|
||||
private toggleMenuActionViewItem?: DropdownMenuActionViewItem;
|
||||
private hasSecondaryActions: boolean;
|
||||
private lookupKeybindings: boolean;
|
||||
|
||||
@@ -42,7 +42,7 @@ export class ToolBar extends Disposable {
|
||||
this.options = options;
|
||||
this.lookupKeybindings = typeof this.options.getKeyBinding === 'function';
|
||||
|
||||
this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionItem && this.toggleMenuActionItem.show(), options.toggleMenuTitle));
|
||||
this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem && this.toggleMenuActionViewItem.show(), options.toggleMenuTitle));
|
||||
|
||||
let element = document.createElement('div');
|
||||
element.className = 'monaco-toolbar';
|
||||
@@ -52,33 +52,33 @@ export class ToolBar extends Disposable {
|
||||
orientation: options.orientation,
|
||||
ariaLabel: options.ariaLabel,
|
||||
actionRunner: options.actionRunner,
|
||||
actionItemProvider: (action: Action) => {
|
||||
actionViewItemProvider: (action: Action) => {
|
||||
|
||||
// Return special action item for the toggle menu action
|
||||
if (action.id === ToggleMenuAction.ID) {
|
||||
|
||||
// Dispose old
|
||||
if (this.toggleMenuActionItem) {
|
||||
this.toggleMenuActionItem.dispose();
|
||||
if (this.toggleMenuActionViewItem) {
|
||||
this.toggleMenuActionViewItem.dispose();
|
||||
}
|
||||
|
||||
// Create new
|
||||
this.toggleMenuActionItem = new DropdownMenuActionItem(
|
||||
this.toggleMenuActionViewItem = new DropdownMenuActionViewItem(
|
||||
action,
|
||||
(<ToggleMenuAction>action).menuActions,
|
||||
contextMenuProvider,
|
||||
this.options.actionItemProvider,
|
||||
this.options.actionViewItemProvider,
|
||||
this.actionRunner,
|
||||
this.options.getKeyBinding,
|
||||
'toolbar-toggle-more',
|
||||
this.options.anchorAlignmentProvider
|
||||
);
|
||||
this.toggleMenuActionItem!.setActionContext(this.actionBar.context);
|
||||
this.toggleMenuActionViewItem!.setActionContext(this.actionBar.context);
|
||||
|
||||
return this.toggleMenuActionItem;
|
||||
return this.toggleMenuActionViewItem;
|
||||
}
|
||||
|
||||
return options.actionItemProvider ? options.actionItemProvider(action) : undefined;
|
||||
return options.actionViewItemProvider ? options.actionViewItemProvider(action) : undefined;
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -93,8 +93,8 @@ export class ToolBar extends Disposable {
|
||||
|
||||
set context(context: any) {
|
||||
this.actionBar.context = context;
|
||||
if (this.toggleMenuActionItem) {
|
||||
this.toggleMenuActionItem.setActionContext(context);
|
||||
if (this.toggleMenuActionViewItem) {
|
||||
this.toggleMenuActionViewItem.setActionContext(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,9 +156,9 @@ export class ToolBar extends Disposable {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
if (this.toggleMenuActionItem) {
|
||||
this.toggleMenuActionItem.dispose();
|
||||
this.toggleMenuActionItem = undefined;
|
||||
if (this.toggleMenuActionViewItem) {
|
||||
this.toggleMenuActionViewItem.dispose();
|
||||
this.toggleMenuActionViewItem = undefined;
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
|
||||
@@ -29,7 +29,7 @@ export interface IActionRunner extends IDisposable {
|
||||
onDidBeforeRun: Event<IRunEvent>;
|
||||
}
|
||||
|
||||
export interface IActionItem {
|
||||
export interface IActionViewItem {
|
||||
actionRunner: IActionRunner;
|
||||
setActionContext(context: any): void;
|
||||
render(element: any /* HTMLElement */): void;
|
||||
|
||||
@@ -79,7 +79,7 @@ export function getFirstFrame(arg0: IRemoteConsoleLog | string | undefined): ISt
|
||||
uri: URI.file(matches[1]),
|
||||
line: Number(matches[2]),
|
||||
column: Number(matches[3])
|
||||
} as IStackFrame;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,19 +139,22 @@ export function isUNC(path: string): boolean {
|
||||
}
|
||||
|
||||
// Reference: https://en.wikipedia.org/wiki/Filename
|
||||
const INVALID_FILE_CHARS = isWindows ? /[\\/:\*\?"<>\|]/g : /[\\/]/g;
|
||||
const WINDOWS_INVALID_FILE_CHARS = /[\\/:\*\?"<>\|]/g;
|
||||
const UNIX_INVALID_FILE_CHARS = /[\\/]/g;
|
||||
const WINDOWS_FORBIDDEN_NAMES = /^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])$/i;
|
||||
export function isValidBasename(name: string | null | undefined): boolean {
|
||||
export function isValidBasename(name: string | null | undefined, isWindowsOS: boolean = isWindows): boolean {
|
||||
const invalidFileChars = isWindowsOS ? WINDOWS_INVALID_FILE_CHARS : UNIX_INVALID_FILE_CHARS;
|
||||
|
||||
if (!name || name.length === 0 || /^\s+$/.test(name)) {
|
||||
return false; // require a name that is not just whitespace
|
||||
}
|
||||
|
||||
INVALID_FILE_CHARS.lastIndex = 0; // the holy grail of software development
|
||||
if (INVALID_FILE_CHARS.test(name)) {
|
||||
invalidFileChars.lastIndex = 0; // the holy grail of software development
|
||||
if (invalidFileChars.test(name)) {
|
||||
return false; // check for certain invalid file characters
|
||||
}
|
||||
|
||||
if (isWindows && WINDOWS_FORBIDDEN_NAMES.test(name)) {
|
||||
if (isWindowsOS && WINDOWS_FORBIDDEN_NAMES.test(name)) {
|
||||
return false; // check for certain invalid file names
|
||||
}
|
||||
|
||||
@@ -159,16 +162,16 @@ export function isValidBasename(name: string | null | undefined): boolean {
|
||||
return false; // check for reserved values
|
||||
}
|
||||
|
||||
if (isWindows && name[name.length - 1] === '.') {
|
||||
if (isWindowsOS && name[name.length - 1] === '.') {
|
||||
return false; // Windows: file cannot end with a "."
|
||||
}
|
||||
|
||||
if (isWindows && name.length !== name.trim().length) {
|
||||
if (isWindowsOS && name.length !== name.trim().length) {
|
||||
return false; // Windows: file cannot end with a whitespace
|
||||
}
|
||||
|
||||
if (name.length > 255) {
|
||||
return false; // most file systems do not allow files > 255 lenth
|
||||
return false; // most file systems do not allow files > 255 length
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -197,7 +197,11 @@ function guessMimeTypeByFirstline(firstLine: string): string | null {
|
||||
}
|
||||
|
||||
if (firstLine.length > 0) {
|
||||
for (const association of registeredAssociations) {
|
||||
|
||||
// We want to prioritize associations based on the order they are registered so that the last registered
|
||||
// association wins over all other. This is for https://github.com/Microsoft/vscode/issues/20074
|
||||
for (let i = registeredAssociations.length - 1; i >= 0; i--) {
|
||||
const association = registeredAssociations[i];
|
||||
if (!association.firstline) {
|
||||
continue;
|
||||
}
|
||||
@@ -230,10 +234,11 @@ export function isUnspecific(mime: string[] | string): boolean {
|
||||
* 2. Otherwise, if there are other extensions, suggest the first one.
|
||||
* 3. Otherwise, suggest the prefix.
|
||||
*/
|
||||
export function suggestFilename(langId: string | null, prefix: string): string {
|
||||
export function suggestFilename(mode: string | undefined, prefix: string): string {
|
||||
const extensions = registeredAssociations
|
||||
.filter(assoc => !assoc.userConfigured && assoc.extension && assoc.id === langId)
|
||||
.filter(assoc => !assoc.userConfigured && assoc.extension && assoc.id === mode)
|
||||
.map(assoc => assoc.extension);
|
||||
|
||||
const extensionsWithDotFirst = coalesce(extensions)
|
||||
.filter(assoc => startsWith(assoc, '.'));
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export function deepClone<T>(obj: T): T {
|
||||
return obj as any;
|
||||
}
|
||||
const result: any = Array.isArray(obj) ? [] : {};
|
||||
Object.keys(obj).forEach((key: string) => {
|
||||
Object.keys(obj as any).forEach((key: string) => {
|
||||
if (obj[key] && typeof obj[key] === 'object') {
|
||||
result[key] = deepClone(obj[key]);
|
||||
} else {
|
||||
|
||||
@@ -79,7 +79,7 @@ export abstract class Parser {
|
||||
this._problemReporter.fatal(message);
|
||||
}
|
||||
|
||||
protected static merge<T>(destination: T, source: T, overwrite: boolean): void {
|
||||
protected static merge<T extends object>(destination: T, source: T, overwrite: boolean): void {
|
||||
Object.keys(source).forEach((key: string) => {
|
||||
const destValue = destination[key];
|
||||
const sourceValue = source[key];
|
||||
|
||||
@@ -176,28 +176,46 @@ export function isAbsolutePath(resource: URI): boolean {
|
||||
/**
|
||||
* Returns true if the URI path has a trailing path separator
|
||||
*/
|
||||
export function hasTrailingPathSeparator(resource: URI): boolean {
|
||||
export function hasTrailingPathSeparator(resource: URI, sep: string = paths.sep): boolean {
|
||||
if (resource.scheme === Schemas.file) {
|
||||
const fsp = originalFSPath(resource);
|
||||
return fsp.length > extpath.getRoot(fsp).length && fsp[fsp.length - 1] === paths.sep;
|
||||
return fsp.length > extpath.getRoot(fsp).length && fsp[fsp.length - 1] === sep;
|
||||
} else {
|
||||
const p = resource.path;
|
||||
return p.length > 1 && p.charCodeAt(p.length - 1) === CharCode.Slash; // ignore the slash at offset 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Removes a trailing path seperator, if theres one.
|
||||
* Removes a trailing path separator, if there's one.
|
||||
* Important: Doesn't remove the first slash, it would make the URI invalid
|
||||
*/
|
||||
export function removeTrailingPathSeparator(resource: URI): URI {
|
||||
if (hasTrailingPathSeparator(resource)) {
|
||||
export function removeTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {
|
||||
if (hasTrailingPathSeparator(resource, sep)) {
|
||||
return resource.with({ path: resource.path.substr(0, resource.path.length - 1) });
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a trailing path separator to the URI if there isn't one already.
|
||||
* For example, c:\ would be unchanged, but c:\users would become c:\users\
|
||||
*/
|
||||
export function addTrailingPathSeparator(resource: URI, sep: string = paths.sep): URI {
|
||||
let isRootSep: boolean = false;
|
||||
if (resource.scheme === Schemas.file) {
|
||||
const fsp = originalFSPath(resource);
|
||||
isRootSep = ((fsp !== undefined) && (fsp.length === extpath.getRoot(fsp).length) && (fsp[fsp.length - 1] === sep));
|
||||
} else {
|
||||
sep = '/';
|
||||
const p = resource.path;
|
||||
isRootSep = p.length === 1 && p.charCodeAt(p.length - 1) === CharCode.Slash;
|
||||
}
|
||||
if (!isRootSep && !hasTrailingPathSeparator(resource, sep)) {
|
||||
return resource.with({ path: resource.path + '/' });
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a relative path between two URIs. If the URIs don't have the same schema or authority, `undefined` is returned.
|
||||
|
||||
@@ -233,7 +233,7 @@ export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {
|
||||
// We check against an empty string. If the regular expression doesn't advance
|
||||
// (e.g. ends in an endless loop) it will match an empty string.
|
||||
const match = regexp.exec('');
|
||||
return !!(match && <any>regexp.lastIndex === 0);
|
||||
return !!(match && regexp.lastIndex === 0);
|
||||
}
|
||||
|
||||
export function regExpContainsBackreference(regexpValue: string): boolean {
|
||||
|
||||
+12
-1
@@ -670,4 +670,15 @@ export async function mkdirp(path: string, mode?: number, token?: CancellationTo
|
||||
// Any other error
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// See https://github.com/Microsoft/vscode/issues/30180
|
||||
const WIN32_MAX_FILE_SIZE = 300 * 1024 * 1024; // 300 MB
|
||||
const GENERAL_MAX_FILE_SIZE = 16 * 1024 * 1024 * 1024; // 16 GB
|
||||
|
||||
// See https://github.com/v8/v8/blob/5918a23a3d571b9625e5cce246bdd5b46ff7cd8b/src/heap/heap.cc#L149
|
||||
const WIN32_MAX_HEAP_SIZE = 700 * 1024 * 1024; // 700 MB
|
||||
const GENERAL_MAX_HEAP_SIZE = 700 * 2 * 1024 * 1024; // 1400 MB
|
||||
|
||||
export const MAX_FILE_SIZE = process.arch === 'ia32' ? WIN32_MAX_FILE_SIZE : GENERAL_MAX_FILE_SIZE;
|
||||
export const MAX_HEAP_SIZE = process.arch === 'ia32' ? WIN32_MAX_HEAP_SIZE : GENERAL_MAX_HEAP_SIZE;
|
||||
@@ -159,7 +159,7 @@ export function asText(context: IRequestContext): Promise<string | null> {
|
||||
});
|
||||
}
|
||||
|
||||
export function asJson<T>(context: IRequestContext): Promise<T | null> {
|
||||
export function asJson<T = {}>(context: IRequestContext): Promise<T | null> {
|
||||
return new Promise((c, e) => {
|
||||
if (!isSuccess(context)) {
|
||||
return e('Server returned ' + context.res.statusCode);
|
||||
|
||||
@@ -218,7 +218,7 @@ class ProtocolReader extends Disposable {
|
||||
// save new state => next time will read the body
|
||||
this._state.readHead = false;
|
||||
this._state.readLen = buff.readUInt32BE(9);
|
||||
this._state.messageType = <ProtocolMessageType>buff.readUInt8(0);
|
||||
this._state.messageType = buff.readUInt8(0);
|
||||
this._state.id = buff.readUInt32BE(1);
|
||||
this._state.ack = buff.readUInt32BE(5);
|
||||
} else {
|
||||
|
||||
@@ -36,11 +36,11 @@ let IDS = 0;
|
||||
export class QuickOpenItemAccessorClass implements IItemAccessor<QuickOpenEntry> {
|
||||
|
||||
getItemLabel(entry: QuickOpenEntry): string | null {
|
||||
return entry.getLabel();
|
||||
return types.withUndefinedAsNull(entry.getLabel());
|
||||
}
|
||||
|
||||
getItemDescription(entry: QuickOpenEntry): string | null {
|
||||
return entry.getDescription();
|
||||
return types.withUndefinedAsNull(entry.getDescription());
|
||||
}
|
||||
|
||||
getItemPath(entry: QuickOpenEntry): string | undefined {
|
||||
@@ -75,15 +75,15 @@ export class QuickOpenEntry {
|
||||
/**
|
||||
* The label of the entry to identify it from others in the list
|
||||
*/
|
||||
getLabel(): string | null {
|
||||
return null;
|
||||
getLabel(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The options for the label to use for this entry
|
||||
*/
|
||||
getLabelOptions(): IIconLabelValueOptions | null {
|
||||
return null;
|
||||
getLabelOptions(): IIconLabelValueOptions | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,51 +97,51 @@ export class QuickOpenEntry {
|
||||
/**
|
||||
* Detail information about the entry that is optional and can be shown below the label
|
||||
*/
|
||||
getDetail(): string | null {
|
||||
return null;
|
||||
getDetail(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The icon of the entry to identify it from others in the list
|
||||
*/
|
||||
getIcon(): string | null {
|
||||
return null;
|
||||
getIcon(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* A secondary description that is optional and can be shown right to the label
|
||||
*/
|
||||
getDescription(): string | null {
|
||||
return null;
|
||||
getDescription(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* A tooltip to show when hovering over the entry.
|
||||
*/
|
||||
getTooltip(): string | null {
|
||||
return null;
|
||||
getTooltip(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* A tooltip to show when hovering over the description portion of the entry.
|
||||
*/
|
||||
getDescriptionTooltip(): string | null {
|
||||
return null;
|
||||
getDescriptionTooltip(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* An optional keybinding to show for an entry.
|
||||
*/
|
||||
getKeybinding(): ResolvedKeybinding | null {
|
||||
return null;
|
||||
getKeybinding(): ResolvedKeybinding | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* A resource for this entry. Resource URIs can be used to compare different kinds of entries and group
|
||||
* them together.
|
||||
*/
|
||||
getResource(): URI | null {
|
||||
return null;
|
||||
getResource(): URI | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,11 +229,11 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
|
||||
this.withBorder = showBorder;
|
||||
}
|
||||
|
||||
getLabel(): string | null {
|
||||
getLabel(): string | undefined {
|
||||
return this.entry ? this.entry.getLabel() : super.getLabel();
|
||||
}
|
||||
|
||||
getLabelOptions(): IIconLabelValueOptions | null {
|
||||
getLabelOptions(): IIconLabelValueOptions | undefined {
|
||||
return this.entry ? this.entry.getLabelOptions() : super.getLabelOptions();
|
||||
}
|
||||
|
||||
@@ -241,19 +241,19 @@ export class QuickOpenEntryGroup extends QuickOpenEntry {
|
||||
return this.entry ? this.entry.getAriaLabel() : super.getAriaLabel();
|
||||
}
|
||||
|
||||
getDetail(): string | null {
|
||||
getDetail(): string | undefined {
|
||||
return this.entry ? this.entry.getDetail() : super.getDetail();
|
||||
}
|
||||
|
||||
getResource(): URI | null {
|
||||
getResource(): URI | undefined {
|
||||
return this.entry ? this.entry.getResource() : super.getResource();
|
||||
}
|
||||
|
||||
getIcon(): string | null {
|
||||
getIcon(): string | undefined {
|
||||
return this.entry ? this.entry.getIcon() : super.getIcon();
|
||||
}
|
||||
|
||||
getDescription(): string | null {
|
||||
getDescription(): string | undefined {
|
||||
return this.entry ? this.entry.getDescription() : super.getDescription();
|
||||
}
|
||||
|
||||
@@ -459,13 +459,13 @@ class Renderer implements IRenderer<QuickOpenEntry> {
|
||||
// Label
|
||||
const options: IIconLabelValueOptions = entry.getLabelOptions() || Object.create(null);
|
||||
options.matches = labelHighlights || [];
|
||||
options.title = types.withNullAsUndefined(entry.getTooltip());
|
||||
options.descriptionTitle = entry.getDescriptionTooltip() || types.withNullAsUndefined(entry.getDescription()); // tooltip over description because it could overflow
|
||||
options.title = entry.getTooltip();
|
||||
options.descriptionTitle = entry.getDescriptionTooltip() || entry.getDescription(); // tooltip over description because it could overflow
|
||||
options.descriptionMatches = descriptionHighlights || [];
|
||||
data.label.setLabel(types.withNullAsUndefined(entry.getLabel()), types.withNullAsUndefined(entry.getDescription()), options);
|
||||
data.label.setLabel(types.withNullAsUndefined(entry.getLabel()), entry.getDescription(), options);
|
||||
|
||||
// Meta
|
||||
data.detail.set(types.withNullAsUndefined(entry.getDetail()), detailHighlights);
|
||||
data.detail.set(entry.getDetail(), detailHighlights);
|
||||
|
||||
// Keybinding
|
||||
data.keybinding.set(entry.getKeybinding()!);
|
||||
@@ -556,7 +556,7 @@ export class QuickOpenModel implements
|
||||
}
|
||||
|
||||
getLabel(entry: QuickOpenEntry): string | null {
|
||||
return entry.getLabel();
|
||||
return types.withUndefinedAsNull(entry.getLabel());
|
||||
}
|
||||
|
||||
getAriaLabel(entry: QuickOpenEntry): string {
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as assert from 'assert';
|
||||
import { guessMimeTypes, registerTextMime, suggestFilename } from 'vs/base/common/mime';
|
||||
|
||||
suite('Mime', () => {
|
||||
|
||||
test('Dynamically Register Text Mime', () => {
|
||||
let guess = guessMimeTypes('foo.monaco');
|
||||
assert.deepEqual(guess, ['application/unknown']);
|
||||
@@ -56,6 +57,11 @@ suite('Mime', () => {
|
||||
registerTextMime({ id: 'docker', filepattern: 'dockerfile*', mime: 'text/looser' });
|
||||
guess = guessMimeTypes('dockerfile');
|
||||
assert.deepEqual(guess, ['text/winner', 'text/plain']);
|
||||
|
||||
registerTextMime({ id: 'azure-looser', mime: 'text/azure-looser', firstline: /azure/ });
|
||||
registerTextMime({ id: 'azure-winner', mime: 'text/azure-winner', firstline: /azure/ });
|
||||
guess = guessMimeTypes('azure', 'azure');
|
||||
assert.deepEqual(guess, ['text/azure-winner', 'text/plain']);
|
||||
});
|
||||
|
||||
test('Specificity priority 1', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { dirname, basename, distinctParents, joinPath, isEqual, isEqualOrParent, hasToIgnoreCase, normalizePath, isAbsolutePath, relativePath, removeTrailingPathSeparator, hasTrailingPathSeparator, resolvePath } from 'vs/base/common/resources';
|
||||
import { dirname, basename, distinctParents, joinPath, isEqual, isEqualOrParent, hasToIgnoreCase, normalizePath, isAbsolutePath, relativePath, removeTrailingPathSeparator, hasTrailingPathSeparator, resolvePath, addTrailingPathSeparator } from 'vs/base/common/resources';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { toSlashes } from 'vs/base/common/extpath';
|
||||
@@ -178,6 +178,9 @@ suite('Resources', () => {
|
||||
assertEqualURI(removeTrailingPathSeparator(u1), expected, u1.toString());
|
||||
}
|
||||
|
||||
function assertAddTrailingSeparator(u1: URI, expected: URI) {
|
||||
assertEqualURI(addTrailingPathSeparator(u1), expected, u1.toString());
|
||||
}
|
||||
|
||||
test('trailingPathSeparator', () => {
|
||||
assertTrailingSeparator(URI.parse('foo://a/foo'), false);
|
||||
@@ -190,6 +193,11 @@ suite('Resources', () => {
|
||||
assertRemoveTrailingSeparator(URI.parse('foo://a/'), URI.parse('foo://a/'));
|
||||
assertRemoveTrailingSeparator(URI.parse('foo://a'), URI.parse('foo://a'));
|
||||
|
||||
assertAddTrailingSeparator(URI.parse('foo://a/foo'), URI.parse('foo://a/foo/'));
|
||||
assertAddTrailingSeparator(URI.parse('foo://a/foo/'), URI.parse('foo://a/foo/'));
|
||||
assertAddTrailingSeparator(URI.parse('foo://a/'), URI.parse('foo://a/'));
|
||||
assertAddTrailingSeparator(URI.parse('foo://a'), URI.parse('foo://a/'));
|
||||
|
||||
if (isWindows) {
|
||||
assertTrailingSeparator(URI.file('c:\\a\\foo'), false);
|
||||
assertTrailingSeparator(URI.file('c:\\a\\foo\\'), true);
|
||||
@@ -202,6 +210,12 @@ suite('Resources', () => {
|
||||
assertRemoveTrailingSeparator(URI.file('c:\\'), URI.file('c:\\'));
|
||||
assertRemoveTrailingSeparator(URI.file('\\\\server\\share\\some\\'), URI.file('\\\\server\\share\\some'));
|
||||
assertRemoveTrailingSeparator(URI.file('\\\\server\\share\\'), URI.file('\\\\server\\share\\'));
|
||||
|
||||
assertAddTrailingSeparator(URI.file('c:\\a\\foo'), URI.file('c:\\a\\foo\\'));
|
||||
assertAddTrailingSeparator(URI.file('c:\\a\\foo\\'), URI.file('c:\\a\\foo\\'));
|
||||
assertAddTrailingSeparator(URI.file('c:\\'), URI.file('c:\\'));
|
||||
assertAddTrailingSeparator(URI.file('\\\\server\\share\\some'), URI.file('\\\\server\\share\\some\\'));
|
||||
assertAddTrailingSeparator(URI.file('\\\\server\\share\\some\\'), URI.file('\\\\server\\share\\some\\'));
|
||||
} else {
|
||||
assertTrailingSeparator(URI.file('/foo/bar'), false);
|
||||
assertTrailingSeparator(URI.file('/foo/bar/'), true);
|
||||
@@ -210,12 +224,16 @@ suite('Resources', () => {
|
||||
assertRemoveTrailingSeparator(URI.file('/foo/bar'), URI.file('/foo/bar'));
|
||||
assertRemoveTrailingSeparator(URI.file('/foo/bar/'), URI.file('/foo/bar'));
|
||||
assertRemoveTrailingSeparator(URI.file('/'), URI.file('/'));
|
||||
|
||||
assertAddTrailingSeparator(URI.file('/foo/bar'), URI.file('/foo/bar/'));
|
||||
assertAddTrailingSeparator(URI.file('/foo/bar/'), URI.file('/foo/bar/'));
|
||||
assertAddTrailingSeparator(URI.file('/'), URI.file('/'));
|
||||
}
|
||||
});
|
||||
|
||||
function assertEqualURI(actual: URI, expected: URI, message?: string) {
|
||||
if (!isEqual(expected, actual)) {
|
||||
assert.equal(expected.toString(), actual.toString(), message);
|
||||
assert.equal(actual.toString(), expected.toString(), message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ suite('Config', () => {
|
||||
const newDir = path.join(parentDir, 'config', id);
|
||||
const testFile = path.join(newDir, 'config.json');
|
||||
|
||||
let watcher = new ConfigWatcher(testFile);
|
||||
let watcher = new ConfigWatcher<{}>(testFile);
|
||||
|
||||
let config = watcher.getConfig();
|
||||
assert.ok(config);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
</head>
|
||||
<body class="vs-dark" aria-label="">
|
||||
</body>
|
||||
|
||||
<!-- Startup via workbench.js -->
|
||||
<script src="../../../../../out/vs/code/browser/workbench/workbench.js"></script>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
function loadScript(path, callback) {
|
||||
let script = document.createElement('script');
|
||||
script.onload = callback;
|
||||
script.async = true;
|
||||
script.type = 'text/javascript';
|
||||
script.src = path;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
loadScript('../../../../../out/vs/loader.js', function () {
|
||||
|
||||
// @ts-ignore
|
||||
require.config({
|
||||
baseUrl: `${window.location.origin}/out`
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
require([
|
||||
'vs/workbench/workbench.web.main',
|
||||
'vs/nls!vs/workbench/workbench.web.main',
|
||||
'vs/css!vs/workbench/workbench.web.main'
|
||||
],
|
||||
// @ts-ignore
|
||||
function () {
|
||||
|
||||
// @ts-ignore
|
||||
require('vs/workbench/browser/web.main').main().then(undefined, console.error);
|
||||
});
|
||||
});
|
||||
})();
|
||||
@@ -87,8 +87,8 @@ function showPartsSplash(configuration) {
|
||||
const style = document.createElement('style');
|
||||
style.className = 'initialShellColors';
|
||||
document.head.appendChild(style);
|
||||
document.body.className = `monaco-shell ${baseTheme}`;
|
||||
style.innerHTML = `.monaco-shell { background-color: ${shellBackground}; color: ${shellForeground}; }`;
|
||||
document.body.className = baseTheme;
|
||||
style.innerHTML = `body { background-color: ${shellBackground}; color: ${shellForeground}; }`;
|
||||
|
||||
if (data && data.layoutInfo) {
|
||||
// restore parts if possible (we might not always store layout info)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body class="monaco-shell vs-dark" aria-label="">
|
||||
</body>
|
||||
|
||||
<!-- Startup via workbench.nodeless.js -->
|
||||
<script src="workbench.nodeless.js"></script>
|
||||
</html>
|
||||
@@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
function uriFromPath(_path) {
|
||||
let pathName = _path.replace(/\\/g, '/');
|
||||
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
|
||||
pathName = '/' + pathName;
|
||||
}
|
||||
|
||||
let uri;
|
||||
if (navigator.userAgent.indexOf('Windows') >= 0 && pathName.startsWith('//')) { // specially handle Windows UNC paths
|
||||
uri = encodeURI('file:' + pathName);
|
||||
} else {
|
||||
uri = encodeURI('file://' + pathName);
|
||||
}
|
||||
|
||||
return uri.replace(/#/g, '%23');
|
||||
}
|
||||
|
||||
function parseURLQueryArgs() {
|
||||
const search = window.location.search || '';
|
||||
|
||||
return search.split(/[?&]/)
|
||||
.filter(function (param) { return !!param; })
|
||||
.map(function (param) { return param.split('='); })
|
||||
.filter(function (param) { return param.length === 2; })
|
||||
.reduce(function (r, param) { r[param[0]] = decodeURIComponent(param[1]); return r; }, {});
|
||||
}
|
||||
|
||||
function loadScript(path, callback) {
|
||||
let script = document.createElement('script');
|
||||
script.onload = callback;
|
||||
script.async = true;
|
||||
script.type = 'text/javascript';
|
||||
script.src = path;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
loadScript('../../../../../out/vs/loader.js', function () {
|
||||
|
||||
const args = parseURLQueryArgs();
|
||||
const configuration = JSON.parse(args['config'] || '{}') || {};
|
||||
|
||||
// @ts-ignore
|
||||
require.config({
|
||||
baseUrl: uriFromPath(configuration.appRoot) + '/out',
|
||||
});
|
||||
|
||||
// @ts-ignore
|
||||
require([
|
||||
'vs/workbench/workbench.nodeless.main',
|
||||
'vs/nls!vs/workbench/workbench.nodeless.main',
|
||||
'vs/css!vs/workbench/workbench.nodeless.main'
|
||||
], function () {
|
||||
|
||||
// @ts-ignore
|
||||
require('vs/workbench/browser/nodeless.main').main().then(undefined, console.error);
|
||||
});
|
||||
});
|
||||
})();
|
||||
@@ -234,7 +234,7 @@ export class CodeApplication extends Disposable {
|
||||
|
||||
ipc.on('vscode:fetchShellEnv', (event: Event) => {
|
||||
const webContents = event.sender;
|
||||
getShellEnvironment().then(shellEnv => {
|
||||
getShellEnvironment(this.logService).then(shellEnv => {
|
||||
if (!webContents.isDestroyed()) {
|
||||
webContents.send('vscode:acceptShellEnv', shellEnv);
|
||||
}
|
||||
@@ -678,7 +678,7 @@ export class CodeApplication extends Disposable {
|
||||
historyMainService.onRecentlyOpenedChange(() => historyMainService.updateWindowsJumpList());
|
||||
|
||||
// Start shared process after a while
|
||||
const sharedProcessSpawn = this._register(new RunOnceScheduler(() => getShellEnvironment().then(userEnv => this.sharedProcess.spawn(userEnv)), 3000));
|
||||
const sharedProcessSpawn = this._register(new RunOnceScheduler(() => getShellEnvironment(this.logService).then(userEnv => this.sharedProcess.spawn(userEnv)), 3000));
|
||||
sharedProcessSpawn.schedule();
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ function setupIPC(accessor: ServicesAccessor): Promise<Server> {
|
||||
logService.trace('Sending some foreground love to the running instance:', processId);
|
||||
|
||||
try {
|
||||
const { allowSetForegroundWindow } = <any>require.__$__nodeRequire('windows-foreground-love');
|
||||
const { allowSetForegroundWindow } = require.__$__nodeRequire('windows-foreground-love');
|
||||
allowSetForegroundWindow(processId);
|
||||
} catch (e) {
|
||||
// noop
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as objects from 'vs/base/common/objects';
|
||||
import * as nls from 'vs/nls';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IStateService } from 'vs/platform/state/common/state';
|
||||
import { screen, BrowserWindow, systemPreferences, app, TouchBar, nativeImage } from 'electron';
|
||||
import { screen, BrowserWindow, systemPreferences, app, TouchBar, nativeImage, Rectangle, Display } from 'electron';
|
||||
import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -25,7 +25,6 @@ import * as perf from 'vs/base/common/performance';
|
||||
import { resolveMarketplaceHeaders } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { getBackgroundColor } from 'vs/code/electron-main/theme';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { endsWith } from 'vs/base/common/strings';
|
||||
|
||||
export interface IWindowCreationOptions {
|
||||
@@ -80,8 +79,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
|
||||
private readonly touchBarGroups: Electron.TouchBarSegmentedControl[];
|
||||
|
||||
private nodeless: boolean;
|
||||
|
||||
constructor(
|
||||
config: IWindowCreationOptions,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@@ -98,8 +95,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
this._readyState = ReadyState.NONE;
|
||||
this.whenReadyCallbacks = [];
|
||||
|
||||
this.nodeless = !!(environmentService.args.nodeless && !environmentService.isBuilt);
|
||||
|
||||
// create browser window
|
||||
this.createBrowserWindow(config);
|
||||
|
||||
@@ -129,7 +124,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
height: this.windowState.height,
|
||||
x: this.windowState.x,
|
||||
y: this.windowState.y,
|
||||
backgroundColor: this.nodeless ? undefined : getBackgroundColor(this.stateService),
|
||||
backgroundColor: getBackgroundColor(this.stateService),
|
||||
minWidth: CodeWindow.MIN_WIDTH,
|
||||
minHeight: CodeWindow.MIN_HEIGHT,
|
||||
show: !isFullscreenOrMaximized,
|
||||
@@ -143,10 +138,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
}
|
||||
};
|
||||
|
||||
if (this.nodeless) {
|
||||
options.webPreferences!.nodeIntegration = false; // simulate Electron 5 behaviour
|
||||
}
|
||||
|
||||
if (isLinux) {
|
||||
options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s)
|
||||
}
|
||||
@@ -198,10 +189,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.nodeless) {
|
||||
this._win.webContents.toggleDevTools();
|
||||
}
|
||||
|
||||
this._lastFocusTime = Date.now(); // since we show directly, we need to set the last focus time too
|
||||
}
|
||||
|
||||
@@ -637,10 +624,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
}
|
||||
|
||||
private doGetUrl(config: object): string {
|
||||
if (this.nodeless) {
|
||||
return `${require.toUrl('vs/code/electron-browser/workbench/workbench.nodeless.html')}?config=${encodeURIComponent(JSON.stringify(config))}`;
|
||||
}
|
||||
|
||||
return `${require.toUrl('vs/code/electron-browser/workbench/workbench.html')}?config=${encodeURIComponent(JSON.stringify(config))}`;
|
||||
}
|
||||
|
||||
@@ -706,66 +689,55 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
private restoreWindowState(state?: IWindowState): IWindowState {
|
||||
if (state) {
|
||||
try {
|
||||
state = withNullAsUndefined(this.validateWindowState(state));
|
||||
state = this.validateWindowState(state);
|
||||
} catch (err) {
|
||||
this.logService.warn(`Unexpected error validating window state: ${err}\n${err.stack}`); // somehow display API can be picky about the state to validate
|
||||
}
|
||||
}
|
||||
|
||||
if (!state) {
|
||||
state = defaultWindowState();
|
||||
}
|
||||
|
||||
return state;
|
||||
return state || defaultWindowState();
|
||||
}
|
||||
|
||||
private validateWindowState(state: IWindowState): IWindowState | null {
|
||||
if (!state) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private validateWindowState(state: IWindowState): IWindowState | undefined {
|
||||
if (typeof state.x !== 'number'
|
||||
|| typeof state.y !== 'number'
|
||||
|| typeof state.width !== 'number'
|
||||
|| typeof state.height !== 'number'
|
||||
) {
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (state.width <= 0 || state.height <= 0) {
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const displays = screen.getAllDisplays();
|
||||
|
||||
// Single Monitor: be strict about x/y positioning
|
||||
if (displays.length === 1) {
|
||||
const displayBounds = displays[0].bounds;
|
||||
|
||||
// Careful with maximized: in that mode x/y can well be negative!
|
||||
if (state.mode !== WindowMode.Maximized && displayBounds.width > 0 && displayBounds.height > 0 /* Linux X11 sessions sometimes report wrong display bounds */) {
|
||||
if (state.x < displayBounds.x) {
|
||||
state.x = displayBounds.x; // prevent window from falling out of the screen to the left
|
||||
const displayWorkingArea = this.getWorkingArea(displays[0]);
|
||||
if (state.mode !== WindowMode.Maximized && displayWorkingArea) {
|
||||
if (state.x < displayWorkingArea.x) {
|
||||
state.x = displayWorkingArea.x; // prevent window from falling out of the screen to the left
|
||||
}
|
||||
|
||||
if (state.y < displayBounds.y) {
|
||||
state.y = displayBounds.y; // prevent window from falling out of the screen to the top
|
||||
if (state.y < displayWorkingArea.y) {
|
||||
state.y = displayWorkingArea.y; // prevent window from falling out of the screen to the top
|
||||
}
|
||||
|
||||
if (state.x > (displayBounds.x + displayBounds.width)) {
|
||||
state.x = displayBounds.x; // prevent window from falling out of the screen to the right
|
||||
if (state.x > (displayWorkingArea.x + displayWorkingArea.width)) {
|
||||
state.x = displayWorkingArea.x; // prevent window from falling out of the screen to the right
|
||||
}
|
||||
|
||||
if (state.y > (displayBounds.y + displayBounds.height)) {
|
||||
state.y = displayBounds.y; // prevent window from falling out of the screen to the bottom
|
||||
if (state.y > (displayWorkingArea.y + displayWorkingArea.height)) {
|
||||
state.y = displayWorkingArea.y; // prevent window from falling out of the screen to the bottom
|
||||
}
|
||||
|
||||
if (state.width > displayBounds.width) {
|
||||
state.width = displayBounds.width; // prevent window from exceeding display bounds width
|
||||
if (state.width > displayWorkingArea.width) {
|
||||
state.width = displayWorkingArea.width; // prevent window from exceeding display bounds width
|
||||
}
|
||||
|
||||
if (state.height > displayBounds.height) {
|
||||
state.height = displayBounds.height; // prevent window from exceeding display bounds height
|
||||
if (state.height > displayWorkingArea.height) {
|
||||
state.height = displayWorkingArea.height; // prevent window from exceeding display bounds height
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,12 +763,14 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
// Multi Monitor (non-fullscreen): be less strict because metrics can be crazy
|
||||
const bounds = { x: state.x, y: state.y, width: state.width, height: state.height };
|
||||
const display = screen.getDisplayMatching(bounds);
|
||||
const displayWorkingArea = this.getWorkingArea(display);
|
||||
if (
|
||||
display && // we have a display matching the desired bounds
|
||||
bounds.x < display.bounds.x + display.bounds.width && // prevent window from falling out of the screen to the right
|
||||
bounds.y < display.bounds.y + display.bounds.height && // prevent window from falling out of the screen to the bottom
|
||||
bounds.x + bounds.width > display.bounds.x && // prevent window from falling out of the screen to the left
|
||||
bounds.y + bounds.height > display.bounds.y // prevent window from falling out of the scree nto the top
|
||||
display && // we have a display matching the desired bounds
|
||||
displayWorkingArea && // we have valid working area bounds
|
||||
bounds.x < displayWorkingArea.x + displayWorkingArea.width && // prevent window from falling out of the screen to the right
|
||||
bounds.y < displayWorkingArea.y + displayWorkingArea.height && // prevent window from falling out of the screen to the bottom
|
||||
bounds.x + bounds.width > displayWorkingArea.x && // prevent window from falling out of the screen to the left
|
||||
bounds.y + bounds.height > displayWorkingArea.y // prevent window from falling out of the scree nto the top
|
||||
) {
|
||||
if (state.mode === WindowMode.Maximized) {
|
||||
const defaults = defaultWindowState(WindowMode.Maximized); // when maximized, make sure we have good values when the user restores the window
|
||||
@@ -809,7 +783,25 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
return state;
|
||||
}
|
||||
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private getWorkingArea(display: Display): Rectangle | undefined {
|
||||
|
||||
// Prefer the working area of the display to account for taskbars on the
|
||||
// desktop being positioned somewhere (https://github.com/Microsoft/vscode/issues/50830).
|
||||
//
|
||||
// Linux X11 sessions sometimes report wrong display bounds, so we validate
|
||||
// the reported sizes are positive.
|
||||
if (display.workArea.width > 0 && display.workArea.height > 0) {
|
||||
return display.workArea;
|
||||
}
|
||||
|
||||
if (display.bounds.width > 0 && display.bounds.height > 0) {
|
||||
return display.bounds;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getBounds(): Electron.Rectangle {
|
||||
|
||||
@@ -7,11 +7,16 @@ import * as cp from 'child_process';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
function getUnixShellEnvironment(logService: ILogService): Promise<typeof process.env> {
|
||||
const promise = new Promise<typeof process.env>((resolve, reject) => {
|
||||
const runAsNode = process.env['ELECTRON_RUN_AS_NODE'];
|
||||
logService.trace('getUnixShellEnvironment#runAsNode', runAsNode);
|
||||
|
||||
const noAttach = process.env['ELECTRON_NO_ATTACH_CONSOLE'];
|
||||
logService.trace('getUnixShellEnvironment#noAttach', noAttach);
|
||||
|
||||
const mark = generateUuid().replace(/-/g, '').substr(0, 12);
|
||||
const regex = new RegExp(mark + '(.*)' + mark);
|
||||
|
||||
@@ -21,6 +26,9 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
});
|
||||
|
||||
const command = `'${process.execPath}' -p '"${mark}" + JSON.stringify(process.env) + "${mark}"'`;
|
||||
logService.trace('getUnixShellEnvironment#env', env);
|
||||
logService.trace('getUnixShellEnvironment#spawn', command);
|
||||
|
||||
const child = cp.spawn(process.env.SHELL!, ['-ilc', command], {
|
||||
detached: true,
|
||||
stdio: ['ignore', 'pipe', process.stderr],
|
||||
@@ -37,6 +45,8 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
}
|
||||
|
||||
const raw = Buffer.concat(buffers).toString('utf8');
|
||||
logService.trace('getUnixShellEnvironment#raw', raw);
|
||||
|
||||
const match = regex.exec(raw);
|
||||
const rawStripped = match ? match[1] : '{}';
|
||||
|
||||
@@ -58,8 +68,10 @@ function getUnixShellEnvironment(): Promise<typeof process.env> {
|
||||
// https://github.com/Microsoft/vscode/issues/22593#issuecomment-336050758
|
||||
delete env['XDG_RUNTIME_DIR'];
|
||||
|
||||
logService.trace('getUnixShellEnvironment#result', env);
|
||||
resolve(env);
|
||||
} catch (err) {
|
||||
logService.error('getUnixShellEnvironment#error', err);
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
@@ -77,14 +89,17 @@ let _shellEnv: Promise<typeof process.env>;
|
||||
* This should only be done when Code itself is not launched
|
||||
* from within a shell.
|
||||
*/
|
||||
export function getShellEnvironment(): Promise<typeof process.env> {
|
||||
export function getShellEnvironment(logService: ILogService): Promise<typeof process.env> {
|
||||
if (_shellEnv === undefined) {
|
||||
if (isWindows) {
|
||||
logService.trace('getShellEnvironment: runing on windows, skipping');
|
||||
_shellEnv = Promise.resolve({});
|
||||
} else if (process.env['VSCODE_CLI'] === '1') {
|
||||
logService.trace('getShellEnvironment: runing on CLI, skipping');
|
||||
_shellEnv = Promise.resolve({});
|
||||
} else {
|
||||
_shellEnv = getUnixShellEnvironment();
|
||||
logService.trace('getShellEnvironment: running on Unix');
|
||||
_shellEnv = getUnixShellEnvironment(logService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,13 +301,13 @@ export namespace CoreNavigationCommands {
|
||||
export const MoveTo: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({
|
||||
id: '_moveTo',
|
||||
inSelectionMode: false,
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const MoveToSelect: CoreEditorCommand = registerEditorCommand(new BaseMoveToCommand({
|
||||
id: '_moveToSelect',
|
||||
inSelectionMode: true,
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
abstract class ColumnSelectCommand extends CoreEditorCommand {
|
||||
@@ -330,7 +330,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'columnSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'cursorColumnSelectLeft',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -373,7 +373,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'cursorColumnSelectRight',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -405,7 +405,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorColumnSelectUp: CoreEditorCommand = registerEditorCommand(new ColumnSelectUpCommand({
|
||||
isPaged: false,
|
||||
id: 'cursorColumnSelectUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -417,7 +417,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorColumnSelectPageUp: CoreEditorCommand = registerEditorCommand(new ColumnSelectUpCommand({
|
||||
isPaged: true,
|
||||
id: 'cursorColumnSelectPageUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -443,7 +443,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorColumnSelectDown: CoreEditorCommand = registerEditorCommand(new ColumnSelectDownCommand({
|
||||
isPaged: false,
|
||||
id: 'cursorColumnSelectDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -455,7 +455,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorColumnSelectPageDown: CoreEditorCommand = registerEditorCommand(new ColumnSelectDownCommand({
|
||||
isPaged: true,
|
||||
id: 'cursorColumnSelectPageDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -468,7 +468,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'cursorMove',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
description: CursorMove_.description
|
||||
});
|
||||
}
|
||||
@@ -531,7 +531,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorLeft',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -548,7 +548,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorLeftSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -564,7 +564,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorRight',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -581,7 +581,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorRightSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -597,7 +597,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -614,7 +614,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorUpSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -633,7 +633,7 @@ export namespace CoreNavigationCommands {
|
||||
value: Constants.PAGE_SIZE_MARKER
|
||||
},
|
||||
id: 'cursorPageUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -649,7 +649,7 @@ export namespace CoreNavigationCommands {
|
||||
value: Constants.PAGE_SIZE_MARKER
|
||||
},
|
||||
id: 'cursorPageUpSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -665,7 +665,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -682,7 +682,7 @@ export namespace CoreNavigationCommands {
|
||||
value: 1
|
||||
},
|
||||
id: 'cursorDownSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -701,7 +701,7 @@ export namespace CoreNavigationCommands {
|
||||
value: Constants.PAGE_SIZE_MARKER
|
||||
},
|
||||
id: 'cursorPageDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -717,7 +717,7 @@ export namespace CoreNavigationCommands {
|
||||
value: Constants.PAGE_SIZE_MARKER
|
||||
},
|
||||
id: 'cursorPageDownSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -729,7 +729,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'createCursor',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -790,7 +790,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: '_lastCursorMoveToSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -835,7 +835,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorHome: CoreEditorCommand = registerEditorCommand(new HomeCommand({
|
||||
inSelectionMode: false,
|
||||
id: 'cursorHome',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -847,7 +847,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorHomeSelect: CoreEditorCommand = registerEditorCommand(new HomeCommand({
|
||||
inSelectionMode: true,
|
||||
id: 'cursorHomeSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -860,7 +860,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'cursorLineStart',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -914,7 +914,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorEnd: CoreEditorCommand = registerEditorCommand(new EndCommand({
|
||||
inSelectionMode: false,
|
||||
id: 'cursorEnd',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -926,7 +926,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorEndSelect: CoreEditorCommand = registerEditorCommand(new EndCommand({
|
||||
inSelectionMode: true,
|
||||
id: 'cursorEndSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -939,7 +939,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'cursorLineEnd',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -994,7 +994,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorTop: CoreEditorCommand = registerEditorCommand(new TopCommand({
|
||||
inSelectionMode: false,
|
||||
id: 'cursorTop',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1006,7 +1006,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorTopSelect: CoreEditorCommand = registerEditorCommand(new TopCommand({
|
||||
inSelectionMode: true,
|
||||
id: 'cursorTopSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1038,7 +1038,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorBottom: CoreEditorCommand = registerEditorCommand(new BottomCommand({
|
||||
inSelectionMode: false,
|
||||
id: 'cursorBottom',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1050,7 +1050,7 @@ export namespace CoreNavigationCommands {
|
||||
export const CursorBottomSelect: CoreEditorCommand = registerEditorCommand(new BottomCommand({
|
||||
inSelectionMode: true,
|
||||
id: 'cursorBottomSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1063,7 +1063,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'editorScroll',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
description: EditorScroll_.description
|
||||
});
|
||||
}
|
||||
@@ -1134,7 +1134,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'scrollLineUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1159,7 +1159,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'scrollPageUp',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1185,7 +1185,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'scrollLineDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1210,7 +1210,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'scrollPageDown',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1257,20 +1257,20 @@ export namespace CoreNavigationCommands {
|
||||
export const WordSelect: CoreEditorCommand = registerEditorCommand(new WordCommand({
|
||||
inSelectionMode: false,
|
||||
id: '_wordSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const WordSelectDrag: CoreEditorCommand = registerEditorCommand(new WordCommand({
|
||||
inSelectionMode: true,
|
||||
id: '_wordSelectDrag',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const LastCursorWordSelect: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'lastCursorWordSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1317,13 +1317,13 @@ export namespace CoreNavigationCommands {
|
||||
export const LineSelect: CoreEditorCommand = registerEditorCommand(new LineCommand({
|
||||
inSelectionMode: false,
|
||||
id: '_lineSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const LineSelectDrag: CoreEditorCommand = registerEditorCommand(new LineCommand({
|
||||
inSelectionMode: true,
|
||||
id: '_lineSelectDrag',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
class LastCursorLineCommand extends CoreEditorCommand {
|
||||
@@ -1353,20 +1353,20 @@ export namespace CoreNavigationCommands {
|
||||
export const LastCursorLineSelect: CoreEditorCommand = registerEditorCommand(new LastCursorLineCommand({
|
||||
inSelectionMode: false,
|
||||
id: 'lastCursorLineSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const LastCursorLineSelectDrag: CoreEditorCommand = registerEditorCommand(new LastCursorLineCommand({
|
||||
inSelectionMode: true,
|
||||
id: 'lastCursorLineSelectDrag',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
}));
|
||||
|
||||
export const ExpandLineSelection: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'expandLineSelection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
weight: CORE_WEIGHT,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
@@ -1445,7 +1445,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'revealLine',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
description: RevealLine_.description
|
||||
});
|
||||
}
|
||||
@@ -1493,7 +1493,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'selectAll',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1513,7 +1513,7 @@ export namespace CoreNavigationCommands {
|
||||
constructor() {
|
||||
super({
|
||||
id: 'setSelection',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1728,7 +1728,7 @@ class EditorHandlerCommand extends Command {
|
||||
constructor(id: string, handlerId: string, description?: ICommandHandlerDescription) {
|
||||
super({
|
||||
id: id,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
description: description
|
||||
});
|
||||
this._handlerId = handlerId;
|
||||
|
||||
@@ -40,17 +40,17 @@ export interface ICommandMenubarOptions {
|
||||
}
|
||||
export interface ICommandOptions {
|
||||
id: string;
|
||||
precondition: ContextKeyExpr | null;
|
||||
kbOpts?: ICommandKeybindingsOptions | null;
|
||||
precondition: ContextKeyExpr | undefined;
|
||||
kbOpts?: ICommandKeybindingsOptions;
|
||||
description?: ICommandHandlerDescription;
|
||||
menubarOpts?: ICommandMenubarOptions;
|
||||
}
|
||||
export abstract class Command {
|
||||
public readonly id: string;
|
||||
public readonly precondition: ContextKeyExpr | null;
|
||||
private readonly _kbOpts: ICommandKeybindingsOptions | null | undefined;
|
||||
private readonly _menubarOpts: ICommandMenubarOptions | null | undefined;
|
||||
private readonly _description: ICommandHandlerDescription | null | undefined;
|
||||
public readonly precondition: ContextKeyExpr | undefined;
|
||||
private readonly _kbOpts: ICommandKeybindingsOptions | undefined;
|
||||
private readonly _menubarOpts: ICommandMenubarOptions | undefined;
|
||||
private readonly _description: ICommandHandlerDescription | undefined;
|
||||
|
||||
constructor(opts: ICommandOptions) {
|
||||
this.id = opts.id;
|
||||
|
||||
@@ -19,14 +19,11 @@ export function getIconClasses(modelService: IModelService, modeService: IModeSe
|
||||
|
||||
// Get the path and name of the resource. For data-URIs, we need to parse specially
|
||||
let name: string | undefined;
|
||||
let path: string | undefined;
|
||||
if (resource.scheme === Schemas.data) {
|
||||
const metadata = DataUri.parseMetaData(resource);
|
||||
name = metadata.get(DataUri.META_DATA_LABEL);
|
||||
path = name;
|
||||
} else {
|
||||
name = cssEscape(basenameOrAuthority(resource).toLowerCase());
|
||||
path = resource.path.toLowerCase();
|
||||
}
|
||||
|
||||
// Folders
|
||||
@@ -47,46 +44,60 @@ export function getIconClasses(modelService: IModelService, modeService: IModeSe
|
||||
classes.push(`ext-file-icon`); // extra segment to increase file-ext score
|
||||
}
|
||||
|
||||
// Configured Language
|
||||
let configuredLangId: string | null = getConfiguredLangId(modelService, modeService, resource);
|
||||
configuredLangId = configuredLangId || (path ? modeService.getModeIdByFilepathOrFirstLine(path) : null);
|
||||
if (configuredLangId) {
|
||||
classes.push(`${cssEscape(configuredLangId)}-lang-file-icon`);
|
||||
// Detected Mode
|
||||
const detectedModeId = detectModeId(modelService, modeService, resource);
|
||||
if (detectedModeId) {
|
||||
classes.push(`${cssEscape(detectedModeId)}-lang-file-icon`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return classes;
|
||||
}
|
||||
|
||||
export function getConfiguredLangId(modelService: IModelService, modeService: IModeService, resource: uri): string | null {
|
||||
let configuredLangId: string | null = null;
|
||||
if (resource) {
|
||||
let modeId: string | null = null;
|
||||
export function detectModeId(modelService: IModelService, modeService: IModeService, resource: uri): string | null {
|
||||
if (!resource) {
|
||||
return null; // we need a resource at least
|
||||
}
|
||||
|
||||
// Data URI: check for encoded metadata
|
||||
if (resource.scheme === Schemas.data) {
|
||||
const metadata = DataUri.parseMetaData(resource);
|
||||
const mime = metadata.get(DataUri.META_DATA_MIME);
|
||||
let modeId: string | null = null;
|
||||
|
||||
if (mime) {
|
||||
modeId = modeService.getModeId(mime);
|
||||
}
|
||||
}
|
||||
// Data URI: check for encoded metadata
|
||||
if (resource.scheme === Schemas.data) {
|
||||
const metadata = DataUri.parseMetaData(resource);
|
||||
const mime = metadata.get(DataUri.META_DATA_MIME);
|
||||
|
||||
// Any other URI: check for model if existing
|
||||
else {
|
||||
const model = modelService.getModel(resource);
|
||||
if (model) {
|
||||
modeId = model.getLanguageIdentifier().language;
|
||||
}
|
||||
}
|
||||
|
||||
if (modeId && modeId !== PLAINTEXT_MODE_ID) {
|
||||
configuredLangId = modeId; // only take if the mode is specific (aka no just plain text)
|
||||
if (mime) {
|
||||
modeId = modeService.getModeId(mime);
|
||||
}
|
||||
}
|
||||
|
||||
return configuredLangId;
|
||||
// Any other URI: check for model if existing
|
||||
else {
|
||||
const model = modelService.getModel(resource);
|
||||
if (model) {
|
||||
modeId = model.getModeId();
|
||||
}
|
||||
}
|
||||
|
||||
// only take if the mode is specific (aka no just plain text)
|
||||
if (modeId && modeId !== PLAINTEXT_MODE_ID) {
|
||||
return modeId;
|
||||
}
|
||||
|
||||
// otherwise fallback to path based detection
|
||||
let path: string | undefined;
|
||||
if (resource.scheme === Schemas.data) {
|
||||
const metadata = DataUri.parseMetaData(resource);
|
||||
path = metadata.get(DataUri.META_DATA_LABEL);
|
||||
} else {
|
||||
path = resource.path.toLowerCase();
|
||||
}
|
||||
|
||||
if (path) {
|
||||
return modeService.getModeIdByFilepathOrFirstLine(path);
|
||||
}
|
||||
|
||||
return null; // finally - we do not know the mode id
|
||||
}
|
||||
|
||||
export function cssEscape(val: string): string {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { IDisposable, IReference } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { ITextModel, ITextSnapshot } from 'vs/editor/common/model';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -46,6 +46,12 @@ export interface ITextEditorModel extends IEditorModel {
|
||||
*/
|
||||
readonly textEditorModel: ITextModel | null;
|
||||
|
||||
/**
|
||||
* Creates a snapshot of the model's contents.
|
||||
*/
|
||||
createSnapshot(this: IResolvedTextEditorModel): ITextSnapshot;
|
||||
createSnapshot(this: ITextEditorModel): ITextSnapshot | null;
|
||||
|
||||
isReadonly(): boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class JumpToBracketAction extends EditorAction {
|
||||
id: 'editor.action.jumpToBracket',
|
||||
label: nls.localize('smartSelect.jumpBracket', "Go to Bracket"),
|
||||
alias: 'Go to Bracket',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH,
|
||||
@@ -55,7 +55,7 @@ class SelectToBracketAction extends EditorAction {
|
||||
id: 'editor.action.selectToBracket',
|
||||
label: nls.localize('smartSelect.selectToBracket', "Select to Bracket"),
|
||||
alias: 'Select to Bracket',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ abstract class ExecCommandAction extends EditorAction {
|
||||
class ExecCommandCutAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_X,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_X, secondary: [KeyMod.Shift | KeyCode.Delete] },
|
||||
@@ -68,7 +68,7 @@ class ExecCommandCutAction extends ExecCommandAction {
|
||||
// Do not bind cut keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = null;
|
||||
kbOpts = undefined;
|
||||
}
|
||||
super('cut', {
|
||||
id: 'editor.action.clipboardCutAction',
|
||||
@@ -107,7 +107,7 @@ class ExecCommandCutAction extends ExecCommandAction {
|
||||
class ExecCommandCopyAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_C,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },
|
||||
@@ -116,14 +116,14 @@ class ExecCommandCopyAction extends ExecCommandAction {
|
||||
// Do not bind copy keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = null;
|
||||
kbOpts = undefined;
|
||||
}
|
||||
|
||||
super('copy', {
|
||||
id: 'editor.action.clipboardCopyAction',
|
||||
label: nls.localize('actions.clipboard.copyLabel', "Copy"),
|
||||
alias: 'Copy',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: kbOpts,
|
||||
menuOpts: {
|
||||
group: CLIPBOARD_CONTEXT_MENU_GROUP,
|
||||
@@ -162,7 +162,7 @@ class ExecCommandCopyAction extends ExecCommandAction {
|
||||
class ExecCommandPasteAction extends ExecCommandAction {
|
||||
|
||||
constructor() {
|
||||
let kbOpts: ICommandKeybindingsOptions | null = {
|
||||
let kbOpts: ICommandKeybindingsOptions | undefined = {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
|
||||
@@ -171,7 +171,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||
// Do not bind paste keybindings in the browser,
|
||||
// since browsers do that for us and it avoids security prompts
|
||||
if (!platform.isNative) {
|
||||
kbOpts = null;
|
||||
kbOpts = undefined;
|
||||
}
|
||||
|
||||
super('paste', {
|
||||
@@ -201,7 +201,7 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
|
||||
id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',
|
||||
label: nls.localize('actions.clipboard.copyWithSyntaxHighlightingLabel', "Copy With Syntax Highlighting"),
|
||||
alias: 'Copy With Syntax Highlighting',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
|
||||
@@ -76,9 +76,9 @@ export class ColorDetector implements IEditorContribution {
|
||||
}
|
||||
const languageId = model.getLanguageIdentifier();
|
||||
// handle deprecated settings. [languageId].colorDecorators.enable
|
||||
let deprecatedConfig = this._configurationService.getValue(languageId.language);
|
||||
const deprecatedConfig = this._configurationService.getValue<{}>(languageId.language);
|
||||
if (deprecatedConfig) {
|
||||
let colorDecorators = deprecatedConfig['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');
|
||||
const colorDecorators = deprecatedConfig['colorDecorators']; // deprecatedConfig.valueOf('.colorDecorators.enable');
|
||||
if (colorDecorators && colorDecorators['enable'] !== undefined && !colorDecorators['enable']) {
|
||||
return colorDecorators['enable'];
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ActionViewItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IAnchor } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { KeyCode, KeyMod, ResolvedKeybinding } from 'vs/base/common/keyCodes';
|
||||
@@ -176,18 +176,18 @@ export class ContextMenuController implements IEditorContribution {
|
||||
|
||||
getActions: () => actions,
|
||||
|
||||
getActionItem: (action) => {
|
||||
getActionViewItem: (action) => {
|
||||
const keybinding = this._keybindingFor(action);
|
||||
if (keybinding) {
|
||||
return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });
|
||||
return new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true });
|
||||
}
|
||||
|
||||
const customActionItem = <any>action;
|
||||
if (typeof customActionItem.getActionItem === 'function') {
|
||||
return customActionItem.getActionItem();
|
||||
const customActionViewItem = <any>action;
|
||||
if (typeof customActionViewItem.getActionViewItem === 'function') {
|
||||
return customActionViewItem.getActionViewItem();
|
||||
}
|
||||
|
||||
return new ActionItem(action, action, { icon: true, label: true, isMenu: true });
|
||||
return new ActionViewItem(action, action, { icon: true, label: true, isMenu: true });
|
||||
},
|
||||
|
||||
getKeyBinding: (action): ResolvedKeybinding | undefined => {
|
||||
@@ -228,7 +228,7 @@ class ShowContextMenu extends EditorAction {
|
||||
id: 'editor.action.showContextMenu',
|
||||
label: nls.localize('action.showContextMenu.label', "Show Editor Context Menu"),
|
||||
alias: 'Show Editor Context Menu',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.Shift | KeyCode.F10,
|
||||
|
||||
@@ -119,7 +119,7 @@ export class CursorUndo extends EditorAction {
|
||||
id: 'cursorUndo',
|
||||
label: nls.localize('cursor.undo', "Soft Undo"),
|
||||
alias: 'Soft Undo',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_U,
|
||||
|
||||
@@ -422,7 +422,7 @@ export class StartFindAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindAction,
|
||||
label: nls.localize('startFindAction', "Find"),
|
||||
alias: 'Find',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
@@ -459,7 +459,7 @@ export class StartFindWithSelectionAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindWithSelection,
|
||||
label: nls.localize('startFindWithSelectionAction', "Find With Selection"),
|
||||
alias: 'Find With Selection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: 0,
|
||||
@@ -513,7 +513,7 @@ export class NextMatchFindAction extends MatchFindAction {
|
||||
id: FIND_IDS.NextMatchFindAction,
|
||||
label: nls.localize('findNextMatchAction', "Find Next"),
|
||||
alias: 'Find Next',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyCode.F3,
|
||||
@@ -535,7 +535,7 @@ export class PreviousMatchFindAction extends MatchFindAction {
|
||||
id: FIND_IDS.PreviousMatchFindAction,
|
||||
label: nls.localize('findPreviousMatchAction', "Find Previous"),
|
||||
alias: 'Find Previous',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.Shift | KeyCode.F3,
|
||||
@@ -583,7 +583,7 @@ export class NextSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
id: FIND_IDS.NextSelectionMatchFindAction,
|
||||
label: nls.localize('nextSelectionMatchFindAction', "Find Next Selection"),
|
||||
alias: 'Find Next Selection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.F3,
|
||||
@@ -604,7 +604,7 @@ export class PreviousSelectionMatchFindAction extends SelectionMatchFindAction {
|
||||
id: FIND_IDS.PreviousSelectionMatchFindAction,
|
||||
label: nls.localize('previousSelectionMatchFindAction', "Find Previous Selection"),
|
||||
alias: 'Find Previous Selection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F3,
|
||||
@@ -625,7 +625,7 @@ export class StartFindReplaceAction extends EditorAction {
|
||||
id: FIND_IDS.StartFindReplaceAction,
|
||||
label: nls.localize('startReplace', "Replace"),
|
||||
alias: 'Replace',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_H,
|
||||
@@ -704,7 +704,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleCaseSensitiveCommand,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
handler: x => x.toggleCaseSensitive(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -718,7 +718,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleWholeWordCommand,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
handler: x => x.toggleWholeWords(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -732,7 +732,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleRegexCommand,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
handler: x => x.toggleRegex(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
@@ -746,7 +746,7 @@ registerEditorCommand(new FindCommand({
|
||||
|
||||
registerEditorCommand(new FindCommand({
|
||||
id: FIND_IDS.ToggleSearchScopeCommand,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
handler: x => x.toggleSearchScope(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 5,
|
||||
|
||||
@@ -503,7 +503,7 @@ class UnfoldAction extends FoldingAction<FoldingArguments> {
|
||||
id: 'editor.unfold',
|
||||
label: nls.localize('unfoldAction.label', "Unfold"),
|
||||
alias: 'Unfold',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_CLOSE_SQUARE_BRACKET,
|
||||
@@ -567,7 +567,7 @@ class UnFoldRecursivelyAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldRecursively',
|
||||
label: nls.localize('unFoldRecursivelyAction.label', "Unfold Recursively"),
|
||||
alias: 'Unfold Recursively',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_CLOSE_SQUARE_BRACKET),
|
||||
@@ -588,7 +588,7 @@ class FoldAction extends FoldingAction<FoldingArguments> {
|
||||
id: 'editor.fold',
|
||||
label: nls.localize('foldAction.label', "Fold"),
|
||||
alias: 'Fold',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_OPEN_SQUARE_BRACKET,
|
||||
@@ -652,7 +652,7 @@ class FoldRecursivelyAction extends FoldingAction<void> {
|
||||
id: 'editor.foldRecursively',
|
||||
label: nls.localize('foldRecursivelyAction.label', "Fold Recursively"),
|
||||
alias: 'Fold Recursively',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_OPEN_SQUARE_BRACKET),
|
||||
@@ -674,7 +674,7 @@ class FoldAllBlockCommentsAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAllBlockComments',
|
||||
label: nls.localize('foldAllBlockComments.label', "Fold All Block Comments"),
|
||||
alias: 'Fold All Block Comments',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.US_SLASH),
|
||||
@@ -707,7 +707,7 @@ class FoldAllRegionsAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAllMarkerRegions',
|
||||
label: nls.localize('foldAllMarkerRegions.label', "Fold All Regions"),
|
||||
alias: 'Fold All Regions',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_8),
|
||||
@@ -740,7 +740,7 @@ class UnfoldAllRegionsAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldAllMarkerRegions',
|
||||
label: nls.localize('unfoldAllMarkerRegions.label', "Unfold All Regions"),
|
||||
alias: 'Unfold All Regions',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_9),
|
||||
@@ -773,7 +773,7 @@ class FoldAllAction extends FoldingAction<void> {
|
||||
id: 'editor.foldAll',
|
||||
label: nls.localize('foldAllAction.label', "Fold All"),
|
||||
alias: 'Fold All',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_0),
|
||||
@@ -794,7 +794,7 @@ class UnfoldAllAction extends FoldingAction<void> {
|
||||
id: 'editor.unfoldAll',
|
||||
label: nls.localize('unfoldAllAction.label', "Unfold All"),
|
||||
alias: 'Unfold All',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_J),
|
||||
@@ -838,7 +838,7 @@ for (let i = 1; i <= 7; i++) {
|
||||
id: FoldLevelAction.ID(i),
|
||||
label: nls.localize('foldLevelAction.label', "Fold Level {0}", i),
|
||||
alias: `Fold Level ${i}`,
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | (KeyCode.KEY_0 + i)),
|
||||
|
||||
@@ -15,7 +15,7 @@ class EditorFontZoomIn extends EditorAction {
|
||||
id: 'editor.action.fontZoomIn',
|
||||
label: nls.localize('EditorFontZoomIn.label', "Editor Font Zoom In"),
|
||||
alias: 'Editor Font Zoom In',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class EditorFontZoomOut extends EditorAction {
|
||||
id: 'editor.action.fontZoomOut',
|
||||
label: nls.localize('EditorFontZoomOut.label', "Editor Font Zoom Out"),
|
||||
alias: 'Editor Font Zoom Out',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class EditorFontZoomReset extends EditorAction {
|
||||
id: 'editor.action.fontZoomReset',
|
||||
label: nls.localize('EditorFontZoomReset.label', "Editor Font Zoom Reset"),
|
||||
alias: 'Editor Font Zoom Reset',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
|
||||
|
||||
private gotoDefinition(target: IMouseTarget, sideBySide: boolean): Promise<any> {
|
||||
this.editor.setPosition(target.position!);
|
||||
const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: '', label: '', id: '', precondition: null });
|
||||
const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: '', label: '', id: '', precondition: undefined });
|
||||
return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor));
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ class ShowHoverAction extends EditorAction {
|
||||
]
|
||||
}, "Show Hover"),
|
||||
alias: 'Show Hover',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_I),
|
||||
|
||||
@@ -40,7 +40,6 @@ import { applyCodeAction, QuickFixAction } from 'vs/editor/contrib/codeAction/co
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model';
|
||||
|
||||
const $ = dom.$;
|
||||
@@ -68,14 +67,13 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
|
||||
|
||||
private readonly _editor: ICodeEditor;
|
||||
private _result: HoverPart[];
|
||||
private _range: Range | null;
|
||||
private _range?: Range;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
private readonly _markerDecorationsService: IMarkerDecorationsService
|
||||
) {
|
||||
this._editor = editor;
|
||||
this._range = null;
|
||||
}
|
||||
|
||||
setRange(range: Range): void {
|
||||
@@ -183,7 +181,7 @@ class ModesContentComputer implements IHoverComputer<HoverPart[]> {
|
||||
|
||||
private _getLoadingMessage(): HoverPart {
|
||||
return {
|
||||
range: withNullAsUndefined(this._range),
|
||||
range: this._range,
|
||||
contents: [new MarkdownString().appendText(nls.localize('modesContentHover.loading', "Loading..."))]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ export class IndentUsingTabs extends ChangeIndentationSizeAction {
|
||||
id: IndentUsingTabs.ID,
|
||||
label: nls.localize('indentUsingTabs', "Indent Using Tabs"),
|
||||
alias: 'Indent Using Tabs',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ export class IndentUsingSpaces extends ChangeIndentationSizeAction {
|
||||
id: IndentUsingSpaces.ID,
|
||||
label: nls.localize('indentUsingSpaces', "Indent Using Spaces"),
|
||||
alias: 'Indent Using Spaces',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -281,7 +281,7 @@ export class DetectIndentation extends EditorAction {
|
||||
id: DetectIndentation.ID,
|
||||
label: nls.localize('detectIndentation', "Detect Indentation from Content"),
|
||||
alias: 'Detect Indentation from Content',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ class OpenLinkAction extends EditorAction {
|
||||
id: 'editor.action.openLink',
|
||||
label: nls.localize('label', "Open Link"),
|
||||
alias: 'Open Link',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export class InsertCursorAbove extends EditorAction {
|
||||
id: 'editor.action.insertCursorAbove',
|
||||
label: nls.localize('mutlicursor.insertAbove', "Add Cursor Above"),
|
||||
alias: 'Add Cursor Above',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
|
||||
@@ -83,7 +83,7 @@ export class InsertCursorBelow extends EditorAction {
|
||||
id: 'editor.action.insertCursorBelow',
|
||||
label: nls.localize('mutlicursor.insertBelow', "Add Cursor Below"),
|
||||
alias: 'Add Cursor Below',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
|
||||
@@ -132,7 +132,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
||||
id: 'editor.action.insertCursorAtEndOfEachLineSelected',
|
||||
label: nls.localize('mutlicursor.insertAtEndOfEachLineSelected', "Add Cursors to Line Ends"),
|
||||
alias: 'Add Cursors to Line Ends',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I,
|
||||
@@ -184,7 +184,7 @@ class InsertCursorAtEndOfLineSelected extends EditorAction {
|
||||
id: 'editor.action.addCursorsToBottom',
|
||||
label: nls.localize('mutlicursor.addCursorsToBottom', "Add Cursors To Bottom"),
|
||||
alias: 'Add Cursors To Bottom',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ class InsertCursorAtTopOfLineSelected extends EditorAction {
|
||||
id: 'editor.action.addCursorsToTop',
|
||||
label: nls.localize('mutlicursor.addCursorsToTop', "Add Cursors To Top"),
|
||||
alias: 'Add Cursors To Top',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
||||
id: 'editor.action.addSelectionToNextFindMatch',
|
||||
label: nls.localize('addSelectionToNextFindMatch', "Add Selection To Next Find Match"),
|
||||
alias: 'Add Selection To Next Find Match',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_D,
|
||||
@@ -675,7 +675,7 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
|
||||
id: 'editor.action.addSelectionToPreviousFindMatch',
|
||||
label: nls.localize('addSelectionToPreviousFindMatch', "Add Selection To Previous Find Match"),
|
||||
alias: 'Add Selection To Previous Find Match',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
menubarOpts: {
|
||||
menuId: MenuId.MenubarSelectionMenu,
|
||||
group: '3_multi',
|
||||
@@ -695,7 +695,7 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
|
||||
id: 'editor.action.moveSelectionToNextFindMatch',
|
||||
label: nls.localize('moveSelectionToNextFindMatch', "Move Last Selection To Next Find Match"),
|
||||
alias: 'Move Last Selection To Next Find Match',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_D),
|
||||
@@ -714,7 +714,7 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
|
||||
id: 'editor.action.moveSelectionToPreviousFindMatch',
|
||||
label: nls.localize('moveSelectionToPreviousFindMatch', "Move Last Selection To Previous Find Match"),
|
||||
alias: 'Move Last Selection To Previous Find Match',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
protected _run(multiCursorController: MultiCursorSelectionController, findController: CommonFindController): void {
|
||||
@@ -728,7 +728,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
||||
id: 'editor.action.selectHighlights',
|
||||
label: nls.localize('selectAllOccurrencesOfFindMatch', "Select All Occurrences of Find Match"),
|
||||
alias: 'Select All Occurrences of Find Match',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_L,
|
||||
|
||||
@@ -161,7 +161,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
|
||||
id: 'editor.action.smartSelect.expand',
|
||||
label: nls.localize('smartSelect.expand', "Expand Selection"),
|
||||
alias: 'Expand Selection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.RightArrow,
|
||||
@@ -187,7 +187,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
|
||||
id: 'editor.action.smartSelect.shrink',
|
||||
label: nls.localize('smartSelect.shrink', "Shrink Selection"),
|
||||
alias: 'Shrink Selection',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.LeftArrow,
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ToggleTabFocusModeAction extends EditorAction {
|
||||
id: ToggleTabFocusModeAction.ID,
|
||||
label: nls.localize({ key: 'toggle.tabMovesFocus', comment: ['Turn on/off use of tab key for moving focus around VS Code'] }, "Toggle Tab Key Moves Focus"),
|
||||
alias: 'Toggle Tab Key Moves Focus',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: null,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_M,
|
||||
|
||||
@@ -14,7 +14,7 @@ class ForceRetokenizeAction extends EditorAction {
|
||||
id: 'editor.action.forceRetokenize',
|
||||
label: nls.localize('forceRetokenize', "Developer: Force Retokenize"),
|
||||
alias: 'Developer: Force Retokenize',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export class CursorWordStartLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartLeft',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.LeftArrow,
|
||||
@@ -115,7 +115,7 @@ export class CursorWordEndLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndLeft',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class CursorWordLeft extends WordLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStartFast,
|
||||
id: 'cursorWordLeft',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export class CursorWordStartLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartLeftSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.LeftArrow,
|
||||
@@ -154,7 +154,7 @@ export class CursorWordEndLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndLeftSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ export class CursorWordLeftSelect extends WordLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordLeftSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ export class CursorWordStartRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartRight',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export class CursorWordEndRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndRight',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.RightArrow,
|
||||
@@ -204,7 +204,7 @@ export class CursorWordRight extends WordRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordRight',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ export class CursorWordStartRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordStartRightSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ export class CursorWordEndRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordEndRightSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.RightArrow,
|
||||
@@ -243,7 +243,7 @@ export class CursorWordRightSelect extends WordRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordRightSelect',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class CursorWordPartLeft extends WordPartLeftCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordPartLeft',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -98,7 +98,7 @@ export class CursorWordPartLeftSelect extends WordPartLeftCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordStart,
|
||||
id: 'cursorWordPartLeftSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -122,7 +122,7 @@ export class CursorWordPartRight extends WordPartRightCommand {
|
||||
inSelectionMode: false,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordPartRight',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
@@ -138,7 +138,7 @@ export class CursorWordPartRightSelect extends WordPartRightCommand {
|
||||
inSelectionMode: true,
|
||||
wordNavigationType: WordNavigationType.WordEnd,
|
||||
id: 'cursorWordPartRightSelect',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: 0,
|
||||
|
||||
@@ -330,7 +330,7 @@ class ShowAccessibilityHelpAction extends EditorAction {
|
||||
id: 'editor.action.showAccessibilityHelp',
|
||||
label: AccessibilityHelpNLS.showAccessibilityHelpAction,
|
||||
alias: 'Show Accessibility Help',
|
||||
precondition: null,
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
primary: (browser.isIE ? KeyMod.CtrlCmd | KeyCode.F1 : KeyMod.Alt | KeyCode.F1),
|
||||
|
||||
@@ -84,7 +84,7 @@ class InspectTokens extends EditorAction {
|
||||
id: 'editor.action.inspectTokens',
|
||||
label: InspectTokensNLS.inspectTokensAction,
|
||||
alias: 'Developer: Inspect Tokens',
|
||||
precondition: null
|
||||
precondition: undefined
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user