diff --git a/.yarnrc b/.yarnrc index beab9f70b95..7e63643de04 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://atom.io/download/electron" -target "3.1.8" +target "4.2.3" runtime "electron" diff --git a/build/azure-pipelines/common/symbols.ts b/build/azure-pipelines/common/symbols.ts index 1a5125295f3..a42342ce7f7 100644 --- a/build/azure-pipelines/common/symbols.ts +++ b/build/azure-pipelines/common/symbols.ts @@ -36,7 +36,6 @@ export interface IVersionAccessor extends IApplicationAccessor { enum Platform { WIN_32 = 'win32-ia32', WIN_64 = 'win32-x64', - LINUX_32 = 'linux-ia32', LINUX_64 = 'linux-x64', MAC_OS = 'darwin-x64' } @@ -191,7 +190,7 @@ if (process.platform === 'darwin') { } else if (process.platform === 'win32') { platform = is64 ? Platform.WIN_64 : Platform.WIN_32; } else { - platform = is64 ? Platform.LINUX_64 : Platform.LINUX_32; + platform = Platform.LINUX_64; } // Create version and upload symbols in HockeyApp diff --git a/build/azure-pipelines/linux/product-build-linux.yml b/build/azure-pipelines/linux/product-build-linux.yml index 5ea5de8ade1..c1386b93f71 100644 --- a/build/azure-pipelines/linux/product-build-linux.yml +++ b/build/azure-pipelines/linux/product-build-linux.yml @@ -16,9 +16,6 @@ steps: - script: | set -e export npm_config_arch="$(VSCODE_ARCH)" - if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then - export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig" - fi cat << EOF > ~/.netrc machine monacotools.visualstudio.com diff --git a/build/azure-pipelines/linux/publish.sh b/build/azure-pipelines/linux/publish.sh index 0f864600bd3..a6b48389d58 100755 --- a/build/azure-pipelines/linux/publish.sh +++ b/build/azure-pipelines/linux/publish.sh @@ -5,8 +5,6 @@ ROOT="$REPO/.." # Publish tarball PLATFORM_LINUX="linux-$VSCODE_ARCH" -[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64" -[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64" BUILDNAME="VSCode-$PLATFORM_LINUX" BUILD="$ROOT/$BUILDNAME" BUILD_VERSION="$(date +%s)" @@ -39,7 +37,7 @@ node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_H # Publish DEB yarn gulp "vscode-linux-$VSCODE_ARCH-build-deb" PLATFORM_DEB="linux-deb-$VSCODE_ARCH" -[[ "$VSCODE_ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64" +DEB_ARCH="amd64" DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" @@ -48,7 +46,7 @@ node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" p # Publish RPM yarn gulp "vscode-linux-$VSCODE_ARCH-build-rpm" PLATFORM_RPM="linux-rpm-$VSCODE_ARCH" -[[ "$VSCODE_ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64" +RPM_ARCH="x86_64" RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 8b013cb9211..ac9ce03b593 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -3,9 +3,6 @@ resources: - container: vscode-x64 image: vscodehub.azurecr.io/vscode-linux-build-agent:x64 endpoint: VSCodeHub - - container: vscode-ia32 - image: vscodehub.azurecr.io/vscode-linux-build-agent:ia32 - endpoint: VSCodeHub - container: snapcraft image: snapcore/snapcraft @@ -49,16 +46,6 @@ jobs: steps: - template: linux/snap-build-linux.yml -- job: Linux32 - condition: eq(variables['VSCODE_BUILD_LINUX_32BIT'], 'true') - pool: - vmImage: 'Ubuntu-16.04' - variables: - VSCODE_ARCH: ia32 - container: vscode-ia32 - steps: - - template: linux/product-build-linux.yml - - job: LinuxArmhf condition: eq(variables['VSCODE_BUILD_LINUX_ARMHF'], 'true') pool: @@ -84,7 +71,6 @@ jobs: - Windows32 - Linux - LinuxSnap - - Linux32 - LinuxArmhf - macOS steps: diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 9b0abd18d9a..a718cfb0082 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -23,7 +23,7 @@ const commit = util.getVersion(root); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); function getDebPackageArch(arch) { - return { x64: 'amd64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch]; + return { x64: 'amd64', arm: 'armhf', arm64: "arm64" }[arch]; } function prepareDebPackage(arch) { @@ -114,7 +114,7 @@ function getRpmBuildPath(rpmArch) { } function getRpmPackageArch(arch) { - return { x64: 'x86_64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch]; + return { x64: 'x86_64', arm: 'armhf', arm64: "arm64" }[arch]; } function prepareRpmPackage(arch) { @@ -238,7 +238,6 @@ function buildSnapPackage(arch) { } const BUILD_TARGETS = [ - { arch: 'ia32' }, { arch: 'x64' }, { arch: 'arm' }, { arch: 'arm64' }, diff --git a/build/lib/electron.js b/build/lib/electron.js index 6387133675b..63e867a98fe 100644 --- a/build/lib/electron.js +++ b/build/lib/electron.js @@ -24,7 +24,7 @@ module.exports.getElectronVersion = getElectronVersion; if (require.main === module) { const version = getElectronVersion(); const versionFile = path.join(root, '.build', 'electron', 'version'); - const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `v${version}`; + const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`; process.exit(isUpToDate ? 0 : 1); } diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json index 22d3d165c3c..32b0e6fb4c7 100644 --- a/build/lib/i18n.resources.json +++ b/build/lib/i18n.resources.json @@ -38,10 +38,6 @@ "name": "vs/workbench/contrib/codeEditor", "project": "vscode-workbench" }, - { - "name": "vs/workbench/contrib/codeinset", - "project": "vscode-workbench" - }, { "name": "vs/workbench/contrib/callHierarchy", "project": "vscode-workbench" diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index ee75ac1ec01..9f53df17bad 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -25,7 +25,7 @@ function log(message: any, ...rest: any[]): void { export interface Language { id: string; // language id, e.g. zh-tw, de - translationId?: string; // language id used in translation tools, e.g zh-hant, de (optional, if not set, the id is used) + translationId?: string; // language id used in translation tools, e.g. zh-hant, de (optional, if not set, the id is used) folderName?: string; // language specific folder name, e.g. cht, deu (optional, if not set, the id is used) } diff --git a/build/package.json b/build/package.json index 49495b1c1e5..373323408b8 100644 --- a/build/package.json +++ b/build/package.json @@ -39,7 +39,7 @@ "minimist": "^1.2.0", "request": "^2.85.0", "tslint": "^5.9.1", - "typescript": "3.4.5", + "typescript": "3.5.1", "vsce": "1.48.0", "xml2js": "^0.4.17" }, diff --git a/build/yarn.lock b/build/yarn.lock index 3d6f612789b..da572cd1465 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -1894,10 +1894,10 @@ typed-rest-client@^0.9.0: tunnel "0.0.4" underscore "1.8.3" -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.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" + integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" diff --git a/cgmanifest.json b/cgmanifest.json index 406060f8a7a..6cebbffd6b9 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "chromium", "repositoryUrl": "https://chromium.googlesource.com/chromium/src", - "commitHash": "164c37e3f235134c88e80fac2a182cfba3f07f00" + "commitHash": "c6a08e5368de4352903e702cde750b33239a50ab" } }, "licenseDetail": [ @@ -40,20 +40,7 @@ "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ], "isOnlyProductionDependency": true, - "version": "66.0.3359.181" - }, - { - "component": { - "type": "git", - "git": { - "name": "libchromiumcontent", - "repositoryUrl": "https://github.com/electron/libchromiumcontent", - "commitHash": "7ea271f92018b1eeb8e70ec6de8c29f9758a0c05" - } - }, - "isOnlyProductionDependency": true, - "license": "MIT", - "version": "66.0.3359.181" + "version": "69.0.3497.128" }, { "component": { @@ -61,11 +48,11 @@ "git": { "name": "nodejs", "repositoryUrl": "https://github.com/nodejs/node", - "commitHash": "5cbb905c1af7cea2d709932d59827d7c6d03ef4a" + "commitHash": "8c70b2084ce5f76ea1e3b3c4ccdeee4483fe338b" } }, "isOnlyProductionDependency": true, - "version": "10.2.0" + "version": "10.11.0" }, { "component": { @@ -73,12 +60,12 @@ "git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", - "commitHash": "e84a6860e35e14b4031b88bb9b49841cdb89a305" + "commitHash": "c1b5a1cfc8a14a337540193daecfa5d0f50dd7bb" } }, "isOnlyProductionDependency": true, "license": "MIT", - "version": "3.1.8" + "version": "4.2.3" }, { "component": { diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json index e9f9e255f33..448d7481646 100644 --- a/extensions/configuration-editing/package.json +++ b/extensions/configuration-editing/package.json @@ -108,6 +108,6 @@ ] }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" } } diff --git a/extensions/configuration-editing/yarn.lock b/extensions/configuration-editing/yarn.lock index 49c47166066..ce653f097a9 100644 --- a/extensions/configuration-editing/yarn.lock +++ b/extensions/configuration-editing/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== jsonc-parser@2.0.2: version "2.0.2" diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index dcbf1f65e2f..f67719029ef 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/cpp-textmate-grammar", "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", - "commitHash": "e33a317ccd0babba4b07ffc042ab9796e6412ddc" + "commitHash": "85ef67461698ec3c0b64411a53705daa0b68fc13" } }, "license": "MIT", - "version": "1.8.15", + "version": "1.11.3", "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." }, { diff --git a/extensions/cpp/syntaxes/c.tmLanguage.json b/extensions/cpp/syntaxes/c.tmLanguage.json index 925c7bb92ac..ae463d31f62 100644 --- a/extensions/cpp/syntaxes/c.tmLanguage.json +++ b/extensions/cpp/syntaxes/c.tmLanguage.json @@ -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/e33a317ccd0babba4b07ffc042ab9796e6412ddc", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/f88ac364a66b447bc16b966a66af52ae8b31795c", "name": "C", "scopeName": "source.c", "patterns": [ @@ -17,6 +17,9 @@ { "include": "#preprocessor-rule-conditional" }, + { + "include": "#predefined_macros" + }, { "include": "#comments" }, @@ -559,10 +562,6 @@ }, "name": "comment.block.c" }, - { - "match": "\\*/.*\\n", - "name": "invalid.illegal.stray-comment-end.c" - }, { "captures": { "1": { @@ -2124,12 +2123,12 @@ "name": "keyword.control.switch.c" } }, - "end": "(?:(?<=\\})|(?=[;>\\[\\]=]))", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "patterns": [ { "name": "meta.head.switch.c", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.switch.c" @@ -2140,14 +2139,14 @@ "include": "#switch_conditional_parentheses" }, { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.body.switch.c", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.switch.c" @@ -2161,7 +2160,7 @@ "include": "#case_statement" }, { - "include": "$base" + "include": "#root_context" }, { "include": "#block_innards" @@ -2170,11 +2169,11 @@ }, { "name": "meta.tail.switch.c", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2236,7 +2235,7 @@ ] }, { - "include": "#function_call_context_c" + "include": "#function_call_context" } ] }, @@ -2292,7 +2291,7 @@ } }, "method_access": { - "contentName": "meta.function-call.member", + "contentName": "meta.function-call.member.c", "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", "beginCaptures": { "1": { @@ -2347,6 +2346,1026 @@ } ] }, + "predefined_macros": { + "patterns": [ + { + "match": "\\b__cplusplus\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus.c" + }, + { + "match": "\\b__DATE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__DATE__.c" + }, + { + "match": "\\b__FILE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FILE__.c" + }, + { + "match": "\\b__LINE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LINE__.c" + }, + { + "match": "\\b__STDC__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STDC__.c" + }, + { + "match": "\\b__STDC_HOSTED__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STDC_HOSTED__.c" + }, + { + "match": "\\b__STDC_NO_COMPLEX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STDC_NO_COMPLEX__.c" + }, + { + "match": "\\b__STDC_VERSION__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STDC_VERSION__.c" + }, + { + "match": "\\b__STDCPP_THREADS__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STDCPP_THREADS__.c" + }, + { + "match": "\\b__TIME__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__TIME__.c" + }, + { + "match": "\\bNDEBUG\\b", + "name": "entity.name.other.preprocessor.macro.predefined.NDEBUG.c" + }, + { + "match": "\\b__OBJC__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__OBJC__.c" + }, + { + "match": "\\b__ASSEMBLER__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ASSEMBLER__.c" + }, + { + "match": "\\b__ATOM__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ATOM__.c" + }, + { + "match": "\\b__AVX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__AVX__.c" + }, + { + "match": "\\b__AVX2__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__AVX2__.c" + }, + { + "match": "\\b_CHAR_UNSIGNED\\b", + "name": "entity.name.other.preprocessor.macro.predefined._CHAR_UNSIGNED.c" + }, + { + "match": "\\b__CLR_VER\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__CLR_VER.c" + }, + { + "match": "\\b_CONTROL_FLOW_GUARD\\b", + "name": "entity.name.other.preprocessor.macro.predefined._CONTROL_FLOW_GUARD.c" + }, + { + "match": "\\b__COUNTER__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__COUNTER__.c" + }, + { + "match": "\\b__cplusplus_cli\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus_cli.c" + }, + { + "match": "\\b__cplusplus_winrt\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__cplusplus_winrt.c" + }, + { + "match": "\\b_CPPRTTI\\b", + "name": "entity.name.other.preprocessor.macro.predefined._CPPRTTI.c" + }, + { + "match": "\\b_CPPUNWIND\\b", + "name": "entity.name.other.preprocessor.macro.predefined._CPPUNWIND.c" + }, + { + "match": "\\b_DEBUG\\b", + "name": "entity.name.other.preprocessor.macro.predefined._DEBUG.c" + }, + { + "match": "\\b_DLL\\b", + "name": "entity.name.other.preprocessor.macro.predefined._DLL.c" + }, + { + "match": "\\b__FUNCDNAME__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FUNCDNAME__.c" + }, + { + "match": "\\b__FUNCSIG__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FUNCSIG__.c" + }, + { + "match": "\\b__FUNCTION__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FUNCTION__.c" + }, + { + "match": "\\b_INTEGRAL_MAX_BITS\\b", + "name": "entity.name.other.preprocessor.macro.predefined._INTEGRAL_MAX_BITS.c" + }, + { + "match": "\\b__INTELLISENSE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTELLISENSE__.c" + }, + { + "match": "\\b_ISO_VOLATILE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._ISO_VOLATILE.c" + }, + { + "match": "\\b_KERNEL_MODE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._KERNEL_MODE.c" + }, + { + "match": "\\b_M_AMD64\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_AMD64.c" + }, + { + "match": "\\b_M_ARM\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_ARM.c" + }, + { + "match": "\\b_M_ARM_ARMV7VE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_ARM_ARMV7VE.c" + }, + { + "match": "\\b_M_ARM_FP\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_ARM_FP.c" + }, + { + "match": "\\b_M_ARM64\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_ARM64.c" + }, + { + "match": "\\b_M_CEE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_CEE.c" + }, + { + "match": "\\b_M_CEE_PURE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_CEE_PURE.c" + }, + { + "match": "\\b_M_CEE_SAFE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_CEE_SAFE.c" + }, + { + "match": "\\b_M_FP_EXCEPT\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_FP_EXCEPT.c" + }, + { + "match": "\\b_M_FP_FAST\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_FP_FAST.c" + }, + { + "match": "\\b_M_FP_PRECISE\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_FP_PRECISE.c" + }, + { + "match": "\\b_M_FP_STRICT\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_FP_STRICT.c" + }, + { + "match": "\\b_M_IX86\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_IX86.c" + }, + { + "match": "\\b_M_IX86_FP\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_IX86_FP.c" + }, + { + "match": "\\b_M_X64\\b", + "name": "entity.name.other.preprocessor.macro.predefined._M_X64.c" + }, + { + "match": "\\b_MANAGED\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MANAGED.c" + }, + { + "match": "\\b_MSC_BUILD\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MSC_BUILD.c" + }, + { + "match": "\\b_MSC_EXTENSIONS\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MSC_EXTENSIONS.c" + }, + { + "match": "\\b_MSC_FULL_VER\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MSC_FULL_VER.c" + }, + { + "match": "\\b_MSC_VER\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MSC_VER.c" + }, + { + "match": "\\b_MSVC_LANG\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MSVC_LANG.c" + }, + { + "match": "\\b__MSVC_RUNTIME_CHECKS\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__MSVC_RUNTIME_CHECKS.c" + }, + { + "match": "\\b_MT\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MT.c" + }, + { + "match": "\\b_NATIVE_WCHAR_T_DEFINED\\b", + "name": "entity.name.other.preprocessor.macro.predefined._NATIVE_WCHAR_T_DEFINED.c" + }, + { + "match": "\\b_OPENMP\\b", + "name": "entity.name.other.preprocessor.macro.predefined._OPENMP.c" + }, + { + "match": "\\b_PREFAST\\b", + "name": "entity.name.other.preprocessor.macro.predefined._PREFAST.c" + }, + { + "match": "\\b__TIMESTAMP__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__TIMESTAMP__.c" + }, + { + "match": "\\b_VC_NO_DEFAULTLIB\\b", + "name": "entity.name.other.preprocessor.macro.predefined._VC_NO_DEFAULTLIB.c" + }, + { + "match": "\\b_WCHAR_T_DEFINED\\b", + "name": "entity.name.other.preprocessor.macro.predefined._WCHAR_T_DEFINED.c" + }, + { + "match": "\\b_WIN32\\b", + "name": "entity.name.other.preprocessor.macro.predefined._WIN32.c" + }, + { + "match": "\\b_WIN64\\b", + "name": "entity.name.other.preprocessor.macro.predefined._WIN64.c" + }, + { + "match": "\\b_WINRT_DLL\\b", + "name": "entity.name.other.preprocessor.macro.predefined._WINRT_DLL.c" + }, + { + "match": "\\b_ATL_VER\\b", + "name": "entity.name.other.preprocessor.macro.predefined._ATL_VER.c" + }, + { + "match": "\\b_MFC_VER\\b", + "name": "entity.name.other.preprocessor.macro.predefined._MFC_VER.c" + }, + { + "match": "\\b__GFORTRAN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GFORTRAN__.c" + }, + { + "match": "\\b__GNUC__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GNUC__.c" + }, + { + "match": "\\b__GNUC_MINOR__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_MINOR__.c" + }, + { + "match": "\\b__GNUC_PATCHLEVEL__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_PATCHLEVEL__.c" + }, + { + "match": "\\b__GNUG__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GNUG__.c" + }, + { + "match": "\\b__STRICT_ANSI__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__STRICT_ANSI__.c" + }, + { + "match": "\\b__BASE_FILE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__BASE_FILE__.c" + }, + { + "match": "\\b__INCLUDE_LEVEL__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INCLUDE_LEVEL__.c" + }, + { + "match": "\\b__ELF__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ELF__.c" + }, + { + "match": "\\b__VERSION__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__VERSION__.c" + }, + { + "match": "\\b__OPTIMIZE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__OPTIMIZE__.c" + }, + { + "match": "\\b__OPTIMIZE_SIZE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__OPTIMIZE_SIZE__.c" + }, + { + "match": "\\b__NO_INLINE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__NO_INLINE__.c" + }, + { + "match": "\\b__GNUC_STDC_INLINE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GNUC_STDC_INLINE__.c" + }, + { + "match": "\\b__CHAR_UNSIGNED__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__CHAR_UNSIGNED__.c" + }, + { + "match": "\\b__WCHAR_UNSIGNED__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_UNSIGNED__.c" + }, + { + "match": "\\b__REGISTER_PREFIX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__REGISTER_PREFIX__.c" + }, + { + "match": "\\b__REGISTER_PREFIX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__REGISTER_PREFIX__.c" + }, + { + "match": "\\b__SIZE_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_TYPE__.c" + }, + { + "match": "\\b__PTRDIFF_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_TYPE__.c" + }, + { + "match": "\\b__WCHAR_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_TYPE__.c" + }, + { + "match": "\\b__WINT_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WINT_TYPE__.c" + }, + { + "match": "\\b__INTMAX_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_TYPE__.c" + }, + { + "match": "\\b__UINTMAX_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINTMAX_TYPE__.c" + }, + { + "match": "\\b__SIG_ATOMIC_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_TYPE__.c" + }, + { + "match": "\\b__INT8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT8_TYPE__.c" + }, + { + "match": "\\b__INT16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT16_TYPE__.c" + }, + { + "match": "\\b__INT32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT32_TYPE__.c" + }, + { + "match": "\\b__INT64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT64_TYPE__.c" + }, + { + "match": "\\b__UINT8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT8_TYPE__.c" + }, + { + "match": "\\b__UINT16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT16_TYPE__.c" + }, + { + "match": "\\b__UINT32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT32_TYPE__.c" + }, + { + "match": "\\b__UINT64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT64_TYPE__.c" + }, + { + "match": "\\b__INT_LEAST8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_TYPE__.c" + }, + { + "match": "\\b__INT_LEAST16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_TYPE__.c" + }, + { + "match": "\\b__INT_LEAST32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_TYPE__.c" + }, + { + "match": "\\b__INT_LEAST64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_TYPE__.c" + }, + { + "match": "\\b__UINT_LEAST8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST8_TYPE__.c" + }, + { + "match": "\\b__UINT_LEAST16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST16_TYPE__.c" + }, + { + "match": "\\b__UINT_LEAST32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST32_TYPE__.c" + }, + { + "match": "\\b__UINT_LEAST64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST64_TYPE__.c" + }, + { + "match": "\\b__INT_FAST8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_TYPE__.c" + }, + { + "match": "\\b__INT_FAST16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_TYPE__.c" + }, + { + "match": "\\b__INT_FAST32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_TYPE__.c" + }, + { + "match": "\\b__INT_FAST64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_TYPE__.c" + }, + { + "match": "\\b__UINT_FAST8_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST8_TYPE__.c" + }, + { + "match": "\\b__UINT_FAST16_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST16_TYPE__.c" + }, + { + "match": "\\b__UINT_FAST32_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST32_TYPE__.c" + }, + { + "match": "\\b__UINT_FAST64_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST64_TYPE__.c" + }, + { + "match": "\\b__INTPTR_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_TYPE__.c" + }, + { + "match": "\\b__UINTPTR_TYPE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINTPTR_TYPE__.c" + }, + { + "match": "\\b__CHAR_BIT__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__CHAR_BIT__.c" + }, + { + "match": "\\b__SCHAR_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SCHAR_MAX__.c" + }, + { + "match": "\\b__WCHAR_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_MAX__.c" + }, + { + "match": "\\b__SHRT_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SHRT_MAX__.c" + }, + { + "match": "\\b__INT_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_MAX__.c" + }, + { + "match": "\\b__LONG_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LONG_MAX__.c" + }, + { + "match": "\\b__LONG_LONG_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LONG_LONG_MAX__.c" + }, + { + "match": "\\b__WINT_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WINT_MAX__.c" + }, + { + "match": "\\b__SIZE_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_MAX__.c" + }, + { + "match": "\\b__PTRDIFF_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_MAX__.c" + }, + { + "match": "\\b__INTMAX_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_MAX__.c" + }, + { + "match": "\\b__UINTMAX_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINTMAX_MAX__.c" + }, + { + "match": "\\b__SIG_ATOMIC_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_MAX__.c" + }, + { + "match": "\\b__INT8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT8_MAX__.c" + }, + { + "match": "\\b__INT16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT16_MAX__.c" + }, + { + "match": "\\b__INT32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT32_MAX__.c" + }, + { + "match": "\\b__INT64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT64_MAX__.c" + }, + { + "match": "\\b__UINT8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT8_MAX__.c" + }, + { + "match": "\\b__UINT16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT16_MAX__.c" + }, + { + "match": "\\b__UINT32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT32_MAX__.c" + }, + { + "match": "\\b__UINT64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT64_MAX__.c" + }, + { + "match": "\\b__INT_LEAST8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_MAX__.c" + }, + { + "match": "\\b__INT_LEAST16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_MAX__.c" + }, + { + "match": "\\b__INT_LEAST32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_MAX__.c" + }, + { + "match": "\\b__INT_LEAST64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_MAX__.c" + }, + { + "match": "\\b__UINT_LEAST8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST8_MAX__.c" + }, + { + "match": "\\b__UINT_LEAST16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST16_MAX__.c" + }, + { + "match": "\\b__UINT_LEAST32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST32_MAX__.c" + }, + { + "match": "\\b__UINT_LEAST64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_LEAST64_MAX__.c" + }, + { + "match": "\\b__INT_FAST8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_MAX__.c" + }, + { + "match": "\\b__INT_FAST16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_MAX__.c" + }, + { + "match": "\\b__INT_FAST32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_MAX__.c" + }, + { + "match": "\\b__INT_FAST64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_MAX__.c" + }, + { + "match": "\\b__UINT_FAST8_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST8_MAX__.c" + }, + { + "match": "\\b__UINT_FAST16_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST16_MAX__.c" + }, + { + "match": "\\b__UINT_FAST32_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST32_MAX__.c" + }, + { + "match": "\\b__UINT_FAST64_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINT_FAST64_MAX__.c" + }, + { + "match": "\\b__INTPTR_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_MAX__.c" + }, + { + "match": "\\b__UINTPTR_MAX__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__UINTPTR_MAX__.c" + }, + { + "match": "\\b__WCHAR_MIN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_MIN__.c" + }, + { + "match": "\\b__WINT_MIN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WINT_MIN__.c" + }, + { + "match": "\\b__SIG_ATOMIC_MIN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_MIN__.c" + }, + { + "match": "\\b__SCHAR_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SCHAR_WIDTH__.c" + }, + { + "match": "\\b__SHRT_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SHRT_WIDTH__.c" + }, + { + "match": "\\b__INT_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_WIDTH__.c" + }, + { + "match": "\\b__LONG_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LONG_WIDTH__.c" + }, + { + "match": "\\b__LONG_LONG_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LONG_LONG_WIDTH__.c" + }, + { + "match": "\\b__PTRDIFF_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__PTRDIFF_WIDTH__.c" + }, + { + "match": "\\b__SIG_ATOMIC_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIG_ATOMIC_WIDTH__.c" + }, + { + "match": "\\b__SIZE_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZE_WIDTH__.c" + }, + { + "match": "\\b__WCHAR_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WCHAR_WIDTH__.c" + }, + { + "match": "\\b__WINT_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__WINT_WIDTH__.c" + }, + { + "match": "\\b__INT_LEAST8_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST8_WIDTH__.c" + }, + { + "match": "\\b__INT_LEAST16_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST16_WIDTH__.c" + }, + { + "match": "\\b__INT_LEAST32_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST32_WIDTH__.c" + }, + { + "match": "\\b__INT_LEAST64_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_LEAST64_WIDTH__.c" + }, + { + "match": "\\b__INT_FAST8_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST8_WIDTH__.c" + }, + { + "match": "\\b__INT_FAST16_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST16_WIDTH__.c" + }, + { + "match": "\\b__INT_FAST32_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST32_WIDTH__.c" + }, + { + "match": "\\b__INT_FAST64_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INT_FAST64_WIDTH__.c" + }, + { + "match": "\\b__INTPTR_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTPTR_WIDTH__.c" + }, + { + "match": "\\b__INTMAX_WIDTH__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__INTMAX_WIDTH__.c" + }, + { + "match": "\\b__SIZEOF_INT__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_INT__.c" + }, + { + "match": "\\b__SIZEOF_LONG__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG__.c" + }, + { + "match": "\\b__SIZEOF_LONG_LONG__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG_LONG__.c" + }, + { + "match": "\\b__SIZEOF_SHORT__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_SHORT__.c" + }, + { + "match": "\\b__SIZEOF_POINTER__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_POINTER__.c" + }, + { + "match": "\\b__SIZEOF_FLOAT__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_FLOAT__.c" + }, + { + "match": "\\b__SIZEOF_DOUBLE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_DOUBLE__.c" + }, + { + "match": "\\b__SIZEOF_LONG_DOUBLE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_LONG_DOUBLE__.c" + }, + { + "match": "\\b__SIZEOF_SIZE_T__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_SIZE_T__.c" + }, + { + "match": "\\b__SIZEOF_WCHAR_T__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_WCHAR_T__.c" + }, + { + "match": "\\b__SIZEOF_WINT_T__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_WINT_T__.c" + }, + { + "match": "\\b__SIZEOF_PTRDIFF_T__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SIZEOF_PTRDIFF_T__.c" + }, + { + "match": "\\b__BYTE_ORDER__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__BYTE_ORDER__.c" + }, + { + "match": "\\b__ORDER_LITTLE_ENDIAN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_LITTLE_ENDIAN__.c" + }, + { + "match": "\\b__ORDER_BIG_ENDIAN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_BIG_ENDIAN__.c" + }, + { + "match": "\\b__ORDER_PDP_ENDIAN__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__ORDER_PDP_ENDIAN__.c" + }, + { + "match": "\\b__FLOAT_WORD_ORDER__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FLOAT_WORD_ORDER__.c" + }, + { + "match": "\\b__DEPRECATED\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__DEPRECATED.c" + }, + { + "match": "\\b__EXCEPTIONS\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__EXCEPTIONS.c" + }, + { + "match": "\\b__GXX_RTTI\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GXX_RTTI.c" + }, + { + "match": "\\b__USING_SJLJ_EXCEPTIONS__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__USING_SJLJ_EXCEPTIONS__.c" + }, + { + "match": "\\b__GXX_EXPERIMENTAL_CXX0X__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GXX_EXPERIMENTAL_CXX0X__.c" + }, + { + "match": "\\b__GXX_WEAK__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GXX_WEAK__.c" + }, + { + "match": "\\b__NEXT_RUNTIME__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__NEXT_RUNTIME__.c" + }, + { + "match": "\\b__LP64__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__LP64__.c" + }, + { + "match": "\\b_LP64\\b", + "name": "entity.name.other.preprocessor.macro.predefined._LP64.c" + }, + { + "match": "\\b__SSP__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SSP__.c" + }, + { + "match": "\\b__SSP_ALL__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SSP_ALL__.c" + }, + { + "match": "\\b__SSP_STRONG__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SSP_STRONG__.c" + }, + { + "match": "\\b__SSP_EXPLICIT__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SSP_EXPLICIT__.c" + }, + { + "match": "\\b__SANITIZE_ADDRESS__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SANITIZE_ADDRESS__.c" + }, + { + "match": "\\b__SANITIZE_THREAD__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__SANITIZE_THREAD__.c" + }, + { + "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1.c" + }, + { + "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2.c" + }, + { + "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.c" + }, + { + "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8.c" + }, + { + "match": "\\b__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16.c" + }, + { + "match": "\\b__HAVE_SPECULATION_SAFE_VALUE\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__HAVE_SPECULATION_SAFE_VALUE.c" + }, + { + "match": "\\b__GCC_HAVE_DWARF2_CFI_ASM\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_HAVE_DWARF2_CFI_ASM.c" + }, + { + "match": "\\b__FP_FAST_FMA\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMA.c" + }, + { + "match": "\\b__FP_FAST_FMAF\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF.c" + }, + { + "match": "\\b__FP_FAST_FMAL\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAL.c" + }, + { + "match": "\\b__FP_FAST_FMAF16\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF16.c" + }, + { + "match": "\\b__FP_FAST_FMAF32\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF32.c" + }, + { + "match": "\\b__FP_FAST_FMAF64\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF64.c" + }, + { + "match": "\\b__FP_FAST_FMAF128\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF128.c" + }, + { + "match": "\\b__FP_FAST_FMAF32X\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF32X.c" + }, + { + "match": "\\b__FP_FAST_FMAF64X\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF64X.c" + }, + { + "match": "\\b__FP_FAST_FMAF128X\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FP_FAST_FMAF128X.c" + }, + { + "match": "\\b__GCC_IEC_559\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_IEC_559.c" + }, + { + "match": "\\b__GCC_IEC_559_COMPLEX\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__GCC_IEC_559_COMPLEX.c" + }, + { + "match": "\\b__NO_MATH_ERRNO__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__NO_MATH_ERRNO__.c" + }, + { + "match": "\\b__has_builtin\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_builtin.c" + }, + { + "match": "\\b__has_feature\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_feature.c" + }, + { + "match": "\\b__has_extension\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_extension.c" + }, + { + "match": "\\b__has_cpp_attribute\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_cpp_attribute.c" + }, + { + "match": "\\b__has_c_attribute\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_c_attribute.c" + }, + { + "match": "\\b__has_attribute\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_attribute.c" + }, + { + "match": "\\b__has_declspec_attribute\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_declspec_attribute.c" + }, + { + "match": "\\b__is_identifier\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__is_identifier.c" + }, + { + "match": "\\b__has_include\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_include.c" + }, + { + "match": "\\b__has_include_next\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_include_next.c" + }, + { + "match": "\\b__has_warning\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__has_warning.c" + }, + { + "match": "\\b__BASE_FILE__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__BASE_FILE__.c" + }, + { + "match": "\\b__FILE_NAME__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__FILE_NAME__.c" + }, + { + "match": "\\b__clang__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__clang__.c" + }, + { + "match": "\\b__clang_major__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__clang_major__.c" + }, + { + "match": "\\b__clang_minor__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__clang_minor__.c" + }, + { + "match": "\\b__clang_patchlevel__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__clang_patchlevel__.c" + }, + { + "match": "\\b__clang_version__\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__clang_version__.c" + }, + { + "match": "\\b__fp16\\b", + "name": "entity.name.other.preprocessor.macro.predefined.__fp16.c" + }, + { + "match": "\\b_Float16\\b", + "name": "entity.name.other.preprocessor.macro.predefined._Float16.c" + }, + { + "match": "(\\b__([A-Z_])__\\b)", + "captures": { + "1": { + "name": "entity.name.other.preprocessor.macro.predefined.probably.$2.c" + } + } + } + ] + }, "numbers": { "begin": "(?\\[\\]=]))", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "patterns": [ { "name": "meta.head.switch.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.switch.cpp" @@ -803,14 +1108,14 @@ "include": "#switch_conditional_parentheses" }, { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.body.switch.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.switch.cpp" @@ -824,7 +1129,7 @@ "include": "#case_statement" }, { - "include": "$base" + "include": "#root_context" }, { "include": "#block_innards" @@ -833,11 +1138,11 @@ }, { "name": "meta.tail.switch.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -874,13 +1179,13 @@ ] }, { - "match": "(using)\\s+((?:,\\w])*>\\s*", + "match": "(?]*|[^>]*+<[^>]*+>)++>\\s*", "captures": { "0": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_context" + "include": "#template_call_range" } ] } @@ -1197,7 +1502,7 @@ ] }, "template_argument_defaulted": { - "match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*([=])", + "match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*([=])", "captures": { "1": { "name": "storage.type.template.cpp" @@ -1211,7 +1516,7 @@ } }, "template_definition_argument": { - "match": "(?:(?:\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))\\s*(?:(,)|(?=>|$))", + "match": "(?:(?:\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*))\\s*(?:(,)|(?=>|$))", "captures": { "1": { "name": "storage.type.template.argument.$1.cpp" @@ -1237,37 +1542,352 @@ } }, "scope_resolution": { - "match": "((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)", + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_inner_generated" + } + ] + } + } + }, + "scope_resolution_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", "captures": { "1": { "patterns": [ { - "include": "#scope_resolution" + "include": "#scope_resolution_inner_generated" } ] }, "2": { - "name": "entity.name.type.namespace.scope-resolution.cpp" + "name": "entity.name.scope-resolution.cpp" }, "3": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_context" + "include": "#template_call_range" } ] }, "4": { - "name": "punctuation.separator.namespace.access.cpp" + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" } - }, - "name": "meta.scope-resolution.cpp" + } }, - "qualified_type": { - "match": "\\s*(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.])", + "scope_resolution_template_call": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", "captures": { "0": { - "name": "entity.name.type.cpp meta.qualified_type.cpp", + "patterns": [ + { + "include": "#scope_resolution_template_call_inner_generated" + } + ] + } + } + }, + "scope_resolution_template_call_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_template_call_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.template.call.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.call.cpp" + } + } + }, + "scope_resolution_template_definition": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_template_definition_inner_generated" + } + ] + } + } + }, + "scope_resolution_template_definition_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_template_definition_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.template.definition.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.template.definition.cpp" + } + } + }, + "scope_resolution_function_call": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_function_call_inner_generated" + } + ] + } + } + }, + "scope_resolution_function_call_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_function_call_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.function.call.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.call.cpp" + } + } + }, + "scope_resolution_function_definition": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_function_definition_inner_generated" + } + ] + } + } + }, + "scope_resolution_function_definition_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_function_definition_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.function.definition.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp" + } + } + }, + "scope_resolution_namespace_alias": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_namespace_alias_inner_generated" + } + ] + } + } + }, + "scope_resolution_namespace_alias_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_namespace_alias_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.namespace.alias.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.alias.cpp" + } + } + }, + "scope_resolution_namespace_using": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_namespace_using_inner_generated" + } + ] + } + } + }, + "scope_resolution_namespace_using_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_namespace_using_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.namespace.using.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.using.cpp" + } + } + }, + "scope_resolution_namespace_block": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_namespace_block_inner_generated" + } + ] + } + } + }, + "scope_resolution_namespace_block_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_namespace_block_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.namespace.block.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.namespace.block.cpp" + } + } + }, + "scope_resolution_function_definition_operator_overload": { + "match": "(?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*", + "captures": { + "0": { + "patterns": [ + { + "include": "#scope_resolution_function_definition_operator_overload_inner_generated" + } + ] + } + } + }, + "scope_resolution_function_definition_operator_overload_inner_generated": { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution_function_definition_operator_overload_inner_generated" + } + ] + }, + "2": { + "name": "entity.name.scope-resolution.function.definition.operator-overload.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#template_call_range" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.operator-overload.cpp" + } + } + }, + "qualified_type": { + "match": "\\s*(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.])", + "captures": { + "0": { + "name": "meta.qualified_type.cpp", "patterns": [ { "match": "(?:class|struct|union|enum)", @@ -1287,6 +1907,16 @@ }, { "include": "#comma" + }, + { + "include": "#scope_resolution_inner_generated" + }, + { + "include": "#template_call_range" + }, + { + "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*", + "name": "entity.name.type.cpp" } ] }, @@ -1300,40 +1930,40 @@ } ] }, - "2": { - "name": "meta.scope-resolution.cpp" - }, "3": { "patterns": [ { - "include": "#scope_resolution" + "include": "#scope_resolution_inner_generated" } ] }, "4": { - "name": "entity.name.type.namespace.scope-resolution.cpp" + "name": "entity.name.scope-resolution.cpp" }, "5": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_context" + "include": "#template_call_range" } ] }, "6": { - "name": "punctuation.separator.namespace.access.cpp" + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" + }, + "7": { + "name": "entity.name.type.cpp" } } }, "type_alias": { - "match": "(using)\\s*(?!namespace)(\\s*(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(\\=)\\s*(typename)?\\s*((?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))|(.+(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))\\s*(\\=)\\s*(typename)?\\s*((?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))|(.+(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))(?:\\s+|(\\s*((?:\\*\\s*)*)((?:&\\s*){0,2})\\s*))((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?|\\?\\?>)|(?=[;>\\[\\]=]))", "patterns": [ { - "include": "#parameter_struct" + "name": "meta.head.function.definition.cpp", + "begin": "\\G ?", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.function.definition.cpp" + } + }, + "patterns": [ + { + "contentName": "meta.function.definition.parameters.cpp", + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parameters.begin.bracket.round.cpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parameters.end.bracket.round.cpp" + } + }, + "patterns": [ + { + "include": "#function_parameter_context" + }, + { + "include": "#function_call_context" + } + ] + }, + { + "include": "#comments_context" + }, + { + "include": "#root_context" + } + ] }, { - "include": "#function_context_c" + "name": "meta.body.function.definition.cpp", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.function.definition.cpp" + } + }, + "patterns": [ + { + "include": "#function_body_context" + } + ] + }, + { + "name": "meta.tail.function.definition.cpp", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "include": "#root_context" + } + ] } ] }, @@ -1583,17 +2382,17 @@ ] }, { - "include": "#function_call_context_c" + "include": "#function_call_context" } ] }, "function_call": { - "begin": "(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(\\()", + "begin": "(?!\\s)(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(\\()", "beginCaptures": { "1": { "patterns": [ { - "include": "#scope_resolution" + "include": "#scope_resolution_function_call_inner_generated" } ] }, @@ -1604,49 +2403,23 @@ "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_context" + "include": "#template_call_range" } ] }, "4": { - "name": "punctuation.section.arguments.begin.bracket.round.cpp" + "name": "punctuation.section.arguments.begin.bracket.round.function.call.cpp" } }, "end": "(\\))", "endCaptures": { "1": { - "name": "punctuation.section.arguments.end.bracket.round.cpp" + "name": "punctuation.section.arguments.end.bracket.round.function.call.cpp" } }, "patterns": [ { - "include": "#function_call_context_c" - } - ] - }, - "legacy_function_definition": { - "name": "meta.function.definition.parameters.cpp", - "begin": "(?!(?:(?:::|\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\.|\\->|\\+\\+|\\-\\-|\\+|\\-|!|not|~|compl|\\*|&|sizeof|sizeof\\.\\.\\.|new|new\\[\\]|delete|delete\\[\\]|\\.\\*|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|not_eq|&|bitand|\\^|xor|\\||bitor|&&|and|\\|\\||or|\\?:|throw|=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|and_eq|\\^=|xor_eq|\\|=|or_eq|,|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast)|(?:throw|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default))\\s*\\()((?:(?-mix:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|::)++|(?<=operator)(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|new|new\\[\\]|delete|delete\\[\\]|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.cpp" - }, - "2": { - "name": "punctuation.section.parameters.begin.bracket.round.cpp" - } - }, - "end": "(\\)|:)", - "endCaptures": { - "1": { - "name": "punctuation.section.parameters.end.bracket.round.cpp" - } - }, - "patterns": [ - { - "include": "#probably_a_parameter" - }, - { - "include": "#function_context_c" + "include": "#function_call_context" } ] }, @@ -1664,13 +2437,6 @@ { "include": "#typeid_operator" }, - { - "include": "#decltype_specifier" - }, - { - "match": "(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)(\\()(\\*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)?\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", + "begin": "(\\s*(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))\\s*(\\s*((?:\\*\\s*)*)((?:&\\s*){0,2})\\s*)(\\()(\\*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)?\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()", "beginCaptures": { "1": { - "name": "entity.name.type.cpp meta.qualified_type.cpp", + "name": "meta.qualified_type.cpp", "patterns": [ { "match": "(?:class|struct|union|enum)", @@ -1778,6 +2544,16 @@ }, { "include": "#comma" + }, + { + "include": "#scope_resolution_inner_generated" + }, + { + "include": "#template_call_range" + }, + { + "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*", + "name": "entity.name.type.cpp" } ] }, @@ -1791,62 +2567,62 @@ } ] }, - "3": { - "name": "meta.scope-resolution.cpp" - }, "4": { "patterns": [ { - "include": "#scope_resolution" + "include": "#scope_resolution_inner_generated" } ] }, "5": { - "name": "entity.name.type.namespace.scope-resolution.cpp" + "name": "entity.name.scope-resolution.cpp" }, "6": { "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template_call_context" + "include": "#template_call_range" } ] }, "7": { - "name": "punctuation.separator.namespace.access.cpp" + "name": "punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp" }, - "9": { - "name": "storage.modifier.pointer.cpp" + "8": { + "name": "entity.name.type.cpp" }, "10": { - "name": "storage.modifier.reference.cpp" + "name": "storage.modifier.pointer.cpp" }, "11": { - "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" + "name": "storage.modifier.reference.cpp" }, "12": { - "name": "punctuation.definition.function.pointer.dereference.cpp" + "name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp" }, "13": { - "name": "variable.other.definition.pointer.function.cpp" + "name": "punctuation.definition.function.pointer.dereference.cpp" }, "14": { - "name": "punctuation.definition.begin.bracket.square.cpp" + "name": "variable.other.definition.pointer.function.cpp" }, "15": { + "name": "punctuation.definition.begin.bracket.square.cpp" + }, + "16": { "patterns": [ { "include": "#evaluation_context" } ] }, - "16": { + "17": { "name": "punctuation.definition.end.bracket.square.cpp" }, - "17": { + "18": { "name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp" }, - "18": { + "19": { "name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp" } }, @@ -1858,18 +2634,12 @@ }, "patterns": [ { - "include": "#parameter_struct" - }, - { - "include": "#probably_a_parameter" - }, - { - "include": "#function_context_c" + "include": "#function_parameter_context" } ] }, "probably_a_parameter": { - "match": "(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?==))|((?<=\\w |\\*\\/|[&*>\\]\\)]|\\.\\.\\.)\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))))", + "match": "(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?==))|((?<=\\w |\\*\\/|[&*>\\]\\)]|\\.\\.\\.)\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))))", "captures": { "1": { "name": "variable.parameter.defaulted.cpp" @@ -1881,7 +2651,7 @@ }, "operator_overload": { "name": "meta.function.definition.parameters.operator-overload.cpp", - "begin": "(operator)((?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?::)*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:&)?)))\\s*(\\()", + "begin": "(operator)((?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:&)?)))\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.other.operator.overload.cpp" @@ -1890,7 +2660,7 @@ "name": "entity.name.operator.overloadee.cpp", "patterns": [ { - "include": "#scope_resolution" + "include": "#scope_resolution_function_definition_operator_overload_inner_generated" } ] }, @@ -1906,15 +2676,12 @@ }, "patterns": [ { - "include": "#probably_a_parameter" - }, - { - "include": "#function_context_c" + "include": "#function_parameter_context" } ] }, "member_access": { - "match": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!auto[^(?-mix:\\w)]|void[^(?-mix:\\w)]|char[^(?-mix:\\w)]|short[^(?-mix:\\w)]|int[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|long[^(?-mix:\\w)]|float[^(?-mix:\\w)]|double[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|uint_least64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\b(?!\\())", + "match": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!auto[^(?-mix:\\w)]|void[^(?-mix:\\w)]|char[^(?-mix:\\w)]|short[^(?-mix:\\w)]|int[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|long[^(?-mix:\\w)]|float[^(?-mix:\\w)]|double[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|uint_least64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\b(?!\\())", "captures": { "1": { "name": "variable.language.this.cpp" @@ -1931,11 +2698,24 @@ "5": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?\\*|->))))", - "name": "variable.other.object.property.cpp" + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?\\*|->)))", + "captures": { + "1": { + "name": "variable.language.this.cpp" + }, + "2": { + "name": "variable.other.object.property.cpp" + }, + "3": { + "name": "punctuation.separator.dot-access.cpp" + }, + "4": { + "name": "punctuation.separator.pointer-access.cpp" + } + } }, { - "match": "(?:((?\\*|->)))", + "match": "(?:((?\\*|->)))", "captures": { "1": { "name": "variable.language.this.cpp" @@ -1965,8 +2745,7 @@ } }, "method_access": { - "contentName": "meta.function-call.member", - "begin": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)(\\()", + "begin": "(?:((?\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(\\()", "beginCaptures": { "1": { "name": "variable.language.this.cpp" @@ -1983,11 +2762,24 @@ "5": { "patterns": [ { - "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?\\*|->))))", - "name": "variable.other.object.property.cpp" + "match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?:((?\\*|->)))", + "captures": { + "1": { + "name": "variable.language.this.cpp" + }, + "2": { + "name": "variable.other.object.property.cpp" + }, + "3": { + "name": "punctuation.separator.dot-access.cpp" + }, + "4": { + "name": "punctuation.separator.pointer-access.cpp" + } + } }, { - "match": "(?:((?\\*|->)))", + "match": "(?:((?\\*|->)))", "captures": { "1": { "name": "variable.language.this.cpp" @@ -2026,13 +2818,13 @@ }, "patterns": [ { - "include": "#function_call_context_c" + "include": "#function_call_context" } ] }, "using_namespace": { "name": "meta.using-namespace.cpp", - "begin": "(?:,\\w])*>\\s*)))?::)*\\s*))?((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*))?((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)\\s*((?:,\\w])*>\\s*)))?::)*\\s*)\\s*(?:(?:((?\\[\\]=]))", + "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "patterns": [ { "name": "meta.head.namespace.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.namespace.cpp" } - } + }, + "patterns": [ + { + "include": "#attributes_context" + }, + { + "match": "((?:::)?(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*\\s*(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)\\s*((?|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.namespace.cpp" @@ -2122,28 +2941,28 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.tail.namespace.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } ] }, "macro_argument": { - "match": "##(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)", + "match": "##(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*(?!\\w)", "name": "variable.other.macro.argument.cpp" }, "lambdas": { - "begin": "((?:(?<=[^\\s]|^)(?])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))", "beginCaptures": { "2": { "name": "punctuation.definition.capture.begin.lambda.cpp" @@ -2152,10 +2971,7 @@ "name": "meta.lambda.capture.cpp", "patterns": [ { - "include": "#probably_a_parameter" - }, - { - "include": "#function_context_c" + "include": "#function_parameter_context" } ] }, @@ -2181,10 +2997,7 @@ }, "patterns": [ { - "include": "#probably_a_parameter" - }, - { - "include": "#function_context_c" + "include": "#function_parameter_context" } ] }, @@ -2219,7 +3032,7 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2227,14 +3040,1034 @@ }, "pthread_types": { "match": "(?:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?:,\\w])*>\\s*))?(::)))?\\s*((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:((?]*|[^>]*+<[^>]*+>)++>\\s*))?(::)))?\\s*((?\\[\\]=]))", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -2342,7 +4172,7 @@ { "name": "meta.head.enum.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.enum.cpp" @@ -2350,14 +4180,14 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.body.enum.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.enum.cpp" @@ -2380,11 +4210,11 @@ }, { "name": "meta.tail.enum.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2405,7 +4235,7 @@ "name": "storage.type.modifier.virtual.cpp" }, { - "match": "(?<=virtual|private|protected|public|,|:)\\s*(?!(?:(?:private|protected|public)|virtual))((?-mix:(?:\\s*(?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))", + "match": "(?<=virtual|private|protected|public|,|:)\\s*(?!(?:(?:private|protected|public)|virtual))((?-mix:(?:\\s*(?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))", "captures": { "1": { "name": "entity.name.type.inherited.cpp" @@ -2416,7 +4246,7 @@ }, "class_block": { "name": "meta.block.class.cpp", - "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", + "begin": "((((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.class.cpp" @@ -2461,7 +4291,7 @@ ] } }, - "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -2474,7 +4304,7 @@ { "name": "meta.head.class.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.class.cpp" @@ -2497,8 +4327,8 @@ }, { "name": "meta.body.class.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.class.cpp" @@ -2512,17 +4342,17 @@ "include": "#constructor_context" }, { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.tail.class.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2530,7 +4360,7 @@ }, "struct_block": { "name": "meta.block.struct.cpp", - "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", + "begin": "((((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.struct.cpp" @@ -2575,7 +4405,7 @@ ] } }, - "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -2588,7 +4418,7 @@ { "name": "meta.head.struct.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" @@ -2611,8 +4441,8 @@ }, { "name": "meta.body.struct.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.struct.cpp" @@ -2626,17 +4456,17 @@ "include": "#constructor_context" }, { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.tail.struct.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2644,7 +4474,7 @@ }, "union_block": { "name": "meta.block.union.cpp", - "begin": "((((?:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))", + "begin": "((((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", "beginCaptures": { "1": { "name": "meta.head.union.cpp" @@ -2689,7 +4519,7 @@ ] } }, - "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -2702,7 +4532,7 @@ { "name": "meta.head.union.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.union.cpp" @@ -2725,8 +4555,8 @@ }, { "name": "meta.body.union.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.union.cpp" @@ -2740,17 +4570,17 @@ "include": "#constructor_context" }, { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.tail.union.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -2767,7 +4597,7 @@ "name": "storage.type.extern.cpp" } }, - "end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" @@ -2780,7 +4610,7 @@ { "name": "meta.head.extern.cpp", "begin": "\\G ?", - "end": "((?:\\{|(?=;)))", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.extern.cpp" @@ -2788,14 +4618,14 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.body.extern.cpp", - "begin": "(?<=\\{)", - "end": "(\\})", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.extern.cpp" @@ -2803,22 +4633,439 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, { "name": "meta.tail.extern.cpp", - "begin": "(?<=})[\\s\\n]*", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, { - "include": "$base" + "include": "#root_context" + } + ] + }, + "typedef_class": { + "begin": "((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", + "beginCaptures": { + "1": { + "name": "meta.head.class.cpp" + }, + "3": { + "name": "storage.type.$3.cpp" + }, + "4": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, + "9": { + "patterns": [ + { + "include": "#inhertance_context" + } + ] + } + }, + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.cpp" + }, + "2": { + "name": "punctuation.terminator.statement.cpp" + } + }, + "patterns": [ + { + "name": "meta.head.class.cpp", + "begin": "\\G ?", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.class.cpp" + } + }, + "patterns": [ + { + "include": "#preprocessor_context" + }, + { + "include": "#inhertance_context" + }, + { + "include": "#template_call_range" + }, + { + "include": "#comments_context" + } + ] + }, + { + "name": "meta.body.class.cpp", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.class.cpp" + } + }, + "patterns": [ + { + "include": "#function_pointer" + }, + { + "include": "#constructor_context" + }, + { + "include": "#root_context" + } + ] + }, + { + "name": "meta.tail.class.cpp", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "match": "(\\s*((?:\\*\\s*)*)((?:&\\s*){0,2})\\s*)((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", + "beginCaptures": { + "1": { + "name": "meta.head.struct.cpp" + }, + "3": { + "name": "storage.type.$3.cpp" + }, + "4": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, + "9": { + "patterns": [ + { + "include": "#inhertance_context" + } + ] + } + }, + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.cpp" + }, + "2": { + "name": "punctuation.terminator.statement.cpp" + } + }, + "patterns": [ + { + "name": "meta.head.struct.cpp", + "begin": "\\G ?", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.struct.cpp" + } + }, + "patterns": [ + { + "include": "#preprocessor_context" + }, + { + "include": "#inhertance_context" + }, + { + "include": "#template_call_range" + }, + { + "include": "#comments_context" + } + ] + }, + { + "name": "meta.body.struct.cpp", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.struct.cpp" + } + }, + "patterns": [ + { + "include": "#function_pointer" + }, + { + "include": "#constructor_context" + }, + { + "include": "#root_context" + } + ] + }, + { + "name": "meta.tail.struct.cpp", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "match": "(\\s*((?:\\*\\s*)*)((?:&\\s*){0,2})\\s*)((?]*|[^>]*+<[^>]*+>)++>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)\\s*(?:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*))?(?:::)))?\\s*(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)(?:(?-mix:(?:(?]*|[^>]*+<[^>]*+>)++>\\s*)))?(?![\\w<:.]))))+)*))?))", + "beginCaptures": { + "1": { + "name": "meta.head.union.cpp" + }, + "3": { + "name": "storage.type.$3.cpp" + }, + "4": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "5": { + "patterns": [ + { + "include": "#attributes_context" + }, + { + "include": "#number_literal" + } + ] + }, + "6": { + "name": "entity.name.type.$3.cpp" + }, + "7": { + "name": "storage.type.modifier.final.cpp" + }, + "8": { + "name": "colon.cpp punctuation.separator.inhertance.cpp" + }, + "9": { + "patterns": [ + { + "include": "#inhertance_context" + } + ] + } + }, + "end": "(?:(?:(?<=\\}|%>|\\?\\?>)\\s*(;)|(;))|(?=[;>\\[\\]=]))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.cpp" + }, + "2": { + "name": "punctuation.terminator.statement.cpp" + } + }, + "patterns": [ + { + "name": "meta.head.union.cpp", + "begin": "\\G ?", + "end": "((?:\\{|<%|\\?\\?<|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.union.cpp" + } + }, + "patterns": [ + { + "include": "#preprocessor_context" + }, + { + "include": "#inhertance_context" + }, + { + "include": "#template_call_range" + }, + { + "include": "#comments_context" + } + ] + }, + { + "name": "meta.body.union.cpp", + "begin": "(?<=\\{|<%|\\?\\?<)", + "end": "(\\}|%>|\\?\\?>)", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.union.cpp" + } + }, + "patterns": [ + { + "include": "#function_pointer" + }, + { + "include": "#constructor_context" + }, + { + "include": "#root_context" + } + ] + }, + { + "name": "meta.tail.union.cpp", + "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "match": "(\\s*((?:\\*\\s*)*)((?:&\\s*){0,2})\\s*)((?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*))\\s*::\\s*~\\2|~(?>(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*)))\\s*(\\()\\s*(\\))", + "captures": { "1": { - "name": "entity.name.function.destructor.cpp" + "name": "entity.name.function.destructor.cpp entity.name.function.special.destructor.cpp" }, - "2": { + "3": { "name": "punctuation.definition.parameters.begin.destructor.cpp" - } - }, - "end": "(?-mix:\\))", - "endCaptures": { - "0": { + }, + "4": { "name": "punctuation.definition.parameters.end.destructor.cpp" } }, - "patterns": [ - { - "include": "$base" - } - ] - }, - "destructor_prototype": { - "name": "meta.function.destructor.prototype.cpp", - "begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?:,\\w])*>\\s*)))?)\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", - "end": "(?<=\\))(?!\\w)", - "name": "meta.function-call.cpp", - "patterns": [ - { - "include": "#function_call_context_c" + "include": "#root_context" } ] }, @@ -3476,7 +5677,7 @@ }, "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, @@ -3656,7 +5857,7 @@ ] }, { - "include": "$base" + "include": "#root_context" } ] }, @@ -3874,12 +6075,12 @@ ] }, { - "include": "$base" + "include": "#root_context" } ] }, { - "contentName": "comment.block.preprocessor.if-branch", + "contentName": "comment.block.preprocessor.if-branch.cpp", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", "patterns": [ @@ -3972,7 +6173,7 @@ ] }, { - "contentName": "comment.block.preprocessor.if-branch.in-block", + "contentName": "comment.block.preprocessor.if-branch.in-block.cpp", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", "patterns": [ @@ -4015,7 +6216,7 @@ "include": "#comments_context" }, { - "contentName": "comment.block.preprocessor.elif-branch", + "contentName": "comment.block.preprocessor.elif-branch.cpp", "begin": "\\n", "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", "patterns": [ @@ -4072,7 +6273,7 @@ "include": "#comments_context" }, { - "contentName": "comment.block.preprocessor.else-branch", + "contentName": "comment.block.preprocessor.else-branch.cpp", "begin": "^\\s*((#)\\s*else\\b)", "beginCaptures": { "0": { @@ -4096,7 +6297,7 @@ ] }, { - "contentName": "comment.block.preprocessor.if-branch", + "contentName": "comment.block.preprocessor.if-branch.cpp", "begin": "^\\s*((#)\\s*elif\\b)", "beginCaptures": { "0": { @@ -4124,7 +6325,7 @@ "end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] } @@ -4170,7 +6371,7 @@ "include": "#comments_context" }, { - "contentName": "comment.block.preprocessor.else-branch.in-block", + "contentName": "comment.block.preprocessor.else-branch.in-block.cpp", "begin": "^\\s*((#)\\s*else\\b)", "beginCaptures": { "0": { @@ -4194,7 +6395,7 @@ ] }, { - "contentName": "comment.block.preprocessor.if-branch.in-block", + "contentName": "comment.block.preprocessor.if-branch.in-block.cpp", "begin": "^\\s*((#)\\s*elif\\b)", "beginCaptures": { "0": { @@ -4261,7 +6462,7 @@ "end": "(?=^\\s*((#)\\s*(?:endif)\\b))", "patterns": [ { - "contentName": "comment.block.preprocessor.elif-branch", + "contentName": "comment.block.preprocessor.elif-branch.cpp", "begin": "^\\s*((#)\\s*(else)\\b)", "beginCaptures": { "0": { @@ -4285,7 +6486,7 @@ ] }, { - "contentName": "comment.block.preprocessor.elif-branch", + "contentName": "comment.block.preprocessor.elif-branch.cpp", "begin": "^\\s*((#)\\s*(elif)\\b)", "beginCaptures": { "0": { @@ -4309,7 +6510,7 @@ ] }, { - "include": "$base" + "include": "#root_context" } ] } @@ -4348,7 +6549,7 @@ "end": "(?=^\\s*((#)\\s*(?:endif)\\b))", "patterns": [ { - "contentName": "comment.block.preprocessor.elif-branch.in-block", + "contentName": "comment.block.preprocessor.elif-branch.in-block.cpp", "begin": "^\\s*((#)\\s*(else)\\b)", "beginCaptures": { "0": { @@ -4372,7 +6573,7 @@ ] }, { - "contentName": "comment.block.preprocessor.elif-branch", + "contentName": "comment.block.preprocessor.elif-branch.cpp", "begin": "^\\s*((#)\\s*(elif)\\b)", "beginCaptures": { "0": { @@ -4418,7 +6619,7 @@ "end": "(?=^\\s*((#)\\s*endif\\b))", "patterns": [ { - "include": "$base" + "include": "#root_context" } ] }, @@ -4448,7 +6649,7 @@ "include": "#vararg_ellipses" }, { - "match": "(?-mix:##?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))", + "match": "(?-mix:##?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8})))*(?!\\w))", "name": "variable.other.macro.argument.cpp" }, { @@ -4542,7 +6743,7 @@ "include": "#member_access" }, { - "include": "$base" + "include": "#root_context" } ] }, @@ -4641,123 +6842,124 @@ } ] }, - "function_context_c": { + "function_call_context": { "patterns": [ { - "include": "#attributes_context" + "include": "#struct_declare" + }, + { + "include": "#string_context" + }, + { + "include": "#functional_specifiers_pre_parameters" + }, + { + "include": "#qualifiers_and_specifiers_post_parameters" + }, + { + "include": "#storage_specifiers" + }, + { + "include": "#access_control_keywords" + }, + { + "include": "#exception_keywords" + }, + { + "include": "#static_assert" + }, + { + "include": "#other_keywords" + }, + { + "include": "#memory_operators" + }, + { + "include": "#the_this_keyword" + }, + { + "include": "#language_constants" + }, + { + "include": "#misc_storage_modifiers_1" + }, + { + "include": "#lambdas" + }, + { + "include": "#preprocessor_context" }, { "include": "#comments_context" }, { - "include": "#storage_types" + "include": "#misc_storage_modifiers_2" + }, + { + "include": "#number_literal" + }, + { + "include": "#string_context_c" + }, + { + "include": "#meta_preprocessor_macro" + }, + { + "include": "#meta_preprocessor_diagnostic" + }, + { + "include": "#meta_preprocessor_include" + }, + { + "include": "#pragma_mark" + }, + { + "include": "#meta_preprocessor_line" + }, + { + "include": "#meta_preprocessor_undef" + }, + { + "include": "#meta_preprocessor_pragma" + }, + { + "include": "#predefined_macros" }, { "include": "#operators" }, - { - "include": "#vararg_ellipses" - }, - { - "include": "#legacy_function_definition" - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.parens.begin.bracket.round.cpp" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.parens.end.bracket.round.cpp" - } - }, - "patterns": [ - { - "include": "#function_context_c" - } - ] - }, - { - "include": "$base" - } - ] - }, - "function_call_context_c": { - "patterns": [ { "include": "#attributes_context" }, { - "include": "#comments_context" + "include": "#parentheses" }, { - "include": "#storage_types" - }, - { - "include": "#method_access" - }, - { - "include": "#member_access" - }, - { - "include": "#operators" - }, - { - "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:new)\\s*((?-mix:(?:(?-mix:(?:(?:,\\w])*>\\s*)))?)) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", - "beginCaptures": { - "1": { - "name": "keyword.operator.wordlike.cpp memory.cpp keyword.operator.new.cpp" - }, - "2": { - "patterns": [ - { - "include": "#template_call_innards" - } - ] - }, - "3": { - "name": "punctuation.section.arguments.begin.bracket.round.cpp" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.arguments.end.bracket.round.cpp" - } - }, - "patterns": [ - { - "include": "#function_call_context_c" - } - ] + "include": "#type_casting_operators" }, { "include": "#function_call" }, { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.parens.begin.bracket.round.cpp" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.parens.end.bracket.round.cpp" - } - }, - "patterns": [ - { - "include": "#function_call_context_c" - } - ] + "include": "#scope_resolution_inner_generated" }, { - "include": "#block_context" + "include": "#storage_types" + }, + { + "include": "#line_continuation_character" + }, + { + "include": "#square_brackets" + }, + { + "include": "#empty_square_brackets" + }, + { + "include": "#semicolon" + }, + { + "include": "#comma" } ] } diff --git a/extensions/cpp/test/colorize-results/test-23630_cpp.json b/extensions/cpp/test/colorize-results/test-23630_cpp.json index a58961ae945..55aec19d2cb 100644 --- a/extensions/cpp/test/colorize-results/test-23630_cpp.json +++ b/extensions/cpp/test/colorize-results/test-23630_cpp.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "ifndef", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -45,7 +45,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.macro.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -56,7 +56,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -67,7 +67,7 @@ }, { "c": "define", - "t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -78,7 +78,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.macro.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -89,7 +89,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -100,7 +100,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -111,7 +111,7 @@ }, { "c": "endif", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", diff --git a/extensions/cpp/test/colorize-results/test-23850_cpp.json b/extensions/cpp/test/colorize-results/test-23850_cpp.json index 924bbc78243..dfcdfd6787a 100644 --- a/extensions/cpp/test/colorize-results/test-23850_cpp.json +++ b/extensions/cpp/test/colorize-results/test-23850_cpp.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "ifndef", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -45,7 +45,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -56,7 +56,7 @@ }, { "c": "define", - "t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -67,7 +67,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.macro.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -78,7 +78,7 @@ }, { "c": "_UCRT", - "t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -89,7 +89,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -100,7 +100,7 @@ }, { "c": "endif", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", diff --git a/extensions/cpp/test/colorize-results/test_cc.json b/extensions/cpp/test/colorize-results/test_cc.json index e53e3ede6e4..c96d57f2373 100644 --- a/extensions/cpp/test/colorize-results/test_cc.json +++ b/extensions/cpp/test/colorize-results/test_cc.json @@ -1,7 +1,7 @@ [ { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -12,7 +12,7 @@ }, { "c": "if", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -23,7 +23,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -34,7 +34,7 @@ }, { "c": "B4G_DEBUG_CHECK", - "t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -45,7 +45,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -56,7 +56,7 @@ }, { "c": "fprintf", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -67,7 +67,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -78,7 +78,7 @@ }, { "c": "stderr", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -89,7 +89,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -100,7 +100,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -111,7 +111,7 @@ }, { "c": "num_candidate_ret=", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -122,7 +122,7 @@ }, { "c": "%d", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -133,7 +133,7 @@ }, { "c": ":", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -144,7 +144,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -155,7 +155,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -166,7 +166,7 @@ }, { "c": " num_candidate", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -177,7 +177,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -188,7 +188,7 @@ }, { "c": ";", - "t": "source.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -199,7 +199,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -210,7 +210,7 @@ }, { "c": "for", - "t": "source.cpp keyword.control.for.cpp", + "t": "source.cpp source.cpp keyword.control.for.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -221,7 +221,7 @@ }, { "c": "(", - "t": "source.cpp meta.parens.cpp punctuation.section.parens.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.parens.cpp punctuation.section.parens.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -232,7 +232,7 @@ }, { "c": "int", - "t": "source.cpp meta.parens.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.parens.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -243,7 +243,7 @@ }, { "c": " i", - "t": "source.cpp meta.parens.cpp", + "t": "source.cpp source.cpp meta.parens.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -254,7 +254,7 @@ }, { "c": "=", - "t": "source.cpp meta.parens.cpp keyword.operator.assignment.cpp", + "t": "source.cpp source.cpp meta.parens.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -265,7 +265,7 @@ }, { "c": "0", - "t": "source.cpp meta.parens.cpp constant.numeric.decimal.cpp", + "t": "source.cpp source.cpp meta.parens.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -276,7 +276,7 @@ }, { "c": ";", - "t": "source.cpp meta.parens.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.parens.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -287,7 +287,7 @@ }, { "c": "i", - "t": "source.cpp meta.parens.cpp", + "t": "source.cpp source.cpp meta.parens.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -298,7 +298,7 @@ }, { "c": "<", - "t": "source.cpp meta.parens.cpp keyword.operator.comparison.cpp", + "t": "source.cpp source.cpp meta.parens.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -309,7 +309,7 @@ }, { "c": "num_candidate", - "t": "source.cpp meta.parens.cpp", + "t": "source.cpp source.cpp meta.parens.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -320,7 +320,7 @@ }, { "c": ";", - "t": "source.cpp meta.parens.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.parens.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -331,7 +331,7 @@ }, { "c": "++", - "t": "source.cpp meta.parens.cpp keyword.operator.increment.cpp", + "t": "source.cpp source.cpp meta.parens.cpp keyword.operator.increment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -342,7 +342,7 @@ }, { "c": "i", - "t": "source.cpp meta.parens.cpp", + "t": "source.cpp source.cpp meta.parens.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -353,7 +353,7 @@ }, { "c": ")", - "t": "source.cpp meta.parens.cpp punctuation.section.parens.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.parens.cpp punctuation.section.parens.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -364,7 +364,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -375,7 +375,7 @@ }, { "c": "fprintf", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -386,7 +386,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -397,7 +397,7 @@ }, { "c": "stderr", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -408,7 +408,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -419,7 +419,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -430,7 +430,7 @@ }, { "c": "%d", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -441,7 +441,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -452,7 +452,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -463,7 +463,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -474,7 +474,7 @@ }, { "c": "user_candidate", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp variable.other.object.cpp", + "t": "source.cpp source.cpp meta.bracket.square.access.cpp variable.other.object.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -485,7 +485,7 @@ }, { "c": "[", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp", + "t": "source.cpp source.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -496,7 +496,7 @@ }, { "c": "i", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp", + "t": "source.cpp source.cpp meta.bracket.square.access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -507,7 +507,7 @@ }, { "c": "]", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp", + "t": "source.cpp source.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -518,7 +518,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -529,7 +529,7 @@ }, { "c": ";", - "t": "source.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -540,7 +540,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -551,7 +551,7 @@ }, { "c": "fprintf", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -562,7 +562,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -573,7 +573,7 @@ }, { "c": "stderr", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -584,7 +584,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -595,7 +595,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -606,7 +606,7 @@ }, { "c": ";", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -617,7 +617,7 @@ }, { "c": "\"", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -628,7 +628,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -639,7 +639,7 @@ }, { "c": ";", - "t": "source.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -650,7 +650,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -661,7 +661,7 @@ }, { "c": "endif", - "t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", + "t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -672,7 +672,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -683,7 +683,7 @@ }, { "c": "void", - "t": "source.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -694,7 +694,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -705,7 +705,7 @@ }, { "c": "main", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -716,7 +716,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -727,7 +727,7 @@ }, { "c": "O ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -738,7 +738,7 @@ }, { "c": "obj", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -749,7 +749,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -760,7 +760,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,7 +771,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -782,7 +782,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +793,7 @@ }, { "c": "LOG_INFO", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -804,7 +804,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -815,7 +815,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -826,7 +826,7 @@ }, { "c": "not hilighted as string", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -837,7 +837,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -848,7 +848,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -859,7 +859,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -870,7 +870,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -881,7 +881,7 @@ }, { "c": "LOG_INFO", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -892,7 +892,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -903,7 +903,7 @@ }, { "c": "obj ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -914,7 +914,7 @@ }, { "c": "<<", - "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -925,7 +925,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -936,7 +936,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -947,7 +947,7 @@ }, { "c": ", even worse; ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -958,7 +958,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -969,7 +969,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -980,7 +980,7 @@ }, { "c": "<<", - "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -991,7 +991,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1002,7 +1002,7 @@ }, { "c": "obj", - "t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.object.access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1013,7 +1013,7 @@ }, { "c": ".", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1024,7 +1024,7 @@ }, { "c": "x", - "t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.property.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.property.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1035,7 +1035,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1046,7 +1046,7 @@ }, { "c": "<<", - "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1057,7 +1057,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1068,7 +1068,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1079,7 +1079,7 @@ }, { "c": " check this out.", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1090,7 +1090,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1101,7 +1101,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1112,7 +1112,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1123,7 +1123,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.whitespace.comment.leading.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1134,7 +1134,7 @@ }, { "c": "//", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1145,7 +1145,7 @@ }, { "c": " everything from this point on is interpeted as a string literal...", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1156,7 +1156,7 @@ }, { "c": " O x", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1167,7 +1167,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1178,7 +1178,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1189,18 +1189,18 @@ }, { "c": "std", - "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp entity.name.type.namespace.scope-resolution.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.scope-resolution.cpp", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", + "dark_plus": "entity.name.scope-resolution: #4EC9B0", + "light_plus": "entity.name.scope-resolution: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" + "hc_black": "entity.name.scope-resolution: #4EC9B0" } }, { "c": "::", - "t": "source.cpp meta.block.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1211,7 +1211,7 @@ }, { "c": "unique_ptr", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1222,7 +1222,7 @@ }, { "c": "<", - "t": "source.cpp meta.block.cpp keyword.operator.comparison.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1233,7 +1233,7 @@ }, { "c": "O", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1244,7 +1244,7 @@ }, { "c": ">", - "t": "source.cpp meta.block.cpp keyword.operator.comparison.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.comparison.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1255,7 +1255,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1266,7 +1266,7 @@ }, { "c": "o", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1277,7 +1277,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1288,18 +1288,18 @@ }, { "c": "new", - "t": "source.cpp meta.block.cpp meta.function-call.cpp keyword.operator.wordlike.cpp alias.cpp keyword.operator.new.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.wordlike.cpp memory.cpp keyword.operator.new.cpp", "r": { - "dark_plus": "keyword.operator.new.cpp: #C586C0", - "light_plus": "keyword.operator.new.cpp: #AF00DB", + "dark_plus": "source.cpp keyword.operator.new: #C586C0", + "light_plus": "source.cpp keyword.operator.new: #AF00DB", "dark_vs": "keyword.operator.new: #569CD6", "light_vs": "keyword.operator.new: #0000FF", - "hc_black": "keyword.operator.new.cpp: #C586C0" + "hc_black": "source.cpp keyword.operator.new: #C586C0" } }, { "c": " O", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1310,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1321,7 +1321,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1332,7 +1332,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.whitespace.comment.leading.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1343,7 +1343,7 @@ }, { "c": "//", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1354,7 +1354,7 @@ }, { "c": " sadness.", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1365,7 +1365,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1376,7 +1376,7 @@ }, { "c": "sprintf", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1387,7 +1387,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1398,7 +1398,7 @@ }, { "c": "options", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1409,7 +1409,7 @@ }, { "c": ",", - "t": "source.cpp meta.block.cpp meta.function-call.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1420,7 +1420,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1431,7 +1431,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1442,7 +1442,7 @@ }, { "c": "STYLE=Keramik;TITLE=", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1453,7 +1453,7 @@ }, { "c": "%s", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1464,7 +1464,7 @@ }, { "c": ";THEME=", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1475,7 +1475,7 @@ }, { "c": "%s", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp constant.other.placeholder.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1486,7 +1486,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1497,7 +1497,7 @@ }, { "c": ",", - "t": "source.cpp meta.block.cpp meta.function-call.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1508,7 +1508,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1519,7 +1519,7 @@ }, { "c": "...", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.vararg-ellipses.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.vararg-ellipses.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1530,7 +1530,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1541,7 +1541,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1552,7 +1552,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1563,7 +1563,7 @@ }, { "c": "int", - "t": "source.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1574,7 +1574,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1585,7 +1585,7 @@ }, { "c": "main2", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1596,7 +1596,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1607,7 +1607,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1618,7 +1618,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1629,7 +1629,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1640,7 +1640,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1651,7 +1651,7 @@ }, { "c": "printf", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1662,7 +1662,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1673,7 +1673,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1684,7 +1684,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1695,7 +1695,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1706,7 +1706,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1717,7 +1717,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1728,7 +1728,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.whitespace.comment.leading.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1739,7 +1739,7 @@ }, { "c": "//", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1750,7 +1750,7 @@ }, { "c": " the rest of", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1761,7 +1761,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1771,8 +1771,118 @@ } }, { - "c": "asm(\"movw $0x38, %ax; ltr %ax\");", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "c": "asm", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp storage.type.asm.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 source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp punctuation.section.parens.begin.bracket.round.cpp", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "\"", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "movw $0x38, ", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "%a", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "x; ltr ", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "%a", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp constant.other.placeholder.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "x", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "\"", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": ")", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp meta.parens.cpp punctuation.section.parens.end.bracket.round.cpp", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ";", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1783,7 +1893,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp meta.function-call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1794,7 +1904,7 @@ }, { "c": "fn", - "t": "source.cpp meta.block.cpp meta.function-call.cpp entity.name.function.call.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.call.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1805,7 +1915,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1816,7 +1926,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1827,7 +1937,7 @@ }, { "c": "{};", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1838,7 +1948,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp meta.function-call.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1849,7 +1959,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.call.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1860,7 +1970,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1871,7 +1981,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp punctuation.whitespace.comment.leading.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.whitespace.comment.leading.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1882,7 +1992,7 @@ }, { "c": "//", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1893,7 +2003,7 @@ }, { "c": " the rest of", - "t": "source.cpp meta.block.cpp comment.line.double-slash.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -1904,7 +2014,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", diff --git a/extensions/cpp/test/colorize-results/test_cpp.json b/extensions/cpp/test/colorize-results/test_cpp.json index 9702dc50b0b..8d651f04f42 100644 --- a/extensions/cpp/test/colorize-results/test_cpp.json +++ b/extensions/cpp/test/colorize-results/test_cpp.json @@ -1,7 +1,7 @@ [ { "c": "//", - "t": "source.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", + "t": "source.cpp source.cpp comment.line.double-slash.cpp punctuation.definition.comment.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -12,7 +12,7 @@ }, { "c": " classes example", - "t": "source.cpp comment.line.double-slash.cpp", + "t": "source.cpp source.cpp comment.line.double-slash.cpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -23,7 +23,7 @@ }, { "c": "#", - "t": "source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp punctuation.definition.directive.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp punctuation.definition.directive.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -34,7 +34,7 @@ }, { "c": "include", - "t": "source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -45,7 +45,7 @@ }, { "c": " ", - "t": "source.cpp meta.preprocessor.include.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -56,7 +56,7 @@ }, { "c": "<", - "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -67,7 +67,7 @@ }, { "c": "iostream", - "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -78,7 +78,7 @@ }, { "c": ">", - "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -89,7 +89,7 @@ }, { "c": "using", - "t": "source.cpp meta.using-namespace.cpp keyword.other.using.directive.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp keyword.other.using.directive.cpp", "r": { "dark_plus": "keyword.other.using: #C586C0", "light_plus": "keyword.other.using: #AF00DB", @@ -100,7 +100,7 @@ }, { "c": " ", - "t": "source.cpp meta.using-namespace.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -111,7 +111,7 @@ }, { "c": "namespace", - "t": "source.cpp meta.using-namespace.cpp keyword.other.namespace.directive.cpp storage.type.namespace.directive.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp keyword.other.namespace.directive.cpp storage.type.namespace.directive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -122,7 +122,7 @@ }, { "c": " ", - "t": "source.cpp meta.using-namespace.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -133,18 +133,18 @@ }, { "c": "std", - "t": "source.cpp meta.using-namespace.cpp entity.name.type.namespace.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp entity.name.namespace.cpp", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", + "dark_plus": "entity.name.namespace: #4EC9B0", + "light_plus": "entity.name.namespace: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" + "hc_black": "entity.name.namespace: #4EC9B0" } }, { "c": ";", - "t": "source.cpp meta.using-namespace.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.using-namespace.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": "class", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp storage.type.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.head.class.cpp storage.type.class.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -166,7 +166,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.head.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -177,7 +177,7 @@ }, { "c": "Rectangle", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp entity.name.type.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.head.class.cpp entity.name.type.class.cpp", "r": { "dark_plus": "entity.name.type: #4EC9B0", "light_plus": "entity.name.type: #267F99", @@ -188,7 +188,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.head.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -199,7 +199,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.class.cpp meta.head.class.cpp punctuation.section.block.begin.bracket.curly.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.head.class.cpp punctuation.section.block.begin.bracket.curly.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -210,7 +210,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -221,7 +221,7 @@ }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -232,7 +232,7 @@ }, { "c": " width", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -243,7 +243,7 @@ }, { "c": ",", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -254,7 +254,7 @@ }, { "c": " height", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -265,7 +265,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -276,7 +276,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -287,7 +287,7 @@ }, { "c": "public", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp", + "t": "source.cpp 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", @@ -298,7 +298,7 @@ }, { "c": ":", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp colon.cpp", + "t": "source.cpp 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", @@ -309,7 +309,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -320,7 +320,7 @@ }, { "c": "void", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -331,7 +331,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -342,7 +342,7 @@ }, { "c": "set_values", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -353,7 +353,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -364,7 +364,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -375,7 +375,7 @@ }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -386,7 +386,7 @@ }, { "c": ",", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -397,7 +397,7 @@ }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -408,7 +408,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -419,7 +419,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -430,7 +430,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -441,7 +441,7 @@ }, { "c": "int", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -452,7 +452,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -463,7 +463,7 @@ }, { "c": "area", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -474,7 +474,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -485,7 +485,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -496,7 +496,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -507,7 +507,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -518,7 +518,7 @@ }, { "c": "return", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp keyword.control.return.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.control.return.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -529,7 +529,7 @@ }, { "c": " width", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -540,7 +540,7 @@ }, { "c": "*", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp keyword.operator.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -551,7 +551,7 @@ }, { "c": "height", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -562,7 +562,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -573,7 +573,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -584,7 +584,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.section.block.end.bracket.curly.class.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp meta.body.class.cpp punctuation.section.block.end.bracket.curly.class.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -595,7 +595,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.class.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.block.class.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -606,7 +606,7 @@ }, { "c": "void", - "t": "source.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -617,7 +617,7 @@ }, { "c": " ", - "t": "source.cpp meta.scope-resolution.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -628,18 +628,18 @@ }, { "c": "Rectangle", - "t": "source.cpp meta.scope-resolution.cpp entity.name.type.namespace.scope-resolution.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp entity.name.scope-resolution.function.definition.cpp", "r": { - "dark_plus": "entity.name.type: #4EC9B0", - "light_plus": "entity.name.type: #267F99", + "dark_plus": "entity.name.scope-resolution: #4EC9B0", + "light_plus": "entity.name.scope-resolution: #267F99", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "entity.name.type: #4EC9B0" + "hc_black": "entity.name.scope-resolution: #4EC9B0" } }, { "c": "::", - "t": "source.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp punctuation.separator.namespace.access.cpp punctuation.separator.scope-resolution.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -650,7 +650,7 @@ }, { "c": "set_values", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -661,7 +661,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -672,7 +672,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -683,7 +683,7 @@ }, { "c": "int", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -694,7 +694,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -705,7 +705,7 @@ }, { "c": "x", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -716,7 +716,7 @@ }, { "c": ",", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -727,7 +727,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -738,7 +738,7 @@ }, { "c": "int", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -749,7 +749,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -760,7 +760,7 @@ }, { "c": "y", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -771,7 +771,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -782,7 +782,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +793,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -804,7 +804,7 @@ }, { "c": " width ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -815,7 +815,7 @@ }, { "c": "=", - "t": "source.cpp meta.block.cpp keyword.operator.assignment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -826,7 +826,7 @@ }, { "c": " x", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -837,7 +837,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -848,7 +848,7 @@ }, { "c": " height ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -859,7 +859,7 @@ }, { "c": "=", - "t": "source.cpp meta.block.cpp keyword.operator.assignment.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.assignment.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -870,7 +870,7 @@ }, { "c": " y", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -881,7 +881,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -892,7 +892,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -903,7 +903,7 @@ }, { "c": "int", - "t": "source.cpp storage.type.primitive.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.qualified_type.cpp storage.type.primitive.cpp storage.type.built-in.primitive.cpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -914,7 +914,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +925,7 @@ }, { "c": "main", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp entity.name.function.definition.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -936,7 +936,7 @@ }, { "c": " ", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -947,7 +947,7 @@ }, { "c": "(", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.begin.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -958,7 +958,7 @@ }, { "c": ")", - "t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.parameters.end.bracket.round.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -969,7 +969,7 @@ }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -980,7 +980,7 @@ }, { "c": "{", - "t": "source.cpp meta.block.cpp punctuation.section.block.begin.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.head.function.definition.cpp punctuation.section.block.begin.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -991,7 +991,7 @@ }, { "c": " Rectangle rect", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1002,7 +1002,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1013,7 +1013,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1024,7 +1024,7 @@ }, { "c": "rect", - "t": "source.cpp meta.block.cpp variable.other.object.access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1035,7 +1035,7 @@ }, { "c": ".", - "t": "source.cpp meta.block.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1046,18 +1046,18 @@ }, { "c": "set_values", - "t": "source.cpp meta.block.cpp variable.other.property.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.member.cpp", "r": { - "dark_plus": "variable: #9CDCFE", - "light_plus": "variable: #001080", + "dark_plus": "entity.name.function: #DCDCAA", + "light_plus": "entity.name.function: #795E26", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "variable: #9CDCFE" + "hc_black": "entity.name.function: #DCDCAA" } }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1068,7 +1068,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.begin.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1079,7 +1079,7 @@ }, { "c": "3", - "t": "source.cpp meta.block.cpp meta.parens.block.cpp constant.numeric.decimal.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1090,7 +1090,7 @@ }, { "c": ",", - "t": "source.cpp meta.block.cpp meta.parens.block.cpp comma.cpp punctuation.separator.delimiter.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp comma.cpp punctuation.separator.delimiter.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1101,7 +1101,7 @@ }, { "c": "4", - "t": "source.cpp meta.block.cpp meta.parens.block.cpp constant.numeric.decimal.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1112,7 +1112,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp meta.parens.block.cpp punctuation.section.parens.end.bracket.round.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1123,7 +1123,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1134,7 +1134,7 @@ }, { "c": " cout ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1145,7 +1145,7 @@ }, { "c": "<<", - "t": "source.cpp meta.block.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1156,7 +1156,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1167,7 +1167,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1178,7 +1178,7 @@ }, { "c": "area: ", - "t": "source.cpp meta.block.cpp string.quoted.double.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1189,7 +1189,7 @@ }, { "c": "\"", - "t": "source.cpp meta.block.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1200,7 +1200,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1211,7 +1211,7 @@ }, { "c": "<<", - "t": "source.cpp meta.block.cpp keyword.operator.bitwise.shift.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.operator.bitwise.shift.cpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1222,7 +1222,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1233,7 +1233,7 @@ }, { "c": "rect", - "t": "source.cpp meta.block.cpp variable.other.object.access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp variable.other.object.access.cpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1244,7 +1244,7 @@ }, { "c": ".", - "t": "source.cpp meta.block.cpp punctuation.separator.dot-access.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.separator.dot-access.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1255,7 +1255,7 @@ }, { "c": "area", - "t": "source.cpp meta.block.cpp entity.name.function.member.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp entity.name.function.member.cpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -1266,7 +1266,7 @@ }, { "c": "(", - "t": "source.cpp meta.block.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1277,7 +1277,7 @@ }, { "c": ")", - "t": "source.cpp meta.block.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1288,7 +1288,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1299,7 +1299,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1310,7 @@ }, { "c": "return", - "t": "source.cpp meta.block.cpp keyword.control.return.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp keyword.control.return.cpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1321,7 +1321,7 @@ }, { "c": " ", - "t": "source.cpp meta.block.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1332,7 +1332,7 @@ }, { "c": "0", - "t": "source.cpp meta.block.cpp constant.numeric.decimal.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp constant.numeric.decimal.cpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1343,7 +1343,7 @@ }, { "c": ";", - "t": "source.cpp meta.block.cpp punctuation.terminator.statement.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.terminator.statement.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1354,7 +1354,7 @@ }, { "c": "}", - "t": "source.cpp meta.block.cpp punctuation.section.block.end.bracket.curly.cpp", + "t": "source.cpp source.cpp meta.function.definition.cpp meta.body.function.definition.cpp punctuation.section.block.end.bracket.curly.function.definition.cpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index 0b2e83c1d8d..c0104987241 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -736,7 +736,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "mocha": "^5.2.0" } } diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index bc363b1cdb2..05d800740ed 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "glob": "^7.1.2", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", diff --git a/extensions/css-language-features/server/src/test/links.test.ts b/extensions/css-language-features/server/src/test/links.test.ts new file mode 100644 index 00000000000..e8c5a068e10 --- /dev/null +++ b/extensions/css-language-features/server/src/test/links.test.ts @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import 'mocha'; +import * as assert from 'assert'; +import Uri from 'vscode-uri'; +import { resolve } from 'path'; +import { TextDocument, DocumentLink } from 'vscode-languageserver-types'; +import { WorkspaceFolder } from 'vscode-languageserver-protocol'; +import { getCSSLanguageService } from 'vscode-css-languageservice'; +import { getDocumentContext } from '../utils/documentContext'; + +export interface ItemDescription { + offset: number; + value: string; + target: string; +} + +suite('Links', () => { + const cssLanguageService = getCSSLanguageService(); + + let assertLink = function (links: DocumentLink[], expected: ItemDescription, document: TextDocument) { + let matches = links.filter(link => { + return document.offsetAt(link.range.start) === expected.offset; + }); + + assert.equal(matches.length, 1, `${expected.offset} should only existing once: Actual: ${links.map(l => document.offsetAt(l.range.start)).join(', ')}`); + let match = matches[0]; + assert.equal(document.getText(match.range), expected.value); + assert.equal(match.target, expected.target); + }; + + function assertLinks(value: string, expected: ItemDescription[], testUri: string, workspaceFolders?: WorkspaceFolder[], lang: string = 'css'): void { + const offset = value.indexOf('|'); + value = value.substr(0, offset) + value.substr(offset + 1); + + const document = TextDocument.create(testUri, lang, 0, value); + + if (!workspaceFolders) { + workspaceFolders = [{ name: 'x', uri: testUri.substr(0, testUri.lastIndexOf('/')) }]; + } + + const context = getDocumentContext(testUri, workspaceFolders); + + const stylesheet = cssLanguageService.parseStylesheet(document); + let links = cssLanguageService.findDocumentLinks(document, stylesheet, context)!; + + assert.equal(links.length, expected.length); + + for (let item of expected) { + assertLink(links, item, document); + } + } + + function getTestResource(path: string) { + return Uri.file(resolve(__dirname, '../../test/linksTestFixtures', path)).toString(); + } + + test('url links', function () { + + let testUri = getTestResource('about.css'); + let folders = [{ name: 'x', uri: getTestResource('') }]; + + assertLinks('html { background-image: url("hello.html|")', + [{ offset: 29, value: '"hello.html"', target: getTestResource('hello.html') }], testUri, folders + ); + }); + + // test('url links', function () { + + // let testUri = getTestResource('about.css'); + // let folders = [{ name: 'x', uri: getTestResource('') }]; + + // assertLinks('html { background-image: url("~foo/hello.html|")', + // [{ offset: 29, value: '"~foo/hello.html"', target: getTestResource('node_modules/foo/hello.html') }], testUri, folders + // ); + // }); +}); \ No newline at end of file diff --git a/extensions/css-language-features/server/src/utils/documentContext.ts b/extensions/css-language-features/server/src/utils/documentContext.ts index 9858ca84367..41c29989f02 100644 --- a/extensions/css-language-features/server/src/utils/documentContext.ts +++ b/extensions/css-language-features/server/src/utils/documentContext.ts @@ -7,6 +7,27 @@ import { DocumentContext } from 'vscode-css-languageservice'; import { endsWith, startsWith } from '../utils/strings'; import * as url from 'url'; import { WorkspaceFolder } from 'vscode-languageserver'; +import URI from 'vscode-uri'; +import { join, dirname } from 'path'; +import { existsSync } from 'fs'; + +function getModuleNameFromPath(path: string) { + // If a scoped module (starts with @) then get up until second instance of '/', otherwise get until first isntance of '/' + if (path[0] === '@') { + return path.substring(0, path.indexOf('/', path.indexOf('/') + 1)); + } + return path.substring(0, path.indexOf('/')); +} + +function resolvePathToModule(_moduleName: string, _relativeTo: string): string | undefined { + // resolve the module relative to the document. We can't use `require` here as the code is webpacked. + const documentFolder = dirname(URI.parse(_relativeTo).fsPath); + const packPath = join(documentFolder, 'node_modules', _moduleName, 'package.json'); + if (existsSync(packPath)) { + return URI.file(packPath).toString(); + } + return undefined; +} export function getDocumentContext(documentUri: string, workspaceFolders: WorkspaceFolder[]): DocumentContext { function getRootFolder(): string | undefined { @@ -32,6 +53,18 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp } } } + // Following [css-loader](https://github.com/webpack-contrib/css-loader#url) + // and [sass-loader's](https://github.com/webpack-contrib/sass-loader#imports) + // convention, if an import path starts with ~ then use node module resolution + // *unless* it starts with "~/" as this refers to the user's home directory. + if (ref[0] === '~' && ref[1] !== '/' && startsWith(base, 'file://')) { + const moduleName = getModuleNameFromPath(ref.substring(1)); + const modulePath = resolvePathToModule(moduleName, base); + if (modulePath) { + const pathWithinModule = ref.substring(moduleName.length + 2); + return url.resolve(modulePath, pathWithinModule); + } + } return url.resolve(base, ref); }, }; diff --git a/extensions/css-language-features/server/test/linksTestFixtures/.gitignore b/extensions/css-language-features/server/test/linksTestFixtures/.gitignore new file mode 100644 index 00000000000..d591cdfd50a --- /dev/null +++ b/extensions/css-language-features/server/test/linksTestFixtures/.gitignore @@ -0,0 +1 @@ +!/node_modules \ No newline at end of file diff --git a/extensions/css-language-features/server/test/linksTestFixtures/node_modules/foo/package.json b/extensions/css-language-features/server/test/linksTestFixtures/node_modules/foo/package.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 126653c8612..d8f2b53b982 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== ansi-regex@^3.0.0: version "3.0.0" diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock index 385d59738dd..6c3b551509a 100644 --- a/extensions/css-language-features/yarn.lock +++ b/extensions/css-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== balanced-match@^1.0.0: version "1.0.0" diff --git a/extensions/debug-auto-launch/package.json b/extensions/debug-auto-launch/package.json index 7b676cfbe60..3129c3477c5 100644 --- a/extensions/debug-auto-launch/package.json +++ b/extensions/debug-auto-launch/package.json @@ -49,6 +49,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "8.0.33" + "@types/node": "^10.14.8" } } diff --git a/extensions/debug-auto-launch/yarn.lock b/extensions/debug-auto-launch/yarn.lock index 6767cb8d8c2..e6247e29255 100644 --- a/extensions/debug-auto-launch/yarn.lock +++ b/extensions/debug-auto-launch/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@8.0.33": - version "8.0.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd" - integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/debug-server-ready/package.json b/extensions/debug-server-ready/package.json index ee66be8012d..cd006ce71e6 100644 --- a/extensions/debug-server-ready/package.json +++ b/extensions/debug-server-ready/package.json @@ -105,6 +105,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "8.0.33" + "@types/node": "^10.14.8" } } diff --git a/extensions/debug-server-ready/yarn.lock b/extensions/debug-server-ready/yarn.lock index 6767cb8d8c2..e6247e29255 100644 --- a/extensions/debug-server-ready/yarn.lock +++ b/extensions/debug-server-ready/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@8.0.33": - version "8.0.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd" - integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json index 9805a694c83..a4aa05180c3 100644 --- a/extensions/emmet/package.json +++ b/extensions/emmet/package.json @@ -439,7 +439,7 @@ "deps": "yarn add vscode-emmet-helper" }, "devDependencies": { - "@types/node": "8.0.33", + "@types/node": "^10.14.8", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "vscode": "1.0.1" diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index f332aff2e00..e548023487f 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -491,7 +491,7 @@ export function isValidLocationForEmmetAbbreviation(document: vscode.TextDocumen } let valid = true; - let foundSpace = false; // If < is found before finding whitespace, then its valid abbreviation. Eg: { +} + +export async function activate(context: ExtensionContext): Promise { + context.subscriptions.push(commands.registerCommand('git.credential', async (data: any) => { + try { + const { stdout, stderr } = await exec(`git credential ${data.command}`, { + stdin: data.stdin, + env: Object.assign(process.env, { GIT_TERMINAL_PROMPT: '0' }) + }); + return { stdout, stderr, code: 0 }; + } catch ({ stdout, stderr, error }) { + const code = error.code || 0; + if (stderr.indexOf('terminal prompts disabled') !== -1) { + stderr = ''; + } + return { stdout, stderr, code }; + } + })); +} + +export interface ExecResult { + error: Error | null; + stdout: string; + stderr: string; +} + + +export function exec(command: string, options: cp.ExecOptions & { stdin?: string } = {}) { + return new Promise((resolve, reject) => { + const child = cp.exec(command, options, (error, stdout, stderr) => { + (error ? reject : resolve)({ error, stdout, stderr }); + }); + if (options.stdin) { + child.stdin.write(options.stdin, (err: any) => { + if (err) { + reject(err); + return; + } + child.stdin.end((err: any) => { + if (err) { + reject(err); + } + }); + }); + } + }); +} diff --git a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts b/extensions/git-ui/src/typings/refs.d.ts similarity index 69% rename from src/vs/workbench/api/electron-browser/extensionHost.contribution.ts rename to extensions/git-ui/src/typings/refs.d.ts index ff53f793d50..a933431220b 100644 --- a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts +++ b/extensions/git-ui/src/typings/refs.d.ts @@ -3,5 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import '../browser/extensionHost.contribution.common'; -import './mainThreadWebview'; +/// +/// +/// \ No newline at end of file diff --git a/extensions/git-ui/tsconfig.json b/extensions/git-ui/tsconfig.json new file mode 100644 index 00000000000..27e9268b39b --- /dev/null +++ b/extensions/git-ui/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../shared.tsconfig.json", + "compilerOptions": { + "outDir": "./out", + "experimentalDecorators": true, + "typeRoots": [ + "./node_modules/@types" + ] + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/extensions/git-ui/yarn.lock b/extensions/git-ui/yarn.lock new file mode 100644 index 00000000000..b23b0ac0392 --- /dev/null +++ b/extensions/git-ui/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== diff --git a/extensions/git/package.json b/extensions/git/package.json index a6cf112f69a..22b473fd41d 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -20,7 +20,8 @@ "scripts": { "compile": "gulp compile-extension:git", "watch": "gulp watch-extension:git", - "update-grammar": "node ./build/update-grammars.js" + "update-grammar": "node ./build/update-grammars.js", + "test": "mocha" }, "contributes": { "commands": [ @@ -1458,13 +1459,14 @@ "jschardet": "^1.6.0", "vscode-extension-telemetry": "0.1.1", "vscode-nls": "^4.0.0", + "vscode-uri": "^2.0.0", "which": "^1.3.0" }, "devDependencies": { "@types/byline": "4.2.31", "@types/file-type": "^5.2.1", "@types/mocha": "2.2.43", - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "@types/which": "^1.0.28", "mocha": "^3.2.0" } diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index aa6eb1e9a59..ea3e22eec82 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -12,7 +12,8 @@ import { EventEmitter } from 'events'; import iconv = require('iconv-lite'); import * as filetype from 'file-type'; import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util'; -import { CancellationToken, Uri, workspace } from 'vscode'; +import { CancellationToken } from 'vscode'; +import { URI } from 'vscode-uri'; import { detectEncoding } from './encoding'; import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git'; @@ -557,7 +558,7 @@ export function parseGitmodules(raw: string): Submodule[] { return; } - const propertyMatch = /^\s*(\w+) = (.*)$/.exec(line); + const propertyMatch = /^\s*(\w+)\s+=\s+(.*)$/.exec(line); if (!propertyMatch) { return; @@ -636,6 +637,7 @@ export interface CommitOptions { export interface PullOptions { unshallow?: boolean; + tags?: boolean; } export enum ForcePushMode { @@ -995,7 +997,7 @@ export class Repository { break; } - const originalUri = Uri.file(path.isAbsolute(resourcePath) ? resourcePath : path.join(this.repositoryRoot, resourcePath)); + const originalUri = URI.file(path.isAbsolute(resourcePath) ? resourcePath : path.join(this.repositoryRoot, resourcePath)); let status: Status = Status.UNTRACKED; // Copy or Rename status comes with a number, e.g. 'R100'. We don't need the number, so we use only first character of the status. @@ -1023,7 +1025,7 @@ export class Repository { break; } - const uri = Uri.file(path.isAbsolute(newPath) ? newPath : path.join(this.repositoryRoot, newPath)); + const uri = URI.file(path.isAbsolute(newPath) ? newPath : path.join(this.repositoryRoot, newPath)); result.push({ uri, renameUri: uri, @@ -1363,9 +1365,8 @@ export class Repository { async pull(rebase?: boolean, remote?: string, branch?: string, options: PullOptions = {}): Promise { const args = ['pull']; - const config = workspace.getConfiguration('git', Uri.file(this.root)); - if (config.get('pullTags')) { + if (options.tags) { args.push('--tags'); } diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index e81a3be3d4e..33106400301 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -984,11 +984,12 @@ export class Repository implements Disposable { await this.maybeAutoStash(async () => { const config = workspace.getConfiguration('git', Uri.file(this.root)); const fetchOnPull = config.get('fetchOnPull'); + const tags = config.get('pullTags'); if (fetchOnPull) { - await this.repository.pull(rebase, undefined, undefined, { unshallow }); + await this.repository.pull(rebase, undefined, undefined, { unshallow, tags }); } else { - await this.repository.pull(rebase, remote, branch, { unshallow }); + await this.repository.pull(rebase, remote, branch, { unshallow, tags }); } }); }); @@ -1044,11 +1045,12 @@ export class Repository implements Disposable { await this.maybeAutoStash(async () => { const config = workspace.getConfiguration('git', Uri.file(this.root)); const fetchOnPull = config.get('fetchOnPull'); + const tags = config.get('pullTags'); if (fetchOnPull) { - await this.repository.pull(rebase); + await this.repository.pull(rebase, undefined, undefined, { tags }); } else { - await this.repository.pull(rebase, remoteName, pullBranch); + await this.repository.pull(rebase, remoteName, pullBranch, { tags }); } const remote = this.remotes.find(r => r.name === remoteName); diff --git a/extensions/git/src/test/git.test.ts b/extensions/git/src/test/git.test.ts index e28cf10d192..f0444ce5795 100644 --- a/extensions/git/src/test/git.test.ts +++ b/extensions/git/src/test/git.test.ts @@ -172,6 +172,17 @@ suite('git', () => { { name: 'deps/spdlog4', path: 'deps/spdlog4', url: 'https://github.com/gabime/spdlog4.git' } ]); }); + + test('whitespace #74844', () => { + const sample = `[submodule "deps/spdlog"] + path = deps/spdlog + url = https://github.com/gabime/spdlog.git +`; + + assert.deepEqual(parseGitmodules(sample), [ + { name: 'deps/spdlog', path: 'deps/spdlog', url: 'https://github.com/gabime/spdlog.git' } + ]); + }); }); suite('parseGitCommit', () => { diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock index f13ef93c34f..1f2ea8aed42 100644 --- a/extensions/git/yarn.lock +++ b/extensions/git/yarn.lock @@ -26,10 +26,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ== -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== "@types/which@^1.0.28": version "1.0.28" @@ -325,6 +325,11 @@ vscode-nls@^4.0.0: resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002" integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw== +vscode-uri@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.0.0.tgz#2df704222f72b8a71ff266ba0830ed6c51ac1542" + integrity sha512-lWXWofDSYD8r/TIyu64MdwB4FaSirQ608PP/TzUyslyOeHGwQ0eTHUZeJrK1ILOmwUHaJtV693m2JoUYroUDpw== + which@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json index 74fa452028a..75957f87064 100644 --- a/extensions/grunt/package.json +++ b/extensions/grunt/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/grunt/yarn.lock b/extensions/grunt/yarn.lock index 1bcd757b8a1..e6247e29255 100644 --- a/extensions/grunt/yarn.lock +++ b/extensions/grunt/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json index a9139780f7a..7115e7e770f 100644 --- a/extensions/gulp/package.json +++ b/extensions/gulp/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/gulp/yarn.lock b/extensions/gulp/yarn.lock index 1bcd757b8a1..e6247e29255 100644 --- a/extensions/gulp/yarn.lock +++ b/extensions/gulp/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index e44dc9f7102..d3d4db6dc15 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -180,6 +180,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" } } diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 7c90bfb52c9..dd930a80bb2 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "glob": "^7.1.2", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 6bdbac4e1a2..f3b5a845d2a 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== ansi-regex@^3.0.0: version "3.0.0" diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock index a0667775d59..7665682bf37 100644 --- a/extensions/html-language-features/yarn.lock +++ b/extensions/html-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== applicationinsights@1.0.8: version "1.0.8" diff --git a/extensions/ini/package.json b/extensions/ini/package.json index abe1dbecc65..b439b4c6701 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -17,9 +17,9 @@ }, { "id": "properties", - "extensions": [ ".properties", ".cfg", ".conf", ".desktop", ".directory" ], + "extensions": [ ".properties", ".cfg", ".conf", ".directory" ], "filenames": [ ".gitattributes", ".gitconfig", "gitconfig", ".editorconfig" ], - "filenamePatterns": [ "**/.git/config" ], + "filenamePatterns": [ "**/.config/git/config", "**/.git/config" ], "aliases": [ "Properties", "properties" ], "configuration": "./properties.language-configuration.json" }], diff --git a/extensions/jake/package.json b/extensions/jake/package.json index 30962bd7616..93bb838ed54 100644 --- a/extensions/jake/package.json +++ b/extensions/jake/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/jake/yarn.lock b/extensions/jake/yarn.lock index 1bcd757b8a1..e6247e29255 100644 --- a/extensions/jake/yarn.lock +++ b/extensions/jake/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index 9dc4f87d9f0..2ee9f740947 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -107,6 +107,6 @@ "request-light": "^0.2.4" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" } } diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index 1f73cea2295..054c0fe0178 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" }, "scripts": { "prepublishOnly": "npm run clean && npm run test", diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 3f0383a8c4f..c7e54ce8845 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== agent-base@4, agent-base@^4.1.0: version "4.1.2" diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock index 758f96fd511..0f11fa9d58d 100644 --- a/extensions/json-language-features/yarn.lock +++ b/extensions/json-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== agent-base@4, agent-base@^4.1.0: version "4.2.1" diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index 10431185034..5637b6061da 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -303,7 +303,7 @@ "build-preview": "webpack --mode development" }, "dependencies": { - "highlight.js": "9.13.1", + "highlight.js": "9.15.8", "markdown-it": "^8.4.2", "markdown-it-front-matter": "^0.1.2", "vscode-extension-telemetry": "0.1.1", @@ -313,7 +313,7 @@ "@types/highlight.js": "9.12.3", "@types/lodash.throttle": "^4.1.3", "@types/markdown-it": "0.0.2", - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "lodash.throttle": "^4.1.1", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", diff --git a/extensions/markdown-language-features/yarn.lock b/extensions/markdown-language-features/yarn.lock index e85ae950b3a..a1b876e7dc8 100644 --- a/extensions/markdown-language-features/yarn.lock +++ b/extensions/markdown-language-features/yarn.lock @@ -29,10 +29,10 @@ resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660" integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA= -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== abbrev@1: version "1.1.1" @@ -2933,10 +2933,10 @@ he@1.1.1: resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= -highlight.js@9.13.1: - version "9.13.1" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.13.1.tgz#054586d53a6863311168488a0f58d6c505ce641e" - integrity sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A== +highlight.js@9.15.8: + version "9.15.8" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.8.tgz#f344fda123f36f1a65490e932cf90569e4999971" + integrity sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA== hmac-drbg@^1.0.0: version "1.0.1" diff --git a/extensions/merge-conflict/package.json b/extensions/merge-conflict/package.json index e017edebf7b..3485db0e65f 100644 --- a/extensions/merge-conflict/package.json +++ b/extensions/merge-conflict/package.json @@ -137,6 +137,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "8.0.33" + "@types/node": "^10.14.8" } } diff --git a/extensions/merge-conflict/yarn.lock b/extensions/merge-conflict/yarn.lock index 6767cb8d8c2..e6247e29255 100644 --- a/extensions/merge-conflict/yarn.lock +++ b/extensions/merge-conflict/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@8.0.33": - version "8.0.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd" - integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/npm/package.json b/extensions/npm/package.json index 43dc6a21557..7da5968737c 100644 --- a/extensions/npm/package.json +++ b/extensions/npm/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "@types/minimatch": "^3.0.3", - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/npm/yarn.lock b/extensions/npm/yarn.lock index ca339ed8150..e80a4ca5a2d 100644 --- a/extensions/npm/yarn.lock +++ b/extensions/npm/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== agent-base@4, agent-base@^4.1.0: version "4.2.0" diff --git a/extensions/objective-c/build/update-grammars.js b/extensions/objective-c/build/update-grammars.js new file mode 100644 index 00000000000..52dd76e06a1 --- /dev/null +++ b/extensions/objective-c/build/update-grammars.js @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +var updateGrammar = require('../../../build/npm/update-grammar'); + +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objc.tmLanguage.json', './syntaxes/objective-c.tmLanguage.json'); +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objcpp.tmLanguage.json', './syntaxes/objective-c++.tmLanguage.json'); + diff --git a/extensions/objective-c/cgmanifest.json b/extensions/objective-c/cgmanifest.json index a73bf659af5..fc610c254ee 100644 --- a/extensions/objective-c/cgmanifest.json +++ b/extensions/objective-c/cgmanifest.json @@ -4,27 +4,14 @@ "component": { "type": "git", "git": { - "name": "atom/language-objective-c", - "repositoryUrl": "https://github.com/atom/language-objective-c", - "commitHash": "7fdf0c40ec1d592a902ed6a7cf5565bdf12e2ae8" + "name": "jeff-hykin/cpp-textmate-grammar", + "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", + "commitHash": "efa8ce61762d0481a1b710fdbc12e284867cdc8f" } }, "license": "MIT", - "description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the Atom package https://github.com/atom/language-objective-c which was originally converted from the TextMate bundle https://github.com/textmate/objective-c.tmbundle.", - "version": "0.15.0" - }, - { - "component": { - "type": "git", - "git": { - "name": "atom/language-c", - "repositoryUrl": "https://github.com/atom/language-c", - "commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c" - } - }, - "license": "MIT", - "version": "0.58.1", - "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." + "version": "1.11.0", + "description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the language package https://github.com/jeff-hykin/cpp-textmate-grammar." } ], "version": 1 diff --git a/extensions/objective-c/package.json b/extensions/objective-c/package.json index 944b68e0538..2fcbd2643ab 100644 --- a/extensions/objective-c/package.json +++ b/extensions/objective-c/package.json @@ -8,7 +8,7 @@ "vscode": "*" }, "scripts": { - "update-grammar": "node ../../build/npm/update-grammar.js atom/language-objective-c grammars/objective-c.cson ./syntaxes/objective-c.tmLanguage.json && node ../../build/npm/update-grammar.js atom/language-objective-c grammars/objective-c%2B%2B.cson ./syntaxes/objective-c++.tmLanguage.json" + "update-grammar": "node ./build/update-grammars.js" }, "contributes": { "languages": [ diff --git a/extensions/objective-c/syntaxes/cpp.tmLanguage.json b/extensions/objective-c/syntaxes/cpp.tmLanguage.json deleted file mode 100644 index 059ce9442db..00000000000 --- a/extensions/objective-c/syntaxes/cpp.tmLanguage.json +++ /dev/null @@ -1,447 +0,0 @@ -{ - "information_for_contributors": [ - "This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson", - "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-c/commit/3a269f88b12e512fb9495dc006a1dabf325d3d7f", - "name": "C++", - "scopeName": "source.cppold", - "patterns": [ - { - "include": "#special_block" - }, - { - "include": "#strings" - }, - { - "match": "\\b(friend|explicit|virtual|override|final|noexcept)\\b", - "name": "storage.modifier.cpp" - }, - { - "match": "\\b(private:|protected:|public:)", - "name": "storage.modifier.cpp" - }, - { - "match": "\\b(catch|operator|try|throw|using)\\b", - "name": "keyword.control.cpp" - }, - { - "match": "\\bdelete\\b(\\s*\\[\\])?|\\bnew\\b(?!])", - "name": "keyword.control.cpp" - }, - { - "match": "\\b(f|m)[A-Z]\\w*\\b", - "name": "variable.other.readwrite.member.cpp" - }, - { - "match": "\\bthis\\b", - "name": "variable.language.this.cpp" - }, - { - "match": "\\bnullptr\\b", - "name": "constant.language.cpp" - }, - { - "match": "\\btemplate\\b\\s*", - "name": "storage.type.template.cpp" - }, - { - "match": "\\b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\\b\\s*", - "name": "keyword.operator.cast.cpp" - }, - { - "match": "::", - "name": "punctuation.separator.namespace.access.cpp" - }, - { - "match": "\\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\b", - "name": "keyword.operator.cpp" - }, - { - "match": "\\b(class|decltype|wchar_t|char16_t|char32_t)\\b", - "name": "storage.type.cpp" - }, - { - "match": "\\b(constexpr|export|mutable|typename|thread_local)\\b", - "name": "storage.modifier.cpp" - }, - { - "begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?", - "name": "meta.angle-brackets.cpp", - "patterns": [ - { - "include": "#angle_brackets" - }, - { - "include": "$base" - } - ] - }, - "block": { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.block.begin.bracket.curly.c" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.block.end.bracket.curly.c" - } - }, - "name": "meta.block.cpp", - "patterns": [ - { - "captures": { - "1": { - "name": "support.function.any-method.c" - }, - "2": { - "name": "punctuation.definition.parameters.c" - } - }, - "match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket", - "name": "meta.function-call.c" - }, - { - "include": "$base" - } - ] - }, - "constructor": { - "patterns": [ - { - "begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket", - "beginCaptures": { - "1": { - "name": "entity.name.function.cpp" - }, - "2": { - "name": "punctuation.definition.parameters.begin.c" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.parameters.end.c" - } - }, - "name": "meta.function.constructor.cpp", - "patterns": [ - { - "include": "$base" - } - ] - }, - { - "begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.parameters.c" - } - }, - "end": "(?=\\{)", - "name": "meta.function.constructor.initializer-list.cpp", - "patterns": [ - { - "include": "$base" - } - ] - } - ] - }, - "special_block": { - "patterns": [ - { - "begin": "\\b(using)\\b\\s*(namespace)\\b\\s*((?:[_A-Za-z][_A-Za-z0-9]*\\b(::)?)*)", - "beginCaptures": { - "1": { - "name": "keyword.control.cpp" - }, - "2": { - "name": "storage.type.cpp" - }, - "3": { - "name": "entity.name.type.cpp" - } - }, - "end": "(;)", - "name": "meta.using-namespace-declaration.cpp" - }, - { - "begin": "\\b(namespace)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+", - "beginCaptures": { - "1": { - "name": "storage.type.cpp" - }, - "2": { - "name": "entity.name.type.cpp" - } - }, - "captures": { - "1": { - "name": "keyword.control.namespace.$2" - } - }, - "end": "(?<=\\})|(?=(;|,|\\(|\\)|>|\\[|\\]|=))", - "name": "meta.namespace-block.cpp", - "patterns": [ - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.scope.cpp" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.scope.cpp" - } - }, - "patterns": [ - { - "include": "#special_block" - }, - { - "include": "#constructor" - }, - { - "include": "$base" - } - ] - }, - { - "include": "$base" - } - ] - }, - { - "begin": "\\b(class|struct)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?", - "beginCaptures": { - "1": { - "name": "storage.type.cpp" - }, - "2": { - "name": "entity.name.type.cpp" - }, - "4": { - "name": "storage.type.modifier.cpp" - }, - "5": { - "name": "entity.name.type.inherited.cpp" - }, - "6": { - "patterns": [ - { - "match": "(public|protected|private)", - "name": "storage.type.modifier.cpp" - }, - { - "match": "[_A-Za-z][_A-Za-z0-9]*", - "name": "entity.name.type.inherited.cpp" - } - ] - } - }, - "end": "(?<=\\})|(?=(;|\\(|\\)|>|\\[|\\]|=))", - "name": "meta.class-struct-block.cpp", - "patterns": [ - { - "include": "#angle_brackets" - }, - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.block.begin.bracket.curly.cpp" - } - }, - "end": "(\\})(\\s*\\n)?", - "endCaptures": { - "1": { - "name": "punctuation.section.block.end.bracket.curly.cpp" - }, - "2": { - "name": "invalid.illegal.you-forgot-semicolon.cpp" - } - }, - "patterns": [ - { - "include": "#special_block" - }, - { - "include": "#constructor" - }, - { - "include": "$base" - } - ] - }, - { - "include": "$base" - } - ] - }, - { - "begin": "\\b(extern)(?=\\s*\")", - "beginCaptures": { - "1": { - "name": "storage.modifier.cpp" - } - }, - "end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)", - "name": "meta.extern-block.cpp", - "patterns": [ - { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.section.block.begin.bracket.curly.c" - } - }, - "end": "\\}|(?=\\s*#\\s*endif\\b)", - "endCaptures": { - "0": { - "name": "punctuation.section.block.end.bracket.curly.c" - } - }, - "patterns": [ - { - "include": "#special_block" - }, - { - "include": "$base" - } - ] - }, - { - "include": "$base" - } - ] - } - ] - }, - "strings": { - "patterns": [ - { - "begin": "(u|u8|U|L)?\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.cpp" - }, - "1": { - "name": "meta.encoding.cpp" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.cpp" - } - }, - "name": "string.quoted.double.cpp", - "patterns": [ - { - "match": "\\\\u\\h{4}|\\\\U\\h{8}", - "name": "constant.character.escape.cpp" - }, - { - "match": "\\\\['\"?\\\\abfnrtv]", - "name": "constant.character.escape.cpp" - }, - { - "match": "\\\\[0-7]{1,3}", - "name": "constant.character.escape.cpp" - }, - { - "match": "\\\\x\\h+", - "name": "constant.character.escape.cpp" - }, - { - "include": "source.c#string_placeholder" - } - ] - }, - { - "begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.cpp" - }, - "1": { - "name": "meta.encoding.cpp" - }, - "3": { - "name": "invalid.illegal.delimiter-too-long.cpp" - } - }, - "end": "\\)\\2(\\3)\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.cpp" - }, - "1": { - "name": "invalid.illegal.delimiter-too-long.cpp" - } - }, - "name": "string.quoted.double.raw.cpp" - } - ] - } - } -} \ No newline at end of file diff --git a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json index 8c48f5282d3..5f5f57ccc7a 100644 --- a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json @@ -1,18 +1,7098 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c%2B%2B.cson", + "This file has been converted from https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master//syntaxes/objcpp.tmLanguage.json", "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-objective-c/commit/7fdf0c40ec1d592a902ed6a7cf5565bdf12e2ae8", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/8d3cf8028835c68e75e42d0bd3192c837847a419", "name": "Objective-C++", "scopeName": "source.objcpp", "patterns": [ { - "include": "source.cppold" + "include": "#cpp_lang" }, { - "include": "source.objc" + "begin": "((@)(interface|protocol))(?!.+;)\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*((:)(?:\\s*)([A-Za-z][A-Za-z0-9]*))?(\\s|\\n)?", + "captures": { + "1": { + "name": "storage.type.objcpp" + }, + "2": { + "name": "punctuation.definition.storage.type.objcpp" + }, + "4": { + "name": "entity.name.type.objcpp" + }, + "6": { + "name": "punctuation.definition.entity.other.inherited-class.objcpp" + }, + "7": { + "name": "entity.other.inherited-class.objcpp" + }, + "8": { + "name": "meta.divider.objcpp" + }, + "9": { + "name": "meta.inherited-class.objcpp" + } + }, + "contentName": "meta.scope.interface.objcpp", + "end": "((@)end)\\b", + "name": "meta.interface-or-protocol.objcpp", + "patterns": [ + { + "include": "#interface_innards" + } + ] + }, + { + "begin": "((@)(implementation))\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*(?::\\s*([A-Za-z][A-Za-z0-9]*))?", + "captures": { + "1": { + "name": "storage.type.objcpp" + }, + "2": { + "name": "punctuation.definition.storage.type.objcpp" + }, + "4": { + "name": "entity.name.type.objcpp" + }, + "5": { + "name": "entity.other.inherited-class.objcpp" + } + }, + "contentName": "meta.scope.implementation.objcpp", + "end": "((@)end)\\b", + "name": "meta.implementation.objcpp", + "patterns": [ + { + "include": "#implementation_innards" + } + ] + }, + { + "begin": "@\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "match": "(?x)%\n\t\t\t\t\t\t(\\d+\\$)? # field (argument #)\n\t\t\t\t\t\t[#0\\- +']* # flags\n\t\t\t\t\t\t((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n\t\t\t\t\t\t(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n\t\t\t\t\t\t[@] # conversion type\n\t\t\t\t\t", + "name": "constant.other.placeholder.objcpp" + }, + { + "include": "#string_placeholder" + } + ] + }, + { + "begin": "\\b(id)\\s*(?=<)", + "beginCaptures": { + "1": { + "name": "storage.type.objcpp" + } + }, + "end": "(?<=>)", + "name": "meta.id-with-protocol.objcpp", + "patterns": [ + { + "include": "#protocol_list" + } + ] + }, + { + "match": "\\b(NS_DURING|NS_HANDLER|NS_ENDHANDLER)\\b", + "name": "keyword.control.macro.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "(@)(try|catch|finally|throw)\\b", + "name": "keyword.control.exception.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "(@)(synchronized)\\b", + "name": "keyword.control.synchronize.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "(@)(required|optional)\\b", + "name": "keyword.control.protocol-specification.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "(@)(defs|encode)\\b", + "name": "keyword.other.objcpp" + }, + { + "match": "\\bid\\b", + "name": "storage.type.id.objcpp" + }, + { + "match": "\\b(IBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class|instancetype)\\b", + "name": "storage.type.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.storage.type.objcpp" + } + }, + "match": "(@)(class|protocol)\\b", + "name": "storage.type.objcpp" + }, + { + "begin": "((@)selector)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "storage.type.objcpp" + }, + "2": { + "name": "punctuation.definition.storage.type.objcpp" + }, + "3": { + "name": "punctuation.definition.storage.type.objcpp" + } + }, + "contentName": "meta.selector.method-name.objcpp", + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.definition.storage.type.objcpp" + } + }, + "name": "meta.selector.objcpp", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "match": "\\b(?:[a-zA-Z_:][\\w]*)+", + "name": "support.function.any-method.name-of-parameter.objcpp" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.storage.modifier.objcpp" + } + }, + "match": "(@)(synchronized|public|package|private|protected)\\b", + "name": "storage.modifier.objcpp" + }, + { + "match": "\\b(YES|NO|Nil|nil)\\b", + "name": "constant.language.objcpp" + }, + { + "match": "\\bNSApp\\b", + "name": "support.variable.foundation.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.whitespace.support.function.cocoa.leopard.objcpp" + }, + "2": { + "name": "support.function.cocoa.leopard.objcpp" + } + }, + "match": "(\\s*)\\b(NS(Rect(ToCGRect|FromCGRect)|MakeCollectable|S(tringFromProtocol|ize(ToCGSize|FromCGSize))|Draw(NinePartImage|ThreePartImage)|P(oint(ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))\\b" + }, + { + "captures": { + "1": { + "name": "punctuation.whitespace.support.function.leading.cocoa.objcpp" + }, + "2": { + "name": "support.function.cocoa.objcpp" + } + }, + "match": "(\\s*)\\b(NS(R(ound(DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(CriticalAlertPanel(RelativeToWindow)?|InformationalAlertPanel(RelativeToWindow)?|AlertPanel(RelativeToWindow)?)|e(set(MapTable|HashTable)|c(ycleZone|t(Clip(List)?|F(ill(UsingOperation|List(UsingOperation|With(Grays|Colors(UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(dPixel|l(MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(s)?|WindowServerMemory|AlertPanel)|M(i(n(X|Y)|d(X|Y))|ouseInRect|a(p(Remove|Get|Member|Insert(IfAbsent|KnownAbsent)?)|ke(R(ect|ange)|Size|Point)|x(Range|X|Y)))|B(itsPer(SampleFromDepth|PixelFromDepth)|e(stDepth|ep|gin(CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(ho(uldRetainWithZone|w(sServicesMenuItem|AnimationEffect))|tringFrom(R(ect|ange)|MapTable|S(ize|elector)|HashTable|Class|Point)|izeFromString|e(t(ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(Big(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|Short|Host(ShortTo(Big|Little)|IntTo(Big|Little)|DoubleTo(Big|Little)|FloatTo(Big|Little)|Long(To(Big|Little)|LongTo(Big|Little)))|Int|Double|Float|L(ittle(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|ong(Long)?)))|H(ighlightRect|o(stByteOrder|meDirectory(ForUser)?)|eight|ash(Remove|Get|Insert(IfAbsent|KnownAbsent)?)|FSType(CodeFromFileType|OfFile))|N(umberOfColorComponents|ext(MapEnumeratorPair|HashEnumeratorItem))|C(o(n(tainsRect|vert(GlyphsToPackedGlyphs|Swapped(DoubleToHost|FloatToHost)|Host(DoubleToSwapped|FloatToSwapped)))|unt(MapTable|HashTable|Frames|Windows(ForContext)?)|py(M(emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(MapTables|HashTables))|lassFromString|reate(MapTable(WithZone)?|HashTable(WithZone)?|Zone|File(namePboardType|ContentsPboardType)))|TemporaryDirectory|I(s(ControllerMarker|EmptyRect|FreedObject)|n(setRect|crementExtraRefCount|te(r(sect(sRect|ionR(ect|ange))|faceStyleForKey)|gralRect)))|Zone(Realloc|Malloc|Name|Calloc|Fr(omPointer|ee))|O(penStepRootDirectory|ffsetRect)|D(i(sableScreenUpdates|videRect)|ottedFrameRect|e(c(imal(Round|Multiply|S(tring|ubtract)|Normalize|Co(py|mpa(ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(MemoryPages|Object))|raw(Gr(oove|ayBezel)|B(itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(hiteBezel|indowBackground)|LightBezel))|U(serName|n(ionR(ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(Bundle(Setup|Cleanup)|Setup(VirtualMachine)?|Needs(ToLoadClasses|VirtualMachine)|ClassesF(orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(oint(InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(n(d(MapTableEnumeration|HashTableEnumeration)|umerate(MapTable|HashTable)|ableScreenUpdates)|qual(R(ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(ileTypeForHFSTypeCode|ullUserName|r(ee(MapTable|HashTable)|ame(Rect(WithWidth(UsingOperation)?)?|Address)))|Wi(ndowList(ForContext)?|dth)|Lo(cationInRange|g(v|PageSize)?)|A(ccessibility(R(oleDescription(ForUIElement)?|aiseBadArgumentException)|Unignored(Children(ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(Main|Load)|vailableWindowDepths|ll(MapTable(Values|Keys)|HashTableObjects|ocate(MemoryPages|Collectable|Object)))))\\b" + }, + { + "match": "\\bNS(RuleEditor|G(arbageCollector|radient)|MapTable|HashTable|Co(ndition|llectionView(Item)?)|T(oolbarItemGroup|extInputClient|r(eeNode|ackingArea))|InvocationOperation|Operation(Queue)?|D(ictionaryController|ockTile)|P(ointer(Functions|Array)|athC(o(ntrol(Delegate)?|mponentCell)|ell(Delegate)?)|r(intPanelAccessorizing|edicateEditor(RowTemplate)?))|ViewController|FastEnumeration|Animat(ionContext|ablePropertyContainer))\\b", + "name": "support.class.cocoa.leopard.objcpp" + }, + { + "match": "\\bNS(R(u(nLoop|ler(Marker|View))|e(sponder|cursiveLock|lativeSpecifier)|an(domSpecifier|geSpecifier))|G(etCommand|lyph(Generator|Storage|Info)|raphicsContext)|XML(Node|D(ocument|TD(Node)?)|Parser|Element)|M(iddleSpecifier|ov(ie(View)?|eCommand)|utable(S(tring|et)|C(haracterSet|opying)|IndexSet|D(ictionary|ata)|URLRequest|ParagraphStyle|A(ttributedString|rray))|e(ssagePort(NameServer)?|nu(Item(Cell)?|View)?|t(hodSignature|adata(Item|Query(ResultGroup|AttributeValueTuple)?)))|a(ch(BootstrapServer|Port)|trix))|B(itmapImageRep|ox|u(ndle|tton(Cell)?)|ezierPath|rowser(Cell)?)|S(hadow|c(anner|r(ipt(SuiteRegistry|C(o(ercionHandler|mmand(Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(er|View)|een))|t(epper(Cell)?|atus(Bar|Item)|r(ing|eam))|imple(HorizontalTypesetter|CString)|o(cketPort(NameServer)?|und|rtDescriptor)|p(e(cifierTest|ech(Recognizer|Synthesizer)|ll(Server|Checker))|litView)|e(cureTextField(Cell)?|t(Command)?|archField(Cell)?|rializer|gmentedC(ontrol|ell))|lider(Cell)?|avePanel)|H(ost|TTP(Cookie(Storage)?|URLResponse)|elpManager)|N(ib(Con(nector|trolConnector)|OutletConnector)?|otification(Center|Queue)?|u(ll|mber(Formatter)?)|etService(Browser)?|ameSpecifier)|C(ha(ngeSpelling|racterSet)|o(n(stantString|nection|trol(ler)?|ditionLock)|d(ing|er)|unt(Command|edSet)|pying|lor(Space|P(ick(ing(Custom|Default)|er)|anel)|Well|List)?|m(p(oundPredicate|arisonPredicate)|boBox(Cell)?))|u(stomImageRep|rsor)|IImageRep|ell|l(ipView|o(seCommand|neCommand)|assDescription)|a(ched(ImageRep|URLResponse)|lendar(Date)?)|reateCommand)|T(hread|ypesetter|ime(Zone|r)|o(olbar(Item(Validations)?)?|kenField(Cell)?)|ext(Block|Storage|Container|Tab(le(Block)?)?|Input|View|Field(Cell)?|List|Attachment(Cell)?)?|a(sk|b(le(Header(Cell|View)|Column|View)|View(Item)?))|reeController)|I(n(dex(S(pecifier|et)|Path)|put(Manager|S(tream|erv(iceProvider|er(MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(Rep|Cell|View)?)|O(ut(putStream|lineView)|pen(GL(Context|Pixel(Buffer|Format)|View)|Panel)|bj(CTypeSerializationCallBack|ect(Controller)?))|D(i(st(antObject(Request)?|ributed(NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(Controller)?|e(serializer|cimalNumber(Behaviors|Handler)?|leteCommand)|at(e(Components|Picker(Cell)?|Formatter)?|a)|ra(wer|ggingInfo))|U(ser(InterfaceValidations|Defaults(Controller)?)|RL(Re(sponse|quest)|Handle(Client)?|C(onnection|ache|redential(Storage)?)|Download(Delegate)?|Prot(ocol(Client)?|ectionSpace)|AuthenticationChallenge(Sender)?)?|n(iqueIDSpecifier|doManager|archiver))|P(ipe|o(sitionalSpecifier|pUpButton(Cell)?|rt(Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(steboard|nel|ragraphStyle|geLayout)|r(int(Info|er|Operation|Panel)|o(cessInfo|tocolChecker|perty(Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(numerator|vent|PSImageRep|rror|x(ception|istsCommand|pression))|V(iew(Animation)?|al(idated(ToobarItem|UserInterfaceItem)|ue(Transformer)?))|Keyed(Unarchiver|Archiver)|Qui(ckDrawView|tCommand)|F(ile(Manager|Handle|Wrapper)|o(nt(Manager|Descriptor|Panel)?|rm(Cell|atter)))|W(hoseSpecifier|indow(Controller)?|orkspace)|L(o(c(k(ing)?|ale)|gicalTest)|evelIndicator(Cell)?|ayoutManager)|A(ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(ication|e(Script|Event(Manager|Descriptor)))|ffineTransform|lert|r(chiver|ray(Controller)?)))\\b", + "name": "support.class.cocoa.objcpp" + }, + { + "match": "\\bNS(R(oundingMode|ule(Editor(RowType|NestingMode)|rOrientation)|e(questUserAttentionType|lativePosition))|G(lyphInscription|radientDrawingOptions)|XML(NodeKind|D(ocumentContentKind|TDNodeKind)|ParserError)|M(ultibyteGlyphPacking|apTableOptions)|B(itmapFormat|oxType|ezierPathElement|ackgroundStyle|rowserDropOperation)|S(tr(ing(CompareOptions|DrawingOptions|EncodingConversionOptions)|eam(Status|Event))|p(eechBoundary|litViewDividerStyle)|e(archPathD(irectory|omainMask)|gmentS(tyle|witchTracking))|liderType|aveOptions)|H(TTPCookieAcceptPolicy|ashTableOptions)|N(otification(SuspensionBehavior|Coalescing)|umberFormatter(RoundingMode|Behavior|Style|PadPosition)|etService(sError|Options))|C(haracterCollection|o(lor(RenderingIntent|SpaceModel|PanelMode)|mp(oundPredicateType|arisonPredicateModifier))|ellStateValue|al(culationError|endarUnit))|T(ypesetterControlCharacterAction|imeZoneNameStyle|e(stComparisonOperation|xt(Block(Dimension|V(erticalAlignment|alueType)|Layer)|TableLayoutAlgorithm|FieldBezelStyle))|ableView(SelectionHighlightStyle|ColumnAutoresizingStyle)|rackingAreaOptions)|I(n(sertionPosition|te(rfaceStyle|ger))|mage(RepLoadStatus|Scaling|CacheMode|FrameStyle|LoadStatus|Alignment))|Ope(nGLPixelFormatAttribute|rationQueuePriority)|Date(Picker(Mode|Style)|Formatter(Behavior|Style))|U(RL(RequestCachePolicy|HandleStatus|C(acheStoragePolicy|redentialPersistence))|Integer)|P(o(stingStyle|int(ingDeviceType|erFunctionsOptions)|pUpArrowPosition)|athStyle|r(int(ing(Orientation|PaginationMode)|erTableStatus|PanelOptions)|opertyList(MutabilityOptions|Format)|edicateOperatorType))|ExpressionType|KeyValue(SetMutationKind|Change)|QTMovieLoopMode|F(indPanel(SubstringMatchType|Action)|o(nt(RenderingMode|FamilyClass)|cusRingPlacement))|W(hoseSubelementIdentifier|ind(ingRule|ow(B(utton|ackingLocation)|SharingType|CollectionBehavior)))|L(ine(MovementDirection|SweepDirection|CapStyle|JoinStyle)|evelIndicatorStyle)|Animation(BlockingMode|Curve))\\b", + "name": "support.type.cocoa.leopard.objcpp" + }, + { + "match": "\\bC(I(Sampler|Co(ntext|lor)|Image(Accumulator)?|PlugIn(Registration)?|Vector|Kernel|Filter(Generator|Shape)?)|A(Renderer|MediaTiming(Function)?|BasicAnimation|ScrollLayer|Constraint(LayoutManager)?|T(iledLayer|extLayer|rans(ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(nimation(Group)?|ction)))\\b", + "name": "support.class.quartz.objcpp" + }, + { + "match": "\\bC(G(Float|Point|Size|Rect)|IFormat|AConstraintAttribute)\\b", + "name": "support.type.quartz.objcpp" + }, + { + "match": "\\bNS(R(ect(Edge)?|ange)|G(lyph(Relation|LayoutMode)?|radientType)|M(odalSession|a(trixMode|p(Table|Enumerator)))|B(itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(cr(oll(er(Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(Granularity|Direction|Affinity)|wapped(Double|Float)|aveOperationType)|Ha(sh(Table|Enumerator)|ndler(2)?)|C(o(ntrol(Size|Tint)|mp(ositingOperation|arisonResult))|ell(State|Type|ImagePosition|Attribute))|T(hreadPrivate|ypesetterGlyphInfo|i(ckMarkPosition|tlePosition|meInterval)|o(ol(TipTag|bar(SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(TabType|Alignment)|ab(State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(ContextAuxiliary|PixelFormatAuxiliary)|D(ocumentChangeType|atePickerElementFlags|ra(werState|gOperation))|UsableScrollerParts|P(oint|r(intingPageOrder|ogressIndicator(Style|Th(ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(nt(SymbolicTraits|TraitMask|Action)|cusRingType)|W(indow(OrderingMode|Depth)|orkspace(IconCreationOptions|LaunchOptions)|ritingDirection)|L(ineBreakMode|ayout(Status|Direction))|A(nimation(Progress|Effect)|ppl(ication(TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle))\\b", + "name": "support.type.cocoa.objcpp" + }, + { + "match": "\\bNS(NotFound|Ordered(Ascending|Descending|Same))\\b", + "name": "support.constant.cocoa.objcpp" + }, + { + "match": "\\bNS(MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification\\b", + "name": "support.constant.notification.cocoa.leopard.objcpp" + }, + { + "match": "\\bNS(Menu(Did(RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(ystemColorsDidChange|plitView(DidResizeSubviews|WillResizeSubviews))|C(o(nt(extHelpModeDid(Deactivate|Activate)|rolT(intDidChange|extDid(BeginEditing|Change|EndEditing)))|lor(PanelColorDidChange|ListDidChange)|mboBox(Selection(IsChanging|DidChange)|Will(Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(oolbar(DidRemoveItem|WillAddItem)|ext(Storage(DidProcessEditing|WillProcessEditing)|Did(BeginEditing|Change|EndEditing)|View(DidChange(Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)))|ImageRepRegistryDidChange|OutlineView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)|Item(Did(Collapse|Expand)|Will(Collapse|Expand)))|Drawer(Did(Close|Open)|Will(Close|Open))|PopUpButton(CellWillPopUp|WillPopUp)|View(GlobalFrameDidChange|BoundsDidChange|F(ocusDidChange|rameDidChange))|FontSetChanged|W(indow(Did(Resi(ze|gn(Main|Key))|M(iniaturize|ove)|Become(Main|Key)|ChangeScreen(|Profile)|Deminiaturize|Update|E(ndSheet|xpose))|Will(M(iniaturize|ove)|BeginSheet|Close))|orkspace(SessionDid(ResignActive|BecomeActive)|Did(Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(Sleep|Unmount|PowerOff|LaunchApplication)))|A(ntialiasThresholdChanged|ppl(ication(Did(ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(nhide|pdate)|FinishLaunching)|Will(ResignActive|BecomeActive|Hide|Terminate|U(nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification\\b", + "name": "support.constant.notification.cocoa.objcpp" + }, + { + "match": "\\bNS(RuleEditor(RowType(Simple|Compound)|NestingMode(Si(ngle|mple)|Compound|List))|GradientDraws(BeforeStartingLocation|AfterEndingLocation)|M(inusSetExpressionType|a(chPortDeallocate(ReceiveRight|SendRight|None)|pTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(oxCustom|undleExecutableArchitecture(X86|I386|PPC(64)?)|etweenPredicateOperatorType|ackgroundStyle(Raised|Dark|L(ight|owered)))|S(tring(DrawingTruncatesLastVisibleLine|EncodingConversion(ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(e(ech(SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(GrammarFlag|SpellingFlag))|litViewDividerStyleThi(n|ck))|e(rvice(RequestTimedOutError|M(iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(inimum|aximum)|Application(NotFoundError|LaunchFailedError))|gmentStyle(Round(Rect|ed)|SmallSquare|Capsule|Textured(Rounded|Square)|Automatic)))|H(UDWindowMask|ashTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(oModeColorPanel|etServiceNoAutoRename)|C(hangeRedone|o(ntainsPredicateOperatorType|l(orRenderingIntent(RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(None|ContentArea|TrackableArea|EditableTextArea))|T(imeZoneNameStyle(S(hort(Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(Regular|SourceList)|racking(Mouse(Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(ssumeInside|ctive(In(KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(n(tersectSetExpressionType|dexedColorSpaceModel)|mageScale(None|Proportionally(Down|UpOrDown)|AxesIndependently))|Ope(nGLPFAAllowOfflineRenderers|rationQueue(DefaultMaxConcurrentOperationCount|Priority(High|Normal|Very(High|Low)|Low)))|D(iacriticInsensitiveSearch|ownloadsDirectory)|U(nionSetExpressionType|TF(16(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(ointerFunctions(Ma(chVirtualMemory|llocMemory)|Str(ongMemory|uctPersonality)|C(StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(paque(Memory|Personality)|bjectP(ointerPersonality|ersonality)))|at(hStyle(Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(Scaling|Copies|Orientation|P(a(perSize|ge(Range|SetupAccessory))|review)))|Executable(RuntimeMismatchError|NotLoadableError|ErrorM(inimum|aximum)|L(inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(Initial|Prior)|F(i(ndPanelSubstringMatchType(StartsWith|Contains|EndsWith|FullWord)|leRead(TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(ndow(BackingLocation(MainMemory|Default|VideoMemory)|Sharing(Read(Only|Write)|None)|CollectionBehavior(MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType)\\b", + "name": "support.constant.cocoa.leopard.objcpp" + }, + { + "match": "\\bNS(R(GB(ModeColorPanel|ColorSpaceModel)|ight(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey)|ound(RectBezelStyle|Bankers|ed(BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(CapStyle|JoinStyle))|un(StoppedResponse|ContinuesResponse|AbortedResponse)|e(s(izableWindowMask|et(CursorRectsRunLoopOrdering|FunctionKey))|ce(ssedBezelStyle|iver(sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(evancyLevelIndicatorStyle|ative(Before|After))|gular(SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(n(domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(ModeMatrix|Button)))|G(IFFileType|lyph(Below|Inscribe(B(elow|ase)|Over(strike|Below)|Above)|Layout(WithPrevious|A(tAPoint|gainstAPoint))|A(ttribute(BidiLevel|Soft|Inscribe|Elastic)|bove))|r(ooveBorder|eaterThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|a(y(ModeColorPanel|ColorSpaceModel)|dient(None|Con(cave(Strong|Weak)|vex(Strong|Weak)))|phiteControlTint)))|XML(N(o(tationDeclarationKind|de(CompactEmptyElement|IsCDATA|OptionsNone|Use(SingleQuotes|DoubleQuotes)|Pre(serve(NamespaceOrder|C(haracterReferences|DATA)|DTD|Prefixes|E(ntities|mptyElements)|Quotes|Whitespace|A(ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(ocument(X(MLKind|HTMLKind|Include)|HTMLKind|T(idy(XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(arser(GTRequiredError|XMLDeclNot(StartedError|FinishedError)|Mi(splaced(XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(StartedError|FinishedError))|S(t(andaloneValueError|ringNot(StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(MTOKENRequiredError|o(t(ationNot(StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(haracterRef(In(DTDError|PrologError|EpilogError)|AtEOFError)|o(nditionalSectionNot(StartedError|FinishedError)|mment(NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(ternalError|valid(HexCharacterRefError|C(haracter(RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(NameError|Error)))|OutOfMemoryError|D(ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(RI(RequiredError|FragmentError)|n(declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(MissingSemiError|NoNameError|In(Internal(SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(ocessingInstructionNot(StartedError|FinishedError)|ematureDocumentEndError))|E(n(codingNotSupportedError|tity(Ref(In(DTDError|PrologError|EpilogError)|erence(MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(StartedError|FinishedError)|Is(ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(StartedError|FinishedError)|xt(ernalS(tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(iteralNot(StartedError|FinishedError)|T(RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(RedefinedError|HasNoValueError|Not(StartedError|FinishedError)|ListNot(StartedError|FinishedError)))|rocessingInstructionKind)|E(ntity(GeneralKind|DeclarationKind|UnparsedKind|P(ar(sedKind|ameterKind)|redefined))|lement(Declaration(MixedKind|UndefinedKind|E(lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(N(MToken(sKind|Kind)|otationKind)|CDATAKind|ID(Ref(sKind|Kind)|Kind)|DeclarationKind|En(tit(yKind|iesKind)|umerationKind)|Kind))|M(i(n(XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(nthCalendarUnit|deSwitchFunctionKey|use(Moved(Mask)?|E(ntered(Mask)?|ventSubtype|xited(Mask)?))|veToBezierPathElement|mentary(ChangeButton|Push(Button|InButton)|Light(Button)?))|enuFunctionKey|a(c(intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(XEdge|YEdge))|ACHOperatingSystem)|B(MPFileType|o(ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(Se(condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(zelBorder|velLineJoinStyle|low(Bottom|Top)|gin(sWith(Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(spaceCharacter|tabTextMovement|ingStore(Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(owser(NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(h(ift(JISStringEncoding|KeyMask)|ow(ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(s(ReqFunctionKey|tem(D(omainMask|efined(Mask)?)|FunctionKey))|mbolStringEncoding)|c(a(nnedOption|le(None|ToFit|Proportionally))|r(oll(er(NoPart|Increment(Page|Line|Arrow)|Decrement(Page|Line|Arrow)|Knob(Slot)?|Arrows(M(inEnd|axEnd)|None|DefaultSetting))|Wheel(Mask)?|LockFunctionKey)|eenChangedEventType))|t(opFunctionKey|r(ingDrawing(OneShot|DisableScreenFontSubstitution|Uses(DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(Status(Reading|NotOpen|Closed|Open(ing)?|Error|Writing|AtEnd)|Event(Has(BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(ndEncountered|rrorOccurred)))))|i(ngle(DateMode|UnderlineStyle)|ze(DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(condCalendarUnit|lect(By(Character|Paragraph|Word)|i(ng(Next|Previous)|onAffinity(Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(Momentary|Select(One|Any)))|quareLineCapStyle|witchButton|ave(ToOperation|Op(tions(Yes|No|Ask)|eration)|AsOperation)|mall(SquareBezelStyle|C(ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(ighlightModeMatrix|SBModeColorPanel|o(ur(Minute(SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(Never|OnlyFromMainDocumentDomain|Always)|e(lp(ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(MonthDa(yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(o(n(StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(ification(SuspensionBehavior(Hold|Coalesce|D(eliverImmediately|rop))|NoCoalescing|CoalescingOn(Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(cr(iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(itle|opLevelContainersSpecifierError|abs(BezelBorder|NoBorder|LineBorder))|I(nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(ll(Glyph|CellType)|m(eric(Search|PadKeyMask)|berFormatter(Round(Half(Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(10|Default)|S(cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(ercentStyle|ad(Before(Suffix|Prefix)|After(Suffix|Prefix))))))|e(t(Services(BadArgumentError|NotFoundError|C(ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(t(iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(hange(ReadOtherContents|GrayCell(Mask)?|BackgroundCell(Mask)?|Cleared|Done|Undone|Autosaved)|MYK(ModeColorPanel|ColorSpaceModel)|ircular(BezelStyle|Slider)|o(n(stantValueExpressionType|t(inuousCapacityLevelIndicatorStyle|entsCellMask|ain(sComparison|erSpecifierError)|rol(Glyph|KeyMask))|densedFontMask)|lor(Panel(RGBModeMask|GrayModeMask|HSBModeMask|C(MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(p(osite(XOR|Source(In|O(ut|ver)|Atop)|Highlight|C(opy|lear)|Destination(In|O(ut|ver)|Atop)|Plus(Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(stom(SelectorPredicateOperatorType|PaletteModeColorPanel)|r(sor(Update(Mask)?|PointingDevice)|veToBezierPathElement))|e(nterT(extAlignment|abStopType)|ll(State|H(ighlighted|as(Image(Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(Bordered|InsetButton)|Disabled|Editable|LightsBy(Gray|Background|Contents)|AllowsMixedState))|l(ipPagination|o(s(ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(ControlTint|DisplayFunctionKey|LineFunctionKey))|a(seInsensitive(Search|PredicateOption)|n(notCreateScriptCommandError|cel(Button|TextMovement))|chesDirectory|lculation(NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(itical(Request|AlertStyle)|ayonModeColorPanel))|T(hick(SquareBezelStyle|erSquareBezelStyle)|ypesetter(Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(ineBreakAction|atestBehavior))|i(ckMark(Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(olbarItemVisibilityPriority(Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(Compression(N(one|EXT)|CCITTFAX(3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(rminate(Now|Cancel|Later)|xt(Read(InapplicableDocumentTypeError|WriteErrorM(inimum|aximum))|Block(M(i(nimum(Height|Width)|ddleAlignment)|a(rgin|ximum(Height|Width)))|B(o(ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(Characters|Attributes)|CellType|ured(RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(Character|TextMovement|le(tP(oint(Mask|EventSubtype)?|roximity(Mask|EventSubtype)?)|Column(NoResizing|UserResizingMask|AutoresizingMask)|View(ReverseSequentialColumnAutoresizingStyle|GridNone|S(olid(HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(n(sert(CharFunctionKey|FunctionKey|LineFunctionKey)|t(Type|ernalS(criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(2022JPStringEncoding|Latin(1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(R(ight|ep(MatchesDevice|LoadStatus(ReadingHeader|Completed|InvalidData|Un(expectedEOF|knownType)|WillNeedAllData)))|Below|C(ellType|ache(BySize|Never|Default|Always))|Interpolation(High|None|Default|Low)|O(nly|verlaps)|Frame(Gr(oove|ayBezel)|Button|None|Photo)|L(oadStatus(ReadError|C(ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(lign(Right|Bottom(Right|Left)?|Center|Top(Right|Left)?|Left)|bove)))|O(n(State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|TextMovement)|SF1OperatingSystem|pe(n(GL(GO(Re(setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(R(obust|endererID)|M(inimumPolicy|ulti(sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(creenMask|te(ncilSize|reo)|ingleRenderer|upersample|ample(s|Buffers|Alpha))|NoRecovery|C(o(lor(Size|Float)|mpliant)|losestPolicy)|OffScreen|D(oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(cc(umSize|elerated)|ux(Buffers|DepthStencil)|l(phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(B(itfield|oolType)|S(hortType|tr(ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(Type|longType)|ArrayType))|D(i(s(c(losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(Selection|PredicateModifier))|o(c(ModalWindowMask|ument(Directory|ationDirectory))|ubleType|wn(TextMovement|ArrowFunctionKey))|e(s(cendingPageOrder|ktopDirectory)|cimalTabStopType|v(ice(NColorSpaceModel|IndependentModifierFlagsMask)|eloper(Directory|ApplicationDirectory))|fault(ControlTint|TokenStyle)|lete(Char(acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(yCalendarUnit|teFormatter(MediumStyle|Behavior(10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(wer(Clos(ingState|edState)|Open(ingState|State))|gOperation(Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(ser(CancelledError|D(irectory|omainMask)|FunctionKey)|RL(Handle(NotLoaded|Load(Succeeded|InProgress|Failed))|CredentialPersistence(None|Permanent|ForSession))|n(scaledWindowMask|cachedRead|i(codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(o(CloseGroupingRunLoopOrdering|FunctionKey)|e(finedDateComponent|rline(Style(Single|None|Thick|Double)|Pattern(Solid|D(ot|ash(Dot(Dot)?)?)))))|known(ColorSpaceModel|P(ointingDevice|ageOrder)|KeyS(criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(ustifiedTextAlignment|PEG(2000FileType|FileType)|apaneseEUC(GlyphPacking|StringEncoding))|P(o(s(t(Now|erFontMask|WhenIdle|ASAP)|iti(on(Replace|Be(fore|ginning)|End|After)|ve(IntType|DoubleType|FloatType)))|pUp(NoArrow|ArrowAt(Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(InCell(Mask)?|OnPushOffButton)|e(n(TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(Mask)?)|P(S(caleField|tatus(Title|Field)|aveButton)|N(ote(Title|Field)|ame(Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(a(perFeedButton|ge(Range(To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(useFunctionKey|ragraphSeparatorCharacter|ge(DownFunctionKey|UpFunctionKey))|r(int(ing(ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(NotFound|OK|Error)|FunctionKey)|o(p(ertyList(XMLFormat|MutableContainers(AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(BarStyle|SpinningStyle|Preferred(SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(ssedTab|vFunctionKey))|L(HeightForm|CancelButton|TitleField|ImageButton|O(KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(n(terCharacter|d(sWith(Comparison|PredicateOperatorType)|FunctionKey))|v(e(nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(Comparison|PredicateOperatorType)|ra(serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(clude(10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(i(ew(M(in(XMargin|YMargin)|ax(XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(lidationErrorM(inimum|aximum)|riableExpressionType))|Key(SpecifierEvaluationScriptError|Down(Mask)?|Up(Mask)?|PathExpressionType|Value(MinusSetMutation|SetSetMutation|Change(Re(placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(New|Old)|UnionSetMutation|ValidationError))|QTMovie(NormalPlayback|Looping(BackAndForthPlayback|Playback))|F(1(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(nd(PanelAction(Replace(A(ndFind|ll(InSelection)?))?|S(howFindPanel|e(tFindString|lectAll(InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(Read(No(SuchFileError|PermissionError)|CorruptFileError|In(validFileNameError|applicableStringEncodingError)|Un(supportedSchemeError|knownError))|HandlingPanel(CancelButton|OKButton)|NoSuchFileError|ErrorM(inimum|aximum)|Write(NoPermissionError|In(validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(nt(Mo(noSpaceTrait|dernSerifsClass)|BoldTrait|S(ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(o(ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(ntegerAdvancementsRenderingMode|talicTrait)|O(ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(nknownClass|IOptimizedTrait)|Panel(S(hadowEffectModeMask|t(andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(amilyClassMask|reeformSerifsClass)|Antialiased(RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(Below|Type(None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(attingError(M(inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(ExpressionType|KeyMask)|3(1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(RevertButton|S(ize(Title|Field)|etButton)|CurrentField|Preview(Button|Field))|l(oat(ingPointSamplesBitmapFormat|Type)|agsChanged(Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(heelModeColorPanel|indow(s(NTOperatingSystem|CP125(1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(InterfaceStyle|OperatingSystem))|M(iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(ctivation|ddingToRecents)|A(sync|nd(Hide(Others)?|Print)|llowingClassicStartup))|eek(day(CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(ntsBidiLevels|rningAlertStyle)|r(itingDirection(RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(i(stModeMatrix|ne(Moves(Right|Down|Up|Left)|B(order|reakBy(C(harWrapping|lipping)|Truncating(Middle|Head|Tail)|WordWrapping))|S(eparatorCharacter|weep(Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(ssThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey))|a(yout(RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(sc(iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(y(Type|PredicateModifier|EventMask)|choredSearch|imation(Blocking|Nonblocking(Threaded)?|E(ffect(DisappearingItemDefault|Poof)|ase(In(Out)?|Out))|Linear)|dPredicateType)|t(Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(obe(GB1CharacterCollection|CNS1CharacterCollection|Japan(1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(saveOperation|Pagination)|pp(lication(SupportDirectory|D(irectory|e(fined(Mask)?|legateReply(Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(Mask)?)|l(ternateKeyMask|pha(ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(sWrongScriptError|EvaluationScriptError)|bove(Bottom|Top)|WTEventType))\\b", + "name": "support.constant.cocoa.objcpp" + }, + { + "include": "#c_lang" + }, + { + "include": "#bracketed_content" } - ] + ], + "repository": { + "c_lang": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled" + }, + { + "include": "#preprocessor-rule-disabled" + }, + { + "include": "#preprocessor-rule-conditional" + }, + { + "include": "#comments" + }, + { + "include": "#switch_statement" + }, + { + "match": "\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\b", + "name": "keyword.control.objcpp" + }, + { + "include": "#storage_types" + }, + { + "match": "typedef", + "name": "keyword.other.typedef.objcpp" + }, + { + "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b", + "name": "storage.modifier.objcpp" + }, + { + "match": "\\bk[A-Z]\\w*\\b", + "name": "constant.other.variable.mac-classic.objcpp" + }, + { + "match": "\\bg[A-Z]\\w*\\b", + "name": "variable.other.readwrite.global.mac-classic.objcpp" + }, + { + "match": "\\bs[A-Z]\\w*\\b", + "name": "variable.other.readwrite.static.mac-classic.objcpp" + }, + { + "match": "\\b(NULL|true|false|TRUE|FALSE)\\b", + "name": "constant.language.objcpp" + }, + { + "include": "#operators" + }, + { + "include": "#numbers" + }, + { + "include": "#strings" + }, + { + "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+\t# define\n((?[a-zA-Z_$][\\w$]*))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.objcpp" + }, + "2": { + "name": "punctuation.definition.directive.objcpp" + }, + "3": { + "name": "entity.name.function.preprocessor.objcpp" + }, + "5": { + "name": "punctuation.definition.parameters.begin.objcpp" + }, + "6": { + "name": "variable.parameter.preprocessor.objcpp" + }, + "8": { + "name": "punctuation.separator.parameters.objcpp" + }, + "9": { + "name": "punctuation.definition.parameters.end.objcpp" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.other.lt-gt.include.objcpp" + } + ] + }, + { + "include": "#pragma-mark" + }, + { + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.objcpp" + }, + "2": { + "name": "punctuation.definition.directive.objcpp" + } + }, + "end": "(?=(?://|/\\*))|(?\\]\\)]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))", + "captures": { + "1": { + "name": "variable.parameter.probably.objcpp" + } + } + }, + "access-method": { + "name": "meta.function-call.member.objcpp", + "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.object.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + }, + "4": { + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.dot-access.objcpp" + }, + { + "match": "->", + "name": "punctuation.separator.pointer-access.objcpp" + }, + { + "match": "[a-zA-Z_][a-zA-Z_0-9]*", + "name": "variable.object.objcpp" + }, + { + "name": "everything.else.objcpp", + "match": ".+" + } + ] + }, + "5": { + "name": "entity.name.function.member.objcpp" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "block": { + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "name": "meta.block.objcpp", + "patterns": [ + { + "include": "#block_innards" + } + ] + } + ] + }, + "block_innards": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-block" + }, + { + "include": "#preprocessor-rule-disabled-block" + }, + { + "include": "#preprocessor-rule-conditional-block" + }, + { + "include": "#method_access" + }, + { + "include": "#member_access" + }, + { + "include": "#c_function_call" + }, + { + "name": "meta.initialization.objcpp", + "begin": "(?x)\n(?:\n (?:\n\t(?=\\s)(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "variable.other.objcpp" + }, + "2": { + "name": "punctuation.section.parens.begin.bracket.round.initialization.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.initialization.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "patterns": [ + { + "include": "#block_innards" + } + ] + }, + { + "include": "#parens-block" + }, + { + "include": "$base" + } + ] + }, + "c_function_call": { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.objcpp", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "comments": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.objcpp" + } + }, + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", + "name": "comment.block.objcpp" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.objcpp" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.objcpp" + } + }, + "name": "comment.block.objcpp" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.objcpp" + } + }, + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", + "name": "comment.line.banner.objcpp" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.objcpp" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.objcpp" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.objcpp", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "end": "^\\s*#\\s*endif\\b", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + "line_continuation_character": { + "patterns": [ + { + "match": "(\\\\)\\n", + "captures": { + "1": { + "name": "constant.character.escape.line-continuation.objcpp" + } + } + } + ] + }, + "parens": { + "name": "meta.parens.objcpp", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "$base" + } + ] + }, + "parens-block": { + "name": "meta.parens.block.objcpp", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#block_innards" + }, + { + "match": "(?-mix:(?>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.objcpp" + }, + { + "match": "<<|>>", + "name": "keyword.operator.bitwise.shift.objcpp" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.objcpp" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.objcpp" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.objcpp" + }, + { + "match": "=", + "name": "keyword.operator.assignment.objcpp" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.objcpp" + }, + { + "begin": "(\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.objcpp" + } + }, + "end": "(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + }, + { + "include": "#line_continuation_character" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.single.objcpp", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#line_continuation_character" + } + ] + } + ] + }, + "string_escaped_char": { + "patterns": [ + { + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.objcpp" + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type", + "name": "constant.other.placeholder.objcpp" + }, + { + "match": "(%)(?!\"\\s*(PRI|SCN))", + "captures": { + "1": { + "name": "invalid.illegal.placeholder.objcpp" + } + } + } + ] + }, + "storage_types": { + "patterns": [ + { + "match": "(?-mix:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objcpp" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objcpp" + }, + "2": { + "name": "punctuation.section.parameters.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "include": "$base" + } + ] + }, + "function-call-innards": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#storage_types" + }, + { + "include": "#method_access" + }, + { + "include": "#member_access" + }, + { + "include": "#operators" + }, + { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objcpp" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "include": "#block_innards" + } + ] + }, + "default_statement": { + "name": "meta.conditional.case.objcpp", + "begin": "((?\\[\\]=]))", + "patterns": [ + { + "name": "meta.head.switch.objcpp", + "begin": "\\G ?", + "end": "((?:\\{|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.switch.objcpp" + } + }, + "patterns": [ + { + "include": "#switch_conditional_parentheses" + }, + { + "include": "$base" + } + ] + }, + { + "name": "meta.body.switch.objcpp", + "begin": "(?<=\\{)", + "end": "(\\})", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.switch.objcpp" + } + }, + "patterns": [ + { + "include": "#default_statement" + }, + { + "include": "#case_statement" + }, + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + { + "name": "meta.tail.switch.objcpp", + "begin": "(?<=})[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "switch_conditional_parentheses": { + "name": "meta.conditional.switch.objcpp", + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.objcpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.conditional.switch.objcpp" + } + }, + "patterns": [ + { + "include": "#conditional_context" + } + ] + }, + "static_assert": { + "begin": "(static_assert|_Static_assert)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.static_assert.objcpp" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "name": "meta.static_assert.message.objcpp", + "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.delimiter.objcpp" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#string_context" + }, + { + "include": "#string_context_c" + } + ] + }, + { + "include": "#function_call_context" + } + ] + }, + "conditional_context": { + "patterns": [ + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + "member_access": { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", + "captures": { + "1": { + "name": "variable.other.object.access.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + } + } + } + ] + }, + "5": { + "name": "variable.other.member.objcpp" + } + } + }, + "method_access": { + "contentName": "meta.function-call.member.objcpp", + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.access.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + } + } + } + ] + }, + "5": { + "name": "entity.name.function.member.objcpp" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.objcpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "numbers": { + "begin": "(?", + "endCaptures": { + "0": { + "name": "meta.template.angle-brackets.end.objcpp" + } + }, + "name": "template.definition.objcpp", + "patterns": [ + { + "include": "#template_definition_argument" + } + ] + }, + "template_definition_argument": { + "match": "\\s*(?:([a-zA-Z_][a-zA-Z_0-9]*\\s*)|((?:[a-zA-Z_][a-zA-Z_0-9]*\\s+)*)([a-zA-Z_][a-zA-Z_0-9]*)|([a-zA-Z_][a-zA-Z_0-9]*)\\s*(\\.\\.\\.)\\s*([a-zA-Z_][a-zA-Z_0-9]*)|((?:[a-zA-Z_][a-zA-Z_0-9]*\\s+)*)([a-zA-Z_][a-zA-Z_0-9]*)\\s*(=)\\s*(\\w+))(,|(?=>))", + "captures": { + "1": { + "name": "storage.type.template.objcpp" + }, + "2": { + "name": "storage.type.template.objcpp" + }, + "3": { + "name": "entity.name.type.template.objcpp" + }, + "4": { + "name": "storage.type.template.objcpp" + }, + "5": { + "name": "meta.template.operator.ellipsis.objcpp" + }, + "6": { + "name": "entity.name.type.template.objcpp" + }, + "7": { + "name": "storage.type.template.objcpp" + }, + "8": { + "name": "entity.name.type.template.objcpp" + }, + "9": { + "name": "keyword.operator.assignment.objcpp" + }, + "10": { + "name": "constant.language.objcpp" + }, + "11": { + "name": "meta.template.operator.comma.objcpp" + } + } + }, + "angle_brackets": { + "begin": "<", + "end": ">", + "name": "meta.angle-brackets.objcpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "include": "$base" + } + ] + }, + "block": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "name": "meta.block.objcpp", + "patterns": [ + { + "captures": { + "1": { + "name": "support.function.any-method.objcpp" + }, + "2": { + "name": "punctuation.definition.parameters.objcpp" + } + }, + "match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket", + "name": "meta.function-call.objcpp" + }, + { + "include": "$base" + } + ] + }, + "constructor": { + "patterns": [ + { + "begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "entity.name.function.constructor.objcpp" + }, + "2": { + "name": "punctuation.definition.parameters.begin.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.objcpp" + } + }, + "name": "meta.function.constructor.objcpp", + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards" + } + ] + }, + { + "begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.parameters.objcpp" + } + }, + "end": "(?=\\{)", + "name": "meta.function.constructor.initializer-list.objcpp", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "special_block": { + "patterns": [ + { + "begin": "\\b(using)\\b\\s*(namespace)\\b\\s*((?:[_A-Za-z][_A-Za-z0-9]*\\b(::)?)*)", + "beginCaptures": { + "1": { + "name": "keyword.control.objcpp" + }, + "2": { + "name": "storage.type.namespace.objcpp" + }, + "3": { + "name": "entity.name.type.objcpp" + } + }, + "end": ";", + "endCaptures": { + "0": { + "name": "punctuation.terminator.statement.objcpp" + } + }, + "name": "meta.using-namespace-declaration.objcpp" + }, + { + "begin": "\\b(namespace)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+", + "beginCaptures": { + "1": { + "name": "storage.type.namespace.objcpp" + }, + "2": { + "name": "entity.name.type.objcpp" + } + }, + "captures": { + "1": { + "name": "keyword.control.namespace.$2.objcpp" + } + }, + "end": "(?<=\\})|(?=(;|,|\\(|\\)|>|\\[|\\]|=))", + "name": "meta.namespace-block.objcpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.scope.objcpp" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.scope.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(?:(class)|(struct))\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?", + "beginCaptures": { + "1": { + "name": "storage.type.class.objcpp" + }, + "2": { + "name": "storage.type.struct.objcpp" + }, + "3": { + "name": "entity.name.type.objcpp" + }, + "5": { + "name": "storage.type.modifier.access.objcpp" + }, + "6": { + "name": "entity.name.type.inherited.objcpp" + }, + "7": { + "patterns": [ + { + "match": "(public|protected|private)", + "name": "storage.type.modifier.access.objcpp" + }, + { + "match": "[_A-Za-z][_A-Za-z0-9]*", + "name": "entity.name.type.inherited.objcpp" + } + ] + } + }, + "end": "(?<=\\})|(?=(;|\\(|\\)|>|\\[|\\]|=))", + "name": "meta.class-struct-block.objcpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "(\\})(\\s*\\n)?", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + }, + "2": { + "name": "invalid.illegal.you-forgot-semicolon.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(extern)(?=\\s*\")", + "beginCaptures": { + "1": { + "name": "storage.modifier.objcpp" + } + }, + "end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)", + "name": "meta.extern-block.objcpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "\\}|(?=\\s*#\\s*endif\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "(u|u8|U|L)?\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + }, + "1": { + "name": "meta.encoding.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "match": "\\\\u\\h{4}|\\\\U\\h{8}", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\['\"?\\\\abfnrtv]", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\[0-7]{1,3}", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\x\\h+", + "name": "constant.character.escape.objcpp" + }, + { + "include": "#string_placeholder" + } + ] + }, + { + "begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + }, + "1": { + "name": "meta.encoding.objcpp" + }, + "3": { + "name": "invalid.illegal.delimiter-too-long.objcpp" + } + }, + "end": "\\)\\2(\\3)\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + }, + "1": { + "name": "invalid.illegal.delimiter-too-long.objcpp" + } + }, + "name": "string.quoted.double.raw.objcpp" + } + ] + } + } + }, + "cpp_lang_newish": { + "patterns": [ + { + "include": "#special_block" + }, + { + "match": "(?-mix:##[a-zA-Z_]\\w*(?!\\w))", + "name": "variable.other.macro.argument.objcpp" + }, + { + "include": "#strings" + }, + { + "match": "(?[a-zA-Z_$][\\w$]*))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.objcpp" + }, + "2": { + "name": "punctuation.definition.directive.objcpp" + }, + "3": { + "name": "entity.name.function.preprocessor.objcpp" + }, + "5": { + "name": "punctuation.definition.parameters.begin.objcpp" + }, + "6": { + "name": "variable.parameter.preprocessor.objcpp" + }, + "8": { + "name": "punctuation.separator.parameters.objcpp" + }, + "9": { + "name": "punctuation.definition.parameters.end.objcpp" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.other.lt-gt.include.objcpp" + } + ] + }, + { + "include": "#pragma-mark" + }, + { + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.objcpp" + }, + "2": { + "name": "punctuation.definition.directive.objcpp" + } + }, + "end": "(?=(?://|/\\*))|(?,\\w])*>\\s*", + "captures": { + "0": { + "name": "meta.template.call.objcpp", + "patterns": [ + { + "include": "#storage_types_c" + }, + { + "include": "#constants" + }, + { + "include": "#scope_resolution" + }, + { + "match": "(?))", + "endCaptures": { + "1": { + "name": "punctuation.section.angle-brackets.end.template.definition.objcpp" + } + }, + "patterns": [ + { + "include": "#scope_resolution" + }, + { + "include": "#template_definition_argument" + }, + { + "include": "#template_call_innards" + } + ] + }, + "template_definition_argument": { + "match": "((?:(?:(?:(?:(?:(?:\\s*([a-zA-Z_]\\w*)|((?:[a-zA-Z_]\\w*\\s+)+)([a-zA-Z_]\\w*)))|([a-zA-Z_]\\w*)\\s*(\\.\\.\\.)\\s*([a-zA-Z_]\\w*)))|((?:[a-zA-Z_]\\w*\\s+)*)([a-zA-Z_]\\w*)\\s*([=])\\s*(\\w+)))\\s*(?:(?:(,)|(?=>))))", + "captures": { + "2": { + "name": "storage.type.template.argument.$1.objcpp" + }, + "3": { + "name": "storage.type.template.argument.$2.objcpp" + }, + "4": { + "name": "entity.name.type.template.objcpp" + }, + "5": { + "name": "storage.type.template.objcpp" + }, + "6": { + "name": "keyword.operator.ellipsis.template.definition.objcpp" + }, + "7": { + "name": "entity.name.type.template.objcpp" + }, + "8": { + "name": "storage.type.template.objcpp" + }, + "9": { + "name": "entity.name.type.template.objcpp" + }, + "10": { + "name": "keyword.operator.assignment.objcpp" + }, + "11": { + "name": "constant.other.objcpp" + }, + "12": { + "name": "punctuation.separator.comma.template.argument.objcpp" + } + } + }, + "scope_resolution": { + "match": "((?:[a-zA-Z_]\\w*\\s*(?:(?:<(?:[\\s<>,\\w])*>\\s*))?::)*\\s*)([a-zA-Z_]\\w*)\\s*((?:<(?:[\\s<>,\\w])*>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution" + } + ] + }, + "2": { + "name": "entity.name.namespace.scope-resolution.objcpp" + }, + "3": { + "patterns": [ + { + "include": "#template_call_innards" + } + ] + }, + "4": { + "name": "punctuation.separator.namespace.access.objcpp" + } + }, + "name": "meta.scope-resolution.objcpp" + }, + "angle_brackets": { + "begin": "<", + "end": ">", + "name": "meta.angle-brackets.objcpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "include": "$base" + } + ] + }, + "block": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "name": "meta.block.objcpp", + "patterns": [ + { + "captures": { + "1": { + "name": "support.function.any-method.objcpp" + }, + "2": { + "name": "punctuation.definition.parameters.objcpp" + } + }, + "match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|return)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket", + "name": "meta.function-call.objcpp" + }, + { + "include": "$base" + } + ] + }, + "constructor": { + "patterns": [ + { + "begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "entity.name.function.constructor.objcpp" + }, + "2": { + "name": "punctuation.definition.parameters.begin.constructor.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.constructor.objcpp" + } + }, + "name": "meta.function.constructor.objcpp", + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards-c" + } + ] + }, + { + "begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.initializer-list.parameters.objcpp" + } + }, + "end": "(?=\\{)", + "name": "meta.function.constructor.initializer-list.objcpp", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "special_block": { + "patterns": [ + { + "comment": "https://en.cppreference.com/w/cpp/language/namespace", + "begin": "\\b(using)\\s+(namespace)\\s+(?:((?:[a-zA-Z_]\\w*\\s*(?:(?:<(?:[\\s<>,\\w])*>\\s*))?::)*)\\s*)?((?,\\w])*>\\s*))?::)*[a-zA-Z_]\\w*)|(?={)))", + "beginCaptures": { + "1": { + "name": "keyword.other.namespace.definition.objcpp storage.type.namespace.definition.objcpp" + }, + "2": { + "patterns": [ + { + "match": "(?-mix:(?|\\[|\\]|=))", + "name": "meta.namespace-block.objcpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.scope.objcpp" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.scope.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(?:(class)|(struct))\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?", + "beginCaptures": { + "1": { + "name": "storage.type.class.objcpp" + }, + "2": { + "name": "storage.type.struct.objcpp" + }, + "3": { + "name": "entity.name.type.objcpp" + }, + "5": { + "name": "storage.type.modifier.access.objcpp" + }, + "6": { + "name": "entity.name.type.inherited.objcpp" + }, + "7": { + "patterns": [ + { + "match": "(public|protected|private)", + "name": "storage.type.modifier.access.objcpp" + }, + { + "match": "[_A-Za-z][_A-Za-z0-9]*", + "name": "entity.name.type.inherited.objcpp" + } + ] + } + }, + "end": "(?<=\\})|(;)|(?=(\\(|\\)|>|\\[|\\]|=))", + "endCaptures": { + "1": { + "name": "punctuation.terminator.statement.objcpp" + } + }, + "name": "meta.class-struct-block.objcpp", + "patterns": [ + { + "include": "#angle_brackets" + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "(\\})(\\s*\\n)?", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + }, + "2": { + "name": "invalid.illegal.you-forgot-semicolon.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "#constructor" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\b(extern)(?=\\s*\")", + "beginCaptures": { + "1": { + "name": "storage.modifier.objcpp" + } + }, + "end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)", + "name": "meta.extern-block.objcpp", + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "\\}|(?=\\s*#\\s*endif\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "patterns": [ + { + "include": "#special_block" + }, + { + "include": "$base" + } + ] + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "(u|u8|U|L)?\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + }, + "1": { + "name": "meta.encoding.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "match": "\\\\u\\h{4}|\\\\U\\h{8}", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\['\"?\\\\abfnrtv]", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\[0-7]{1,3}", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\x\\h+", + "name": "constant.character.escape.objcpp" + }, + { + "include": "#string_placeholder-c" + } + ] + }, + { + "begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + }, + "1": { + "name": "meta.encoding.objcpp" + }, + "3": { + "name": "invalid.illegal.delimiter-too-long.objcpp" + } + }, + "end": "\\)\\2(\\3)\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + }, + "1": { + "name": "invalid.illegal.delimiter-too-long.objcpp" + } + }, + "name": "string.quoted.double.raw.objcpp" + } + ] + }, + "probably_a_parameter": { + "match": "(?:(?:([a-zA-Z_]\\w*)\\s*(?==)|(?<=\\w\\s|\\*\\/|[&*>\\]\\)])\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:(?:,|\\))))))", + "captures": { + "1": { + "name": "variable.parameter.probably.defaulted.objcpp" + }, + "2": { + "name": "variable.parameter.probably.objcpp" + } + } + }, + "operator_overload": { + "begin": "((?:[a-zA-Z_]\\w*\\s*(?:(?:<(?:[\\s<>,\\w])*>\\s*))?::)*)\\s*(operator)((?:(?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:[a-zA-Z_]\\w*\\s*(?:(?:<(?:[\\s<>,\\w])*>\\s*))?::)*[a-zA-Z_]\\w*\\s*(?:&)?)))))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.scope.objcpp" + }, + "2": { + "name": "keyword.other.operator.overload.objcpp" + }, + "3": { + "name": "entity.name.operator.overloadee.objcpp" + }, + "4": { + "name": "punctuation.section.parameters.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.objcpp" + } + }, + "name": "meta.function.definition.parameters.operator-overload.objcpp", + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards-c" + } + ] + }, + "access-method": { + "name": "meta.function-call.member.objcpp", + "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + }, + "4": { + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.dot-access.objcpp" + }, + { + "match": "->", + "name": "punctuation.separator.pointer-access.objcpp" + }, + { + "match": "[a-zA-Z_][a-zA-Z_0-9]*", + "name": "variable.other.object.objcpp" + }, + { + "name": "everything.else.objcpp", + "match": ".+" + } + ] + }, + "5": { + "name": "entity.name.function.member.objcpp" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + "access-member": { + "name": "variable.other.object.access.objcpp", + "match": "(?:(?:([a-zA-Z_]\\w*)|(?<=\\]|\\))))\\s*(?:(?:((?:(?:\\.|\\.\\*)))|((?:(?:->|->\\*)))))\\s*((?:[a-zA-Z_]\\w*\\s*(?:(?:\\.|->))\\s*)*)\\b(?!(?:auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t))([a-zA-Z_]\\w*)\\b(?!\\()", + "captures": { + "1": { + "name": "variable.other.object.objcpp" + }, + "2": { + "name": "punctuation.separator.dot-access.objcpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.objcpp" + }, + "4": { + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.dot-access.objcpp" + }, + { + "match": "->", + "name": "punctuation.separator.pointer-access.objcpp" + }, + { + "match": "[a-zA-Z_]\\w*", + "name": "variable.other.object.objcpp" + }, + { + "match": ".+", + "name": "everything.else.objcpp" + } + ] + }, + "5": { + "name": "variable.other.member.objcpp" + } + } + }, + "block-c": { + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "name": "meta.block.objcpp", + "patterns": [ + { + "include": "#block_innards-c" + } + ] + } + ] + }, + "block_innards-c": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-block" + }, + { + "include": "#preprocessor-rule-disabled-block" + }, + { + "include": "#preprocessor-rule-conditional-block" + }, + { + "include": "#access-method" + }, + { + "include": "#access-member" + }, + { + "include": "#c_function_call" + }, + { + "name": "meta.initialization.objcpp", + "begin": "(?x)\n(?:\n (?:\n\t(?=\\s)(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "variable.other.objcpp" + }, + "2": { + "name": "punctuation.section.parens.begin.bracket.round.initialization.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.initialization.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objcpp" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objcpp" + } + }, + "patterns": [ + { + "include": "#block_innards-c" + } + ] + }, + { + "include": "#parens-block-c" + }, + { + "include": "$base" + } + ] + }, + "c_function_call": { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*(?:(?:<(?:[\\s<>,\\w])*>\\s*))?\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.objcpp", + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + "comments-c": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.objcpp" + } + }, + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", + "name": "comment.block.objcpp" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.objcpp" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.objcpp" + } + }, + "name": "comment.block.objcpp" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.objcpp" + } + }, + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", + "name": "comment.line.banner.objcpp" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.objcpp" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.objcpp" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.objcpp", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "end": "^\\s*#\\s*endif\\b", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + "line_continuation_character": { + "patterns": [ + { + "match": "(\\\\)\\n", + "captures": { + "1": { + "name": "constant.character.escape.line-continuation.objcpp" + } + } + } + ] + }, + "parens-c": { + "name": "punctuation.section.parens-c\b.objcpp", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "$base" + } + ] + }, + "parens-block-c": { + "name": "meta.block.parens.objcpp", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#block_innards-c" + }, + { + "match": "(?>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.objcpp" + }, + { + "match": "<<|>>", + "name": "keyword.operator.bitwise.shift.objcpp" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.objcpp" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.objcpp" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.objcpp" + }, + { + "match": "=", + "name": "keyword.operator.assignment.objcpp" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.objcpp" + }, + { + "begin": "\\?", + "beginCaptures": { + "0": { + "name": "keyword.operator.ternary.objcpp" + } + }, + "end": ":", + "applyEndPatternLast": true, + "endCaptures": { + "0": { + "name": "keyword.operator.ternary.objcpp" + } + }, + "patterns": [ + { + "include": "#access-method" + }, + { + "include": "#access-member" + }, + { + "include": "#c_function_call" + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings-c": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "include": "#string_escaped_char-c" + }, + { + "include": "#string_placeholder-c" + }, + { + "include": "#line_continuation_character" + } + ] + }, + { + "begin": "(?-mix:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objcpp" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objcpp" + }, + "2": { + "name": "punctuation.section.parameters.begin.bracket.round.objcpp" + } + }, + "end": "\\)|:", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards-c" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-innards-c" + } + ] + }, + { + "include": "$base" + } + ] + }, + "function-call-innards-c": { + "patterns": [ + { + "include": "#comments-c" + }, + { + "include": "#storage_types_c" + }, + { + "include": "#access-method" + }, + { + "include": "#access-member" + }, + { + "include": "#operators" + }, + { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:new)\\s*((?:(?:<(?:[\\s<>,\\w])*>\\s*))?) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.memory.new.objcpp" + }, + "2": { + "patterns": [ + { + "include": "#template_call_innards" + } + ] + }, + "3": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + { + "begin": "(?,\\w])*>\\s*))?::)*)\\s*([a-zA-Z_]\\w*)\\s*(?:((?:<(?:[\\s<>,\\w])*>\\s*)))?(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution" + } + ] + }, + "2": { + "name": "entity.name.function.call.objcpp" + }, + "3": { + "patterns": [ + { + "include": "#template_call_innards" + } + ] + }, + "4": { + "name": "punctuation.section.arguments.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objcpp" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objcpp" + } + }, + "patterns": [ + { + "include": "#function-call-innards-c" + } + ] + }, + { + "include": "#block_innards-c" + } + ] + } + } + }, + "string_escaped_char": { + "patterns": [ + { + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.objcpp" + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type", + "name": "constant.other.placeholder.objcpp" + }, + { + "match": "(%)(?!\"\\s*(PRI|SCN))", + "captures": { + "1": { + "name": "invalid.illegal.placeholder.objcpp" + } + } + } + ] + }, + "bracketed_content": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.scope.begin.objcpp" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.scope.end.objcpp" + } + }, + "name": "meta.bracketed.objcpp", + "patterns": [ + { + "begin": "(?=predicateWithFormat:)(?<=NSPredicate )(predicateWithFormat:)", + "beginCaptures": { + "1": { + "name": "support.function.any-method.objcpp" + }, + "2": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "end": "(?=\\])", + "name": "meta.function-call.predicate.objcpp", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "match": "\\bargument(Array|s)(:)", + "name": "support.function.any-method.name-of-parameter.objcpp" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "match": "\\b\\w+(:)", + "name": "invalid.illegal.unknown-method.objcpp" + }, + { + "begin": "@\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objcpp" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objcpp" + } + }, + "name": "string.quoted.double.objcpp", + "patterns": [ + { + "match": "\\b(AND|OR|NOT|IN)\\b", + "name": "keyword.operator.logical.predicate.cocoa.objcpp" + }, + { + "match": "\\b(ALL|ANY|SOME|NONE)\\b", + "name": "constant.language.predicate.cocoa.objcpp" + }, + { + "match": "\\b(NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", + "name": "constant.language.predicate.cocoa.objcpp" + }, + { + "match": "\\b(MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", + "name": "keyword.operator.comparison.predicate.cocoa.objcpp" + }, + { + "match": "\\bC(ASEINSENSITIVE|I)\\b", + "name": "keyword.other.modifier.predicate.cocoa.objcpp" + }, + { + "match": "\\b(ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", + "name": "keyword.other.predicate.cocoa.objcpp" + }, + { + "match": "\\\\(\\\\|[abefnrtv'\"?]|[0-3]\\d{,2}|[4-7]\\d?|x[a-zA-Z0-9]+)", + "name": "constant.character.escape.objcpp" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.objcpp" + } + ] + }, + { + "include": "#special_variables" + }, + { + "include": "#c_functions" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "(?=\\w)(?<=[\\w\\])\"] )(\\w+(?:(:)|(?=\\])))", + "beginCaptures": { + "1": { + "name": "support.function.any-method.objcpp" + }, + "2": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "end": "(?=\\])", + "name": "meta.function-call.objcpp", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.separator.arguments.objcpp" + } + }, + "match": "\\b\\w+(:)", + "name": "support.function.any-method.name-of-parameter.objcpp" + }, + { + "include": "#special_variables" + }, + { + "include": "#c_functions" + }, + { + "include": "$base" + } + ] + }, + { + "include": "#special_variables" + }, + { + "include": "#c_functions" + }, + { + "include": "$self" + } + ] + }, + "c_functions": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.whitespace.support.function.leading.objcpp" + }, + "2": { + "name": "support.function.C99.objcpp" + } + }, + "match": "(\\s*)\\b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\\b" + }, + { + "captures": { + "1": { + "name": "punctuation.whitespace.function-call.leading.objcpp" + }, + "2": { + "name": "support.function.any-method.objcpp" + }, + "3": { + "name": "punctuation.definition.parameters.objcpp" + } + }, + "match": "(?x) (?: (?= \\s ) (?:(?<=else|new|return) | (?\\\\\\s*\\n)", + "name": "punctuation.separator.continuation.objcpp" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "comment": "eat nested preprocessor if(def)s", + "end": "^\\s*#\\s*endif\\b.*$", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + "implementation_innards": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-implementation" + }, + { + "include": "#preprocessor-rule-disabled-implementation" + }, + { + "include": "#preprocessor-rule-other-implementation" + }, + { + "include": "#property_directive" + }, + { + "include": "#special_variables" + }, + { + "include": "#method_super" + }, + { + "include": "$base" + } + ] + }, + "interface_innards": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-interface" + }, + { + "include": "#preprocessor-rule-disabled-interface" + }, + { + "include": "#preprocessor-rule-other-interface" + }, + { + "include": "#properties" + }, + { + "include": "#protocol_list" + }, + { + "include": "#method" + }, + { + "include": "$base" + } + ] + }, + "method": { + "begin": "^(-|\\+)\\s*", + "end": "(?=\\{|#)|;", + "name": "meta.function.objcpp", + "patterns": [ + { + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.definition.type.begin.objcpp" + } + }, + "end": "(\\))\\s*(\\w+\\b)", + "endCaptures": { + "1": { + "name": "punctuation.definition.type.end.objcpp" + }, + "2": { + "name": "entity.name.function.objcpp" + } + }, + "name": "meta.return-type.objcpp", + "patterns": [ + { + "include": "#protocol_list" + }, + { + "include": "#protocol_type_qualifier" + }, + { + "include": "$base" + } + ] + }, + { + "match": "\\b\\w+(?=:)", + "name": "entity.name.function.name-of-parameter.objcpp" + }, + { + "begin": "((:))\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.name-of-parameter.objcpp" + }, + "2": { + "name": "punctuation.separator.arguments.objcpp" + }, + "3": { + "name": "punctuation.definition.type.begin.objcpp" + } + }, + "end": "(\\))\\s*(\\w+\\b)?", + "endCaptures": { + "1": { + "name": "punctuation.definition.type.end.objcpp" + }, + "2": { + "name": "variable.parameter.function.objcpp" + } + }, + "name": "meta.argument-type.objcpp", + "patterns": [ + { + "include": "#protocol_list" + }, + { + "include": "#protocol_type_qualifier" + }, + { + "include": "$base" + } + ] + }, + { + "include": "#comment" + } + ] + }, + "method_super": { + "begin": "^(?=-|\\+)", + "end": "(?<=\\})|(?=#)", + "name": "meta.function-with-body.objcpp", + "patterns": [ + { + "include": "#method" + }, + { + "include": "$base" + } + ] + }, + "pragma-mark": { + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.pragma.objcpp" + }, + "3": { + "name": "meta.toc-list.pragma-mark.objcpp" + } + }, + "match": "^\\s*(#\\s*(pragma\\s+mark)\\s+(.*))", + "name": "meta.section.objcpp" + }, + "preprocessor-rule-disabled-implementation": { + "begin": "^\\s*(#(if)\\s+(0)\\b).*", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.if.objcpp" + }, + "3": { + "name": "constant.numeric.preprocessor.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "begin": "^\\s*(#\\s*(else)\\b)", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.else.objcpp" + } + }, + "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#interface_innards" + } + ] + }, + { + "begin": "", + "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "name": "comment.block.preprocessor.if-branch.objcpp", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + } + ] + }, + "preprocessor-rule-disabled-interface": { + "begin": "^\\s*(#(if)\\s+(0)\\b).*", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.if.objcpp" + }, + "3": { + "name": "constant.numeric.preprocessor.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "begin": "^\\s*(#\\s*(else)\\b)", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.else.objcpp" + } + }, + "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#interface_innards" + } + ] + }, + { + "begin": "", + "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "name": "comment.block.preprocessor.if-branch.objcpp", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + } + ] + }, + "preprocessor-rule-enabled-implementation": { + "begin": "^\\s*(#(if)\\s+(0*1)\\b)", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.if.objcpp" + }, + "3": { + "name": "constant.numeric.preprocessor.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "begin": "^\\s*(#\\s*(else)\\b).*", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.else.objcpp" + } + }, + "contentName": "comment.block.preprocessor.else-branch.objcpp", + "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + { + "begin": "", + "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#implementation_innards" + } + ] + } + ] + }, + "preprocessor-rule-enabled-interface": { + "begin": "^\\s*(#(if)\\s+(0*1)\\b)", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.if.objcpp" + }, + "3": { + "name": "constant.numeric.preprocessor.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "begin": "^\\s*(#\\s*(else)\\b).*", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.else.objcpp" + } + }, + "contentName": "comment.block.preprocessor.else-branch.objcpp", + "end": "(?=^\\s*#\\s*endif\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + { + "begin": "", + "end": "(?=^\\s*#\\s*(else|endif)\\b.*?(?:(?=(?://|/\\*))|$))", + "patterns": [ + { + "include": "#interface_innards" + } + ] + } + ] + }, + "preprocessor-rule-other-implementation": { + "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b).*?(?:(?=(?://|/\\*))|$)", + "patterns": [ + { + "include": "#implementation_innards" + } + ] + }, + "preprocessor-rule-other-interface": { + "begin": "^\\s*(#\\s*(if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))", + "captures": { + "1": { + "name": "meta.preprocessor.objcpp" + }, + "2": { + "name": "keyword.control.import.objcpp" + } + }, + "end": "^\\s*(#\\s*(endif)\\b).*?(?:(?=(?://|/\\*))|$)", + "patterns": [ + { + "include": "#interface_innards" + } + ] + }, + "properties": { + "patterns": [ + { + "begin": "((@)property)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.property.objcpp" + }, + "2": { + "name": "punctuation.definition.keyword.objcpp" + }, + "3": { + "name": "punctuation.section.scope.begin.objcpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.scope.end.objcpp" + } + }, + "name": "meta.property-with-attributes.objcpp", + "patterns": [ + { + "match": "\\b(getter|setter|readonly|readwrite|assign|retain|copy|nonatomic|strong|weak)\\b", + "name": "keyword.other.property.attribute.objcpp" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.other.property.objcpp" + }, + "2": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "((@)property)\\b", + "name": "meta.property.objcpp" + } + ] + }, + "property_directive": { + "captures": { + "1": { + "name": "punctuation.definition.keyword.objcpp" + } + }, + "match": "(@)(dynamic|synthesize)\\b", + "name": "keyword.other.property.directive.objcpp" + }, + "protocol_list": { + "begin": "(<)", + "beginCaptures": { + "1": { + "name": "punctuation.section.scope.begin.objcpp" + } + }, + "end": "(>)", + "endCaptures": { + "1": { + "name": "punctuation.section.scope.end.objcpp" + } + }, + "name": "meta.protocol-list.objcpp", + "patterns": [ + { + "match": "\\bNS(GlyphStorage|M(utableCopying|enuItem)|C(hangeSpelling|o(ding|pying|lorPicking(Custom|Default)))|T(oolbarItemValidations|ext(Input|AttachmentCell))|I(nputServ(iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(CTypeSerializationCallBack|ect)|D(ecimalNumberBehaviors|raggingInfo)|U(serInterfaceValidations|RL(HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(ToobarItem|UserInterfaceItem)|Locking)\\b", + "name": "support.other.protocol.objcpp" + } + ] + }, + "protocol_type_qualifier": { + "match": "\\b(in|out|inout|oneway|bycopy|byref)\\b", + "name": "storage.modifier.protocol.objcpp" + }, + "special_variables": { + "patterns": [ + { + "match": "\\b_cmd\\b", + "name": "variable.other.selector.objcpp" + }, + { + "match": "\\b(self|super)\\b", + "name": "variable.language.objcpp" + } + ] + } + } } \ No newline at end of file diff --git a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json index b88ebab9eb8..95a57cee9cc 100644 --- a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json @@ -1,10 +1,10 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c.cson", + "This file has been converted from https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master//syntaxes/objc.tmLanguage.json", "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-objective-c/commit/0727e04544f3414c1c339cf15a39a05ea3938cb4", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/efa8ce61762d0481a1b710fdbc12e284867cdc8f", "name": "Objective-C", "scopeName": "source.objc", "patterns": [ @@ -83,14 +83,14 @@ "name": "string.quoted.double.objc", "patterns": [ { - "include": "source.c#string_escaped_char" + "include": "#string_escaped_char" }, { "match": "(?x)%\n\t\t\t\t\t\t(\\d+\\$)? # field (argument #)\n\t\t\t\t\t\t[#0\\- +']* # flags\n\t\t\t\t\t\t((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n\t\t\t\t\t\t(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n\t\t\t\t\t\t[@] # conversion type\n\t\t\t\t\t", "name": "constant.other.placeholder.objc" }, { - "include": "source.c#string_placeholder" + "include": "#string_placeholder" } ] }, @@ -214,15 +214,15 @@ }, { "match": "\\bNSApp\\b", - "name": "support.variable.foundation" + "name": "support.variable.foundation.objc" }, { "captures": { "1": { - "name": "punctuation.whitespace.support.function.cocoa.leopard" + "name": "punctuation.whitespace.support.function.cocoa.leopard.objc" }, "2": { - "name": "support.function.cocoa.leopard" + "name": "support.function.cocoa.leopard.objc" } }, "match": "(\\s*)\\b(NS(Rect(ToCGRect|FromCGRect)|MakeCollectable|S(tringFromProtocol|ize(ToCGSize|FromCGSize))|Draw(NinePartImage|ThreePartImage)|P(oint(ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))\\b" @@ -230,66 +230,2677 @@ { "captures": { "1": { - "name": "punctuation.whitespace.support.function.leading.cocoa" + "name": "punctuation.whitespace.support.function.leading.cocoa.objc" }, "2": { - "name": "support.function.cocoa" + "name": "support.function.cocoa.objc" } }, "match": "(\\s*)\\b(NS(R(ound(DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(CriticalAlertPanel(RelativeToWindow)?|InformationalAlertPanel(RelativeToWindow)?|AlertPanel(RelativeToWindow)?)|e(set(MapTable|HashTable)|c(ycleZone|t(Clip(List)?|F(ill(UsingOperation|List(UsingOperation|With(Grays|Colors(UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(dPixel|l(MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(s)?|WindowServerMemory|AlertPanel)|M(i(n(X|Y)|d(X|Y))|ouseInRect|a(p(Remove|Get|Member|Insert(IfAbsent|KnownAbsent)?)|ke(R(ect|ange)|Size|Point)|x(Range|X|Y)))|B(itsPer(SampleFromDepth|PixelFromDepth)|e(stDepth|ep|gin(CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(ho(uldRetainWithZone|w(sServicesMenuItem|AnimationEffect))|tringFrom(R(ect|ange)|MapTable|S(ize|elector)|HashTable|Class|Point)|izeFromString|e(t(ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(Big(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|Short|Host(ShortTo(Big|Little)|IntTo(Big|Little)|DoubleTo(Big|Little)|FloatTo(Big|Little)|Long(To(Big|Little)|LongTo(Big|Little)))|Int|Double|Float|L(ittle(ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(ToHost|LongToHost))|ong(Long)?)))|H(ighlightRect|o(stByteOrder|meDirectory(ForUser)?)|eight|ash(Remove|Get|Insert(IfAbsent|KnownAbsent)?)|FSType(CodeFromFileType|OfFile))|N(umberOfColorComponents|ext(MapEnumeratorPair|HashEnumeratorItem))|C(o(n(tainsRect|vert(GlyphsToPackedGlyphs|Swapped(DoubleToHost|FloatToHost)|Host(DoubleToSwapped|FloatToSwapped)))|unt(MapTable|HashTable|Frames|Windows(ForContext)?)|py(M(emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(MapTables|HashTables))|lassFromString|reate(MapTable(WithZone)?|HashTable(WithZone)?|Zone|File(namePboardType|ContentsPboardType)))|TemporaryDirectory|I(s(ControllerMarker|EmptyRect|FreedObject)|n(setRect|crementExtraRefCount|te(r(sect(sRect|ionR(ect|ange))|faceStyleForKey)|gralRect)))|Zone(Realloc|Malloc|Name|Calloc|Fr(omPointer|ee))|O(penStepRootDirectory|ffsetRect)|D(i(sableScreenUpdates|videRect)|ottedFrameRect|e(c(imal(Round|Multiply|S(tring|ubtract)|Normalize|Co(py|mpa(ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(MemoryPages|Object))|raw(Gr(oove|ayBezel)|B(itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(hiteBezel|indowBackground)|LightBezel))|U(serName|n(ionR(ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(Bundle(Setup|Cleanup)|Setup(VirtualMachine)?|Needs(ToLoadClasses|VirtualMachine)|ClassesF(orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(oint(InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(n(d(MapTableEnumeration|HashTableEnumeration)|umerate(MapTable|HashTable)|ableScreenUpdates)|qual(R(ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(ileTypeForHFSTypeCode|ullUserName|r(ee(MapTable|HashTable)|ame(Rect(WithWidth(UsingOperation)?)?|Address)))|Wi(ndowList(ForContext)?|dth)|Lo(cationInRange|g(v|PageSize)?)|A(ccessibility(R(oleDescription(ForUIElement)?|aiseBadArgumentException)|Unignored(Children(ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(Main|Load)|vailableWindowDepths|ll(MapTable(Values|Keys)|HashTableObjects|ocate(MemoryPages|Collectable|Object)))))\\b" }, { "match": "\\bNS(RuleEditor|G(arbageCollector|radient)|MapTable|HashTable|Co(ndition|llectionView(Item)?)|T(oolbarItemGroup|extInputClient|r(eeNode|ackingArea))|InvocationOperation|Operation(Queue)?|D(ictionaryController|ockTile)|P(ointer(Functions|Array)|athC(o(ntrol(Delegate)?|mponentCell)|ell(Delegate)?)|r(intPanelAccessorizing|edicateEditor(RowTemplate)?))|ViewController|FastEnumeration|Animat(ionContext|ablePropertyContainer))\\b", - "name": "support.class.cocoa.leopard" + "name": "support.class.cocoa.leopard.objc" }, { "match": "\\bNS(R(u(nLoop|ler(Marker|View))|e(sponder|cursiveLock|lativeSpecifier)|an(domSpecifier|geSpecifier))|G(etCommand|lyph(Generator|Storage|Info)|raphicsContext)|XML(Node|D(ocument|TD(Node)?)|Parser|Element)|M(iddleSpecifier|ov(ie(View)?|eCommand)|utable(S(tring|et)|C(haracterSet|opying)|IndexSet|D(ictionary|ata)|URLRequest|ParagraphStyle|A(ttributedString|rray))|e(ssagePort(NameServer)?|nu(Item(Cell)?|View)?|t(hodSignature|adata(Item|Query(ResultGroup|AttributeValueTuple)?)))|a(ch(BootstrapServer|Port)|trix))|B(itmapImageRep|ox|u(ndle|tton(Cell)?)|ezierPath|rowser(Cell)?)|S(hadow|c(anner|r(ipt(SuiteRegistry|C(o(ercionHandler|mmand(Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(er|View)|een))|t(epper(Cell)?|atus(Bar|Item)|r(ing|eam))|imple(HorizontalTypesetter|CString)|o(cketPort(NameServer)?|und|rtDescriptor)|p(e(cifierTest|ech(Recognizer|Synthesizer)|ll(Server|Checker))|litView)|e(cureTextField(Cell)?|t(Command)?|archField(Cell)?|rializer|gmentedC(ontrol|ell))|lider(Cell)?|avePanel)|H(ost|TTP(Cookie(Storage)?|URLResponse)|elpManager)|N(ib(Con(nector|trolConnector)|OutletConnector)?|otification(Center|Queue)?|u(ll|mber(Formatter)?)|etService(Browser)?|ameSpecifier)|C(ha(ngeSpelling|racterSet)|o(n(stantString|nection|trol(ler)?|ditionLock)|d(ing|er)|unt(Command|edSet)|pying|lor(Space|P(ick(ing(Custom|Default)|er)|anel)|Well|List)?|m(p(oundPredicate|arisonPredicate)|boBox(Cell)?))|u(stomImageRep|rsor)|IImageRep|ell|l(ipView|o(seCommand|neCommand)|assDescription)|a(ched(ImageRep|URLResponse)|lendar(Date)?)|reateCommand)|T(hread|ypesetter|ime(Zone|r)|o(olbar(Item(Validations)?)?|kenField(Cell)?)|ext(Block|Storage|Container|Tab(le(Block)?)?|Input|View|Field(Cell)?|List|Attachment(Cell)?)?|a(sk|b(le(Header(Cell|View)|Column|View)|View(Item)?))|reeController)|I(n(dex(S(pecifier|et)|Path)|put(Manager|S(tream|erv(iceProvider|er(MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(Rep|Cell|View)?)|O(ut(putStream|lineView)|pen(GL(Context|Pixel(Buffer|Format)|View)|Panel)|bj(CTypeSerializationCallBack|ect(Controller)?))|D(i(st(antObject(Request)?|ributed(NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(Controller)?|e(serializer|cimalNumber(Behaviors|Handler)?|leteCommand)|at(e(Components|Picker(Cell)?|Formatter)?|a)|ra(wer|ggingInfo))|U(ser(InterfaceValidations|Defaults(Controller)?)|RL(Re(sponse|quest)|Handle(Client)?|C(onnection|ache|redential(Storage)?)|Download(Delegate)?|Prot(ocol(Client)?|ectionSpace)|AuthenticationChallenge(Sender)?)?|n(iqueIDSpecifier|doManager|archiver))|P(ipe|o(sitionalSpecifier|pUpButton(Cell)?|rt(Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(steboard|nel|ragraphStyle|geLayout)|r(int(Info|er|Operation|Panel)|o(cessInfo|tocolChecker|perty(Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(numerator|vent|PSImageRep|rror|x(ception|istsCommand|pression))|V(iew(Animation)?|al(idated(ToobarItem|UserInterfaceItem)|ue(Transformer)?))|Keyed(Unarchiver|Archiver)|Qui(ckDrawView|tCommand)|F(ile(Manager|Handle|Wrapper)|o(nt(Manager|Descriptor|Panel)?|rm(Cell|atter)))|W(hoseSpecifier|indow(Controller)?|orkspace)|L(o(c(k(ing)?|ale)|gicalTest)|evelIndicator(Cell)?|ayoutManager)|A(ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(ication|e(Script|Event(Manager|Descriptor)))|ffineTransform|lert|r(chiver|ray(Controller)?)))\\b", - "name": "support.class.cocoa" + "name": "support.class.cocoa.objc" }, { "match": "\\bNS(R(oundingMode|ule(Editor(RowType|NestingMode)|rOrientation)|e(questUserAttentionType|lativePosition))|G(lyphInscription|radientDrawingOptions)|XML(NodeKind|D(ocumentContentKind|TDNodeKind)|ParserError)|M(ultibyteGlyphPacking|apTableOptions)|B(itmapFormat|oxType|ezierPathElement|ackgroundStyle|rowserDropOperation)|S(tr(ing(CompareOptions|DrawingOptions|EncodingConversionOptions)|eam(Status|Event))|p(eechBoundary|litViewDividerStyle)|e(archPathD(irectory|omainMask)|gmentS(tyle|witchTracking))|liderType|aveOptions)|H(TTPCookieAcceptPolicy|ashTableOptions)|N(otification(SuspensionBehavior|Coalescing)|umberFormatter(RoundingMode|Behavior|Style|PadPosition)|etService(sError|Options))|C(haracterCollection|o(lor(RenderingIntent|SpaceModel|PanelMode)|mp(oundPredicateType|arisonPredicateModifier))|ellStateValue|al(culationError|endarUnit))|T(ypesetterControlCharacterAction|imeZoneNameStyle|e(stComparisonOperation|xt(Block(Dimension|V(erticalAlignment|alueType)|Layer)|TableLayoutAlgorithm|FieldBezelStyle))|ableView(SelectionHighlightStyle|ColumnAutoresizingStyle)|rackingAreaOptions)|I(n(sertionPosition|te(rfaceStyle|ger))|mage(RepLoadStatus|Scaling|CacheMode|FrameStyle|LoadStatus|Alignment))|Ope(nGLPixelFormatAttribute|rationQueuePriority)|Date(Picker(Mode|Style)|Formatter(Behavior|Style))|U(RL(RequestCachePolicy|HandleStatus|C(acheStoragePolicy|redentialPersistence))|Integer)|P(o(stingStyle|int(ingDeviceType|erFunctionsOptions)|pUpArrowPosition)|athStyle|r(int(ing(Orientation|PaginationMode)|erTableStatus|PanelOptions)|opertyList(MutabilityOptions|Format)|edicateOperatorType))|ExpressionType|KeyValue(SetMutationKind|Change)|QTMovieLoopMode|F(indPanel(SubstringMatchType|Action)|o(nt(RenderingMode|FamilyClass)|cusRingPlacement))|W(hoseSubelementIdentifier|ind(ingRule|ow(B(utton|ackingLocation)|SharingType|CollectionBehavior)))|L(ine(MovementDirection|SweepDirection|CapStyle|JoinStyle)|evelIndicatorStyle)|Animation(BlockingMode|Curve))\\b", - "name": "support.type.cocoa.leopard" + "name": "support.type.cocoa.leopard.objc" }, { "match": "\\bC(I(Sampler|Co(ntext|lor)|Image(Accumulator)?|PlugIn(Registration)?|Vector|Kernel|Filter(Generator|Shape)?)|A(Renderer|MediaTiming(Function)?|BasicAnimation|ScrollLayer|Constraint(LayoutManager)?|T(iledLayer|extLayer|rans(ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(nimation(Group)?|ction)))\\b", - "name": "support.class.quartz" + "name": "support.class.quartz.objc" }, { "match": "\\bC(G(Float|Point|Size|Rect)|IFormat|AConstraintAttribute)\\b", - "name": "support.type.quartz" + "name": "support.type.quartz.objc" }, { "match": "\\bNS(R(ect(Edge)?|ange)|G(lyph(Relation|LayoutMode)?|radientType)|M(odalSession|a(trixMode|p(Table|Enumerator)))|B(itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(cr(oll(er(Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(Granularity|Direction|Affinity)|wapped(Double|Float)|aveOperationType)|Ha(sh(Table|Enumerator)|ndler(2)?)|C(o(ntrol(Size|Tint)|mp(ositingOperation|arisonResult))|ell(State|Type|ImagePosition|Attribute))|T(hreadPrivate|ypesetterGlyphInfo|i(ckMarkPosition|tlePosition|meInterval)|o(ol(TipTag|bar(SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(TabType|Alignment)|ab(State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(ContextAuxiliary|PixelFormatAuxiliary)|D(ocumentChangeType|atePickerElementFlags|ra(werState|gOperation))|UsableScrollerParts|P(oint|r(intingPageOrder|ogressIndicator(Style|Th(ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(nt(SymbolicTraits|TraitMask|Action)|cusRingType)|W(indow(OrderingMode|Depth)|orkspace(IconCreationOptions|LaunchOptions)|ritingDirection)|L(ineBreakMode|ayout(Status|Direction))|A(nimation(Progress|Effect)|ppl(ication(TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle))\\b", - "name": "support.type.cocoa" + "name": "support.type.cocoa.objc" }, { "match": "\\bNS(NotFound|Ordered(Ascending|Descending|Same))\\b", - "name": "support.constant.cocoa" + "name": "support.constant.cocoa.objc" }, { "match": "\\bNS(MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification\\b", - "name": "support.constant.notification.cocoa.leopard" + "name": "support.constant.notification.cocoa.leopard.objc" }, { "match": "\\bNS(Menu(Did(RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(ystemColorsDidChange|plitView(DidResizeSubviews|WillResizeSubviews))|C(o(nt(extHelpModeDid(Deactivate|Activate)|rolT(intDidChange|extDid(BeginEditing|Change|EndEditing)))|lor(PanelColorDidChange|ListDidChange)|mboBox(Selection(IsChanging|DidChange)|Will(Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(oolbar(DidRemoveItem|WillAddItem)|ext(Storage(DidProcessEditing|WillProcessEditing)|Did(BeginEditing|Change|EndEditing)|View(DidChange(Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)))|ImageRepRegistryDidChange|OutlineView(Selection(IsChanging|DidChange)|ColumnDid(Resize|Move)|Item(Did(Collapse|Expand)|Will(Collapse|Expand)))|Drawer(Did(Close|Open)|Will(Close|Open))|PopUpButton(CellWillPopUp|WillPopUp)|View(GlobalFrameDidChange|BoundsDidChange|F(ocusDidChange|rameDidChange))|FontSetChanged|W(indow(Did(Resi(ze|gn(Main|Key))|M(iniaturize|ove)|Become(Main|Key)|ChangeScreen(|Profile)|Deminiaturize|Update|E(ndSheet|xpose))|Will(M(iniaturize|ove)|BeginSheet|Close))|orkspace(SessionDid(ResignActive|BecomeActive)|Did(Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(Sleep|Unmount|PowerOff|LaunchApplication)))|A(ntialiasThresholdChanged|ppl(ication(Did(ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(nhide|pdate)|FinishLaunching)|Will(ResignActive|BecomeActive|Hide|Terminate|U(nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification\\b", - "name": "support.constant.notification.cocoa" + "name": "support.constant.notification.cocoa.objc" }, { "match": "\\bNS(RuleEditor(RowType(Simple|Compound)|NestingMode(Si(ngle|mple)|Compound|List))|GradientDraws(BeforeStartingLocation|AfterEndingLocation)|M(inusSetExpressionType|a(chPortDeallocate(ReceiveRight|SendRight|None)|pTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(oxCustom|undleExecutableArchitecture(X86|I386|PPC(64)?)|etweenPredicateOperatorType|ackgroundStyle(Raised|Dark|L(ight|owered)))|S(tring(DrawingTruncatesLastVisibleLine|EncodingConversion(ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(e(ech(SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(GrammarFlag|SpellingFlag))|litViewDividerStyleThi(n|ck))|e(rvice(RequestTimedOutError|M(iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(inimum|aximum)|Application(NotFoundError|LaunchFailedError))|gmentStyle(Round(Rect|ed)|SmallSquare|Capsule|Textured(Rounded|Square)|Automatic)))|H(UDWindowMask|ashTable(StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(oModeColorPanel|etServiceNoAutoRename)|C(hangeRedone|o(ntainsPredicateOperatorType|l(orRenderingIntent(RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(None|ContentArea|TrackableArea|EditableTextArea))|T(imeZoneNameStyle(S(hort(Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(Regular|SourceList)|racking(Mouse(Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(ssumeInside|ctive(In(KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(n(tersectSetExpressionType|dexedColorSpaceModel)|mageScale(None|Proportionally(Down|UpOrDown)|AxesIndependently))|Ope(nGLPFAAllowOfflineRenderers|rationQueue(DefaultMaxConcurrentOperationCount|Priority(High|Normal|Very(High|Low)|Low)))|D(iacriticInsensitiveSearch|ownloadsDirectory)|U(nionSetExpressionType|TF(16(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(ointerFunctions(Ma(chVirtualMemory|llocMemory)|Str(ongMemory|uctPersonality)|C(StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(paque(Memory|Personality)|bjectP(ointerPersonality|ersonality)))|at(hStyle(Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(Scaling|Copies|Orientation|P(a(perSize|ge(Range|SetupAccessory))|review)))|Executable(RuntimeMismatchError|NotLoadableError|ErrorM(inimum|aximum)|L(inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(Initial|Prior)|F(i(ndPanelSubstringMatchType(StartsWith|Contains|EndsWith|FullWord)|leRead(TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(ndow(BackingLocation(MainMemory|Default|VideoMemory)|Sharing(Read(Only|Write)|None)|CollectionBehavior(MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType)\\b", - "name": "support.constant.cocoa.leopard" + "name": "support.constant.cocoa.leopard.objc" }, { "match": "\\bNS(R(GB(ModeColorPanel|ColorSpaceModel)|ight(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey)|ound(RectBezelStyle|Bankers|ed(BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(CapStyle|JoinStyle))|un(StoppedResponse|ContinuesResponse|AbortedResponse)|e(s(izableWindowMask|et(CursorRectsRunLoopOrdering|FunctionKey))|ce(ssedBezelStyle|iver(sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(evancyLevelIndicatorStyle|ative(Before|After))|gular(SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(n(domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(ModeMatrix|Button)))|G(IFFileType|lyph(Below|Inscribe(B(elow|ase)|Over(strike|Below)|Above)|Layout(WithPrevious|A(tAPoint|gainstAPoint))|A(ttribute(BidiLevel|Soft|Inscribe|Elastic)|bove))|r(ooveBorder|eaterThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|a(y(ModeColorPanel|ColorSpaceModel)|dient(None|Con(cave(Strong|Weak)|vex(Strong|Weak)))|phiteControlTint)))|XML(N(o(tationDeclarationKind|de(CompactEmptyElement|IsCDATA|OptionsNone|Use(SingleQuotes|DoubleQuotes)|Pre(serve(NamespaceOrder|C(haracterReferences|DATA)|DTD|Prefixes|E(ntities|mptyElements)|Quotes|Whitespace|A(ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(ocument(X(MLKind|HTMLKind|Include)|HTMLKind|T(idy(XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(arser(GTRequiredError|XMLDeclNot(StartedError|FinishedError)|Mi(splaced(XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(StartedError|FinishedError))|S(t(andaloneValueError|ringNot(StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(MTOKENRequiredError|o(t(ationNot(StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(haracterRef(In(DTDError|PrologError|EpilogError)|AtEOFError)|o(nditionalSectionNot(StartedError|FinishedError)|mment(NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(ternalError|valid(HexCharacterRefError|C(haracter(RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(NameError|Error)))|OutOfMemoryError|D(ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(RI(RequiredError|FragmentError)|n(declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(MissingSemiError|NoNameError|In(Internal(SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(ocessingInstructionNot(StartedError|FinishedError)|ematureDocumentEndError))|E(n(codingNotSupportedError|tity(Ref(In(DTDError|PrologError|EpilogError)|erence(MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(StartedError|FinishedError)|Is(ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(StartedError|FinishedError)|xt(ernalS(tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(iteralNot(StartedError|FinishedError)|T(RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(RedefinedError|HasNoValueError|Not(StartedError|FinishedError)|ListNot(StartedError|FinishedError)))|rocessingInstructionKind)|E(ntity(GeneralKind|DeclarationKind|UnparsedKind|P(ar(sedKind|ameterKind)|redefined))|lement(Declaration(MixedKind|UndefinedKind|E(lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(N(MToken(sKind|Kind)|otationKind)|CDATAKind|ID(Ref(sKind|Kind)|Kind)|DeclarationKind|En(tit(yKind|iesKind)|umerationKind)|Kind))|M(i(n(XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(nthCalendarUnit|deSwitchFunctionKey|use(Moved(Mask)?|E(ntered(Mask)?|ventSubtype|xited(Mask)?))|veToBezierPathElement|mentary(ChangeButton|Push(Button|InButton)|Light(Button)?))|enuFunctionKey|a(c(intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(XEdge|YEdge))|ACHOperatingSystem)|B(MPFileType|o(ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(Se(condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(zelBorder|velLineJoinStyle|low(Bottom|Top)|gin(sWith(Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(spaceCharacter|tabTextMovement|ingStore(Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(owser(NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(h(ift(JISStringEncoding|KeyMask)|ow(ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(s(ReqFunctionKey|tem(D(omainMask|efined(Mask)?)|FunctionKey))|mbolStringEncoding)|c(a(nnedOption|le(None|ToFit|Proportionally))|r(oll(er(NoPart|Increment(Page|Line|Arrow)|Decrement(Page|Line|Arrow)|Knob(Slot)?|Arrows(M(inEnd|axEnd)|None|DefaultSetting))|Wheel(Mask)?|LockFunctionKey)|eenChangedEventType))|t(opFunctionKey|r(ingDrawing(OneShot|DisableScreenFontSubstitution|Uses(DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(Status(Reading|NotOpen|Closed|Open(ing)?|Error|Writing|AtEnd)|Event(Has(BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(ndEncountered|rrorOccurred)))))|i(ngle(DateMode|UnderlineStyle)|ze(DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(condCalendarUnit|lect(By(Character|Paragraph|Word)|i(ng(Next|Previous)|onAffinity(Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(Momentary|Select(One|Any)))|quareLineCapStyle|witchButton|ave(ToOperation|Op(tions(Yes|No|Ask)|eration)|AsOperation)|mall(SquareBezelStyle|C(ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(ighlightModeMatrix|SBModeColorPanel|o(ur(Minute(SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(Never|OnlyFromMainDocumentDomain|Always)|e(lp(ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(MonthDa(yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(o(n(StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(ification(SuspensionBehavior(Hold|Coalesce|D(eliverImmediately|rop))|NoCoalescing|CoalescingOn(Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(cr(iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(itle|opLevelContainersSpecifierError|abs(BezelBorder|NoBorder|LineBorder))|I(nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(ll(Glyph|CellType)|m(eric(Search|PadKeyMask)|berFormatter(Round(Half(Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(10|Default)|S(cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(ercentStyle|ad(Before(Suffix|Prefix)|After(Suffix|Prefix))))))|e(t(Services(BadArgumentError|NotFoundError|C(ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(t(iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(hange(ReadOtherContents|GrayCell(Mask)?|BackgroundCell(Mask)?|Cleared|Done|Undone|Autosaved)|MYK(ModeColorPanel|ColorSpaceModel)|ircular(BezelStyle|Slider)|o(n(stantValueExpressionType|t(inuousCapacityLevelIndicatorStyle|entsCellMask|ain(sComparison|erSpecifierError)|rol(Glyph|KeyMask))|densedFontMask)|lor(Panel(RGBModeMask|GrayModeMask|HSBModeMask|C(MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(p(osite(XOR|Source(In|O(ut|ver)|Atop)|Highlight|C(opy|lear)|Destination(In|O(ut|ver)|Atop)|Plus(Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(stom(SelectorPredicateOperatorType|PaletteModeColorPanel)|r(sor(Update(Mask)?|PointingDevice)|veToBezierPathElement))|e(nterT(extAlignment|abStopType)|ll(State|H(ighlighted|as(Image(Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(Bordered|InsetButton)|Disabled|Editable|LightsBy(Gray|Background|Contents)|AllowsMixedState))|l(ipPagination|o(s(ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(ControlTint|DisplayFunctionKey|LineFunctionKey))|a(seInsensitive(Search|PredicateOption)|n(notCreateScriptCommandError|cel(Button|TextMovement))|chesDirectory|lculation(NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(itical(Request|AlertStyle)|ayonModeColorPanel))|T(hick(SquareBezelStyle|erSquareBezelStyle)|ypesetter(Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(ineBreakAction|atestBehavior))|i(ckMark(Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(olbarItemVisibilityPriority(Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(Compression(N(one|EXT)|CCITTFAX(3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(rminate(Now|Cancel|Later)|xt(Read(InapplicableDocumentTypeError|WriteErrorM(inimum|aximum))|Block(M(i(nimum(Height|Width)|ddleAlignment)|a(rgin|ximum(Height|Width)))|B(o(ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(Characters|Attributes)|CellType|ured(RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(Character|TextMovement|le(tP(oint(Mask|EventSubtype)?|roximity(Mask|EventSubtype)?)|Column(NoResizing|UserResizingMask|AutoresizingMask)|View(ReverseSequentialColumnAutoresizingStyle|GridNone|S(olid(HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(n(sert(CharFunctionKey|FunctionKey|LineFunctionKey)|t(Type|ernalS(criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(2022JPStringEncoding|Latin(1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(R(ight|ep(MatchesDevice|LoadStatus(ReadingHeader|Completed|InvalidData|Un(expectedEOF|knownType)|WillNeedAllData)))|Below|C(ellType|ache(BySize|Never|Default|Always))|Interpolation(High|None|Default|Low)|O(nly|verlaps)|Frame(Gr(oove|ayBezel)|Button|None|Photo)|L(oadStatus(ReadError|C(ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(lign(Right|Bottom(Right|Left)?|Center|Top(Right|Left)?|Left)|bove)))|O(n(State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|TextMovement)|SF1OperatingSystem|pe(n(GL(GO(Re(setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(R(obust|endererID)|M(inimumPolicy|ulti(sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(creenMask|te(ncilSize|reo)|ingleRenderer|upersample|ample(s|Buffers|Alpha))|NoRecovery|C(o(lor(Size|Float)|mpliant)|losestPolicy)|OffScreen|D(oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(cc(umSize|elerated)|ux(Buffers|DepthStencil)|l(phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(B(itfield|oolType)|S(hortType|tr(ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(Type|longType)|ArrayType))|D(i(s(c(losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(Selection|PredicateModifier))|o(c(ModalWindowMask|ument(Directory|ationDirectory))|ubleType|wn(TextMovement|ArrowFunctionKey))|e(s(cendingPageOrder|ktopDirectory)|cimalTabStopType|v(ice(NColorSpaceModel|IndependentModifierFlagsMask)|eloper(Directory|ApplicationDirectory))|fault(ControlTint|TokenStyle)|lete(Char(acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(yCalendarUnit|teFormatter(MediumStyle|Behavior(10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(wer(Clos(ingState|edState)|Open(ingState|State))|gOperation(Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(ser(CancelledError|D(irectory|omainMask)|FunctionKey)|RL(Handle(NotLoaded|Load(Succeeded|InProgress|Failed))|CredentialPersistence(None|Permanent|ForSession))|n(scaledWindowMask|cachedRead|i(codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(o(CloseGroupingRunLoopOrdering|FunctionKey)|e(finedDateComponent|rline(Style(Single|None|Thick|Double)|Pattern(Solid|D(ot|ash(Dot(Dot)?)?)))))|known(ColorSpaceModel|P(ointingDevice|ageOrder)|KeyS(criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(ustifiedTextAlignment|PEG(2000FileType|FileType)|apaneseEUC(GlyphPacking|StringEncoding))|P(o(s(t(Now|erFontMask|WhenIdle|ASAP)|iti(on(Replace|Be(fore|ginning)|End|After)|ve(IntType|DoubleType|FloatType)))|pUp(NoArrow|ArrowAt(Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(InCell(Mask)?|OnPushOffButton)|e(n(TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(Mask)?)|P(S(caleField|tatus(Title|Field)|aveButton)|N(ote(Title|Field)|ame(Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(a(perFeedButton|ge(Range(To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(useFunctionKey|ragraphSeparatorCharacter|ge(DownFunctionKey|UpFunctionKey))|r(int(ing(ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(NotFound|OK|Error)|FunctionKey)|o(p(ertyList(XMLFormat|MutableContainers(AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(BarStyle|SpinningStyle|Preferred(SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(ssedTab|vFunctionKey))|L(HeightForm|CancelButton|TitleField|ImageButton|O(KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(n(terCharacter|d(sWith(Comparison|PredicateOperatorType)|FunctionKey))|v(e(nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(Comparison|PredicateOperatorType)|ra(serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(clude(10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(i(ew(M(in(XMargin|YMargin)|ax(XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(lidationErrorM(inimum|aximum)|riableExpressionType))|Key(SpecifierEvaluationScriptError|Down(Mask)?|Up(Mask)?|PathExpressionType|Value(MinusSetMutation|SetSetMutation|Change(Re(placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(New|Old)|UnionSetMutation|ValidationError))|QTMovie(NormalPlayback|Looping(BackAndForthPlayback|Playback))|F(1(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(nd(PanelAction(Replace(A(ndFind|ll(InSelection)?))?|S(howFindPanel|e(tFindString|lectAll(InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(Read(No(SuchFileError|PermissionError)|CorruptFileError|In(validFileNameError|applicableStringEncodingError)|Un(supportedSchemeError|knownError))|HandlingPanel(CancelButton|OKButton)|NoSuchFileError|ErrorM(inimum|aximum)|Write(NoPermissionError|In(validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(nt(Mo(noSpaceTrait|dernSerifsClass)|BoldTrait|S(ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(o(ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(ntegerAdvancementsRenderingMode|talicTrait)|O(ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(nknownClass|IOptimizedTrait)|Panel(S(hadowEffectModeMask|t(andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(amilyClassMask|reeformSerifsClass)|Antialiased(RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(Below|Type(None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(attingError(M(inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(ExpressionType|KeyMask)|3(1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(RevertButton|S(ize(Title|Field)|etButton)|CurrentField|Preview(Button|Field))|l(oat(ingPointSamplesBitmapFormat|Type)|agsChanged(Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(heelModeColorPanel|indow(s(NTOperatingSystem|CP125(1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(InterfaceStyle|OperatingSystem))|M(iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(ctivation|ddingToRecents)|A(sync|nd(Hide(Others)?|Print)|llowingClassicStartup))|eek(day(CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(ntsBidiLevels|rningAlertStyle)|r(itingDirection(RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(i(stModeMatrix|ne(Moves(Right|Down|Up|Left)|B(order|reakBy(C(harWrapping|lipping)|Truncating(Middle|Head|Tail)|WordWrapping))|S(eparatorCharacter|weep(Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(ssThan(Comparison|OrEqualTo(Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(Mouse(D(own(Mask)?|ragged(Mask)?)|Up(Mask)?)|T(ext(Movement|Alignment)|ab(sBezelBorder|StopType))|ArrowFunctionKey))|a(yout(RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(sc(iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(y(Type|PredicateModifier|EventMask)|choredSearch|imation(Blocking|Nonblocking(Threaded)?|E(ffect(DisappearingItemDefault|Poof)|ase(In(Out)?|Out))|Linear)|dPredicateType)|t(Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(obe(GB1CharacterCollection|CNS1CharacterCollection|Japan(1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(saveOperation|Pagination)|pp(lication(SupportDirectory|D(irectory|e(fined(Mask)?|legateReply(Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(Mask)?)|l(ternateKeyMask|pha(ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(sWrongScriptError|EvaluationScriptError)|bove(Bottom|Top)|WTEventType))\\b", - "name": "support.constant.cocoa" + "name": "support.constant.cocoa.objc" }, { - "include": "source.c" + "include": "#c_lang" }, { "include": "#bracketed_content" } ], "repository": { + "c_lang": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled" + }, + { + "include": "#preprocessor-rule-disabled" + }, + { + "include": "#preprocessor-rule-conditional" + }, + { + "include": "#comments" + }, + { + "include": "#switch_statement" + }, + { + "match": "\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\b", + "name": "keyword.control.objc" + }, + { + "include": "#storage_types" + }, + { + "match": "typedef", + "name": "keyword.other.typedef.objc" + }, + { + "match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b", + "name": "storage.modifier.objc" + }, + { + "match": "\\bk[A-Z]\\w*\\b", + "name": "constant.other.variable.mac-classic.objc" + }, + { + "match": "\\bg[A-Z]\\w*\\b", + "name": "variable.other.readwrite.global.mac-classic.objc" + }, + { + "match": "\\bs[A-Z]\\w*\\b", + "name": "variable.other.readwrite.static.mac-classic.objc" + }, + { + "match": "\\b(NULL|true|false|TRUE|FALSE)\\b", + "name": "constant.language.objc" + }, + { + "include": "#operators" + }, + { + "include": "#numbers" + }, + { + "include": "#strings" + }, + { + "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+\t# define\n((?[a-zA-Z_$][\\w$]*))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.objc" + }, + "2": { + "name": "punctuation.definition.directive.objc" + }, + "3": { + "name": "entity.name.function.preprocessor.objc" + }, + "5": { + "name": "punctuation.definition.parameters.begin.objc" + }, + "6": { + "name": "variable.parameter.preprocessor.objc" + }, + "8": { + "name": "punctuation.separator.parameters.objc" + }, + "9": { + "name": "punctuation.definition.parameters.end.objc" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objc" + } + }, + "name": "string.quoted.other.lt-gt.include.objc" + } + ] + }, + { + "include": "#pragma-mark" + }, + { + "begin": "^\\s*((#)\\s*line)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.line.objc" + }, + "2": { + "name": "punctuation.definition.directive.objc" + } + }, + "end": "(?=(?://|/\\*))|(?\\]\\)]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))", + "captures": { + "1": { + "name": "variable.parameter.probably.objc" + } + } + }, + "access-method": { + "name": "meta.function-call.member.objc", + "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.object.objc" + }, + "2": { + "name": "punctuation.separator.dot-access.objc" + }, + "3": { + "name": "punctuation.separator.pointer-access.objc" + }, + "4": { + "patterns": [ + { + "match": "\\.", + "name": "punctuation.separator.dot-access.objc" + }, + { + "match": "->", + "name": "punctuation.separator.pointer-access.objc" + }, + { + "match": "[a-zA-Z_][a-zA-Z_0-9]*", + "name": "variable.object.objc" + }, + { + "name": "everything.else.objc", + "match": ".+" + } + ] + }, + "5": { + "name": "entity.name.function.member.objc" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "block": { + "patterns": [ + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objc" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objc" + } + }, + "name": "meta.block.objc", + "patterns": [ + { + "include": "#block_innards" + } + ] + } + ] + }, + "block_innards": { + "patterns": [ + { + "include": "#preprocessor-rule-enabled-block" + }, + { + "include": "#preprocessor-rule-disabled-block" + }, + { + "include": "#preprocessor-rule-conditional-block" + }, + { + "include": "#method_access" + }, + { + "include": "#member_access" + }, + { + "include": "#c_function_call" + }, + { + "name": "meta.initialization.objc", + "begin": "(?x)\n(?:\n (?:\n\t(?=\\s)(?=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket", + "beginCaptures": { + "1": { + "name": "variable.other.objc" + }, + "2": { + "name": "punctuation.section.parens.begin.bracket.round.initialization.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.initialization.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.block.begin.bracket.curly.objc" + } + }, + "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", + "endCaptures": { + "0": { + "name": "punctuation.section.block.end.bracket.curly.objc" + } + }, + "patterns": [ + { + "include": "#block_innards" + } + ] + }, + { + "include": "#parens-block" + }, + { + "include": "$base" + } + ] + }, + "c_function_call": { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)", + "name": "meta.function-call.objc", + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "comments": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.toc-list.banner.block.objc" + } + }, + "match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?", + "name": "comment.block.objc" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.objc" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.objc" + } + }, + "name": "comment.block.objc" + }, + { + "captures": { + "1": { + "name": "meta.toc-list.banner.line.objc" + } + }, + "match": "^// =(\\s*.*?)\\s*=\\s*$\\n?", + "name": "comment.line.banner.objc" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.objc" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.objc" + } + }, + "end": "(?=\\n)", + "name": "comment.line.double-slash.objc", + "patterns": [ + { + "include": "#line_continuation_character" + } + ] + } + ] + } + ] + }, + "disabled": { + "begin": "^\\s*#\\s*if(n?def)?\\b.*$", + "end": "^\\s*#\\s*endif\\b", + "patterns": [ + { + "include": "#disabled" + }, + { + "include": "#pragma-mark" + } + ] + }, + "line_continuation_character": { + "patterns": [ + { + "match": "(\\\\)\\n", + "captures": { + "1": { + "name": "constant.character.escape.line-continuation.objc" + } + } + } + ] + }, + "parens": { + "name": "meta.parens.objc", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "$base" + } + ] + }, + "parens-block": { + "name": "meta.parens.block.objc", + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "#block_innards" + }, + { + "match": "(?-mix:(?>=|\\|=", + "name": "keyword.operator.assignment.compound.bitwise.objc" + }, + { + "match": "<<|>>", + "name": "keyword.operator.bitwise.shift.objc" + }, + { + "match": "!=|<=|>=|==|<|>", + "name": "keyword.operator.comparison.objc" + }, + { + "match": "&&|!|\\|\\|", + "name": "keyword.operator.logical.objc" + }, + { + "match": "&|\\||\\^|~", + "name": "keyword.operator.objc" + }, + { + "match": "=", + "name": "keyword.operator.assignment.objc" + }, + { + "match": "%|\\*|/|-|\\+", + "name": "keyword.operator.objc" + }, + { + "begin": "(\\?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.ternary.objc" + } + }, + "end": "(:)", + "endCaptures": { + "1": { + "name": "keyword.operator.ternary.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + }, + { + "include": "$base" + } + ] + } + ] + }, + "strings": { + "patterns": [ + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objc" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objc" + } + }, + "name": "string.quoted.double.objc", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#string_placeholder" + }, + { + "include": "#line_continuation_character" + } + ] + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.objc" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.objc" + } + }, + "name": "string.quoted.single.objc", + "patterns": [ + { + "include": "#string_escaped_char" + }, + { + "include": "#line_continuation_character" + } + ] + } + ] + }, + "string_escaped_char": { + "patterns": [ + { + "match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )", + "name": "constant.character.escape.objc" + }, + { + "match": "\\\\.", + "name": "invalid.illegal.unknown-escape.objc" + } + ] + }, + "string_placeholder": { + "patterns": [ + { + "match": "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type", + "name": "constant.other.placeholder.objc" + }, + { + "match": "(%)(?!\"\\s*(PRI|SCN))", + "captures": { + "1": { + "name": "invalid.illegal.placeholder.objc" + } + } + } + ] + }, + "storage_types": { + "patterns": [ + { + "match": "(?-mix:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "end": "(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objc" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objc" + } + }, + "end": "(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objc" + }, + "2": { + "name": "punctuation.section.parameters.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parameters.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "#function-innards" + } + ] + }, + { + "include": "$base" + } + ] + }, + "function-call-innards": { + "patterns": [ + { + "include": "#comments" + }, + { + "include": "#storage_types" + }, + { + "include": "#method_access" + }, + { + "include": "#member_access" + }, + { + "include": "#operators" + }, + { + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "beginCaptures": { + "1": { + "name": "entity.name.function.objc" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.arguments.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.parens.begin.bracket.round.objc" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.parens.end.bracket.round.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + { + "include": "#block_innards" + } + ] + }, + "default_statement": { + "name": "meta.conditional.case.objc", + "begin": "((?\\[\\]=]))", + "patterns": [ + { + "name": "meta.head.switch.objc", + "begin": "\\G ?", + "end": "((?:\\{|(?=;)))", + "endCaptures": { + "1": { + "name": "punctuation.section.block.begin.bracket.curly.switch.objc" + } + }, + "patterns": [ + { + "include": "#switch_conditional_parentheses" + }, + { + "include": "$base" + } + ] + }, + { + "name": "meta.body.switch.objc", + "begin": "(?<=\\{)", + "end": "(\\})", + "endCaptures": { + "1": { + "name": "punctuation.section.block.end.bracket.curly.switch.objc" + } + }, + "patterns": [ + { + "include": "#default_statement" + }, + { + "include": "#case_statement" + }, + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + { + "name": "meta.tail.switch.objc", + "begin": "(?<=})[\\s\\n]*", + "end": "[\\s\\n]*(?=;)", + "patterns": [ + { + "include": "$base" + } + ] + } + ] + }, + "switch_conditional_parentheses": { + "name": "meta.conditional.switch.objc", + "begin": "(\\()", + "beginCaptures": { + "1": { + "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.objc" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parens.end.bracket.round.conditional.switch.objc" + } + }, + "patterns": [ + { + "include": "#conditional_context" + } + ] + }, + "static_assert": { + "begin": "(static_assert|_Static_assert)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.static_assert.objc" + }, + "2": { + "name": "punctuation.section.arguments.begin.bracket.round.objc" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.objc" + } + }, + "patterns": [ + { + "name": "meta.static_assert.message.objc", + "begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.delimiter.objc" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#string_context" + }, + { + "include": "#string_context_c" + } + ] + }, + { + "include": "#function_call_context" + } + ] + }, + "conditional_context": { + "patterns": [ + { + "include": "$base" + }, + { + "include": "#block_innards" + } + ] + }, + "member_access": { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:void|char|short|int|signed|unsigned|long|float|double|bool|_Bool|_Complex|_Imaginary|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|memory_order|atomic_bool|atomic_char|atomic_schar|atomic_uchar|atomic_short|atomic_ushort|atomic_int|atomic_uint|atomic_long|atomic_ulong|atomic_llong|atomic_ullong|atomic_char16_t|atomic_char32_t|atomic_wchar_t|atomic_int_least8_t|atomic_uint_least8_t|atomic_int_least16_t|atomic_uint_least16_t|atomic_int_least32_t|atomic_uint_least32_t|atomic_int_least64_t|atomic_uint_least64_t|atomic_int_fast8_t|atomic_uint_fast8_t|atomic_int_fast16_t|atomic_uint_fast16_t|atomic_int_fast32_t|atomic_uint_fast32_t|atomic_int_fast64_t|atomic_uint_fast64_t|atomic_intptr_t|atomic_uintptr_t|atomic_size_t|atomic_ptrdiff_t|atomic_intmax_t|atomic_uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", + "captures": { + "1": { + "name": "variable.other.object.access.objc" + }, + "2": { + "name": "punctuation.separator.dot-access.objc" + }, + "3": { + "name": "punctuation.separator.pointer-access.objc" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.objc" + }, + "2": { + "name": "punctuation.separator.dot-access.objc" + }, + "3": { + "name": "punctuation.separator.pointer-access.objc" + } + } + } + ] + }, + "5": { + "name": "variable.other.member.objc" + } + } + }, + "method_access": { + "contentName": "meta.function-call.member.objc", + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.access.objc" + }, + "2": { + "name": "punctuation.separator.dot-access.objc" + }, + "3": { + "name": "punctuation.separator.pointer-access.objc" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.objc" + }, + "2": { + "name": "punctuation.separator.dot-access.objc" + }, + "3": { + "name": "punctuation.separator.pointer-access.objc" + } + } + } + ] + }, + "5": { + "name": "entity.name.function.member.objc" + }, + "6": { + "name": "punctuation.section.arguments.begin.bracket.round.function.member.objc" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.arguments.end.bracket.round.function.member.objc" + } + }, + "patterns": [ + { + "include": "#function-call-innards" + } + ] + }, + "numbers": { + "begin": "(?", - "t": "source.objc meta.preprocessor.include.c string.quoted.other.lt-gt.include.c punctuation.definition.string.end.c", + "t": "source.objc meta.preprocessor.include.objc string.quoted.other.lt-gt.include.objc punctuation.definition.string.end.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -177,7 +177,7 @@ }, { "c": "/*", - "t": "source.objc comment.block.c punctuation.definition.comment.begin.c", + "t": "source.objc comment.block.objc punctuation.definition.comment.begin.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -188,7 +188,7 @@ }, { "c": "\tMulti", - "t": "source.objc comment.block.c", + "t": "source.objc comment.block.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -199,7 +199,7 @@ }, { "c": "\tLine", - "t": "source.objc comment.block.c", + "t": "source.objc comment.block.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -210,7 +210,7 @@ }, { "c": "\tComments", - "t": "source.objc comment.block.c", + "t": "source.objc comment.block.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -221,7 +221,7 @@ }, { "c": "*/", - "t": "source.objc comment.block.c punctuation.definition.comment.end.c", + "t": "source.objc comment.block.objc punctuation.definition.comment.end.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -298,7 +298,7 @@ }, { "c": "void", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc storage.type.built-in.primitive.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc storage.type.built-in.primitive.objc", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -364,7 +364,7 @@ }, { "c": "NSNotification", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -386,7 +386,7 @@ }, { "c": "*", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -419,7 +419,7 @@ }, { "c": "{", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.begin.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -430,7 +430,7 @@ }, { "c": "}", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.end.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -551,7 +551,7 @@ }, { "c": "{", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.begin.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -562,7 +562,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -573,7 +573,7 @@ }, { "c": "NSString", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -584,7 +584,7 @@ }, { "c": "*", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -595,7 +595,7 @@ }, { "c": " defaultDir ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -606,7 +606,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -617,7 +617,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.whitespace.support.function.leading.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.whitespace.support.function.leading.cocoa.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -628,7 +628,7 @@ }, { "c": "NSSearchPathForDirectoriesInDomains", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.function.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc support.function.cocoa.objc", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -639,7 +639,7 @@ }, { "c": "(", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc punctuation.section.parens.begin.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -650,7 +650,7 @@ }, { "c": "NSDocumentDirectory", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c support.constant.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc support.constant.cocoa.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -661,7 +661,7 @@ }, { "c": ",", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.separator.delimiter.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc punctuation.separator.delimiter.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -672,7 +672,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -683,7 +683,7 @@ }, { "c": "NSUserDomainMask", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c support.constant.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc support.constant.cocoa.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -694,7 +694,7 @@ }, { "c": ",", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.separator.delimiter.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc punctuation.separator.delimiter.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -705,7 +705,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -716,7 +716,7 @@ }, { "c": "true", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c constant.language.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc constant.language.objc", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -727,7 +727,7 @@ }, { "c": ")", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.parens.block.objc punctuation.section.parens.end.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -738,7 +738,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -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.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -760,7 +760,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,7 +771,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -782,7 +782,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +793,7 @@ }, { "c": "NSOpenPanel", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -804,7 +804,7 @@ }, { "c": "*", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -815,7 +815,7 @@ }, { "c": " panel ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -826,7 +826,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -837,7 +837,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -848,7 +848,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -859,7 +859,7 @@ }, { "c": "NSOpenPanel", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -870,7 +870,7 @@ }, { "c": " openPanel", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -881,7 +881,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -892,7 +892,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -903,7 +903,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -914,7 +914,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +925,7 @@ }, { "c": "panel setAllowedFileTypes:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -936,7 +936,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -947,7 +947,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -958,7 +958,7 @@ }, { "c": "NSArray", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -969,7 +969,7 @@ }, { "c": " alloc", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -980,7 +980,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -991,7 +991,7 @@ }, { "c": " initWithObjects:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1002,7 +1002,7 @@ }, { "c": "@\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.begin.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1013,7 +1013,7 @@ }, { "c": "ipa", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1024,7 +1024,7 @@ }, { "c": "\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.end.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1035,7 +1035,7 @@ }, { "c": ",", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.separator.delimiter.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1046,7 +1046,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1057,7 +1057,7 @@ }, { "c": "@\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.begin.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1068,7 +1068,7 @@ }, { "c": "xcarchive", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1079,7 +1079,7 @@ }, { "c": "\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.end.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1090,7 +1090,7 @@ }, { "c": ",", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.separator.delimiter.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1101,7 +1101,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1112,7 +1112,7 @@ }, { "c": "@\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.begin.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1123,7 +1123,7 @@ }, { "c": "app", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1134,7 +1134,7 @@ }, { "c": "\"", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc string.quoted.double.objc punctuation.definition.string.end.objc", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1145,7 +1145,7 @@ }, { "c": ",", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.separator.delimiter.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1156,7 +1156,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1167,7 +1167,7 @@ }, { "c": "nil", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c constant.language.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc constant.language.objc", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -1178,7 +1178,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1189,7 +1189,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1200,7 +1200,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1211,7 +1211,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1222,7 +1222,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1233,7 +1233,7 @@ }, { "c": "panel beginWithCompletionHandler:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1244,7 +1244,7 @@ }, { "c": "^", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1255,7 +1255,7 @@ }, { "c": "(", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.section.parens.begin.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1266,7 +1266,7 @@ }, { "c": "NSInteger", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.type.cocoa.leopard", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc support.type.cocoa.leopard.objc", "r": { "dark_plus": "support.type: #4EC9B0", "light_plus": "support.type: #267F99", @@ -1277,7 +1277,7 @@ }, { "c": " result", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1288,7 +1288,7 @@ }, { "c": ")", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.section.parens.end.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1299,7 +1299,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1310,7 @@ }, { "c": "{", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.section.block.begin.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1321,7 +1321,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1332,7 +1332,7 @@ }, { "c": "if", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c keyword.control.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc keyword.control.objc", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1343,7 +1343,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1354,7 +1354,7 @@ }, { "c": "(", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc punctuation.section.parens.begin.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1365,7 +1365,7 @@ }, { "c": "result ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1376,7 +1376,7 @@ }, { "c": "==", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c keyword.operator.comparison.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc keyword.operator.comparison.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1387,7 +1387,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1398,7 +1398,7 @@ }, { "c": "NSFileHandlingPanelOKButton", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c support.constant.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc support.constant.cocoa.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1409,7 +1409,7 @@ }, { "c": ")", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.parens.block.objc punctuation.section.parens.end.bracket.round.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1420,7 +1420,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1431,7 +1431,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1442,7 +1442,7 @@ }, { "c": "self", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc variable.other.object.access.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1453,7 +1453,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.separator.dot-access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1464,7 +1464,7 @@ }, { "c": "inputTextField", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc variable.other.member.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1475,7 +1475,7 @@ }, { "c": " setStringValue:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1486,7 +1486,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1497,7 +1497,7 @@ }, { "c": "panel", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc variable.other.object.access.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1508,7 +1508,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.separator.dot-access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1519,7 +1519,7 @@ }, { "c": "URL", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc variable.other.member.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1530,7 +1530,7 @@ }, { "c": " path", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1541,7 +1541,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1552,7 +1552,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1563,7 +1563,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1574,7 +1574,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1585,7 +1585,7 @@ }, { "c": "}", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.section.block.end.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1596,7 +1596,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1607,7 +1607,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1618,7 +1618,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1629,7 +1629,7 @@ }, { "c": "return", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.control.objc", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1640,7 +1640,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1651,7 +1651,7 @@ }, { "c": "YES", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.language.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.language.objc", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -1662,7 +1662,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1673,7 +1673,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1684,7 +1684,7 @@ }, { "c": "int", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c storage.type.built-in.primitive.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc storage.type.built-in.primitive.objc", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1695,7 +1695,7 @@ }, { "c": " hex ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1706,7 +1706,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1717,7 +1717,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1728,7 +1728,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.hexadecimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1739,7 +1739,7 @@ }, { "c": "FEF1F0F", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.hexadecimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.hexadecimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1750,7 +1750,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1761,7 +1761,7 @@ }, { "c": "\t ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1772,7 +1772,7 @@ }, { "c": "float", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c storage.type.built-in.primitive.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc storage.type.built-in.primitive.objc", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1783,7 +1783,7 @@ }, { "c": " ing ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1794,7 +1794,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1805,7 +1805,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1816,7 +1816,7 @@ }, { "c": "3", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1827,7 +1827,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1838,7 +1838,7 @@ }, { "c": "14", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1849,7 +1849,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1860,7 +1860,7 @@ }, { "c": "\t ing ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1871,7 +1871,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1882,7 +1882,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1893,7 +1893,7 @@ }, { "c": "3", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1904,7 +1904,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1915,7 +1915,7 @@ }, { "c": "14", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1926,7 +1926,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.exponent.decimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1937,7 +1937,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.exponent.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1948,7 +1948,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1959,7 +1959,7 @@ }, { "c": "\t ing ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1970,7 +1970,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1981,7 +1981,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1992,7 +1992,7 @@ }, { "c": "31", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2003,7 +2003,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.point.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2014,7 +2014,7 @@ }, { "c": "4", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2025,7 +2025,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.other.unit.exponent.decimal.objc", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -2036,7 +2036,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.minus.exponent.decimal.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2047,7 +2047,7 @@ }, { "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", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.numeric.exponent.decimal.objc", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2058,7 +2058,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2069,7 +2069,7 @@ }, { "c": "}", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.end.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2366,7 +2366,7 @@ }, { "c": "{", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.begin.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2377,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.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.whitespace.comment.leading.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2388,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.c punctuation.definition.comment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc comment.line.double-slash.objc punctuation.definition.comment.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -2399,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.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc comment.line.double-slash.objc", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -2410,7 +2410,7 @@ }, { "c": " UITapGestureRecognizer ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2421,7 +2421,7 @@ }, { "c": "*", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2432,7 +2432,7 @@ }, { "c": "tapGesture ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2443,7 +2443,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2454,7 +2454,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2465,7 +2465,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2476,7 +2476,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2487,7 +2487,7 @@ }, { "c": "UITapGestureRecognizer alloc", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2498,7 +2498,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2509,7 +2509,7 @@ }, { "c": " initWithTarget:self action:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2520,7 +2520,7 @@ }, { "c": "@", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc storage.type.objc punctuation.definition.storage.type.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.selector.objc storage.type.objc punctuation.definition.storage.type.objc", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2531,7 +2531,7 @@ }, { "c": "selector", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc storage.type.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.selector.objc storage.type.objc", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2542,7 +2542,7 @@ }, { "c": "(", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc punctuation.definition.storage.type.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.selector.objc punctuation.definition.storage.type.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2553,7 +2553,7 @@ }, { "c": "handleTap:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc meta.selector.method-name.objc support.function.any-method.name-of-parameter.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.selector.objc meta.selector.method-name.objc support.function.any-method.name-of-parameter.objc", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2564,7 +2564,7 @@ }, { "c": ")", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc punctuation.definition.storage.type.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc meta.selector.objc punctuation.definition.storage.type.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2575,7 +2575,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2586,7 +2586,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2597,7 +2597,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2608,7 +2608,7 @@ }, { "c": "NSMutableArray", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -2619,7 +2619,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2630,7 +2630,7 @@ }, { "c": "*", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2641,7 +2641,7 @@ }, { "c": "gestureRecognizers ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2652,7 +2652,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2663,7 +2663,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2674,7 +2674,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2685,7 +2685,7 @@ }, { "c": "NSMutableArray", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc support.class.cocoa.objc", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -2696,7 +2696,7 @@ }, { "c": " array", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2707,7 +2707,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2718,7 +2718,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2729,7 +2729,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2740,7 +2740,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2751,7 +2751,7 @@ }, { "c": "gestureRecognizers addObject:tapGesture", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2762,7 +2762,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2773,7 +2773,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2784,7 +2784,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2795,7 +2795,7 @@ }, { "c": "[", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.begin.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2806,7 +2806,7 @@ }, { "c": "gestureRecognizers addObjectsFromArray:", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2817,7 +2817,7 @@ }, { "c": "scnView", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc variable.other.object.access.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2828,7 +2828,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.separator.dot-access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2839,7 +2839,7 @@ }, { "c": "gestureRecognizers", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc variable.other.member.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2850,7 +2850,7 @@ }, { "c": "]", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc meta.bracket.square.access.objc punctuation.definition.end.bracket.square.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2861,7 +2861,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2872,7 +2872,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2883,7 +2883,7 @@ }, { "c": "scnView", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c variable.other.object.access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc variable.other.object.access.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2894,7 +2894,7 @@ }, { "c": ".", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.separator.dot-access.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.separator.dot-access.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2905,7 +2905,7 @@ }, { "c": "gestureRecognizers", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c variable.other.member.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc variable.other.member.objc", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2916,7 +2916,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2927,7 +2927,7 @@ }, { "c": "=", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.operator.assignment.objc", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2938,7 +2938,7 @@ }, { "c": " gestureRecognizers", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2949,7 +2949,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2960,7 +2960,7 @@ }, { "c": "\t", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2971,7 +2971,7 @@ }, { "c": "return", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.control.objc", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -2982,7 +2982,7 @@ }, { "c": " tapGesture", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2993,7 +2993,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3004,7 +3004,7 @@ }, { "c": "\t", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3015,7 +3015,7 @@ }, { "c": "return", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc keyword.control.objc", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -3026,7 +3026,7 @@ }, { "c": " ", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3037,7 +3037,7 @@ }, { "c": "nil", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.language.objc", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc constant.language.objc", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -3048,7 +3048,7 @@ }, { "c": ";", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.terminator.statement.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3059,7 +3059,7 @@ }, { "c": "}", - "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objc meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.objc punctuation.section.block.end.bracket.curly.objc", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", diff --git a/extensions/objective-c/test/colorize-results/test_mm.json b/extensions/objective-c/test/colorize-results/test_mm.json index 82cb0cd8192..2af2751bcec 100644 --- a/extensions/objective-c/test/colorize-results/test_mm.json +++ b/extensions/objective-c/test/colorize-results/test_mm.json @@ -1,7 +1,7 @@ [ { "c": "//", - "t": "source.objcpp comment.line.double-slash.c punctuation.definition.comment.c", + "t": "source.objcpp comment.line.double-slash.objcpp punctuation.definition.comment.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -12,7 +12,7 @@ }, { "c": "//", - "t": "source.objcpp comment.line.double-slash.c punctuation.definition.comment.c", + "t": "source.objcpp comment.line.double-slash.objcpp punctuation.definition.comment.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -23,7 +23,7 @@ }, { "c": " Copyright (c) Microsoft Corporation. All rights reserved.", - "t": "source.objcpp comment.line.double-slash.c", + "t": "source.objcpp comment.line.double-slash.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -34,7 +34,7 @@ }, { "c": "//", - "t": "source.objcpp comment.line.double-slash.c punctuation.definition.comment.c", + "t": "source.objcpp comment.line.double-slash.objcpp punctuation.definition.comment.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -45,7 +45,7 @@ }, { "c": "#", - "t": "source.objcpp meta.preprocessor.include.c keyword.control.directive.import.c punctuation.definition.directive.c", + "t": "source.objcpp meta.preprocessor.include.objcpp keyword.control.directive.import.objcpp punctuation.definition.directive.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -56,7 +56,7 @@ }, { "c": "import", - "t": "source.objcpp meta.preprocessor.include.c keyword.control.directive.import.c", + "t": "source.objcpp meta.preprocessor.include.objcpp keyword.control.directive.import.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -67,7 +67,7 @@ }, { "c": " ", - "t": "source.objcpp meta.preprocessor.include.c", + "t": "source.objcpp meta.preprocessor.include.objcpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -78,7 +78,7 @@ }, { "c": "\"", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.double.include.c punctuation.definition.string.begin.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.double.include.objcpp punctuation.definition.string.begin.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -89,7 +89,7 @@ }, { "c": "UseQuotes.h", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.double.include.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.double.include.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -100,7 +100,7 @@ }, { "c": "\"", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.double.include.c punctuation.definition.string.end.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.double.include.objcpp punctuation.definition.string.end.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -111,7 +111,7 @@ }, { "c": "#", - "t": "source.objcpp meta.preprocessor.include.c keyword.control.directive.import.c punctuation.definition.directive.c", + "t": "source.objcpp meta.preprocessor.include.objcpp keyword.control.directive.import.objcpp punctuation.definition.directive.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -122,7 +122,7 @@ }, { "c": "import", - "t": "source.objcpp meta.preprocessor.include.c keyword.control.directive.import.c", + "t": "source.objcpp meta.preprocessor.include.objcpp keyword.control.directive.import.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -133,7 +133,7 @@ }, { "c": " ", - "t": "source.objcpp meta.preprocessor.include.c", + "t": "source.objcpp meta.preprocessor.include.objcpp", "r": { "dark_plus": "meta.preprocessor: #569CD6", "light_plus": "meta.preprocessor: #0000FF", @@ -144,7 +144,7 @@ }, { "c": "<", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.other.lt-gt.include.c punctuation.definition.string.begin.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.other.lt-gt.include.objcpp punctuation.definition.string.begin.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -155,7 +155,7 @@ }, { "c": "Use/GTLT.h", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.other.lt-gt.include.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.other.lt-gt.include.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -166,7 +166,7 @@ }, { "c": ">", - "t": "source.objcpp meta.preprocessor.include.c string.quoted.other.lt-gt.include.c punctuation.definition.string.end.c", + "t": "source.objcpp meta.preprocessor.include.objcpp string.quoted.other.lt-gt.include.objcpp punctuation.definition.string.end.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -177,7 +177,7 @@ }, { "c": "/*", - "t": "source.objcpp comment.block.c punctuation.definition.comment.begin.c", + "t": "source.objcpp comment.block.objcpp punctuation.definition.comment.begin.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -188,7 +188,7 @@ }, { "c": "\tMulti", - "t": "source.objcpp comment.block.c", + "t": "source.objcpp comment.block.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -199,7 +199,7 @@ }, { "c": "\tLine", - "t": "source.objcpp comment.block.c", + "t": "source.objcpp comment.block.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -210,7 +210,7 @@ }, { "c": "\tComments", - "t": "source.objcpp comment.block.c", + "t": "source.objcpp comment.block.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -221,7 +221,7 @@ }, { "c": "*/", - "t": "source.objcpp comment.block.c punctuation.definition.comment.end.c", + "t": "source.objcpp comment.block.objcpp punctuation.definition.comment.end.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -232,7 +232,7 @@ }, { "c": "@", - "t": "source.objcpp meta.implementation.objc storage.type.objc punctuation.definition.storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp storage.type.objcpp punctuation.definition.storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -243,7 +243,7 @@ }, { "c": "implementation", - "t": "source.objcpp meta.implementation.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -254,7 +254,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc", + "t": "source.objcpp meta.implementation.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -265,7 +265,7 @@ }, { "c": "Test", - "t": "source.objcpp meta.implementation.objc entity.name.type.objc", + "t": "source.objcpp meta.implementation.objcpp entity.name.type.objcpp", "r": { "dark_plus": "entity.name.type: #4EC9B0", "light_plus": "entity.name.type: #267F99", @@ -276,7 +276,7 @@ }, { "c": "- ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -287,7 +287,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -298,7 +298,7 @@ }, { "c": "void", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc storage.type.built-in.primitive.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp storage.type.built-in.primitive.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -309,7 +309,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -320,7 +320,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -331,7 +331,7 @@ }, { "c": "applicationWillFinishLaunching", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc entity.name.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp entity.name.function.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -342,7 +342,7 @@ }, { "c": ":", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc entity.name.function.name-of-parameter.objc punctuation.separator.arguments.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp entity.name.function.name-of-parameter.objcpp punctuation.separator.arguments.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -353,7 +353,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -364,7 +364,7 @@ }, { "c": "NSNotification", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -375,7 +375,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -386,7 +386,7 @@ }, { "c": "*", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -397,7 +397,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -408,7 +408,7 @@ }, { "c": "notification", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc variable.parameter.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp variable.parameter.function.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -419,7 +419,7 @@ }, { "c": "{", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.begin.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -430,7 +430,7 @@ }, { "c": "}", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.end.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -441,7 +441,7 @@ }, { "c": "- ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -452,7 +452,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -463,7 +463,7 @@ }, { "c": "IBAction", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -474,7 +474,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -485,7 +485,7 @@ }, { "c": "onSelectInput", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc entity.name.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp entity.name.function.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -496,7 +496,7 @@ }, { "c": ":", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc entity.name.function.name-of-parameter.objc punctuation.separator.arguments.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp entity.name.function.name-of-parameter.objcpp punctuation.separator.arguments.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -507,7 +507,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -518,7 +518,7 @@ }, { "c": "id", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc storage.type.id.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp storage.type.id.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -529,7 +529,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -540,7 +540,7 @@ }, { "c": "sender", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc variable.parameter.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp variable.parameter.function.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -551,7 +551,7 @@ }, { "c": "{", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.begin.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -562,7 +562,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -573,7 +573,7 @@ }, { "c": "NSString", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -584,7 +584,7 @@ }, { "c": "*", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -595,7 +595,7 @@ }, { "c": " defaultDir ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -606,7 +606,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -617,7 +617,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.whitespace.support.function.leading.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.whitespace.support.function.leading.cocoa.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -628,7 +628,7 @@ }, { "c": "NSSearchPathForDirectoriesInDomains", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.function.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp support.function.cocoa.objcpp", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -639,7 +639,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp punctuation.section.parens.begin.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -650,7 +650,7 @@ }, { "c": "NSDocumentDirectory", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c support.constant.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp support.constant.cocoa.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -661,7 +661,7 @@ }, { "c": ",", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.separator.delimiter.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp punctuation.separator.delimiter.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -672,7 +672,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -683,7 +683,7 @@ }, { "c": "NSUserDomainMask", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c support.constant.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp support.constant.cocoa.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -694,7 +694,7 @@ }, { "c": ",", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.separator.delimiter.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp punctuation.separator.delimiter.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -705,7 +705,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -716,7 +716,7 @@ }, { "c": "true", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c constant.language.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp constant.language.objcpp", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -727,7 +727,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.parens.block.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.parens.block.objcpp punctuation.section.parens.end.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -738,7 +738,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -749,7 +749,7 @@ }, { "c": "0", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -760,7 +760,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -771,7 +771,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -782,7 +782,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -793,7 +793,7 @@ }, { "c": "NSOpenPanel", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -804,7 +804,7 @@ }, { "c": "*", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -815,7 +815,7 @@ }, { "c": " panel ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -826,7 +826,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -837,7 +837,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -848,7 +848,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -859,7 +859,7 @@ }, { "c": "NSOpenPanel", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -870,7 +870,7 @@ }, { "c": " openPanel", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -881,7 +881,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -892,7 +892,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -903,7 +903,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -914,7 +914,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +925,7 @@ }, { "c": "panel setAllowedFileTypes:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -936,7 +936,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -947,7 +947,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -958,7 +958,7 @@ }, { "c": "NSArray", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -969,7 +969,7 @@ }, { "c": " alloc", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -980,7 +980,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -991,7 +991,7 @@ }, { "c": " initWithObjects:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1002,7 +1002,7 @@ }, { "c": "@\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.begin.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1013,7 +1013,7 @@ }, { "c": "ipa", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1024,7 +1024,7 @@ }, { "c": "\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.end.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1035,7 +1035,7 @@ }, { "c": ",", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.separator.delimiter.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1046,7 +1046,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1057,7 +1057,7 @@ }, { "c": "@\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.begin.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1068,7 +1068,7 @@ }, { "c": "xcarchive", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1079,7 +1079,7 @@ }, { "c": "\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.end.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1090,7 +1090,7 @@ }, { "c": ",", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.separator.delimiter.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1101,7 +1101,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1112,7 +1112,7 @@ }, { "c": "@\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.begin.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1123,7 +1123,7 @@ }, { "c": "app", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1134,7 +1134,7 @@ }, { "c": "\"", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c string.quoted.double.objc punctuation.definition.string.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp string.quoted.double.objcpp punctuation.definition.string.end.objcpp", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -1145,7 +1145,7 @@ }, { "c": ",", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.delimiter.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.separator.delimiter.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1156,7 +1156,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1167,7 +1167,7 @@ }, { "c": "nil", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c constant.language.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp constant.language.objcpp", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -1178,7 +1178,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1189,7 +1189,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1200,7 +1200,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1211,7 +1211,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1222,7 +1222,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1233,7 +1233,7 @@ }, { "c": "panel beginWithCompletionHandler:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1244,7 +1244,7 @@ }, { "c": "^", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1255,7 +1255,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.section.parens.begin.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1266,7 +1266,7 @@ }, { "c": "NSInteger", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.type.cocoa.leopard", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp support.type.cocoa.leopard.objcpp", "r": { "dark_plus": "support.type: #4EC9B0", "light_plus": "support.type: #267F99", @@ -1277,7 +1277,7 @@ }, { "c": " result", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1288,7 +1288,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.section.parens.end.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1299,7 +1299,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1310,7 @@ }, { "c": "{", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.section.block.begin.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1321,7 +1321,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1332,7 +1332,7 @@ }, { "c": "if", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c keyword.control.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp keyword.control.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1343,7 +1343,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1354,7 +1354,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c punctuation.section.parens.begin.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp punctuation.section.parens.begin.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1365,7 +1365,7 @@ }, { "c": "result ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1376,7 +1376,7 @@ }, { "c": "==", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c keyword.operator.comparison.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp keyword.operator.comparison.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1387,7 +1387,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1398,7 +1398,7 @@ }, { "c": "NSFileHandlingPanelOKButton", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c support.constant.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp support.constant.cocoa.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1409,7 +1409,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.parens.block.c punctuation.section.parens.end.bracket.round.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.parens.block.objcpp punctuation.section.parens.end.bracket.round.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1420,7 +1420,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1431,7 +1431,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1442,7 +1442,7 @@ }, { "c": "self", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp variable.other.object.access.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1453,7 +1453,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.separator.dot-access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1464,7 +1464,7 @@ }, { "c": "inputTextField", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp variable.other.member.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1475,7 +1475,7 @@ }, { "c": " setStringValue:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1486,7 +1486,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1497,7 +1497,7 @@ }, { "c": "panel", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp variable.other.object.access.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1508,7 +1508,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.separator.dot-access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1519,7 +1519,7 @@ }, { "c": "URL", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp variable.other.member.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1530,7 +1530,7 @@ }, { "c": " path", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1541,7 +1541,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1552,7 +1552,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1563,7 +1563,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1574,7 +1574,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1585,7 +1585,7 @@ }, { "c": "}", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.section.block.end.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1596,7 +1596,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1607,7 +1607,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1618,7 +1618,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1629,7 +1629,7 @@ }, { "c": "return", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.control.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -1640,7 +1640,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1651,7 +1651,7 @@ }, { "c": "YES", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.language.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.language.objcpp", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -1662,7 +1662,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1673,7 +1673,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1684,7 +1684,7 @@ }, { "c": "int", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c storage.type.built-in.primitive.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp storage.type.built-in.primitive.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1695,7 +1695,7 @@ }, { "c": " hex ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1706,7 +1706,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1717,7 +1717,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1728,7 +1728,7 @@ }, { "c": "0x", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.hexadecimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.hexadecimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1739,7 +1739,7 @@ }, { "c": "FEF1F0F", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.hexadecimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.hexadecimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1750,7 +1750,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1761,7 +1761,7 @@ }, { "c": "\t ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1772,7 +1772,7 @@ }, { "c": "float", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c storage.type.built-in.primitive.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp storage.type.built-in.primitive.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -1783,7 +1783,7 @@ }, { "c": " ing ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1794,7 +1794,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1805,7 +1805,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1816,7 +1816,7 @@ }, { "c": "3", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1827,7 +1827,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1838,7 +1838,7 @@ }, { "c": "14", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1849,7 +1849,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1860,7 +1860,7 @@ }, { "c": "\t ing ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1871,7 +1871,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1882,7 +1882,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1893,7 +1893,7 @@ }, { "c": "3", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1904,7 +1904,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1915,7 +1915,7 @@ }, { "c": "14", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1926,7 +1926,7 @@ }, { "c": "e", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.exponent.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -1937,7 +1937,7 @@ }, { "c": "0", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.exponent.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.exponent.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -1948,7 +1948,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1959,7 +1959,7 @@ }, { "c": "\t ing ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1970,7 +1970,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -1981,7 +1981,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1992,7 +1992,7 @@ }, { "c": "31", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2003,7 +2003,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.point.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.point.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2014,7 +2014,7 @@ }, { "c": "4", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2025,7 +2025,7 @@ }, { "c": "e", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.other.unit.exponent.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.other.unit.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.other.unit: #B5CEA8", "light_plus": "keyword.other.unit: #09885A", @@ -2036,7 +2036,7 @@ }, { "c": "-", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.minus.exponent.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.minus.exponent.decimal.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2047,7 +2047,7 @@ }, { "c": "2", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.numeric.exponent.decimal.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.numeric.exponent.decimal.objcpp", "r": { "dark_plus": "constant.numeric: #B5CEA8", "light_plus": "constant.numeric: #09885A", @@ -2058,7 +2058,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2069,7 +2069,7 @@ }, { "c": "}", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.end.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2080,7 +2080,7 @@ }, { "c": "-", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2091,7 +2091,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -2102,7 +2102,7 @@ }, { "c": "id", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc storage.type.id.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp storage.type.id.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2113,7 +2113,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -2124,7 +2124,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp", "r": { "dark_plus": "meta.return-type: #4EC9B0", "light_plus": "meta.return-type: #267F99", @@ -2135,7 +2135,7 @@ }, { "c": "initWithParams", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.return-type.objc entity.name.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.return-type.objcpp entity.name.function.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -2146,7 +2146,7 @@ }, { "c": ":", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc entity.name.function.name-of-parameter.objc punctuation.separator.arguments.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp entity.name.function.name-of-parameter.objcpp punctuation.separator.arguments.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -2157,7 +2157,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2168,7 +2168,7 @@ }, { "c": "id", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2179,7 +2179,7 @@ }, { "c": "<", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc punctuation.section.scope.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp punctuation.section.scope.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2190,7 +2190,7 @@ }, { "c": "anObject", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2201,7 +2201,7 @@ }, { "c": ">", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc punctuation.section.scope.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp punctuation.section.scope.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2212,7 +2212,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2223,7 +2223,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2234,7 +2234,7 @@ }, { "c": "aHandler", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc variable.parameter.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp variable.parameter.function.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2245,7 +2245,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2256,7 +2256,7 @@ }, { "c": "withDeviceStateManager", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc entity.name.function.name-of-parameter.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp entity.name.function.name-of-parameter.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -2267,7 +2267,7 @@ }, { "c": ":", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc entity.name.function.name-of-parameter.objc punctuation.separator.arguments.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp entity.name.function.name-of-parameter.objcpp punctuation.separator.arguments.objcpp", "r": { "dark_plus": "entity.name.function: #DCDCAA", "light_plus": "entity.name.function: #795E26", @@ -2278,7 +2278,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2289,7 +2289,7 @@ }, { "c": "id", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2300,7 +2300,7 @@ }, { "c": "<", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc punctuation.section.scope.begin.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp punctuation.section.scope.begin.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2311,7 +2311,7 @@ }, { "c": "anotherObject", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2322,7 +2322,7 @@ }, { "c": ">", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc meta.id-with-protocol.objc meta.protocol-list.objc punctuation.section.scope.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp meta.id-with-protocol.objcpp meta.protocol-list.objcpp punctuation.section.scope.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2333,7 +2333,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc punctuation.definition.type.end.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp punctuation.definition.type.end.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2344,7 +2344,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2355,7 +2355,7 @@ }, { "c": "deviceStateManager", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.function.objc meta.argument-type.objc variable.parameter.function.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.function.objcpp meta.argument-type.objcpp variable.parameter.function.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2366,7 +2366,7 @@ }, { "c": "{", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.begin.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.begin.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2377,7 +2377,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.whitespace.comment.leading.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.whitespace.comment.leading.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2388,7 +2388,7 @@ }, { "c": "//", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.c punctuation.definition.comment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp comment.line.double-slash.objcpp punctuation.definition.comment.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -2399,7 +2399,7 @@ }, { "c": " add a tap gesture recognizer", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c comment.line.double-slash.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp comment.line.double-slash.objcpp", "r": { "dark_plus": "comment: #6A9955", "light_plus": "comment: #008000", @@ -2410,7 +2410,7 @@ }, { "c": " UITapGestureRecognizer ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2421,7 +2421,7 @@ }, { "c": "*", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2432,7 +2432,7 @@ }, { "c": "tapGesture ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2443,7 +2443,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2454,7 +2454,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2465,7 +2465,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2476,7 +2476,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2487,7 +2487,7 @@ }, { "c": "UITapGestureRecognizer alloc", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2498,7 +2498,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2509,7 +2509,7 @@ }, { "c": " initWithTarget:self action:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2520,7 +2520,7 @@ }, { "c": "@", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc storage.type.objc punctuation.definition.storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.selector.objcpp storage.type.objcpp punctuation.definition.storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2531,7 +2531,7 @@ }, { "c": "selector", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.selector.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -2542,7 +2542,7 @@ }, { "c": "(", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc punctuation.definition.storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.selector.objcpp punctuation.definition.storage.type.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2553,7 +2553,7 @@ }, { "c": "handleTap:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc meta.selector.method-name.objc support.function.any-method.name-of-parameter.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.selector.objcpp meta.selector.method-name.objcpp support.function.any-method.name-of-parameter.objcpp", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2564,7 +2564,7 @@ }, { "c": ")", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c meta.selector.objc punctuation.definition.storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp meta.selector.objcpp punctuation.definition.storage.type.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2575,7 +2575,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2586,7 +2586,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2597,7 +2597,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2608,7 +2608,7 @@ }, { "c": "NSMutableArray", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -2619,7 +2619,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2630,7 +2630,7 @@ }, { "c": "*", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2641,7 +2641,7 @@ }, { "c": "gestureRecognizers ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2652,7 +2652,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2663,7 +2663,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2674,7 +2674,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2685,7 +2685,7 @@ }, { "c": "NSMutableArray", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c support.class.cocoa", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp support.class.cocoa.objcpp", "r": { "dark_plus": "support.class: #4EC9B0", "light_plus": "support.class: #267F99", @@ -2696,7 +2696,7 @@ }, { "c": " array", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2707,7 +2707,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2718,7 +2718,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2729,7 +2729,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2740,7 +2740,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2751,7 +2751,7 @@ }, { "c": "gestureRecognizers addObject:tapGesture", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2762,7 +2762,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2773,7 +2773,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2784,7 +2784,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2795,7 +2795,7 @@ }, { "c": "[", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.begin.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.begin.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2806,7 +2806,7 @@ }, { "c": "gestureRecognizers addObjectsFromArray:", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2817,7 +2817,7 @@ }, { "c": "scnView", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c variable.other.object.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp variable.other.object.access.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2828,7 +2828,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.separator.dot-access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.separator.dot-access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2839,7 +2839,7 @@ }, { "c": "gestureRecognizers", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c variable.other.member.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp variable.other.member.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2850,7 +2850,7 @@ }, { "c": "]", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c meta.bracket.square.access.c punctuation.definition.end.bracket.square.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp meta.bracket.square.access.objcpp punctuation.definition.end.bracket.square.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2861,7 +2861,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2872,7 +2872,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2883,7 +2883,7 @@ }, { "c": "scnView", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c variable.other.object.access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp variable.other.object.access.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2894,7 +2894,7 @@ }, { "c": ".", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.separator.dot-access.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.separator.dot-access.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2905,7 +2905,7 @@ }, { "c": "gestureRecognizers", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c variable.other.member.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp variable.other.member.objcpp", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2916,7 +2916,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2927,7 +2927,7 @@ }, { "c": "=", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.operator.assignment.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.operator.assignment.objcpp", "r": { "dark_plus": "keyword.operator: #D4D4D4", "light_plus": "keyword.operator: #000000", @@ -2938,7 +2938,7 @@ }, { "c": " gestureRecognizers", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2949,7 +2949,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2960,7 +2960,7 @@ }, { "c": "\t", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2971,7 +2971,7 @@ }, { "c": "return", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.control.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -2982,7 +2982,7 @@ }, { "c": " tapGesture", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2993,7 +2993,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3004,7 +3004,7 @@ }, { "c": "\t", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3015,7 +3015,7 @@ }, { "c": "return", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c keyword.control.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp keyword.control.objcpp", "r": { "dark_plus": "keyword.control: #C586C0", "light_plus": "keyword.control: #AF00DB", @@ -3026,7 +3026,7 @@ }, { "c": " ", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3037,7 +3037,7 @@ }, { "c": "nil", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c constant.language.objc", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp constant.language.objcpp", "r": { "dark_plus": "constant.language: #569CD6", "light_plus": "constant.language: #0000FF", @@ -3048,7 +3048,7 @@ }, { "c": ";", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.terminator.statement.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.terminator.statement.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3059,7 +3059,7 @@ }, { "c": "}", - "t": "source.objcpp meta.implementation.objc meta.scope.implementation.objc meta.function-with-body.objc meta.block.c punctuation.section.block.end.bracket.curly.c", + "t": "source.objcpp meta.implementation.objcpp meta.scope.implementation.objcpp meta.function-with-body.objcpp meta.block.objcpp punctuation.section.block.end.bracket.curly.objcpp", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3070,7 +3070,7 @@ }, { "c": "@", - "t": "source.objcpp meta.implementation.objc storage.type.objc punctuation.definition.storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp storage.type.objcpp punctuation.definition.storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", @@ -3081,7 +3081,7 @@ }, { "c": "end", - "t": "source.objcpp meta.implementation.objc storage.type.objc", + "t": "source.objcpp meta.implementation.objcpp storage.type.objcpp", "r": { "dark_plus": "storage.type: #569CD6", "light_plus": "storage.type: #0000FF", diff --git a/extensions/php-language-features/package.json b/extensions/php-language-features/package.json index 28ccad47def..bb84a785eb4 100644 --- a/extensions/php-language-features/package.json +++ b/extensions/php-language-features/package.json @@ -80,6 +80,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.21" + "@types/node": "^10.14.8" } } diff --git a/extensions/php-language-features/yarn.lock b/extensions/php-language-features/yarn.lock index 1bcd757b8a1..e6247e29255 100644 --- a/extensions/php-language-features/yarn.lock +++ b/extensions/php-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index 1f7d48782d2..43a3ae648dc 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -86,7 +86,9 @@ "name": "Class name", "scope": [ "entity.name.class", - "entity.name.type" + "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution" ], "settings": { "fontStyle": "underline", diff --git a/extensions/theme-defaults/themes/dark_plus.json b/extensions/theme-defaults/themes/dark_plus.json index e73cc3a09af..1898153ba89 100644 --- a/extensions/theme-defaults/themes/dark_plus.json +++ b/extensions/theme-defaults/themes/dark_plus.json @@ -21,6 +21,8 @@ "support.class", "support.type", "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution", "entity.name.class", "storage.type.numeric.go", "storage.type.byte.go", @@ -67,10 +69,10 @@ } }, { - "name": "Control flow keywords", + "name": "Control flow / Special keywords", "scope": [ "keyword.control", - "keyword.operator.new.cpp", + "source.cpp keyword.operator.new", "keyword.operator.delete", "keyword.other.using", "keyword.other.operator" diff --git a/extensions/theme-defaults/themes/hc_black.json b/extensions/theme-defaults/themes/hc_black.json index 870681495dc..8119256d5f2 100644 --- a/extensions/theme-defaults/themes/hc_black.json +++ b/extensions/theme-defaults/themes/hc_black.json @@ -26,6 +26,8 @@ "support.class", "support.type", "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution", "entity.name.class", "storage.type.cs", "storage.type.generic.cs", @@ -65,11 +67,11 @@ } }, { - "name": "Control flow keywords", + "name": "Control flow / Special keywords", "scope": [ "keyword.control", - "keyword.operator.new.cpp", - "keyword.operator.delete.cpp", + "source.cpp keyword.operator.new", + "source.cpp keyword.operator.delete", "keyword.other.using", "keyword.other.operator" ], diff --git a/extensions/theme-defaults/themes/light_plus.json b/extensions/theme-defaults/themes/light_plus.json index ce23ed901d6..7138f045d58 100644 --- a/extensions/theme-defaults/themes/light_plus.json +++ b/extensions/theme-defaults/themes/light_plus.json @@ -21,6 +21,8 @@ "support.class", "support.type", "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution", "entity.name.class", "storage.type.numeric.go", "storage.type.byte.go", @@ -67,11 +69,11 @@ } }, { - "name": "Control flow keywords", + "name": "Control flow / Special keywords", "scope": [ "keyword.control", - "keyword.operator.new.cpp", - "keyword.operator.delete.cpp", + "source.cpp keyword.operator.new", + "source.cpp keyword.operator.delete", "keyword.other.using", "keyword.other.operator" ], diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index fac06fd00d4..4b0eb5bdfcf 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -147,7 +147,9 @@ "scope": [ "support.class", "entity.name.class", - "entity.name.type" + "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution" ], "settings": { "foreground": "#f06431" diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json index ed325071b64..5f5e5cff916 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json @@ -143,7 +143,7 @@ }, { "name": "Class name", - "scope": "entity.name.class, entity.name.type", + "scope": "entity.name.class, entity.name.type, entity.name.namespace, entity.name.scope-resolution", "settings": { "fontStyle": "", "foreground": "#9B0000", @@ -255,7 +255,7 @@ } }, { - "name": "Keyword Control", + "name": "Keyword Control / Special", "scope": [ "keyword.control", "keyword.operator.new.cpp", diff --git a/extensions/theme-monokai/themes/monokai-color-theme.json b/extensions/theme-monokai/themes/monokai-color-theme.json index 14d616f6153..c16fa3c5575 100644 --- a/extensions/theme-monokai/themes/monokai-color-theme.json +++ b/extensions/theme-monokai/themes/monokai-color-theme.json @@ -205,7 +205,7 @@ }, { "name": "Class name", - "scope": "entity.name.type, entity.name.class", + "scope": "entity.name.type, entity.name.class, entity.name.namespace, entity.name.scope-resolution", "settings": { "fontStyle": "underline", "foreground": "#A6E22E" diff --git a/extensions/theme-quietlight/themes/quietlight-color-theme.json b/extensions/theme-quietlight/themes/quietlight-color-theme.json index 67f7caa4da5..38681612b42 100644 --- a/extensions/theme-quietlight/themes/quietlight-color-theme.json +++ b/extensions/theme-quietlight/themes/quietlight-color-theme.json @@ -125,6 +125,8 @@ "name": "Classes", "scope": [ "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution", "entity.other.inherited-class", "support.class" ], diff --git a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json index 5605aba721d..f2ee483bea4 100644 --- a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json +++ b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json @@ -72,7 +72,9 @@ "name": "Class name", "scope": [ "entity.name.class", - "entity.name.type" + "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution" ], "settings": { "fontStyle": "", diff --git a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json index b94aeb71de8..2ddb67d7ac2 100644 --- a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json +++ b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json @@ -72,7 +72,9 @@ "name": "Class name", "scope": [ "entity.name.class", - "entity.name.type" + "entity.name.type", + "entity.name.namespace", + "entity.name.scope-resolution" ], "settings": { "foreground": "#268BD2" diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json index 2ca39bf565d..6c985d1ea5e 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json @@ -101,7 +101,7 @@ }, { "name": "Class, Support", - "scope": "entity.name.class, entity.name.type, support.type, support.class", + "scope": "entity.name.class, entity.name.type, entity.name.namespace, entity.name.scope-resolution, support.type, support.class", "settings": { "fontStyle": "", "foreground": "#FFEEAD" diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index a5147d60f8e..86f996d0649 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -23,7 +23,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^12.0.2", + "@types/node": "^10.14.8", "@types/semver": "^5.5.0", "@types/rimraf": "2.0.2", "vscode": "^1.1.10" diff --git a/extensions/typescript-language-features/src/features/diagnostics.ts b/extensions/typescript-language-features/src/features/diagnostics.ts index a9de15ab539..6e0568824ad 100644 --- a/extensions/typescript-language-features/src/features/diagnostics.ts +++ b/extensions/typescript-language-features/src/features/diagnostics.ts @@ -6,6 +6,25 @@ import * as vscode from 'vscode'; import { ResourceMap } from '../utils/resourceMap'; import { DiagnosticLanguage, allDiagnosticLanguages } from '../utils/languageDescription'; +import * as arrays from '../utils/arrays'; + +function diagnosticsEquals(a: vscode.Diagnostic, b: vscode.Diagnostic): boolean { + if (a === b) { + return true; + } + + return a.code === b.code + && a.message === b.message + && a.severity === b.severity + && a.source === b.source + && a.range.isEqual(b.range) + && arrays.equals(a.relatedInformation || arrays.empty, b.relatedInformation || arrays.empty, (a, b) => { + return a.message === b.message + && a.location.range.isEqual(b.location.range) + && a.location.uri.fsPath === b.location.uri.fsPath; + }) + && arrays.equals(a.tags || arrays.empty, b.tags || arrays.empty); +} export const enum DiagnosticKind { Syntax, @@ -31,12 +50,10 @@ class FileDiagnostics { this.language = language; } - if (diagnostics.length === 0) { - const existing = this._diagnostics.get(kind); - if (!existing || existing && existing.length === 0) { - // No need to update - return false; - } + const existing = this._diagnostics.get(kind); + if (arrays.equals(existing || arrays.empty, diagnostics, diagnosticsEquals)) { + // No need to update + return false; } this._diagnostics.set(kind, diagnostics); diff --git a/extensions/typescript-language-features/src/test/server.test.ts b/extensions/typescript-language-features/src/test/server.test.ts new file mode 100644 index 00000000000..bd22203d8d3 --- /dev/null +++ b/extensions/typescript-language-features/src/test/server.test.ts @@ -0,0 +1,76 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; +import 'mocha'; +import * as stream from 'stream'; +import { PipeRequestCanceller, ServerProcess, TypeScriptServer } from '../tsServer/server'; +import { nulToken } from '../utils/cancellation'; +import Logger from '../utils/logger'; +import TelemetryReporter from '../utils/telemetry'; +import Tracer from '../utils/tracer'; +import * as Proto from '../protocol'; + + +const NoopTelemetryReporter = new class implements TelemetryReporter { + logTelemetry(): void { /* noop */ } + dispose(): void { /* noop */ } +}; + +class FakeServerProcess implements ServerProcess { + private readonly _out: stream.PassThrough; + + private readonly writeListeners = new Set<(data: Buffer) => void>(); + public stdout: stream.PassThrough; + + constructor() { + this._out = new stream.PassThrough(); + this.stdout = this._out; + } + + public write(data: Proto.Request) { + const listeners = Array.from(this.writeListeners); + this.writeListeners.clear(); + + setImmediate(() => { + for (const listener of listeners) { + listener(Buffer.from(JSON.stringify(data), 'utf8')); + } + const body = Buffer.from(JSON.stringify({ 'seq': data.seq, 'type': 'response', 'command': data.command, 'request_seq': data.seq, 'success': true }), 'utf8'); + this._out.write(Buffer.from(`Content-Length: ${body.length}\r\n\r\n${body}`, 'utf8')); + }); + } + + + on(_name: any, _handler: any) { /* noop */ } + + kill(): void { /* noop */ } + + public onWrite(): Promise { + return new Promise((resolve) => { + this.writeListeners.add((data) => { + resolve(JSON.parse(data.toString())); + }); + }); + } +} + +suite('Server', () => { + const tracer = new Tracer(new Logger()); + + test('should send requests with increasing sequence numbers', async () => { + const process = new FakeServerProcess(); + const server = new TypeScriptServer(process, undefined, new PipeRequestCanceller(undefined, tracer), undefined!, NoopTelemetryReporter, tracer); + + const onWrite1 = process.onWrite(); + server.executeImpl('geterr', {}, { isAsync: false, token: nulToken, expectsResult: true }); + assert.strictEqual((await onWrite1).seq, 0); + + const onWrite2 = process.onWrite(); + server.executeImpl('geterr', {}, { isAsync: false, token: nulToken, expectsResult: true }); + assert.strictEqual((await onWrite2).seq, 1); + }); +}); + diff --git a/extensions/typescript-language-features/src/tsServer/server.ts b/extensions/typescript-language-features/src/tsServer/server.ts index 1bfb290fa0a..10a001d52c2 100644 --- a/extensions/typescript-language-features/src/tsServer/server.ts +++ b/extensions/typescript-language-features/src/tsServer/server.ts @@ -3,9 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as cp from 'child_process'; +import * as child_process from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; +import * as stream from 'stream'; import * as vscode from 'vscode'; import * as Proto from '../protocol'; import { ServerResponse } from '../typescriptService'; @@ -125,7 +126,13 @@ export class TypeScriptServerSpawner { const childProcess = electron.fork(version.tsServerPath, args, this.getForkOptions()); this._logger.info('Started TSServer'); - return new TypeScriptServer(childProcess, tsServerLogFile, cancellationPipeName, version, this._telemetryReporter, this._tracer); + return new TypeScriptServer( + new ChildServerProcess(childProcess), + tsServerLogFile, + new PipeRequestCanceller(cancellationPipeName, this._tracer), + version, + this._telemetryReporter, + this._tracer); } private getForkOptions() { @@ -239,6 +246,63 @@ export class TypeScriptServerSpawner { } } +export interface OngoingRequestCanceller { + tryCancelOngoingRequest(seq: number): boolean; +} + +export class PipeRequestCanceller implements OngoingRequestCanceller { + public constructor( + private readonly _cancellationPipeName: string | undefined, + private readonly _tracer: Tracer, + ) { } + + public tryCancelOngoingRequest(seq: number): boolean { + if (!this._cancellationPipeName) { + return false; + } + this._tracer.logTrace(`TypeScript Server: trying to cancel ongoing request with sequence number ${seq}`); + try { + fs.writeFileSync(this._cancellationPipeName + seq, ''); + } catch { + // noop + } + return true; + } +} + +export interface ServerProcess { + readonly stdout: stream.Readable; + write(serverRequest: Proto.Request): void; + + on(name: 'exit', handler: (code: number | null) => void): void; + on(name: 'error', handler: (error: Error) => void): void; + + kill(): void; +} + +class ChildServerProcess implements ServerProcess { + + public constructor( + private readonly _process: child_process.ChildProcess, + ) { } + + get stdout(): stream.Readable { return this._process.stdout!; } + + write(serverRequest: Proto.Request): void { + this._process.stdin!.write(JSON.stringify(serverRequest) + '\r\n', 'utf8'); + } + + on(name: 'exit', handler: (code: number | null) => void): void; + on(name: 'error', handler: (error: Error) => void): void; + on(name: any, handler: any) { + this._process.on(name, handler); + } + + kill(): void { + this._process.kill(); + } +} + export class TypeScriptServer extends Disposable { private readonly _reader: Reader; private readonly _requestQueue = new RequestQueue(); @@ -246,18 +310,25 @@ export class TypeScriptServer extends Disposable { private readonly _pendingResponses = new Set(); constructor( - private readonly _childProcess: cp.ChildProcess, + private readonly _process: ServerProcess, private readonly _tsServerLogFile: string | undefined, - private readonly _cancellationPipeName: string | undefined, + private readonly _requestCanceller: OngoingRequestCanceller, private readonly _version: TypeScriptVersion, private readonly _telemetryReporter: TelemetryReporter, private readonly _tracer: Tracer, ) { super(); - this._reader = this._register(new Reader(this._childProcess.stdout!)); + this._reader = this._register(new Reader(this._process.stdout!)); this._reader.onData(msg => this.dispatchMessage(msg)); - this._childProcess.on('exit', code => this.handleExit(code)); - this._childProcess.on('error', error => this.handleError(error)); + + this._process.on('exit', code => { + this._onExit.fire(code); + this._callbacks.destroy('server exited'); + }); + this._process.on('error', error => { + this._onError.fire(error); + this._callbacks.destroy('server errored'); + }); } private readonly _onEvent = this._register(new vscode.EventEmitter()); @@ -273,8 +344,8 @@ export class TypeScriptServer extends Disposable { public get tsServerLogFile() { return this._tsServerLogFile; } - public write(serverRequest: Proto.Request) { - this._childProcess.stdin!.write(JSON.stringify(serverRequest) + '\r\n', 'utf8'); + private write(serverRequest: Proto.Request) { + this._process.write(serverRequest); } public dispose() { @@ -284,17 +355,7 @@ export class TypeScriptServer extends Disposable { } public kill() { - this._childProcess.kill(); - } - - private handleExit(error: any) { - this._onExit.fire(error); - this._callbacks.destroy('server exited'); - } - - private handleError(error: any) { - this._onError.fire(error); - this._callbacks.destroy('server errored'); + this._process.kill(); } private dispatchMessage(message: Proto.Message) { @@ -334,13 +395,7 @@ export class TypeScriptServer extends Disposable { return true; } - if (this._cancellationPipeName) { - this._tracer.logTrace(`TypeScript Server: trying to cancel ongoing request with sequence number ${seq}`); - try { - fs.writeFileSync(this._cancellationPipeName + seq, ''); - } catch { - // noop - } + if (this._requestCanceller.tryCancelOngoingRequest(seq)) { return true; } diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 8f8f45aaa34..b478e9ed080 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -20,7 +20,7 @@ import LogDirectoryProvider from './utils/logDirectoryProvider'; import Logger from './utils/logger'; import { TypeScriptPluginPathsProvider } from './utils/pluginPathsProvider'; import { PluginManager } from './utils/plugins'; -import TelemetryReporter from './utils/telemetry'; +import TelemetryReporter, { VSCodeTelemetryReporter } from './utils/telemetry'; import Tracer from './utils/tracer'; import { inferredProjectConfig } from './utils/tsconfig'; import { TypeScriptVersionPicker } from './utils/versionPicker'; @@ -152,7 +152,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType } }, this, this._disposables); - this.telemetryReporter = this._register(new TelemetryReporter(() => { + this.telemetryReporter = this._register(new VSCodeTelemetryReporter(() => { if (this.serverState.type === ServerState.Type.Running) { if (this.serverState.tsserverVersion) { return this.serverState.tsserverVersion; diff --git a/extensions/typescript-language-features/src/utils/arrays.ts b/extensions/typescript-language-features/src/utils/arrays.ts index bf403c3afeb..f9435fe9b20 100644 --- a/extensions/typescript-language-features/src/utils/arrays.ts +++ b/extensions/typescript-language-features/src/utils/arrays.ts @@ -2,20 +2,23 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export function equals(one: ReadonlyArray, other: ReadonlyArray, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean { - if (one.length !== other.length) { + +export const empty = Object.freeze([]); + +export function equals( + a: ReadonlyArray, + b: ReadonlyArray, + itemEquals: (a: T, b: T) => boolean = (a, b) => a === b +): boolean { + if (a === b) { + return true; + } + if (a.length !== b.length) { return false; } - - for (let i = 0, len = one.length; i < len; i++) { - if (!itemEquals(one[i], other[i])) { - return false; - } - } - - return true; + return a.every((x, i) => itemEquals(x, b[i])); } export function flatten(arr: ReadonlyArray[]): T[] { - return ([] as T[]).concat.apply([], arr); + return Array.prototype.concat.apply([], arr); } \ No newline at end of file diff --git a/extensions/typescript-language-features/src/utils/telemetry.ts b/extensions/typescript-language-features/src/utils/telemetry.ts index e3b5f09adc7..fe6ea8d292a 100644 --- a/extensions/typescript-language-features/src/utils/telemetry.ts +++ b/extensions/typescript-language-features/src/utils/telemetry.ts @@ -13,15 +13,14 @@ interface PackageInfo { readonly aiKey: string; } -export default class TelemetryReporter { - private _reporter: VsCodeTelemetryReporter | null = null; +export default interface TelemetryReporter { + logTelemetry(eventName: string, properties?: { [prop: string]: string }): void; - dispose() { - if (this._reporter) { - this._reporter.dispose(); - this._reporter = null; - } - } + dispose(): void; +} + +export class VSCodeTelemetryReporter implements TelemetryReporter { + private _reporter: VsCodeTelemetryReporter | null = null; constructor( private readonly clientVersionDelegate: () => string @@ -45,6 +44,13 @@ export default class TelemetryReporter { } } + public dispose() { + if (this._reporter) { + this._reporter.dispose(); + this._reporter = null; + } + } + @memoize private get reporter(): VsCodeTelemetryReporter | null { if (this.packageInfo && this.packageInfo.aiKey) { diff --git a/extensions/typescript-language-features/yarn.lock b/extensions/typescript-language-features/yarn.lock index 968cb9074cd..683f002c727 100644 --- a/extensions/typescript-language-features/yarn.lock +++ b/extensions/typescript-language-features/yarn.lock @@ -21,11 +21,16 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.0.2": +"@types/node@*": version "12.0.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40" integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== + "@types/rimraf@2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e" diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index e1716b8555a..fd3c663e806 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@types/mocha": "2.2.43", - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "typescript": "^1.6.2", diff --git a/extensions/vscode-api-tests/yarn.lock b/extensions/vscode-api-tests/yarn.lock index c7841be1397..7585841254a 100644 --- a/extensions/vscode-api-tests/yarn.lock +++ b/extensions/vscode-api-tests/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.43.tgz#03c54589c43ad048cbcbfd63999b55d0424eec27" integrity sha512-xNlAmH+lRJdUMXClMTI9Y0pRqIojdxfm7DHsIxoB2iTzu3fnPmSMEN8SsSx0cdwV36d02PWCWaDUoZPDSln+xw== -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== ajv@^5.1.0: version "5.3.0" diff --git a/extensions/vscode-colorize-tests/package.json b/extensions/vscode-colorize-tests/package.json index 517429bb6d7..500d9120a96 100644 --- a/extensions/vscode-colorize-tests/package.json +++ b/extensions/vscode-colorize-tests/package.json @@ -11,7 +11,7 @@ "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", + "@types/node": "^10.14.8", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "vscode": "1.1.5" diff --git a/extensions/vscode-colorize-tests/yarn.lock b/extensions/vscode-colorize-tests/yarn.lock index 46684d06b5e..368b81f2f96 100644 --- a/extensions/vscode-colorize-tests/yarn.lock +++ b/extensions/vscode-colorize-tests/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.21" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" - integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== ajv@^5.1.0: version "5.3.0" diff --git a/extensions/vscode-test-resolver/package.json b/extensions/vscode-test-resolver/package.json index 6377065d874..cf87ab6c73b 100644 --- a/extensions/vscode-test-resolver/package.json +++ b/extensions/vscode-test-resolver/package.json @@ -21,7 +21,7 @@ ], "main": "./out/extension", "devDependencies": { - "@types/node": "^10.12.21", + "@types/node": "^10.14.8", "vscode": "1.1.5" }, "contributes": { diff --git a/extensions/vscode-test-resolver/src/extension.ts b/extensions/vscode-test-resolver/src/extension.ts index e137e7c9696..da2a277dcd4 100644 --- a/extensions/vscode-test-resolver/src/extension.ts +++ b/extensions/vscode-test-resolver/src/extension.ts @@ -65,7 +65,7 @@ export function activate(context: vscode.ExtensionContext) { return; } - const { updateUrl, commit, quality } = getProductConfiguration(); + const { updateUrl, commit, quality, serverDataFolderName, dataFolderName } = getProductConfiguration(); if (!commit) { // dev mode const vscodePath = path.resolve(path.join(context.extensionPath, '..', '..')); const nodeExec = process.platform === 'win32' ? 'node.exe' : 'node'; @@ -86,7 +86,10 @@ export function activate(context: vscode.ExtensionContext) { const env = getNewEnv(); extHostProcess = cp.spawn(nodePath, [path.join('out', 'remoteExtensionHostAgent'), '--port=0'], { cwd: vscodePath, env }); } else { - const serverBin = path.resolve(os.homedir(), '.vscode-remote', 'bin'); + const remoteDataDir = process.env['TESTRESOLVER_DATA_FOLDER'] || path.join(os.homedir(), serverDataFolderName || `${dataFolderName}-testresolver`); + outputChannel.appendLine(`Using data folder at ${remoteDataDir}`); + + const serverBin = path.join(remoteDataDir, 'bin'); progress.report({ message: 'Installing VSCode Server' }); const serverLocation = await downloadAndUnzipVSCodeServer(updateUrl, commit, quality, serverBin); outputChannel.appendLine(`Using server build at ${serverLocation}`); @@ -95,8 +98,10 @@ export function activate(context: vscode.ExtensionContext) { const env = getNewEnv(); env['PATH'] = path.join(serverLocation, 'bin') + path.delimiter + env['PATH']; // code command for the terminal + env['VSCODE_AGENT_FOLDER'] = remoteDataDir; - extHostProcess = cp.spawn(path.join(serverLocation, 'server.sh'), commandArgs, { env, cwd: serverLocation }); + const serverCommand = process.platform === 'win32' ? 'server.bat' : 'server.sh'; + extHostProcess = cp.spawn(path.join(serverLocation, serverCommand), commandArgs, { env, cwd: serverLocation }); } extHostProcess.stdout.on('data', (data: Buffer) => processOutput(data.toString())); extHostProcess.stderr.on('data', (data: Buffer) => processOutput(data.toString())); @@ -166,6 +171,8 @@ export interface IProductConfiguration { updateUrl: string; commit: string; quality: string; + dataFolderName: string; + serverDataFolderName?: string; } function getProductConfiguration(): IProductConfiguration { diff --git a/extensions/vscode-test-resolver/yarn.lock b/extensions/vscode-test-resolver/yarn.lock index 4cb37817738..925cef2c142 100644 --- a/extensions/vscode-test-resolver/yarn.lock +++ b/extensions/vscode-test-resolver/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^10.12.21": - version "10.12.30" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.30.tgz#4c2b4f0015f214f8158a347350481322b3b29b2f" - integrity sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== ajv@^6.5.5: version "6.10.0" diff --git a/package.json b/package.json index 17ed752705f..57e8f85a2d5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.36.0", - "distro": "15aab9a6b297eb15ea96c450d3b92b0758572cca", + "distro": "3974e1b8eebdf6dae9977fde7dac5ba53fe21403", "author": { "name": "Microsoft Corporation" }, @@ -40,20 +40,21 @@ "native-is-elevated": "^0.2.1", "native-keymap": "1.2.5", "native-watchdog": "1.0.0", - "node-pty": "0.9.0-beta13", + "node-pty": "0.9.0-beta16", "onigasm-umd": "^2.2.2", "semver": "^5.5.0", "spdlog": "0.8.1", "sudo-prompt": "8.2.0", "v8-inspect-profiler": "^0.0.20", "vscode-chokidar": "1.6.5", - "vscode-debugprotocol": "1.35.0", - "vscode-nsfw": "1.1.1", + "vscode-nsfw": "1.1.2", "vscode-proxy-agent": "0.4.0", "vscode-ripgrep": "^1.2.5", "vscode-sqlite3": "4.0.7", "vscode-textmate": "^4.1.1", - "vscode-xterm": "3.14.0-beta6", + "xterm": "3.15.0-beta14", + "xterm-addon-search": "0.1.0-beta5", + "xterm-addon-web-links": "0.1.0-beta9", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, @@ -70,7 +71,6 @@ "ansi-colors": "^3.2.3", "asar": "^0.14.0", "chromium-pickle-js": "^0.2.0", - "clean-css": "3.4.6", "copy-webpack-plugin": "^4.5.2", "coveralls": "^2.11.11", "cson-parser": "^1.3.3", @@ -129,13 +129,14 @@ "source-map": "^0.4.4", "ts-loader": "^4.4.2", "tslint": "^5.16.0", - "typescript": "3.4.5", + "typescript": "3.5.1", "typescript-formatter": "7.1.0", "uglify-es": "^3.0.18", "underscore": "^1.8.2", "vinyl": "^2.0.0", "vinyl-fs": "^3.0.0", "vsce": "1.48.0", + "vscode-debugprotocol": "1.35.0", "vscode-nls-dev": "3.2.5", "webpack": "^4.16.5", "webpack-cli": "^3.1.0", @@ -155,4 +156,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.3" } -} \ No newline at end of file +} diff --git a/remote/installDevModules.sh b/remote/installDevModules.sh deleted file mode 100755 index 3b8941d0024..00000000000 --- a/remote/installDevModules.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -ex - -# Install Node and Yarn -export NODE_VERSION=10.2.1 -export YARN_VERSION=1.10.1 -curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" -curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" -tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C "$HOME" --no-same-owner -tar -xzf "yarn-v$YARN_VERSION.tar.gz" -C "$HOME" -mkdir -p "$HOME/bin" -ln -s "$HOME/node-v$NODE_VERSION-linux-x64/bin/node" "$HOME/bin/node" -ln -s "$HOME/yarn-v$YARN_VERSION/bin/yarn" "$HOME/bin/yarn" -ln -s "$HOME/yarn-v$YARN_VERSION/bin/yarnpkg" "$HOME/bin/yarnpkg" -rm "node-v$NODE_VERSION-linux-x64.tar.xz" "yarn-v$YARN_VERSION.tar.gz" - -# Compile native /remote node_modules -PATH="$HOME/bin:$PATH" \ -PYTHON=/usr/bin/python2.7 \ -yarn --ignore-optional diff --git a/remote/installDevPackagesAsRoot.sh b/remote/installDevPackagesAsRoot.sh deleted file mode 100755 index 1df37767c96..00000000000 --- a/remote/installDevPackagesAsRoot.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -ex - -# Install libraries and tools -apt-get update -apt-get install -y \ - curl \ - make \ - gcc \ - g++ \ - python2.7 \ - libx11-dev \ - libxkbfile-dev \ - libsecret-1-dev \ - xz-utils -rm -rf /var/lib/apt/lists/* diff --git a/remote/launchDevMode.sh b/remote/launchDevMode.sh deleted file mode 100755 index cd7ab12976a..00000000000 --- a/remote/launchDevMode.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e - -export NODE_ENV=development -export VSCODE_DEV=1 -export VSCODE_INJECT_NODE_MODULE_LOOKUP_PATH="$HOME/.vscode-remote/bin/dev-remote/node_modules" - -cd $VSCODE_REPO - -if [ -z "$extensions" ] ; then - echo No extensions to install. - mkdir -p /root/.vscode-remote -else - (PATH="$HOME/bin:$PATH" node out/remoteExtensionHostAgent.js ${VSCODE_TELEMETRY_ARG} ${extensions} || true) -fi - -PATH="$HOME/bin:$PATH" node out/remoteExtensionHostAgent.js ${VSCODE_TELEMETRY_ARG} --port $PORT diff --git a/resources/linux/rpm/dependencies.json b/resources/linux/rpm/dependencies.json index d0b64c4fa68..34f127e1ae5 100644 --- a/resources/linux/rpm/dependencies.json +++ b/resources/linux/rpm/dependencies.json @@ -63,83 +63,5 @@ "libxcb.so.1()(64bit)", "libxkbfile.so.1()(64bit)", "libsecret-1.so.0()(64bit)" - ], - "i386": [ - "ld-linux.so.2", - "ld-linux.so.2(GLIBC_2.1)", - "libX11-xcb.so.1", - "libX11.so.6", - "libXcomposite.so.1", - "libXcursor.so.1", - "libXdamage.so.1", - "libXext.so.6", - "libXfixes.so.3", - "libXi.so.6", - "libXrandr.so.2", - "libXrender.so.1", - "libXss.so.1", - "libXtst.so.6", - "libasound.so.2", - "libatk-1.0.so.0", - "libc.so.6", - "libc.so.6(GLIBC_2.0)", - "libc.so.6(GLIBC_2.1)", - "libc.so.6(GLIBC_2.1.3)", - "libc.so.6(GLIBC_2.11)", - "libc.so.6(GLIBC_2.2)", - "libc.so.6(GLIBC_2.2.3)", - "libc.so.6(GLIBC_2.3)", - "libc.so.6(GLIBC_2.3.2)", - "libc.so.6(GLIBC_2.3.4)", - "libc.so.6(GLIBC_2.4)", - "libc.so.6(GLIBC_2.6)", - "libc.so.6(GLIBC_2.7)", - "libcairo.so.2", - "libcups.so.2", - "libdbus-1.so.3", - "libdl.so.2", - "libdl.so.2(GLIBC_2.0)", - "libdl.so.2(GLIBC_2.1)", - "libexpat.so.1", - "libfontconfig.so.1", - "libfreetype.so.6", - "libgcc_s.so.1", - "libgcc_s.so.1(GCC_4.0.0)", - "libgcc_s.so.1(GLIBC_2.0)", - "libgdk-x11-2.0.so.0", - "libgdk_pixbuf-2.0.so.0", - "libgio-2.0.so.0", - "libglib-2.0.so.0", - "libgmodule-2.0.so.0", - "libgobject-2.0.so.0", - "libgtk-3.so.0", - "libm.so.6", - "libm.so.6(GLIBC_2.0)", - "libm.so.6(GLIBC_2.1)", - "libnspr4.so", - "libnss3.so", - "libnssutil3.so", - "libpango-1.0.so.0", - "libpangocairo-1.0.so.0", - "libpthread.so.0", - "libpthread.so.0(GLIBC_2.0)", - "libpthread.so.0(GLIBC_2.1)", - "libpthread.so.0(GLIBC_2.2)", - "libpthread.so.0(GLIBC_2.2.3)", - "libpthread.so.0(GLIBC_2.3.2)", - "libpthread.so.0(GLIBC_2.3.3)", - "librt.so.1", - "librt.so.1(GLIBC_2.2)", - "libsmime3.so", - "libstdc++.so.6", - "libstdc++.so.6(GLIBCXX_3.4)", - "libstdc++.so.6(GLIBCXX_3.4.10)", - "libstdc++.so.6(GLIBCXX_3.4.11)", - "libstdc++.so.6(GLIBCXX_3.4.14)", - "libstdc++.so.6(GLIBCXX_3.4.15)", - "libstdc++.so.6(GLIBCXX_3.4.9)", - "libxcb.so.1", - "libxkbfile.so.1", - "libsecret-1.so.0" ] } \ No newline at end of file diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index 20e58bcd730..59163a017cc 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron 3.1.8 +// Type definitions for Electron 4.2.3 // Project: http://electronjs.org/ // Definitions by: The Electron Team // Definitions: https://github.com/electron/electron-typescript-definitions @@ -86,7 +86,7 @@ declare namespace Electron { webviewTag: WebviewTag; } - interface AllElectron extends MainInterface, RendererInterface {} + interface AllElectron extends MainInterface, RendererInterface { } const app: App; const autoUpdater: AutoUpdater; @@ -119,7 +119,7 @@ declare namespace Electron { interface App extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/app + // Docs: http://electronjs.org/docs/api/app /** * Emitted when Chrome's accessibility support changes. This event fires when @@ -472,6 +472,100 @@ declare namespace Electron { once(event: 'ready', listener: (launchInfo: any) => void): this; addListener(event: 'ready', listener: (launchInfo: any) => void): this; removeListener(event: 'ready', listener: (launchInfo: any) => void): this; + /** + * Emitted when remote.getBuiltin() is called in the renderer process of + * webContents. Calling event.preventDefault() will prevent the module from being + * returned. Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-builtin', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + once(event: 'remote-get-builtin', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + addListener(event: 'remote-get-builtin', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + removeListener(event: 'remote-get-builtin', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + /** + * Emitted when remote.getCurrentWebContents() is called in the renderer process of + * webContents. Calling event.preventDefault() will prevent the object from being + * returned. Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-current-web-contents', listener: (event: Event, + webContents: WebContents) => void): this; + once(event: 'remote-get-current-web-contents', listener: (event: Event, + webContents: WebContents) => void): this; + addListener(event: 'remote-get-current-web-contents', listener: (event: Event, + webContents: WebContents) => void): this; + removeListener(event: 'remote-get-current-web-contents', listener: (event: Event, + webContents: WebContents) => void): this; + /** + * Emitted when remote.getCurrentWindow() is called in the renderer process of + * webContents. Calling event.preventDefault() will prevent the object from being + * returned. Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-current-window', listener: (event: Event, + webContents: WebContents) => void): this; + once(event: 'remote-get-current-window', listener: (event: Event, + webContents: WebContents) => void): this; + addListener(event: 'remote-get-current-window', listener: (event: Event, + webContents: WebContents) => void): this; + removeListener(event: 'remote-get-current-window', listener: (event: Event, + webContents: WebContents) => void): this; + /** + * Emitted when remote.getGlobal() is called in the renderer process of + * webContents. Calling event.preventDefault() will prevent the global from being + * returned. Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-global', listener: (event: Event, + webContents: WebContents, + globalName: string) => void): this; + once(event: 'remote-get-global', listener: (event: Event, + webContents: WebContents, + globalName: string) => void): this; + addListener(event: 'remote-get-global', listener: (event: Event, + webContents: WebContents, + globalName: string) => void): this; + removeListener(event: 'remote-get-global', listener: (event: Event, + webContents: WebContents, + globalName: string) => void): this; + /** + * Emitted when .getWebContents() is called in the renderer process of + * webContents. Calling event.preventDefault() will prevent the object from being + * returned. Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-guest-web-contents', listener: (event: Event, + webContents: WebContents, + guestWebContents: WebContents) => void): this; + once(event: 'remote-get-guest-web-contents', listener: (event: Event, + webContents: WebContents, + guestWebContents: WebContents) => void): this; + addListener(event: 'remote-get-guest-web-contents', listener: (event: Event, + webContents: WebContents, + guestWebContents: WebContents) => void): this; + removeListener(event: 'remote-get-guest-web-contents', listener: (event: Event, + webContents: WebContents, + guestWebContents: WebContents) => void): this; + /** + * Emitted when remote.require() is called in the renderer process of webContents. + * Calling event.preventDefault() will prevent the module from being returned. + * Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-require', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + once(event: 'remote-require', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + addListener(event: 'remote-require', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; + removeListener(event: 'remote-require', listener: (event: Event, + webContents: WebContents, + moduleName: string) => void): this; /** * This event will be emitted inside the primary instance of your application when * a second instance has been executed. argv is an Array of the second instance's @@ -690,6 +784,11 @@ declare namespace Electron { * is ready. */ enableMixedSandbox(): void; + /** + * Enables full sandbox mode on the app. This method can only be called before app + * is ready. + */ + enableSandbox(): void; /** * Exits immediately with exitCode. exitCode defaults to 0. All windows will be * closed immediately without asking user and the before-quit and will-quit events @@ -709,13 +808,22 @@ declare namespace Electron { * Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux * and macOS, icons depend on the application associated with file mime type. */ - getFileIcon(path: string, options: FileIconOptions, callback: (error: Error, icon: NativeImage) => void): void; + getFileIcon(path: string, callback: (error: Error, icon: NativeImage) => void): void; /** * Fetches a path's associated icon. On Windows, there a 2 kinds of icons: On Linux * and macOS, icons depend on the application associated with file mime type. */ - getFileIcon(path: string, callback: (error: Error, icon: NativeImage) => void): void; + getFileIcon(path: string, options: FileIconOptions, callback: (error: Error, icon: NativeImage) => void): void; getGPUFeatureStatus(): GPUFeatureStatus; + /** + * For infoType equal to complete: Promise is fulfilled with Object containing all + * the GPU Information as in chromium's GPUInfo object. This includes the version + * and driver information that's shown on chrome://gpu page. For infoType equal to + * basic: Promise is fulfilled with Object containing fewer attributes than when + * requested with complete. Here's an example of basic response: Using basic should + * be preferred if only basic information like vendorId or driverId is needed. + */ + getGPUInfo(infoType: string): Promise; getJumpListSettings(): JumpListSettings; /** * To set the locale, you'll want to use a command line switch at app startup, @@ -754,7 +862,7 @@ declare namespace Electron { /** * Imports the certificate in pkcs12 format into the platform certificate store. * callback is called with the result of import operation, a value of 0 indicates - * success while any other value indicates failure according to chromium + * success while any other value indicates failure according to Chromium * net_error_list. */ importCertificate(options: ImportCertificateOptions, callback: (result: number) => void): void; @@ -843,9 +951,9 @@ declare namespace Electron { setAboutPanelOptions(options: AboutPanelOptionsOptions): void; /** * Manually enables Chrome's accessibility support, allowing to expose - * accessibility switch to users in application settings. - * https://www.chromium.org/developers/design-documents/accessibility for more - * details. Disabled by default. Note: Rendering accessibility tree can + * accessibility switch to users in application settings. See Chromium's + * accessibility docs for more details. Disabled by default. This API must be + * called after the ready event is emitted. Note: Rendering accessibility tree can * significantly affect the performance of your app. It should not be enabled by * default. */ @@ -929,7 +1037,12 @@ declare namespace Electron { */ show(): void; /** - * Start accessing a security scoped resource. With this method electron + * Show the about panel with the values defined in the app's .plist file or with + * the options set via app.setAboutPanelOptions(options). + */ + showAboutPanel(): void; + /** + * Start accessing a security scoped resource. With this method Electron * applications that are packaged for the Mac App Store may reach outside their * sandbox to access files chosen by the user. See Apple's documentation for a * description of how this system works. @@ -940,7 +1053,7 @@ declare namespace Electron { * userInfo into its current userInfo dictionary. */ updateCurrentActivity(type: string, userInfo: any): void; - whenReady(): Promise; + whenReady(): Promise; commandLine: CommandLine; dock: Dock; /** @@ -949,11 +1062,19 @@ declare namespace Electron { * production environments. */ isPackaged?: boolean; + /** + * A String which is the user agent string Electron will use as a global fallback. + * This is the user agent that will be used when no user agent is set at the + * webContents or session level. Useful for ensuring your entire app has the same + * user agent. Set to a custom value as early as possible in your apps + * initialization to ensure that your overridden value is used. + */ + userAgentFallback?: string; } interface AutoUpdater extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/auto-updater + // Docs: http://electronjs.org/docs/api/auto-updater /** * This event is emitted after a user calls quitAndInstall(). When this API is @@ -990,7 +1111,9 @@ declare namespace Electron { removeListener(event: 'update-available', listener: Function): this; /** * Emitted when an update has been downloaded. On Windows only releaseName is - * available. + * available. Note: It is not strictly necessary to handle this event. A + * successfully downloaded update will still be applied the next time the + * application starts. */ on(event: 'update-downloaded', listener: (event: Event, releaseNotes: string, @@ -1029,10 +1152,10 @@ declare namespace Electron { * Restarts the app and installs the update after it has been downloaded. It should * only be called after update-downloaded has been emitted. Under the hood calling * autoUpdater.quitAndInstall() will close all application windows first, and - * automatically call app.quit() after all windows have been closed. Note: If the - * application is quit without calling this API after the update-downloaded event - * has been emitted, the application will still be replaced by the updated one on - * the next run. + * automatically call app.quit() after all windows have been closed. Note: It is + * not strictly necessary to call this function to apply an update, as a + * successfully downloaded update will always be applied the next time the + * application starts. */ quitAndInstall(): void; /** @@ -1043,7 +1166,7 @@ declare namespace Electron { interface BluetoothDevice { - // Docs: http://electron.atom.io/docs/api/structures/bluetooth-device + // Docs: http://electronjs.org/docs/api/structures/bluetooth-device deviceId: string; deviceName: string; @@ -1051,11 +1174,11 @@ declare namespace Electron { class BrowserView extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/browser-view + // Docs: http://electronjs.org/docs/api/browser-view constructor(options?: BrowserViewConstructorOptions); static fromId(id: number): BrowserView; - static fromWebContents(webContents: WebContents): BrowserView | null; + static fromWebContents(webContents: WebContents): (BrowserView) | (null); static getAllViews(): BrowserView[]; /** * Force closing the view, the unload and beforeunload events won't be emitted for @@ -1076,8 +1199,19 @@ declare namespace Electron { class BrowserWindow extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/browser-window + // Docs: http://electronjs.org/docs/api/browser-window + /** + * Emitted when the window is set or unset to show always on top of other windows. + */ + on(event: 'always-on-top-changed', listener: (event: Event, + isAlwaysOnTop: boolean) => void): this; + once(event: 'always-on-top-changed', listener: (event: Event, + isAlwaysOnTop: boolean) => void): this; + addListener(event: 'always-on-top-changed', listener: (event: Event, + isAlwaysOnTop: boolean) => void): this; + removeListener(event: 'always-on-top-changed', listener: (event: Event, + isAlwaysOnTop: boolean) => void): this; /** * Emitted when an App Command is invoked. These are typically related to keyboard * media keys or browser commands, as well as the "Back" button built into some @@ -1207,13 +1341,13 @@ declare namespace Electron { * prevent the native window's title from changing. */ on(event: 'page-title-updated', listener: (event: Event, - title: string) => void): this; + title: string, explicitSet: boolean) => void): this; once(event: 'page-title-updated', listener: (event: Event, - title: string) => void): this; + title: string, explicitSet: boolean) => void): this; addListener(event: 'page-title-updated', listener: (event: Event, - title: string) => void): this; + title: string, explicitSet: boolean) => void): this; removeListener(event: 'page-title-updated', listener: (event: Event, - title: string) => void): this; + title: string, explicitSet: boolean) => void): this; /** * Emitted when the web page has been rendered (while not being shown) and window * can be displayed without a visual flash. @@ -1223,7 +1357,7 @@ declare namespace Electron { addListener(event: 'ready-to-show', listener: Function): this; removeListener(event: 'ready-to-show', listener: Function): this; /** - * Emitted when the window is being resized. + * Emitted after the window has been resized. */ on(event: 'resize', listener: Function): this; once(event: 'resize', listener: Function): this; @@ -1318,6 +1452,58 @@ declare namespace Electron { once(event: 'unresponsive', listener: Function): this; addListener(event: 'unresponsive', listener: Function): this; removeListener(event: 'unresponsive', listener: Function): this; + /** + * Emitted before the window is moved. Calling event.preventDefault() will prevent + * the window from being moved. Note that this is only emitted when the window is + * being resized manually. Resizing the window with setBounds/setSize will not emit + * this event. + */ + on(event: 'will-move', listener: (event: Event, + /** + * ` Location the window is being moved to. + */ + newBounds: Rectangle) => void): this; + once(event: 'will-move', listener: (event: Event, + /** + * ` Location the window is being moved to. + */ + newBounds: Rectangle) => void): this; + addListener(event: 'will-move', listener: (event: Event, + /** + * ` Location the window is being moved to. + */ + newBounds: Rectangle) => void): this; + removeListener(event: 'will-move', listener: (event: Event, + /** + * ` Location the window is being moved to. + */ + newBounds: Rectangle) => void): this; + /** + * Emitted before the window is resized. Calling event.preventDefault() will + * prevent the window from being resized. Note that this is only emitted when the + * window is being resized manually. Resizing the window with setBounds/setSize + * will not emit this event. + */ + on(event: 'will-resize', listener: (event: Event, + /** + * ` Size the window is being resized to. + */ + newBounds: Rectangle) => void): this; + once(event: 'will-resize', listener: (event: Event, + /** + * ` Size the window is being resized to. + */ + newBounds: Rectangle) => void): this; + addListener(event: 'will-resize', listener: (event: Event, + /** + * ` Size the window is being resized to. + */ + newBounds: Rectangle) => void): this; + removeListener(event: 'will-resize', listener: (event: Event, + /** + * ` Size the window is being resized to. + */ + newBounds: Rectangle) => void): this; constructor(options?: BrowserWindowConstructorOptions); /** * Adds DevTools extension located at path, and returns extension's name. The @@ -1335,7 +1521,7 @@ declare namespace Electron { * This API cannot be called before the ready event of the app module is emitted. */ static addExtension(path: string): void; - static fromBrowserView(browserView: BrowserView): BrowserWindow | null; + static fromBrowserView(browserView: BrowserView): (BrowserWindow) | (null); static fromId(id: number): BrowserWindow; static fromWebContents(webContents: WebContents): BrowserWindow; static getAllWindows(): BrowserWindow[]; @@ -1349,7 +1535,7 @@ declare namespace Electron { * emitted. */ static getExtensions(): Extensions; - static getFocusedWindow(): BrowserWindow | null; + static getFocusedWindow(): (BrowserWindow) | (null); /** * Remove a DevTools extension by name. Note: This API cannot be called before the * ready event of the app module is emitted. @@ -1411,7 +1597,7 @@ declare namespace Electron { * Note: The BrowserView API is currently experimental and may change or be removed * in future Electron releases. */ - getBrowserView(): BrowserView | null; + getBrowserView(): (BrowserView) | (null); getChildWindows(): BrowserWindow[]; getContentBounds(): Rectangle; getContentSize(): number[]; @@ -1422,6 +1608,13 @@ declare namespace Electron { * (unsigned long) on Linux. */ getNativeWindowHandle(): Buffer; + /** + * Note: whatever the current state of the window : maximized, minimized or in + * fullscreen, this function always returns the position and size of the window in + * normal state. In normal state, getBounds and getNormalBounds returns the same + * Rectangle. + */ + getNormalBounds(): Rectangle; getOpacity(): number; getParentWindow(): BrowserWindow; getPosition(): number[]; @@ -1473,6 +1666,7 @@ declare namespace Electron { * On Linux always returns true. */ isMovable(): boolean; + isNormal(): boolean; isResizable(): boolean; isSimpleFullScreen(): boolean; isVisible(): boolean; @@ -1485,7 +1679,7 @@ declare namespace Electron { * Same as webContents.loadFile, filePath should be a path to an HTML file relative * to the root of your application. See the webContents docs for more information. */ - loadFile(filePath: string): void; + loadFile(filePath: string, options?: LoadFileOptions): void; /** * Same as webContents.loadURL(url[, options]). The url can be a remote address * (e.g. http://) or a path to a local HTML file using the file:// protocol. To @@ -1579,7 +1773,12 @@ declare namespace Electron { */ setAutoHideMenuBar(hide: boolean): void; /** - * Resizes and moves the window to the supplied bounds + * Sets the background color of the window. See Setting backgroundColor. + */ + setBackgroundColor(backgroundColor: string): void; + /** + * Resizes and moves the window to the supplied bounds. Any properties that are not + * supplied will default to their current values. */ setBounds(bounds: Rectangle, animate?: boolean): void; setBrowserView(browserView: BrowserView): void; @@ -1655,7 +1854,7 @@ declare namespace Electron { * Sets the menu as the window's menu bar, setting it to null will remove the menu * bar. */ - setMenu(menu: Menu | null): void; + setMenu(menu: (Menu) | (null)): void; /** * Sets whether the menu bar should be visible. If the menu bar is auto-hide, users * can still bring up the menu bar by pressing the single Alt key. @@ -1682,7 +1881,7 @@ declare namespace Electron { * Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to * convey some sort of application status or to passively notify the user. */ - setOverlayIcon(overlay: NativeImage | null, description: string): void; + setOverlayIcon(overlay: (NativeImage) | (null), description: string): void; /** * Sets parent as current window's parent window, passing null will turn current * window into a top-level window. @@ -1754,7 +1953,8 @@ declare namespace Electron { /** * Sets the region of the window to show as the thumbnail image displayed when * hovering over the window in the taskbar. You can reset the thumbnail to be the - * entire window by specifying an empty region: {x: 0, y: 0, width: 0, height: 0}. + * entire window by specifying an empty region: { x: 0, y: 0, width: 0, height: 0 + * }. */ setThumbnailClip(region: Rectangle): void; /** @@ -1782,7 +1982,12 @@ declare namespace Electron { * Sets whether the window should be visible on all workspaces. Note: This API does * nothing on Windows. */ - setVisibleOnAllWorkspaces(visible: boolean): void; + setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void; + /** + * Sets whether the window traffic light buttons should be visible. This cannot be + * called when titleBarStyle is set to customButtonsOnHover. + */ + setWindowButtonVisibility(visible: boolean): void; /** * Shows and gives focus to the window. */ @@ -1818,7 +2023,7 @@ declare namespace Electron { class BrowserWindowProxy extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/browser-window-proxy + // Docs: http://electronjs.org/docs/api/browser-window-proxy /** * Removes focus from the child window. @@ -1851,7 +2056,7 @@ declare namespace Electron { interface Certificate { - // Docs: http://electron.atom.io/docs/api/structures/certificate + // Docs: http://electronjs.org/docs/api/structures/certificate /** * PEM encoded data @@ -1897,37 +2102,37 @@ declare namespace Electron { interface CertificatePrincipal { - // Docs: http://electron.atom.io/docs/api/structures/certificate-principal + // Docs: http://electronjs.org/docs/api/structures/certificate-principal /** - * Common Name + * Common Name. */ commonName: string; /** - * Country or region + * Country or region. */ country: string; /** - * Locality + * Locality. */ locality: string; /** - * Organization names + * Organization names. */ organizations: string[]; /** - * Organization Unit names + * Organization Unit names. */ organizationUnits: string[]; /** - * State or province + * State or province. */ state: string; } class ClientRequest extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/client-request + // Docs: http://electronjs.org/docs/api/client-request /** * Emitted when the request is aborted. The abort event will not be fired if the @@ -2045,7 +2250,7 @@ declare namespace Electron { * Sends the last chunk of the request data. Subsequent write or end operations * will not be allowed. The finish event is emitted just after the end operation. */ - end(chunk?: string | Buffer, encoding?: string, callback?: Function): void; + end(chunk?: (string) | (Buffer), encoding?: string, callback?: Function): void; /** * Continues any deferred redirection request when the redirection mode is manual. */ @@ -2078,13 +2283,13 @@ declare namespace Electron { * issued on the wire. After the first write operation, it is not allowed to add or * remove a custom header. */ - write(chunk: string | Buffer, encoding?: string, callback?: Function): void; + write(chunk: (string) | (Buffer), encoding?: string, callback?: Function): void; chunkedEncoding: boolean; } interface Clipboard extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/clipboard + // Docs: http://electronjs.org/docs/api/clipboard availableFormats(type?: string): string[]; /** @@ -2144,7 +2349,7 @@ declare namespace Electron { interface ContentTracing extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/content-tracing + // Docs: http://electronjs.org/docs/api/content-tracing /** * Get the current monitoring traced data. Child processes typically cache trace @@ -2181,7 +2386,7 @@ declare namespace Electron { * request. The callback will be called once all child processes have acknowledged * the startRecording request. */ - startRecording(options: TraceCategoriesAndOptions | TraceConfig, callback: Function): void; + startRecording(options: (TraceCategoriesAndOptions) | (TraceConfig), callback: Function): void; /** * Stop monitoring on all processes. Once all child processes have acknowledged the * stopMonitoring request the callback is called. @@ -2203,10 +2408,11 @@ declare namespace Electron { interface Cookie { - // Docs: http://electron.atom.io/docs/api/structures/cookie + // Docs: http://electronjs.org/docs/api/structures/cookie /** - * The domain of the cookie. + * The domain of the cookie; this will be normalized with a preceding dot so that + * it's also valid for subdomains. */ domain?: string; /** @@ -2215,7 +2421,8 @@ declare namespace Electron { */ expirationDate?: number; /** - * Whether the cookie is a host-only cookie. + * Whether the cookie is a host-only cookie; this will only be true if no domain + * was passed. */ hostOnly?: boolean; /** @@ -2247,7 +2454,7 @@ declare namespace Electron { class Cookies extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/cookies + // Docs: http://electronjs.org/docs/api/cookies /** * Emitted when a cookie is changed because it was added, edited, removed, or @@ -2328,7 +2535,7 @@ declare namespace Electron { interface CPUUsage { - // Docs: http://electron.atom.io/docs/api/structures/cpu-usage + // Docs: http://electronjs.org/docs/api/structures/cpu-usage /** * The number of average idle cpu wakeups per second since the last call to @@ -2343,7 +2550,7 @@ declare namespace Electron { interface CrashReport { - // Docs: http://electron.atom.io/docs/api/structures/crash-report + // Docs: http://electronjs.org/docs/api/structures/crash-report date: Date; id: string; @@ -2351,7 +2558,7 @@ declare namespace Electron { interface CrashReporter extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/crash-reporter + // Docs: http://electronjs.org/docs/api/crash-reporter /** * Set an extra parameter to be sent with the crash report. The values specified @@ -2362,8 +2569,10 @@ declare namespace Electron { */ addExtraParameter(key: string, value: string): void; /** - * Returns the date and ID of the last crash report. If no crash reports have been - * sent or the crash reporter has not been started, null is returned. + * Returns the date and ID of the last crash report. Only crash reports that have + * been uploaded will be returned; even if a crash report is present on disk it + * will not be returned until it is uploaded. In the case that there are no + * uploaded reports, null is returned. */ getLastCrashReport(): CrashReport; /** @@ -2419,7 +2628,7 @@ declare namespace Electron { class Debugger extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/debugger + // Docs: http://electronjs.org/docs/api/debugger /** * Emitted when debugging session is terminated. This happens either when @@ -2505,7 +2714,7 @@ declare namespace Electron { interface DesktopCapturer extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/desktop-capturer + // Docs: http://electronjs.org/docs/api/desktop-capturer /** * Starts gathering information about all available desktop media sources, and @@ -2518,7 +2727,7 @@ declare namespace Electron { interface DesktopCapturerSource { - // Docs: http://electron.atom.io/docs/api/structures/desktop-capturer-source + // Docs: http://electronjs.org/docs/api/structures/desktop-capturer-source /** * A unique identifier that will correspond to the id of the matching returned by @@ -2534,8 +2743,8 @@ declare namespace Electron { */ id: string; /** - * A screen source will be named either Entire Screen or Screen , while the - * name of a window source will match the window title. + * A screen source will be named either Entire Screen or Screen , while the name of + * a window source will match the window title. */ name: string; /** @@ -2549,7 +2758,7 @@ declare namespace Electron { interface Dialog extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/dialog + // Docs: http://electronjs.org/docs/api/dialog /** * On macOS, this displays a modal dialog that shows a message and certificate @@ -2610,7 +2819,7 @@ declare namespace Electron { * file selector and a directory selector, so if you set properties to ['openFile', * 'openDirectory'] on these platforms, a directory selector will be shown. */ - showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions, callback?: (filePaths: string[], bookmarks: string[]) => void): string[]; + showOpenDialog(browserWindow: BrowserWindow, options: OpenDialogOptions, callback?: (filePaths: string[], bookmarks: string[]) => void): (string[]) | (undefined); /** * The browserWindow argument allows the dialog to attach itself to a parent * window, making it modal. The filters specifies an array of file types that can @@ -2623,7 +2832,7 @@ declare namespace Electron { * file selector and a directory selector, so if you set properties to ['openFile', * 'openDirectory'] on these platforms, a directory selector will be shown. */ - showOpenDialog(options: OpenDialogOptions, callback?: (filePaths: string[], bookmarks: string[]) => void): string[]; + showOpenDialog(options: OpenDialogOptions, callback?: (filePaths: string[], bookmarks: string[]) => void): (string[]) | (undefined); /** * The browserWindow argument allows the dialog to attach itself to a parent * window, making it modal. The filters specifies an array of file types that can @@ -2631,7 +2840,7 @@ declare namespace Electron { * the API call will be asynchronous and the result will be passed via * callback(filename). */ - showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions, callback?: (filename: string, bookmark: string) => void): string; + showSaveDialog(browserWindow: BrowserWindow, options: SaveDialogOptions, callback?: (filename: string, bookmark: string) => void): (string) | (undefined); /** * The browserWindow argument allows the dialog to attach itself to a parent * window, making it modal. The filters specifies an array of file types that can @@ -2639,12 +2848,12 @@ declare namespace Electron { * the API call will be asynchronous and the result will be passed via * callback(filename). */ - showSaveDialog(options: SaveDialogOptions, callback?: (filename: string, bookmark: string) => void): string; + showSaveDialog(options: SaveDialogOptions, callback?: (filename: string, bookmark: string) => void): (string) | (undefined); } interface Display { - // Docs: http://electron.atom.io/docs/api/structures/display + // Docs: http://electronjs.org/docs/api/structures/display bounds: Rectangle; /** @@ -2670,7 +2879,7 @@ declare namespace Electron { class DownloadItem extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/download-item + // Docs: http://electronjs.org/docs/api/download-item /** * Emitted when the download is in a terminal state. This includes a completed @@ -2773,7 +2982,7 @@ declare namespace Electron { interface FileFilter { - // Docs: http://electron.atom.io/docs/api/structures/file-filter + // Docs: http://electronjs.org/docs/api/structures/file-filter extensions: string[]; name: string; @@ -2781,7 +2990,7 @@ declare namespace Electron { interface GlobalShortcut extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/global-shortcut + // Docs: http://electronjs.org/docs/api/global-shortcut /** * When the accelerator is already taken by other applications, this call will @@ -2811,65 +3020,65 @@ declare namespace Electron { interface GPUFeatureStatus { - // Docs: http://electron.atom.io/docs/api/structures/gpu-feature-status + // Docs: http://electronjs.org/docs/api/structures/gpu-feature-status /** - * Canvas + * Canvas. */ '2d_canvas': string; /** - * Flash + * Flash. */ flash_3d: string; /** - * Flash Stage3D + * Flash Stage3D. */ flash_stage3d: string; /** - * Flash Stage3D Baseline profile + * Flash Stage3D Baseline profile. */ flash_stage3d_baseline: string; /** - * Compositing + * Compositing. */ gpu_compositing: string; /** - * Multiple Raster Threads + * Multiple Raster Threads. */ multiple_raster_threads: string; /** - * Native GpuMemoryBuffers + * Native GpuMemoryBuffers. */ native_gpu_memory_buffers: string; /** - * Rasterization + * Rasterization. */ rasterization: string; /** - * Video Decode + * Video Decode. */ video_decode: string; /** - * Video Encode + * Video Encode. */ video_encode: string; /** - * VPx Video Decode + * VPx Video Decode. */ vpx_decode: string; /** - * WebGL + * WebGL. */ webgl: string; /** - * WebGL2 + * WebGL2. */ webgl2: string; } interface InAppPurchase extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/in-app-purchase + // Docs: http://electronjs.org/docs/api/in-app-purchase /** * Emitted when one or more transactions have been updated. @@ -2917,7 +3126,7 @@ declare namespace Electron { class IncomingMessage extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/incoming-message + // Docs: http://electronjs.org/docs/api/incoming-message /** * Emitted when a request has been canceled during an ongoing HTTP transaction. @@ -2978,7 +3187,7 @@ declare namespace Electron { interface IOCounters { - // Docs: http://electron.atom.io/docs/api/structures/io-counters + // Docs: http://electronjs.org/docs/api/structures/io-counters /** * Then number of I/O other operations. @@ -3008,7 +3217,7 @@ declare namespace Electron { interface IpcMain extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/ipc-main + // Docs: http://electronjs.org/docs/api/ipc-main /** * Listens to channel, when a new message arrives listener would be called with @@ -3033,7 +3242,7 @@ declare namespace Electron { interface IpcRenderer extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/ipc-renderer + // Docs: http://electronjs.org/docs/api/ipc-renderer /** * Listens to channel, when a new message arrives listener would be called with @@ -3083,7 +3292,7 @@ declare namespace Electron { interface JumpListCategory { - // Docs: http://electron.atom.io/docs/api/structures/jump-list-category + // Docs: http://electronjs.org/docs/api/structures/jump-list-category /** * Array of objects if type is tasks or custom, otherwise it should be omitted. @@ -3101,7 +3310,7 @@ declare namespace Electron { interface JumpListItem { - // Docs: http://electron.atom.io/docs/api/structures/jump-list-item + // Docs: http://electronjs.org/docs/api/structures/jump-list-item /** * The command line arguments when program is executed. Should only be set if type @@ -3148,7 +3357,7 @@ declare namespace Electron { interface MemoryInfo { - // Docs: http://electron.atom.io/docs/api/structures/memory-info + // Docs: http://electronjs.org/docs/api/structures/memory-info /** * The maximum amount of memory that has ever been pinned to actual physical RAM. @@ -3177,7 +3386,7 @@ declare namespace Electron { interface MemoryUsageDetails { - // Docs: http://electron.atom.io/docs/api/structures/memory-usage-details + // Docs: http://electronjs.org/docs/api/structures/memory-usage-details count: number; liveSize: number; @@ -3186,7 +3395,7 @@ declare namespace Electron { class Menu { - // Docs: http://electron.atom.io/docs/api/menu + // Docs: http://electronjs.org/docs/api/menu /** * Emitted when a popup is closed either manually or with menu.closePopup(). @@ -3213,7 +3422,7 @@ declare namespace Electron { * Note: The returned Menu instance doesn't support dynamic addition or removal of * menu items. Instance properties can still be dynamically modified. */ - static getApplicationMenu(): Menu | null; + static getApplicationMenu(): (Menu) | (null); /** * Sends the action to the first responder of application. This is used for * emulating default macOS menu behaviors. Usually you would use the role property @@ -3227,7 +3436,7 @@ declare namespace Electron { * Windows and Linux but has no effect on macOS. Note: This API has to be called * after the ready event of app module. */ - static setApplicationMenu(menu: Menu | null): void; + static setApplicationMenu(menu: (Menu) | (null)): void; /** * Appends the menuItem to the menu. */ @@ -3244,13 +3453,13 @@ declare namespace Electron { /** * Pops up this menu as a context menu in the BrowserWindow. */ - popup(options: PopupOptions): void; + popup(options?: PopupOptions): void; items: MenuItem[]; } class MenuItem { - // Docs: http://electron.atom.io/docs/api/menu-item + // Docs: http://electronjs.org/docs/api/menu-item constructor(options: MenuItemConstructorOptions); checked: boolean; @@ -3262,21 +3471,21 @@ declare namespace Electron { interface MimeTypedBuffer { - // Docs: http://electron.atom.io/docs/api/structures/mime-typed-buffer + // Docs: http://electronjs.org/docs/api/structures/mime-typed-buffer /** - * The actual Buffer content + * The actual Buffer content. */ data: Buffer; /** - * The mimeType of the Buffer that you are sending + * The mimeType of the Buffer that you are sending. */ mimeType: string; } class NativeImage { - // Docs: http://electron.atom.io/docs/api/native-image + // Docs: http://electronjs.org/docs/api/native-image /** * Creates an empty NativeImage instance. @@ -3294,7 +3503,14 @@ declare namespace Electron { * Creates a new NativeImage instance from the NSImage that maps to the given image * name. See NSImageName for a list of possible values. The hslShift is applied to * the image with the following rules This means that [-1, 0, 1] will make the - * image completely white and [-1, 1, 0] will make the image completely black. + * image completely white and [-1, 1, 0] will make the image completely black. In + * some cases, the NSImageName doesn't match its string representation; one example + * of this is NSFolderImageName, whose string representation would actually be + * NSFolder. Therefore, you'll need to determine the correct string representation + * for your image before passing it in. This can be done with the following: echo + * -e '#import \nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME); }' | + * clang -otest -x objective-c -framework Cocoa - && ./test where SYSTEM_IMAGE_NAME + * should be replaced with any value from this list. */ static createFromNamedImage(imageName: string, hslShift: number[]): NativeImage; /** @@ -3343,7 +3559,7 @@ declare namespace Electron { interface Net extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/net + // Docs: http://electronjs.org/docs/api/net /** * Creates a ClientRequest instance using the provided options which are directly @@ -3351,12 +3567,12 @@ declare namespace Electron { * to issue both secure and insecure HTTP requests according to the specified * protocol scheme in the options object. */ - request(options: any | string): ClientRequest; + request(options: (any) | (string)): ClientRequest; } interface NetLog extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/net-log + // Docs: http://electronjs.org/docs/api/net-log /** * Starts recording network events to path. @@ -3379,7 +3595,7 @@ declare namespace Electron { class Notification extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/notification + // Docs: http://electronjs.org/docs/api/notification on(event: 'action', listener: (event: Event, /** @@ -3469,7 +3685,7 @@ declare namespace Electron { interface NotificationAction { - // Docs: http://electron.atom.io/docs/api/structures/notification-action + // Docs: http://electronjs.org/docs/api/structures/notification-action /** * The label for the given action. @@ -3483,7 +3699,7 @@ declare namespace Electron { interface Point { - // Docs: http://electron.atom.io/docs/api/structures/point + // Docs: http://electronjs.org/docs/api/structures/point x: number; y: number; @@ -3491,7 +3707,7 @@ declare namespace Electron { interface PowerMonitor extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/power-monitor + // Docs: http://electronjs.org/docs/api/power-monitor /** * Emitted when the system is about to lock the screen. @@ -3549,7 +3765,7 @@ declare namespace Electron { interface PowerSaveBlocker extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/power-save-blocker + // Docs: http://electronjs.org/docs/api/power-save-blocker isStarted(id: number): boolean; /** @@ -3571,7 +3787,7 @@ declare namespace Electron { interface PrinterInfo { - // Docs: http://electron.atom.io/docs/api/structures/printer-info + // Docs: http://electronjs.org/docs/api/structures/printer-info description: string; isDefault: boolean; @@ -3581,16 +3797,12 @@ declare namespace Electron { interface ProcessMetric { - // Docs: http://electron.atom.io/docs/api/structures/process-metric + // Docs: http://electronjs.org/docs/api/structures/process-metric /** * CPU usage of the process. */ cpu: CPUUsage; - /** - * Memory information for the process. - */ - memory: MemoryInfo; /** * Process id of the process. */ @@ -3603,7 +3815,7 @@ declare namespace Electron { interface Product { - // Docs: http://electron.atom.io/docs/api/structures/product + // Docs: http://electronjs.org/docs/api/structures/product /** * The total size of the content, in bytes. @@ -3642,7 +3854,7 @@ declare namespace Electron { interface Protocol extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/protocol + // Docs: http://electronjs.org/docs/api/protocol /** * Intercepts scheme protocol and uses handler as the protocol's new handler which @@ -3663,7 +3875,7 @@ declare namespace Electron { * Same as protocol.registerStreamProtocol, except that it replaces an existing * protocol handler. */ - interceptStreamProtocol(scheme: string, handler: (request: InterceptStreamProtocolRequest, callback: (stream?: ReadableStream | StreamProtocolResponse) => void) => void, completion?: (error: Error) => void): void; + interceptStreamProtocol(scheme: string, handler: (request: InterceptStreamProtocolRequest, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void; /** * Intercepts scheme protocol and uses handler as the protocol's new handler which * sends a String as a response. @@ -3680,15 +3892,15 @@ declare namespace Electron { * with either a Buffer object or an object that has the data, mimeType, and * charset properties. Example: */ - registerBufferProtocol(scheme: string, handler: (request: RegisterBufferProtocolRequest, callback: (buffer?: Buffer | MimeTypedBuffer) => void) => void, completion?: (error: Error) => void): void; + registerBufferProtocol(scheme: string, handler: (request: RegisterBufferProtocolRequest, callback: (buffer?: (Buffer) | (MimeTypedBuffer)) => void) => void, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send the file as a response. The * handler will be called with handler(request, callback) when a request is going * to be created with scheme. completion will be called with completion(null) when * scheme is successfully registered or completion(error) when failed. To handle * the request, the callback should be called with either the file's path or an - * object that has a path property, e.g. callback(filePath) or callback({path: - * filePath}). When callback is called with nothing, a number, or an object that + * object that has a path property, e.g. callback(filePath) or callback({ path: + * filePath }). When callback is called with nothing, a number, or an object that * has an error property, the request will fail with the error number you * specified. For the available error numbers you can use, please see the net error * list. By default the scheme is treated like http:, which is parsed differently @@ -3732,7 +3944,7 @@ declare namespace Electron { * that implements the readable stream API (emits data/end/error events). For * example, here's how a file could be returned: */ - registerStreamProtocol(scheme: string, handler: (request: RegisterStreamProtocolRequest, callback: (stream?: ReadableStream | StreamProtocolResponse) => void) => void, completion?: (error: Error) => void): void; + registerStreamProtocol(scheme: string, handler: (request: RegisterStreamProtocolRequest, callback: (stream?: (NodeJS.ReadableStream) | (StreamProtocolResponse)) => void) => void, completion?: (error: Error) => void): void; /** * Registers a protocol of scheme that will send a String as a response. The usage * is the same with registerFileProtocol, except that the callback should be called @@ -3752,29 +3964,29 @@ declare namespace Electron { interface Rectangle { - // Docs: http://electron.atom.io/docs/api/structures/rectangle + // Docs: http://electronjs.org/docs/api/structures/rectangle /** - * The height of the rectangle (must be an integer) + * The height of the rectangle (must be an integer). */ height: number; /** - * The width of the rectangle (must be an integer) + * The width of the rectangle (must be an integer). */ width: number; /** - * The x coordinate of the origin of the rectangle (must be an integer) + * The x coordinate of the origin of the rectangle (must be an integer). */ x: number; /** - * The y coordinate of the origin of the rectangle (must be an integer) + * The y coordinate of the origin of the rectangle (must be an integer). */ y: number; } interface Referrer { - // Docs: http://electron.atom.io/docs/api/structures/referrer + // Docs: http://electronjs.org/docs/api/structures/referrer /** * Can be default, unsafe-url, no-referrer-when-downgrade, no-referrer, origin, @@ -3790,7 +4002,7 @@ declare namespace Electron { interface Remote extends MainInterface { - // Docs: http://electron.atom.io/docs/api/remote + // Docs: http://electronjs.org/docs/api/remote getCurrentWebContents(): WebContents; /** @@ -3813,7 +4025,7 @@ declare namespace Electron { interface RemoveClientCertificate { - // Docs: http://electron.atom.io/docs/api/structures/remove-client-certificate + // Docs: http://electronjs.org/docs/api/structures/remove-client-certificate /** * Origin of the server whose associated client certificate must be removed from @@ -3828,7 +4040,7 @@ declare namespace Electron { interface RemovePassword { - // Docs: http://electron.atom.io/docs/api/structures/remove-password + // Docs: http://electronjs.org/docs/api/structures/remove-password /** * When provided, the authentication info related to the origin will only be @@ -3860,7 +4072,7 @@ declare namespace Electron { interface Screen extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/screen + // Docs: http://electronjs.org/docs/api/screen /** * Emitted when newDisplay has been added. @@ -3911,7 +4123,7 @@ declare namespace Electron { * relative to the display nearest to window. If window is null, scaling will be * performed to the display nearest to rect. */ - dipToScreenRect(window: BrowserWindow | null, rect: Rectangle): Rectangle; + dipToScreenRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle; getAllDisplays(): Display[]; /** * The current absolute position of the mouse pointer. @@ -3930,44 +4142,44 @@ declare namespace Electron { * relative to the display nearest to window. If window is null, scaling will be * performed to the display nearest to rect. */ - screenToDipRect(window: BrowserWindow | null, rect: Rectangle): Rectangle; + screenToDipRect(window: (BrowserWindow) | (null), rect: Rectangle): Rectangle; } interface ScrubberItem { - // Docs: http://electron.atom.io/docs/api/structures/scrubber-item + // Docs: http://electronjs.org/docs/api/structures/scrubber-item /** - * The image to appear in this item + * The image to appear in this item. */ icon?: NativeImage; /** - * The text to appear in this item + * The text to appear in this item. */ label?: string; } interface SegmentedControlSegment { - // Docs: http://electron.atom.io/docs/api/structures/segmented-control-segment + // Docs: http://electronjs.org/docs/api/structures/segmented-control-segment /** - * Whether this segment is selectable. Default: true + * Whether this segment is selectable. Default: true. */ enabled?: boolean; /** - * The image to appear in this segment + * The image to appear in this segment. */ icon?: NativeImage; /** - * The text to appear in this segment + * The text to appear in this segment. */ label?: string; } class Session extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/session + // Docs: http://electronjs.org/docs/api/session /** * If partition starts with persist:, the page will use a persistent session @@ -4007,7 +4219,7 @@ declare namespace Electron { /** * Clears the session’s HTTP authentication cache. */ - clearAuthCache(options: RemovePassword | RemoveClientCertificate, callback?: Function): void; + clearAuthCache(options: (RemovePassword) | (RemoveClientCertificate), callback?: Function): void; /** * Clears the session’s HTTP cache. */ @@ -4066,12 +4278,18 @@ declare namespace Electron { * Downloads under the respective app folder. */ setDownloadPath(path: string): void; + /** + * Sets the handler which can be used to respond to permission checks for the + * session. Returning true will allow the permission and false will reject it. To + * clear the handler, call setPermissionCheckHandler(null). + */ + setPermissionCheckHandler(handler: ((webContents: WebContents, permission: string, requestingOrigin: string, details: PermissionCheckHandlerDetails) => boolean) | (null)): void; /** * Sets the handler which can be used to respond to permission requests for the * session. Calling callback(true) will allow the permission and callback(false) * will reject it. To clear the handler, call setPermissionRequestHandler(null). */ - setPermissionRequestHandler(handler: (webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerDetails) => void | null): void; + setPermissionRequestHandler(handler: ((webContents: WebContents, permission: string, callback: (permissionGranted: boolean) => void, details: PermissionRequestHandlerDetails) => void) | (null)): void; /** * Adds scripts that will be executed on ALL web contents that are associated with * this session just before normal preload scripts run. @@ -4100,7 +4318,7 @@ declare namespace Electron { interface Shell { - // Docs: http://electron.atom.io/docs/api/shell + // Docs: http://electronjs.org/docs/api/shell /** * Play the beep sound. @@ -4140,7 +4358,7 @@ declare namespace Electron { interface ShortcutDetails { - // Docs: http://electron.atom.io/docs/api/structures/shortcut-details + // Docs: http://electronjs.org/docs/api/structures/shortcut-details /** * The Application User Model ID. Default is empty. @@ -4176,7 +4394,7 @@ declare namespace Electron { interface Size { - // Docs: http://electron.atom.io/docs/api/structures/size + // Docs: http://electronjs.org/docs/api/structures/size height: number; width: number; @@ -4184,25 +4402,25 @@ declare namespace Electron { interface StreamProtocolResponse { - // Docs: http://electron.atom.io/docs/api/structures/stream-protocol-response + // Docs: http://electronjs.org/docs/api/structures/stream-protocol-response /** - * A Node.js readable stream representing the response body + * A Node.js readable stream representing the response body. */ - data: ReadableStream; + data: NodeJS.ReadableStream; /** - * An object containing the response headers + * An object containing the response headers. */ headers: Headers; /** - * The HTTP response code + * The HTTP response code. */ statusCode: number; } interface SystemPreferences extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/system-preferences + // Docs: http://electronjs.org/docs/api/system-preferences on(event: 'accent-color-changed', listener: (event: Event, /** @@ -4224,6 +4442,30 @@ declare namespace Electron { * The new RGBA color the user assigned to be their system accent color. */ newColor: string) => void): this; + /** + * NOTE: This event is only emitted after you have called + * startAppLevelAppearanceTrackingOS + */ + on(event: 'appearance-changed', listener: ( + /** + * Can be `dark` or `light` + */ + newAppearance: ('dark' | 'light')) => void): this; + once(event: 'appearance-changed', listener: ( + /** + * Can be `dark` or `light` + */ + newAppearance: ('dark' | 'light')) => void): this; + addListener(event: 'appearance-changed', listener: ( + /** + * Can be `dark` or `light` + */ + newAppearance: ('dark' | 'light')) => void): this; + removeListener(event: 'appearance-changed', listener: ( + /** + * Can be `dark` or `light` + */ + newAppearance: ('dark' | 'light')) => void): this; on(event: 'color-changed', listener: (event: Event) => void): this; once(event: 'color-changed', listener: (event: Event) => void): this; addListener(event: 'color-changed', listener: (event: Event) => void): this; @@ -4252,8 +4494,41 @@ declare namespace Electron { * used, `false` otherwise. */ invertedColorScheme: boolean) => void): this; + /** + * Important: In order to properly leverage this API, you must set the + * NSMicrophoneUsageDescription and NSCameraUsageDescription strings in your app's + * Info.plist file. The values for these keys will be used to populate the + * permission dialogs so that the user will be properly informed as to the purpose + * of the permission request. See Electron Application Distribution for more + * information about how to set these in the context of Electron. This user consent + * was not required until macOS 10.14 Mojave, so this method will always return + * true if your system is running 10.13 High Sierra or lower. + */ + askForMediaAccess(mediaType: 'microphone' | 'camera'): Promise; getAccentColor(): string; + /** + * Gets the macOS appearance setting that you have declared you want for your + * application, maps to NSApplication.appearance. You can use the + * setAppLevelAppearance API to set this value. + */ + getAppLevelAppearance(): ('dark' | 'light' | 'unknown'); getColor(color: '3d-dark-shadow' | '3d-face' | '3d-highlight' | '3d-light' | '3d-shadow' | 'active-border' | 'active-caption' | 'active-caption-gradient' | 'app-workspace' | 'button-text' | 'caption-text' | 'desktop' | 'disabled-text' | 'highlight' | 'highlight-text' | 'hotlight' | 'inactive-border' | 'inactive-caption' | 'inactive-caption-gradient' | 'inactive-caption-text' | 'info-background' | 'info-text' | 'menu' | 'menu-highlight' | 'menubar' | 'menu-text' | 'scrollbar' | 'window' | 'window-frame' | 'window-text'): string; + /** + * Gets the macOS appearance setting that is currently applied to your application, + * maps to NSApplication.effectiveAppearance Please note that until Electron is + * built targeting the 10.14 SDK, your application's effectiveAppearance will + * default to 'light' and won't inherit the OS preference. In the interim in order + * for your application to inherit the OS preference you must set the + * NSRequiresAquaSystemAppearance key in your apps Info.plist to false. If you are + * using electron-packager or electron-forge just set the enableDarwinDarkMode + * packager option to true. See the Electron Packager API for more details. + */ + getEffectiveAppearance(): ('dark' | 'light' | 'unknown'); + /** + * This user consent was not required until macOS 10.14 Mojave, so this method will + * always return granted if your system is running 10.13 High Sierra or lower. + */ + getMediaAccessStatus(mediaType: string): ('not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown'); /** * Some popular key and types are: */ @@ -4266,6 +4541,7 @@ declare namespace Electron { isDarkMode(): boolean; isInvertedColorScheme(): boolean; isSwipeTrackingFromScrollEventsEnabled(): boolean; + isTrustedAccessibilityClient(prompt: boolean): boolean; /** * Posts event as native notifications of macOS. The userInfo is an Object that * contains the user information dictionary sent along with the notification. @@ -4290,6 +4566,11 @@ declare namespace Electron { * global value of a key previously set with setUserDefault. */ removeUserDefault(key: string): void; + /** + * Sets the appearance setting for your application, this should override the + * system default and override the value of getEffectiveAppearance. + */ + setAppLevelAppearance(appearance: 'dark' | 'light'): void; /** * Set the value of key in NSUserDefaults. Note that type should match actual type * of value. An exception is thrown if they don't. Some popular key and types are: @@ -4333,7 +4614,7 @@ declare namespace Electron { interface Task { - // Docs: http://electron.atom.io/docs/api/structures/task + // Docs: http://electronjs.org/docs/api/structures/task /** * The command line arguments when program is executed. @@ -4368,7 +4649,7 @@ declare namespace Electron { interface ThumbarButton { - // Docs: http://electron.atom.io/docs/api/structures/thumbar-button + // Docs: http://electronjs.org/docs/api/structures/thumbar-button click: Function; /** @@ -4388,7 +4669,7 @@ declare namespace Electron { class TouchBarButton extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-button + // Docs: http://electronjs.org/docs/api/touch-bar-button constructor(options: TouchBarButtonConstructorOptions); backgroundColor: string; @@ -4398,7 +4679,7 @@ declare namespace Electron { class TouchBarColorPicker extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-color-picker + // Docs: http://electronjs.org/docs/api/touch-bar-color-picker constructor(options: TouchBarColorPickerConstructorOptions); availableColors: string[]; @@ -4407,14 +4688,14 @@ declare namespace Electron { class TouchBarGroup extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-group + // Docs: http://electronjs.org/docs/api/touch-bar-group constructor(options: TouchBarGroupConstructorOptions); } class TouchBarLabel extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-label + // Docs: http://electronjs.org/docs/api/touch-bar-label constructor(options: TouchBarLabelConstructorOptions); label: string; @@ -4423,7 +4704,7 @@ declare namespace Electron { class TouchBarPopover extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-popover + // Docs: http://electronjs.org/docs/api/touch-bar-popover constructor(options: TouchBarPopoverConstructorOptions); icon: NativeImage; @@ -4432,7 +4713,7 @@ declare namespace Electron { class TouchBarScrubber extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-scrubber + // Docs: http://electronjs.org/docs/api/touch-bar-scrubber constructor(options: TouchBarScrubberConstructorOptions); continuous: boolean; @@ -4445,7 +4726,7 @@ declare namespace Electron { class TouchBarSegmentedControl extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-segmented-control + // Docs: http://electronjs.org/docs/api/touch-bar-segmented-control constructor(options: TouchBarSegmentedControlConstructorOptions); segments: SegmentedControlSegment[]; @@ -4455,7 +4736,7 @@ declare namespace Electron { class TouchBarSlider extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-slider + // Docs: http://electronjs.org/docs/api/touch-bar-slider constructor(options: TouchBarSliderConstructorOptions); label: string; @@ -4466,14 +4747,14 @@ declare namespace Electron { class TouchBarSpacer extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar-spacer + // Docs: http://electronjs.org/docs/api/touch-bar-spacer constructor(options: TouchBarSpacerConstructorOptions); } class TouchBar extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/touch-bar + // Docs: http://electronjs.org/docs/api/touch-bar constructor(options: TouchBarConstructorOptions); escapeItem: (TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null); @@ -4490,7 +4771,7 @@ declare namespace Electron { interface TraceCategoriesAndOptions { - // Docs: http://electron.atom.io/docs/api/structures/trace-categories-and-options + // Docs: http://electronjs.org/docs/api/structures/trace-categories-and-options /** * – is a filter to control what category groups should be traced. A filter can @@ -4517,7 +4798,7 @@ declare namespace Electron { interface TraceConfig { - // Docs: http://electron.atom.io/docs/api/structures/trace-config + // Docs: http://electronjs.org/docs/api/structures/trace-config excluded_categories?: string[]; included_categories?: string[]; @@ -4526,7 +4807,7 @@ declare namespace Electron { interface Transaction { - // Docs: http://electron.atom.io/docs/api/structures/transaction + // Docs: http://electronjs.org/docs/api/structures/transaction /** * The error code if an error occurred while processing the transaction. @@ -4558,7 +4839,7 @@ declare namespace Electron { class Tray extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/tray + // Docs: http://electronjs.org/docs/api/tray /** * Emitted when the tray balloon is clicked. @@ -4810,7 +5091,7 @@ declare namespace Electron { * The bounds of tray icon. */ bounds: Rectangle) => void): this; - constructor(image: NativeImage | string); + constructor(image: (NativeImage) | (string)); /** * Destroys the tray icon immediately. */ @@ -4834,7 +5115,7 @@ declare namespace Electron { /** * Sets the context menu for this icon. */ - setContextMenu(menu: Menu | null): void; + setContextMenu(menu: (Menu) | (null)): void; /** * Sets when the tray's icon background becomes highlighted (in blue). Note: You * can use highlightMode with a BrowserWindow by toggling between 'never' and @@ -4850,11 +5131,11 @@ declare namespace Electron { /** * Sets the image associated with this tray icon. */ - setImage(image: NativeImage | string): void; + setImage(image: (NativeImage) | (string)): void; /** * Sets the image associated with this tray icon when pressed on macOS. */ - setPressedImage(image: NativeImage | string): void; + setPressedImage(image: (NativeImage) | (string)): void; /** * Sets the title displayed aside of the tray icon in the status bar (Support ANSI * colors). @@ -4868,7 +5149,7 @@ declare namespace Electron { interface UploadBlob { - // Docs: http://electron.atom.io/docs/api/structures/upload-blob + // Docs: http://electronjs.org/docs/api/structures/upload-blob /** * UUID of blob data to upload. @@ -4882,7 +5163,7 @@ declare namespace Electron { interface UploadData { - // Docs: http://electron.atom.io/docs/api/structures/upload-data + // Docs: http://electronjs.org/docs/api/structures/upload-data /** * UUID of blob data. Use method to retrieve the data. @@ -4900,7 +5181,7 @@ declare namespace Electron { interface UploadFile { - // Docs: http://electron.atom.io/docs/api/structures/upload-file + // Docs: http://electronjs.org/docs/api/structures/upload-file /** * Path of file to be uploaded. @@ -4926,7 +5207,7 @@ declare namespace Electron { interface UploadRawData { - // Docs: http://electron.atom.io/docs/api/structures/upload-raw-data + // Docs: http://electronjs.org/docs/api/structures/upload-raw-data /** * Data to be uploaded. @@ -4940,7 +5221,7 @@ declare namespace Electron { class WebContents extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/web-contents + // Docs: http://electronjs.org/docs/api/web-contents static fromId(id: number): WebContents; static getAllWebContents(): WebContents[]; @@ -5164,22 +5445,22 @@ declare namespace Electron { */ on(event: 'did-attach-webview', listener: (event: Event, /** - * The guest web contents that is used by the ``. + * The guest web contents that is used by the ` */ webContents: WebContents) => void): this; once(event: 'did-attach-webview', listener: (event: Event, /** - * The guest web contents that is used by the ``. + * The guest web contents that is used by the ` */ webContents: WebContents) => void): this; addListener(event: 'did-attach-webview', listener: (event: Event, /** - * The guest web contents that is used by the ``. + * The guest web contents that is used by the ` */ webContents: WebContents) => void): this; removeListener(event: 'did-attach-webview', listener: (event: Event, /** - * The guest web contents that is used by the ``. + * The guest web contents that is used by the ` */ webContents: WebContents) => void): this; /** @@ -5190,22 +5471,22 @@ declare namespace Electron { /** * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set. */ - color: string | null) => void): this; + color: (string) | (null)) => void): this; once(event: 'did-change-theme-color', listener: (event: Event, /** * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set. */ - color: string | null) => void): this; + color: (string) | (null)) => void): this; addListener(event: 'did-change-theme-color', listener: (event: Event, /** * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set. */ - color: string | null) => void): this; + color: (string) | (null)) => void): this; removeListener(event: 'did-change-theme-color', listener: (event: Event, /** * Theme color is in format of '#rrggbb'. It is `null` when no theme color is set. */ - color: string | null) => void): this; + color: (string) | (null)) => void): this; /** * This event is like did-finish-load but emitted when the load failed or was * cancelled, e.g. window.stop() is invoked. The full list of error codes and their @@ -5394,6 +5675,35 @@ declare namespace Electron { isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => void): this; + /** + * Emitted after a server side redirect occurs during navigation. For example a + * 302 redirect. This event can not be prevented, if you want to prevent redirects + * you should checkout out the will-redirect event above. + */ + on(event: 'did-redirect-navigation', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + once(event: 'did-redirect-navigation', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + addListener(event: 'did-redirect-navigation', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + removeListener(event: 'did-redirect-navigation', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; /** * Corresponds to the points in time when the spinner of the tab started spinning. */ @@ -5405,22 +5715,26 @@ declare namespace Electron { * Emitted when any frame (including main) starts navigating. isInplace will be * true for in-page navigations. */ - on(event: 'did-start-navigation', listener: (url: string, + on(event: 'did-start-navigation', listener: (event: Event, + url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => void): this; - once(event: 'did-start-navigation', listener: (url: string, + once(event: 'did-start-navigation', listener: (event: Event, + url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => void): this; - addListener(event: 'did-start-navigation', listener: (url: string, + addListener(event: 'did-start-navigation', listener: (event: Event, + url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, frameRoutingId: number) => void): this; - removeListener(event: 'did-start-navigation', listener: (url: string, + removeListener(event: 'did-start-navigation', listener: (event: Event, + url: string, isInPlace: boolean, isMainFrame: boolean, frameProcessId: number, @@ -5648,6 +5962,76 @@ declare namespace Electron { removeListener(event: 'plugin-crashed', listener: (event: Event, name: string, version: string) => void): this; + /** + * Emitted when remote.getBuiltin() is called in the renderer process. Calling + * event.preventDefault() will prevent the module from being returned. Custom value + * can be returned by setting event.returnValue. + */ + on(event: 'remote-get-builtin', listener: (event: Event, + moduleName: string) => void): this; + once(event: 'remote-get-builtin', listener: (event: Event, + moduleName: string) => void): this; + addListener(event: 'remote-get-builtin', listener: (event: Event, + moduleName: string) => void): this; + removeListener(event: 'remote-get-builtin', listener: (event: Event, + moduleName: string) => void): this; + /** + * Emitted when remote.getCurrentWebContents() is called in the renderer process. + * Calling event.preventDefault() will prevent the object from being returned. + * Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-current-web-contents', listener: (event: Event) => void): this; + once(event: 'remote-get-current-web-contents', listener: (event: Event) => void): this; + addListener(event: 'remote-get-current-web-contents', listener: (event: Event) => void): this; + removeListener(event: 'remote-get-current-web-contents', listener: (event: Event) => void): this; + /** + * Emitted when remote.getCurrentWindow() is called in the renderer process. + * Calling event.preventDefault() will prevent the object from being returned. + * Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-current-window', listener: (event: Event) => void): this; + once(event: 'remote-get-current-window', listener: (event: Event) => void): this; + addListener(event: 'remote-get-current-window', listener: (event: Event) => void): this; + removeListener(event: 'remote-get-current-window', listener: (event: Event) => void): this; + /** + * Emitted when remote.getGlobal() is called in the renderer process. Calling + * event.preventDefault() will prevent the global from being returned. Custom value + * can be returned by setting event.returnValue. + */ + on(event: 'remote-get-global', listener: (event: Event, + globalName: string) => void): this; + once(event: 'remote-get-global', listener: (event: Event, + globalName: string) => void): this; + addListener(event: 'remote-get-global', listener: (event: Event, + globalName: string) => void): this; + removeListener(event: 'remote-get-global', listener: (event: Event, + globalName: string) => void): this; + /** + * Emitted when .getWebContents() is called in the renderer process. + * Calling event.preventDefault() will prevent the object from being returned. + * Custom value can be returned by setting event.returnValue. + */ + on(event: 'remote-get-guest-web-contents', listener: (event: Event, + guestWebContents: WebContents) => void): this; + once(event: 'remote-get-guest-web-contents', listener: (event: Event, + guestWebContents: WebContents) => void): this; + addListener(event: 'remote-get-guest-web-contents', listener: (event: Event, + guestWebContents: WebContents) => void): this; + removeListener(event: 'remote-get-guest-web-contents', listener: (event: Event, + guestWebContents: WebContents) => void): this; + /** + * Emitted when remote.require() is called in the renderer process. Calling + * event.preventDefault() will prevent the module from being returned. Custom value + * can be returned by setting event.returnValue. + */ + on(event: 'remote-require', listener: (event: Event, + moduleName: string) => void): this; + once(event: 'remote-require', listener: (event: Event, + moduleName: string) => void): this; + addListener(event: 'remote-require', listener: (event: Event, + moduleName: string) => void): this; + removeListener(event: 'remote-require', listener: (event: Event, + moduleName: string) => void): this; /** * Emitted when the unresponsive web page becomes responsive again. */ @@ -5727,8 +6111,7 @@ declare namespace Electron { */ webPreferences: any, /** - * The other `` parameters such as the `src` URL. This object can be - * modified to adjust the parameters of the guest page. + * The other ` */ params: any) => void): this; once(event: 'will-attach-webview', listener: (event: Event, @@ -5738,8 +6121,7 @@ declare namespace Electron { */ webPreferences: any, /** - * The other `` parameters such as the `src` URL. This object can be - * modified to adjust the parameters of the guest page. + * The other ` */ params: any) => void): this; addListener(event: 'will-attach-webview', listener: (event: Event, @@ -5749,8 +6131,7 @@ declare namespace Electron { */ webPreferences: any, /** - * The other `` parameters such as the `src` URL. This object can be - * modified to adjust the parameters of the guest page. + * The other ` */ params: any) => void): this; removeListener(event: 'will-attach-webview', listener: (event: Event, @@ -5760,8 +6141,7 @@ declare namespace Electron { */ webPreferences: any, /** - * The other `` parameters such as the `src` URL. This object can be - * modified to adjust the parameters of the guest page. + * The other ` */ params: any) => void): this; /** @@ -5790,6 +6170,36 @@ declare namespace Electron { once(event: 'will-prevent-unload', listener: (event: Event) => void): this; addListener(event: 'will-prevent-unload', listener: (event: Event) => void): this; removeListener(event: 'will-prevent-unload', listener: (event: Event) => void): this; + /** + * Emitted as a server side redirect occurs during navigation. For example a 302 + * redirect. This event will be emitted after did-start-navigation and always + * before the did-redirect-navigation event for the same navigation. Calling + * event.preventDefault() will prevent the navigation (not just the redirect). + */ + on(event: 'will-redirect', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + once(event: 'will-redirect', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + addListener(event: 'will-redirect', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; + removeListener(event: 'will-redirect', listener: (event: Event, + url: string, + isInPlace: boolean, + isMainFrame: boolean, + frameProcessId: number, + frameRoutingId: number) => void): this; /** * Adds the specified path to DevTools workspace. Must be used after DevTools * creation: @@ -5895,6 +6305,7 @@ declare namespace Electron { getPrinters(): PrinterInfo[]; getProcessId(): number; getTitle(): string; + getType(): ('backgroundPage' | 'window' | 'browserView' | 'remote' | 'webview' | 'offscreen'); getURL(): string; getUserAgent(): string; getWebRTCIPHandlingPolicy(): string; @@ -5953,6 +6364,7 @@ declare namespace Electron { invalidate(): void; isAudioMuted(): boolean; isCrashed(): boolean; + isCurrentlyAudible(): boolean; isDestroyed(): boolean; isDevToolsFocused(): boolean; isDevToolsOpened(): boolean; @@ -5967,7 +6379,7 @@ declare namespace Electron { * relative to the root of your application. For instance an app structure like * this: Would require code like this */ - loadFile(filePath: string): void; + loadFile(filePath: string, options?: LoadFileOptions): void; /** * Loads the url in the window. The url must contain the protocol prefix, e.g. the * http:// or file://. If the load should bypass http cache then use the pragma @@ -5992,8 +6404,8 @@ declare namespace Electron { * Prints window's web page. When silent is set to true, Electron will pick the * system's default printer if deviceName is empty and the default settings for * printing. Calling window.print() in web page is equivalent to calling - * webContents.print({silent: false, printBackground: false, deviceName: ''}). Use - * page-break-before: always; CSS style to force to print to a new page. + * webContents.print({ silent: false, printBackground: false, deviceName: '' }). + * Use page-break-before: always; CSS style to force to print to a new page. */ print(options?: PrintOptions, callback?: (success: boolean) => void): void; /** @@ -6054,6 +6466,11 @@ declare namespace Electron { * Mute the audio on the current web page. */ setAudioMuted(muted: boolean): void; + /** + * Controls whether or not this WebContents will throttle animations and timers + * when the page becomes backgrounded. This also affects the Page Visibility API. + */ + setBackgroundThrottling(allowed: boolean): void; /** * Uses the devToolsWebContents as the target WebContents to show devtools. The * devToolsWebContents must not have done any navigation, and it should not be used @@ -6131,6 +6548,10 @@ declare namespace Electron { * If offscreen rendering is enabled and painting, stop painting. */ stopPainting(): void; + /** + * Takes a V8 heap snapshot and saves it to filePath. + */ + takeHeapSnapshot(filePath: string): Promise; /** * Toggles the developer tools. */ @@ -6158,7 +6579,7 @@ declare namespace Electron { interface WebFrame extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/web-frame + // Docs: http://electronjs.org/docs/api/web-frame /** * Attempts to free memory that is no longer being used (like images from a @@ -6176,7 +6597,7 @@ declare namespace Electron { */ executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): Promise; /** - * Work like executeJavaScript but evaluates scripts in isolated context. + * Work like executeJavaScript but evaluates scripts in an isolated context. */ executeJavaScriptInIsolatedWorld(worldId: number, scripts: WebSource[], userGesture?: boolean, callback?: (result: any) => void): void; findFrameByName(name: string): WebFrame; @@ -6279,7 +6700,7 @@ declare namespace Electron { class WebRequest extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/web-request + // Docs: http://electronjs.org/docs/api/web-request /** * The listener will be called with listener(details) when a server initiated @@ -6373,7 +6794,7 @@ declare namespace Electron { interface WebSource { - // Docs: http://electron.atom.io/docs/api/structures/web-source + // Docs: http://electronjs.org/docs/api/structures/web-source code: string; /** @@ -6385,7 +6806,7 @@ declare namespace Electron { interface WebviewTag extends HTMLElement { - // Docs: http://electron.atom.io/docs/api/webview-tag + // Docs: http://electronjs.org/docs/api/webview-tag /** * Fired when a load has committed. This includes navigation within the current @@ -6509,11 +6930,6 @@ declare namespace Electron { */ addEventListener(event: 'crashed', listener: (event: Event) => void, useCapture?: boolean): this; removeEventListener(event: 'crashed', listener: (event: Event) => void): this; - /** - * Fired when the gpu process is crashed. - */ - addEventListener(event: 'gpu-crashed', listener: (event: Event) => void, useCapture?: boolean): this; - removeEventListener(event: 'gpu-crashed', listener: (event: Event) => void): this; /** * Fired when a plugin process is crashed. */ @@ -6597,6 +7013,10 @@ declare namespace Electron { * Executes editing command delete in page. */ delete(): void; + /** + * Initiates a download of the resource at url without navigating. + */ + downloadURL(url: string): void; /** * Evaluates code in page. If userGesture is set, it will create the user gesture * context in the page. HTML APIs like requestFullScreen, which require user @@ -6611,7 +7031,21 @@ declare namespace Electron { getTitle(): string; getURL(): string; getUserAgent(): string; + /** + * It depends on the remote module, it is therefore not available when this module + * is disabled. + */ getWebContents(): WebContents; + /** + * Sends a request to get current zoom factor, the callback will be called with + * callback(zoomFactor). + */ + getZoomFactor(callback: (zoomFactor: number) => void): void; + /** + * Sends a request to get current zoom level, the callback will be called with + * callback(zoomLevel). + */ + getZoomLevel(callback: (zoomLevel: number) => void): void; /** * Makes the guest page go back. */ @@ -6646,9 +7080,11 @@ declare namespace Electron { inspectServiceWorker(): void; isAudioMuted(): boolean; isCrashed(): boolean; + isCurrentlyAudible(): boolean; isDevToolsFocused(): boolean; isDevToolsOpened(): boolean; isLoading(): boolean; + isLoadingMainFrame(): boolean; isWaitingForResponse(): boolean; /** * Loads the url in the webview, the url must contain the protocol prefix, e.g. the @@ -6716,10 +7152,18 @@ declare namespace Electron { * Set guest page muted. */ setAudioMuted(muted: boolean): void; + /** + * Sets the maximum and minimum layout-based (i.e. non-visual) zoom level. + */ + setLayoutZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Overrides the user agent for the guest page. */ setUserAgent(userAgent: string): void; + /** + * Sets the maximum and minimum pinch-to-zoom level. + */ + setVisualZoomLevelLimits(minimumLevel: number, maximumLevel: number): void; /** * Changes the zoom factor to the specified factor. Zoom factor is zoom percent * divided by 100, so 300% = 3.0. @@ -6728,7 +7172,8 @@ declare namespace Electron { /** * Changes the zoom level to the specified level. The original size is 0 and each * increment above or below represents zooming 20% larger or smaller to default - * limits of 300% and 50% of original size, respectively. + * limits of 300% and 50% of original size, respectively. The formula for this is + * scale := 1.2 ^ level. */ setZoomLevel(level: number): void; /** @@ -6781,6 +7226,11 @@ declare namespace Electron { * RuntimeEnabledFeatures.json5 file. */ enableblinkfeatures?: string; + /** + * When this attribute is false the guest page in webview will not have access to + * the remote module. The remote module is avaiable by default. + */ + enableremotemodule?: string; /** * Sets the referrer URL for the guest page. */ @@ -7054,7 +7504,7 @@ declare namespace Electron { * visual effects, you can also leave it undefined so the executable's icon will be * used. */ - icon?: NativeImage | string; + icon?: (NativeImage) | (string); /** * Whether window should be shown when created. Default is true. */ @@ -7091,9 +7541,8 @@ declare namespace Electron { enableLargerThanScreen?: boolean; /** * Window's background color as a hexadecimal value, like #66CD00 or #FFF or - * #80FFFFFF (alpha is supported). Default is #FFF (white). If transparent is set - * to true, only values with transparent (#00-------) or opaque (#FF-----) alpha - * values are respected. + * #80FFFFFF (alpha is supported if transparent is set to true). Default is #FFF + * (white). */ backgroundColor?: string; /** @@ -7320,7 +7769,7 @@ declare namespace Electron { } interface CrashReporterStartOptions { - companyName?: string; + companyName: string; /** * URL that crash reports will be sent to as POST. */ @@ -7422,7 +7871,8 @@ declare namespace Electron { */ value?: string; /** - * The domain of the cookie. Empty by default if omitted. + * The domain of the cookie; this will be normalized with a preceding dot so that + * it's also valid for subdomains. Empty by default if omitted. */ domain?: string; /** @@ -7476,7 +7926,7 @@ declare namespace Electron { /** * - */ - icon?: NativeImage | string; + icon?: (NativeImage) | (string); title: string; content: string; } @@ -7518,7 +7968,7 @@ declare namespace Electron { /** * Sets the image associated with this dock icon. */ - setIcon: (image: NativeImage | string) => void; + setIcon: (image: (NativeImage) | (string)) => void; } interface EnableNetworkEmulationOptions { @@ -7716,6 +8166,7 @@ declare namespace Electron { interface InterceptHttpProtocolRequest { url: string; + headers: Headers; referrer: string; method: string; uploadData: UploadData[]; @@ -7772,11 +8223,26 @@ declare namespace Electron { isMainFrame: boolean; } + interface LoadFileOptions { + /** + * Passed to url.format(). + */ + query?: Query; + /** + * Passed to url.format(). + */ + search?: string; + /** + * Passed to url.format(). + */ + hash?: string; + } + interface LoadURLOptions { /** * An HTTP Referrer url. */ - httpReferrer?: string | Referrer; + httpReferrer?: (string) | (Referrer); /** * A user agent originating the request. */ @@ -7785,7 +8251,7 @@ declare namespace Electron { * Extra headers separated by "\n" */ extraHeaders?: string; - postData?: UploadRawData[] | UploadFile[] | UploadBlob[]; + postData?: (UploadRawData[]) | (UploadFile[]) | (UploadBlob[]); /** * Base url (with trailing path separator) for files to be loaded by the data url. * This is needed only if the specified url is a data url and needs to load other @@ -7856,7 +8322,7 @@ declare namespace Electron { label?: string; sublabel?: string; accelerator?: Accelerator; - icon?: NativeImage | string; + icon?: (NativeImage) | (string); /** * If false, the menu item will be greyed out and unclickable. */ @@ -7879,17 +8345,36 @@ declare namespace Electron { * type: 'submenu' can be omitted. If the value is not a then it will be * automatically converted to one using Menu.buildFromTemplate. */ - submenu?: MenuItemConstructorOptions[] | Menu; + submenu?: (MenuItemConstructorOptions[]) | (Menu); /** * Unique within a single menu. If defined then it can be used as a reference to * this item by the position attribute. */ id?: string; /** - * This field allows fine-grained definition of the specific location within a - * given menu. + * Inserts this item before the item with the specified label. If the referenced + * item doesn't exist the item will be inserted at the end of the menu. Also + * implies that the menu item in question should be placed in the same “group” as + * the item. */ - position?: string; + before?: string[]; + /** + * Inserts this item after the item with the specified label. If the referenced + * item doesn't exist the item will be inserted at the end of the menu. + */ + after?: string[]; + /** + * Provides a means for a single context menu to declare the placement of their + * containing group before the containing group of the item with the specified + * label. + */ + beforeGroupContaining?: string[]; + /** + * Provides a means for a single context menu to declare the placement of their + * containing group after the containing group of the item with the specified + * label. + */ + afterGroupContaining?: string[]; } interface MessageBoxOptions { @@ -7935,7 +8420,7 @@ declare namespace Electron { * The index of the button to be used to cancel the dialog, via the Esc key. By * default this is assigned to the first button with "cancel" or "no" as the label. * If no such labeled buttons exist and this option is not set, 0 will be used as - * the return value or callback response. This option is ignored on Windows. + * the return value or callback response. */ cancelId?: number; /** @@ -7993,7 +8478,7 @@ declare namespace Electron { /** * An icon to use in the notification. */ - icon?: string | NativeImage; + icon?: (string) | (NativeImage); /** * Whether or not to add an inline reply option to the notification. */ @@ -8093,6 +8578,7 @@ declare namespace Electron { method: string; webContentsId?: number; resourceType: string; + referrer: string; timestamp: number; responseHeaders: ResponseHeaders; fromCache: boolean; @@ -8151,7 +8637,7 @@ declare namespace Electron { } interface OnHeadersReceivedResponse { - cancel: boolean; + cancel?: boolean; /** * When provided, the server is assumed to have responded with these headers. */ @@ -8242,7 +8728,11 @@ declare namespace Electron { /** * true to bring the opened application to the foreground. The default is true. */ - activate: boolean; + activate?: boolean; + /** + * The working directory. + */ + workingDirectory?: string; } interface PageFaviconUpdatedEvent extends Event { @@ -8267,8 +8757,8 @@ declare namespace Electron { */ screenSize: Size; /** - * Position the view on the screen (screenPosition == mobile) (default: {x: 0, y: - * 0}). + * Position the view on the screen (screenPosition == mobile) (default: { x: 0, y: + * 0 }). */ viewPosition: Point; /** @@ -8298,11 +8788,26 @@ declare namespace Electron { quantity: number; } + interface PermissionCheckHandlerDetails { + /** + * The security orign of the media check. + */ + securityOrigin: string; + /** + * The type of media access being requested, can be video, audio or unknown + */ + mediaType: ('video' | 'audio' | 'unknown'); + } + interface PermissionRequestHandlerDetails { /** * The url of the openExternal request. */ externalURL: string; + /** + * The types of media access being requested, elements can be video or audio + */ + mediaTypes: Array<'video' | 'audio'>; } interface PluginCrashedEvent extends Event { @@ -8359,7 +8864,7 @@ declare namespace Electron { * Specify page size of the generated PDF. Can be A3, A4, A5, Legal, Letter, * Tabloid or an Object containing height and width in microns. */ - pageSize?: string | Size; + pageSize?: (string) | (Size); /** * Whether to print CSS backgrounds. */ @@ -8376,23 +8881,19 @@ declare namespace Electron { interface ProcessMemoryInfo { /** - * The amount of memory currently pinned to actual physical RAM. + * and The amount of memory currently pinned to actual physical RAM in Kilobytes. */ - workingSetSize: number; - /** - * The maximum amount of memory that has ever been pinned to actual physical RAM. - */ - peakWorkingSetSize: number; + residentSet: number; /** * The amount of memory not shared by other processes, such as JS heap or HTML - * content. + * content in Kilobytes. */ - privateBytes: number; + private: number; /** * The amount of memory shared between processes, typically memory consumed by the - * Electron code itself. + * Electron code itself in Kilobytes. */ - sharedBytes: number; + shared: number; } interface ProgressBarOptions { @@ -8437,6 +8938,7 @@ declare namespace Electron { interface RegisterHttpProtocolRequest { url: string; + headers: Headers; referrer: string; method: string; uploadData: UploadData[]; @@ -8704,8 +9206,8 @@ declare namespace Electron { } interface TouchBarConstructorOptions { - items: Array; - escapeItem?: TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null; + items: Array<(TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer)>; + escapeItem?: (TouchBarButton) | (TouchBarColorPicker) | (TouchBarGroup) | (TouchBarLabel) | (TouchBarPopover) | (TouchBarScrubber) | (TouchBarSegmentedControl) | (TouchBarSlider) | (TouchBarSpacer) | (null); } interface TouchBarGroupConstructorOptions { @@ -8871,6 +9373,13 @@ declare namespace Electron { electron?: string; } + interface VisibleOnAllWorkspacesOptions { + /** + * Sets whether the window should be visible above fullscreen windows + */ + visibleOnFullScreen?: boolean; + } + interface WillNavigateEvent extends Event { url: string; } @@ -8964,6 +9473,9 @@ declare namespace Electron { interface Options { } + interface Query { + } + interface RequestHeaders { } @@ -9004,6 +9516,10 @@ declare namespace Electron { * currently experimental and may change or be removed in future Electron releases. */ sandbox?: boolean; + /** + * Whether to enable the module. Default is true. + */ + enableRemoteModule?: boolean; /** * Sets the session used by the page. Instead of passing the Session object * directly, you can also choose to use the partition option instead, which accepts @@ -9072,10 +9588,6 @@ declare namespace Electron { * Enables Chromium's experimental features. Default is false. */ // experimentalFeatures?: boolean; ### VSCODE CHANGE (https://github.com/electron/electron/blob/master/docs/tutorial/security.md) ### - /** - * Enables Chromium's experimental canvas features. Default is false. - */ - experimentalCanvasFeatures?: boolean; /** * Enables scroll bounce (rubber banding) effect on macOS. Default is false. */ @@ -9131,8 +9643,7 @@ declare namespace Electron { * content to ensure the loaded content cannot tamper with the preload script and * any Electron APIs being used. This option uses the same technique used by . You * can access this context in the dev tools by selecting the 'Electron Isolated - * Context' entry in the combo box at the top of the Console tab. This option is - * currently experimental and may change or be removed in future Electron releases. + * Context' entry in the combo box at the top of the Console tab. */ contextIsolation?: boolean; /** @@ -9144,11 +9655,11 @@ declare namespace Electron { nativeWindowOpen?: boolean; /** * Whether to enable the . Defaults to the value of the nodeIntegration option. The - * preload script configured for the will have node integration enabled - * when it is executed so you should ensure remote/untrusted content is not able to - * create a tag with a possibly malicious preload script. You can use the + * preload script configured for the will have node integration enabled when it is + * executed so you should ensure remote/untrusted content is not able to create a + * tag with a possibly malicious preload script. You can use the * will-attach-webview event on to strip away the preload script and to validate or - * alter the 's initial settings. + * alter the 's initial settings. */ webviewTag?: boolean; /** @@ -9230,7 +9741,7 @@ interface Document { declare namespace NodeJS { interface Process extends EventEmitter { - // Docs: http://electron.atom.io/docs/api/process + // Docs: http://electronjs.org/docs/api/process // ### BEGIN VSCODE MODIFICATION ### // /** @@ -9250,6 +9761,12 @@ declare namespace NodeJS { */ crash(): void; getCPUUsage(): Electron.CPUUsage; + /** + * Indicates the creation time of the application. The time is represented as + * number of milliseconds since epoch. It returns null if it is unable to get the + * process creation time. + */ + getCreationTime(): (number) | (null); /** * Returns an object with V8 heap statistics. Note that all statistics are reported * in Kilobytes. @@ -9258,7 +9775,12 @@ declare namespace NodeJS { getIOCounters(): Electron.IOCounters; /** * Returns an object giving memory usage statistics about the current process. Note - * that all statistics are reported in Kilobytes. + * that all statistics are reported in Kilobytes. This api should be called after + * app ready. Chromium does not provide residentSet value for macOS. This is + * because macOS performs in-memory compression of pages that haven't been recently + * used. As a result the resident set size value is not what one would expect. + * private memory is more representative of the actual pre-compression memory usage + * of the process on macOS. */ getProcessMemoryInfo(): Electron.ProcessMemoryInfo; /** @@ -9275,6 +9797,10 @@ declare namespace NodeJS { * whichever is lower for the current process. */ setFdLimit(maxDescriptors: number): void; + /** + * Takes a V8 heap snapshot and saves it to filePath. + */ + takeHeapSnapshot(filePath: string): boolean; /** * A Boolean. When app is started by being passed as parameter to the default app, * this property is true in the main process, otherwise it is undefined. @@ -9300,6 +9826,11 @@ declare namespace NodeJS { * A String representing the path to the resources directory. */ resourcesPath?: string; + /** + * A Boolean. When the renderer process is sandboxed, this property is true, + * otherwise it is undefined. + */ + sandboxed?: boolean; /** * A Boolean that controls whether or not deprecation warnings will be thrown as * exceptions. Setting this to true will throw errors for deprecations. This @@ -9335,4 +9866,4 @@ declare namespace NodeJS { electron: string; chrome: string; } -} +} \ No newline at end of file diff --git a/src/typings/require.d.ts b/src/typings/require.d.ts index ded5e2e7270..618861a5bee 100644 --- a/src/typings/require.d.ts +++ b/src/typings/require.d.ts @@ -17,7 +17,12 @@ declare const enum LoaderEventType { NodeEndEvaluatingScript = 32, NodeBeginNativeRequire = 33, - NodeEndNativeRequire = 34 + NodeEndNativeRequire = 34, + + CachedDataFound = 60, + CachedDataMissed = 61, + CachedDataRejected = 62, + CachedDataCreated = 63, } declare class LoaderEvent { diff --git a/src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.css b/src/typings/vscode-windows-ca-certs.d.ts similarity index 88% rename from src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.css rename to src/typings/vscode-windows-ca-certs.d.ts index 28042461298..f923eb8a8ac 100644 --- a/src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.css +++ b/src/typings/vscode-windows-ca-certs.d.ts @@ -3,6 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-editor .code-inset { - z-index: 10; -} +declare module 'vscode-windows-ca-certs'; diff --git a/src/typings/xterm-addon-search.d.ts b/src/typings/xterm-addon-search.d.ts new file mode 100644 index 00000000000..2f3be6f82bd --- /dev/null +++ b/src/typings/xterm-addon-search.d.ts @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2017 The xterm.js authors. All rights reserved. + * @license MIT + */ + +// HACK: gulp-tsb doesn't play nice with importing from typings +// import { Terminal, ITerminalAddon } from 'xterm'; + +declare module 'xterm-addon-search' { + /** + * Options for a search. + */ + export interface ISearchOptions { + /** + * Whether the search term is a regex. + */ + regex?: boolean; + + /** + * Whether to search for a whole word, the result is only valid if it's + * suppounded in "non-word" characters such as `_`, `(`, `)` or space. + */ + wholeWord?: boolean; + + /** + * Whether the search is case sensitive. + */ + caseSensitive?: boolean; + + /** + * Whether to do an indcremental search, this will expand the selection if it + * still matches the term the user typed. Note that this only affects + * `findNext`, not `findPrevious`. + */ + incremental?: boolean; + } + + /** + * An xterm.js addon that provides search functionality. + */ + export class SearchAddon { + /** + * Activates the addon + * @param terminal The terminal the addon is being loaded in. + */ + public activate(terminal: any): void; + + /** + * Disposes the addon. + */ + public dispose(): void; + + /** + * Search forwards for the next result that matches the search term and + * options. + * @param term The search term. + * @param searchOptions The options for the search. + */ + public findNext(term: string, searchOptions?: ISearchOptions): boolean; + + /** + * Search backwards for the previous result that matches the search term and + * options. + * @param term The search term. + * @param searchOptions The options for the search. + */ + public findPrevious(term: string, searchOptions?: ISearchOptions): boolean; + } +} diff --git a/src/typings/xterm-addon-web-links.d.ts b/src/typings/xterm-addon-web-links.d.ts new file mode 100644 index 00000000000..da348f8c82e --- /dev/null +++ b/src/typings/xterm-addon-web-links.d.ts @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2017 The xterm.js authors. All rights reserved. + * @license MIT + */ + +// HACK: gulp-tsb doesn't play nice with importing from typings +// import { Terminal, ITerminalAddon } from 'xterm'; +interface ILinkMatcherOptions { + /** + * The index of the link from the regex.match(text) call. This defaults to 0 + * (for regular expressions without capture groups). + */ + matchIndex?: number; + + /** + * A callback that validates whether to create an individual link, pass + * whether the link is valid to the callback. + */ + validationCallback?: (uri: string, callback: (isValid: boolean) => void) => void; + + /** + * A callback that fires when the mouse hovers over a link for a moment. + */ + tooltipCallback?: (event: MouseEvent, uri: string) => boolean | void; + + /** + * 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?: () => void; + + /** + * The priority of the link matcher, this defines the order in which the link + * matcher is evaluated relative to others, from highest to lowest. The + * default value is 0. + */ + priority?: number; + + /** + * A callback that fires when the mousedown and click events occur that + * determines whether a link will be activated upon click. This enables + * only activating a link when a certain modifier is held down, if not the + * mouse event will continue propagation (eg. double click to select word). + */ + willLinkActivate?: (event: MouseEvent, uri: string) => boolean; +} + +declare module 'xterm-addon-web-links' { + /** + * An xterm.js addon that enables web links. + */ + export class WebLinksAddon { + /** + * Creates a new web links addon. + * @param handler The callback when the link is called. + * @param options Options for the link matcher. + */ + constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions); + + /** + * Activates the addon + * @param terminal The terminal the addon is being loaded in. + */ + public activate(terminal: any): void; + + /** + * Disposes the addon. + */ + public dispose(): void; + } +} diff --git a/src/typings/vscode-xterm.d.ts b/src/typings/xterm.d.ts similarity index 91% rename from src/typings/vscode-xterm.d.ts rename to src/typings/xterm.d.ts index 01e47b16b27..b4b3d8c0c5f 100644 --- a/src/typings/vscode-xterm.d.ts +++ b/src/typings/xterm.d.ts @@ -9,7 +9,7 @@ /// -declare module 'vscode-xterm' { +declare module 'xterm' { /** * A string representing text font weight. */ @@ -76,31 +76,6 @@ declare module 'vscode-xterm' { */ drawBoldTextInBrightColors?: boolean; - /** - * Whether to enable the rendering of bold text. - * - * @deprecated Use fontWeight and fontWeightBold instead. - */ - enableBold?: boolean; - - /** - * What character atlas implementation to use. The character atlas caches drawn characters, - * speeding up rendering significantly. However, it can introduce some minor rendering - * artifacts. - * - * - 'none': Don't use an atlas. - * - 'static': Generate an atlas when the terminal starts or is reconfigured. This atlas will - * only contain ASCII characters in 16 colors. - * - 'dynamic': Generate an atlas using a LRU cache as characters are requested. Limited to - * ASCII characters (for now), but supports 256 colors. For characters covered by the static - * cache, it's slightly slower in comparison, since there's more overhead involved in - * managing the cache. - * - * Currently defaults to 'static'. This option may be removed in the future. If it is, passed - * parameters will be ignored. - */ - experimentalCharAtlas?: 'none' | 'static' | 'dynamic'; - /** * The font size used to render text. */ @@ -706,13 +681,6 @@ declare module 'vscode-xterm' { */ dispose(): void; - /** - * Destroys the terminal and detaches it from the DOM. - * - * @deprecated Use dispose() instead. - */ - destroy(): void; - /** * Scroll the display of the terminal * @param amount The number of lines to scroll down (negative scroll up). @@ -775,7 +743,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' | 'windowsMode'): boolean; + getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean; /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -826,7 +794,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' | 'windowsMode', value: boolean): void; + setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void; /** * Sets an option on the terminal. * @param key The option key. @@ -1013,8 +981,9 @@ declare module 'vscode-xterm' { } + // Modifications to official .d.ts below -declare module 'vscode-xterm' { +declare module 'xterm' { interface TerminalCore { debug: boolean; @@ -1037,42 +1006,7 @@ declare module 'vscode-xterm' { fire(e: T): void; } - interface ISearchOptions { - /** - * Whether the find should be done as a regex. - */ - regex?: boolean; - /** - * Whether only whole words should match. - */ - wholeWord?: boolean; - /** - * Whether find should pay attention to case. - */ - caseSensitive?: boolean; - } - interface Terminal { _core: TerminalCore; - - webLinksInit(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): void; - - /** - * Find the next instance of the term, then scroll to and select it. If it - * doesn't exist, do nothing. - * @param term The search term. - * @param findOptions Regex, whole word, and case sensitive options. - * @return Whether a result was found. - */ - findNext(term: string, findOptions: ISearchOptions): boolean; - - /** - * Find the previous instance of the term, then scroll to and select it. If it - * doesn't exist, do nothing. - * @param term The search term. - * @param findOptions Regex, whole word, and case sensitive options. - * @return Whether a result was found. - */ - findPrevious(term: string, findOptions: ISearchOptions): boolean; } -} +} \ No newline at end of file diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 85ce189ee98..09458bfc2b6 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -11,7 +11,7 @@ import { TimeoutTimer } from 'vs/base/common/async'; import { CharCode } from 'vs/base/common/charCode'; import { onUnexpectedError } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; import { coalesce } from 'vs/base/common/arrays'; @@ -929,21 +929,20 @@ export function restoreParentsScrollTop(node: Element, state: number[]): void { } } -class FocusTracker implements IFocusTracker { +class FocusTracker extends Disposable implements IFocusTracker { - private _onDidFocus = new Emitter(); - readonly onDidFocus: Event = this._onDidFocus.event; + private readonly _onDidFocus = this._register(new Emitter()); + public readonly onDidFocus: Event = this._onDidFocus.event; - private _onDidBlur = new Emitter(); - readonly onDidBlur: Event = this._onDidBlur.event; - - private disposables: IDisposable[] = []; + private readonly _onDidBlur = this._register(new Emitter()); + public readonly onDidBlur: Event = this._onDidBlur.event; constructor(element: HTMLElement | Window) { + super(); let hasFocus = isAncestor(document.activeElement, element); let loosingFocus = false; - let onFocus = () => { + const onFocus = () => { loosingFocus = false; if (!hasFocus) { hasFocus = true; @@ -951,7 +950,7 @@ class FocusTracker implements IFocusTracker { } }; - let onBlur = () => { + const onBlur = () => { if (hasFocus) { loosingFocus = true; window.setTimeout(() => { @@ -964,14 +963,8 @@ class FocusTracker implements IFocusTracker { } }; - domEvent(element, EventType.FOCUS, true)(onFocus, null, this.disposables); - domEvent(element, EventType.BLUR, true)(onBlur, null, this.disposables); - } - - dispose(): void { - this.disposables = dispose(this.disposables); - this._onDidFocus.dispose(); - this._onDidBlur.dispose(); + this._register(domEvent(element, EventType.FOCUS, true)(onFocus)); + this._register(domEvent(element, EventType.BLUR, true)(onBlur)); } } diff --git a/src/vs/base/browser/globalMouseMoveMonitor.ts b/src/vs/base/browser/globalMouseMoveMonitor.ts index 89210064781..109f6f72260 100644 --- a/src/vs/base/browser/globalMouseMoveMonitor.ts +++ b/src/vs/base/browser/globalMouseMoveMonitor.ts @@ -6,7 +6,7 @@ import * as dom from 'vs/base/browser/dom'; import { IframeUtils } from 'vs/base/browser/iframe'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; export interface IStandardMouseMoveEventData { leftButton: boolean; @@ -36,24 +36,16 @@ export function standardMouseMoveMerger(lastEvent: IStandardMouseMoveEventData, }; } -export class GlobalMouseMoveMonitor extends Disposable { +export class GlobalMouseMoveMonitor implements IDisposable { - private hooks: IDisposable[]; - private mouseMoveEventMerger: IEventMerger | null; - private mouseMoveCallback: IMouseMoveCallback | null; - private onStopCallback: IOnStopCallback | null; - - constructor() { - super(); - this.hooks = []; - this.mouseMoveEventMerger = null; - this.mouseMoveCallback = null; - this.onStopCallback = null; - } + private readonly hooks = new DisposableStore(); + private mouseMoveEventMerger: IEventMerger | null = null; + private mouseMoveCallback: IMouseMoveCallback | null = null; + private onStopCallback: IOnStopCallback | null = null; public dispose(): void { this.stopMonitoring(false); - super.dispose(); + this.hooks.dispose(); } public stopMonitoring(invokeStopCallback: boolean): void { @@ -63,10 +55,10 @@ export class GlobalMouseMoveMonitor extends Disposable { } // Unhook - this.hooks = dispose(this.hooks); + this.hooks.clear(); this.mouseMoveEventMerger = null; this.mouseMoveCallback = null; - let onStopCallback = this.onStopCallback; + const onStopCallback = this.onStopCallback; this.onStopCallback = null; if (invokeStopCallback && onStopCallback) { @@ -74,8 +66,8 @@ export class GlobalMouseMoveMonitor extends Disposable { } } - public isMonitoring() { - return this.hooks.length > 0; + public isMonitoring(): boolean { + return !!this.mouseMoveEventMerger; } public startMonitoring( @@ -93,32 +85,32 @@ export class GlobalMouseMoveMonitor extends Disposable { let windowChain = IframeUtils.getSameOriginWindowChain(); for (const element of windowChain) { - this.hooks.push(dom.addDisposableThrottledListener(element.window.document, 'mousemove', + this.hooks.add(dom.addDisposableThrottledListener(element.window.document, 'mousemove', (data: R) => this.mouseMoveCallback!(data), (lastEvent: R, currentEvent) => this.mouseMoveEventMerger!(lastEvent, currentEvent as MouseEvent) )); - this.hooks.push(dom.addDisposableListener(element.window.document, 'mouseup', (e: MouseEvent) => this.stopMonitoring(true))); + this.hooks.add(dom.addDisposableListener(element.window.document, 'mouseup', (e: MouseEvent) => this.stopMonitoring(true))); } if (IframeUtils.hasDifferentOriginAncestor()) { let lastSameOriginAncestor = windowChain[windowChain.length - 1]; // We might miss a mouse up if it happens outside the iframe // This one is for Chrome - this.hooks.push(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent: MouseEvent) => { + this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent: MouseEvent) => { let e = new StandardMouseEvent(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for FF - this.hooks.push(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent: MouseEvent) => { + this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent: MouseEvent) => { let e = new StandardMouseEvent(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for IE - this.hooks.push(dom.addDisposableListener(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent: MouseEvent) => { + this.hooks.add(dom.addDisposableListener(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent: MouseEvent) => { this.stopMonitoring(true); })); } diff --git a/src/vs/base/browser/hash.ts b/src/vs/base/browser/hash.ts deleted file mode 100644 index eee8c0f56e4..00000000000 --- a/src/vs/base/browser/hash.ts +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export function createSHA1(content: string): Thenable { - if (typeof require !== 'undefined') { - const _crypto: typeof crypto = require.__$__nodeRequire('crypto'); - return Promise.resolve(_crypto['createHash']('sha1').update(content).digest('hex')); - } - return crypto.subtle.digest('SHA-1', new TextEncoder().encode(content)).then(buffer => { - // https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#Converting_a_digest_to_a_hex_string - return Array.prototype.map.call(new Uint8Array(buffer), (value: number) => `00${value.toString(16)}`.slice(-2)).join(''); - }); -} \ No newline at end of file diff --git a/src/vs/base/browser/ui/actionbar/actionbar.ts b/src/vs/base/browser/ui/actionbar/actionbar.ts index 131c756a817..6ff6449e70f 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.ts +++ b/src/vs/base/browser/ui/actionbar/actionbar.ts @@ -261,6 +261,9 @@ export class ActionViewItem extends BaseActionViewItem { this.label.setAttribute('role', 'menuitem'); } else { this.label.setAttribute('role', 'button'); + + // TODO @misolori remove before shipping stable + this.label.setAttribute('data-title', this._action.id); } } diff --git a/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts b/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts index bdbce4e9e30..28713284213 100644 --- a/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts +++ b/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts @@ -9,7 +9,7 @@ import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableEle import { commonPrefixLength } from 'vs/base/common/arrays'; import { Color } from 'vs/base/common/color'; import { Emitter, Event } from 'vs/base/common/event'; -import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import 'vs/css!./breadcrumbsWidget'; @@ -55,16 +55,15 @@ export interface IBreadcrumbsItemEvent { payload: any; } -export class BreadcrumbsWidget { +export class BreadcrumbsWidget extends Disposable { - private readonly _disposables = new Array(); private readonly _domNode: HTMLDivElement; private readonly _styleElement: HTMLStyleElement; private readonly _scrollable: DomScrollableElement; - private readonly _onDidSelectItem = new Emitter(); - private readonly _onDidFocusItem = new Emitter(); - private readonly _onDidChangeFocus = new Emitter(); + private readonly _onDidSelectItem = this._register(new Emitter()); + private readonly _onDidFocusItem = this._register(new Emitter()); + private readonly _onDidChangeFocus = this._register(new Emitter()); readonly onDidSelectItem: Event = this._onDidSelectItem.event; readonly onDidFocusItem: Event = this._onDidFocusItem.event; @@ -83,6 +82,7 @@ export class BreadcrumbsWidget { constructor( container: HTMLElement ) { + super(); this._domNode = document.createElement('div'); this._domNode.className = 'monaco-breadcrumbs'; this._domNode.tabIndex = 0; @@ -94,26 +94,22 @@ export class BreadcrumbsWidget { useShadows: false, scrollYToX: true }); - this._disposables.push(this._scrollable); - this._disposables.push(dom.addStandardDisposableListener(this._domNode, 'click', e => this._onClick(e))); + this._register(this._scrollable); + this._register(dom.addStandardDisposableListener(this._domNode, 'click', e => this._onClick(e))); container.appendChild(this._scrollable.getDomNode()); this._styleElement = dom.createStyleSheet(this._domNode); let focusTracker = dom.trackFocus(this._domNode); - this._disposables.push(focusTracker); - this._disposables.push(focusTracker.onDidBlur(_ => this._onDidChangeFocus.fire(false))); - this._disposables.push(focusTracker.onDidFocus(_ => this._onDidChangeFocus.fire(true))); + this._register(focusTracker); + this._register(focusTracker.onDidBlur(_ => this._onDidChangeFocus.fire(false))); + this._register(focusTracker.onDidFocus(_ => this._onDidChangeFocus.fire(true))); } dispose(): void { - dispose(this._disposables); + super.dispose(); dispose(this._pendingLayout); - this._onDidSelectItem.dispose(); - this._onDidFocusItem.dispose(); - this._onDidChangeFocus.dispose(); this._domNode.remove(); - this._disposables.length = 0; this._nodes.length = 0; this._freeNodes.length = 0; } diff --git a/src/vs/base/browser/ui/centered/centeredViewLayout.ts b/src/vs/base/browser/ui/centered/centeredViewLayout.ts index a776ba92a6d..ff349b87bd4 100644 --- a/src/vs/base/browser/ui/centered/centeredViewLayout.ts +++ b/src/vs/base/browser/ui/centered/centeredViewLayout.ts @@ -7,7 +7,7 @@ import { SplitView, Orientation, ISplitViewStyles, IView as ISplitViewView } fro import { $ } from 'vs/base/browser/dom'; import { Event } from 'vs/base/common/event'; import { IView } from 'vs/base/browser/ui/grid/gridview'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; export interface CenteredViewState { @@ -48,7 +48,7 @@ export interface ICenteredViewStyles extends ISplitViewStyles { background: Color; } -export class CenteredViewLayout { +export class CenteredViewLayout implements IDisposable { private splitView?: SplitView; private width: number = 0; @@ -56,7 +56,7 @@ export class CenteredViewLayout { private style: ICenteredViewStyles; private didLayout = false; private emptyViews: ISplitViewView[] | undefined; - private splitViewDisposables: IDisposable[] = []; + private readonly splitViewDisposables = new DisposableStore(); constructor(private container: HTMLElement, private view: IView, public readonly state: CenteredViewState = { leftMarginRatio: GOLDEN_RATIO.leftMarginRatio, rightMarginRatio: GOLDEN_RATIO.rightMarginRatio }) { this.container.appendChild(this.view.element); @@ -117,13 +117,13 @@ export class CenteredViewLayout { styles: this.style }); - this.splitViewDisposables.push(this.splitView.onDidSashChange(() => { + this.splitViewDisposables.add(this.splitView.onDidSashChange(() => { if (this.splitView) { this.state.leftMarginRatio = this.splitView.getViewSize(0) / this.width; this.state.rightMarginRatio = this.splitView.getViewSize(2) / this.width; } })); - this.splitViewDisposables.push(this.splitView.onDidSashReset(() => { + this.splitViewDisposables.add(this.splitView.onDidSashReset(() => { this.state.leftMarginRatio = GOLDEN_RATIO.leftMarginRatio; this.state.rightMarginRatio = GOLDEN_RATIO.rightMarginRatio; this.resizeMargins(); @@ -138,7 +138,7 @@ export class CenteredViewLayout { if (this.splitView) { this.container.removeChild(this.splitView.el); } - this.splitViewDisposables = dispose(this.splitViewDisposables); + this.splitViewDisposables.clear(); if (this.splitView) { this.splitView.dispose(); } @@ -153,7 +153,7 @@ export class CenteredViewLayout { } dispose(): void { - this.splitViewDisposables = dispose(this.splitViewDisposables); + this.splitViewDisposables.dispose(); if (this.splitView) { this.splitView.dispose(); diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index b3cc40b3eee..7ea36f61d15 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -5,7 +5,7 @@ import 'vs/css!./list'; import { localize } from 'vs/nls'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { isNumber } from 'vs/base/common/types'; import { range, firstIndex, binarySearch } from 'vs/base/common/arrays'; import { memoize } from 'vs/base/common/decorators'; @@ -226,9 +226,8 @@ function isInputElement(e: HTMLElement): boolean { return e.tagName === 'INPUT' || e.tagName === 'TEXTAREA'; } -class KeyboardController implements IDisposable { +class KeyboardController extends Disposable { - private disposables: IDisposable[]; private openController: IOpenController; constructor( @@ -236,8 +235,8 @@ class KeyboardController implements IDisposable { private view: ListView, options: IListOptions ) { + super(); const multipleSelectionSupport = !(options.multipleSelectionSupport === false); - this.disposables = []; this.openController = options.openController || DefaultOpenController; @@ -245,15 +244,15 @@ class KeyboardController implements IDisposable { .filter(e => !isInputElement(e.target as HTMLElement)) .map(e => new StandardKeyboardEvent(e)); - onKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(this.onEnter, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(this.onEscape, this, this.disposables); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(this.onEnter, this)); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this)); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this)); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this)); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this)); + this._register(onKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(this.onEscape, this)); if (multipleSelectionSupport) { - onKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KEY_A).on(this.onCtrlA, this, this.disposables); + this._register(onKeyDown.filter(e => (platform.isMacintosh ? e.metaKey : e.ctrlKey) && e.keyCode === KeyCode.KEY_A).on(this.onCtrlA, this)); } } @@ -312,10 +311,6 @@ class KeyboardController implements IDisposable { this.list.setSelection([], e.browserEvent); this.view.domNode.focus(); } - - dispose() { - this.disposables = dispose(this.disposables); - } } enum TypeLabelControllerState { diff --git a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts index edabf906902..f26942d54e9 100644 --- a/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts +++ b/src/vs/base/browser/ui/selectBox/selectBoxCustom.ts @@ -5,7 +5,7 @@ import 'vs/css!./selectBoxCustom'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { Event, Emitter } from 'vs/base/common/event'; import { KeyCode, KeyCodeUtils } from 'vs/base/common/keyCodes'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; @@ -80,7 +80,7 @@ class SelectListRenderer implements IListRenderer { +export class SelectBoxList extends Disposable implements ISelectBoxDelegate, IListVirtualDelegate { private static readonly DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN = 32; private static readonly DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN = 2; @@ -92,7 +92,6 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate; - private toDispose: IDisposable[]; private styles: ISelectBoxStyles; private listRenderer: SelectListRenderer; private contextViewProvider: IContextViewProvider; @@ -111,7 +110,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate(); - this.toDispose.push(this._onDidSelect); + this._register(this._onDidSelect); this.styles = styles; @@ -185,7 +184,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate { + this._register(dom.addStandardDisposableListener(this.selectElement, 'change', (e) => { this.selected = e.target.selectedIndex; this._onDidSelect.fire({ index: e.target.selectedIndex, @@ -199,7 +198,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate { + this._register(dom.addDisposableListener(this.selectElement, dom.EventType.CLICK, (e) => { dom.EventHelper.stop(e); if (this._isVisible) { @@ -209,13 +208,13 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate { + this._register(dom.addDisposableListener(this.selectElement, dom.EventType.MOUSE_DOWN, (e) => { dom.EventHelper.stop(e); })); // Intercept keyboard handling - this.toDispose.push(dom.addDisposableListener(this.selectElement, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => { + this._register(dom.addDisposableListener(this.selectElement, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => { const event = new StandardKeyboardEvent(e); let showDropDown = false; @@ -735,27 +734,26 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate this.selectList.length > 0) .map(e => new StandardKeyboardEvent(e)); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(e => this.onEnter(e), this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(e => this.onEscape(e), this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDown, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUp, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Home).on(this.onHome, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.End).on(this.onEnd, this, this.toDispose); - onSelectDropDownKeyDown.filter(e => (e.keyCode >= KeyCode.KEY_0 && e.keyCode <= KeyCode.KEY_Z) || (e.keyCode >= KeyCode.US_SEMICOLON && e.keyCode <= KeyCode.NUMPAD_DIVIDE)).on(this.onCharacter, this, this.toDispose); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(e => this.onEnter(e), this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(e => this.onEscape(e), this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDown, this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUp, this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.Home).on(this.onHome, this)); + this._register(onSelectDropDownKeyDown.filter(e => e.keyCode === KeyCode.End).on(this.onEnd, this)); + this._register(onSelectDropDownKeyDown.filter(e => (e.keyCode >= KeyCode.KEY_0 && e.keyCode <= KeyCode.KEY_Z) || (e.keyCode >= KeyCode.US_SEMICOLON && e.keyCode <= KeyCode.NUMPAD_DIVIDE)).on(this.onCharacter, this)); // SetUp list mouse controller - control navigation, disabled items, focus - Event.chain(domEvent(this.selectList.getHTMLElement(), 'mouseup')) + this._register(Event.chain(domEvent(this.selectList.getHTMLElement(), 'mouseup')) .filter(() => this.selectList.length > 0) - .on(e => this.onMouseUp(e), this, this.toDispose); + .on(e => this.onMouseUp(e), this)); - this.toDispose.push( - this.selectList.onDidBlur(_ => this.onListBlur()), - this.selectList.onMouseOver(e => typeof e.index !== 'undefined' && this.selectList.setFocus([e.index])), - this.selectList.onFocusChange(e => this.onListFocus(e)) - ); + + this._register(this.selectList.onDidBlur(_ => this.onListBlur())); + this._register(this.selectList.onMouseOver(e => typeof e.index !== 'undefined' && this.selectList.setFocus([e.index]))); + this._register(this.selectList.onFocusChange(e => this.onListFocus(e))); this.selectList.getHTMLElement().setAttribute('aria-label', this.selectBoxOptions.ariaLabel || ''); this.selectList.getHTMLElement().setAttribute('aria-expanded', 'true'); @@ -1034,6 +1032,6 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate(); - this._register(this._onDidSelect); + this._onDidSelect = this._register(new Emitter()); this.styles = styles; diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index d509af4e4e7..4d2fc8a6144 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./panelview'; -import { IDisposable, dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { Event, Emitter } from 'vs/base/common/event'; import { domEvent } from 'vs/base/browser/event'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; @@ -37,7 +37,7 @@ export interface IPanelStyles { * Subclasses wouldn't be able to set own properties * before the `render()` call, thus forbiding their use. */ -export abstract class Panel implements IView { +export abstract class Panel extends Disposable implements IView { private static readonly HEADER_SIZE = 22; @@ -55,11 +55,9 @@ export abstract class Panel implements IView { private styles: IPanelStyles = {}; private animationTimer: number | undefined = undefined; - private _onDidChange = new Emitter(); + private readonly _onDidChange = this._register(new Emitter()); readonly onDidChange: Event = this._onDidChange.event; - protected disposables: IDisposable[] = []; - get draggableElement(): HTMLElement { return this.header; } @@ -114,6 +112,7 @@ export abstract class Panel implements IView { width: number; constructor(options: IPanelOptions = {}) { + super(); this._expanded = typeof options.expanded === 'undefined' ? true : !!options.expanded; this.ariaHeaderLabel = options.ariaHeaderLabel || ''; this._minimumBodySize = typeof options.minimumBodySize === 'number' ? options.minimumBodySize : 120; @@ -172,26 +171,26 @@ export abstract class Panel implements IView { this.renderHeader(this.header); const focusTracker = trackFocus(this.header); - this.disposables.push(focusTracker); - focusTracker.onDidFocus(() => addClass(this.header, 'focused'), null, this.disposables); - focusTracker.onDidBlur(() => removeClass(this.header, 'focused'), null, this.disposables); + this._register(focusTracker); + this._register(focusTracker.onDidFocus(() => addClass(this.header, 'focused'), null)); + this._register(focusTracker.onDidBlur(() => removeClass(this.header, 'focused'), null)); this.updateHeader(); const onHeaderKeyDown = Event.chain(domEvent(this.header, 'keydown')) .map(e => new StandardKeyboardEvent(e)); - onHeaderKeyDown.filter(e => e.keyCode === KeyCode.Enter || e.keyCode === KeyCode.Space) - .event(() => this.setExpanded(!this.isExpanded()), null, this.disposables); + this._register(onHeaderKeyDown.filter(e => e.keyCode === KeyCode.Enter || e.keyCode === KeyCode.Space) + .event(() => this.setExpanded(!this.isExpanded()), null)); - onHeaderKeyDown.filter(e => e.keyCode === KeyCode.LeftArrow) - .event(() => this.setExpanded(false), null, this.disposables); + this._register(onHeaderKeyDown.filter(e => e.keyCode === KeyCode.LeftArrow) + .event(() => this.setExpanded(false), null)); - onHeaderKeyDown.filter(e => e.keyCode === KeyCode.RightArrow) - .event(() => this.setExpanded(true), null, this.disposables); + this._register(onHeaderKeyDown.filter(e => e.keyCode === KeyCode.RightArrow) + .event(() => this.setExpanded(true), null)); - domEvent(this.header, 'click') - (() => this.setExpanded(!this.isExpanded()), null, this.disposables); + this._register(domEvent(this.header, 'click') + (() => this.setExpanded(!this.isExpanded()), null)); this.body = append(this.element, $('.panel-body')); this.renderBody(this.body); @@ -234,12 +233,6 @@ export abstract class Panel implements IView { protected abstract renderHeader(container: HTMLElement): void; protected abstract renderBody(container: HTMLElement): void; protected abstract layoutBody(height: number, width: number): void; - - dispose(): void { - this.disposables = dispose(this.disposables); - - this._onDidChange.dispose(); - } } interface IDndContext { diff --git a/src/vs/base/common/actions.ts b/src/vs/base/common/actions.ts index b0fea386d30..778a4e9f146 100644 --- a/src/vs/base/common/actions.ts +++ b/src/vs/base/common/actions.ts @@ -48,9 +48,9 @@ export interface IActionChangeEvent { radio?: boolean; } -export class Action implements IAction { +export class Action extends Disposable implements IAction { - protected _onDidChange = new Emitter(); + protected _onDidChange = this._register(new Emitter()); readonly onDidChange: Event = this._onDidChange.event; protected _id: string; @@ -63,6 +63,7 @@ export class Action implements IAction { protected _actionCallback?: (event?: any) => Promise; constructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: any) => Promise) { + super(); this._id = id; this._label = label; this._cssClass = cssClass; @@ -171,10 +172,6 @@ export class Action implements IAction { return Promise.resolve(true); } - - dispose() { - this._onDidChange.dispose(); - } } export interface IRunEvent { diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index 2f1c72b0e14..89b3ffe43d2 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -6,7 +6,7 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import * as errors from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; -import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; export function isThenable(obj: any): obj is Promise { @@ -497,13 +497,12 @@ export class ResourceQueue { } } -export class TimeoutTimer extends Disposable { +export class TimeoutTimer implements IDisposable { private _token: any; constructor(); constructor(runner: () => void, timeout: number); constructor(runner?: () => void, timeout?: number) { - super(); this._token = -1; if (typeof runner === 'function' && typeof timeout === 'number') { @@ -513,7 +512,6 @@ export class TimeoutTimer extends Disposable { dispose(): void { this.cancel(); - super.dispose(); } cancel(): void { @@ -543,18 +541,16 @@ export class TimeoutTimer extends Disposable { } } -export class IntervalTimer extends Disposable { +export class IntervalTimer implements IDisposable { private _token: any; constructor() { - super(); this._token = -1; } dispose(): void { this.cancel(); - super.dispose(); } cancel(): void { diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index 77883c9affb..1fa2adcf344 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -17,8 +17,7 @@ export interface Event { } export namespace Event { - const _disposable = { dispose() { } }; - export const None: Event = function () { return _disposable; }; + export const None: Event = () => Disposable.None; /** * Given an event, returns another event which only fires once. diff --git a/src/vs/base/common/lifecycle.ts b/src/vs/base/common/lifecycle.ts index 3f04b035888..8597d460998 100644 --- a/src/vs/base/common/lifecycle.ts +++ b/src/vs/base/common/lifecycle.ts @@ -5,6 +5,44 @@ import { once } from 'vs/base/common/functional'; +/** + * Enables logging of potentially leaked disposables. + * + * A disposable is considered leaked if it is not disposed or not registered as the child of + * another disposable. This tracking is very simple an only works for classes that either + * extend Disposable or use a DisposableStore. This means there are a lot of false positives. + */ +const TRACK_DISPOSABLES = false; + +const __is_disposable_tracked__ = '__is_disposable_tracked__'; + +function markTracked(x: T): void { + if (!TRACK_DISPOSABLES) { + return; + } + + if (x && x !== Disposable.None) { + try { + x[__is_disposable_tracked__] = true; + } catch { + // noop + } + } +} + +function trackDisposable(x: T): void { + if (!TRACK_DISPOSABLES) { + return; + } + + const stack = new Error().stack!; + setTimeout(() => { + if (!x[__is_disposable_tracked__]) { + console.log(stack); + } + }, 3000); +} + export interface IDisposable { dispose(): void; } @@ -15,31 +53,33 @@ export function isDisposable(thing: E): thing is E & IDisposab } export function dispose(disposable: T): T; -export function dispose(...disposables: Array): T[]; +export function dispose(disposable: T | undefined): T | undefined; export function dispose(disposables: T[]): T[]; -export function dispose(first: T | T[], ...rest: T[]): T | T[] | undefined { - if (Array.isArray(first)) { - first.forEach(d => d && d.dispose()); +export function dispose(disposables: T | T[] | undefined): T | T[] | undefined { + if (Array.isArray(disposables)) { + disposables.forEach(d => { + if (d) { + markTracked(d); + d.dispose(); + } + }); return []; - } else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; + } else if (disposables) { + markTracked(disposables); + disposables.dispose(); + return disposables; } else { - dispose(first); - dispose(rest); - return []; + return undefined; } } export function combinedDisposable(...disposables: IDisposable[]): IDisposable { + disposables.forEach(markTracked); return { dispose: () => dispose(disposables) }; } export function toDisposable(fn: () => void): IDisposable { - return { dispose() { fn(); } }; + return { dispose: fn }; } export class DisposableStore implements IDisposable { @@ -52,6 +92,7 @@ export class DisposableStore implements IDisposable { * Any future disposables added to this object will be disposed of on `add`. */ public dispose(): void { + markTracked(this); this._isDisposed = true; this.clear(); } @@ -65,6 +106,11 @@ export class DisposableStore implements IDisposable { } public add(t: T): T { + if (!t) { + return t; + } + + markTracked(t); if (this._isDisposed) { console.warn('Registering disposable on object that has already been disposed.'); t.dispose(); @@ -82,7 +128,13 @@ export abstract class Disposable implements IDisposable { private readonly _store = new DisposableStore(); + constructor() { + trackDisposable(this); + } + public dispose(): void { + markTracked(this); + this._store.dispose(); } diff --git a/src/vs/base/common/uri.ts b/src/vs/base/common/uri.ts index 966555e04d0..90a7537b3e7 100644 --- a/src/vs/base/common/uri.ts +++ b/src/vs/base/common/uri.ts @@ -96,6 +96,16 @@ const _empty = ''; const _slash = '/'; const _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +function _isQueryStringScheme(scheme: string) { + switch (scheme.toLowerCase()) { + case 'http': + case 'https': + case 'ftp': + return true; + } + return false; +} + /** * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. * This class is a simple parser which creates the basic component parts @@ -282,14 +292,14 @@ export class URI implements UriComponents { static parse(value: string, _strict: boolean = false): URI { const match = _regexp.exec(value); if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); + return new _URI(_empty, _empty, _empty, _empty, _empty, _strict); } return new _URI( match[2] || _empty, - decodeURIComponent(match[4] || _empty), - decodeURIComponent(match[5] || _empty), - decodeURIComponent(match[7] || _empty), - decodeURIComponent(match[9] || _empty), + decodeURIComponentFast(match[4] || _empty, false, false), + decodeURIComponentFast(match[5] || _empty, true, false), + decodeURIComponentFast(match[7] || _empty, false, _isQueryStringScheme(match[2])), + decodeURIComponentFast(match[9] || _empty, false, false), _strict ); } @@ -321,7 +331,7 @@ export class URI implements UriComponents { // normalize to fwd-slashes on windows, // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt + // filename character, e.g. /f\oo/ba\r.txt if (isWindows) { path = path.replace(/\\/g, _slash); } @@ -465,6 +475,84 @@ class _URI extends URI { } } +function isHex(value: string, pos: number): boolean { + if (pos >= value.length) { + return false; + } + const code = value.charCodeAt(pos); + return (code >= CharCode.Digit0 && code <= CharCode.Digit9)// 0-9 + || (code >= CharCode.a && code <= CharCode.f) //a-f + || (code >= CharCode.A && code <= CharCode.F); //A-F +} + + +function decodeURIComponentFast(uriComponent: string, isPath: boolean, isQueryString: boolean): string { + + let res: string | undefined; + let nativeDecodePos = -1; + + for (let pos = 0; pos < uriComponent.length; pos++) { + const code = uriComponent.charCodeAt(pos); + + // decoding needed + if (code === CharCode.PercentSign && isHex(uriComponent, pos + 1) && isHex(uriComponent, pos + 2)) { + + const chA = uriComponent.charCodeAt(pos + 1); + const chB = uriComponent.charCodeAt(pos + 2); + + // when in a path -> check and accept %2f and %2F (fwd slash) + // when in a query string -> check and accept %3D, %26, and %3B (equals, ampersand, semi-colon) + if ( + (isPath && chA === CharCode.Digit2 && (chB === CharCode.F || chB === CharCode.f)) + || + (isQueryString && ( + (chA === CharCode.Digit2 && chB === CharCode.Digit6) // %26 + || + (chA === CharCode.Digit3 && (chB === CharCode.B || chB === CharCode.b || chB === CharCode.D || chB === CharCode.d)) // %3D, %3D + )) + ) { + if (nativeDecodePos !== -1) { + res += decodeURIComponent(uriComponent.substring(nativeDecodePos, pos)); + nativeDecodePos = -1; + } + + if (res !== undefined) { + res += uriComponent.substr(pos, 3); + } + + pos += 2; + continue; + } + + if (res === undefined) { + res = uriComponent.substring(0, pos); + } + if (nativeDecodePos === -1) { + nativeDecodePos = pos; + } + + pos += 2; + + } else { + + if (nativeDecodePos !== -1) { + res += decodeURIComponent(uriComponent.substring(nativeDecodePos, pos)); + nativeDecodePos = -1; + } + + if (res !== undefined) { + res += String.fromCharCode(code); + } + } + } + + if (nativeDecodePos !== -1) { + res += decodeURIComponent(uriComponent.substr(nativeDecodePos)); + } + + return res !== undefined ? res : uriComponent; +} + // reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 const encodeTable: { [ch: number]: string } = { [CharCode.Colon]: '%3A', // gen-delims @@ -490,7 +578,7 @@ const encodeTable: { [ch: number]: string } = { [CharCode.Space]: '%20', }; -function encodeURIComponentFast(uriComponent: string, allowSlash: boolean): string { +function encodeURIComponentFast(uriComponent: string, isPath: boolean, isQueryString: boolean): string { let res: string | undefined = undefined; let nativeEncodePos = -1; @@ -506,7 +594,8 @@ function encodeURIComponentFast(uriComponent: string, allowSlash: boolean): stri || code === CharCode.Period || code === CharCode.Underline || code === CharCode.Tilde - || (allowSlash && code === CharCode.Slash) + || (isPath && code === CharCode.Slash) // path => allow slash AS-IS + || (isQueryString && (code === CharCode.Equals || code === CharCode.Ampersand || code === CharCode.Semicolon)) // query string => allow &=; ) { // check if we are delaying native encode if (nativeEncodePos !== -1) { @@ -518,6 +607,20 @@ function encodeURIComponentFast(uriComponent: string, allowSlash: boolean): stri res += uriComponent.charAt(pos); } + } else if (code === CharCode.PercentSign && isHex(uriComponent, pos + 1) && isHex(uriComponent, pos + 2)) { + // at percentage encoded value + + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.substr(pos, 3); + } + pos += 2; + } else { // encoding needed, we need to allocate a new string if (res === undefined) { @@ -606,6 +709,7 @@ function _asFormatted(uri: URI, skipEncoding: boolean): string { let res = ''; let { scheme, authority, path, query, fragment } = uri; + if (scheme) { res += scheme; res += ':'; @@ -622,22 +726,22 @@ function _asFormatted(uri: URI, skipEncoding: boolean): string { authority = authority.substr(idx + 1); idx = userinfo.indexOf(':'); if (idx === -1) { - res += encoder(userinfo, false); + res += encoder(userinfo, false, false); } else { // :@ - res += encoder(userinfo.substr(0, idx), false); + res += encoder(userinfo.substr(0, idx), false, false); res += ':'; - res += encoder(userinfo.substr(idx + 1), false); + res += encoder(userinfo.substr(idx + 1), false, false); } res += '@'; } authority = authority.toLowerCase(); idx = authority.indexOf(':'); if (idx === -1) { - res += encoder(authority, false); + res += encoder(authority, false, false); } else { // : - res += encoder(authority.substr(0, idx), false); + res += encoder(authority.substr(0, idx), false, false); res += authority.substr(idx); } } @@ -655,15 +759,15 @@ function _asFormatted(uri: URI, skipEncoding: boolean): string { } } // encode the rest of the path - res += encoder(path, true); + res += encoder(path, true, false); } if (query) { res += '?'; - res += encoder(query, false); + res += encoder(query, false, _isQueryStringScheme(scheme)); } if (fragment) { res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment; } return res; } diff --git a/src/vs/base/node/config.ts b/src/vs/base/node/config.ts index fe8d7538d85..4e12fd565ea 100644 --- a/src/vs/base/node/config.ts +++ b/src/vs/base/node/config.ts @@ -6,7 +6,7 @@ import * as fs from 'fs'; import { dirname } from 'vs/base/common/path'; import * as objects from 'vs/base/common/objects'; -import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { Event, Emitter } from 'vs/base/common/event'; import * as json from 'vs/base/common/json'; import { statLink } from 'vs/base/node/pfs'; @@ -41,18 +41,17 @@ export interface IConfigOptions { * - delayed processing of changes to accomodate for lots of changes * - configurable defaults */ -export class ConfigWatcher implements IConfigWatcher, IDisposable { +export class ConfigWatcher extends Disposable implements IConfigWatcher { private cache: T; private parseErrors: json.ParseError[]; private disposed: boolean; private loaded: boolean; private timeoutHandle: NodeJS.Timer | null; - private readonly disposables = new DisposableStore(); private readonly _onDidUpdateConfiguration: Emitter>; constructor(private _path: string, private options: IConfigOptions = { defaultConfig: Object.create(null), onError: error => console.error(error) }) { - this._onDidUpdateConfiguration = new Emitter>(); - this.disposables.add(this._onDidUpdateConfiguration); + super(); + this._onDidUpdateConfiguration = this._register(new Emitter>()); this.registerWatcher(); this.initAsync(); @@ -123,7 +122,7 @@ export class ConfigWatcher implements IConfigWatcher, IDisposable { this.watch(parentFolder, true); // Check if the path is a symlink and watch its target if so - this.handleSymbolicLink().then(undefined, error => { /* ignore error */ }); + this.handleSymbolicLink().then(undefined, () => { /* ignore error */ }); } private async handleSymbolicLink(): Promise { @@ -141,9 +140,9 @@ export class ConfigWatcher implements IConfigWatcher, IDisposable { } if (isFolder) { - this.disposables.add(watchFolder(path, (type, path) => path === this._path ? this.onConfigFileChange() : undefined, error => this.options.onError(error))); + this._register(watchFolder(path, (type, path) => path === this._path ? this.onConfigFileChange() : undefined, error => this.options.onError(error))); } else { - this.disposables.add(watchFile(path, (type, path) => this.onConfigFileChange(), error => this.options.onError(error))); + this._register(watchFile(path, () => this.onConfigFileChange(), error => this.options.onError(error))); } } @@ -185,6 +184,6 @@ export class ConfigWatcher implements IConfigWatcher, IDisposable { dispose(): void { this.disposed = true; - this.disposables.dispose(); + super.dispose(); } } \ No newline at end of file diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index df8690d0011..5bee9f9eced 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -5,6 +5,7 @@ import * as path from 'vs/base/common/path'; import * as fs from 'fs'; +import { promisify } from 'util'; import * as cp from 'child_process'; import * as nls from 'vs/nls'; import * as Types from 'vs/base/common/types'; @@ -404,7 +405,7 @@ export function createQueuedSender(childProcess: cp.ChildProcess): IQueuedSender } export namespace win32 { - export function findExecutable(command: string, cwd?: string, paths?: string[]): string { + export async function findExecutable(command: string, cwd?: string, paths?: string[]): Promise { // If we have an absolute path then we take it. if (path.isAbsolute(command)) { return command; @@ -435,15 +436,15 @@ export namespace win32 { } else { fullPath = path.join(cwd, pathEntry, command); } - if (fs.existsSync(fullPath)) { + if (await promisify(fs.exists)(fullPath)) { return fullPath; } let withExtension = fullPath + '.com'; - if (fs.existsSync(withExtension)) { + if (await promisify(fs.exists)(withExtension)) { return withExtension; } withExtension = fullPath + '.exe'; - if (fs.existsSync(withExtension)) { + if (await promisify(fs.exists)(withExtension)) { return withExtension; } } diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index 970e05e7579..3d75631a62e 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -231,7 +231,7 @@ export interface IDataSource { * * You should not attempt to "move" an element to a different * parent by keeping its ID. The idea here is to have tree location - * related IDs (eg. full file path, in the Explorer example). + * related IDs (e.g. full file path, in the Explorer example). */ getId(tree: ITree, element: any): string; diff --git a/src/vs/base/test/browser/hash.test.ts b/src/vs/base/test/browser/hash.test.ts deleted file mode 100644 index adbedc411f1..00000000000 --- a/src/vs/base/test/browser/hash.test.ts +++ /dev/null @@ -1,16 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import { createSHA1 } from 'vs/base/browser/hash'; - -suite('Hash', () => { - test('computeSHA1Hash', async () => { - assert.equal(await createSHA1(''), 'da39a3ee5e6b4b0d3255bfef95601890afd80709'); - assert.equal(await createSHA1('hello world'), '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'); - assert.equal(await createSHA1('da39a3ee5e6b4b0d3255bfef95601890afd80709'), '10a34637ad661d98ba3344717656fcc76209c2f8'); - assert.equal(await createSHA1('2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'), 'd6b0d82cea4269b51572b8fab43adcee9fc3cf9a'); - assert.equal(await createSHA1('öäü_?ß()<>ÖÄÜ'), 'b64beaeff9e317b0193c8e40a2431b210388eba9'); - }); -}); \ No newline at end of file diff --git a/src/vs/base/test/common/lifecycle.test.ts b/src/vs/base/test/common/lifecycle.test.ts index 29e93e64a41..46d8a254b5b 100644 --- a/src/vs/base/test/common/lifecycle.test.ts +++ b/src/vs/base/test/common/lifecycle.test.ts @@ -42,7 +42,8 @@ suite('Lifecycle', () => { assert(!disposable.isDisposed); assert(!disposable2.isDisposed); - dispose(disposable, disposable2); + dispose(disposable); + dispose(disposable2); assert(disposable.isDisposed); assert(disposable2.isDisposed); diff --git a/src/vs/base/test/common/uri.test.ts b/src/vs/base/test/common/uri.test.ts index 85f2ad691ac..a4495718fcf 100644 --- a/src/vs/base/test/common/uri.test.ts +++ b/src/vs/base/test/common/uri.test.ts @@ -63,7 +63,7 @@ suite('URI', () => { assert.equal(URI.from({ scheme: 'http', authority: '', path: 'my/path' }).toString(), 'http:/my/path'); assert.equal(URI.from({ scheme: 'http', authority: '', path: '/my/path' }).toString(), 'http:/my/path'); //http://a-test-site.com/#test=true - assert.equal(URI.from({ scheme: 'http', authority: 'a-test-site.com', path: '/', query: 'test=true' }).toString(), 'http://a-test-site.com/?test%3Dtrue'); + assert.equal(URI.from({ scheme: 'http', authority: 'a-test-site.com', path: '/', query: 'test=true' }).toString(), 'http://a-test-site.com/?test=true'); assert.equal(URI.from({ scheme: 'http', authority: 'a-test-site.com', path: '/', query: '', fragment: 'test=true' }).toString(), 'http://a-test-site.com/#test%3Dtrue'); }); @@ -102,11 +102,11 @@ suite('URI', () => { test('with, changes', () => { assert.equal(URI.parse('before:some/file/path').with({ scheme: 'after' }).toString(), 'after:some/file/path'); - assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'http', path: '/api/files/test.me', query: 't=1234' }).toString(), 'http:/api/files/test.me?t%3D1234'); - assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'http', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'http:/api/files/test.me?t%3D1234'); - assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'https', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'https:/api/files/test.me?t%3D1234'); - assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'HTTP', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'HTTP:/api/files/test.me?t%3D1234'); - assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'HTTPS', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'HTTPS:/api/files/test.me?t%3D1234'); + assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'http', path: '/api/files/test.me', query: 't=1234' }).toString(), 'http:/api/files/test.me?t=1234'); + assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'http', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'http:/api/files/test.me?t=1234'); + assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'https', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'https:/api/files/test.me?t=1234'); + assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'HTTP', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'HTTP:/api/files/test.me?t=1234'); + assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'HTTPS', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'HTTPS:/api/files/test.me?t=1234'); assert.equal(URI.from({ scheme: 's' }).with({ scheme: 'boo', authority: '', path: '/api/files/test.me', query: 't=1234', fragment: '' }).toString(), 'boo:/api/files/test.me?t%3D1234'); }); @@ -262,11 +262,11 @@ suite('URI', () => { value = URI.file('c:\\test with %25\\path'); assert.equal(value.path, '/c:/test with %25/path'); - assert.equal(value.toString(), 'file:///c%3A/test%20with%20%2525/path'); + assert.equal(value.toString(), 'file:///c%3A/test%20with%20%25/path'); value = URI.file('c:\\test with %25\\c#code'); assert.equal(value.path, '/c:/test with %25/c#code'); - assert.equal(value.toString(), 'file:///c%3A/test%20with%20%2525/c%23code'); + assert.equal(value.toString(), 'file:///c%3A/test%20with%20%25/c%23code'); value = URI.file('\\\\shares'); assert.equal(value.scheme, 'file'); @@ -376,7 +376,7 @@ suite('URI', () => { let uri = URI.parse('https://go.microsoft.com/fwlink/?LinkId=518008'); assert.equal(uri.query, 'LinkId=518008'); assert.equal(uri.toString(true), 'https://go.microsoft.com/fwlink/?LinkId=518008'); - assert.equal(uri.toString(), 'https://go.microsoft.com/fwlink/?LinkId%3D518008'); + assert.equal(uri.toString(), 'https://go.microsoft.com/fwlink/?LinkId=518008'); let uri2 = URI.parse(uri.toString()); assert.equal(uri2.query, 'LinkId=518008'); @@ -385,7 +385,7 @@ suite('URI', () => { uri = URI.parse('https://go.microsoft.com/fwlink/?LinkId=518008&foö&ké¥=üü'); assert.equal(uri.query, 'LinkId=518008&foö&ké¥=üü'); assert.equal(uri.toString(true), 'https://go.microsoft.com/fwlink/?LinkId=518008&foö&ké¥=üü'); - assert.equal(uri.toString(), 'https://go.microsoft.com/fwlink/?LinkId%3D518008%26fo%C3%B6%26k%C3%A9%C2%A5%3D%C3%BC%C3%BC'); + assert.equal(uri.toString(), 'https://go.microsoft.com/fwlink/?LinkId=518008&fo%C3%B6&k%C3%A9%C2%A5=%C3%BC%C3%BC'); uri2 = URI.parse(uri.toString()); assert.equal(uri2.query, 'LinkId=518008&foö&ké¥=üü'); @@ -426,6 +426,57 @@ suite('URI', () => { assert.equal(uri.toString(true), input); }); + test('Support URL specific encodings (query component) #25852', function () { + let input = 'http://example.com/over/there?name=ferret'; + assert.equal(input, URI.parse(input).toString()); + + input = 'http://example.com/over/there?name=ferret&foo=bar'; + assert.equal(input, URI.parse(input).toString()); + + input = 'attp://example.com/over/there?name=ferret'; + assert.equal('attp://example.com/over/there?name%3Dferret', URI.parse(input).toString()); + }); + + test('Uri#parse can break path-component #45515', function () { + let uri: URI; + uri = URI.from({ scheme: 's', authority: 'a', path: '/o%2f' }); + assert.equal(uri.toString(), 's://a/o%2f'); + uri = URI.from({ scheme: 's', authority: 'a', path: '/o%2fü' }); + assert.equal(uri.toString(), 's://a/o%2f%C3%BC'); + uri = URI.from({ scheme: 's', authority: 'a', path: '/o%2f%' }); + assert.equal(uri.toString(), 's://a/o%2f%25'); + + uri = URI.file('/test with %25/c#code'); + assert.equal(uri.path, '/test with %25/c#code'); + assert.equal(uri.toString(), 'file:///test%20with%20%25/c%23code'); + + uri = URI.from({ + scheme: 'http', + authority: 'a', + path: '/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg' + }); + assert.equal(uri.path, '/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg'); + assert.equal(uri.toString(), 'http://a/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg'); + + assert.equal(URI.parse(uri.toString()).path, '/o/products%2FzVNZkudXJyq8bPGTXUxx%2FBetterave-Sesame.jpg'); + assert.equal(uri.toString(), URI.parse(uri.toString()).toString()); // identity + + uri = URI.parse('s://a/p%2ft%c3%bc'); + assert.equal(uri.path, '/p%2ftü'); + + uri = URI.parse('s://a/%c3%bcp%2f-REST'); + assert.equal(uri.path, '/üp%2f-REST'); + + uri = URI.parse('s://a/%c3%bcp%2fd%c3%b6wn'); + assert.equal(uri.path, '/üp%2fdöwn'); + + //https://github.com/microsoft/vscode/issues/25852 + uri = URI.parse('http://www.test.com/path/service?authId=CN%3DQ10'); + assert.equal(uri.query, 'authId=CN%3DQ10'); + assert.equal(uri.toString(), 'http://www.test.com/path/service?authId=CN%3DQ10'); + }); + + test('URI - (de)serialize', function () { const values = [ diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index 419048741e7..3fe41495fab 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -79,7 +79,7 @@ class MainProcessService implements IMainProcessService { } } -function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): void { +async function main(server: Server, initData: ISharedProcessInitData, configuration: ISharedProcessConfiguration): Promise { const services = new ServiceCollection(); const disposables: IDisposable[] = []; @@ -96,12 +96,15 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I const logLevelClient = new LogLevelSetterChannelClient(server.getChannel('loglevel', mainRouter)); const logService = new FollowerLogService(logLevelClient, new SpdLogService('sharedprocess', environmentService.logsPath, initData.logLevel)); disposables.push(logService); - logService.info('main', JSON.stringify(configuration)); + const configurationService = new ConfigurationService(environmentService.appSettingsPath); + disposables.push(configurationService); + await configurationService.initialize(); + services.set(IEnvironmentService, environmentService); services.set(ILogService, logService); - services.set(IConfigurationService, new SyncDescriptor(ConfigurationService, [environmentService.appSettingsPath])); + services.set(IConfigurationService, configurationService); services.set(IRequestService, new SyncDescriptor(RequestService)); services.set(IDownloadService, new SyncDescriptor(DownloadService)); @@ -218,6 +221,6 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise ignore stored colors and layouts + // high contrast mode has been turned on from the outside, e.g. OS -> ignore stored colors and layouts if (data && configuration.highContrast && data.baseTheme !== 'hc-black') { data = undefined; } diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 240dd189202..47020bc4b0b 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -37,7 +37,6 @@ import product from 'vs/platform/product/node/product'; import pkg from 'vs/platform/product/node/package'; import { ProxyAuthHandler } from 'vs/code/electron-main/auth'; import { Disposable } from 'vs/base/common/lifecycle'; -import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { IWindowsMainService, ICodeWindow } from 'vs/platform/windows/electron-main/windows'; import { IHistoryMainService } from 'vs/platform/history/common/history'; import { withUndefinedAsNull } from 'vs/base/common/types'; @@ -98,7 +97,7 @@ export class CodeApplication extends Disposable { @ILogService private readonly logService: ILogService, @IEnvironmentService private readonly environmentService: IEnvironmentService, @ILifecycleService private readonly lifecycleService: ILifecycleService, - @IConfigurationService private readonly configurationService: ConfigurationService, + @IConfigurationService private readonly configurationService: IConfigurationService, @IStateService private readonly stateService: IStateService ) { super(); @@ -232,7 +231,7 @@ export class CodeApplication extends Disposable { const webContents = event.sender; try { - const shellEnv = await getShellEnvironment(this.logService); + const shellEnv = await getShellEnvironment(this.logService, this.environmentService); if (!webContents.isDestroyed()) { webContents.send('vscode:acceptShellEnv', shellEnv); } @@ -341,7 +340,7 @@ export class CodeApplication extends Disposable { const sharedProcessClient = sharedProcess.whenReady().then(() => connect(this.environmentService.sharedIPCHandle, 'main')); this.lifecycleService.when(LifecycleMainPhase.AfterWindowOpen).then(() => { this._register(new RunOnceScheduler(async () => { - const userEnv = await getShellEnvironment(this.logService); + const userEnv = await getShellEnvironment(this.logService, this.environmentService); sharedProcess.spawn(userEnv); }, 3000)).schedule(); diff --git a/src/vs/code/electron-main/auth.ts b/src/vs/code/electron-main/auth.ts index ed92533c32f..d6023519555 100644 --- a/src/vs/code/electron-main/auth.ts +++ b/src/vs/code/electron-main/auth.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; import { Event } from 'vs/base/common/event'; import { BrowserWindow, app } from 'electron'; @@ -22,18 +22,18 @@ type Credentials = { password: string; }; -export class ProxyAuthHandler { +export class ProxyAuthHandler extends Disposable { _serviceBrand: any; private retryCount = 0; - private disposables: IDisposable[] = []; constructor( @IWindowsMainService private readonly windowsMainService: IWindowsMainService ) { + super(); const onLogin = Event.fromNodeEventEmitter(app, 'login', (event, webContents, req, authInfo, cb) => ({ event, webContents, req, authInfo, cb })); - onLogin(this.onLogin, this, this.disposables); + this._register(onLogin(this.onLogin, this)); } private onLogin({ event, authInfo, cb }: LoginEvent): void { @@ -85,8 +85,4 @@ export class ProxyAuthHandler { win.close(); }); } - - dispose(): void { - this.disposables = dispose(this.disposables); - } } \ No newline at end of file diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 12d0c606893..e572f989fbc 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -97,10 +97,11 @@ class CodeMain { // Init services await instantiationService.invokeFunction(async accessor => { const environmentService = accessor.get(IEnvironmentService); + const configurationService = accessor.get(IConfigurationService); const stateService = accessor.get(IStateService); try { - await this.initServices(environmentService, stateService as StateService); + await this.initServices(environmentService, configurationService as ConfigurationService, stateService as StateService); } catch (error) { // Show a dialog for errors that can be resolved by the user @@ -140,9 +141,9 @@ class CodeMain { process.once('exit', () => logService.dispose()); services.set(ILogService, logService); + services.set(IConfigurationService, new ConfigurationService(environmentService.appSettingsPath)); services.set(ILifecycleService, new SyncDescriptor(LifecycleService)); services.set(IStateService, new SyncDescriptor(StateService)); - services.set(IConfigurationService, new SyncDescriptor(ConfigurationService, [environmentService.appSettingsPath])); services.set(IRequestService, new SyncDescriptor(RequestService)); services.set(IDiagnosticsService, new SyncDescriptor(DiagnosticsService)); services.set(IThemeMainService, new SyncDescriptor(ThemeMainService)); @@ -150,7 +151,7 @@ class CodeMain { return [new InstantiationService(services, true), instanceEnvironment]; } - private initServices(environmentService: IEnvironmentService, stateService: StateService): Promise { + private initServices(environmentService: IEnvironmentService, configurationService: ConfigurationService, stateService: StateService): Promise { // Environment service (paths) const environmentServiceInitialization = Promise.all([ @@ -162,10 +163,13 @@ class CodeMain { environmentService.backupHome ].map((path): undefined | Promise => path ? mkdirp(path) : undefined)); + // Configuration service + const configurationServiceInitialization = configurationService.initialize(); + // State service const stateServiceInitialization = stateService.init(); - return Promise.all([environmentServiceInitialization, stateServiceInitialization]); + return Promise.all([environmentServiceInitialization, configurationServiceInitialization, stateServiceInitialization]); } private patchEnvironment(environmentService: IEnvironmentService): typeof process.env { diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index b7446dc4074..1087d110e84 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -39,6 +39,7 @@ import { getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; import { restoreWindowsState, WindowsStateStorageData, getWindowsStateStoreData } from 'vs/code/electron-main/windowsStateStorage'; import { getWorkspaceIdentifier } from 'vs/platform/workspaces/electron-main/workspacesMainService'; import { once } from 'vs/base/common/functional'; +import { Disposable } from 'vs/base/common/lifecycle'; const enum WindowError { UNRESPONSIVE = 1, @@ -154,7 +155,7 @@ interface IWorkspacePathToOpen { label?: string; } -export class WindowsManager implements IWindowsMainService { +export class WindowsManager extends Disposable implements IWindowsMainService { _serviceBrand: any; @@ -168,16 +169,16 @@ export class WindowsManager implements IWindowsMainService { private readonly dialogs: Dialogs; private readonly workspacesManager: WorkspacesManager; - private _onWindowReady = new Emitter(); + private readonly _onWindowReady = this._register(new Emitter()); readonly onWindowReady: CommonEvent = this._onWindowReady.event; - private _onWindowClose = new Emitter(); + private readonly _onWindowClose = this._register(new Emitter()); readonly onWindowClose: CommonEvent = this._onWindowClose.event; - private _onWindowLoad = new Emitter(); + private readonly _onWindowLoad = this._register(new Emitter()); readonly onWindowLoad: CommonEvent = this._onWindowLoad.event; - private _onWindowsCountChanged = new Emitter(); + private readonly _onWindowsCountChanged = this._register(new Emitter()); readonly onWindowsCountChanged: CommonEvent = this._onWindowsCountChanged.event; constructor( @@ -194,6 +195,7 @@ export class WindowsManager implements IWindowsMainService { @IWorkspacesMainService private readonly workspacesMainService: IWorkspacesMainService, @IInstantiationService private readonly instantiationService: IInstantiationService ) { + super(); const windowsStateStoreData = this.stateService.getItem(WindowsManager.windowsStateStorageKey); this.windowsState = restoreWindowsState(windowsStateStoreData); diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index f5116c42827..d9255fca3be 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -44,7 +44,7 @@ import { SpdLogService } from 'vs/platform/log/node/spdlogService'; const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id); const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id); -const useId = localize('useId', "Make sure you use the full extension ID, including the publisher, eg: {0}", 'ms-vscode.csharp'); +const useId = localize('useId', "Make sure you use the full extension ID, including the publisher, e.g.: {0}", 'ms-vscode.csharp'); function getId(manifest: IExtensionManifest, withVersion?: boolean): string { if (withVersion) { @@ -275,17 +275,22 @@ export class Main { const eventPrefix = 'monacoworkbench'; -export function main(argv: ParsedArgs): Promise { +export async function main(argv: ParsedArgs): Promise { const services = new ServiceCollection(); const environmentService = new EnvironmentService(argv, process.execPath); const logService: ILogService = new SpdLogService('cli', environmentService.logsPath, getLogLevel(environmentService)); process.once('exit', () => logService.dispose()); - logService.info('main', argv); + await Promise.all([environmentService.appSettingsHome, environmentService.extensionsPath].map(p => mkdirp(p))); + + const configurationService = new ConfigurationService(environmentService.appSettingsPath); + await configurationService.initialize(); + services.set(IEnvironmentService, environmentService); services.set(ILogService, logService); + services.set(IConfigurationService, configurationService); services.set(IStateService, new SyncDescriptor(StateService)); const instantiationService: IInstantiationService = new InstantiationService(services); @@ -294,40 +299,37 @@ export function main(argv: ParsedArgs): Promise { const envService = accessor.get(IEnvironmentService); const stateService = accessor.get(IStateService); - return Promise.all([envService.appSettingsHome, envService.extensionsPath].map(p => mkdirp(p))).then(() => { - const { appRoot, extensionsPath, extensionDevelopmentLocationURI: extensionDevelopmentLocationURI, isBuilt, installSourcePath } = envService; + const { appRoot, extensionsPath, extensionDevelopmentLocationURI: extensionDevelopmentLocationURI, isBuilt, installSourcePath } = envService; - const services = new ServiceCollection(); - services.set(IConfigurationService, new SyncDescriptor(ConfigurationService, [environmentService.appSettingsPath])); - services.set(IRequestService, new SyncDescriptor(RequestService)); - services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService)); - services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService)); + const services = new ServiceCollection(); + services.set(IRequestService, new SyncDescriptor(RequestService)); + services.set(IExtensionManagementService, new SyncDescriptor(ExtensionManagementService)); + services.set(IExtensionGalleryService, new SyncDescriptor(ExtensionGalleryService)); - const appenders: AppInsightsAppender[] = []; - if (isBuilt && !extensionDevelopmentLocationURI && !envService.args['disable-telemetry'] && product.enableTelemetry) { + const appenders: AppInsightsAppender[] = []; + if (isBuilt && !extensionDevelopmentLocationURI && !envService.args['disable-telemetry'] && product.enableTelemetry) { - if (product.aiConfig && product.aiConfig.asimovKey) { - appenders.push(new AppInsightsAppender(eventPrefix, null, product.aiConfig.asimovKey, logService)); - } - - const config: ITelemetryServiceConfig = { - appender: combinedAppender(...appenders), - commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), installSourcePath), - piiPaths: [appRoot, extensionsPath] - }; - - services.set(ITelemetryService, new SyncDescriptor(TelemetryService, [config])); - } else { - services.set(ITelemetryService, NullTelemetryService); + if (product.aiConfig && product.aiConfig.asimovKey) { + appenders.push(new AppInsightsAppender(eventPrefix, null, product.aiConfig.asimovKey, logService)); } - const instantiationService2 = instantiationService.createChild(services); - const main = instantiationService2.createInstance(Main); + const config: ITelemetryServiceConfig = { + appender: combinedAppender(...appenders), + commonProperties: resolveCommonProperties(product.commit, pkg.version, stateService.getItem('telemetry.machineId'), installSourcePath), + piiPaths: [appRoot, extensionsPath] + }; - return main.run(argv).then(() => { - // Dispose the AI adapter so that remaining data gets flushed. - return combinedAppender(...appenders).dispose(); - }); + services.set(ITelemetryService, new SyncDescriptor(TelemetryService, [config])); + } else { + services.set(ITelemetryService, NullTelemetryService); + } + + const instantiationService2 = instantiationService.createChild(services); + const main = instantiationService2.createInstance(Main); + + return main.run(argv).then(() => { + // Dispose the AI adapter so that remaining data gets flushed. + return combinedAppender(...appenders).dispose(); }); }); } \ No newline at end of file diff --git a/src/vs/code/node/shellEnv.ts b/src/vs/code/node/shellEnv.ts index baabaf7b959..eea6922afbe 100644 --- a/src/vs/code/node/shellEnv.ts +++ b/src/vs/code/node/shellEnv.ts @@ -8,6 +8,7 @@ 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'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; function getUnixShellEnvironment(logService: ILogService): Promise { const promise = new Promise((resolve, reject) => { @@ -89,9 +90,12 @@ let _shellEnv: Promise; * This should only be done when Code itself is not launched * from within a shell. */ -export function getShellEnvironment(logService: ILogService): Promise { +export function getShellEnvironment(logService: ILogService, environmentService: IEnvironmentService): Promise { if (_shellEnv === undefined) { - if (isWindows) { + if (environmentService.args['disable-user-env-probe']) { + logService.trace('getShellEnvironment: disable-user-env-probe set, skipping'); + _shellEnv = Promise.resolve({}); + } else if (isWindows) { logService.trace('getShellEnvironment: runing on windows, skipping'); _shellEnv = Promise.resolve({}); } else if (process.env['VSCODE_CLI'] === '1') { diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index b6240b274a1..41afb8404aa 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -132,7 +132,7 @@ export class View extends ViewEventHandler { this._setLayout(); // Pointer handler - this.pointerHandler = new PointerHandler(this._context, viewController, this.createPointerHandlerHelper()); + this.pointerHandler = this._register(new PointerHandler(this._context, viewController, this.createPointerHandlerHelper())); this._register(model.addEventListener((events: viewEvents.ViewEvent[]) => { this.eventDispatcher.emitMany(events); @@ -342,8 +342,6 @@ export class View extends ViewEventHandler { this.eventDispatcher.removeEventHandler(this); this.outgoingEvents.dispose(); - this.pointerHandler.dispose(); - this.viewLines.dispose(); // Destroy view parts diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index adaf6b71bcf..0cd342d195c 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -38,7 +38,8 @@ import { ClassName } from 'vs/editor/common/model/intervalTree'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/model/textModelEvents'; import * as modes from 'vs/editor/common/modes'; -import { editorErrorBorder, editorErrorForeground, editorHintBorder, editorHintForeground, editorInfoBorder, editorInfoForeground, editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity, editorWarningBorder, editorWarningForeground } from 'vs/editor/common/view/editorColorRegistry'; +import { editorUnnecessaryCodeBorder, editorUnnecessaryCodeOpacity } from 'vs/editor/common/view/editorColorRegistry'; +import { editorErrorBorder, editorErrorForeground, editorHintBorder, editorHintForeground, editorInfoBorder, editorInfoForeground, editorWarningBorder, editorWarningForeground } from 'vs/platform/theme/common/colorRegistry'; import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; diff --git a/src/vs/editor/browser/widget/diffNavigator.ts b/src/vs/editor/browser/widget/diffNavigator.ts index 29afe7ec63e..1c941ed0fac 100644 --- a/src/vs/editor/browser/widget/diffNavigator.ts +++ b/src/vs/editor/browser/widget/diffNavigator.ts @@ -5,7 +5,7 @@ import * as assert from 'vs/base/common/assert'; import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import * as objects from 'vs/base/common/objects'; import { IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; @@ -33,12 +33,11 @@ const defaultOptions: Options = { /** * Create a new diff navigator for the provided diff editor. */ -export class DiffNavigator { +export class DiffNavigator extends Disposable { private readonly _editor: IDiffEditor; private readonly _options: Options; - private readonly _disposables: IDisposable[]; - private readonly _onDidUpdate = new Emitter(); + private readonly _onDidUpdate = this._register(new Emitter()); readonly onDidUpdate: Event = this._onDidUpdate.event; @@ -49,11 +48,11 @@ export class DiffNavigator { private ignoreSelectionChange: boolean; constructor(editor: IDiffEditor, options: Options = {}) { + super(); this._editor = editor; this._options = objects.mixin(options, defaultOptions, false); this.disposed = false; - this._disposables = []; this.nextIdx = -1; this.ranges = []; @@ -61,11 +60,11 @@ export class DiffNavigator { this.revealFirst = Boolean(this._options.alwaysRevealFirst); // hook up to diff editor for diff, disposal, and caret move - this._disposables.push(this._editor.onDidDispose(() => this.dispose())); - this._disposables.push(this._editor.onDidUpdateDiff(() => this._onDiffUpdated())); + this._register(this._editor.onDidDispose(() => this.dispose())); + this._register(this._editor.onDidUpdateDiff(() => this._onDiffUpdated())); if (this._options.followsCaret) { - this._disposables.push(this._editor.getModifiedEditor().onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { + this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => { if (this.ignoreSelectionChange) { return; } @@ -73,7 +72,7 @@ export class DiffNavigator { })); } if (this._options.alwaysRevealFirst) { - this._disposables.push(this._editor.getModifiedEditor().onDidChangeModel((e) => { + this._register(this._editor.getModifiedEditor().onDidChangeModel((e) => { this.revealFirst = true; })); } @@ -216,9 +215,7 @@ export class DiffNavigator { } dispose(): void { - dispose(this._disposables); - this._disposables.length = 0; - this._onDidUpdate.dispose(); + super.dispose(); this.ranges = []; this.disposed = true; } diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index aea28ac2161..ed6e0782e9f 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -1461,15 +1461,21 @@ export interface IWebviewPanelOptions { readonly retainContextWhenHidden?: boolean; } -export interface ICodeLensSymbol { +export interface CodeLens { range: IRange; id?: string; command?: Command; } + +export interface CodeLensList { + lenses: CodeLens[]; + dispose(): void; +} + export interface CodeLensProvider { onDidChange?: Event; - provideCodeLenses(model: model.ITextModel, token: CancellationToken): ProviderResult; - resolveCodeLens?(model: model.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ProviderResult; + provideCodeLenses(model: model.ITextModel, token: CancellationToken): ProviderResult; + resolveCodeLens?(model: model.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } // --- feature registries ------ diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index 27ccaf58e6b..2ee2b7c8831 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { Color, RGBA } from 'vs/base/common/color'; -import { activeContrastBorder, editorBackground, editorForeground, registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { activeContrastBorder, editorBackground, editorForeground, registerColor, editorWarningForeground, editorInfoForeground, editorWarningBorder, editorInfoBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; /** @@ -37,26 +37,14 @@ export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.bord export const editorGutter = registerColor('editorGutter.background', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.')); -export const editorErrorForeground = registerColor('editorError.foreground', { dark: '#ea4646', light: '#d60a0a', hc: null }, nls.localize('errorForeground', 'Foreground color of error squigglies in the editor.')); -export const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hc: Color.fromHex('#E47777').transparent(0.8) }, nls.localize('errorBorder', 'Border color of error squigglies in the editor.')); - -export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#4d9e4d', light: '#117711', hc: null }, nls.localize('warningForeground', 'Foreground color of warning squigglies in the editor.')); -export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning squigglies in the editor.')); - -export const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('infoForeground', 'Foreground color of info squigglies in the editor.')); -export const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info squigglies in the editor.')); - -export const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, nls.localize('hintForeground', 'Foreground color of hint squigglies in the editor.')); -export const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hc: Color.fromHex('#eeeeee').transparent(0.8) }, nls.localize('hintBorder', 'Border color of hint squigglies in the editor.')); - export const editorUnnecessaryCodeBorder = registerColor('editorUnnecessaryCode.border', { dark: null, light: null, hc: Color.fromHex('#fff').transparent(0.8) }, nls.localize('unnecessaryCodeBorder', 'Border color of unnecessary (unused) source code in the editor.')); export const editorUnnecessaryCodeOpacity = registerColor('editorUnnecessaryCode.opacity', { dark: Color.fromHex('#000a'), light: Color.fromHex('#0007'), hc: null }, nls.localize('unnecessaryCodeOpacity', 'Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the \'editorUnnecessaryCode.border\' theme color to underline unnecessary code instead of fading it out.')); const rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6)); export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hc: rulerRangeDefault }, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations.'), true); export const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('overviewRuleError', 'Overview ruler marker color for errors.')); -export const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: new Color(new RGBA(18, 136, 18, 0.7)), light: new Color(new RGBA(18, 136, 18, 0.7)), hc: new Color(new RGBA(50, 255, 50, 1)) }, nls.localize('overviewRuleWarning', 'Overview ruler marker color for warnings.')); -export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: new Color(new RGBA(18, 18, 136, 0.7)), light: new Color(new RGBA(18, 18, 136, 0.7)), hc: new Color(new RGBA(50, 50, 255, 1)) }, nls.localize('overviewRuleInfo', 'Overview ruler marker color for infos.')); +export const overviewRulerWarning = registerColor('editorOverviewRuler.warningForeground', { dark: editorWarningForeground, light: editorWarningForeground, hc: editorWarningBorder }, nls.localize('overviewRuleWarning', 'Overview ruler marker color for warnings.')); +export const overviewRulerInfo = registerColor('editorOverviewRuler.infoForeground', { dark: editorInfoForeground, light: editorInfoForeground, hc: editorInfoBorder }, nls.localize('overviewRuleInfo', 'Overview ruler marker color for infos.')); // contains all color rules that used to defined in editor/browser/widget/editor.css registerThemingParticipant((theme, collector) => { diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index 7d46f79b6a0..150f483052e 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -64,7 +64,7 @@ export class QuickFixController extends Disposable implements IEditorContributio this._editor = editor; this._model = new CodeActionModel(this._editor, markerService, contextKeyService, progressService); - this._codeActionContextMenu = new CodeActionContextMenu(editor, contextMenuService, action => this._onApplyCodeAction(action)); + this._codeActionContextMenu = this._register(new CodeActionContextMenu(editor, contextMenuService, action => this._onApplyCodeAction(action))); this._lightBulbWidget = this._register(new LightBulbWidget(editor)); this._updateLightBulbTitle(); diff --git a/src/vs/editor/contrib/codeAction/codeActionModel.ts b/src/vs/editor/contrib/codeAction/codeActionModel.ts index 46b5956d0d2..91949db78d6 100644 --- a/src/vs/editor/contrib/codeAction/codeActionModel.ts +++ b/src/vs/editor/contrib/codeAction/codeActionModel.ts @@ -5,7 +5,7 @@ import { CancelablePromise, createCancelablePromise, TimeoutTimer } from 'vs/base/common/async'; import { Emitter, Event } from 'vs/base/common/event'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { Position } from 'vs/editor/common/core/position'; @@ -20,10 +20,9 @@ import { CodeActionTrigger } from './codeActionTrigger'; export const SUPPORTED_CODE_ACTIONS = new RawContextKey('supportedCodeAction', ''); -export class CodeActionOracle { +export class CodeActionOracle extends Disposable { - private _disposables: IDisposable[] = []; - private readonly _autoTriggerTimer = new TimeoutTimer(); + private readonly _autoTriggerTimer = this._register(new TimeoutTimer()); constructor( private readonly _editor: ICodeEditor, @@ -32,15 +31,9 @@ export class CodeActionOracle { private readonly _delay: number = 250, private readonly _progressService?: ILocalProgressService, ) { - this._disposables.push( - this._markerService.onMarkerChanged(e => this._onMarkerChanges(e)), - this._editor.onDidChangeCursorPosition(() => this._onCursorChange()), - ); - } - - dispose(): void { - this._disposables = dispose(this._disposables); - this._autoTriggerTimer.cancel(); + super(); + this._register(this._markerService.onMarkerChanged(e => this._onMarkerChanges(e))); + this._register(this._editor.onDidChangeCursorPosition(() => this._onCursorChange())); } trigger(trigger: CodeActionTrigger) { @@ -167,12 +160,11 @@ export namespace CodeActionsState { export type State = typeof Empty | Triggered; } -export class CodeActionModel { +export class CodeActionModel extends Disposable { private _codeActionOracle?: CodeActionOracle; private _state: CodeActionsState.State = CodeActionsState.Empty; private _onDidChangeState = new Emitter(); - private _disposables: IDisposable[] = []; private readonly _supportedCodeActions: IContextKey; constructor( @@ -181,17 +173,18 @@ export class CodeActionModel { contextKeyService: IContextKeyService, private readonly _progressService: ILocalProgressService ) { + super(); this._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService); - this._disposables.push(this._editor.onDidChangeModel(() => this._update())); - this._disposables.push(this._editor.onDidChangeModelLanguage(() => this._update())); - this._disposables.push(CodeActionProviderRegistry.onDidChange(() => this._update())); + this._register(this._editor.onDidChangeModel(() => this._update())); + this._register(this._editor.onDidChangeModelLanguage(() => this._update())); + this._register(CodeActionProviderRegistry.onDidChange(() => this._update())); this._update(); } dispose(): void { - this._disposables = dispose(this._disposables); + super.dispose(); dispose(this._codeActionOracle); } diff --git a/src/vs/editor/contrib/codeAction/codeActionWidget.ts b/src/vs/editor/contrib/codeAction/codeActionWidget.ts index b3ddad603b0..366cf55a18e 100644 --- a/src/vs/editor/contrib/codeAction/codeActionWidget.ts +++ b/src/vs/editor/contrib/codeAction/codeActionWidget.ts @@ -13,26 +13,35 @@ import { ScrollType } from 'vs/editor/common/editorCommon'; import { CodeAction } from 'vs/editor/common/modes'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction'; +import { Disposable } from 'vs/base/common/lifecycle'; -export class CodeActionContextMenu { +export class CodeActionContextMenu extends Disposable { private _visible: boolean; - private readonly _onDidExecuteCodeAction = new Emitter(); + private readonly _onDidExecuteCodeAction = this._register(new Emitter()); public readonly onDidExecuteCodeAction: Event = this._onDidExecuteCodeAction.event; constructor( private readonly _editor: ICodeEditor, private readonly _contextMenuService: IContextMenuService, private readonly _onApplyCodeAction: (action: CodeAction) => Promise - ) { } + ) { + super(); + } - async show(actionsToShow: Promise, at?: { x: number; y: number } | Position): Promise { + public async show(actionsToShow: Promise, at?: { x: number; y: number } | Position): Promise { const codeActions = await actionsToShow; + if (!codeActions.actions.length) { + this._visible = false; + return; + } if (!this._editor.getDomNode()) { // cancel when editor went off-dom + this._visible = false; return Promise.reject(canceled()); } + this._visible = true; const actions = codeActions.actions.map(action => this.codeActionToAction(action)); this._contextMenuService.showContextMenu({ diff --git a/src/vs/editor/contrib/codelens/codeLensCache.ts b/src/vs/editor/contrib/codelens/codeLensCache.ts index 6027dec365d..3df6eb028c5 100644 --- a/src/vs/editor/contrib/codelens/codeLensCache.ts +++ b/src/vs/editor/contrib/codelens/codeLensCache.ts @@ -6,18 +6,19 @@ import { ITextModel } from 'vs/editor/common/model'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ICodeLensData } from 'vs/editor/contrib/codelens/codelens'; +import { CodeLensModel } from 'vs/editor/contrib/codelens/codelens'; import { LRUCache, values } from 'vs/base/common/map'; -import { ICodeLensSymbol, CodeLensProvider } from 'vs/editor/common/modes'; +import { CodeLensProvider, CodeLensList, CodeLens } from 'vs/editor/common/modes'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { Range } from 'vs/editor/common/core/range'; +import { runWhenIdle } from 'vs/base/common/async'; export const ICodeLensCache = createDecorator('ICodeLensCache'); export interface ICodeLensCache { _serviceBrand: any; - put(model: ITextModel, data: ICodeLensData[]): void; - get(model: ITextModel): ICodeLensData[] | undefined; + put(model: ITextModel, data: CodeLensModel): void; + get(model: ITextModel): CodeLensModel | undefined; delete(model: ITextModel): void; } @@ -30,7 +31,7 @@ class CacheItem { constructor( readonly lineCount: number, - readonly data: ICodeLensData[] + readonly data: CodeLensModel ) { } } @@ -39,7 +40,7 @@ export class CodeLensCache implements ICodeLensCache { _serviceBrand: any; private readonly _fakeProvider = new class implements CodeLensProvider { - provideCodeLenses(): ICodeLensSymbol[] { + provideCodeLenses(): CodeLensList { throw new Error('not supported'); } }; @@ -48,9 +49,12 @@ export class CodeLensCache implements ICodeLensCache { constructor(@IStorageService storageService: IStorageService) { - const key = 'codelens/cache'; + // remove old data + const oldkey = 'codelens/cache'; + runWhenIdle(() => storageService.remove(oldkey, StorageScope.WORKSPACE)); // restore lens data on start + const key = 'codelens/cache2'; const raw = storageService.get(key, StorageScope.WORKSPACE, '{}'); this._deserialize(raw); @@ -61,13 +65,12 @@ export class CodeLensCache implements ICodeLensCache { }); } - put(model: ITextModel, data: ICodeLensData[]): void { - const item = new CacheItem(model.getLineCount(), data.map(item => { - return { - symbol: item.symbol, - provider: this._fakeProvider - }; - })); + put(model: ITextModel, data: CodeLensModel): void { + + const lensModel = new CodeLensModel(); + lensModel.add({ lenses: data.lenses.map(v => v.symbol), dispose() { } }, this._fakeProvider); + + const item = new CacheItem(model.getLineCount(), lensModel); this._cache.set(model.uri.toString(), item); } @@ -86,7 +89,7 @@ export class CodeLensCache implements ICodeLensCache { const data: Record = Object.create(null); this._cache.forEach((value, key) => { const lines = new Set(); - for (const d of value.data) { + for (const d of value.data.lenses) { lines.add(d.symbol.range.startLineNumber); } data[key] = { @@ -102,14 +105,14 @@ export class CodeLensCache implements ICodeLensCache { const data: Record = JSON.parse(raw); for (const key in data) { const element = data[key]; - const symbols: ICodeLensData[] = []; + const lenses: CodeLens[] = []; for (const line of element.lines) { - symbols.push({ - provider: this._fakeProvider, - symbol: { range: new Range(line, 1, line, 11) } - }); + lenses.push({ range: new Range(line, 1, line, 11) }); } - this._cache.set(key, new CacheItem(element.lineCount, symbols)); + + const model = new CodeLensModel(); + model.add({ lenses, dispose() { } }, this._fakeProvider); + this._cache.set(key, new CacheItem(element.lineCount, model)); } } catch { // ignore... diff --git a/src/vs/editor/contrib/codelens/codelens.ts b/src/vs/editor/contrib/codelens/codelens.ts index 30468bf74a1..65ab529f510 100644 --- a/src/vs/editor/contrib/codelens/codelens.ts +++ b/src/vs/editor/contrib/codelens/codelens.ts @@ -9,38 +9,59 @@ import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/error import { URI } from 'vs/base/common/uri'; import { registerLanguageCommand } from 'vs/editor/browser/editorExtensions'; import { ITextModel } from 'vs/editor/common/model'; -import { CodeLensProvider, CodeLensProviderRegistry, ICodeLensSymbol } from 'vs/editor/common/modes'; +import { CodeLensProvider, CodeLensProviderRegistry, CodeLens, CodeLensList } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; +import { DisposableStore } from 'vs/base/common/lifecycle'; -export interface ICodeLensData { - symbol: ICodeLensSymbol; +export interface CodeLensItem { + symbol: CodeLens; provider: CodeLensProvider; } -export function getCodeLensData(model: ITextModel, token: CancellationToken): Promise { +export class CodeLensModel { - const symbols: ICodeLensData[] = []; - const provider = CodeLensProviderRegistry.ordered(model); + lenses: CodeLensItem[] = []; - const promises = provider.map(provider => Promise.resolve(provider.provideCodeLenses(model, token)).then(result => { - if (Array.isArray(result)) { - for (let symbol of result) { - symbols.push({ symbol, provider }); - } + private readonly _dispoables = new DisposableStore(); + + dispose(): void { + this._dispoables.dispose(); + } + + add(list: CodeLensList, provider: CodeLensProvider): void { + this._dispoables.add(list); + for (const symbol of list.lenses) { + this.lenses.push({ symbol, provider }); } - }).catch(onUnexpectedExternalError)); + } +} + +export function getCodeLensData(model: ITextModel, token: CancellationToken): Promise { + + const provider = CodeLensProviderRegistry.ordered(model); + const providerRanks = new Map(); + const result = new CodeLensModel(); + + const promises = provider.map((provider, i) => { + + providerRanks.set(provider, i); + + return Promise.resolve(provider.provideCodeLenses(model, token)) + .then(list => list && result.add(list, provider)) + .catch(onUnexpectedExternalError); + }); return Promise.all(promises).then(() => { - return mergeSort(symbols, (a, b) => { + result.lenses = mergeSort(result.lenses, (a, b) => { // sort by lineNumber, provider-rank, and column if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { return -1; } else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { return 1; - } else if (provider.indexOf(a.provider) < provider.indexOf(b.provider)) { + } else if (providerRanks.get(a.provider)! < providerRanks.get(b.provider)!) { return -1; - } else if (provider.indexOf(a.provider) > provider.indexOf(b.provider)) { + } else if (providerRanks.get(a.provider)! > providerRanks.get(b.provider)!) { return 1; } else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { return -1; @@ -50,6 +71,8 @@ export function getCodeLensData(model: ITextModel, token: CancellationToken): Pr return 0; } }); + + return result; }); } @@ -65,12 +88,12 @@ registerLanguageCommand('_executeCodeLensProvider', function (accessor, args) { throw illegalArgument(); } - const result: ICodeLensSymbol[] = []; + const result: CodeLens[] = []; return getCodeLensData(model, CancellationToken.None).then(value => { let resolve: Promise[] = []; - for (const item of value) { + for (const item of value.lenses) { if (typeof itemResolveCount === 'undefined' || Boolean(item.symbol.command)) { result.push(item.symbol); } else if (itemResolveCount-- > 0 && item.provider.resolveCodeLens) { @@ -78,7 +101,7 @@ registerLanguageCommand('_executeCodeLensProvider', function (accessor, args) { } } - return Promise.all(resolve); + return Promise.all(resolve).finally(() => value.dispose()); }).then(() => { return result; diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index c7d7ced6ec4..b4b0052b090 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -5,32 +5,32 @@ import { CancelablePromise, RunOnceScheduler, createCancelablePromise, disposableTimeout } from 'vs/base/common/async'; import { onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { toDisposable, Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import { StableEditorScrollState } from 'vs/editor/browser/core/editorState'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; -import { CodeLensProviderRegistry, ICodeLensSymbol } from 'vs/editor/common/modes'; -import { ICodeLensData, getCodeLensData } from 'vs/editor/contrib/codelens/codelens'; -import { CodeLens, CodeLensHelper } from 'vs/editor/contrib/codelens/codelensWidget'; +import { CodeLensProviderRegistry, CodeLens } from 'vs/editor/common/modes'; +import { getCodeLensData, CodeLensModel, CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; +import { CodeLensWidget, CodeLensHelper } from 'vs/editor/contrib/codelens/codelensWidget'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ICodeLensCache } from 'vs/editor/contrib/codelens/codeLensCache'; -export class CodeLensContribution implements editorCommon.IEditorContribution { +export class CodeLensContribution extends Disposable implements editorCommon.IEditorContribution { private static readonly ID: string = 'css.editor.codeLens'; private _isEnabled: boolean; - private _globalToDispose: IDisposable[]; - private _localToDispose: IDisposable[]; - private _lenses: CodeLens[]; - private _currentFindCodeLensSymbolsPromise: CancelablePromise | null; - private _modelChangeCounter: number; - private _currentResolveCodeLensSymbolsPromise: CancelablePromise | null; + private readonly _localToDispose = this._register(new DisposableStore()); + private _lenses: CodeLensWidget[] = []; + private _currentFindCodeLensSymbolsPromise: CancelablePromise | undefined; + private _currentCodeLensModel: CodeLensModel | undefined; + private _modelChangeCounter: number = 0; + private _currentResolveCodeLensSymbolsPromise: CancelablePromise | undefined; private _detectVisibleLenses: RunOnceScheduler; constructor( @@ -39,43 +39,43 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { @INotificationService private readonly _notificationService: INotificationService, @ICodeLensCache private readonly _codeLensCache: ICodeLensCache ) { + super(); this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; - this._globalToDispose = []; - this._localToDispose = []; this._lenses = []; - this._currentFindCodeLensSymbolsPromise = null; + this._currentFindCodeLensSymbolsPromise = undefined; this._modelChangeCounter = 0; - this._globalToDispose.push(this._editor.onDidChangeModel(() => this._onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { + this._register(this._editor.onDidChangeModel(() => this._onModelChange())); + this._register(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); + this._register(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { let prevIsEnabled = this._isEnabled; this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; if (prevIsEnabled !== this._isEnabled) { this._onModelChange(); } })); - this._globalToDispose.push(CodeLensProviderRegistry.onDidChange(this._onModelChange, this)); + this._register(CodeLensProviderRegistry.onDidChange(this._onModelChange, this)); this._onModelChange(); } dispose(): void { this._localDispose(); - this._globalToDispose = dispose(this._globalToDispose); + super.dispose(); } private _localDispose(): void { if (this._currentFindCodeLensSymbolsPromise) { this._currentFindCodeLensSymbolsPromise.cancel(); - this._currentFindCodeLensSymbolsPromise = null; + this._currentFindCodeLensSymbolsPromise = undefined; this._modelChangeCounter++; } if (this._currentResolveCodeLensSymbolsPromise) { this._currentResolveCodeLensSymbolsPromise.cancel(); - this._currentResolveCodeLensSymbolsPromise = null; + this._currentResolveCodeLensSymbolsPromise = undefined; } - this._localToDispose = dispose(this._localToDispose); + this._localToDispose.clear(); + dispose(this._currentCodeLensModel); } getId(): string { @@ -104,7 +104,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // no provider -> return but check with // cached lenses. they expire after 30 seconds if (cachedLenses) { - this._localToDispose.push(disposableTimeout(() => { + this._localToDispose.add(disposableTimeout(() => { const cachedLensesNow = this._codeLensCache.get(model); if (cachedLenses === cachedLensesNow) { this._codeLensCache.delete(model); @@ -118,7 +118,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { for (const provider of CodeLensProviderRegistry.all(model)) { if (typeof provider.onDidChange === 'function') { let registration = provider.onDidChange(() => scheduler.schedule()); - this._localToDispose.push(registration); + this._localToDispose.add(registration); } } @@ -136,18 +136,25 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._currentFindCodeLensSymbolsPromise.then(result => { if (counterValue === this._modelChangeCounter) { // only the last one wins + // lifecycle -> dispose old model + dispose(this._currentCodeLensModel); + this._currentCodeLensModel = result; + + // cache model to reduce flicker this._codeLensCache.put(model, result); + + // render lenses this._renderCodeLensSymbols(result); this._detectVisibleLenses.schedule(); } }, onUnexpectedError); }, 250); - this._localToDispose.push(scheduler); - this._localToDispose.push(this._detectVisibleLenses); - this._localToDispose.push(this._editor.onDidChangeModelContent((e) => { + this._localToDispose.add(scheduler); + this._localToDispose.add(this._detectVisibleLenses); + this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { this._editor.changeDecorations((changeAccessor) => { this._editor.changeViewZones((viewAccessor) => { - let toDispose: CodeLens[] = []; + let toDispose: CodeLensWidget[] = []; let lastLensLineNumber: number = -1; this._lenses.forEach((lens) => { @@ -176,15 +183,15 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // Ask for all references again scheduler.schedule(); })); - this._localToDispose.push(this._editor.onDidScrollChange(e => { + this._localToDispose.add(this._editor.onDidScrollChange(e => { if (e.scrollTopChanged && this._lenses.length > 0) { this._detectVisibleLenses.schedule(); } })); - this._localToDispose.push(this._editor.onDidLayoutChange(e => { + this._localToDispose.add(this._editor.onDidLayoutChange(e => { this._detectVisibleLenses.schedule(); })); - this._localToDispose.push(toDisposable(() => { + this._localToDispose.add(toDisposable(() => { if (this._editor.getModel()) { const scrollState = StableEditorScrollState.capture(this._editor); this._editor.changeDecorations((changeAccessor) => { @@ -198,14 +205,14 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._disposeAllLenses(undefined, undefined); } })); - this._localToDispose.push(this._editor.onDidChangeConfiguration(e => { + this._localToDispose.add(this._editor.onDidChangeConfiguration(e => { if (e.fontInfo) { for (const lens of this._lenses) { lens.updateHeight(); } } })); - this._localToDispose.push(this._editor.onMouseUp(e => { + this._localToDispose.add(this._editor.onMouseUp(e => { if (e.target.type === editorBrowser.MouseTargetType.CONTENT_WIDGET && e.target.element && e.target.element.tagName === 'A') { for (const lens of this._lenses) { let command = lens.getCommand(e.target.element as HTMLLinkElement); @@ -228,16 +235,16 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { this._lenses = []; } - private _renderCodeLensSymbols(symbols: ICodeLensData[]): void { + private _renderCodeLensSymbols(symbols: CodeLensModel): void { if (!this._editor.hasModel()) { return; } let maxLineNumber = this._editor.getModel().getLineCount(); - let groups: ICodeLensData[][] = []; - let lastGroup: ICodeLensData[] | undefined; + let groups: CodeLensItem[][] = []; + let lastGroup: CodeLensItem[] | undefined; - for (let symbol of symbols) { + for (let symbol of symbols.lenses) { let line = symbol.symbol.range.startLineNumber; if (line < 1 || line > maxLineNumber) { // invalid code lens @@ -272,7 +279,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { groupsIndex++; codeLensIndex++; } else { - this._lenses.splice(codeLensIndex, 0, new CodeLens(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule())); + this._lenses.splice(codeLensIndex, 0, new CodeLensWidget(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule())); codeLensIndex++; groupsIndex++; } @@ -286,7 +293,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { // Create extra symbols while (groupsIndex < groups.length) { - this._lenses.push(new CodeLens(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule())); + this._lenses.push(new CodeLensWidget(groups[groupsIndex], this._editor, helper, accessor, () => this._detectVisibleLenses.schedule())); groupsIndex++; } @@ -300,7 +307,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { private _onViewportChanged(): void { if (this._currentResolveCodeLensSymbolsPromise) { this._currentResolveCodeLensSymbolsPromise.cancel(); - this._currentResolveCodeLensSymbolsPromise = null; + this._currentResolveCodeLensSymbolsPromise = undefined; } const model = this._editor.getModel(); @@ -308,8 +315,8 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { return; } - const toResolve: ICodeLensData[][] = []; - const lenses: CodeLens[] = []; + const toResolve: CodeLensItem[][] = []; + const lenses: CodeLensWidget[] = []; this._lenses.forEach((lens) => { const request = lens.computeIfNecessary(model); if (request) { @@ -326,7 +333,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { const promises = toResolve.map((request, i) => { - const resolvedSymbols = new Array(request.length); + const resolvedSymbols = new Array(request.length); const promises = request.map((request, i) => { if (!request.symbol.command && typeof request.provider.resolveCodeLens === 'function') { return Promise.resolve(request.provider.resolveCodeLens(model, request.symbol, token)).then(symbol => { @@ -346,11 +353,10 @@ export class CodeLensContribution implements editorCommon.IEditorContribution { return Promise.all(promises); }); - this._currentResolveCodeLensSymbolsPromise.then(() => { - this._currentResolveCodeLensSymbolsPromise = null; - }).catch(err => { - this._currentResolveCodeLensSymbolsPromise = null; + this._currentResolveCodeLensSymbolsPromise.catch(err => { onUnexpectedError(err); + }).finally(() => { + this._currentResolveCodeLensSymbolsPromise = undefined; }); } } diff --git a/src/vs/editor/contrib/codelens/codelensWidget.ts b/src/vs/editor/contrib/codelens/codelensWidget.ts index 9a0a0bbe9c1..24ed75a4405 100644 --- a/src/vs/editor/contrib/codelens/codelensWidget.ts +++ b/src/vs/editor/contrib/codelens/codelensWidget.ts @@ -11,9 +11,9 @@ import * as editorBrowser from 'vs/editor/browser/editorBrowser'; import { Range } from 'vs/editor/common/core/range'; import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { Command, ICodeLensSymbol } from 'vs/editor/common/modes'; +import { Command, CodeLens } from 'vs/editor/common/modes'; import { editorCodeLensForeground } from 'vs/editor/common/view/editorColorRegistry'; -import { ICodeLensData } from 'vs/editor/contrib/codelens/codelens'; +import { CodeLensItem } from 'vs/editor/contrib/codelens/codelens'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; @@ -65,7 +65,7 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { constructor( editor: editorBrowser.ICodeEditor, symbolRange: Range, - data: ICodeLensData[] + data: CodeLensItem[] ) { this._id = 'codeLensWidget' + (++CodeLensContentWidget._idPool); this._editor = editor; @@ -88,7 +88,7 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget { this._domNode.innerHTML = ' '; } - withCommands(inSymbols: Array, animate: boolean): void { + withCommands(inSymbols: Array, animate: boolean): void { this._commands.clear(); const symbols = coalesce(inSymbols); @@ -189,17 +189,17 @@ export class CodeLensHelper { } } -export class CodeLens { +export class CodeLensWidget { private readonly _editor: editorBrowser.ICodeEditor; private readonly _viewZone: CodeLensViewZone; private readonly _viewZoneId: number; private readonly _contentWidget: CodeLensContentWidget; private _decorationIds: string[]; - private _data: ICodeLensData[]; + private _data: CodeLensItem[]; constructor( - data: ICodeLensData[], + data: CodeLensItem[], editor: editorBrowser.ICodeEditor, helper: CodeLensHelper, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor, @@ -256,7 +256,7 @@ export class CodeLens { }); } - updateCodeLensSymbols(data: ICodeLensData[], helper: CodeLensHelper): void { + updateCodeLensSymbols(data: CodeLensItem[], helper: CodeLensHelper): void { while (this._decorationIds.length) { helper.removeDecoration(this._decorationIds.pop()!); } @@ -270,7 +270,7 @@ export class CodeLens { }); } - computeIfNecessary(model: ITextModel): ICodeLensData[] | null { + computeIfNecessary(model: ITextModel): CodeLensItem[] | null { if (!this._contentWidget.isVisible()) { return null; } @@ -285,7 +285,7 @@ export class CodeLens { return this._data; } - updateCommands(symbols: Array): void { + updateCommands(symbols: Array): void { this._contentWidget.withCommands(symbols, true); for (let i = 0; i < this._data.length; i++) { const resolved = symbols[i]; diff --git a/src/vs/editor/contrib/colorPicker/colorDetector.ts b/src/vs/editor/contrib/colorPicker/colorDetector.ts index e20d0d532a3..93ce80a2499 100644 --- a/src/vs/editor/contrib/colorPicker/colorDetector.ts +++ b/src/vs/editor/contrib/colorPicker/colorDetector.ts @@ -7,7 +7,7 @@ import { CancelablePromise, TimeoutTimer, createCancelablePromise } from 'vs/bas import { RGBA } from 'vs/base/common/color'; import { onUnexpectedError } from 'vs/base/common/errors'; import { hash } from 'vs/base/common/hash'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; @@ -22,14 +22,13 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur const MAX_DECORATORS = 500; -export class ColorDetector implements IEditorContribution { +export class ColorDetector extends Disposable implements IEditorContribution { private static readonly ID: string = 'editor.contrib.colorDetector'; static RECOMPUTE_TIME = 1000; // ms - private _globalToDispose: IDisposable[] = []; - private _localToDispose: IDisposable[] = []; + private readonly _localToDispose = this._register(new DisposableStore()); private _computePromise: CancelablePromise | null; private _timeoutTimer: TimeoutTimer | null; @@ -45,13 +44,14 @@ export class ColorDetector implements IEditorContribution { @ICodeEditorService private readonly _codeEditorService: ICodeEditorService, @IConfigurationService private readonly _configurationService: IConfigurationService ) { - this._globalToDispose.push(_editor.onDidChangeModel((e) => { + super(); + this._register(_editor.onDidChangeModel((e) => { this._isEnabled = this.isEnabled(); this.onModelChanged(); })); - this._globalToDispose.push(_editor.onDidChangeModelLanguage((e) => this.onModelChanged())); - this._globalToDispose.push(ColorProviderRegistry.onDidChange((e) => this.onModelChanged())); - this._globalToDispose.push(_editor.onDidChangeConfiguration((e) => { + this._register(_editor.onDidChangeModelLanguage((e) => this.onModelChanged())); + this._register(ColorProviderRegistry.onDidChange((e) => this.onModelChanged())); + this._register(_editor.onDidChangeConfiguration((e) => { let prevIsEnabled = this._isEnabled; this._isEnabled = this.isEnabled(); if (prevIsEnabled !== this._isEnabled) { @@ -98,7 +98,7 @@ export class ColorDetector implements IEditorContribution { dispose(): void { this.stop(); this.removeAllDecorations(); - this._globalToDispose = dispose(this._globalToDispose); + super.dispose(); } private onModelChanged(): void { @@ -113,7 +113,7 @@ export class ColorDetector implements IEditorContribution { return; } - this._localToDispose.push(this._editor.onDidChangeModelContent((e) => { + this._localToDispose.add(this._editor.onDidChangeModelContent((e) => { if (!this._timeoutTimer) { this._timeoutTimer = new TimeoutTimer(); this._timeoutTimer.cancelAndSet(() => { @@ -149,7 +149,7 @@ export class ColorDetector implements IEditorContribution { this._computePromise.cancel(); this._computePromise = null; } - this._localToDispose = dispose(this._localToDispose); + this._localToDispose.clear(); } private updateDecorations(colorDatas: IColorData[]): void { diff --git a/src/vs/editor/contrib/find/simpleFindWidget.ts b/src/vs/editor/contrib/find/simpleFindWidget.ts index c7833dcc253..2c1cb22025f 100644 --- a/src/vs/editor/contrib/find/simpleFindWidget.ts +++ b/src/vs/editor/contrib/find/simpleFindWidget.ts @@ -99,29 +99,29 @@ export abstract class SimpleFindWidget extends Widget { } })); - const prevBtn = new SimpleButton({ + const prevBtn = this._register(new SimpleButton({ label: NLS_PREVIOUS_MATCH_BTN_LABEL, className: 'previous', onTrigger: () => { this.find(true); } - }); + })); - const nextBtn = new SimpleButton({ + const nextBtn = this._register(new SimpleButton({ label: NLS_NEXT_MATCH_BTN_LABEL, className: 'next', onTrigger: () => { this.find(false); } - }); + })); - const closeBtn = new SimpleButton({ + const closeBtn = this._register(new SimpleButton({ label: NLS_CLOSE_BTN_LABEL, className: 'close-fw', onTrigger: () => { this.hide(); } - }); + })); this._innerDomNode = document.createElement('div'); this._innerDomNode.classList.add('simple-find-part'); diff --git a/src/vs/editor/contrib/folding/folding.ts b/src/vs/editor/contrib/folding/folding.ts index 389ef232a1b..e5d922f71f6 100644 --- a/src/vs/editor/contrib/folding/folding.ts +++ b/src/vs/editor/contrib/folding/folding.ts @@ -9,7 +9,7 @@ import * as types from 'vs/base/common/types'; import { escapeRegExpCharacters } from 'vs/base/common/strings'; import { RunOnceScheduler, Delayer, CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ScrollType, IEditorContribution } from 'vs/editor/common/editorCommon'; import { ITextModel } from 'vs/editor/common/model'; import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction, registerInstantiatedEditorAction } from 'vs/editor/browser/editorExtensions'; @@ -46,7 +46,7 @@ interface FoldingStateMemento { provider?: string; } -export class FoldingController implements IEditorContribution { +export class FoldingController extends Disposable implements IEditorContribution { static MAX_FOLDING_REGIONS = 5000; @@ -73,27 +73,25 @@ export class FoldingController implements IEditorContribution { private foldingModelPromise: Promise | null; private updateScheduler: Delayer | null; - private globalToDispose: IDisposable[]; private cursorChangedScheduler: RunOnceScheduler | null; - private localToDispose: IDisposable[]; + private readonly localToDispose = this._register(new DisposableStore()); constructor(editor: ICodeEditor) { + super(); this.editor = editor; this._isEnabled = this.editor.getConfiguration().contribInfo.folding; this._autoHideFoldingControls = this.editor.getConfiguration().contribInfo.showFoldingControls === 'mouseover'; this._useFoldingProviders = this.editor.getConfiguration().contribInfo.foldingStrategy !== 'indentation'; - this.globalToDispose = []; - this.localToDispose = []; this.foldingDecorationProvider = new FoldingDecorationProvider(editor); this.foldingDecorationProvider.autoHideFoldingControls = this._autoHideFoldingControls; - this.globalToDispose.push(this.editor.onDidChangeModel(() => this.onModelChanged())); + this._register(this.editor.onDidChangeModel(() => this.onModelChanged())); - this.globalToDispose.push(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { + this._register(this.editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { if (e.contribInfo) { let oldIsEnabled = this._isEnabled; this._isEnabled = this.editor.getConfiguration().contribInfo.folding; @@ -113,7 +111,6 @@ export class FoldingController implements IEditorContribution { } } })); - this.globalToDispose.push({ dispose: () => dispose(this.localToDispose) }); this.onModelChanged(); } @@ -121,10 +118,6 @@ export class FoldingController implements IEditorContribution { return ID; } - public dispose(): void { - this.globalToDispose = dispose(this.globalToDispose); - } - /** * Store view state. */ @@ -173,7 +166,7 @@ export class FoldingController implements IEditorContribution { } private onModelChanged(): void { - this.localToDispose = dispose(this.localToDispose); + this.localToDispose.clear(); let model = this.editor.getModel(); if (!this._isEnabled || !model || model.isTooLargeForTokenization()) { @@ -182,23 +175,23 @@ export class FoldingController implements IEditorContribution { } this.foldingModel = new FoldingModel(model, this.foldingDecorationProvider); - this.localToDispose.push(this.foldingModel); + this.localToDispose.add(this.foldingModel); this.hiddenRangeModel = new HiddenRangeModel(this.foldingModel); - this.localToDispose.push(this.hiddenRangeModel); - this.localToDispose.push(this.hiddenRangeModel.onDidChange(hr => this.onHiddenRangesChanges(hr))); + this.localToDispose.add(this.hiddenRangeModel); + this.localToDispose.add(this.hiddenRangeModel.onDidChange(hr => this.onHiddenRangesChanges(hr))); this.updateScheduler = new Delayer(200); this.cursorChangedScheduler = new RunOnceScheduler(() => this.revealCursor(), 200); - this.localToDispose.push(this.cursorChangedScheduler); - this.localToDispose.push(FoldingRangeProviderRegistry.onDidChange(() => this.onFoldingStrategyChanged())); - this.localToDispose.push(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); // covers model language changes as well - this.localToDispose.push(this.editor.onDidChangeModelContent(() => this.onModelContentChanged())); - this.localToDispose.push(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())); - this.localToDispose.push(this.editor.onMouseDown(e => this.onEditorMouseDown(e))); - this.localToDispose.push(this.editor.onMouseUp(e => this.onEditorMouseUp(e))); - this.localToDispose.push({ + this.localToDispose.add(this.cursorChangedScheduler); + this.localToDispose.add(FoldingRangeProviderRegistry.onDidChange(() => this.onFoldingStrategyChanged())); + this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())); // covers model language changes as well + this.localToDispose.add(this.editor.onDidChangeModelContent(() => this.onModelContentChanged())); + this.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())); + this.localToDispose.add(this.editor.onMouseDown(e => this.onEditorMouseDown(e))); + this.localToDispose.add(this.editor.onMouseUp(e => this.onEditorMouseUp(e))); + this.localToDispose.add({ dispose: () => { if (this.foldingRegionPromise) { this.foldingRegionPromise.cancel(); diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts index 2f36e372857..45314c2d1ab 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts @@ -16,7 +16,7 @@ import { DefinitionProviderRegistry, LocationLink } from 'vs/editor/common/modes import { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { getDefinitionsAtPosition } from './goToDefinition'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; @@ -27,13 +27,12 @@ import { IWordAtPosition, IModelDeltaDecoration, ITextModel, IFoundBracket } fro import { Position } from 'vs/editor/common/core/position'; import { withNullAsUndefined } from 'vs/base/common/types'; -class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { +class GotoDefinitionWithMouseEditorContribution extends Disposable implements editorCommon.IEditorContribution { private static readonly ID = 'editor.contrib.gotodefinitionwithmouse'; static MAX_SOURCE_PREVIEW_LINES = 8; private readonly editor: ICodeEditor; - private toUnhook: IDisposable[]; private decorations: string[]; private currentWordUnderMouse: IWordAtPosition | null; private previousPromise: CancelablePromise | null; @@ -43,19 +42,19 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC @ITextModelService private readonly textModelResolverService: ITextModelService, @IModeService private readonly modeService: IModeService ) { - this.toUnhook = []; + super(); this.decorations = []; this.editor = editor; this.previousPromise = null; let linkGesture = new ClickLinkGesture(editor); - this.toUnhook.push(linkGesture); + this._register(linkGesture); - this.toUnhook.push(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { + this._register(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { this.startFindDefinition(mouseEvent, withNullAsUndefined(keyboardEvent)); })); - this.toUnhook.push(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { + this._register(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { if (this.isEnabled(mouseEvent)) { this.gotoDefinition(mouseEvent.target, mouseEvent.hasSideBySideModifier).then(() => { this.removeDecorations(); @@ -66,7 +65,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC } })); - this.toUnhook.push(linkGesture.onCancel(() => { + this._register(linkGesture.onCancel(() => { this.removeDecorations(); this.currentWordUnderMouse = null; })); @@ -301,10 +300,6 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC public getId(): string { return GotoDefinitionWithMouseEditorContribution.ID; } - - public dispose(): void { - this.toUnhook = dispose(this.toUnhook); - } } registerEditorContribution(GotoDefinitionWithMouseEditorContribution); diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts index 557e5125896..bf25f5d6181 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionResultsNavigation.ts @@ -15,9 +15,9 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService import { Range } from 'vs/editor/common/core/range'; import { Disposable, dispose, IDisposable, combinedDisposable } from 'vs/base/common/lifecycle'; import { Emitter, Event } from 'vs/base/common/event'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { localize } from 'vs/nls'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { INotificationService } from 'vs/platform/notification/common/notification'; export const ctxHasSymbols = new RawContextKey('hasSymbols', false); @@ -45,7 +45,7 @@ class SymbolNavigationService implements ISymbolNavigationService { constructor( @IContextKeyService contextKeyService: IContextKeyService, @ICodeEditorService private readonly _editorService: ICodeEditorService, - @IStatusbarService private readonly _statusbarService: IStatusbarService, + @INotificationService private readonly _notificationService: INotificationService, @IKeybindingService private readonly _keybindingService: IKeybindingService, ) { this._ctxHasSymbols = ctxHasSymbols.bindTo(contextKeyService); @@ -143,7 +143,7 @@ class SymbolNavigationService implements ISymbolNavigationService { ? localize('location.kb', "Symbol {0} of {1}, {2} for next", this._currentIdx + 1, this._currentModel!.references.length, kb.getLabel()) : localize('location', "Symbol {0} of {1}", this._currentIdx + 1, this._currentModel!.references.length); - this._currentMessage = this._statusbarService.setStatusMessage(message); + this._currentMessage = this._notificationService.status(message); } } diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index 4a9a2aa118d..d865ad9bb6d 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { Emitter } from 'vs/base/common/event'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMarker, IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; @@ -27,29 +27,28 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { Action } from 'vs/base/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -class MarkerModel { +class MarkerModel extends Disposable { private readonly _editor: ICodeEditor; private _markers: IMarker[]; private _nextIdx: number; - private _toUnbind: IDisposable[]; private _ignoreSelectionChange: boolean; private readonly _onCurrentMarkerChanged: Emitter; private readonly _onMarkerSetChanged: Emitter; constructor(editor: ICodeEditor, markers: IMarker[]) { + super(); this._editor = editor; this._markers = []; this._nextIdx = -1; - this._toUnbind = []; this._ignoreSelectionChange = false; this._onCurrentMarkerChanged = new Emitter(); this._onMarkerSetChanged = new Emitter(); this.setMarkers(markers); // listen on editor - this._toUnbind.push(this._editor.onDidDispose(() => this.dispose())); - this._toUnbind.push(this._editor.onDidChangeCursorPosition(() => { + this._register(this._editor.onDidDispose(() => this.dispose())); + this._register(this._editor.onDidChangeCursorPosition(() => { if (this._ignoreSelectionChange) { return; } @@ -188,10 +187,6 @@ class MarkerModel { public indexOf(marker: IMarker): number { return 1 + this._markers.indexOf(marker); } - - public dispose(): void { - this._toUnbind = dispose(this._toUnbind); - } } export class MarkerController implements editorCommon.IEditorContribution { diff --git a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts index 2ac2c54af5e..607177aa4e5 100644 --- a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts @@ -6,15 +6,14 @@ import 'vs/css!./media/gotoErrorWidget'; import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { IMarker, MarkerSeverity, IRelatedInformation } from 'vs/platform/markers/common/markers'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { registerColor, oneOf, textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, oneOf, textLinkForeground, editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder } from 'vs/platform/theme/common/colorRegistry'; import { IThemeService, ITheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; -import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder } from 'vs/editor/common/view/editorColorRegistry'; import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { ScrollType } from 'vs/editor/common/editorCommon'; @@ -27,6 +26,7 @@ import { IAction } from 'vs/base/common/actions'; import { IActionBarOptions, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { peekViewTitleForeground, peekViewTitleInfoForeground } from 'vs/editor/contrib/referenceSearch/referencesWidget'; import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; +import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon'; class MessageWidget extends Disposable { @@ -164,8 +164,9 @@ export class MarkerNavigationWidget extends PeekViewWidget { private _parentContainer: HTMLElement; private _container: HTMLElement; + private _icon: HTMLElement; private _message: MessageWidget; - private _callOnDispose: IDisposable[] = []; + private readonly _callOnDispose = new DisposableStore(); private _severity: MarkerSeverity; private _backgroundColor?: Color; private _onDidSelectRelatedInformation = new Emitter(); @@ -183,7 +184,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { this._backgroundColor = Color.white; this._applyTheme(_themeService.getTheme()); - this._callOnDispose.push(_themeService.onThemeChange(this._applyTheme.bind(this))); + this._callOnDispose.add(_themeService.onThemeChange(this._applyTheme.bind(this))); this.create(); } @@ -214,7 +215,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { } dispose(): void { - this._callOnDispose = dispose(this._callOnDispose); + this._callOnDispose.dispose(); super.dispose(); } @@ -227,6 +228,10 @@ export class MarkerNavigationWidget extends PeekViewWidget { this._actionbarWidget.push(this.actions, { label: false, icon: true }); } + protected _fillTitleIcon(container: HTMLElement): void { + this._icon = dom.append(container, dom.$('')); + } + protected _getActionBarOptions(): IActionBarOptions { return { orientation: ActionsOrientation.HORIZONTAL_REVERSE @@ -274,13 +279,7 @@ export class MarkerNavigationWidget extends PeekViewWidget { : nls.localize('change', "{0} of {1} problem", markerIdx, markerCount); this.setTitle(basename(model.uri), detail); } - let headingIconClassName = 'error'; - if (this._severity === MarkerSeverity.Warning) { - headingIconClassName = 'warning'; - } else if (this._severity === MarkerSeverity.Info) { - headingIconClassName = 'info'; - } - this.setTitleIcon(headingIconClassName); + this._icon.className = SeverityIcon.className(MarkerSeverity.toSeverity(this._severity)); this.editor.revealPositionInCenter(position, ScrollType.Smooth); diff --git a/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css b/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css index 5b5b607e81f..6680fb166cd 100644 --- a/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css +++ b/src/vs/editor/contrib/gotoError/media/gotoErrorWidget.css @@ -5,28 +5,10 @@ /* marker zone */ -.monaco-editor .peekview-widget .head .peekview-title .icon.warning { - background: url('status-warning.svg') center center no-repeat; -} - -.monaco-editor .peekview-widget .head .peekview-title .icon.error { - background: url('status-error.svg') center center no-repeat; -} - -.monaco-editor .peekview-widget .head .peekview-title .icon.info { - background: url('status-info.svg') center center no-repeat; -} - -.vs-dark .monaco-editor .peekview-widget .head .peekview-title .icon.warning { - background: url('status-warning-inverse.svg') center center no-repeat; -} - -.vs-dark .monaco-editor .peekview-widget .head .peekview-title .icon.error { - background: url('status-error-inverse.svg') center center no-repeat; -} - -.vs-dark .monaco-editor .peekview-widget .head .peekview-title .icon.info { - background: url('status-info-inverse.svg') center center no-repeat; +.monaco-editor .peekview-widget .head .peekview-title .severity-icon { + display: inline-block; + vertical-align: text-top; + margin-right: 4px; } .monaco-editor .marker-widget { diff --git a/src/vs/editor/contrib/gotoError/media/status-error-inverse.svg b/src/vs/editor/contrib/gotoError/media/status-error-inverse.svg deleted file mode 100644 index 3c852a7ffde..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-error-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/media/status-error.svg b/src/vs/editor/contrib/gotoError/media/status-error.svg deleted file mode 100644 index a1ddb39fed6..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-error.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/media/status-info-inverse.svg b/src/vs/editor/contrib/gotoError/media/status-info-inverse.svg deleted file mode 100644 index d38c363e0e4..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-info-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/media/status-info.svg b/src/vs/editor/contrib/gotoError/media/status-info.svg deleted file mode 100644 index 6e2e22f67bc..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-info.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/media/status-warning-inverse.svg b/src/vs/editor/contrib/gotoError/media/status-warning-inverse.svg deleted file mode 100644 index df44e61b326..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-warning-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/gotoError/media/status-warning.svg b/src/vs/editor/contrib/gotoError/media/status-warning.svg deleted file mode 100644 index f4e2a84b0af..00000000000 --- a/src/vs/editor/contrib/gotoError/media/status-warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/editor/contrib/multicursor/multicursor.ts b/src/vs/editor/contrib/multicursor/multicursor.ts index 9a699df3229..ec0925af31a 100644 --- a/src/vs/editor/contrib/multicursor/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/multicursor.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { RunOnceScheduler } from 'vs/base/common/async'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EditorAction, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { RevealTarget } from 'vs/editor/common/controller/cursorCommon'; @@ -427,7 +427,7 @@ export class MultiCursorSelectionController extends Disposable implements IEdito private readonly _editor: ICodeEditor; private _ignoreSelectionChange: boolean; private _session: MultiCursorSession | null; - private _sessionDispose: IDisposable[]; + private readonly _sessionDispose = this._register(new DisposableStore()); public static get(editor: ICodeEditor): MultiCursorSelectionController { return editor.getContribution(MultiCursorSelectionController.ID); @@ -438,7 +438,6 @@ export class MultiCursorSelectionController extends Disposable implements IEdito this._editor = editor; this._ignoreSelectionChange = false; this._session = null; - this._sessionDispose = []; } public dispose(): void { @@ -468,27 +467,25 @@ export class MultiCursorSelectionController extends Disposable implements IEdito } findController.getState().change(newState, false); - this._sessionDispose = [ - this._editor.onDidChangeCursorSelection((e) => { - if (this._ignoreSelectionChange) { - return; - } + this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e) => { + if (this._ignoreSelectionChange) { + return; + } + this._endSession(); + })); + this._sessionDispose.add(this._editor.onDidBlurEditorText(() => { + this._endSession(); + })); + this._sessionDispose.add(findController.getState().onFindReplaceStateChange((e) => { + if (e.matchCase || e.wholeWord) { this._endSession(); - }), - this._editor.onDidBlurEditorText(() => { - this._endSession(); - }), - findController.getState().onFindReplaceStateChange((e) => { - if (e.matchCase || e.wholeWord) { - this._endSession(); - } - }) - ]; + } + })); } } private _endSession(): void { - this._sessionDispose = dispose(this._sessionDispose); + this._sessionDispose.clear(); if (this._session && this._session.isDisconnectedFromFindController) { const newState: INewFindReplaceState = { wholeWordOverride: FindOptionOverride.NotSet, diff --git a/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts index 5c365daebac..f7eae70292e 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts @@ -8,7 +8,7 @@ import { domEvent, stop } from 'vs/base/browser/event'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { Event } from 'vs/base/common/event'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import 'vs/css!./parameterHints'; import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; @@ -25,12 +25,12 @@ import { ParameterHintsModel, TriggerContext } from 'vs/editor/contrib/parameter const $ = dom.$; -export class ParameterHintsWidget implements IContentWidget, IDisposable { +export class ParameterHintsWidget extends Disposable implements IContentWidget, IDisposable { private static readonly ID = 'editor.widget.parameterHintsWidget'; private readonly markdownRenderer: MarkdownRenderer; - private renderDisposeables: IDisposable[]; + private readonly renderDisposeables = this._register(new DisposableStore()); private model: ParameterHintsModel | null; private readonly keyVisible: IContextKey; private readonly keyMultipleSignatures: IContextKey; @@ -41,7 +41,6 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { private visible: boolean; private announcedLabel: string | null; private scrollbar: DomScrollableElement; - private disposables: IDisposable[]; // Editor.IContentWidget.allowEditorOverflow allowEditorOverflow = true; @@ -52,14 +51,14 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { @IOpenerService openerService: IOpenerService, @IModeService modeService: IModeService, ) { + super(); this.markdownRenderer = new MarkdownRenderer(editor, modeService, openerService); this.model = new ParameterHintsModel(editor); this.keyVisible = Context.Visible.bindTo(contextKeyService); this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService); this.visible = false; - this.disposables = []; - this.disposables.push(this.model.onChangedHints(newParameterHints => { + this._register(this.model.onChangedHints(newParameterHints => { if (newParameterHints) { this.show(); this.render(newParameterHints); @@ -79,16 +78,16 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { const next = dom.append(buttons, $('.button.next')); const onPreviousClick = stop(domEvent(previous, 'click')); - onPreviousClick(this.previous, this, this.disposables); + this._register(onPreviousClick(this.previous, this)); const onNextClick = stop(domEvent(next, 'click')); - onNextClick(this.next, this, this.disposables); + this._register(onNextClick(this.next, this)); this.overloads = dom.append(wrapper, $('.overloads')); const body = $('.body'); this.scrollbar = new DomScrollableElement(body, {}); - this.disposables.push(this.scrollbar); + this._register(this.scrollbar); wrapper.appendChild(this.scrollbar.getDomNode()); this.signature = dom.append(body, $('.signature')); @@ -99,7 +98,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { this.hide(); this.element.style.userSelect = 'text'; - this.disposables.push(this.editor.onDidChangeCursorSelection(e => { + this._register(this.editor.onDidChangeCursorSelection(e => { if (this.visible) { this.editor.layoutContentWidget(this); } @@ -112,11 +111,11 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { updateFont(); - Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) + this._register(Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) .filter(e => e.fontInfo) - .on(updateFont, null, this.disposables); + .on(updateFont, null)); - this.disposables.push(this.editor.onDidLayoutChange(e => this.updateMaxHeight())); + this._register(this.editor.onDidLayoutChange(e => this.updateMaxHeight())); this.updateMaxHeight(); } @@ -190,8 +189,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { this.renderParameters(code, signature, hints.activeParameter); } - dispose(this.renderDisposeables); - this.renderDisposeables = []; + this.renderDisposeables.clear(); const activeParameter = signature.parameters[hints.activeParameter]; @@ -202,7 +200,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { } else { const renderedContents = this.markdownRenderer.render(activeParameter.documentation); dom.addClass(renderedContents.element, 'markdown-docs'); - this.renderDisposeables.push(renderedContents); + this.renderDisposeables.add(renderedContents); documentation.appendChild(renderedContents.element); } dom.append(this.docs, $('p', {}, documentation)); @@ -216,7 +214,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { } else { const renderedContents = this.markdownRenderer.render(signature.documentation); dom.addClass(renderedContents.element, 'markdown-docs'); - this.renderDisposeables.push(renderedContents); + this.renderDisposeables.add(renderedContents); dom.append(this.docs, renderedContents.element); } @@ -323,8 +321,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { } dispose(): void { - this.disposables = dispose(this.disposables); - this.renderDisposeables = dispose(this.renderDisposeables); + super.dispose(); if (this.model) { this.model.dispose(); diff --git a/src/vs/editor/contrib/referenceSearch/media/peekViewWidget.css b/src/vs/editor/contrib/referenceSearch/media/peekViewWidget.css index 67fb333dd4d..ac669d39341 100644 --- a/src/vs/editor/contrib/referenceSearch/media/peekViewWidget.css +++ b/src/vs/editor/contrib/referenceSearch/media/peekViewWidget.css @@ -19,14 +19,6 @@ cursor: pointer; } -.monaco-editor .peekview-widget .head .peekview-title .icon { - display: inline-block; - height: 16px; - width: 16px; - vertical-align: text-bottom; - margin-right: 4px; -} - .monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty) { font-size: 0.9em; margin-left: 0.5em; diff --git a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts index a2c2f81aa96..cf34d9ea9cc 100644 --- a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts @@ -85,7 +85,6 @@ export abstract class PeekViewWidget extends ZoneWidget { private _onDidClose = new Emitter(); protected _headElement: HTMLDivElement; - protected _headingIcon: HTMLElement; protected _primaryHeading: HTMLElement; protected _secondaryHeading: HTMLElement; protected _metaHeading: HTMLElement; @@ -155,11 +154,11 @@ export abstract class PeekViewWidget extends ZoneWidget { dom.append(this._headElement, titleElement); dom.addStandardDisposableListener(titleElement, 'click', event => this._onTitleClick(event)); - this._headingIcon = dom.$('span'); + this._fillTitleIcon(titleElement); this._primaryHeading = dom.$('span.filename'); this._secondaryHeading = dom.$('span.dirname'); this._metaHeading = dom.$('span.meta'); - dom.append(titleElement, this._headingIcon, this._primaryHeading, this._secondaryHeading, this._metaHeading); + dom.append(titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading); const actionsContainer = dom.$('.peekview-actions'); dom.append(this._headElement, actionsContainer); @@ -174,6 +173,9 @@ export abstract class PeekViewWidget extends ZoneWidget { }), { label: false, icon: true }); } + protected _fillTitleIcon(container: HTMLElement): void { + } + protected _getActionBarOptions(): IActionBarOptions { return {}; } @@ -182,10 +184,6 @@ export abstract class PeekViewWidget extends ZoneWidget { // implement me } - public setTitleIcon(iconClassName: string): void { - this._headingIcon.className = iconClassName ? `icon ${iconClassName}` : ''; - } - public setTitle(primaryHeading: string, secondaryHeading?: string): void { this._primaryHeading.innerHTML = strings.escape(primaryHeading); this._primaryHeading.setAttribute('aria-label', primaryHeading); diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index 3c9e6e91b33..45aef6a5e58 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -230,7 +230,10 @@ export class ReferenceWidget extends PeekViewWidget { dispose(): void { this.setModel(undefined); this._callOnDispose = dispose(this._callOnDispose); - dispose(this._preview, this._previewNotAvailableMessage, this._tree, this._previewModelReference); + dispose(this._preview); + dispose(this._previewNotAvailableMessage); + dispose(this._tree); + dispose(this._previewModelReference); this._splitView.dispose(); super.dispose(); } diff --git a/src/vs/editor/contrib/suggest/suggestWidget.ts b/src/vs/editor/contrib/suggest/suggestWidget.ts index 5fd984f9af7..265ccca9ab8 100644 --- a/src/vs/editor/contrib/suggest/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/suggestWidget.ts @@ -9,7 +9,7 @@ import { createMatches } from 'vs/base/common/filters'; import * as strings from 'vs/base/common/strings'; import { Event, Emitter } from 'vs/base/common/event'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, toDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass, addDisposableListener } from 'vs/base/browser/dom'; import { IListVirtualDelegate, IListEvent, IListRenderer, IListMouseEvent } from 'vs/base/browser/ui/list/list'; import { List } from 'vs/base/browser/ui/list/listWidget'; @@ -103,7 +103,9 @@ class Renderer implements IListRenderer renderTemplate(container: HTMLElement): ISuggestionTemplateData { const data = Object.create(null); - data.disposables = []; + const disposables = new DisposableStore(); + data.disposables = [disposables]; + data.root = container; addClass(data.root, 'show-file-icons'); @@ -114,7 +116,7 @@ class Renderer implements IListRenderer const main = append(text, $('.main')); data.iconLabel = new IconLabel(main, { supportHighlights: true }); - data.disposables.push(data.iconLabel); + disposables.add(data.iconLabel); data.typeLabel = append(main, $('span.type-label')); @@ -142,9 +144,9 @@ class Renderer implements IListRenderer configureFont(); - Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) + disposables.add(Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) .filter(e => e.fontInfo || e.contribInfo) - .on(configureFont, null, data.disposables); + .on(configureFont, null)); return data; } @@ -226,7 +228,7 @@ const enum State { Details } -class SuggestionDetails { +class SuggestionDetails extends Disposable { private el: HTMLElement; private close: HTMLElement; @@ -236,8 +238,7 @@ class SuggestionDetails { private type: HTMLElement; private docs: HTMLElement; private ariaLabel: string | null; - private disposables: IDisposable[]; - private renderDisposeable: IDisposable; + private readonly renderDisposeable = this._register(new DisposableStore()); private borderWidth: number = 1; constructor( @@ -247,16 +248,16 @@ class SuggestionDetails { private readonly markdownRenderer: MarkdownRenderer, private readonly triggerKeybindingLabel: string ) { - this.disposables = []; + super(); this.el = append(container, $('.details')); - this.disposables.push(toDisposable(() => container.removeChild(this.el))); + this._register(toDisposable(() => container.removeChild(this.el))); this.body = $('.body'); this.scrollbar = new DomScrollableElement(this.body, {}); append(this.el, this.scrollbar.getDomNode()); - this.disposables.push(this.scrollbar); + this._register(this.scrollbar); this.header = append(this.body, $('.header')); this.close = append(this.header, $('span.close')); @@ -268,11 +269,11 @@ class SuggestionDetails { this.configureFont(); - Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) + this._register(Event.chain(this.editor.onDidChangeConfiguration.bind(this.editor)) .filter(e => e.fontInfo) - .on(this.configureFont, this, this.disposables); + .on(this.configureFont, this)); - markdownRenderer.onDidRenderCodeBlock(() => this.scrollbar.scanDomNode(), this, this.disposables); + this._register(markdownRenderer.onDidRenderCodeBlock(() => this.scrollbar.scanDomNode(), this)); } get element() { @@ -280,7 +281,7 @@ class SuggestionDetails { } render(item: CompletionItem): void { - this.renderDisposeable = dispose(this.renderDisposeable); + this.renderDisposeable.clear(); if (!item || !canExpandCompletionItem(item)) { this.type.textContent = ''; @@ -297,7 +298,7 @@ class SuggestionDetails { addClass(this.docs, 'markdown-docs'); this.docs.innerHTML = ''; const renderedContents = this.markdownRenderer.render(item.completion.documentation); - this.renderDisposeable = renderedContents; + this.renderDisposeable.add(renderedContents); this.docs.appendChild(renderedContents.element); } @@ -377,11 +378,6 @@ class SuggestionDetails { this.close.style.height = lineHeightPx; this.close.style.width = lineHeightPx; } - - dispose(): void { - this.disposables = dispose(this.disposables); - this.renderDisposeable = dispose(this.renderDisposeable); - } } export interface ISelectedSuggestion { diff --git a/src/vs/editor/contrib/suggest/wordContextKey.ts b/src/vs/editor/contrib/suggest/wordContextKey.ts index de2a026e5aa..9461b86d339 100644 --- a/src/vs/editor/contrib/suggest/wordContextKey.ts +++ b/src/vs/editor/contrib/suggest/wordContextKey.ts @@ -4,15 +4,14 @@ *--------------------------------------------------------------------------------------------*/ import { RawContextKey, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -export class WordContextKey { +export class WordContextKey extends Disposable { static readonly AtEnd = new RawContextKey('atEndOfWord', false); private readonly _ckAtEnd: IContextKey; - private readonly _confListener: IDisposable; private _enabled: boolean; private _selectionListener?: IDisposable; @@ -21,13 +20,15 @@ export class WordContextKey { private readonly _editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, ) { + super(); this._ckAtEnd = WordContextKey.AtEnd.bindTo(contextKeyService); - this._confListener = this._editor.onDidChangeConfiguration(e => e.contribInfo && this._update()); + this._register(this._editor.onDidChangeConfiguration(e => e.contribInfo && this._update())); this._update(); } dispose(): void { - dispose(this._confListener, this._selectionListener); + super.dispose(); + dispose(this._selectionListener); this._ckAtEnd.reset(); } diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts index e48dcba6535..1fc21b5fc7f 100644 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts @@ -6,24 +6,23 @@ import 'vs/css!./iPadShowKeyboard'; import * as browser from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon'; -export class IPadShowKeyboard implements IEditorContribution { +export class IPadShowKeyboard extends Disposable implements IEditorContribution { private static readonly ID = 'editor.contrib.iPadShowKeyboard'; private readonly editor: ICodeEditor; private widget: ShowKeyboardWidget | null; - private toDispose: IDisposable[]; constructor(editor: ICodeEditor) { + super(); this.editor = editor; - this.toDispose = []; if (browser.isIPad) { - this.toDispose.push(editor.onDidChangeConfiguration(() => this.update())); + this._register(editor.onDidChangeConfiguration(() => this.update())); this.update(); } } @@ -48,7 +47,7 @@ export class IPadShowKeyboard implements IEditorContribution { } public dispose(): void { - this.toDispose = dispose(this.toDispose); + super.dispose(); if (this.widget) { this.widget.dispose(); this.widget = null; @@ -56,25 +55,24 @@ export class IPadShowKeyboard implements IEditorContribution { } } -class ShowKeyboardWidget implements IOverlayWidget { +class ShowKeyboardWidget extends Disposable implements IOverlayWidget { private static readonly ID = 'editor.contrib.ShowKeyboardWidget'; private readonly editor: ICodeEditor; private readonly _domNode: HTMLElement; - private _toDispose: IDisposable[]; constructor(editor: ICodeEditor) { + super(); this.editor = editor; this._domNode = document.createElement('textarea'); this._domNode.className = 'iPadShowKeyboard'; - this._toDispose = []; - this._toDispose.push(dom.addDisposableListener(this._domNode, 'touchstart', (e) => { + this._register(dom.addDisposableListener(this._domNode, 'touchstart', (e) => { this.editor.focus(); })); - this._toDispose.push(dom.addDisposableListener(this._domNode, 'focus', (e) => { + this._register(dom.addDisposableListener(this._domNode, 'focus', (e) => { this.editor.focus(); })); @@ -83,7 +81,7 @@ class ShowKeyboardWidget implements IOverlayWidget { public dispose(): void { this.editor.removeOverlayWidget(this); - this._toDispose = dispose(this._toDispose); + super.dispose(); } // ----- IOverlayWidget API diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index 71b9b2b5d9c..a699ce708ec 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { Emitter, Event } from 'vs/base/common/event'; import { Keybinding, ResolvedKeybinding, SimpleKeybinding, createKeybinding } from 'vs/base/common/keyCodes'; -import { IDisposable, IReference, ImmortalReference, toDisposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { IDisposable, IReference, ImmortalReference, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle'; import { OS, isLinux, isMacintosh } from 'vs/base/common/platform'; import Severity from 'vs/base/common/severity'; import { URI } from 'vs/base/common/uri'; @@ -37,7 +37,7 @@ import { IKeybindingItem, KeybindingsRegistry } from 'vs/platform/keybinding/com import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { ILabelService, ResourceLabelFormatter } from 'vs/platform/label/common/label'; -import { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification } from 'vs/platform/notification/common/notification'; +import { INotification, INotificationHandle, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { IProgressRunner, ILocalProgressService } from 'vs/platform/progress/common/progress'; import { ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder, IWorkspaceFoldersChangeEvent, WorkbenchState, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; @@ -220,6 +220,10 @@ export class SimpleNotificationService implements INotificationService { public prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { return SimpleNotificationService.NO_OP; } + + public status(message: string | Error, options?: IStatusMessageOptions): IDisposable { + return Disposable.None; + } } export class StandaloneCommandService implements ICommandService { diff --git a/src/vs/editor/standalone/browser/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts index 8a1f4a9c183..f3ea17ca812 100644 --- a/src/vs/editor/standalone/browser/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -250,7 +250,7 @@ export interface IEncodedLineTokens { * - f = foreground ColorId (9 bits) * - b = background ColorId (9 bits) * - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors: - * e.g colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color, + * e.g. colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color, * id = 1 is for the default foreground color, id = 2 for the default background. */ tokens: Uint32Array; diff --git a/src/vs/loader.js b/src/vs/loader.js index 4eddcab3a02..2de484960b1 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -235,6 +235,7 @@ var AMDLoader; *--------------------------------------------------------------------------------------------*/ var AMDLoader; (function (AMDLoader) { + ; var ConfigurationOptionsUtil = (function () { function ConfigurationOptionsUtil() { } @@ -305,22 +306,8 @@ var AMDLoader; if (typeof options.nodeCachedData.writeDelay !== 'number' || options.nodeCachedData.writeDelay < 0) { options.nodeCachedData.writeDelay = 1000 * 7; } - if (typeof options.nodeCachedData.onData !== 'function') { - options.nodeCachedData.onData = function (err) { - if (err && err.errorCode === 'cachedDataRejected') { - console.warn('Rejected cached data from file: ' + err.path); - } - else if (err && err.errorCode) { - console.error('Problems handling cached data file: ' + err.path); - console.error(err.detail); - } - else if (err) { - console.error(err); - } - }; - } if (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== 'string') { - options.nodeCachedData.onData('INVALID cached data configuration, \'path\' MUST be set'); + options.onError('INVALID cached data configuration, \'path\' MUST be set'); options.nodeCachedData = undefined; } } @@ -660,7 +647,6 @@ var AMDLoader; this._env = env; this._didInitialize = false; this._didPatchNodeRequire = false; - this._hasCreateCachedData = false; } NodeScriptLoader.prototype._init = function (nodeRequire) { if (this._didInitialize) { @@ -672,14 +658,17 @@ var AMDLoader; this._vm = nodeRequire('vm'); this._path = nodeRequire('path'); this._crypto = nodeRequire('crypto'); - // check for `createCachedData`-api - this._hasCreateCachedData = typeof (new this._vm.Script('').createCachedData) === 'function'; }; // patch require-function of nodejs such that we can manually create a script // from cached data. this is done by overriding the `Module._compile` function NodeScriptLoader.prototype._initNodeRequire = function (nodeRequire, moduleManager) { + // It is important to check for `nodeCachedData` first and then set `_didPatchNodeRequire`. + // That's because `nodeCachedData` is set _after_ calling this for the first time... var nodeCachedData = moduleManager.getConfig().getOptionsLiteral().nodeCachedData; - if (!nodeCachedData || this._didPatchNodeRequire) { + if (!nodeCachedData) { + return; + } + if (this._didPatchNodeRequire) { return; } this._didPatchNodeRequire = true; @@ -708,13 +697,13 @@ var AMDLoader; content = content.replace(/^#!.*/, ''); // create wrapper function var wrapper = Module.wrap(content); - var cachedDataPath = that._getCachedDataPath(nodeCachedData.seed, nodeCachedData.path, filename); + var cachedDataPath = that._getCachedDataPath(nodeCachedData, filename); var options = { filename: filename }; try { options.cachedData = that._fs.readFileSync(cachedDataPath); } catch (e) { - options.produceCachedData = !that._hasCreateCachedData; + // ignore } var script = new that._vm.Script(wrapper, options); var compileWrapper = script.runInThisContext(options); @@ -722,7 +711,7 @@ var AMDLoader; var require = makeRequireFunction(this); var args = [this.exports, require, this, filename, dirname, process, _commonjsGlobal, Buffer]; var result = compileWrapper.apply(this.exports, args); - that._processCachedData(moduleManager, script, wrapper, cachedDataPath, !options.cachedData); + that._processCachedData(script, cachedDataPath, Boolean(options.cachedData), moduleManager.getConfig(), moduleManager.getRecorder()); return result; }; }; @@ -780,16 +769,16 @@ var AMDLoader; _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, { filename: vmScriptSrc }, recorder, callback, errorback); } else { - var cachedDataPath_1 = _this._getCachedDataPath(opts.nodeCachedData.seed, opts.nodeCachedData.path, scriptSrc); + var cachedDataPath_1 = _this._getCachedDataPath(opts.nodeCachedData, scriptSrc); _this._fs.readFile(cachedDataPath_1, function (_err, cachedData) { // create script options var options = { filename: vmScriptSrc, - produceCachedData: !_this._hasCreateCachedData && typeof cachedData === 'undefined', cachedData: cachedData }; + recorder.record(cachedData ? 60 /* CachedDataFound */ : 61 /* CachedDataMissed */, scriptSrc); var script = _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, options, recorder, callback, errorback); - _this._processCachedData(moduleManager, script, contents, cachedDataPath_1, !options.cachedData); + _this._processCachedData(script, cachedDataPath_1, Boolean(cachedData), moduleManager.getConfig(), recorder); }); } }); @@ -818,74 +807,56 @@ var AMDLoader; } return script; }; - NodeScriptLoader.prototype._getCachedDataPath = function (seed, basedir, filename) { - var hash = this._crypto.createHash('md5').update(filename, 'utf8').update(seed, 'utf8').digest('hex'); + NodeScriptLoader.prototype._getCachedDataPath = function (config, filename) { + var hash = this._crypto.createHash('md5').update(filename, 'utf8').update(config.seed, 'utf8').digest('hex'); var basename = this._path.basename(filename).replace(/\.js$/, ''); - return this._path.join(basedir, basename + "-" + hash + ".code"); + return this._path.join(config.path, basename + "-" + hash + ".code"); }; - NodeScriptLoader.prototype._processCachedData = function (moduleManager, script, contents, cachedDataPath, createCachedData) { + NodeScriptLoader.prototype._processCachedData = function (script, cachedDataPath, hadCachedData, config, recorder) { var _this = this; if (script.cachedDataRejected) { - // data rejected => delete cache file - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData({ - errorCode: 'cachedDataRejected', - path: cachedDataPath + // rejected cached data + // (1) delete data + // (2) create new data + recorder.record(62 /* CachedDataRejected */, cachedDataPath); + this._fs.unlink(cachedDataPath, function (err) { + if (err) { + config.onError(err); + } + _this._createCachedData(script, cachedDataPath, config, recorder); }); - NodeScriptLoader._runSoon(function () { - return _this._fs.unlink(cachedDataPath, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData({ - errorCode: 'unlink', - path: cachedDataPath, - detail: err - }); - } - }); - }, moduleManager.getConfig().getOptionsLiteral().nodeCachedData.writeDelay / 2); } - else if (script.cachedDataProduced) { - // data produced => tell outside world - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData(undefined, { - path: cachedDataPath - }); - // data produced => write cache file - NodeScriptLoader._runSoon(function () { - return _this._fs.writeFile(cachedDataPath, script.cachedData, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData({ - errorCode: 'writeFile', - path: cachedDataPath, - detail: err - }); - } - }); - }, moduleManager.getConfig().getOptionsLiteral().nodeCachedData.writeDelay); - } - else if (this._hasCreateCachedData && createCachedData) { - // NEW world - // data produced => tell outside world - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData(undefined, { - path: cachedDataPath - }); - // soon'ish create and save cached data - NodeScriptLoader._runSoon(function () { - var data = script.createCachedData(contents); - _this._fs.writeFile(cachedDataPath, data, function (err) { - if (!err) { - return; - } - moduleManager.getConfig().getOptionsLiteral().nodeCachedData.onData({ - errorCode: 'writeFile', - path: cachedDataPath, - detail: err - }); - }); - }, moduleManager.getConfig().getOptionsLiteral().nodeCachedData.writeDelay); + else if (!hadCachedData) { + // create cached data unless we already had + // and accepted cached data + this._createCachedData(script, cachedDataPath, config, recorder); } }; - NodeScriptLoader._runSoon = function (callback, minTimeout) { - var timeout = minTimeout + Math.ceil(Math.random() * minTimeout); - setTimeout(callback, timeout); + NodeScriptLoader.prototype._createCachedData = function (script, cachedDataPath, config, recorder) { + var _this = this; + var timeout = Math.ceil(config.getOptionsLiteral().nodeCachedData.writeDelay * (1 + Math.random())); + var lastSize = -1; + var iteration = 0; + var createLoop = function () { + setTimeout(function () { + var data = script.createCachedData(); + if (data.length === lastSize) { + return; + } + lastSize = data.length; + _this._fs.writeFile(cachedDataPath, data, function (err) { + if (err) { + config.onError(err); + } + recorder.record(63 /* CachedDataCreated */, cachedDataPath); + createLoop(); + }); + }, timeout * (Math.pow(4, iteration++))); + }; + // with some delay (`timeout`) create cached data + // and repeat that (with backoff delay) until the + // data seems to be not changing anymore + createLoop(); }; return NodeScriptLoader; }()); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 2405c549d10..9a44a9563e4 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4271,7 +4271,7 @@ declare namespace monaco.languages { * - f = foreground ColorId (9 bits) * - b = background ColorId (9 bits) * - The color value for each colorId is defined in IStandaloneThemeData.customTokenColors: - * e.g colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color, + * e.g. colorId = 1 is stored in IStandaloneThemeData.customTokenColors[1]. Color id = 0 means no color, * id = 1 is for the default foreground color, id = 2 for the default background. */ tokens: Uint32Array; @@ -5449,16 +5449,21 @@ declare namespace monaco.languages { arguments?: any[]; } - export interface ICodeLensSymbol { + export interface CodeLens { range: IRange; id?: string; command?: Command; } + export interface CodeLensList { + lenses: CodeLens[]; + dispose(): void; + } + export interface CodeLensProvider { onDidChange?: IEvent; - provideCodeLenses(model: editor.ITextModel, token: CancellationToken): ProviderResult; - resolveCodeLens?(model: editor.ITextModel, codeLens: ICodeLensSymbol, token: CancellationToken): ProviderResult; + provideCodeLenses(model: editor.ITextModel, token: CancellationToken): ProviderResult; + resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult; } export interface ILanguageExtensionPoint { diff --git a/src/vs/platform/actions/common/menuService.ts b/src/vs/platform/actions/common/menuService.ts index 1523ae10337..e0ee881b773 100644 --- a/src/vs/platform/actions/common/menuService.ts +++ b/src/vs/platform/actions/common/menuService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter, Event } from 'vs/base/common/event'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IMenu, IMenuActionOptions, IMenuItem, IMenuService, isIMenuItem, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction } from 'vs/platform/actions/common/actions'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr, IContextKeyService, IContextKeyChangeEvent } from 'vs/platform/contextkey/common/contextkey'; @@ -27,10 +27,9 @@ export class MenuService implements IMenuService { type MenuItemGroup = [string, Array]; -class Menu implements IMenu { +class Menu extends Disposable implements IMenu { - private readonly _onDidChange = new Emitter(); - private readonly _disposables: IDisposable[] = []; + private readonly _onDidChange = this._register(new Emitter()); private _menuGroups: MenuItemGroup[]; private _contextKeys: Set; @@ -40,23 +39,24 @@ class Menu implements IMenu { @ICommandService private readonly _commandService: ICommandService, @IContextKeyService private readonly _contextKeyService: IContextKeyService ) { + super(); this._build(); // rebuild this menu whenever the menu registry reports an // event for this MenuId - Event.debounce( + this._register(Event.debounce( Event.filter(MenuRegistry.onDidChangeMenu, menuId => menuId === this._id), () => { }, 50 - )(this._build, this, this._disposables); + )(this._build, this)); // when context keys change we need to check if the menu also // has changed - Event.debounce( + this._register(Event.debounce( this._contextKeyService.onDidChangeContext, (last, event) => last || event.affectsSome(this._contextKeys), 50 - )(e => e && this._onDidChange.fire(undefined), this, this._disposables); + )(e => e && this._onDidChange.fire(undefined), this)); } private _build(): void { @@ -95,11 +95,6 @@ class Menu implements IMenu { this._onDidChange.fire(this); } - dispose() { - dispose(this._disposables); - this._onDidChange.dispose(); - } - get onDidChange(): Event { return this._onDidChange.event; } diff --git a/src/vs/platform/configuration/node/configuration.ts b/src/vs/platform/configuration/node/configuration.ts deleted file mode 100644 index 1d3a6cd3412..00000000000 --- a/src/vs/platform/configuration/node/configuration.ts +++ /dev/null @@ -1,56 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Disposable } from 'vs/base/common/lifecycle'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { ConfigurationModelParser, ConfigurationModel } from 'vs/platform/configuration/common/configurationModels'; -import { ConfigWatcher } from 'vs/base/node/config'; -import { Event, Emitter } from 'vs/base/common/event'; - -export class NodeBasedUserConfiguration extends Disposable { - - private userConfigModelWatcher: ConfigWatcher; - private initializePromise: Promise; - - private readonly _onDidChangeConfiguration: Emitter = this._register(new Emitter()); - readonly onDidChangeConfiguration: Event = this._onDidChangeConfiguration.event; - - constructor(private settingsPath: string) { - super(); - } - - initialize(): Promise { - if (!this.initializePromise) { - this.initializePromise = new Promise((c, e) => { - this.userConfigModelWatcher = new ConfigWatcher(this.settingsPath, { - changeBufferDelay: 300, onError: error => onUnexpectedError(error), defaultConfig: new ConfigurationModelParser(this.settingsPath), parse: (content: string, parseErrors: any[]) => { - const userConfigModelParser = new ConfigurationModelParser(this.settingsPath); - userConfigModelParser.parseContent(content); - parseErrors = [...userConfigModelParser.errors]; - return userConfigModelParser; - }, initCallback: () => c(undefined) - }); - this._register(this.userConfigModelWatcher); - - // Listeners - this._register(this.userConfigModelWatcher.onDidUpdateConfiguration(() => this._onDidChangeConfiguration.fire(this.userConfigModelWatcher.getConfig().configurationModel))); - }); - } - return this.initializePromise.then(() => this.userConfigModelWatcher.getConfig().configurationModel); - } - - initializeSync(): ConfigurationModel { - this.initialize(); - return this.userConfigModelWatcher.getConfig().configurationModel; - } - - reload(): Promise { - return this.initialize().then(() => new Promise(c => this.userConfigModelWatcher.reload(userConfigModelParser => c(userConfigModelParser.configurationModel)))); - } - - getConfigurationModel(): ConfigurationModel { - return this.userConfigModelWatcher.getConfig().configurationModel; - } -} \ No newline at end of file diff --git a/src/vs/platform/configuration/node/configurationService.ts b/src/vs/platform/configuration/node/configurationService.ts index 496cdbed4cf..a9b76c1429f 100644 --- a/src/vs/platform/configuration/node/configurationService.ts +++ b/src/vs/platform/configuration/node/configurationService.ts @@ -7,40 +7,49 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { IConfigurationService, IConfigurationChangeEvent, IConfigurationOverrides, ConfigurationTarget, compare, isConfigurationOverrides, IConfigurationData } from 'vs/platform/configuration/common/configuration'; -import { DefaultConfigurationModel, Configuration, ConfigurationChangeEvent, ConfigurationModel } from 'vs/platform/configuration/common/configurationModels'; +import { DefaultConfigurationModel, Configuration, ConfigurationChangeEvent, ConfigurationModel, ConfigurationModelParser } from 'vs/platform/configuration/common/configurationModels'; import { Event, Emitter } from 'vs/base/common/event'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { NodeBasedUserConfiguration } from 'vs/platform/configuration/node/configuration'; +import { ConfigWatcher } from 'vs/base/node/config'; +import { onUnexpectedError } from 'vs/base/common/errors'; export class ConfigurationService extends Disposable implements IConfigurationService, IDisposable { _serviceBrand: any; - private _configuration: Configuration; - private userConfiguration: NodeBasedUserConfiguration; + private configuration: Configuration; + private userConfigModelWatcher: ConfigWatcher | undefined; private readonly _onDidChangeConfiguration: Emitter = this._register(new Emitter()); readonly onDidChangeConfiguration: Event = this._onDidChangeConfiguration.event; constructor( - configurationPath: string + private readonly configurationPath: string ) { super(); - - this.userConfiguration = this._register(new NodeBasedUserConfiguration(configurationPath)); - - // Initialize - const defaults = new DefaultConfigurationModel(); - const user = this.userConfiguration.initializeSync(); - this._configuration = new Configuration(defaults, user); - - // Listeners - this._register(this.userConfiguration.onDidChangeConfiguration(userConfigurationModel => this.onDidChangeUserConfiguration(userConfigurationModel))); + this.configuration = new Configuration(new DefaultConfigurationModel(), new ConfigurationModel()); this._register(Registry.as(Extensions.Configuration).onDidUpdateConfiguration(configurationProperties => this.onDidDefaultConfigurationChange(configurationProperties))); } - get configuration(): Configuration { - return this._configuration; + initialize(): Promise { + if (this.userConfigModelWatcher) { + this.userConfigModelWatcher.dispose(); + } + + return new Promise((c, e) => { + this.userConfigModelWatcher = this._register(new ConfigWatcher(this.configurationPath, { + changeBufferDelay: 300, onError: error => onUnexpectedError(error), defaultConfig: new ConfigurationModelParser(this.configurationPath), parse: (content: string, parseErrors: any[]) => { + const userConfigModelParser = new ConfigurationModelParser(this.configurationPath); + userConfigModelParser.parseContent(content); + parseErrors = [...userConfigModelParser.errors]; + return userConfigModelParser; + }, initCallback: () => { + this.configuration = new Configuration(new DefaultConfigurationModel(), this.userConfigModelWatcher!.getConfig().configurationModel); + this._register(this.userConfigModelWatcher!.onDidUpdateConfiguration(() => this.onDidChangeUserConfiguration(this.userConfigModelWatcher!.getConfig().configurationModel))); + c(); + } + })); + }); } getConfigurationData(): IConfigurationData { @@ -85,21 +94,26 @@ export class ConfigurationService extends Disposable implements IConfigurationSe } reloadConfiguration(folder?: IWorkspaceFolder): Promise { - return folder ? Promise.resolve(undefined) : - this.userConfiguration.reload().then(userConfigurationModel => this.onDidChangeUserConfiguration(userConfigurationModel)); + if (this.userConfigModelWatcher) { + return new Promise(c => this.userConfigModelWatcher!.reload(userConfigModelParser => { + this.onDidChangeUserConfiguration(userConfigModelParser.configurationModel); + c(); + })); + } + return this.initialize(); } private onDidChangeUserConfiguration(userConfigurationModel: ConfigurationModel): void { - const { added, updated, removed } = compare(this._configuration.localUserConfiguration, userConfigurationModel); + const { added, updated, removed } = compare(this.configuration.localUserConfiguration, userConfigurationModel); const changedKeys = [...added, ...updated, ...removed]; if (changedKeys.length) { - this._configuration.updateLocalUserConfiguration(userConfigurationModel); + this.configuration.updateLocalUserConfiguration(userConfigurationModel); this.trigger(changedKeys, ConfigurationTarget.USER); } } private onDidDefaultConfigurationChange(keys: string[]): void { - this._configuration.updateDefaultConfiguration(new DefaultConfigurationModel()); + this.configuration.updateDefaultConfiguration(new DefaultConfigurationModel()); this.trigger(keys, ConfigurationTarget.DEFAULT); } @@ -110,9 +124,9 @@ export class ConfigurationService extends Disposable implements IConfigurationSe private getTargetConfiguration(target: ConfigurationTarget): any { switch (target) { case ConfigurationTarget.DEFAULT: - return this._configuration.defaults.contents; + return this.configuration.defaults.contents; case ConfigurationTarget.USER: - return this._configuration.localUserConfiguration.contents; + return this.configuration.localUserConfiguration.contents; } return {}; } diff --git a/src/vs/platform/configuration/test/node/configurationService.test.ts b/src/vs/platform/configuration/test/node/configurationService.test.ts index 5c4970f436d..8cd83c1e9c0 100644 --- a/src/vs/platform/configuration/test/node/configurationService.test.ts +++ b/src/vs/platform/configuration/test/node/configurationService.test.ts @@ -21,6 +21,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(res.testFile, '{ "foo": "bar" }'); const service = new ConfigurationService(res.testFile); + await service.initialize(); const config = service.getValue<{ foo: string; }>(); @@ -38,6 +39,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(res.testFile, '{ "testworkbench.editor.tabs": true }'); const service = new ConfigurationService(res.testFile); + await service.initialize(); const config = service.getValue<{ testworkbench: { editor: { @@ -60,6 +62,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(res.testFile, ',,,,'); const service = new ConfigurationService(res.testFile); + await service.initialize(); const config = service.getValue<{ foo: string; }>(); @@ -69,13 +72,14 @@ suite('ConfigurationService - Node', () => { return res.cleanUp(); }); - test('missing file does not explode', () => { + test('missing file does not explode', async () => { const id = uuid.generateUuid(); const parentDir = path.join(os.tmpdir(), 'vsctests', id); const newDir = path.join(parentDir, 'config', id); const testFile = path.join(newDir, 'config.json'); const service = new ConfigurationService(testFile); + await service.initialize(); const config = service.getValue<{ foo: string }>(); assert.ok(config); @@ -87,6 +91,7 @@ suite('ConfigurationService - Node', () => { const res = await testFile('config', 'config.json'); const service = new ConfigurationService(res.testFile); + await service.initialize(); return new Promise((c, e) => { service.onDidChangeConfiguration(() => { assert.equal(service.getValue('foo'), 'bar'); @@ -104,6 +109,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(res.testFile, '{ "foo": "bar" }'); const service = new ConfigurationService(res.testFile); + await service.initialize(); let config = service.getValue<{ foo: string; }>(); @@ -130,7 +136,7 @@ suite('ConfigurationService - Node', () => { return res.cleanUp(); }); - test('model defaults', () => { + test('model defaults', async () => { interface ITestSetting { configuration: { service: { @@ -152,6 +158,7 @@ suite('ConfigurationService - Node', () => { }); let serviceWithoutFile = new ConfigurationService('__testFile'); + await serviceWithoutFile.initialize(); let setting = serviceWithoutFile.getValue(); assert.ok(setting); @@ -194,6 +201,8 @@ suite('ConfigurationService - Node', () => { const r = await testFile('config', 'config.json'); const service = new ConfigurationService(r.testFile); + service.initialize(); + let res = service.inspect('something.missing'); assert.strictEqual(res.value, undefined); assert.strictEqual(res.default, undefined); @@ -230,6 +239,8 @@ suite('ConfigurationService - Node', () => { const r = await testFile('config', 'config.json'); const service = new ConfigurationService(r.testFile); + service.initialize(); + let res = service.inspect('lookup.service.testNullSetting'); assert.strictEqual(res.default, null); assert.strictEqual(res.value, null); diff --git a/src/vs/platform/driver/electron-browser/driver.ts b/src/vs/platform/driver/electron-browser/driver.ts index 36246b59ad3..d6dc3f659bc 100644 --- a/src/vs/platform/driver/electron-browser/driver.ts +++ b/src/vs/platform/driver/electron-browser/driver.ts @@ -10,7 +10,7 @@ import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProces import { getTopLeftOffset, getClientArea } from 'vs/base/browser/dom'; import * as electron from 'electron'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { Terminal } from 'vscode-xterm'; +import { Terminal } from 'xterm'; import { timeout } from 'vs/base/common/async'; import { coalesce } from 'vs/base/common/arrays'; diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index f48e072b5e8..bb0085ef2ef 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -27,7 +27,6 @@ export interface ParsedArgs { 'prof-startup'?: string; 'prof-startup-prefix'?: string; 'prof-append-timers'?: string; - 'prof-modules'?: string; verbose?: boolean; trace?: boolean; 'trace-category-filter'?: string; @@ -69,6 +68,7 @@ export interface ParsedArgs { 'driver'?: string; 'driver-verbose'?: boolean; remote?: string; + 'disable-user-env-probe'?: boolean; } export const IEnvironmentService = createDecorator('environmentService'); diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index 33d28e88cfc..b3e99e2b808 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -54,7 +54,6 @@ export const options: Option[] = [ { id: 'verbose', type: 'boolean', cat: 't', description: localize('verbose', "Print verbose output (implies --wait).") }, { id: 'log', type: 'string', cat: 't', args: 'level', description: localize('log', "Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.") }, { id: 'status', type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") }, - { id: 'prof-modules', type: 'boolean', alias: 'p', cat: 't', description: localize('prof-modules', "Capture performance markers while loading JS modules and print them with 'F1 > Developer: Startup Performance") }, { id: 'prof-startup', type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") }, { id: 'disable-extensions', type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") }, { id: 'disable-extension', type: 'string', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") }, @@ -275,4 +274,4 @@ export function createWaitMarkerFile(verbose?: boolean): string | undefined { } return undefined; } -} \ No newline at end of file +} diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index a89da0fa419..36fc28f7e00 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -114,16 +114,16 @@ export class ExtensionManagementService extends Disposable implements IExtension private readonly manifestCache: ExtensionsManifestCache; private readonly extensionLifecycle: ExtensionsLifecycle; - private readonly _onInstallExtension = new Emitter(); + private readonly _onInstallExtension = this._register(new Emitter()); readonly onInstallExtension: Event = this._onInstallExtension.event; - private readonly _onDidInstallExtension = new Emitter(); + private readonly _onDidInstallExtension = this._register(new Emitter()); readonly onDidInstallExtension: Event = this._onDidInstallExtension.event; - private readonly _onUninstallExtension = new Emitter(); + private readonly _onUninstallExtension = this._register(new Emitter()); readonly onUninstallExtension: Event = this._onUninstallExtension.event; - private _onDidUninstallExtension = new Emitter(); + private _onDidUninstallExtension = this._register(new Emitter()); onDidUninstallExtension: Event = this._onDidUninstallExtension.event; constructor( @@ -267,9 +267,6 @@ export class ExtensionManagementService extends Disposable implements IExtension async installFromGallery(extension: IGalleryExtension): Promise { const startTime = new Date().getTime(); - this.logService.info('Installing extension:', extension.identifier.id); - this._onInstallExtension.fire({ identifier: extension.identifier, gallery: extension }); - const onDidInstallExtensionSuccess = (extension: IGalleryExtension, operation: InstallOperation, local: ILocalExtension) => { this.logService.info(`Extensions installed successfully:`, extension.identifier.id); this._onDidInstallExtension.fire({ identifier: extension.identifier, gallery: extension, local, operation }); @@ -297,6 +294,9 @@ export class ExtensionManagementService extends Disposable implements IExtension let cancellablePromise = this.installingExtensions.get(key); if (!cancellablePromise) { + this.logService.info('Installing extension:', extension.identifier.id); + this._onInstallExtension.fire({ identifier: extension.identifier, gallery: extension }); + let operation: InstallOperation = InstallOperation.Install; let cancellationToken: CancellationToken, successCallback: (a?: any) => void, errorCallback: (e?: any) => any | null; cancellablePromise = createCancelablePromise(token => { cancellationToken = token; return new Promise((c, e) => { successCallback = c; errorCallback = e; }); }); @@ -480,12 +480,12 @@ export class ExtensionManagementService extends Disposable implements IExtension e => Promise.reject(new ExtensionManagementError(this.joinErrors(e).message, INSTALL_ERROR_DELETING))); } - private rename(identfier: IExtensionIdentifier, extractPath: string, renamePath: string, retryUntil: number): Promise { + private rename(identifier: IExtensionIdentifier, extractPath: string, renamePath: string, retryUntil: number): Promise { return pfs.rename(extractPath, renamePath) .then(undefined, error => { if (isWindows && error && error.code === 'EPERM' && Date.now() < retryUntil) { - this.logService.info(`Failed renaming ${extractPath} to ${renamePath} with 'EPERM' error. Trying again...`, identfier.id); - return this.rename(identfier, extractPath, renamePath, retryUntil); + this.logService.info(`Failed renaming ${extractPath} to ${renamePath} with 'EPERM' error. Trying again...`, identifier.id); + return this.rename(identifier, extractPath, renamePath, retryUntil); } return Promise.reject(new ExtensionManagementError(error.message || nls.localize('renameError', "Unknown error while renaming {0} to {1}", extractPath, renamePath), error.code || INSTALL_ERROR_RENAMING)); }); @@ -723,7 +723,7 @@ export class ExtensionManagementService extends Disposable implements IExtension this.logService.trace('Started scanning system extensions'); const systemExtensionsPromise = this.scanExtensions(this.systemExtensionsPath, ExtensionType.System) .then(result => { - this.logService.info('Scanned system extensions:', result.length); + this.logService.trace('Scanned system extensions:', result.length); return result; }); if (this.environmentService.isBuilt) { @@ -736,7 +736,7 @@ export class ExtensionManagementService extends Disposable implements IExtension if (devSystemExtensionsList.length) { return this.scanExtensions(this.devSystemExtensionsPath, ExtensionType.System) .then(result => { - this.logService.info('Scanned dev system extensions:', result.length); + this.logService.trace('Scanned dev system extensions:', result.length); return result.filter(r => devSystemExtensionsList.some(id => areSameExtensions(r.identifier, { id }))); }); } else { @@ -756,7 +756,7 @@ export class ExtensionManagementService extends Disposable implements IExtension const byExtension: ILocalExtension[][] = groupByExtension(extensions, e => e.identifier); extensions = byExtension.map(p => p.sort((a, b) => semver.rcompare(a.manifest.version, b.manifest.version))[0]); } - this.logService.info('Scanned user extensions:', extensions.length); + this.logService.trace('Scanned user extensions:', extensions.length); return extensions; }); } @@ -835,8 +835,8 @@ export class ExtensionManagementService extends Disposable implements IExtension return pfs.rimraf(extension.location.fsPath).then(() => this.logService.info('Deleted from disk', extension.identifier.id, extension.location.fsPath)); } - private isUninstalled(identfier: ExtensionIdentifierWithVersion): Promise { - return this.filterUninstalled(identfier).then(uninstalled => uninstalled.length === 1); + private isUninstalled(identifier: ExtensionIdentifierWithVersion): Promise { + return this.filterUninstalled(identifier).then(uninstalled => uninstalled.length === 1); } private filterUninstalled(...identifiers: ExtensionIdentifierWithVersion[]): Promise { diff --git a/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts b/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts index 1cf171942b7..0e464b1db02 100644 --- a/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts +++ b/src/vs/platform/extensionManagement/node/extensionsManifestCache.ts @@ -16,11 +16,11 @@ export class ExtensionsManifestCache extends Disposable { constructor( private readonly environmentService: IEnvironmentService, - extensionsManagementServuce: IExtensionManagementService + extensionsManagementService: IExtensionManagementService ) { super(); - this._register(extensionsManagementServuce.onDidInstallExtension(e => this.onDidInstallExtension(e))); - this._register(extensionsManagementServuce.onDidUninstallExtension(e => this.onDidUnInstallExtension(e))); + this._register(extensionsManagementService.onDidInstallExtension(e => this.onDidInstallExtension(e))); + this._register(extensionsManagementService.onDidUninstallExtension(e => this.onDidUnInstallExtension(e))); } private onDidInstallExtension(e: DidInstallExtensionEvent): void { diff --git a/src/vs/platform/keybinding/common/abstractKeybindingService.ts b/src/vs/platform/keybinding/common/abstractKeybindingService.ts index 33e1efbebb2..e5d4a3f979a 100644 --- a/src/vs/platform/keybinding/common/abstractKeybindingService.ts +++ b/src/vs/platform/keybinding/common/abstractKeybindingService.ts @@ -15,7 +15,6 @@ import { IKeybindingEvent, IKeybindingService, IKeyboardEvent } from 'vs/platfor import { IResolveResult, KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; interface CurrentChord { @@ -26,45 +25,32 @@ interface CurrentChord { export abstract class AbstractKeybindingService extends Disposable implements IKeybindingService { public _serviceBrand: any; + protected readonly _onDidUpdateKeybindings: Emitter = this._register(new Emitter()); + get onDidUpdateKeybindings(): Event { + return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : Event.None; // Sinon stubbing walks properties on prototype + } + private _currentChord: CurrentChord | null; private _currentChordChecker: IntervalTimer; private _currentChordStatusMessage: IDisposable | null; - protected _onDidUpdateKeybindings: Emitter; - - private _contextKeyService: IContextKeyService; - private _statusService: IStatusbarService | undefined; - private _notificationService: INotificationService; - protected _commandService: ICommandService; - protected _telemetryService: ITelemetryService; constructor( - contextKeyService: IContextKeyService, - commandService: ICommandService, - telemetryService: ITelemetryService, - notificationService: INotificationService, - statusService?: IStatusbarService + private _contextKeyService: IContextKeyService, + protected _commandService: ICommandService, + protected _telemetryService: ITelemetryService, + private _notificationService: INotificationService, ) { super(); - this._contextKeyService = contextKeyService; - this._commandService = commandService; - this._telemetryService = telemetryService; - this._statusService = statusService; - this._notificationService = notificationService; this._currentChord = null; this._currentChordChecker = new IntervalTimer(); this._currentChordStatusMessage = null; - this._onDidUpdateKeybindings = this._register(new Emitter()); } public dispose(): void { super.dispose(); } - get onDidUpdateKeybindings(): Event { - return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : Event.None; // Sinon stubbing walks properties on prototype - } - protected abstract _getResolver(): KeybindingResolver; protected abstract _documentHasFocus(): boolean; public abstract resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[]; @@ -128,9 +114,7 @@ export abstract class AbstractKeybindingService extends Disposable implements IK keypress: firstPart, label: keypressLabel }; - if (this._statusService) { - this._currentChordStatusMessage = this._statusService.setStatusMessage(nls.localize('first.chord', "({0}) was pressed. Waiting for second key of chord...", keypressLabel)); - } + this._currentChordStatusMessage = this._notificationService.status(nls.localize('first.chord', "({0}) was pressed. Waiting for second key of chord...", keypressLabel)); const chordEnterTime = Date.now(); this._currentChordChecker.cancelAndSet(() => { @@ -192,9 +176,9 @@ export abstract class AbstractKeybindingService extends Disposable implements IK return shouldPreventDefault; } - if (this._statusService && this._currentChord) { + if (this._currentChord) { if (!resolveResult || !resolveResult.commandId) { - this._statusService.setStatusMessage(nls.localize('missing.chord', "The key combination ({0}, {1}) is not a command.", this._currentChord.label, keypressLabel), 10 * 1000 /* 10s */); + this._notificationService.status(nls.localize('missing.chord', "The key combination ({0}, {1}) is not a command.", this._currentChord.label, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ }); shouldPreventDefault = true; } } diff --git a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts index 72c2062202c..7ddc222b5ca 100644 --- a/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts +++ b/src/vs/platform/keybinding/test/common/abstractKeybindingService.test.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; import { KeyChord, KeyCode, KeyMod, Keybinding, ResolvedKeybinding, SimpleKeybinding, createKeybinding, createSimpleKeybinding } from 'vs/base/common/keyCodes'; -import { IDisposable } from 'vs/base/common/lifecycle'; import { OS } from 'vs/base/common/platform'; import Severity from 'vs/base/common/severity'; import { ICommandService } from 'vs/platform/commands/common/commands'; @@ -14,9 +13,9 @@ import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; -import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification } from 'vs/platform/notification/common/notification'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; +import { INotification, INotificationService, IPromptChoice, IPromptOptions, NoOpNotification, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; +import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; function createContext(ctx: any) { return { @@ -35,10 +34,9 @@ suite('AbstractKeybindingService', () => { resolver: KeybindingResolver, contextKeyService: IContextKeyService, commandService: ICommandService, - notificationService: INotificationService, - statusService?: IStatusbarService + notificationService: INotificationService ) { - super(contextKeyService, commandService, NullTelemetryService, notificationService, statusService); + super(contextKeyService, commandService, NullTelemetryService, notificationService); this._resolver = resolver; } @@ -129,7 +127,7 @@ suite('AbstractKeybindingService', () => { }; let notificationService: INotificationService = { - _serviceBrand: undefined, + _serviceBrand: {} as ServiceIdentifier, notify: (notification: INotification) => { showMessageCalls.push({ sev: notification.severity, message: notification.message }); return new NoOpNotification(); @@ -148,13 +146,8 @@ suite('AbstractKeybindingService', () => { }, prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions) { throw new Error('not implemented'); - } - }; - - let statusbarService: IStatusbarService = { - _serviceBrand: undefined, - addEntry: undefined!, - setStatusMessage: (message: string, autoDisposeAfter?: number, delayBy?: number): IDisposable => { + }, + status(message: string, options?: IStatusMessageOptions) { statusMessageCalls!.push(message); return { dispose: () => { @@ -166,7 +159,7 @@ suite('AbstractKeybindingService', () => { let resolver = new KeybindingResolver(items, []); - return new TestKeybindingService(resolver, contextKeyService, commandService, notificationService, statusbarService); + return new TestKeybindingService(resolver, contextKeyService, commandService, notificationService); }; }); diff --git a/src/vs/platform/log/common/log.ts b/src/vs/platform/log/common/log.ts index abba518e47d..8b9fea5e257 100644 --- a/src/vs/platform/log/common/log.ts +++ b/src/vs/platform/log/common/log.ts @@ -186,7 +186,7 @@ export class ConsoleLogService extends AbstractLogService implements ILogService export class MultiplexLogService extends AbstractLogService implements ILogService { _serviceBrand: any; - constructor(private logServices: ILogService[]) { + constructor(private readonly logServices: ReadonlyArray) { super(); if (logServices.length) { this.setLevel(logServices[0].getLevel()); diff --git a/src/vs/platform/markers/common/markers.ts b/src/vs/platform/markers/common/markers.ts index cffd2962259..9461b506c21 100644 --- a/src/vs/platform/markers/common/markers.ts +++ b/src/vs/platform/markers/common/markers.ts @@ -71,6 +71,15 @@ export namespace MarkerSeverity { case Severity.Ignore: return MarkerSeverity.Hint; } } + + export function toSeverity(severity: MarkerSeverity): Severity { + switch (severity) { + case MarkerSeverity.Error: return Severity.Error; + case MarkerSeverity.Warning: return Severity.Warning; + case MarkerSeverity.Info: return Severity.Info; + case MarkerSeverity.Hint: return Severity.Ignore; + } + } } /** diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts index 6ffab39ac35..a96985ffcc7 100644 --- a/src/vs/platform/notification/common/notification.ts +++ b/src/vs/platform/notification/common/notification.ts @@ -4,9 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import BaseSeverity from 'vs/base/common/severity'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { IAction } from 'vs/base/common/actions'; import { Event, Emitter } from 'vs/base/common/event'; +import { IDisposable } from 'vs/base/common/lifecycle'; export import Severity = BaseSeverity; @@ -172,6 +173,21 @@ export interface IPromptOptions extends INotificationProperties { onCancel?: () => void; } +export interface IStatusMessageOptions { + + /** + * An optional timeout after which the status message should show. By default + * the status message will show immediately. + */ + showAfter?: number; + + /** + * An optional timeout after which the status message is to be hidden. By default + * the status message will not hide until another status message is displayed. + */ + hideAfter?: number; +} + /** * A service to bring up notifications and non-modal prompts. * @@ -179,7 +195,7 @@ export interface IPromptOptions extends INotificationProperties { */ export interface INotificationService { - _serviceBrand: any; + _serviceBrand: ServiceIdentifier; /** * Show the provided notification to the user. The returned `INotificationHandle` @@ -221,16 +237,24 @@ export interface INotificationService { * @returns a handle on the notification to e.g. hide it or update message, buttons, etc. */ prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle; + + /** + * Shows a status message in the status area with the provied text. + * + * @param message the message to show as status + * @param options provides some optional configuration options + * + * @returns a disposable to hide the status message + */ + status(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable; } export class NoOpNotification implements INotificationHandle { + readonly progress = new NoOpProgress(); private readonly _onDidClose: Emitter = new Emitter(); - - get onDidClose(): Event { - return this._onDidClose.event; - } + get onDidClose(): Event { return this._onDidClose.event; } updateSeverity(severity: Severity): void { } updateMessage(message: NotificationMessage): void { } diff --git a/src/vs/platform/notification/test/common/testNotificationService.ts b/src/vs/platform/notification/test/common/testNotificationService.ts index 4385727a2ec..933469987ed 100644 --- a/src/vs/platform/notification/test/common/testNotificationService.ts +++ b/src/vs/platform/notification/test/common/testNotificationService.ts @@ -3,31 +3,36 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification'; +import { INotificationService, INotificationHandle, NoOpNotification, Severity, INotification, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; +import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; export class TestNotificationService implements INotificationService { - public _serviceBrand: any; + _serviceBrand: any; private static readonly NO_OP: INotificationHandle = new NoOpNotification(); - public info(message: string): INotificationHandle { + info(message: string): INotificationHandle { return this.notify({ severity: Severity.Info, message }); } - public warn(message: string): INotificationHandle { + warn(message: string): INotificationHandle { return this.notify({ severity: Severity.Warning, message }); } - public error(error: string | Error): INotificationHandle { + error(error: string | Error): INotificationHandle { return this.notify({ severity: Severity.Error, message: error }); } - public notify(notification: INotification): INotificationHandle { + notify(notification: INotification): INotificationHandle { return TestNotificationService.NO_OP; } - public prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { + prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { return TestNotificationService.NO_OP; } + + status(message: string | Error, options?: IStatusMessageOptions): IDisposable { + return Disposable.None; + } } \ No newline at end of file diff --git a/src/vs/platform/product/node/product.ts b/src/vs/platform/product/node/product.ts index 305538a7073..3ad86dbcf1b 100644 --- a/src/vs/platform/product/node/product.ts +++ b/src/vs/platform/product/node/product.ts @@ -75,7 +75,6 @@ export interface IProductConfiguration { hockeyApp: { 'win32-ia32': string; 'win32-x64': string; - 'linux-ia32': string; 'linux-x64': string; 'darwin': string; }; diff --git a/src/vs/platform/registry/common/platform.ts b/src/vs/platform/registry/common/platform.ts index a81c001af82..4c399777030 100644 --- a/src/vs/platform/registry/common/platform.ts +++ b/src/vs/platform/registry/common/platform.ts @@ -31,26 +31,22 @@ export interface IRegistry { class RegistryImpl implements IRegistry { - private data: { [id: string]: any; }; - - constructor() { - this.data = {}; - } + private readonly data = new Map(); public add(id: string, data: any): void { Assert.ok(Types.isString(id)); Assert.ok(Types.isObject(data)); - Assert.ok(!this.data.hasOwnProperty(id), 'There is already an extension with this id'); + Assert.ok(!this.data.has(id), 'There is already an extension with this id'); - this.data[id] = data; + this.data.set(id, data); } public knows(id: string): boolean { - return this.data.hasOwnProperty(id); + return this.data.has(id); } public as(id: string): any { - return this.data[id] || null; + return this.data.get(id) || null; } } diff --git a/src/vs/platform/request/node/requestService.ts b/src/vs/platform/request/node/requestService.ts index 20963f6a2f7..c2858fe6dd0 100644 --- a/src/vs/platform/request/node/requestService.ts +++ b/src/vs/platform/request/node/requestService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; import { IRequestOptions, IRequestContext, IRequestFunction, request } from 'vs/base/node/request'; import { getProxyAgent } from 'vs/base/node/proxy'; @@ -16,21 +16,21 @@ import { CancellationToken } from 'vs/base/common/cancellation'; * This service exposes the `request` API, while using the global * or configured proxy settings. */ -export class RequestService implements IRequestService { +export class RequestService extends Disposable implements IRequestService { _serviceBrand: any; private proxyUrl?: string; private strictSSL: boolean; private authorization?: string; - private disposables: IDisposable[] = []; constructor( @IConfigurationService configurationService: IConfigurationService, @ILogService private readonly logService: ILogService ) { + super(); this.configure(configurationService.getValue()); - configurationService.onDidChangeConfiguration(() => this.configure(configurationService.getValue()), this, this.disposables); + this._register(configurationService.onDidChangeConfiguration(() => this.configure(configurationService.getValue()), this)); } private configure(config: IHTTPConfiguration) { diff --git a/src/vs/platform/severityIcon/common/severityIcon.ts b/src/vs/platform/severityIcon/common/severityIcon.ts new file mode 100644 index 00000000000..343774e5b09 --- /dev/null +++ b/src/vs/platform/severityIcon/common/severityIcon.ts @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import Severity from 'vs/base/common/severity'; +import { registerThemingParticipant, ITheme, LIGHT } from 'vs/platform/theme/common/themeService'; +import { Color } from 'vs/base/common/color'; + +const errorStart = encodeURIComponent(``); +const errorDarkStart = encodeURIComponent(``); + +const warningStart = encodeURIComponent(``); +const warningDarkStart = encodeURIComponent(``); + +const infoStart = encodeURIComponent(``); +const infoDarkStart = encodeURIComponent(``); + +export namespace SeverityIcon { + + export function getSVGData(severity: Severity, theme: ITheme): string { + switch (severity) { + case Severity.Ignore: + const ignoreColor = theme.type === LIGHT ? Color.fromHex('#1BA1E2') : Color.fromHex('#1BA1E2'); + return theme.type === LIGHT ? infoStart + encodeURIComponent(ignoreColor.toString()) + infoEnd + : infoDarkStart + encodeURIComponent(ignoreColor.toString()) + infoDarkEnd; + case Severity.Info: + const infoColor = theme.type === LIGHT ? Color.fromHex('#1BA1E2') : Color.fromHex('#1BA1E2'); + return theme.type === LIGHT ? infoStart + encodeURIComponent(infoColor.toString()) + infoEnd + : infoDarkStart + encodeURIComponent(infoColor.toString()) + infoDarkEnd; + case Severity.Warning: + const warningColor = theme.type === LIGHT ? Color.fromHex('#fc0') : Color.fromHex('#fc0'); + return theme.type === LIGHT ? warningStart + encodeURIComponent(warningColor.toString()) + warningEnd + : warningDarkStart + encodeURIComponent(warningColor.toString()) + warningDarkEnd; + case Severity.Error: + const errorColor = theme.type === LIGHT ? Color.fromHex('#E51400') : Color.fromHex('#F48771'); + return theme.type === LIGHT ? errorStart + encodeURIComponent(errorColor.toString()) + errorEnd + : errorDarkStart + encodeURIComponent(errorColor.toString()) + errorDarkEnd; + } + return ''; + } + + export function className(severity: Severity): string { + switch (severity) { + case Severity.Ignore: + return 'severity-icon severity-ignore'; + case Severity.Info: + return 'severity-icon severity-info'; + case Severity.Warning: + return 'severity-icon severity-warning'; + case Severity.Error: + return 'severity-icon severity-error'; + } + return ''; + } +} + +function getCSSRule(severity: Severity, theme: ITheme): string { + return `.${SeverityIcon.className(severity).split(' ').join('.')} { background: url("data:image/svg+xml,${SeverityIcon.getSVGData(severity, theme)}") center center no-repeat; height: 16px; width: 16px; }`; +} + +registerThemingParticipant((theme, collector) => { + collector.addRule(getCSSRule(Severity.Error, theme)); + collector.addRule(getCSSRule(Severity.Warning, theme)); + collector.addRule(getCSSRule(Severity.Info, theme)); + collector.addRule(getCSSRule(Severity.Ignore, theme)); +}); \ No newline at end of file diff --git a/src/vs/platform/statusbar/common/statusbar.ts b/src/vs/platform/statusbar/common/statusbar.ts index 92a2c0c99f5..f83ca77e1ed 100644 --- a/src/vs/platform/statusbar/common/statusbar.ts +++ b/src/vs/platform/statusbar/common/statusbar.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ThemeColor } from 'vs/platform/theme/common/themeService'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; @@ -64,18 +64,13 @@ export interface IStatusbarEntry { export interface IStatusbarService { - _serviceBrand: any; + _serviceBrand: ServiceIdentifier; /** * Adds an entry to the statusbar with the given alignment and priority. Use the returned accessor * to update or remove the statusbar entry. */ addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority?: number): IStatusbarEntryAccessor; - - /** - * Prints something to the status bar area with optional auto dispose and delay. - */ - setStatusMessage(message: string, autoDisposeAfter?: number, delayBy?: number): IDisposable; } export interface IStatusbarEntryAccessor extends IDisposable { diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 433b4704b66..f48faaa47b5 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -264,6 +264,18 @@ export const menuSelectionBackground = registerColor('menu.selectionBackground', export const menuSelectionBorder = registerColor('menu.selectionBorder', { dark: null, light: null, hc: activeContrastBorder }, nls.localize('menuSelectionBorder', "Border color of the selected menu item in menus.")); export const menuSeparatorBackground = registerColor('menu.separatorBackground', { dark: '#BBBBBB', light: '#888888', hc: contrastBorder }, nls.localize('menuSeparatorBackground', "Color of a separator menu item in menus.")); +export const editorErrorForeground = registerColor('editorError.foreground', { dark: '#F48771', light: '#E51400', hc: null }, nls.localize('editorError.foreground', 'Foreground color of error squigglies in the editor.')); +export const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hc: Color.fromHex('#E47777').transparent(0.8) }, nls.localize('errorBorder', 'Border color of error boxes in the editor.')); + +export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#FFCC00', light: '#E9A700', hc: null }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.')); +export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#FFCC00').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning boxes in the editor.')); + +export const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('editorInfo.foreground', 'Foreground color of info squigglies in the editor.')); +export const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info boxes in the editor.')); + +export const editorHintForeground = registerColor('editorHint.foreground', { dark: Color.fromHex('#eeeeee').transparent(0.7), light: '#6c6c6c', hc: null }, nls.localize('editorHint.foreground', 'Foreground color of hint squigglies in the editor.')); +export const editorHintBorder = registerColor('editorHint.border', { dark: null, light: null, hc: Color.fromHex('#eeeeee').transparent(0.8) }, nls.localize('hintBorder', 'Border color of hint boxes in the editor.')); + /** * Editor background color. * Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254 diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index beb70d39512..c000ffdac15 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -351,4 +351,4 @@ export const defaultDialogStyles = { export function attachDialogStyler(widget: IThemable, themeService: IThemeService, style?: IDialogStyleOverrides): IDisposable { return attachStyler(themeService, { ...defaultDialogStyles, ...style }, widget); -} +} \ No newline at end of file diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts index eceddd25c57..8467f908dc6 100644 --- a/src/vs/platform/update/electron-main/updateService.win32.ts +++ b/src/vs/platform/update/electron-main/updateService.win32.ts @@ -237,10 +237,10 @@ export class Win32UpdateService extends AbstractUpdateService { }); const readyMutexName = `${product.win32MutexName}-ready`; - const isActive = (require.__$__nodeRequire('windows-mutex') as any).isActive; + const mutex = await import('windows-mutex'); // poll for mutex-ready - pollUntil(() => isActive(readyMutexName)) + pollUntil(() => mutex.isActive(readyMutexName)) .then(() => this.setState(State.Ready(update))); } diff --git a/src/vs/platform/url/electron-main/electronUrlListener.ts b/src/vs/platform/url/electron-main/electronUrlListener.ts index c88372f8bc1..d0cdeee8f5d 100644 --- a/src/vs/platform/url/electron-main/electronUrlListener.ts +++ b/src/vs/platform/url/electron-main/electronUrlListener.ts @@ -8,7 +8,7 @@ import { IURLService } from 'vs/platform/url/common/url'; import product from 'vs/platform/product/node/product'; import { app } from 'electron'; import { URI } from 'vs/base/common/uri'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows'; import { isWindows } from 'vs/base/common/platform'; import { coalesce } from 'vs/base/common/arrays'; @@ -21,15 +21,14 @@ function uriFromRawUrl(url: string): URI | null { } } -export class ElectronURLListener { - - private disposables: IDisposable[] = []; +export class ElectronURLListener extends Disposable { constructor( initial: string | string[], @IURLService private readonly urlService: IURLService, @IWindowsMainService windowsService: IWindowsMainService ) { + super(); const globalBuffer = ((global).getOpenUrls() || []) as string[]; const rawBuffer = [ ...(typeof initial === 'string' ? [initial] : initial), @@ -56,7 +55,7 @@ export class ElectronURLListener { }); const onOpenUrl = Event.filter(Event.map(onOpenElectronUrl, uriFromRawUrl), uri => !!uri); - onOpenUrl(this.urlService.open, this.urlService, this.disposables); + this._register(onOpenUrl(this.urlService.open, this.urlService)); const isWindowReady = windowsService.getWindows() .filter(w => w.isReady) @@ -68,8 +67,4 @@ export class ElectronURLListener { Event.once(windowsService.onWindowReady)(flush); } } - - dispose(): void { - this.disposables = dispose(this.disposables); - } } \ No newline at end of file diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index f636cd1b8e3..d288f2f8b84 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -6,7 +6,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Event } from 'vs/base/common/event'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { IProcessEnvironment, isMacintosh, isLinux } from 'vs/base/common/platform'; +import { IProcessEnvironment, isMacintosh, isLinux, isWeb } from 'vs/base/common/platform'; import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { IRecentlyOpened, IRecent } from 'vs/platform/history/common/history'; @@ -282,6 +282,10 @@ export interface IWindowSettings { } export function getTitleBarStyle(configurationService: IConfigurationService, environment: IEnvironmentService, isExtensionDevelopment = environment.isExtensionDevelopment): 'native' | 'custom' { + if (isWeb) { + return 'custom'; + } + const configuration = configurationService.getValue('window'); const isDev = !environment.isBuilt || isExtensionDevelopment; diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index 07d8e6071a9..12cfac305ef 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import * as os from 'os'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; import { URI } from 'vs/base/common/uri'; import product from 'vs/platform/product/node/product'; @@ -24,12 +24,10 @@ import { mnemonicButtonLabel } from 'vs/base/common/labels'; import { isMacintosh, isLinux } from 'vs/base/common/platform'; import { ILogService } from 'vs/platform/log/common/log'; -export class WindowsService implements IWindowsService, IURLHandler, IDisposable { +export class WindowsService extends Disposable implements IWindowsService, IURLHandler { _serviceBrand: any; - private disposables: IDisposable[] = []; - private _activeWindowId: number | undefined; readonly onWindowOpen: Event = Event.filter(Event.fromNodeEventEmitter(app, 'browser-window-created', (_, w: Electron.BrowserWindow) => w.id), id => !!this.windowsMainService.getWindowById(id)); @@ -52,11 +50,12 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable @IHistoryMainService private readonly historyService: IHistoryMainService, @ILogService private readonly logService: ILogService ) { + super(); urlService.registerHandler(this); // remember last active window id - Event.latch(Event.any(this.onWindowOpen, this.onWindowFocus)) - (id => this._activeWindowId = id, null, this.disposables); + this._register(Event.latch(Event.any(this.onWindowOpen, this.onWindowFocus)) + (id => this._activeWindowId = id, null)); } async pickFileFolderAndOpen(options: INativeOpenDialogOptions): Promise { @@ -460,8 +459,4 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable return undefined; } - - dispose(): void { - this.disposables = dispose(this.disposables); - } } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index de5a43cf497..d03f3edf9a2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -1101,7 +1101,7 @@ declare module 'vscode' { /** * The column in which this editor shows. Will be `undefined` in case this - * isn't one of the main editors, e.g an embedded editor, or when the editor + * isn't one of the main editors, e.g. an embedded editor, or when the editor * column is larger than three. */ viewColumn?: ViewColumn; @@ -1900,7 +1900,7 @@ declare module 'vscode' { * * *Note* that a document selector that is just a language identifier selects *all* * documents, even those that are not saved on disk. Only use such selectors when - * a feature works without further context, e.g without the need to resolve related + * a feature works without further context, e.g. without the need to resolve related * 'files'. * * @sample `let sel:DocumentSelector = { scheme: 'file', language: 'typescript' }`; @@ -2595,7 +2595,7 @@ declare module 'vscode' { name: string; /** - * More detail for this symbol, e.g the signature of a function. + * More detail for this symbol, e.g. the signature of a function. */ detail: string; @@ -2605,12 +2605,12 @@ declare module 'vscode' { kind: SymbolKind; /** - * The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g comments and code. + * The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code. */ range: Range; /** - * The range that should be selected and reveal when this symbol is being picked, e.g the name of a function. + * The range that should be selected and reveal when this symbol is being picked, e.g. the name of a function. * Must be contained by the [`range`](#DocumentSymbol.range). */ selectionRange: Range; @@ -3515,6 +3515,10 @@ declare module 'vscode' { * * The editor will only resolve a completion item once. * + * *Note* that accepting a completion item will not wait for it to be resolved. Because of that [`insertText`](#CompletionItem.insertText), + * [`additionalTextEdits`](#CompletionItem.additionalTextEdits), and [`command`](#CompletionItem.command) should not + * be changed when resolving an item. + * * @param item A completion item currently active in the UI. * @param token A cancellation token. * @return The resolved completion item or a thenable that resolves to of such. It is OK to return the given @@ -3645,7 +3649,7 @@ declare module 'vscode' { * * For some languages one color can have multiple presentations, e.g. css can represent the color red with * the constant `Red`, the hex-value `#ff0000`, or in rgba and hsla forms. In csharp other representations - * apply, e.g `System.Drawing.Color.Red`. + * apply, e.g. `System.Drawing.Color.Red`. */ export class ColorPresentation { @@ -4231,7 +4235,7 @@ declare module 'vscode' { /** * Represents a related message and source code location for a diagnostic. This should be - * used to point to code locations that cause or related to a diagnostics, e.g when duplicating + * used to point to code locations that cause or related to a diagnostics, e.g. when duplicating * a symbol in a scope. */ export class DiagnosticRelatedInformation { @@ -6676,7 +6680,7 @@ declare module 'vscode' { * the following rules: * * - The uri-scheme must be `vscode.env.uriScheme`; - * - The uri-authority must be the extension id (eg. `my.extension`); + * - The uri-authority must be the extension id (e.g. `my.extension`); * - The uri-path, -query and -fragment parts are arbitrary. * * For example, if the `my.extension` extension registers a uri handler, it will only @@ -8417,9 +8421,9 @@ declare module 'vscode' { /** * Creates a new [source control](#SourceControl) instance. * - * @param id An `id` for the source control. Something short, eg: `git`. - * @param label A human-readable string for the source control. Eg: `Git`. - * @param rootUri An optional Uri of the root of the source control. Eg: `Uri.parse(workspaceRoot)`. + * @param id An `id` for the source control. Something short, e.g.: `git`. + * @param label A human-readable string for the source control. E.g.: `Git`. + * @param rootUri An optional Uri of the root of the source control. E.g.: `Uri.parse(workspaceRoot)`. * @return An instance of [source control](#SourceControl). */ export function createSourceControl(id: string, label: string, rootUri?: Uri): SourceControl; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 177aeee3353..966803bd86c 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -137,32 +137,20 @@ declare module 'vscode' { // #region Joh - code insets - /** - */ - export class CodeInset { - range: Range; - height?: number; - constructor(range: Range, height?: number); + export interface WebviewEditorInset { + readonly editor: TextEditor; + readonly range: Range; + readonly webview: Webview; + readonly onDidDispose: Event; + dispose(): void; } - export interface CodeInsetProvider { - onDidChangeCodeInsets?: Event; - provideCodeInsets(document: TextDocument, token: CancellationToken): ProviderResult; - resolveCodeInset(codeInset: CodeInset, webview: Webview, token: CancellationToken): ProviderResult; - } - - export namespace languages { - - /** - * Register a code inset provider. - * - */ - export function registerCodeInsetProvider(selector: DocumentSelector, provider: CodeInsetProvider): Disposable; + export namespace window { + export function createWebviewTextEditorInset(editor: TextEditor, range: Range, options?: WebviewOptions): WebviewEditorInset; } //#endregion - //#region Joh - read/write in chunks export interface FileSystemProvider { diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.common.ts b/src/vs/workbench/api/browser/extensionHost.contribution.common.ts deleted file mode 100644 index 38a2c922265..00000000000 --- a/src/vs/workbench/api/browser/extensionHost.contribution.common.ts +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; - -// --- other interested parties -import { JSONValidationExtensionPoint } from 'vs/workbench/api/common/jsonValidationExtensionPoint'; -import { ColorExtensionPoint } from 'vs/workbench/services/themes/common/colorExtensionPoint'; -import { LanguageConfigurationFileHandler } from 'vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint'; - -// --- mainThread participants -import './mainThreadClipboard'; -import './mainThreadCommands'; -import './mainThreadConfiguration'; -import './mainThreadConsole'; -import './mainThreadDebugService'; -import './mainThreadDecorations'; -import './mainThreadDiagnostics'; -import './mainThreadDialogs'; -import './mainThreadDocumentContentProviders'; -import './mainThreadDocuments'; -import './mainThreadDocumentsAndEditors'; -import './mainThreadEditor'; -import './mainThreadEditors'; -import './mainThreadErrors'; -import './mainThreadExtensionService'; -import './mainThreadFileSystem'; -import './mainThreadFileSystemEventService'; -import './mainThreadHeapService'; -import './mainThreadKeytar'; -import './mainThreadLanguageFeatures'; -import './mainThreadLanguages'; -import './mainThreadLogService'; -import './mainThreadMessageService'; -import './mainThreadOutputService'; -import './mainThreadProgress'; -import './mainThreadQuickOpen'; -import './mainThreadSaveParticipant'; -import './mainThreadSCM'; -import './mainThreadSearch'; -import './mainThreadStatusBar'; -import './mainThreadStorage'; -import './mainThreadTelemetry'; -import './mainThreadTerminalService'; -import './mainThreadTreeViews'; -import './mainThreadUrls'; -import './mainThreadWindow'; -import './mainThreadWorkspace'; -import './mainThreadComments'; -import './mainThreadTask'; -import 'vs/workbench/api/common/apiCommands'; - -export class ExtensionPoints implements IWorkbenchContribution { - - constructor( - @IInstantiationService private readonly instantiationService: IInstantiationService - ) { - // Classes that handle extension points... - this.instantiationService.createInstance(JSONValidationExtensionPoint); - this.instantiationService.createInstance(ColorExtensionPoint); - this.instantiationService.createInstance(LanguageConfigurationFileHandler); - } -} - -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, LifecyclePhase.Starting); diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts index a9803561b5f..b4eca4746c9 100644 --- a/src/vs/workbench/api/browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/browser/extensionHost.contribution.ts @@ -3,5 +3,70 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import './extensionHost.contribution.common'; +import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; + +// --- other interested parties +import { JSONValidationExtensionPoint } from 'vs/workbench/api/common/jsonValidationExtensionPoint'; +import { ColorExtensionPoint } from 'vs/workbench/services/themes/common/colorExtensionPoint'; +import { LanguageConfigurationFileHandler } from 'vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint'; + +// --- mainThread participants +import './mainThreadCodeInsets'; +import './mainThreadClipboard'; +import './mainThreadCommands'; +import './mainThreadConfiguration'; +import './mainThreadConsole'; +import './mainThreadDebugService'; +import './mainThreadDecorations'; +import './mainThreadDiagnostics'; +import './mainThreadDialogs'; +import './mainThreadDocumentContentProviders'; +import './mainThreadDocuments'; +import './mainThreadDocumentsAndEditors'; +import './mainThreadEditor'; +import './mainThreadEditors'; +import './mainThreadErrors'; +import './mainThreadExtensionService'; +import './mainThreadFileSystem'; +import './mainThreadFileSystemEventService'; +import './mainThreadHeapService'; +import './mainThreadKeytar'; +import './mainThreadLanguageFeatures'; +import './mainThreadLanguages'; +import './mainThreadLogService'; +import './mainThreadMessageService'; +import './mainThreadOutputService'; +import './mainThreadProgress'; +import './mainThreadQuickOpen'; +import './mainThreadSaveParticipant'; +import './mainThreadSCM'; +import './mainThreadSearch'; +import './mainThreadStatusBar'; +import './mainThreadStorage'; +import './mainThreadTelemetry'; +import './mainThreadTerminalService'; +import './mainThreadTreeViews'; +import './mainThreadUrls'; +import './mainThreadWindow'; import './mainThreadWebview'; +import './mainThreadWorkspace'; +import './mainThreadComments'; +import './mainThreadTask'; +import 'vs/workbench/api/common/apiCommands'; + +export class ExtensionPoints implements IWorkbenchContribution { + + constructor( + @IInstantiationService private readonly instantiationService: IInstantiationService + ) { + // Classes that handle extension points... + this.instantiationService.createInstance(JSONValidationExtensionPoint); + this.instantiationService.createInstance(ColorExtensionPoint); + this.instantiationService.createInstance(LanguageConfigurationFileHandler); + } +} + +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(ExtensionPoints, LifecyclePhase.Starting); diff --git a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts new file mode 100644 index 00000000000..49a1abd1c12 --- /dev/null +++ b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts @@ -0,0 +1,144 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { UriComponents, URI } from 'vs/base/common/uri'; +import * as modes from 'vs/editor/common/modes'; +import { MainContext, MainThreadEditorInsetsShape, IExtHostContext, ExtHostEditorInsetsShape, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol'; +import { extHostNamedCustomer } from '../common/extHostCustomers'; +import { IRange } from 'vs/editor/common/core/range'; +import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; +import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/common/webview'; +import { DisposableStore } from 'vs/base/common/lifecycle'; +import { IActiveCodeEditor, IViewZone } from 'vs/editor/browser/editorBrowser'; + +// todo@joh move these things back into something like contrib/insets +class EditorWebviewZone implements IViewZone { + + readonly domNode: HTMLElement; + readonly afterLineNumber: number; + readonly afterColumn: number; + readonly heightInLines: number; + + private _id: number; + // suppressMouseDown?: boolean | undefined; + // heightInPx?: number | undefined; + // minWidthInPx?: number | undefined; + // marginDomNode?: HTMLElement | null | undefined; + // onDomNodeTop?: ((top: number) => void) | undefined; + // onComputedHeight?: ((height: number) => void) | undefined; + + constructor( + readonly editor: IActiveCodeEditor, + readonly range: IRange, + readonly webview: Webview, + ) { + this.domNode = document.createElement('div'); + this.afterLineNumber = range.startLineNumber; + this.afterColumn = range.startColumn; + this.heightInLines = range.endLineNumber - range.startLineNumber; + + editor.changeViewZones(accessor => this._id = accessor.addZone(this)); + webview.mountTo(this.domNode); + } + + dispose(): void { + this.editor.changeViewZones(accessor => accessor.removeZone(this._id)); + } +} + +@extHostNamedCustomer(MainContext.MainThreadEditorInsets) +export class MainThreadEditorInsets implements MainThreadEditorInsetsShape { + + private readonly _proxy: ExtHostEditorInsetsShape; + private readonly _disposables = new DisposableStore(); + private readonly _insets = new Map(); + + constructor( + context: IExtHostContext, + @ICodeEditorService private readonly _editorService: ICodeEditorService, + @IWebviewService private readonly _webviewService: IWebviewService, + ) { + this._proxy = context.getProxy(ExtHostContext.ExtHostEditorInsets); + } + + dispose(): void { + this._disposables.dispose(); + } + + async $createEditorInset(handle: number, id: string, uri: UriComponents, range: IRange, options: modes.IWebviewOptions): Promise { + + let editor: IActiveCodeEditor | undefined; + id = id.substr(0, id.indexOf(',')); //todo@joh HACK + + for (const candidate of this._editorService.listCodeEditors()) { + if (candidate.getId() === id && candidate.hasModel() && candidate.getModel()!.uri.toString() === URI.revive(uri).toString()) { + editor = candidate; + break; + } + } + + if (!editor) { + setTimeout(() => this._proxy.$onDidDispose(handle)); + return; + } + + const disposables = new DisposableStore(); + + const webview = this._webviewService.createWebview({ + enableFindWidget: false, + allowSvgs: false, + extension: undefined + }, { + allowScripts: options.enableScripts + }); + + const webviewZone = new EditorWebviewZone(editor, range, webview); + + const remove = () => { + disposables.dispose(); + this._proxy.$onDidDispose(handle); + this._insets.delete(handle); + }; + + disposables.add(editor.onDidChangeModel(remove)); + disposables.add(editor.onDidDispose(remove)); + disposables.add(webviewZone); + disposables.add(webview); + disposables.add(webview.onMessage(msg => this._proxy.$onDidReceiveMessage(handle, msg))); + + this._insets.set(handle, webviewZone); + } + + $disposeEditorInset(handle: number): void { + const inset = this._insets.get(handle); + if (inset) { + this._insets.delete(handle); + inset.dispose(); + } + } + + $setHtml(handle: number, value: string): void { + const inset = this._insets.get(handle); + if (inset) { + inset.webview.html = value; + } + } + + $setOptions(handle: number, options: modes.IWebviewOptions): void { + const inset = this._insets.get(handle); + if (inset) { + inset.webview.options = options; + } + } + + $postMessage(handle: number, value: any): Promise { + const inset = this._insets.get(handle); + if (inset) { + inset.webview.sendMessage(value); + return Promise.resolve(true); + } + return Promise.resolve(false); + } +} diff --git a/src/vs/workbench/api/browser/mainThreadCommands.ts b/src/vs/workbench/api/browser/mainThreadCommands.ts index c61ad7e5733..fcf82fcfdb8 100644 --- a/src/vs/workbench/api/browser/mainThreadCommands.ts +++ b/src/vs/workbench/api/browser/mainThreadCommands.ts @@ -12,7 +12,7 @@ import { revive } from 'vs/base/common/marshalling'; @extHostNamedCustomer(MainContext.MainThreadCommands) export class MainThreadCommands implements MainThreadCommandsShape { - private readonly _disposables = new Map(); + private readonly _commandRegistrations = new Map(); private readonly _generateCommandsDocumentationRegistration: IDisposable; private readonly _proxy: ExtHostCommandsShape; @@ -26,8 +26,8 @@ export class MainThreadCommands implements MainThreadCommandsShape { } dispose() { - this._disposables.forEach(value => value.dispose()); - this._disposables.clear(); + this._commandRegistrations.forEach(value => value.dispose()); + this._commandRegistrations.clear(); this._generateCommandsDocumentationRegistration.dispose(); } @@ -53,7 +53,7 @@ export class MainThreadCommands implements MainThreadCommandsShape { } $registerCommand(id: string): void { - this._disposables.set( + this._commandRegistrations.set( id, CommandsRegistry.registerCommand(id, (accessor, ...args) => { return this._proxy.$executeContributedCommand(id, ...args).then(result => { @@ -64,10 +64,10 @@ export class MainThreadCommands implements MainThreadCommandsShape { } $unregisterCommand(id: string): void { - const command = this._disposables.get(id); + const command = this._commandRegistrations.get(id); if (command) { command.dispose(); - this._disposables.delete(id); + this._commandRegistrations.delete(id); } } diff --git a/src/vs/workbench/api/browser/mainThreadComments.ts b/src/vs/workbench/api/browser/mainThreadComments.ts index aa0e454810a..43bcbaa54e0 100644 --- a/src/vs/workbench/api/browser/mainThreadComments.ts +++ b/src/vs/workbench/api/browser/mainThreadComments.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable, dispose, DisposableStore } from 'vs/base/common/lifecycle'; import { ICodeEditor, isCodeEditor, isDiffEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import * as modes from 'vs/editor/common/modes'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; @@ -299,7 +299,8 @@ export class MainThreadCommentController { this._features = features; } - createCommentThread(commentThreadHandle: number, + createCommentThread(extensionId: string, + commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, @@ -307,7 +308,7 @@ export class MainThreadCommentController { let thread = new MainThreadCommentThread( commentThreadHandle, this.handle, - '', + extensionId, threadId, URI.revive(resource).toString(), range @@ -451,6 +452,10 @@ export class MainThreadCommentController { this._proxy.$createCommentThreadTemplate(this.handle, resource, range); } + async updateCommentThreadTemplate(threadHandle: number, range: IRange) { + await this._proxy.$updateCommentThreadTemplate(this.handle, threadHandle, range); + } + toJSON(): any { return { $mid: 6, @@ -461,8 +466,6 @@ export class MainThreadCommentController { @extHostNamedCustomer(MainContext.MainThreadComments) export class MainThreadComments extends Disposable implements MainThreadCommentsShape { - private _disposables: IDisposable[]; - private _activeCommentThreadDisposables: IDisposable[]; private readonly _proxy: ExtHostCommentsShape; private _documentProviders = new Map(); private _workspaceProviders = new Map(); @@ -470,10 +473,12 @@ export class MainThreadComments extends Disposable implements MainThreadComments private _commentControllers = new Map(); private _activeCommentThread?: MainThreadCommentThread; + private readonly _activeCommentThreadDisposables = this._register(new DisposableStore()); private _input?: modes.CommentInput; private _openPanelListener: IDisposable | null; + constructor( extHostContext: IExtHostContext, @IEditorService private readonly _editorService: IEditorService, @@ -483,11 +488,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments @IConfigurationService private readonly _configurationService: IConfigurationService, ) { super(); - this._disposables = []; - this._activeCommentThreadDisposables = []; this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostComments); - this._disposables.push(this._commentService.onDidChangeActiveCommentThread(async thread => { + this._register(this._commentService.onDidChangeActiveCommentThread(async thread => { let handle = (thread as MainThreadCommentThread).controllerHandle; let controller = this._commentControllers.get(handle); @@ -495,11 +498,11 @@ export class MainThreadComments extends Disposable implements MainThreadComments return; } - this._activeCommentThreadDisposables = dispose(this._activeCommentThreadDisposables); + this._activeCommentThreadDisposables.clear(); this._activeCommentThread = thread as MainThreadCommentThread; controller.activeCommentThread = this._activeCommentThread; - this._activeCommentThreadDisposables.push(this._activeCommentThread.onDidChangeInput(input => { // todo, dispose + this._activeCommentThreadDisposables.add(this._activeCommentThread.onDidChangeInput(input => { // todo, dispose this._input = input; this._proxy.$onCommentWidgetInputChange(handle, URI.parse(this._activeCommentThread!.resource), this._activeCommentThread!.range, this._input ? this._input.value : undefined); })); @@ -548,7 +551,8 @@ export class MainThreadComments extends Disposable implements MainThreadComments commentThreadHandle: number, threadId: string, resource: UriComponents, - range: IRange + range: IRange, + extensionId: ExtensionIdentifier ): modes.CommentThread2 | undefined { let provider = this._commentControllers.get(handle); @@ -556,7 +560,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments return undefined; } - return provider.createCommentThread(commentThreadHandle, threadId, resource, range); + return provider.createCommentThread(extensionId.value, commentThreadHandle, threadId, resource, range); } $updateCommentThread(handle: number, @@ -776,8 +780,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments } dispose(): void { - this._disposables = dispose(this._disposables); - this._activeCommentThreadDisposables = dispose(this._activeCommentThreadDisposables); + super.dispose(); this._workspaceProviders.forEach(value => dispose(value)); this._workspaceProviders.clear(); this._documentProviders.forEach(value => dispose(value)); diff --git a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts index 5c8a9b248bb..9ac6192df62 100644 --- a/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, combinedDisposable, Disposable } from 'vs/base/common/lifecycle'; import { values } from 'vs/base/common/map'; import { URI } from 'vs/base/common/uri'; import { ICodeEditor, isCodeEditor, isDiffEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; @@ -142,9 +142,8 @@ const enum ActiveEditorOrder { Editor, Panel } -class MainThreadDocumentAndEditorStateComputer { +class MainThreadDocumentAndEditorStateComputer extends Disposable { - private _toDispose: IDisposable[] = []; private _toDisposeOnEditorRemove = new Map(); private _currentState: DocumentAndEditorState; private _activeEditorOrder: ActiveEditorOrder = ActiveEditorOrder.Editor; @@ -156,25 +155,22 @@ class MainThreadDocumentAndEditorStateComputer { @IEditorService private readonly _editorService: IEditorService, @IPanelService private readonly _panelService: IPanelService ) { - this._modelService.onModelAdded(this._updateStateOnModelAdd, this, this._toDispose); - this._modelService.onModelRemoved(_ => this._updateState(), this, this._toDispose); - this._editorService.onDidActiveEditorChange(_ => this._updateState(), this, this._toDispose); + super(); + this._register(this._modelService.onModelAdded(this._updateStateOnModelAdd, this)); + this._register(this._modelService.onModelRemoved(_ => this._updateState(), this)); + this._register(this._editorService.onDidActiveEditorChange(_ => this._updateState(), this)); - this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor, this, this._toDispose); - this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor, this, this._toDispose); + this._register(this._codeEditorService.onCodeEditorAdd(this._onDidAddEditor, this)); + this._register(this._codeEditorService.onCodeEditorRemove(this._onDidRemoveEditor, this)); this._codeEditorService.listCodeEditors().forEach(this._onDidAddEditor, this); - this._panelService.onDidPanelOpen(_ => this._activeEditorOrder = ActiveEditorOrder.Panel, undefined, this._toDispose); - this._panelService.onDidPanelClose(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose); - this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined, this._toDispose); + this._register(this._panelService.onDidPanelOpen(_ => this._activeEditorOrder = ActiveEditorOrder.Panel, undefined)); + this._register(this._panelService.onDidPanelClose(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined)); + this._register(this._editorService.onDidVisibleEditorsChange(_ => this._activeEditorOrder = ActiveEditorOrder.Editor, undefined)); this._updateState(); } - dispose(): void { - this._toDispose = dispose(this._toDispose); - } - private _onDidAddEditor(e: ICodeEditor): void { this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable( e.onDidChangeModel(() => this._updateState()), @@ -302,17 +298,15 @@ class MainThreadDocumentAndEditorStateComputer { } @extHostCustomer -export class MainThreadDocumentsAndEditors { +export class MainThreadDocumentsAndEditors extends Disposable { - private _toDispose: IDisposable[]; private readonly _proxy: ExtHostDocumentsAndEditorsShape; - private readonly _stateComputer: MainThreadDocumentAndEditorStateComputer; private _textEditors = <{ [id: string]: MainThreadTextEditor }>Object.create(null); - private _onTextEditorAdd = new Emitter(); - private _onTextEditorRemove = new Emitter(); - private _onDocumentAdd = new Emitter(); - private _onDocumentRemove = new Emitter(); + private _onTextEditorAdd = this._register(new Emitter()); + private _onTextEditorRemove = this._register(new Emitter()); + private _onDocumentAdd = this._register(new Emitter()); + private _onDocumentRemove = this._register(new Emitter()); readonly onTextEditorAdd: Event = this._onTextEditorAdd.event; readonly onTextEditorRemove: Event = this._onTextEditorRemove.event; @@ -334,30 +328,17 @@ export class MainThreadDocumentsAndEditors { @IPanelService panelService: IPanelService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService ) { + super(); this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDocumentsAndEditors); - const mainThreadDocuments = new MainThreadDocuments(this, extHostContext, this._modelService, modeService, this._textFileService, fileService, textModelResolverService, untitledEditorService, environmentService); + const mainThreadDocuments = this._register(new MainThreadDocuments(this, extHostContext, this._modelService, modeService, this._textFileService, fileService, textModelResolverService, untitledEditorService, environmentService)); extHostContext.set(MainContext.MainThreadDocuments, mainThreadDocuments); - const mainThreadTextEditors = new MainThreadTextEditors(this, extHostContext, codeEditorService, bulkEditService, this._editorService, this._editorGroupService); + const mainThreadTextEditors = this._register(new MainThreadTextEditors(this, extHostContext, codeEditorService, bulkEditService, this._editorService, this._editorGroupService)); extHostContext.set(MainContext.MainThreadTextEditors, mainThreadTextEditors); // It is expected that the ctor of the state computer calls our `_onDelta`. - this._stateComputer = new MainThreadDocumentAndEditorStateComputer(delta => this._onDelta(delta), _modelService, codeEditorService, this._editorService, panelService); - - this._toDispose = [ - mainThreadDocuments, - mainThreadTextEditors, - this._stateComputer, - this._onTextEditorAdd, - this._onTextEditorRemove, - this._onDocumentAdd, - this._onDocumentRemove, - ]; - } - - dispose(): void { - this._toDispose = dispose(this._toDispose); + this._register(new MainThreadDocumentAndEditorStateComputer(delta => this._onDelta(delta), _modelService, codeEditorService, this._editorService, panelService)); } private _onDelta(delta: DocumentAndEditorStateDelta): void { diff --git a/src/vs/workbench/api/browser/mainThreadEditors.ts b/src/vs/workbench/api/browser/mainThreadEditors.ts index 9dfff56540a..4eaf703eb37 100644 --- a/src/vs/workbench/api/browser/mainThreadEditors.ts +++ b/src/vs/workbench/api/browser/mainThreadEditors.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { disposed } from 'vs/base/common/errors'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { equals as objectEquals } from 'vs/base/common/objects'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; @@ -25,14 +25,13 @@ import { EditorViewColumn, editorGroupToViewColumn, viewColumnToEditorGroup } fr import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -export class MainThreadTextEditors implements MainThreadTextEditorsShape { +export class MainThreadTextEditors extends Disposable implements MainThreadTextEditorsShape { private static INSTANCE_COUNT: number = 0; private readonly _instanceId: string; private readonly _proxy: ExtHostEditorsShape; private readonly _documentsAndEditors: MainThreadDocumentsAndEditors; - private _toDispose: IDisposable[]; private _textEditorsListenersMap: { [editorId: string]: IDisposable[]; }; private _editorPositionData: ITextEditorPositionData | null; private _registeredDecorationTypes: { [decorationType: string]: boolean; }; @@ -45,29 +44,29 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape { @IEditorService private readonly _editorService: IEditorService, @IEditorGroupsService private readonly _editorGroupService: IEditorGroupsService ) { + super(); this._instanceId = String(++MainThreadTextEditors.INSTANCE_COUNT); this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostEditors); this._documentsAndEditors = documentsAndEditors; - this._toDispose = []; this._textEditorsListenersMap = Object.create(null); this._editorPositionData = null; - this._toDispose.push(documentsAndEditors.onTextEditorAdd(editors => editors.forEach(this._onTextEditorAdd, this))); - this._toDispose.push(documentsAndEditors.onTextEditorRemove(editors => editors.forEach(this._onTextEditorRemove, this))); + this._register(documentsAndEditors.onTextEditorAdd(editors => editors.forEach(this._onTextEditorAdd, this))); + this._register(documentsAndEditors.onTextEditorRemove(editors => editors.forEach(this._onTextEditorRemove, this))); - this._toDispose.push(this._editorService.onDidVisibleEditorsChange(() => this._updateActiveAndVisibleTextEditors())); - this._toDispose.push(this._editorGroupService.onDidRemoveGroup(() => this._updateActiveAndVisibleTextEditors())); - this._toDispose.push(this._editorGroupService.onDidMoveGroup(() => this._updateActiveAndVisibleTextEditors())); + this._register(this._editorService.onDidVisibleEditorsChange(() => this._updateActiveAndVisibleTextEditors())); + this._register(this._editorGroupService.onDidRemoveGroup(() => this._updateActiveAndVisibleTextEditors())); + this._register(this._editorGroupService.onDidMoveGroup(() => this._updateActiveAndVisibleTextEditors())); this._registeredDecorationTypes = Object.create(null); } public dispose(): void { + super.dispose(); Object.keys(this._textEditorsListenersMap).forEach((editorId) => { dispose(this._textEditorsListenersMap[editorId]); }); this._textEditorsListenersMap = Object.create(null); - this._toDispose = dispose(this._toDispose); for (let decorationType in this._registeredDecorationTypes) { this._codeEditorService.removeDecorationType(decorationType); } diff --git a/src/vs/workbench/api/browser/mainThreadKeytar.ts b/src/vs/workbench/api/browser/mainThreadKeytar.ts index 49551459664..f169cc457bf 100644 --- a/src/vs/workbench/api/browser/mainThreadKeytar.ts +++ b/src/vs/workbench/api/browser/mainThreadKeytar.ts @@ -16,16 +16,14 @@ interface IKeytarModule { @extHostNamedCustomer(MainContext.MainThreadKeytar) export class MainThreadKeytar implements MainThreadKeytarShape { - private _keytar: IKeytarModule | null; + private _keytar: Promise; constructor( extHostContext: IExtHostContext ) { - try { - this._keytar = require.__$__nodeRequire('keytar'); - } catch (e) { - this._keytar = null; - } + // tslint:disable-next-line:import-patterns + this._keytar = import('keytar') + .catch(e => null); } dispose(): void { @@ -33,28 +31,32 @@ export class MainThreadKeytar implements MainThreadKeytarShape { } async $getPassword(service: string, account: string): Promise { - if (this._keytar) { - return this._keytar.getPassword(service, account); + const keytar = await this._keytar; + if (keytar) { + return keytar.getPassword(service, account); } return null; } async $setPassword(service: string, account: string, password: string): Promise { - if (this._keytar) { - return this._keytar.setPassword(service, account, password); + const keytar = await this._keytar; + if (keytar) { + return keytar.setPassword(service, account, password); } } async $deletePassword(service: string, account: string): Promise { - if (this._keytar) { - return this._keytar.deletePassword(service, account); + const keytar = await this._keytar; + if (keytar) { + return keytar.deletePassword(service, account); } return false; } async $findPassword(service: string): Promise { - if (this._keytar) { - return this._keytar.findPassword(service); + const keytar = await this._keytar; + if (keytar) { + return keytar.findPassword(service); } return null; } diff --git a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts index 126112ed917..8e5dc539dc4 100644 --- a/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts @@ -11,14 +11,13 @@ import * as search from 'vs/workbench/contrib/search/common/search'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Position as EditorPosition } from 'vs/editor/common/core/position'; import { Range as EditorRange, IRange } from 'vs/editor/common/core/range'; -import { ExtHostContext, MainThreadLanguageFeaturesShape, ExtHostLanguageFeaturesShape, MainContext, IExtHostContext, ISerializedLanguageConfiguration, ISerializedRegExp, ISerializedIndentationRule, ISerializedOnEnterRule, LocationDto, WorkspaceSymbolDto, CodeActionDto, reviveWorkspaceEditDto, ISerializedDocumentFilter, DefinitionLinkDto, ISerializedSignatureHelpProviderMetadata, CodeInsetDto, LinkDto, CallHierarchyDto, SuggestDataDto } from '../common/extHost.protocol'; +import { ExtHostContext, MainThreadLanguageFeaturesShape, ExtHostLanguageFeaturesShape, MainContext, IExtHostContext, ISerializedLanguageConfiguration, ISerializedRegExp, ISerializedIndentationRule, ISerializedOnEnterRule, LocationDto, WorkspaceSymbolDto, CodeActionDto, reviveWorkspaceEditDto, ISerializedDocumentFilter, DefinitionLinkDto, ISerializedSignatureHelpProviderMetadata, LinkDto, CallHierarchyDto, SuggestDataDto } from '../common/extHost.protocol'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { LanguageConfiguration, IndentationRule, OnEnterRule } from 'vs/editor/common/modes/languageConfiguration'; import { IModeService } from 'vs/editor/common/services/modeService'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; import { URI } from 'vs/base/common/uri'; import { Selection } from 'vs/editor/common/core/selection'; -import * as codeInset from 'vs/workbench/contrib/codeinset/common/codeInset'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import * as callh from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { IHeapService } from 'vs/workbench/services/heap/common/heap'; @@ -140,25 +139,19 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha $registerCodeLensSupport(handle: number, selector: ISerializedDocumentFilter[], eventHandle: number | undefined): void { const provider = { - provideCodeLenses: (model: ITextModel, token: CancellationToken): modes.ICodeLensSymbol[] | Promise => { - return this._proxy.$provideCodeLenses(handle, model.uri, token).then(dto => { - if (dto) { - dto.forEach(obj => { - this._heapService.trackObject(obj); - this._heapService.trackObject(obj.command); - }); + provideCodeLenses: (model: ITextModel, token: CancellationToken): Promise => { + return this._proxy.$provideCodeLenses(handle, model.uri, token).then(listDto => { + if (!listDto) { + return undefined; } - return dto; + return { + lenses: listDto.lenses, + dispose: () => listDto.cacheId && this._proxy.$releaseCodeLenses(handle, listDto.cacheId) + }; }); }, - resolveCodeLens: (_model: ITextModel, codeLens: modes.ICodeLensSymbol, token: CancellationToken): Promise => { - return this._proxy.$resolveCodeLens(handle, codeLens, token).then(obj => { - if (obj) { - this._heapService.trackObject(obj); - this._heapService.trackObject(obj.command); - } - return obj; - }); + resolveCodeLens: (_model: ITextModel, codeLens: modes.CodeLens, token: CancellationToken): Promise => { + return this._proxy.$resolveCodeLens(handle, codeLens, token); } }; @@ -178,35 +171,6 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha } } - // -- code inset - - $registerCodeInsetSupport(handle: number, selector: ISerializedDocumentFilter[], eventHandle: number): void { - - const provider = { - provideCodeInsets: (model: ITextModel, token: CancellationToken): CodeInsetDto[] | Thenable => { - return this._proxy.$provideCodeInsets(handle, model.uri, token).then(dto => { - if (dto) { dto.forEach(obj => this._heapService.trackObject(obj)); } - return dto; - }); - }, - resolveCodeInset: (model: ITextModel, codeInset: CodeInsetDto, token: CancellationToken): CodeInsetDto | Thenable => { - return this._proxy.$resolveCodeInset(handle, model.uri, codeInset, token).then(obj => { - this._heapService.trackObject(obj); - return obj; - }); - } - }; - - if (typeof eventHandle === 'number') { - const emitter = new Emitter(); - this._registrations[eventHandle] = emitter; - provider.onDidChange = emitter.event; - } - - const langSelector = selector; - this._registrations[handle] = codeInset.CodeInsetProviderRegistry.register(langSelector, provider); - } - // --- declaration $registerDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void { diff --git a/src/vs/workbench/api/browser/mainThreadMessageService.ts b/src/vs/workbench/api/browser/mainThreadMessageService.ts index 0343323cf05..2c2507eca67 100644 --- a/src/vs/workbench/api/browser/mainThreadMessageService.ts +++ b/src/vs/workbench/api/browser/mainThreadMessageService.ts @@ -90,7 +90,8 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape { // if promise has not been resolved yet, now is the time to ensure a return value // otherwise if already resolved it means the user clicked one of the buttons Event.once(messageHandle.onDidClose)(() => { - dispose(...primaryActions, ...secondaryActions); + dispose(primaryActions); + dispose(secondaryActions); resolve(undefined); }); }); diff --git a/src/vs/workbench/api/browser/mainThreadWebview.ts b/src/vs/workbench/api/browser/mainThreadWebview.ts index a1867465520..c7b1f6462c5 100644 --- a/src/vs/workbench/api/browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/browser/mainThreadWebview.ts @@ -3,46 +3,365 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Disposable } from 'vs/base/common/lifecycle'; -import { UriComponents } from 'vs/base/common/uri'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import * as map from 'vs/base/common/map'; +import { URI, UriComponents } from 'vs/base/common/uri'; import * as modes from 'vs/editor/common/modes'; +import { localize } from 'vs/nls'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { MainContext, MainThreadWebviewsShape, WebviewPanelShowOptions } from 'vs/workbench/api/common/extHost.protocol'; +import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { ExtHostContext, ExtHostWebviewsShape, IExtHostContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelShowOptions } from 'vs/workbench/api/common/extHost.protocol'; +import { editorGroupToViewColumn, EditorViewColumn, viewColumnToEditorGroup } from 'vs/workbench/api/common/shared/editor'; +import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor'; +import { WebviewEditorInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput'; +import { ICreateWebViewShowOptions, IWebviewEditorService, WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { extHostNamedCustomer } from '../common/extHostCustomers'; +import { IProductService } from 'vs/platform/product/common/product'; @extHostNamedCustomer(MainContext.MainThreadWebviews) export class MainThreadWebviews extends Disposable implements MainThreadWebviewsShape { - $createWebviewPanel(handle: string, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: modes.IWebviewPanelOptions & modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void { - throw new Error('Method not implemented.'); + + private static readonly standardSupportedLinkSchemes = new Set([ + 'http', + 'https', + 'mailto', + 'vscode', + 'vscode-insider', + ]); + + private static revivalPool = 0; + + + private readonly _proxy: ExtHostWebviewsShape; + private readonly _webviews = new Map(); + private readonly _revivers = new Map(); + + private _activeWebview: WebviewPanelHandle | undefined = undefined; + + constructor( + context: IExtHostContext, + @ILifecycleService lifecycleService: ILifecycleService, + @IExtensionService extensionService: IExtensionService, + @IEditorGroupsService private readonly _editorGroupService: IEditorGroupsService, + @IEditorService private readonly _editorService: IEditorService, + @IWebviewEditorService private readonly _webviewService: IWebviewEditorService, + @IOpenerService private readonly _openerService: IOpenerService, + @ITelemetryService private readonly _telemetryService: ITelemetryService, + @IProductService private readonly _productService: IProductService, + ) { + super(); + + this._proxy = context.getProxy(ExtHostContext.ExtHostWebviews); + this._register(_editorService.onDidActiveEditorChange(this.onActiveEditorChanged, this)); + this._register(_editorService.onDidVisibleEditorsChange(this.onVisibleEditorsChanged, this)); + + // This reviver's only job is to activate webview extensions + // This should trigger the real reviver to be registered from the extension host side. + this._register(_webviewService.registerReviver({ + canRevive: (webview) => { + const viewType = webview.state.viewType; + if (viewType) { + extensionService.activateByEvent(`onWebviewPanel:${viewType}`); + } + return false; + }, + reviveWebview: () => { throw new Error('not implemented'); } + })); + + this._register(lifecycleService.onBeforeShutdown(e => { + e.veto(this._onBeforeShutdown()); + }, this)); } - $createWebviewCodeInset(handle: number, symbolId: string, options: modes.IWebviewOptions, extensionId: ExtensionIdentifier | undefined, extensionLocation: UriComponents | undefined): void { - throw new Error('Method not implemented.'); + + public $createWebviewPanel( + handle: WebviewPanelHandle, + viewType: string, + title: string, + showOptions: { viewColumn?: EditorViewColumn, preserveFocus?: boolean }, + options: WebviewInputOptions, + extensionId: ExtensionIdentifier, + extensionLocation: UriComponents + ): void { + const mainThreadShowOptions: ICreateWebViewShowOptions = Object.create(null); + if (showOptions) { + mainThreadShowOptions.preserveFocus = !!showOptions.preserveFocus; + mainThreadShowOptions.group = viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn); + } + + const webview = this._webviewService.createWebview(this.getInternalWebviewId(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), { + location: URI.revive(extensionLocation), + id: extensionId + }, this.createWebviewEventDelegate(handle)); + webview.state = { + viewType: viewType, + state: undefined + }; + + this._webviews.set(handle, webview); + + /* __GDPR__ + "webviews:createWebviewPanel" : { + "extensionId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + this._telemetryService.publicLog('webviews:createWebviewPanel', { extensionId: extensionId.value }); } - $disposeWebview(handle: string): void { - throw new Error('Method not implemented.'); + + public $disposeWebview(handle: WebviewPanelHandle): void { + const webview = this.getWebview(handle); + webview.dispose(); } - $reveal(handle: string, showOptions: WebviewPanelShowOptions): void { - throw new Error('Method not implemented.'); + + public $setTitle(handle: WebviewPanelHandle, value: string): void { + const webview = this.getWebview(handle); + webview.setName(value); } - $setTitle(handle: string, value: string): void { - throw new Error('Method not implemented.'); + + public $setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void { + const webview = this.getWebview(handle); + webview.iconPath = reviveWebviewIcon(value); } - $setIconPath(handle: string, value: { light: UriComponents; dark: UriComponents; } | undefined): void { - throw new Error('Method not implemented.'); + + public $setHtml(handle: WebviewPanelHandle, value: string): void { + const webview = this.getWebview(handle); + webview.html = value; } - $setHtml(handle: string | number, value: string): void { - throw new Error('Method not implemented.'); + + public $setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void { + const webview = this.getWebview(handle); + webview.setOptions(reviveWebviewOptions(options as any /*todo@mat */)); } - $setOptions(handle: string | number, options: modes.IWebviewOptions): void { - throw new Error('Method not implemented.'); + + public $reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void { + const webview = this.getWebview(handle); + if (webview.isDisposed()) { + return; + } + + const targetGroup = this._editorGroupService.getGroup(viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn)) || this._editorGroupService.getGroup(webview.group || 0); + if (targetGroup) { + this._webviewService.revealWebview(webview, targetGroup, !!showOptions.preserveFocus); + } } - $postMessage(handle: string | number, value: any): Promise { - throw new Error('Method not implemented.'); + + public async $postMessage(handle: WebviewPanelHandle, message: any): Promise { + const webview = this.getWebview(handle); + const editors = this._editorService.visibleControls + .filter(e => e instanceof WebviewEditor) + .map(e => e as WebviewEditor) + .filter(e => e.input!.matches(webview)); + + if (editors.length > 0) { + editors[0].sendMessage(message); + return true; + } + + if (webview.webview) { + webview.webview.sendMessage(message); + return true; + } + + return false; } - $registerSerializer(viewType: string): void { - throw new Error('Method not implemented.'); + + public $registerSerializer(viewType: string): void { + if (this._revivers.has(viewType)) { + throw new Error(`Reviver for ${viewType} already registered`); + } + + this._revivers.set(viewType, this._webviewService.registerReviver({ + canRevive: (webview) => { + return webview.state && webview.state.viewType === viewType; + }, + reviveWebview: async (webview): Promise => { + const viewType = webview.state.viewType; + const handle = 'revival-' + MainThreadWebviews.revivalPool++; + this._webviews.set(handle, webview); + webview._events = this.createWebviewEventDelegate(handle); + let state = undefined; + if (webview.state.state) { + try { + state = JSON.parse(webview.state.state); + } catch { + // noop + } + } + + try { + await this._proxy.$deserializeWebviewPanel(handle, viewType, webview.getTitle(), state, editorGroupToViewColumn(this._editorGroupService, webview.group || 0), webview.options); + } catch (error) { + onUnexpectedError(error); + webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType); + } + } + })); } - $unregisterSerializer(viewType: string): void { - throw new Error('Method not implemented.'); + + public $unregisterSerializer(viewType: string): void { + const reviver = this._revivers.get(viewType); + if (!reviver) { + throw new Error(`No reviver for ${viewType} registered`); + } + + reviver.dispose(); + this._revivers.delete(viewType); + } + + private getInternalWebviewId(viewType: string): string { + return `mainThreadWebview-${viewType}`; + } + + private _onBeforeShutdown(): boolean { + this._webviews.forEach((webview) => { + if (!webview.isDisposed() && webview.state && this._revivers.has(webview.state.viewType)) { + webview.state.state = webview.webviewState; + } + }); + return false; // Don't veto shutdown + } + + private createWebviewEventDelegate(handle: WebviewPanelHandle) { + return { + onDidClickLink: (uri: URI) => this.onDidClickLink(handle, uri), + onMessage: (message: any) => this._proxy.$onMessage(handle, message), + onDispose: () => { + this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => { + this._webviews.delete(handle); + }); + } + }; + } + + private onActiveEditorChanged() { + const activeEditor = this._editorService.activeControl; + let newActiveWebview: { input: WebviewEditorInput, handle: WebviewPanelHandle } | undefined = undefined; + if (activeEditor && activeEditor.input instanceof WebviewEditorInput) { + for (const handle of map.keys(this._webviews)) { + const input = this._webviews.get(handle)!; + if (input.matches(activeEditor.input)) { + newActiveWebview = { input, handle }; + break; + } + } + } + + if (newActiveWebview && newActiveWebview.handle === this._activeWebview) { + // Webview itself unchanged but position may have changed + this._proxy.$onDidChangeWebviewPanelViewState(newActiveWebview.handle, { + active: true, + visible: true, + position: editorGroupToViewColumn(this._editorGroupService, newActiveWebview.input.group || 0) + }); + return; + } + + // Broadcast view state update for currently active + if (typeof this._activeWebview !== 'undefined') { + const oldActiveWebview = this._webviews.get(this._activeWebview); + if (oldActiveWebview) { + this._proxy.$onDidChangeWebviewPanelViewState(this._activeWebview, { + active: false, + visible: this._editorService.visibleControls.some(editor => !!editor.input && editor.input.matches(oldActiveWebview)), + position: editorGroupToViewColumn(this._editorGroupService, oldActiveWebview.group || 0), + }); + } + } + + // Then for newly active + if (newActiveWebview) { + this._proxy.$onDidChangeWebviewPanelViewState(newActiveWebview.handle, { + active: true, + visible: true, + position: editorGroupToViewColumn(this._editorGroupService, activeEditor ? activeEditor.group : ACTIVE_GROUP), + }); + this._activeWebview = newActiveWebview.handle; + } else { + this._activeWebview = undefined; + } + } + + private onVisibleEditorsChanged(): void { + this._webviews.forEach((input, handle) => { + for (const workbenchEditor of this._editorService.visibleControls) { + if (workbenchEditor.input && workbenchEditor.input.matches(input)) { + const editorPosition = editorGroupToViewColumn(this._editorGroupService, workbenchEditor.group!); + + input.updateGroup(workbenchEditor.group!.id); + this._proxy.$onDidChangeWebviewPanelViewState(handle, { + active: handle === this._activeWebview, + visible: true, + position: editorPosition + }); + break; + } + } + }); + } + + private onDidClickLink(handle: WebviewPanelHandle, link: URI): void { + if (!link) { + return; + } + + const webview = this.getWebview(handle); + if (this.isSupportedLink(webview, link)) { + this._openerService.open(link); + } + } + + private isSupportedLink(webview: WebviewEditorInput, link: URI): boolean { + if (MainThreadWebviews.standardSupportedLinkSchemes.has(link.scheme)) { + return true; + } + if (this._productService.urlProtocol === link.scheme) { + return true; + } + return !!webview.options.enableCommandUris && link.scheme === 'command'; + } + + private getWebview(handle: WebviewPanelHandle): WebviewEditorInput { + const webview = this._webviews.get(handle); + if (!webview) { + throw new Error('Unknown webview handle:' + handle); + } + return webview; + } + + private static getDeserializationFailedContents(viewType: string) { + return ` + + + + + + + ${localize('errorMessage', "An error occurred while restoring view:{0}", viewType)} + `; } } + +function reviveWebviewOptions(options: WebviewInputOptions): WebviewInputOptions { + return { + ...options, + localResourceRoots: Array.isArray(options.localResourceRoots) ? options.localResourceRoots.map(r => URI.revive(r)) : undefined, + }; +} + +function reviveWebviewIcon( + value: { light: UriComponents, dark: UriComponents } | undefined +): { light: URI, dark: URI } | undefined { + if (!value) { + return undefined; + } + + return { + light: URI.revive(value.light), + dark: URI.revive(value.dark) + }; +} diff --git a/src/vs/workbench/api/browser/mainThreadWindow.ts b/src/vs/workbench/api/browser/mainThreadWindow.ts index 4c5b038c231..18893db47b2 100644 --- a/src/vs/workbench/api/browser/mainThreadWindow.ts +++ b/src/vs/workbench/api/browser/mainThreadWindow.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Event } from 'vs/base/common/event'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; @@ -13,10 +13,9 @@ import { ITunnelService, RemoteTunnel } from 'vs/platform/remote/common/tunnel'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @extHostNamedCustomer(MainContext.MainThreadWindow) -export class MainThreadWindow implements MainThreadWindowShape { +export class MainThreadWindow extends Disposable implements MainThreadWindowShape { private readonly proxy: ExtHostWindowShape; - private disposables: IDisposable[] = []; private readonly _tunnels = new Map>(); constructor( @@ -26,14 +25,15 @@ export class MainThreadWindow implements MainThreadWindowShape { @ITunnelService private readonly tunnelService: ITunnelService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService ) { + super(); this.proxy = extHostContext.getProxy(ExtHostContext.ExtHostWindow); - Event.latch(windowService.onDidChangeFocus) - (this.proxy.$onDidChangeWindowFocus, this.proxy, this.disposables); + this._register(Event.latch(windowService.onDidChangeFocus) + (this.proxy.$onDidChangeWindowFocus, this.proxy)); } dispose(): void { - this.disposables = dispose(this.disposables); + super.dispose(); for (const tunnel of this._tunnels.values()) { tunnel.then(tunnel => tunnel.dispose()); diff --git a/src/vs/workbench/api/browser/mainThreadWorkspace.ts b/src/vs/workbench/api/browser/mainThreadWorkspace.ts index 8e91801b58f..6720db87bf9 100644 --- a/src/vs/workbench/api/browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/browser/mainThreadWorkspace.ts @@ -13,7 +13,6 @@ import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ILabelService } from 'vs/platform/label/common/label'; import { IFileMatch, IPatternInfo, ISearchProgressItem, ISearchService } from 'vs/workbench/services/search/common/search'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { IWorkspaceContextService, WorkbenchState, IWorkspace } from 'vs/platform/workspace/common/workspace'; import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers'; @@ -24,6 +23,7 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, MainThreadWorkspaceShape, IWorkspaceData, ITextSearchComplete } from '../common/extHost.protocol'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { isEqualOrParent } from 'vs/base/common/resources'; +import { INotificationService } from 'vs/platform/notification/common/notification'; @extHostNamedCustomer(MainContext.MainThreadWorkspace) export class MainThreadWorkspace implements MainThreadWorkspaceShape { @@ -39,7 +39,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @ITextFileService private readonly _textFileService: ITextFileService, @IWorkspaceEditingService private readonly _workspaceEditingService: IWorkspaceEditingService, - @IStatusbarService private readonly _statusbarService: IStatusbarService, + @INotificationService private readonly _notificationService: INotificationService, @IWindowService private readonly _windowService: IWindowService, @IInstantiationService private readonly _instantiationService: IInstantiationService, @ILabelService private readonly _labelService: ILabelService, @@ -66,7 +66,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { const workspaceFoldersToAdd = foldersToAdd.map(f => ({ uri: URI.revive(f.uri), name: f.name })); // Indicate in status message - this._statusbarService.setStatusMessage(this.getStatusMessage(extensionName, workspaceFoldersToAdd.length, deleteCount), 10 * 1000 /* 10s */); + this._notificationService.status(this.getStatusMessage(extensionName, workspaceFoldersToAdd.length, deleteCount), { hideAfter: 10 * 1000 /* 10s */ }); return this._workspaceEditingService.updateFolders(index, deleteCount, workspaceFoldersToAdd, true); } diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index ed5dec5a66f..06160349ea4 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -42,7 +42,6 @@ import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; import { IMarkdownString } from 'vs/base/common/htmlContent'; import { ResolvedAuthority, RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import * as codeInset from 'vs/workbench/contrib/codeinset/common/codeInset'; import * as callHierarchy from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { IRelativePattern } from 'vs/base/common/glob'; import { IRemoteConsoleLog } from 'vs/base/common/console'; @@ -137,7 +136,7 @@ export interface MainThreadCommentsShape extends IDisposable { $registerCommentController(handle: number, id: string, label: string): void; $unregisterCommentController(handle: number): void; $updateCommentControllerFeatures(handle: number, features: CommentProviderFeatures): void; - $createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange): modes.CommentThread2 | undefined; + $createCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, extensionId: ExtensionIdentifier): modes.CommentThread2 | undefined; $updateCommentThread(handle: number, commentThreadHandle: number, threadId: string, resource: UriComponents, range: IRange, label: string, contextValue: string | undefined, comments: modes.Comment[], acceptInputCommand: modes.Command | undefined, additionalCommands: modes.Command[], deleteCommand: modes.Command | undefined, collapseState: modes.CommentThreadCollapsibleState): void; $deleteCommentThread(handle: number, commentThreadHandle: number): void; $setInputValue(handle: number, input: string): void; @@ -333,7 +332,6 @@ export interface MainThreadLanguageFeaturesShape extends IDisposable { $unregister(handle: number): void; $registerDocumentSymbolProvider(handle: number, selector: ISerializedDocumentFilter[], label: string): void; $registerCodeLensSupport(handle: number, selector: ISerializedDocumentFilter[], eventHandle: number | undefined): void; - $registerCodeInsetSupport(handle: number, selector: ISerializedDocumentFilter[], eventHandle: number | undefined): void; $emitCodeLensEvent(eventHandle: number, event?: any): void; $registerDefinitionSupport(handle: number, selector: ISerializedDocumentFilter[]): void; $registerDeclarationSupport(handle: number, selector: ISerializedDocumentFilter[]): void; @@ -510,9 +508,21 @@ export interface MainThreadTelemetryShape extends IDisposable { $publicLog(eventName: string, data?: any): void; } -export type WebviewPanelHandle = string; +export interface MainThreadEditorInsetsShape extends IDisposable { + $createEditorInset(handle: number, editorId: string, document: UriComponents, range: IRange, options: modes.IWebviewOptions): Promise; + $disposeEditorInset(handle: number): void; -export type WebviewInsetHandle = number; + $setHtml(handle: number, value: string): void; + $setOptions(handle: number, options: modes.IWebviewOptions): void; + $postMessage(handle: number, value: any): Promise; +} + +export interface ExtHostEditorInsetsShape { + $onDidDispose(handle: number): void; + $onDidReceiveMessage(handle: number, message: any): void; +} + +export type WebviewPanelHandle = string; export interface WebviewPanelShowOptions { readonly viewColumn?: EditorViewColumn; @@ -521,15 +531,14 @@ export interface WebviewPanelShowOptions { export interface MainThreadWebviewsShape extends IDisposable { $createWebviewPanel(handle: WebviewPanelHandle, viewType: string, title: string, showOptions: WebviewPanelShowOptions, options: modes.IWebviewPanelOptions & modes.IWebviewOptions, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void; - $createWebviewCodeInset(handle: WebviewInsetHandle, symbolId: string, options: modes.IWebviewOptions, extensionId: ExtensionIdentifier | undefined, extensionLocation: UriComponents | undefined): void; $disposeWebview(handle: WebviewPanelHandle): void; $reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void; $setTitle(handle: WebviewPanelHandle, value: string): void; $setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void; - $setHtml(handle: WebviewPanelHandle | WebviewInsetHandle, value: string): void; - $setOptions(handle: WebviewPanelHandle | WebviewInsetHandle, options: modes.IWebviewOptions): void; - $postMessage(handle: WebviewPanelHandle | WebviewInsetHandle, value: any): Promise; + $setHtml(handle: WebviewPanelHandle, value: string): void; + $setOptions(handle: WebviewPanelHandle, options: modes.IWebviewOptions): void; + $postMessage(handle: WebviewPanelHandle, value: any): Promise; $registerSerializer(viewType: string): void; $unregisterSerializer(viewType: string): void; @@ -999,13 +1008,16 @@ export interface LinkDto { tooltip?: string; } -export interface CodeLensDto extends ObjectIdentifier { - range: IRange; - id?: string; - command?: CommandDto; +export interface CodeLensListDto { + cacheId?: number; + lenses: CodeLensDto[]; } -export type CodeInsetDto = ObjectIdentifier & codeInset.ICodeInsetSymbol; +export interface CodeLensDto { + cacheId?: ChainedCacheId; + range: IRange; + command?: CommandDto; +} export interface CallHierarchyDto { _id: number; @@ -1019,10 +1031,9 @@ export interface CallHierarchyDto { export interface ExtHostLanguageFeaturesShape { $provideDocumentSymbols(handle: number, resource: UriComponents, token: CancellationToken): Promise; - $provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise; + $provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise; $resolveCodeLens(handle: number, symbol: CodeLensDto, token: CancellationToken): Promise; - $provideCodeInsets(handle: number, resource: UriComponents, token: CancellationToken): Promise; - $resolveCodeInset(handle: number, resource: UriComponents, symbol: CodeInsetDto, token: CancellationToken): Promise; + $releaseCodeLenses(handle: number, id: number): void; $provideDefinition(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise; $provideDeclaration(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise; $provideImplementation(handle: number, resource: UriComponents, position: IPosition, token: CancellationToken): Promise; @@ -1210,6 +1221,7 @@ export interface ExtHostCommentsShape { $provideDocumentComments(handle: number, document: UriComponents): Promise; $createNewCommentThread(handle: number, document: UriComponents, range: IRange, text: string): Promise; $createCommentThreadTemplate(commentControllerHandle: number, uriComponents: UriComponents, range: IRange): void; + $updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange): Promise; $onCommentWidgetInputChange(commentControllerHandle: number, document: UriComponents, range: IRange, input: string | undefined): Promise; $deleteCommentThread(commentControllerHandle: number, commentThreadHandle: number): void; $provideCommentingRanges(commentControllerHandle: number, uriComponents: UriComponents, token: CancellationToken): Promise; @@ -1247,6 +1259,7 @@ export const MainContext = { MainThreadDocuments: createMainId('MainThreadDocuments'), MainThreadDocumentContentProviders: createMainId('MainThreadDocumentContentProviders'), MainThreadTextEditors: createMainId('MainThreadTextEditors'), + MainThreadEditorInsets: createMainId('MainThreadEditorInsets'), MainThreadErrors: createMainId('MainThreadErrors'), MainThreadTreeViews: createMainId('MainThreadTreeViews'), MainThreadKeytar: createMainId('MainThreadKeytar'), @@ -1297,6 +1310,7 @@ export const ExtHostContext = { ExtHostWorkspace: createExtId('ExtHostWorkspace'), ExtHostWindow: createExtId('ExtHostWindow'), ExtHostWebviews: createExtId('ExtHostWebviews'), + ExtHostEditorInsets: createExtId('ExtHostEditorInsets'), ExtHostProgress: createMainId('ExtHostProgress'), ExtHostComments: createMainId('ExtHostComments'), ExtHostStorage: createMainId('ExtHostStorage'), diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index d4f1eb5ba6d..0c5874b2b06 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -504,7 +504,7 @@ export class ExtHostApiCommands { private _executeCodeLensProvider(resource: URI, itemResolveCount: number): Promise { const args = { resource, itemResolveCount }; - return this._commands.executeCommand('_executeCodeLensProvider', args) + return this._commands.executeCommand('_executeCodeLensProvider', args) .then(tryMapWith(item => { return new types.CodeLens( typeConverters.Range.to(item.range), diff --git a/src/vs/workbench/api/common/extHostCodeInsets.ts b/src/vs/workbench/api/common/extHostCodeInsets.ts new file mode 100644 index 00000000000..c2a6e2de298 --- /dev/null +++ b/src/vs/workbench/api/common/extHostCodeInsets.ts @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Emitter } from 'vs/base/common/event'; +import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; +import * as vscode from 'vscode'; +import { MainThreadEditorInsetsShape } from './extHost.protocol'; +import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors'; +import { DisposableStore } from 'vs/base/common/lifecycle'; +import { ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor'; + +export class ExtHostEditorInsets implements ExtHostEditorInsets { + + private _handlePool = 0; + private _disposables = new DisposableStore(); + private _insets = new Map }>(); + + constructor( + private readonly _proxy: MainThreadEditorInsetsShape, + private readonly _editors: ExtHostEditors + ) { + + // dispose editor inset whenever the hosting editor goes away + this._disposables.add(_editors.onDidChangeVisibleTextEditors(() => { + const visibleEditor = _editors.getVisibleTextEditors(); + this._insets.forEach(value => { + if (visibleEditor.indexOf(value.editor) < 0) { + value.inset.dispose(); // will remove from `this._insets` + } + }); + })); + } + + dispose(): void { + this._insets.forEach(value => value.inset.dispose()); + this._disposables.dispose(); + } + + createWebviewEditorInset(editor: vscode.TextEditor, range: vscode.Range, options?: vscode.WebviewOptions): vscode.WebviewEditorInset { + + let apiEditor: ExtHostTextEditor | undefined; + for (const candidate of this._editors.getVisibleTextEditors()) { + if (candidate === editor) { + apiEditor = candidate; + break; + } + } + if (!apiEditor) { + throw new Error('not a visible editor'); + } + + const that = this; + const handle = this._handlePool++; + const onDidReceiveMessage = new Emitter(); + const onDidDispose = new Emitter(); + + const webview = new class implements vscode.Webview { + + private _html: string = ''; + private _options: vscode.WebviewOptions; + + set options(value: vscode.WebviewOptions) { + this._options = value; + that._proxy.$setOptions(handle, value); + } + + get options(): vscode.WebviewOptions { + return this._options; + } + + set html(value: string) { + this._html = value; + that._proxy.$setHtml(handle, value); + } + + get html(): string { + return this._html; + } + + get onDidReceiveMessage(): vscode.Event { + return onDidReceiveMessage.event; + } + + postMessage(message: any): Thenable { + return that._proxy.$postMessage(handle, message); + } + }; + + const inset = new class implements vscode.WebviewEditorInset { + + readonly editor: vscode.TextEditor = editor; + readonly range: vscode.Range = range; + readonly webview: vscode.Webview = webview; + readonly onDidDispose: vscode.Event = onDidDispose.event; + + dispose(): void { + if (that._insets.has(handle)) { + that._insets.delete(handle); + that._proxy.$disposeEditorInset(handle); + onDidDispose.fire(); + + // final cleanup + onDidDispose.dispose(); + onDidReceiveMessage.dispose(); + } + } + }; + + this._proxy.$createEditorInset(handle, apiEditor.id, apiEditor.document.uri, typeConverters.Range.from(range), options || {}); + this._insets.set(handle, { editor, inset, onDidReceiveMessage }); + + return inset; + } + + $onDidDispose(handle: number): void { + const value = this._insets.get(handle); + if (value) { + value.inset.dispose(); + } + } + + $onDidReceiveMessage(handle: number, message: any): void { + const value = this._insets.get(handle); + if (value) { + value.onDidReceiveMessage.fire(message); + } + } +} diff --git a/src/vs/workbench/api/common/extHostCommands.ts b/src/vs/workbench/api/common/extHostCommands.ts index 59edc45abf3..11df6eeef3c 100644 --- a/src/vs/workbench/api/common/extHostCommands.ts +++ b/src/vs/workbench/api/common/extHostCommands.ts @@ -18,6 +18,7 @@ import { revive } from 'vs/base/common/marshalling'; import { Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; import { URI } from 'vs/base/common/uri'; +import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; interface CommandHandler { callback: Function; @@ -211,6 +212,35 @@ export class CommandsConverter { this._commands.registerCommand(true, this._delegatingCommandId, this._executeConvertedCommand, this); } + toInternal2(command: vscode.Command | undefined, disposables: DisposableStore): CommandDto | undefined { + + if (!command) { + return undefined; + } + + const result: CommandDto = { + $ident: undefined, + id: command.command, + title: command.title, + tooltip: command.tooltip + }; + + if (command.command && isNonEmptyArray(command.arguments)) { + // we have a contributed command with arguments. that + // means we don't want to send the arguments around + + const id = this._heap.keep(command); + disposables.add(toDisposable(() => this._heap.delete(id))); + result.$ident = id; + + result.id = this._delegatingCommandId; + result.arguments = [id]; + + } + + return result; + } + toInternal(command: vscode.Command): CommandDto; toInternal(command: undefined): undefined; toInternal(command: vscode.Command | undefined): CommandDto | undefined; diff --git a/src/vs/workbench/api/common/extHostComments.ts b/src/vs/workbench/api/common/extHostComments.ts index 9276ca5f685..d10cb9a5325 100644 --- a/src/vs/workbench/api/common/extHostComments.ts +++ b/src/vs/workbench/api/common/extHostComments.ts @@ -162,6 +162,16 @@ export class ExtHostComments implements ExtHostCommentsShape { commentController.$createCommentThreadTemplate(uriComponents, range); } + async $updateCommentThreadTemplate(commentControllerHandle: number, threadHandle: number, range: IRange) { + const commentController = this._commentControllers.get(commentControllerHandle); + + if (!commentController) { + return; + } + + commentController.$updateCommentThreadTemplate(threadHandle, range); + } + $onCommentWidgetInputChange(commentControllerHandle: number, uriComponents: UriComponents, range: IRange, input: string): Promise { const commentController = this._commentControllers.get(commentControllerHandle); @@ -582,7 +592,8 @@ export class ExtHostCommentThread implements vscode.CommentThread { private _id: string | undefined, private _uri: vscode.Uri, private _range: vscode.Range, - private _comments: vscode.Comment[] + private _comments: vscode.Comment[], + extensionId: ExtensionIdentifier ) { if (this._id === undefined) { this._id = `${_commentController.id}.${this.handle}`; @@ -593,7 +604,8 @@ export class ExtHostCommentThread implements vscode.CommentThread { this.handle, this._id, this._uri, - extHostTypeConverter.Range.from(this._range) + extHostTypeConverter.Range.from(this._range), + extensionId ); this._localDisposables = []; @@ -741,7 +753,7 @@ class ExtHostCommentController implements vscode.CommentController { } constructor( - _extension: IExtensionDescription, + private _extension: IExtensionDescription, private _handle: number, private readonly _commandsConverter: CommandsConverter, private _proxy: MainThreadCommentsShape, @@ -755,23 +767,30 @@ class ExtHostCommentController implements vscode.CommentController { createCommentThread(id: string, resource: vscode.Uri, range: vscode.Range, comments: vscode.Comment[]): vscode.CommentThread; createCommentThread(arg0: vscode.Uri | string, arg1: vscode.Uri | vscode.Range, arg2: vscode.Range | vscode.Comment[], arg3?: vscode.Comment[]): vscode.CommentThread { if (typeof arg0 === 'string') { - const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, arg0, arg1 as vscode.Uri, arg2 as vscode.Range, arg3 as vscode.Comment[]); + const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, arg0, arg1 as vscode.Uri, arg2 as vscode.Range, arg3 as vscode.Comment[], this._extension.identifier); this._threads.set(commentThread.handle, commentThread); return commentThread; } else { - const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, undefined, arg0 as vscode.Uri, arg1 as vscode.Range, arg2 as vscode.Comment[]); + const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, undefined, arg0 as vscode.Uri, arg1 as vscode.Range, arg2 as vscode.Comment[], this._extension.identifier); this._threads.set(commentThread.handle, commentThread); return commentThread; } } $createCommentThreadTemplate(uriComponents: UriComponents, range: IRange) { - const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, undefined, URI.revive(uriComponents), extHostTypeConverter.Range.to(range), []); + const commentThread = new ExtHostCommentThread(this._proxy, this._commandsConverter, this, undefined, URI.revive(uriComponents), extHostTypeConverter.Range.to(range), [], this._extension.identifier); commentThread.collapsibleState = modes.CommentThreadCollapsibleState.Expanded; this._threads.set(commentThread.handle, commentThread); return commentThread; } + $updateCommentThreadTemplate(threadHandle: number, range: IRange) { + let thread = this._threads.get(threadHandle); + if (thread) { + thread.range = extHostTypeConverter.Range.to(range); + } + } + $deleteCommentThread(threadHandle: number) { let thread = this._threads.get(threadHandle); diff --git a/src/vs/workbench/api/common/extHostDocuments.ts b/src/vs/workbench/api/common/extHostDocuments.ts index b7cf7793138..5c5f3ddaf94 100644 --- a/src/vs/workbench/api/common/extHostDocuments.ts +++ b/src/vs/workbench/api/common/extHostDocuments.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Emitter, Event } from 'vs/base/common/event'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { URI, UriComponents } from 'vs/base/common/uri'; import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; import { ExtHostDocumentsShape, IMainContext, MainContext, MainThreadDocumentsShape } from 'vs/workbench/api/common/extHost.protocol'; @@ -13,7 +13,7 @@ import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocum import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters'; import * as vscode from 'vscode'; -export class ExtHostDocuments implements ExtHostDocumentsShape { +export class ExtHostDocuments extends Disposable implements ExtHostDocumentsShape { private _onDidAddDocument = new Emitter(); private _onDidRemoveDocument = new Emitter(); @@ -25,31 +25,25 @@ export class ExtHostDocuments implements ExtHostDocumentsShape { readonly onDidChangeDocument: Event = this._onDidChangeDocument.event; readonly onDidSaveDocument: Event = this._onDidSaveDocument.event; - private _toDispose: IDisposable[]; private _proxy: MainThreadDocumentsShape; private _documentsAndEditors: ExtHostDocumentsAndEditors; private _documentLoader = new Map>(); constructor(mainContext: IMainContext, documentsAndEditors: ExtHostDocumentsAndEditors) { + super(); this._proxy = mainContext.getProxy(MainContext.MainThreadDocuments); this._documentsAndEditors = documentsAndEditors; - this._toDispose = [ - this._documentsAndEditors.onDidRemoveDocuments(documents => { - for (const data of documents) { - this._onDidRemoveDocument.fire(data.document); - } - }), - this._documentsAndEditors.onDidAddDocuments(documents => { - for (const data of documents) { - this._onDidAddDocument.fire(data.document); - } - }) - ]; - } - - public dispose(): void { - dispose(this._toDispose); + this._register(this._documentsAndEditors.onDidRemoveDocuments(documents => { + for (const data of documents) { + this._onDidRemoveDocument.fire(data.document); + } + })); + this._register(this._documentsAndEditors.onDidAddDocuments(documents => { + for (const data of documents) { + this._onDidAddDocument.fire(data.document); + } + })); } public getAllDocumentData(): ExtHostDocumentData[] { diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index 3f6c11fe20a..5ee506bf01a 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -15,7 +15,7 @@ import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments'; import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands'; import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics'; import { asPromise } from 'vs/base/common/async'; -import { MainContext, MainThreadLanguageFeaturesShape, ExtHostLanguageFeaturesShape, ObjectIdentifier, IRawColorInfo, IMainContext, IdObject, ISerializedRegExp, ISerializedIndentationRule, ISerializedOnEnterRule, ISerializedLanguageConfiguration, WorkspaceSymbolDto, SuggestResultDto, WorkspaceSymbolsDto, CodeActionDto, ISerializedDocumentFilter, WorkspaceEditDto, ISerializedSignatureHelpProviderMetadata, LinkDto, CodeLensDto, MainThreadWebviewsShape, CodeInsetDto, SuggestDataDto, LinksListDto, ChainedCacheId } from './extHost.protocol'; +import { MainContext, MainThreadLanguageFeaturesShape, ExtHostLanguageFeaturesShape, ObjectIdentifier, IRawColorInfo, IMainContext, IdObject, ISerializedRegExp, ISerializedIndentationRule, ISerializedOnEnterRule, ISerializedLanguageConfiguration, WorkspaceSymbolDto, SuggestResultDto, WorkspaceSymbolsDto, CodeActionDto, ISerializedDocumentFilter, WorkspaceEditDto, ISerializedSignatureHelpProviderMetadata, LinkDto, CodeLensDto, SuggestDataDto, LinksListDto, ChainedCacheId, CodeLensListDto } from './extHost.protocol'; import { regExpLeadsToEndlessLoop, regExpFlags } from 'vs/base/common/strings'; import { IPosition } from 'vs/editor/common/core/position'; import { IRange, Range as EditorRange } from 'vs/editor/common/core/range'; @@ -25,12 +25,10 @@ import { ISelection, Selection } from 'vs/editor/common/core/selection'; import { ILogService } from 'vs/platform/log/common/log'; import { CancellationToken } from 'vs/base/common/cancellation'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; -import { ExtHostWebview } from 'vs/workbench/api/common/extHostWebview'; -import * as codeInset from 'vs/workbench/contrib/codeinset/common/codeInset'; -import { generateUuid } from 'vs/base/common/uuid'; import * as callHierarchy from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { LRUCache } from 'vs/base/common/map'; import { IURITransformer } from 'vs/base/common/uriIpc'; +import { DisposableStore, dispose } from 'vs/base/common/lifecycle'; // --- adapter @@ -105,35 +103,50 @@ class CodeLensAdapter { private static _badCmd: vscode.Command = { command: 'missing', title: '!!MISSING: command!!' }; + private readonly _cache = new Cache(); + private readonly _disposables = new Map(); + constructor( private readonly _documents: ExtHostDocuments, private readonly _commands: CommandsConverter, - private readonly _heapService: ExtHostHeapService, private readonly _provider: vscode.CodeLensProvider ) { } - provideCodeLenses(resource: URI, token: CancellationToken): Promise { + provideCodeLenses(resource: URI, token: CancellationToken): Promise { const doc = this._documents.getDocument(resource); return asPromise(() => this._provider.provideCodeLenses(doc, token)).then(lenses => { - const result: CodeLensDto[] = []; - if (isNonEmptyArray(lenses)) { - for (const lens of lenses) { - const id = this._heapService.keep(lens); - result.push(ObjectIdentifier.mixin({ - range: typeConvert.Range.from(lens.range), - command: this._commands.toInternal(lens.command) - }, id)); - } + + if (!lenses || token.isCancellationRequested) { + return undefined; } + + const cacheId = this._cache.add(lenses); + const disposables = new DisposableStore(); + this._disposables.set(cacheId, disposables); + + const result: CodeLensListDto = { + cacheId, + lenses: [], + }; + + for (let i = 0; i < lenses.length; i++) { + result.lenses.push({ + cacheId: [cacheId, i], + range: typeConvert.Range.from(lenses[i].range), + command: this._commands.toInternal2(lenses[i].command, disposables) + }); + } + return result; }); } resolveCodeLens(symbol: CodeLensDto, token: CancellationToken): Promise { - const lens = this._heapService.get(ObjectIdentifier.of(symbol)); - if (!lens) { + const lens = symbol.cacheId && this._cache.get(...symbol.cacheId); + const disposables = symbol.cacheId && this._disposables.get(symbol.cacheId[0]); + if (!lens || !disposables) { return Promise.resolve(undefined); } @@ -146,50 +159,15 @@ class CodeLensAdapter { return resolve.then(newLens => { newLens = newLens || lens; - symbol.command = this._commands.toInternal(newLens.command || CodeLensAdapter._badCmd); + symbol.command = this._commands.toInternal2(newLens.command || CodeLensAdapter._badCmd, disposables); return symbol; }); } -} -class CodeInsetAdapter { - - constructor( - private readonly _documents: ExtHostDocuments, - private readonly _heapService: ExtHostHeapService, - private readonly _provider: vscode.CodeInsetProvider - ) { } - - provideCodeInsets(resource: URI, token: CancellationToken): Promise { - const doc = this._documents.getDocument(resource); - return asPromise(() => this._provider.provideCodeInsets(doc, token)).then(insets => { - if (Array.isArray(insets)) { - return insets.map(inset => { - const $ident = this._heapService.keep(inset); - const id = generateUuid(); - return { - $ident, - id, - range: typeConvert.Range.from(inset.range), - height: inset.height - }; - }); - } - return undefined; - }); - } - - resolveCodeInset(symbol: CodeInsetDto, webview: vscode.Webview, token: CancellationToken): Promise { - - const inset = this._heapService.get(ObjectIdentifier.of(symbol)); - if (!inset) { - return Promise.resolve(symbol); - } - - return asPromise(() => this._provider.resolveCodeInset(inset, webview, token)).then(newInset => { - newInset = newInset || inset; - return symbol; - }); + releaseCodeLenses(cachedId: number): void { + dispose(this._disposables.get(cachedId)); + this._disposables.delete(cachedId); + this._cache.delete(cachedId); } } @@ -625,6 +603,7 @@ class SuggestAdapter { private _provider: vscode.CompletionItemProvider; private _cache = new Cache(); + private _disposables = new Map(); constructor(documents: ExtHostDocuments, commands: CommandsConverter, provider: vscode.CompletionItemProvider) { this._documents = documents; @@ -650,13 +629,12 @@ class SuggestAdapter { return undefined; } - let list = Array.isArray(value) ? new CompletionList(value) : value; - let pid: number | undefined; + const list = Array.isArray(value) ? new CompletionList(value) : value; // keep result for providers that support resolving - if (SuggestAdapter.supportsResolving(this._provider)) { - pid = this._cache.add(list.items); - } + const pid: number = SuggestAdapter.supportsResolving(this._provider) ? this._cache.add(list.items) : this._cache.add([]); + const disposables = new DisposableStore(); + this._disposables.set(pid, disposables); // the default text edit range const wordRangeBeforePos = (doc.getWordRangeAtPosition(pos) as Range || new Range(pos, pos)) @@ -670,7 +648,7 @@ class SuggestAdapter { }; for (let i = 0; i < list.items.length; i++) { - const suggestion = this._convertCompletionItem(list.items[i], pos, pid && [pid, i] || undefined); + const suggestion = this._convertCompletionItem(list.items[i], pos, [pid, i]); // check for bad completion item // for the converter did warn if (suggestion) { @@ -705,15 +683,22 @@ class SuggestAdapter { } releaseCompletionItems(id: number): any { + dispose(this._disposables.get(id)); + this._disposables.delete(id); this._cache.delete(id); } - private _convertCompletionItem(item: vscode.CompletionItem, position: vscode.Position, id: ChainedCacheId | undefined): SuggestDataDto | undefined { + private _convertCompletionItem(item: vscode.CompletionItem, position: vscode.Position, id: ChainedCacheId): SuggestDataDto | undefined { if (typeof item.label !== 'string' || item.label.length === 0) { console.warn('INVALID text edit -> must have at least a label'); return undefined; } + const disposables = this._disposables.get(id[0]); + if (!disposables) { + throw Error('DisposableStore is missing...'); + } + const result: SuggestDataDto = { // x: id, @@ -728,7 +713,7 @@ class SuggestAdapter { i: item.keepWhitespace ? modes.CompletionItemInsertTextRule.KeepWhitespace : 0, k: item.commitCharacters, l: item.additionalTextEdits && item.additionalTextEdits.map(typeConvert.TextEdit.from), - m: this._commands.toInternal(item.command), + m: this._commands.toInternal2(item.command, disposables), }; // 'insertText'-logic @@ -1040,7 +1025,7 @@ type Adapter = DocumentSymbolAdapter | CodeLensAdapter | DefinitionAdapter | Hov | DocumentHighlightAdapter | ReferenceAdapter | CodeActionAdapter | DocumentFormattingAdapter | RangeFormattingAdapter | OnTypeFormattingAdapter | NavigateTypeAdapter | RenameAdapter | SuggestAdapter | SignatureHelpAdapter | LinkProviderAdapter | ImplementationAdapter | TypeDefinitionAdapter - | ColorProviderAdapter | FoldingProviderAdapter | CodeInsetAdapter | DeclarationAdapter | SelectionRangeAdapter | CallHierarchyAdapter; + | ColorProviderAdapter | FoldingProviderAdapter | DeclarationAdapter | SelectionRangeAdapter | CallHierarchyAdapter; class AdapterData { constructor( @@ -1061,7 +1046,6 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { private _diagnostics: ExtHostDiagnostics; private _adapter = new Map(); private readonly _logService: ILogService; - private _webviewProxy: MainThreadWebviewsShape; constructor( mainContext: IMainContext, @@ -1079,7 +1063,6 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { this._heapService = heapMonitor; this._diagnostics = diagnostics; this._logService = logService; - this._webviewProxy = mainContext.getProxy(MainContext.MainThreadWebviews); } private _transformDocumentSelector(selector: vscode.DocumentSelector): Array { @@ -1182,7 +1165,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { const handle = this._nextHandle(); const eventHandle = typeof provider.onDidChangeCodeLenses === 'function' ? this._nextHandle() : undefined; - this._adapter.set(handle, new AdapterData(new CodeLensAdapter(this._documents, this._commands.converter, this._heapService, provider), extension)); + this._adapter.set(handle, new AdapterData(new CodeLensAdapter(this._documents, this._commands.converter, provider), extension)); this._proxy.$registerCodeLensSupport(handle, this._transformDocumentSelector(selector), eventHandle); let result = this._createDisposable(handle); @@ -1194,43 +1177,16 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { return result; } - $provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise { - return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(URI.revive(resource), token), []); + $provideCodeLenses(handle: number, resource: UriComponents, token: CancellationToken): Promise { + return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.provideCodeLenses(URI.revive(resource), token), undefined); } - $resolveCodeLens(handle: number, symbol: modes.ICodeLensSymbol, token: CancellationToken): Promise { + $resolveCodeLens(handle: number, symbol: CodeLensDto, token: CancellationToken): Promise { return this._withAdapter(handle, CodeLensAdapter, adapter => adapter.resolveCodeLens(symbol, token), undefined); } - // --- code insets - - registerCodeInsetProvider(extension: IExtensionDescription, selector: vscode.DocumentSelector, provider: vscode.CodeInsetProvider): vscode.Disposable { - const handle = this._nextHandle(); - const eventHandle = typeof provider.onDidChangeCodeInsets === 'function' ? this._nextHandle() : undefined; - - this._adapter.set(handle, new AdapterData(new CodeInsetAdapter(this._documents, this._heapService, provider), extension)); - this._proxy.$registerCodeInsetSupport(handle, this._transformDocumentSelector(selector), eventHandle); - let result = this._createDisposable(handle); - - if (eventHandle !== undefined && provider.onDidChangeCodeInsets) { - const subscription = provider.onDidChangeCodeInsets(_ => this._proxy.$emitCodeLensEvent(eventHandle)); - result = Disposable.from(result, subscription); - } - - return result; - } - - $provideCodeInsets(handle: number, resource: UriComponents, token: CancellationToken): Promise { - return this._withAdapter(handle, CodeInsetAdapter, adapter => adapter.provideCodeInsets(URI.revive(resource), token), undefined); - } - - $resolveCodeInset(handle: number, _resource: UriComponents, symbol: codeInset.ICodeInsetSymbol, token: CancellationToken): Promise { - const webviewHandle = Math.random(); - const webview = new ExtHostWebview(webviewHandle, this._webviewProxy, { enableScripts: true }); - return this._withAdapter(handle, CodeInsetAdapter, async (adapter, extension) => { - await this._webviewProxy.$createWebviewCodeInset(webviewHandle, symbol.id, { enableCommandUris: true, enableScripts: true }, extension ? extension.identifier : undefined, extension ? extension.extensionLocation : undefined); - return adapter.resolveCodeInset(symbol, webview, token); - }, symbol); + $releaseCodeLenses(handle: number, cacheId: number): void { + this._withAdapter(handle, CodeLensAdapter, adapter => Promise.resolve(adapter.releaseCodeLenses(cacheId)), undefined); } // --- declaration diff --git a/src/vs/workbench/api/common/extHostWebview.ts b/src/vs/workbench/api/common/extHostWebview.ts index bddd0721dd0..b6ad9c09ee2 100644 --- a/src/vs/workbench/api/common/extHostWebview.ts +++ b/src/vs/workbench/api/common/extHostWebview.ts @@ -8,7 +8,7 @@ import { URI } from 'vs/base/common/uri'; import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor'; import * as vscode from 'vscode'; -import { ExtHostWebviewsShape, IMainContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelViewState, WebviewInsetHandle } from './extHost.protocol'; +import { ExtHostWebviewsShape, IMainContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelViewState } from './extHost.protocol'; import { Disposable } from './extHostTypes'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as modes from 'vs/editor/common/modes'; @@ -16,7 +16,7 @@ import * as modes from 'vs/editor/common/modes'; type IconPath = URI | { light: URI, dark: URI }; export class ExtHostWebview implements vscode.Webview { - private readonly _handle: WebviewPanelHandle | WebviewInsetHandle; + private readonly _handle: WebviewPanelHandle; private readonly _proxy: MainThreadWebviewsShape; private _html: string; private _options: vscode.WebviewOptions; @@ -26,7 +26,7 @@ export class ExtHostWebview implements vscode.Webview { public readonly onDidReceiveMessage: Event = this._onMessageEmitter.event; constructor( - handle: WebviewPanelHandle | WebviewInsetHandle, + handle: WebviewPanelHandle, proxy: MainThreadWebviewsShape, options: vscode.WebviewOptions ) { diff --git a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts b/src/vs/workbench/api/electron-browser/mainThreadWebview.ts deleted file mode 100644 index 735814fc0e1..00000000000 --- a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts +++ /dev/null @@ -1,437 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; -import * as map from 'vs/base/common/map'; -import { URI, UriComponents } from 'vs/base/common/uri'; -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import * as modes from 'vs/editor/common/modes'; -import { localize } from 'vs/nls'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; -import product from 'vs/platform/product/node/product'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ExtHostContext, ExtHostWebviewsShape, IExtHostContext, MainContext, MainThreadWebviewsShape, WebviewInsetHandle, WebviewPanelHandle, WebviewPanelShowOptions } from 'vs/workbench/api/common/extHost.protocol'; -import { editorGroupToViewColumn, EditorViewColumn, viewColumnToEditorGroup } from 'vs/workbench/api/common/shared/editor'; -import { CodeInsetController } from 'vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution'; -import { WebviewEditor } from 'vs/workbench/contrib/webview/browser/webviewEditor'; -import { WebviewEditorInput } from 'vs/workbench/contrib/webview/browser/webviewEditorInput'; -import { ICreateWebViewShowOptions, IWebviewEditorService, WebviewInputOptions } from 'vs/workbench/contrib/webview/browser/webviewEditorService'; -import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; -import { ACTIVE_GROUP, IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { extHostNamedCustomer } from '../common/extHostCustomers'; - -@extHostNamedCustomer(MainContext.MainThreadWebviews) -export class MainThreadWebviews extends Disposable implements MainThreadWebviewsShape { - - private static readonly standardSupportedLinkSchemes = new Set([ - 'http', - 'https', - 'mailto', - product.urlProtocol, - 'vscode', - 'vscode-insiders' - ]); - - private static revivalPool = 0; - - - private readonly _proxy: ExtHostWebviewsShape; - private readonly _webviews = new Map(); - private readonly _webviewsElements = new Map(); - private readonly _revivers = new Map(); - - private _activeWebview: WebviewPanelHandle | undefined = undefined; - - constructor( - context: IExtHostContext, - @ILifecycleService lifecycleService: ILifecycleService, - @IExtensionService extensionService: IExtensionService, - @IEditorGroupsService private readonly _editorGroupService: IEditorGroupsService, - @IEditorService private readonly _editorService: IEditorService, - @IWebviewEditorService private readonly _webviewService: IWebviewEditorService, - @IOpenerService private readonly _openerService: IOpenerService, - @ITelemetryService private readonly _telemetryService: ITelemetryService, - @IInstantiationService private readonly _instantiationService: IInstantiationService, - @ICodeEditorService private readonly _codeEditorService: ICodeEditorService, - ) { - super(); - - this._proxy = context.getProxy(ExtHostContext.ExtHostWebviews); - this._register(_editorService.onDidActiveEditorChange(this.onActiveEditorChanged, this)); - this._register(_editorService.onDidVisibleEditorsChange(this.onVisibleEditorsChanged, this)); - - // This reviver's only job is to activate webview extensions - // This should trigger the real reviver to be registered from the extension host side. - this._register(_webviewService.registerReviver({ - canRevive: (webview) => { - const viewType = webview.state.viewType; - if (viewType) { - extensionService.activateByEvent(`onWebviewPanel:${viewType}`); - } - return false; - }, - reviveWebview: () => { throw new Error('not implemented'); } - })); - - this._register(lifecycleService.onBeforeShutdown(e => { - e.veto(this._onBeforeShutdown()); - }, this)); - } - - public $createWebviewPanel( - handle: WebviewPanelHandle, - viewType: string, - title: string, - showOptions: { viewColumn?: EditorViewColumn, preserveFocus?: boolean }, - options: WebviewInputOptions, - extensionId: ExtensionIdentifier, - extensionLocation: UriComponents - ): void { - const mainThreadShowOptions: ICreateWebViewShowOptions = Object.create(null); - if (showOptions) { - mainThreadShowOptions.preserveFocus = !!showOptions.preserveFocus; - mainThreadShowOptions.group = viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn); - } - - const webview = this._webviewService.createWebview(this.getInternalWebviewId(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), { - location: URI.revive(extensionLocation), - id: extensionId - }, this.createWebviewEventDelegate(handle)); - webview.state = { - viewType: viewType, - state: undefined - }; - - this._webviews.set(handle, webview); - - /* __GDPR__ - "webviews:createWebviewPanel" : { - "extensionId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this._telemetryService.publicLog('webviews:createWebviewPanel', { extensionId: extensionId.value }); - } - - $createWebviewCodeInset( - handle: WebviewInsetHandle, - symbolId: string, - options: modes.IWebviewOptions, - extensionId: ExtensionIdentifier, - extensionLocation: UriComponents - ): void { - // todo@joh main is for the lack of a code-inset service - // which we maybe wanna have... this is how it now works - // 1) create webview element - // 2) find the code inset controller that request it - // 3) let the controller adopt the widget - // 4) continue to forward messages to the webview - const webview = this._instantiationService.createInstance( - WebviewElement, - { - extension: { - location: URI.revive(extensionLocation), - id: extensionId - }, - enableFindWidget: false, - }, - { - allowScripts: options.enableScripts, - } - ); - - let found = false; - for (const editor of this._codeEditorService.listCodeEditors()) { - const ctrl = CodeInsetController.get(editor); - if (ctrl && ctrl.acceptWebview(symbolId, webview)) { - found = true; - break; - } - } - - if (!found) { - webview.dispose(); - return; - } - // this will leak... the adopted webview will be disposed by the - // code inset controller. we might need a dispose-event here so that - // we can clean up things. - this._webviewsElements.set(handle, webview); - } - - public $disposeWebview(handle: WebviewPanelHandle): void { - const webview = this.getWebview(handle); - webview.dispose(); - } - - public $setTitle(handle: WebviewPanelHandle, value: string): void { - const webview = this.getWebview(handle); - webview.setName(value); - } - - public $setIconPath(handle: WebviewPanelHandle, value: { light: UriComponents, dark: UriComponents } | undefined): void { - const webview = this.getWebview(handle); - webview.iconPath = reviveWebviewIcon(value); - } - - public $setHtml(handle: WebviewPanelHandle | WebviewInsetHandle, value: string): void { - if (typeof handle === 'number') { - this.getWebviewElement(handle).html = value; - } else { - const webview = this.getWebview(handle); - webview.html = value; - } - } - - public $setOptions(handle: WebviewPanelHandle | WebviewInsetHandle, options: modes.IWebviewOptions): void { - if (typeof handle === 'number') { - this.getWebviewElement(handle).options = reviveWebviewOptions(options as any /*todo@mat */); - } else { - const webview = this.getWebview(handle); - webview.setOptions(reviveWebviewOptions(options as any /*todo@mat */)); - } - } - - public $reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void { - const webview = this.getWebview(handle); - if (webview.isDisposed()) { - return; - } - - const targetGroup = this._editorGroupService.getGroup(viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn)) || this._editorGroupService.getGroup(webview.group || 0); - if (targetGroup) { - this._webviewService.revealWebview(webview, targetGroup, !!showOptions.preserveFocus); - } - } - - public async $postMessage(handle: WebviewPanelHandle | WebviewInsetHandle, message: any): Promise { - if (typeof handle === 'number') { - this.getWebviewElement(handle).sendMessage(message); - return true; - } else { - const webview = this.getWebview(handle); - const editors = this._editorService.visibleControls - .filter(e => e instanceof WebviewEditor) - .map(e => e as WebviewEditor) - .filter(e => e.input!.matches(webview)); - - if (editors.length > 0) { - editors[0].sendMessage(message); - return true; - } - - if (webview.webview) { - webview.webview.sendMessage(message); - return true; - } - - return false; - } - } - - public $registerSerializer(viewType: string): void { - if (this._revivers.has(viewType)) { - throw new Error(`Reviver for ${viewType} already registered`); - } - - this._revivers.set(viewType, this._webviewService.registerReviver({ - canRevive: (webview) => { - return webview.state && webview.state.viewType === viewType; - }, - reviveWebview: async (webview): Promise => { - const viewType = webview.state.viewType; - const handle = 'revival-' + MainThreadWebviews.revivalPool++; - this._webviews.set(handle, webview); - webview._events = this.createWebviewEventDelegate(handle); - let state = undefined; - if (webview.state.state) { - try { - state = JSON.parse(webview.state.state); - } catch { - // noop - } - } - - try { - await this._proxy.$deserializeWebviewPanel(handle, viewType, webview.getTitle(), state, editorGroupToViewColumn(this._editorGroupService, webview.group || 0), webview.options); - } catch (error) { - onUnexpectedError(error); - webview.html = MainThreadWebviews.getDeserializationFailedContents(viewType); - } - } - })); - } - - public $unregisterSerializer(viewType: string): void { - const reviver = this._revivers.get(viewType); - if (!reviver) { - throw new Error(`No reviver for ${viewType} registered`); - } - - reviver.dispose(); - this._revivers.delete(viewType); - } - - private getInternalWebviewId(viewType: string): string { - return `mainThreadWebview-${viewType}`; - } - - private _onBeforeShutdown(): boolean { - this._webviews.forEach((webview) => { - if (!webview.isDisposed() && webview.state && this._revivers.has(webview.state.viewType)) { - webview.state.state = webview.webviewState; - } - }); - return false; // Don't veto shutdown - } - - private createWebviewEventDelegate(handle: WebviewPanelHandle) { - return { - onDidClickLink: (uri: URI) => this.onDidClickLink(handle, uri), - onMessage: (message: any) => this._proxy.$onMessage(handle, message), - onDispose: () => { - this._proxy.$onDidDisposeWebviewPanel(handle).finally(() => { - this._webviews.delete(handle); - }); - } - }; - } - - private onActiveEditorChanged() { - const activeEditor = this._editorService.activeControl; - let newActiveWebview: { input: WebviewEditorInput, handle: WebviewPanelHandle } | undefined = undefined; - if (activeEditor && activeEditor.input instanceof WebviewEditorInput) { - for (const handle of map.keys(this._webviews)) { - const input = this._webviews.get(handle)!; - if (input.matches(activeEditor.input)) { - newActiveWebview = { input, handle }; - break; - } - } - } - - if (newActiveWebview && newActiveWebview.handle === this._activeWebview) { - // Webview itself unchanged but position may have changed - this._proxy.$onDidChangeWebviewPanelViewState(newActiveWebview.handle, { - active: true, - visible: true, - position: editorGroupToViewColumn(this._editorGroupService, newActiveWebview.input.group || 0) - }); - return; - } - - // Broadcast view state update for currently active - if (typeof this._activeWebview !== 'undefined') { - const oldActiveWebview = this._webviews.get(this._activeWebview); - if (oldActiveWebview) { - this._proxy.$onDidChangeWebviewPanelViewState(this._activeWebview, { - active: false, - visible: this._editorService.visibleControls.some(editor => !!editor.input && editor.input.matches(oldActiveWebview)), - position: editorGroupToViewColumn(this._editorGroupService, oldActiveWebview.group || 0), - }); - } - } - - // Then for newly active - if (newActiveWebview) { - this._proxy.$onDidChangeWebviewPanelViewState(newActiveWebview.handle, { - active: true, - visible: true, - position: editorGroupToViewColumn(this._editorGroupService, activeEditor ? activeEditor.group : ACTIVE_GROUP), - }); - this._activeWebview = newActiveWebview.handle; - } else { - this._activeWebview = undefined; - } - } - - private onVisibleEditorsChanged(): void { - this._webviews.forEach((input, handle) => { - for (const workbenchEditor of this._editorService.visibleControls) { - if (workbenchEditor.input && workbenchEditor.input.matches(input)) { - const editorPosition = editorGroupToViewColumn(this._editorGroupService, workbenchEditor.group!); - - input.updateGroup(workbenchEditor.group!.id); - this._proxy.$onDidChangeWebviewPanelViewState(handle, { - active: handle === this._activeWebview, - visible: true, - position: editorPosition - }); - break; - } - } - }); - } - - private onDidClickLink(handle: WebviewPanelHandle, link: URI): void { - if (!link) { - return; - } - - const webview = this.getWebview(handle); - if (this.isSupportedLink(webview, link)) { - this._openerService.open(link); - } - } - - private isSupportedLink(webview: WebviewEditorInput, link: URI): boolean { - if (MainThreadWebviews.standardSupportedLinkSchemes.has(link.scheme)) { - return true; - } - return !!webview.options.enableCommandUris && link.scheme === 'command'; - } - - private getWebview(handle: WebviewPanelHandle): WebviewEditorInput { - const webview = this._webviews.get(handle); - if (!webview) { - throw new Error('Unknown webview handle:' + handle); - } - return webview; - } - - private getWebviewElement(handle: number): WebviewElement { - const webview = this._webviewsElements.get(handle); - if (!webview) { - throw new Error('Unknown webview handle:' + handle); - } - return webview; - } - - private static getDeserializationFailedContents(viewType: string) { - return ` - - - - - - - ${localize('errorMessage', "An error occurred while restoring view:{0}", viewType)} - `; - } -} - -function reviveWebviewOptions(options: WebviewInputOptions): WebviewInputOptions { - return { - ...options, - localResourceRoots: Array.isArray(options.localResourceRoots) ? options.localResourceRoots.map(r => URI.revive(r)) : undefined, - }; -} - -function reviveWebviewIcon( - value: { light: UriComponents, dark: UriComponents } | undefined -): { light: URI, dark: URI } | undefined { - if (!value) { - return undefined; - } - - return { - light: URI.revive(value.light), - dark: URI.revive(value.dark) - }; -} diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 5e79d7bed44..18bbd444eb0 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -67,6 +67,7 @@ import { withNullAsUndefined } from 'vs/base/common/types'; import { values } from 'vs/base/common/collections'; import { Schemas } from 'vs/base/common/network'; import { IURITransformer } from 'vs/base/common/uriIpc'; +import { ExtHostEditorInsets } from 'vs/workbench/api/common/extHostCodeInsets'; export interface IExtensionApiFactory { (extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode; @@ -109,6 +110,7 @@ export function createApiFactory( const extHostTreeViews = rpcProtocol.set(ExtHostContext.ExtHostTreeViews, new ExtHostTreeViews(rpcProtocol.getProxy(MainContext.MainThreadTreeViews), extHostCommands, extHostLogService)); rpcProtocol.set(ExtHostContext.ExtHostWorkspace, extHostWorkspace); rpcProtocol.set(ExtHostContext.ExtHostConfiguration, extHostConfiguration); + const extHostEditorInsets = rpcProtocol.set(ExtHostContext.ExtHostEditorInsets, new ExtHostEditorInsets(rpcProtocol.getProxy(MainContext.MainThreadEditorInsets), extHostEditors)); const extHostDiagnostics = rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, new ExtHostDiagnostics(rpcProtocol)); const extHostLanguageFeatures = rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, new ExtHostLanguageFeatures(rpcProtocol, uriTransformer, extHostDocuments, extHostCommands, extHostHeapService, extHostDiagnostics, extHostLogService)); const extHostFileSystem = rpcProtocol.set(ExtHostContext.ExtHostFileSystem, new ExtHostFileSystem(rpcProtocol, extHostLanguageFeatures)); @@ -160,7 +162,7 @@ export function createApiFactory( // Check document selectors for being overly generic. Technically this isn't a problem but // in practice many extensions say they support `fooLang` but need fs-access to do so. Those - // extension should specify then the `file`-scheme, e.g `{ scheme: 'fooLang', language: 'fooLang' }` + // extension should specify then the `file`-scheme, e.g. `{ scheme: 'fooLang', language: 'fooLang' }` // We only inform once, it is not a warning because we just want to raise awareness and because // we cannot say if the extension is doing it right or wrong... const checkSelector = (function () { @@ -306,10 +308,6 @@ export function createApiFactory( registerCodeLensProvider(selector: vscode.DocumentSelector, provider: vscode.CodeLensProvider): vscode.Disposable { return extHostLanguageFeatures.registerCodeLensProvider(extension, checkSelector(selector), provider); }, - registerCodeInsetProvider(selector: vscode.DocumentSelector, provider: vscode.CodeInsetProvider): vscode.Disposable { - checkProposedApiEnabled(extension); - return extHostLanguageFeatures.registerCodeInsetProvider(extension, checkSelector(selector), provider); - }, registerDefinitionProvider(selector: vscode.DocumentSelector, provider: vscode.DefinitionProvider): vscode.Disposable { return extHostLanguageFeatures.registerDefinitionProvider(extension, checkSelector(selector), provider); }, @@ -486,6 +484,10 @@ export function createApiFactory( createWebviewPanel(viewType: string, title: string, showOptions: vscode.ViewColumn | { viewColumn: vscode.ViewColumn, preserveFocus?: boolean }, options: vscode.WebviewPanelOptions & vscode.WebviewOptions): vscode.WebviewPanel { return extHostWebviews.createWebviewPanel(extension, viewType, title, showOptions, options); }, + createWebviewTextEditorInset(editor: vscode.TextEditor, range: vscode.Range, options: vscode.WebviewOptions): vscode.WebviewEditorInset { + checkProposedApiEnabled(extension); + return extHostEditorInsets.createWebviewEditorInset(editor, range, options); + }, createTerminal(nameOrOptions?: vscode.TerminalOptions | string, shellPath?: string, shellArgs?: string[] | string): vscode.Terminal { if (typeof nameOrOptions === 'object') { nameOrOptions.runInBackground = nameOrOptions.runInBackground && extension.enableProposedApi; diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index f2f2d8a341e..ca88785c082 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -712,7 +712,7 @@ export class ExtHostTask implements ExtHostTaskShape { paths[i] = resolver.resolve(ws, paths[i]); } } - result.process = win32.findExecutable( + result.process = await win32.findExecutable( resolver.resolve(ws, toResolve.process.name), toResolve.process.cwd !== undefined ? resolver.resolve(ws, toResolve.process.cwd) : undefined, paths diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 7bbd04d90fa..21d130abeb6 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -176,7 +176,7 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi this._pidPromiseComplete(processId); this._pidPromiseComplete = null; } else { - // Recreate the promise if this is the nth processId set (eg. reused task terminals) + // Recreate the promise if this is the nth processId set (e.g. reused task terminals) this._pidPromise.then(pid => { if (pid !== processId) { this._pidPromise = Promise.resolve(processId); diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 5b42967e77f..aaa41bae5bb 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -21,8 +21,9 @@ import { MenuBarVisibility } from 'vs/platform/windows/common/windows'; import { isWindows, isLinux } from 'vs/base/common/platform'; import { IsMacContext } from 'vs/workbench/browser/contextkeys'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { InEditorZenModeContext } from 'vs/workbench/common/editor'; +import { InEditorZenModeContext, IsCenteredLayoutContext } from 'vs/workbench/common/editor'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +import { SideBarVisibleContext } from 'vs/workbench/common/viewlet'; const registry = Registry.as(Extensions.WorkbenchActions); const viewCategory = nls.localize('view', "View"); @@ -61,7 +62,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '2_workbench_layout', command: { id: ToggleActivityBarVisibilityAction.ID, - title: nls.localize({ key: 'miToggleActivityBar', comment: ['&& denotes a mnemonic'] }, "Toggle &&Activity Bar") + title: nls.localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"), + toggled: ContextKeyExpr.equals('config.workbench.activityBar.visible', true) }, order: 4 }); @@ -95,7 +97,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '1_toggle_view', command: { id: ToggleCenteredLayout.ID, - title: nls.localize('miToggleCenteredLayout', "Toggle Centered Layout") + title: nls.localize('miToggleCenteredLayout', "Centered Layout"), + toggled: IsCenteredLayoutContext }, order: 3 }); @@ -203,11 +206,22 @@ export class ToggleSidebarPositionAction extends Action { registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSidebarPositionAction, ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.LABEL), 'View: Toggle Side Bar Position', viewCategory); MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { - group: '2_workbench_layout', + group: '3_workbench_layout_move', command: { id: ToggleSidebarPositionAction.ID, - title: nls.localize({ key: 'miMoveSidebarLeftRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left/Right") + title: nls.localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right") }, + when: ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), + order: 2 +}); + +MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { + group: '3_workbench_layout_move', + command: { + id: ToggleSidebarPositionAction.ID, + title: nls.localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left") + }, + when: ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), order: 2 }); @@ -266,14 +280,15 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '2_workbench_layout', command: { id: ToggleSidebarVisibilityAction.ID, - title: nls.localize({ key: 'miToggleSidebar', comment: ['&& denotes a mnemonic'] }, "&&Toggle Side Bar") + title: nls.localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Side Bar"), + toggled: SideBarVisibleContext }, order: 1 }); // --- Toggle Statusbar Visibility -class ToggleStatusbarVisibilityAction extends Action { +export class ToggleStatusbarVisibilityAction extends Action { static readonly ID = 'workbench.action.toggleStatusbarVisibility'; static readonly LABEL = nls.localize('toggleStatusbar', "Toggle Status Bar Visibility"); @@ -305,7 +320,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '2_workbench_layout', command: { id: ToggleStatusbarVisibilityAction.ID, - title: nls.localize({ key: 'miToggleStatusbar', comment: ['&& denotes a mnemonic'] }, "&&Toggle Status Bar") + title: nls.localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "Show S&&tatus Bar"), + toggled: ContextKeyExpr.equals('config.workbench.statusBar.visible', true) }, order: 3 }); @@ -370,7 +386,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '1_toggle_view', command: { id: ToggleZenMode.ID, - title: nls.localize('miToggleZenMode', "Toggle Zen Mode") + title: nls.localize('miToggleZenMode', "Zen Mode"), + toggled: InEditorZenModeContext }, order: 2 }); @@ -427,13 +444,13 @@ if (isWindows || isLinux) { } MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { - group: '1_toggle_view', + group: '2_workbench_layout', command: { id: ToggleMenuBarAction.ID, - title: nls.localize({ key: 'miToggleMenuBar', comment: ['&& denotes a mnemonic'] }, "Toggle Menu &&Bar") + title: nls.localize({ key: 'miShowMenuBar', comment: ['&& denotes a mnemonic'] }, "Show Menu &&Bar"), + toggled: ContextKeyExpr.and(IsMacContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle')) }, - when: IsMacContext.toNegated(), - order: 4 + order: 0 }); // --- Resize View diff --git a/src/vs/workbench/browser/contextkeys.ts b/src/vs/workbench/browser/contextkeys.ts index a7846a7d257..b147b08289f 100644 --- a/src/vs/workbench/browser/contextkeys.ts +++ b/src/vs/workbench/browser/contextkeys.ts @@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys'; import { IWindowsConfiguration } from 'vs/platform/windows/common/windows'; -import { ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, TEXT_DIFF_EDITOR_ID, SplitEditorsVertically, InEditorZenModeContext } from 'vs/workbench/common/editor'; +import { ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, TEXT_DIFF_EDITOR_ID, SplitEditorsVertically, InEditorZenModeContext, IsCenteredLayoutContext } from 'vs/workbench/common/editor'; import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -16,9 +16,10 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { SideBarVisibleContext } from 'vs/workbench/common/viewlet'; -import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; +import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { isMacintosh, isLinux, isWindows } from 'vs/base/common/platform'; +import { PanelPositionContext } from 'vs/workbench/common/panel'; export const IsMacContext = new RawContextKey('isMac', isMacintosh); export const IsLinuxContext = new RawContextKey('isLinux', isLinux); @@ -38,6 +39,8 @@ export const WorkspaceFolderCountContext = new RawContextKey('workspaceF export const RemoteFileDialogContext = new RawContextKey('remoteFileDialogVisible', false); +export const IsFullscreenContext = new RawContextKey('isFullscreen', false); + export class WorkbenchContextKeysHandler extends Disposable { private inputFocusedContext: IContextKey; @@ -54,8 +57,10 @@ export class WorkbenchContextKeysHandler extends Disposable { private inZenModeContext: IContextKey; - + private isFullscreenContext: IContextKey; + private isCenteredLayoutContext: IContextKey; private sideBarVisibleContext: IContextKey; + private panelPositionContext: IContextKey; constructor( @IContextKeyService private contextKeyService: IContextKeyService, @@ -93,6 +98,9 @@ export class WorkbenchContextKeysHandler extends Disposable { })); this._register(this.layoutService.onZenModeChange(enabled => this.inZenModeContext.set(enabled))); + this._register(this.layoutService.onFullscreenChange(fullscreen => this.isFullscreenContext.set(fullscreen))); + this._register(this.layoutService.onCenteredLayoutChange(centered => this.isCenteredLayoutContext.set(centered))); + this._register(this.layoutService.onPanelPositionChange(position => this.panelPositionContext.set(position))); this._register(this.viewletService.onDidViewletClose(() => this.updateSideBarContextKeys())); this._register(this.viewletService.onDidViewletOpen(() => this.updateSideBarContextKeys())); @@ -140,11 +148,21 @@ export class WorkbenchContextKeysHandler extends Disposable { this.splitEditorsVerticallyContext = SplitEditorsVertically.bindTo(this.contextKeyService); this.updateSplitEditorsVerticallyContext(); + // Fullscreen + this.isFullscreenContext = IsFullscreenContext.bindTo(this.contextKeyService); + // Zen Mode this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService); + // Centered Layout + this.isCenteredLayoutContext = IsCenteredLayoutContext.bindTo(this.contextKeyService); + // Sidebar this.sideBarVisibleContext = SideBarVisibleContext.bindTo(this.contextKeyService); + + // Panel Position + this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService); + this.panelPositionContext.set(this.layoutService.getPanelPosition() === Position.RIGHT ? 'right' : 'bottom'); } private updateEditorContextKeys(): void { diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 313743ea6e3..1df44757333 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -43,7 +43,10 @@ enum Settings { SIDEBAR_POSITION = 'workbench.sideBar.location', PANEL_POSITION = 'workbench.panel.defaultLocation', - ZEN_MODE_RESTORE = 'zenMode.restore' + ZEN_MODE_RESTORE = 'zenMode.restore', + + // TODO @misolori remove before shipping stable + ICON_EXPLORATION_ENABLED = 'workbench.iconExploration.enabled' } enum Storage { @@ -63,8 +66,17 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi private readonly _onTitleBarVisibilityChange: Emitter = this._register(new Emitter()); get onTitleBarVisibilityChange(): Event { return this._onTitleBarVisibilityChange.event; } - private readonly _onZenMode: Emitter = this._register(new Emitter()); - get onZenModeChange(): Event { return this._onZenMode.event; } + private readonly _onZenModeChange: Emitter = this._register(new Emitter()); + get onZenModeChange(): Event { return this._onZenModeChange.event; } + + private readonly _onFullscreenChange: Emitter = this._register(new Emitter()); + get onFullscreenChange(): Event { return this._onFullscreenChange.event; } + + private readonly _onCenteredLayoutChange: Emitter = this._register(new Emitter()); + get onCenteredLayoutChange(): Event { return this._onCenteredLayoutChange.event; } + + private readonly _onPanelPositionChange: Emitter = this._register(new Emitter()); + get onPanelPositionChange(): Event { return this._onPanelPositionChange.event; } private readonly _onLayout = this._register(new Emitter()); get onLayout(): Event { return this._onLayout.event; } @@ -148,6 +160,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi wasSideBarVisible: false, wasPanelVisible: false, transitionDisposeables: [] as IDisposable[] + }, + + // TODO @misolori remove before shipping stable + iconExploration: { + enabled: false } }; @@ -242,6 +259,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this._onTitleBarVisibilityChange.fire(); this.layout(); // handle title bar when fullscreen changes } + + this._onFullscreenChange.fire(this.state.fullscreen); } private doUpdateLayoutConfiguration(skipLayout?: boolean): void { @@ -274,6 +293,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Menubar visibility const newMenubarVisibility = this.configurationService.getValue(Settings.MENUBAR_VISIBLE); this.setMenubarVisibility(newMenubarVisibility, !!skipLayout); + + // TODO @misolori remove before shipping stable + // Icon exploration on setting change + const newIconExplorationEnabled = this.configurationService.getValue(Settings.ICON_EXPLORATION_ENABLED); + this.setIconExploration(newIconExplorationEnabled); + } private setSideBarPosition(position: Position): void { @@ -386,6 +411,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // Zen mode enablement this.state.zenMode.restore = this.storageService.getBoolean(Storage.ZEN_MODE_ENABLED, StorageScope.WORKSPACE, false) && this.configurationService.getValue(Settings.ZEN_MODE_RESTORE); + + // TODO @misolori remove before shipping stable + // Icon exploration + this.state.iconExploration.enabled = this.configurationService.getValue(Settings.ICON_EXPLORATION_ENABLED); + this.setIconExploration(this.state.iconExploration.enabled); } private resolveEditorsToOpen(fileService: IFileService): Promise | IResourceEditor[] { @@ -631,7 +661,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } // Event - this._onZenMode.fire(this.state.zenMode.active); + this._onZenModeChange.fire(this.state.zenMode.active); } private setStatusBarHidden(hidden: boolean, skipLayout?: boolean): void { @@ -654,6 +684,19 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } } + // TODO @misolori remove before shipping stable + private setIconExploration(enabled: boolean): void { + this.state.iconExploration.enabled = enabled; + + // Update DOM + if (enabled) { + document.body.dataset.exploration = 'icon-exploration'; + } else { + document.body.dataset.exploration = ''; + } + + } + protected createWorkbenchLayout(instantiationService: IInstantiationService): void { const titleBar = this.getPart(Parts.TITLEBAR_PART); const editorPart = this.getPart(Parts.EDITOR_PART); @@ -828,6 +871,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi this.layout(); } } + + this._onCenteredLayoutChange.fire(this.state.editor.centered); } resizePart(part: Parts, sizeChange: number): void { @@ -1069,6 +1114,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi } else { this.workbenchGrid.layout(); } + + this._onPanelPositionChange.fire(positionToString(this.state.panel.position)); } private savePanelDimension(): void { diff --git a/src/vs/workbench/browser/legacyLayout.ts b/src/vs/workbench/browser/legacyLayout.ts index 53e73acf9da..202d19fa434 100644 --- a/src/vs/workbench/browser/legacyLayout.ts +++ b/src/vs/workbench/browser/legacyLayout.ts @@ -10,14 +10,14 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { Disposable } from 'vs/base/common/lifecycle'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { isMacintosh } from 'vs/base/common/platform'; +import { isMacintosh, isWeb } from 'vs/base/common/platform'; import { memoize } from 'vs/base/common/decorators'; import { Dimension, getClientArea, size, position, hide, show } from 'vs/base/browser/dom'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { getZoomFactor } from 'vs/base/browser/browser'; import { Part } from 'vs/workbench/browser/part'; -const TITLE_BAR_HEIGHT = isMacintosh ? 22 : 30; +const TITLE_BAR_HEIGHT = isMacintosh && !isWeb ? 22 : 30; const STATUS_BAR_HEIGHT = 22; const ACTIVITY_BAR_WIDTH = 50; diff --git a/src/vs/workbench/browser/media/icons.css b/src/vs/workbench/browser/media/icons.css new file mode 100644 index 00000000000..ec2744d0f0b --- /dev/null +++ b/src/vs/workbench/browser/media/icons.css @@ -0,0 +1,1160 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/**************** + Colors +****************/ +:root { + --blue: #00539c; + --gray: #424242; + --grayLight: #848484; + --green: #388a34; + --greenLight: #9cce9c; + --orange: #c27d1a; + --orangeLight: #ff8e00; + --purple: #652d90; + --red: #a31515; + --redLight: #e51400; + --yellow: #fc0; +} + +:root .vs-dark { + --blue: #75beff; + --gray: #c5c5c5; + --grayLight: #848484; + --green: #89d185; + --greenLight: #9cce9c; + --orange: #e8ab53; + --orangeLight: #ff8e00; + --purple: #b180d7; + --red: #f48771; + --redLight: #e51400; + --yellow: #fc0; +} + + +/**************** + Base +****************/ +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header[aria-label="Open Editors Section"] > .actions .action-label.icon, +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.explorer-action.icon, +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.toolbar-toggle-more.icon, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .title > .title-actions .actions-container[aria-label^="Explorer"] .icon, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .title > .title-actions .actions-container[aria-label="Search actions"] .icon, +body[data-exploration^="icon-exploration"] .monaco-findInput > .controls .monaco-custom-checkbox::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .search-view .query-details .file-types .controls > .monaco-custom-checkbox.useExcludesAndIgnoreFiles::before, +body[data-exploration^="icon-exploration"] .markers-panel-action-filter > .markers-panel-filter-controls > .markers-panel-filter-filesExclude::before, +body[data-exploration^="icon-exploration"] .search-view .search-widget .replace-container .monaco-action-bar .action-item .icon, +body[data-exploration^="icon-exploration"] .search-view a[class^="action-"], +body[data-exploration^="icon-exploration"] .monaco-workbench .search-view .query-details .more, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .title > .title-actions .actions-container[aria-label="Source Control: Git actions"] .icon, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .title > .title-actions .actions-container[aria-label="Debug actions"] .icon, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .title > .title-actions .actions-container[aria-label^="Extensions"] .icon, +body[data-exploration^="icon-exploration"] .scm-viewlet .monaco-list-row > .resource-group > .actions .action-label[data-title^="git."], +body[data-exploration^="icon-exploration"] .scm-viewlet .monaco-list-row > .resource > .name > .monaco-icon-label > .actions .action-label, +body[data-exploration^="icon-exploration"] .monaco-workbench .part > .content > .debug-viewlet .actions .action-label.icon, +body[data-exploration^="icon-exploration"] .monaco-workbench .debug-toolbar .drag-area, +body[data-exploration^="icon-exploration"] .monaco-workbench .debug-toolbar .action-label, +body[data-exploration^="icon-exploration"] .debug-breakpoint, +body[data-exploration^="icon-exploration"] .debug-viewlet .debug-breakpoints .breakpoint > .icon, +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar .action-item .action-label.extension-action.manage, +body[data-exploration^="icon-exploration"] .extension-ratings > .star, +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .octicon, +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle .octicon, +body[data-exploration^="icon-exploration"] .monaco-toolbar .action-label.toolbar-toggle-more, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.panel > .title > .title-actions .monaco-action-bar .action-item .action-label, +body[data-exploration^="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .symbol-icon::before, +body[data-exploration^="icon-exploration"] .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close, +body[data-exploration^="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore, +body[data-exploration^="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-title .icon.error, +body[data-exploration^="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-title .icon.warning, +body[data-exploration^="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item-icon, +body[data-exploration^="icon-exploration"] .monaco-workbench > .notifications-center > .notifications-center-header .clear-all-notifications-action, +body[data-exploration^="icon-exploration"] .monaco-workbench > .notifications-center > .notifications-center-header .hide-all-notifications-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .clear-notification-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .expand-notification-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .collapse-notification-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .action-label, +body[data-exploration^="icon-exploration"] .markers-panel .marker-icon, +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix, +body[data-exploration^="icon-exploration"] .monaco-tl-twistie.collapsible:not(.loading), +body[data-exploration^="icon-exploration"] .file-icon-themable-tree .monaco-tree-row.has-children .content::before, +body[data-exploration^="icon-exploration"] .file-icon-themable-tree .monaco-tree-row.has-children.expanded .content::before, +body[data-exploration^="icon-exploration"] .monaco-breadcrumbs .monaco-breadcrumb-item:not(:nth-child(2))::before, +body[data-exploration^="icon-exploration"] .monaco-tl-twistie.collapsible.collapsed:not(.loading), +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="workbench.action.closeActiveEditor"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.splitEditor"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="git.openChange"], +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace-all::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .previous::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .next::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .close-fw::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .expand::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .collapse::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .monaco-checkbox .label::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .quick-open-sidebyside-vertical, +body[data-exploration^="icon-exploration"] .monaco-tree-action.collapse-all, +body[data-exploration^="icon-exploration"] .monaco-editor .margin-view-overlays .folding, +body[data-exploration^="icon-exploration"] .monaco-workbench .explorer-action.save-all, +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.icon[data-title="git.commit"], +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.icon[data-title="git.refresh"], +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-up, +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-down, +body[data-exploration^="icon-exploration"] .monaco-workbench .explorer-viewlet .action-close-all-files, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .close-editor-group, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.panel > .title > .panel-switcher-container.composite-bar > .monaco-action-bar .action-label.toggle-more, +body[data-exploration^="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .clear-input, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.openGlobalKeybindingsFile"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="settings.switchToJSON"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="markdown.showSource"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label.file-icon[title^="Preview"]::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="markdown.showPreviewToSide"], +body[data-exploration^="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label, +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.compareEditor.previousChange"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.compareEditor.nextChange"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="git.openFile"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.openGlobalKeybindings"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="toggle.diff.ignoreTrimWhitespace"], +body[data-exploration^="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions .action-label.icon[data-title="peekview.close"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="workbench.action.splitEditor"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="git.openChange"], +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover, +body[data-exploration^="icon-exploration"] .monaco-workbench .explorer-viewlet .explorer-open-editors .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .close-editor-action, +body[data-exploration^="icon-exploration"] .monaco-workbench .explorer-viewlet .explorer-open-editors .close-editor-action { + background-image: none !important; + background: var(--gray); + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center; + -webkit-mask-size: 16px; +} + +/* Center via Flexbox + Search expand */ +body[data-exploration^="icon-exploration"] .search-view .search-widget .toggle-replace-button.collapse, +body[data-exploration^="icon-exploration"] .search-view .search-widget .toggle-replace-button.expand, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace-all, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .previous, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .next, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .close-fw, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .expand, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .collapse, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .monaco-checkbox .label { + display: flex; + align-items: center; + justify-content: center; + background-image: none !important; +} + +/* Before elements */ +body[data-exploration^="icon-exploration"] .search-view .search-widget .toggle-replace-button.collapse::before, +body[data-exploration^="icon-exploration"] .search-view .search-widget .toggle-replace-button.expand::before, +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace-all::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .replace::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .previous::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .next::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .close-fw::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .expand::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .collapse::before, +body[data-exploration^="icon-exploration"] .monaco-editor .find-widget .monaco-checkbox .label::before, +body[data-exploration^="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .monaco-custom-checkbox::before { + content: ""; + width: 16px; + height: 16px; + background-color: var(--gray); + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center; + -webkit-mask-size: 16px; +} + +/* For icons that are a custom checkbox and use focus */ +body[data-exploration^="icon-exploration"] .monaco-findInput > .controls .monaco-custom-checkbox, +body[data-exploration^="icon-exploration"] .markers-panel-action-filter > .markers-panel-filter-controls > .markers-panel-filter-filesExclude, +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header, +body[data-exploration^="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .monaco-custom-checkbox { + background-image: none !important; +} + +body[data-exploration^="icon-exploration"] .monaco-findInput > .controls .monaco-custom-checkbox::before, +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-up::before, +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-down::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .search-view .query-details .file-types .controls > .monaco-custom-checkbox.useExcludesAndIgnoreFiles::before, +body[data-exploration^="icon-exploration"] .markers-panel-action-filter > .markers-panel-filter-controls > .markers-panel-filter-filesExclude::before { + content: ""; + width: 16px; + height: 16px; + display: block; +} + +/******************** + ACTIVITY BAR +********************/ + +body[data-exploration^="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label { + -webkit-mask-size: 24px !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.explore { + -webkit-mask-image: url("images/activitybar/files-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.search { + -webkit-mask-image: url("images/activitybar/search-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.scm { + -webkit-mask-image: url("images/activitybar/git-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.debug { + -webkit-mask-image: url("images/activitybar/debug-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.extensions { + -webkit-mask-image: url("images/activitybar/extensions-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar .monaco-action-bar .action-label.update-activity { + -webkit-mask-image: url("images/activitybar/settings-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .activitybar > .content > .composite-bar > .monaco-action-bar .action-label.toggle-more { + -webkit-mask-image: url("images/activitybar/more-alt1.svg"); +} + + +/**************** + Explorer +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .flip-editor-layout { + -webkit-mask-image: url("images/explorer/layout-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-action.save-all, +body[data-exploration="icon-exploration"] .monaco-workbench .save-all { + -webkit-mask-image: url("images/explorer/save-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-viewlet .action-close-all-files { + -webkit-mask-image: url("images/explorer/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-action.new-file { + -webkit-mask-image: url("images/explorer/add-file-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-action.new-folder { + -webkit-mask-image: url("images/explorer/add-folder-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-action.refresh-explorer { + -webkit-mask-image: url("images/explorer/refresh-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-action.collapse-explorer { + -webkit-mask-image: url("images/explorer/collapse-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-toolbar .action-label.toolbar-toggle-more { + -webkit-mask-image: url("images/explorer/more-alt1.svg"); +} + + +/**************** + Search +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .search-action.refresh { + -webkit-mask-image: url("images/search/refresh-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .search-action.clear-search-results { + -webkit-mask-image: url("images/search/clear-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .search-action.collapse { + -webkit-mask-image: url("images/search/collapse-all-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .search-action.cancel-search { + -webkit-mask-image: url("images/search/stop-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .search-widget .replace-container .monaco-action-bar .action-item .icon { + -webkit-mask-image: url("images/search/replace-all-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .search-view .query-details .file-types .controls > .monaco-custom-checkbox.useExcludesAndIgnoreFiles::before, +body[data-exploration="icon-exploration"] .markers-panel-action-filter > .markers-panel-filter-controls > .markers-panel-filter-filesExclude::before { + -webkit-mask-image: url("images/search/exclude-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-custom-checkbox.monaco-case-sensitive::before { + -webkit-mask-image: url("images/search/case-sensitive-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-custom-checkbox.monaco-whole-word::before { + -webkit-mask-image: url("images/search/whole-word-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-custom-checkbox.monaco-regex::before { + -webkit-mask-image: url("images/search/regex-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .action-replace { + -webkit-mask-image: url("images/search/replace-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .action-replace-all { + -webkit-mask-image: url("images/search/replace-all-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .action-remove { + -webkit-mask-image: url("images/search/remove-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .search-view .query-details .more { + -webkit-mask-image: url("images/search/more-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .search-widget .toggle-replace-button.collapse::before { + -webkit-mask-image: url("images/search/collapse-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .search-view .search-widget .toggle-replace-button.expand::before { + -webkit-mask-image: url("images/search/expand-alt1.svg"); +} + + +/**************** + Git +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .part > .title > .title-actions .action-label[data-title="git.commit"], +body[data-exploration="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.icon[data-title="git.commit"] { + -webkit-mask-image: url("images/git/check-alt1.svg"); +} +/* Refresh */ +body[data-exploration="icon-exploration"] .monaco-workbench .part > .title > .title-actions .action-label[data-title="git.refresh"], +body[data-exploration="icon-exploration"] .monaco-panel-view .panel > .panel-header > .actions .action-label.icon[data-title="git.refresh"] { + -webkit-mask-image: url("images/git/refresh-alt1.svg"); +} +/* Stage */ +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="git.stageChange"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource-group > .actions .action-label[data-title="git.stageAll"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource > .name > .monaco-icon-label > .actions .action-label[data-title="git.stage"] { + -webkit-mask-image: url("images/git/stage-alt1.svg"); +} +/* Unstage */ +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource-group > .actions .action-label[data-title="git.unstageAll"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource > .name > .monaco-icon-label > .actions .action-label[data-title="git.unstage"] { + -webkit-mask-image: url("images/git/unstage-alt1.svg"); +} +/* Discard */ +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="git.revertChange"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource-group > .actions .action-label[data-title="git.cleanAll"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource > .name > .monaco-icon-label > .actions .action-label[data-title="git.clean"] { + -webkit-mask-image: url("images/git/clean-alt1.svg"); +} +/* Open File */ +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="git.openFile"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.openGlobalKeybindings"], +body[data-exploration="icon-exploration"] .scm-viewlet .monaco-list-row > .resource > .name > .monaco-icon-label > .actions .action-label[data-title="git.openFile2"] { + -webkit-mask-image: url("images/git/gotofile-alt1.svg"); +} +/* Chevrons */ +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.compareEditor.nextChange"], +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="editor.action.marker.next"], +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="editor.action.dirtydiff.next"] { + -webkit-mask-image: url("images/git/next-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.compareEditor.previousChange"], +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="editor.action.marker.prev"], +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions > .monaco-action-bar .action-label[data-title="editor.action.dirtydiff.previous"] { + -webkit-mask-image: url("images/git/previous-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="toggle.diff.ignoreTrimWhitespace"]{ + -webkit-mask-image: url("images/git/whitespace-alt1.svg"); +} + + +/**************** + Debug +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-action.start, +body[data-exploration="icon-exploration"] .monaco-workbench .part > .title > .title-actions .start-debug-action-item .icon { + -webkit-mask-image: url("images/debug/start-alt1.svg"); + background: var(--green) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-action.configure { + -webkit-mask-image: url("images/debug/gear-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-action.toggle-repl { + -webkit-mask-image: url("images/debug/repl-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-viewlet .debug-action.add-watch-expression, +body[data-exploration="icon-exploration"] .debug-viewlet .debug-action.add-function-breakpoint { + -webkit-mask-image: url("images/debug/add-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-viewlet .debug-action.remove-all { + -webkit-mask-image: url("images/debug/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-viewlet .debug-action.breakpoints-activate { + -webkit-mask-image: url("images/debug/breakpoint-activate-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .drag-area { + -webkit-mask-image: url("images/debug/drag-alt1.svg"); + background: var(--grayLight); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.stepOver"], +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.stepBack"] { + -webkit-mask-image: url("images/debug/step-over-alt1.svg"); + background: var(--blue) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.stepInto"] { + -webkit-mask-image: url("images/debug/step-into-alt1.svg"); + background: var(--blue) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.stepOut"] { + -webkit-mask-image: url("images/debug/step-out-alt1.svg"); + background: var(--blue) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.continue"], +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.rever"] { + -webkit-mask-image: url("images/debug/continue-alt1.svg"); + background: var(--blue) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.restart"] { + -webkit-mask-image: url("images/debug/restart-alt1.svg"); + background: var(--green) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.pause"] { + -webkit-mask-image: url("images/debug/pause-alt1.svg"); + background: var(--green) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.stop"] { + -webkit-mask-image: url("images/debug/stop-alt1.svg"); + background: var(--red) !important; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .debug-toolbar .action-label[data-title="workbench.action.debug.disconnect"] { + -webkit-mask-image: url("images/debug/disconnect-alt1.svg"); + background: var(--red) !important; +} + +body[data-exploration="icon-exploration"] .debug-breakpoint, +body[data-exploration="icon-exploration"] .debug-breakpoint.icon, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-column::before { + -webkit-mask-image: url("images/debug/breakpoint-alt1.svg"); + background: var(--redLight) !important; +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-disabled.icon { + -webkit-mask-image: url("images/debug/breakpoint-unverified-alt1.svg"); + background: var(--grayLight); +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-unverified, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-column.debug-breakpoint-disabled-column::before { + -webkit-mask-image: url("images/debug/breakpoint-alt1.svg"); + background: var(--grayLight); +} + +body[data-exploration="icon-exploration"] .monaco-editor .debug-top-stack-frame-column::before, +body[data-exploration="icon-exploration"] .monaco-editor .debug-top-stack-frame { + -webkit-mask-image: url("images/debug/current-arrow-alt1.svg"); + background: var(--yellow) !important; +} + +body[data-exploration="icon-exploration"] .monaco-editor .debug-top-stack-frame.debug-breakpoint, +body[data-exploration="icon-exploration"] .monaco-editor .debug-top-stack-frame.debug-breakpoint-conditional, +body[data-exploration="icon-exploration"] .monaco-editor .debug-top-stack-frame.debug-breakpoint-log, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-column.debug-breakpoint-column.debug-top-stack-frame-column::before { + -webkit-mask-image: url("images/debug/current-and-breakpoint-alt1.svg"); + background: var(--yellow) !important; +} + +body[data-exploration="icon-exploration"] .monaco-editor .debug-focused-stack-frame.debug-breakpoint, +body[data-exploration="icon-exploration"] .monaco-editor .debug-focused-stack-frame.debug-breakpoint-conditional, +body[data-exploration="icon-exploration"] .monaco-editor .debug-focused-stack-frame.debug-breakpoint-log { + -webkit-mask-image: url("images/debug/stackframe-and-breakpoint-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-log, +body[data-exploration="icon-exploration"] .debug-breakpoint-log.icon, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-column.debug-breakpoint-log-column::before { + -webkit-mask-image: url("images/debug/breakpoint-log-alt1.svg"); + background: var(--redLight) !important; +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-log-disabled, +body[data-exploration="icon-exploration"] .debug-breakpoint-log-disabled.icon, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-log-disabled-column::before { + -webkit-mask-image: url("images/debug/breakpoint-log-alt1.svg"); + background: var(--grayLight); +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-log-unverified, +body[data-exploration="icon-exploration"] .debug-breakpoint-log-unverified.icon, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-log-unverified-column::before { + -webkit-mask-image: url("images/debug/breakpoint-log-unverified-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-breakpoint-conditional, +body[data-exploration="icon-exploration"] .debug-breakpoint-conditional.icon, +body[data-exploration="icon-exploration"] .monaco-editor .debug-breakpoint-column.debug-breakpoint-conditional-column::before { + -webkit-mask-image: url("images/debug/breakpoint-conditional-alt1.svg"); + background: var(--redLight) !important; +} + +body[data-exploration="icon-exploration"] .monaco-editor .debug-focused-stack-frame { + -webkit-mask-image: url("images/debug/stackframe-arrow-alt1.svg"); + background: var(--green) !important; +} + +body[data-exploration="icon-exploration"] .debug-function-breakpoint, +body[data-exploration="icon-exploration"] .debug-function-breakpoint.icon { + -webkit-mask-image: url("images/debug/breakpoint-function-alt1.svg"); + background: var(--redLight) !important; +} + +body[data-exploration="icon-exploration"] .debug-function-breakpoint-unverified { + -webkit-mask-image: url("images/debug/breakpoint-function-unverified-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-function-breakpoint-disabled { + -webkit-mask-image: url("images/debug/breakpoint-function-disabled-alt1.svg"); +} + +/**************** + Extensions +****************/ + +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header { + align-items: center; +} + +body[data-exploration="icon-exploration"] .monaco-action-bar .action-item .action-label.clear-extensions { + -webkit-mask-image: url("images/extensions/clear-alt1.svg"); +} + +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count:not(:empty), +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .ratings { + display: flex; + align-items: center; + justify-content: center; +} + +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .octicon::before, +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle .octicon::before { + content: "" !important; +} + +body[data-exploration^="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .octicon, +body[data-exploration^="icon-exploration"] .extension-ratings.small > .full { + width: 12px; + height: 12px; + -webkit-mask-size: 12px; +} + +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle .octicon { + width: 16px; + height: 16px; + -webkit-mask-size: 16px; +} + +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle > span:not(:first-child):not(:empty) { + position: relative; +} + +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle > .install > .count { + margin-left: 22px; +} + +body[data-exploration^="icon-exploration"] .extension-editor > .header > .details > .subtitle .octicon { + position: absolute; + left: 14px; + top: 0; +} + +body[data-exploration="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .octicon, +body[data-exploration="icon-exploration"] .extension-editor > .header > .details > .subtitle .octicon { + -webkit-mask-image: url("images/extensions/download-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .extension-ratings > .full { + -webkit-mask-image: url("images/extensions/star-full-alt1.svg"); + background: var(--orangeLight); +} + +body[data-exploration="icon-exploration"] .extension-ratings > .half { + -webkit-mask-image: url("images/extensions/star-half-alt1.svg"); + background: var(--orangeLight); +} + +body[data-exploration="icon-exploration"] .extension-ratings > .empty { + -webkit-mask-image: url("images/extensions/star-empty-alt1.svg"); + background: var(--gray); +} + +body[data-exploration="icon-exploration"] .extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar .action-item .action-label.extension-action.manage { + -webkit-mask-image: url("images/extensions/gear-alt1.svg"); +} + + +/**************** + Panels +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .hide-panel-action, +.hc-black .monaco-workbench .hide-panel-action { + -webkit-mask-image: url("images/panel/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .maximize-panel-action { + -webkit-mask-image: url("images/panel/up-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .minimize-panel-action { + -webkit-mask-image: url("images/panel/down-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-tree-action.collapse-all { + -webkit-mask-image: url("images/panel/collapse-all-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .output-action.open-log-file { + -webkit-mask-image: url("images/panel/gotofile-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .output-action.open-log-file { + -webkit-mask-image: url("images/panel/gotofile-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .output-action.output-scroll-unlock { + -webkit-mask-image: url("images/panel/output-unlock-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .output-action.output-scroll-lock { + -webkit-mask-image: url("images/panel/output-lock-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .output-action.clear-output { + -webkit-mask-image: url("images/panel/clear-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .debug-action.clear-repl { + -webkit-mask-image: url("images/panel/clear-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .terminal-action.kill { + -webkit-mask-image: url("images/panel/kill-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .terminal-action.split, +body[data-exploration="icon-exploration"] .monaco-workbench .quick-open-sidebyside-vertical { + -webkit-mask-image: url("images/panel/split-horizontal-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .panel.right .terminal-action.split { + -webkit-mask-image: url("images/panel/split-vertical-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .terminal-action.new { + -webkit-mask-image: url("images/panel/add-alt1.svg"); +} + + +/**************** + IntelliSense +****************/ + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close { + -webkit-mask-image: url("images/intellisense/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore { + -webkit-mask-image: url("images/intellisense/info-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.method::before, +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.function::before, +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constructor::before { + -webkit-mask-image: url("images/intellisense/method-alt1.svg"); + background-color: var(--purple); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.field::before { + -webkit-mask-image: url("images/intellisense/field-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.event::before { + -webkit-mask-image: url("images/intellisense/event-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.operator::before { + -webkit-mask-image: url("images/intellisense/operator-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.variable::before { + -webkit-mask-image: url("images/intellisense/variable-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.class::before { + -webkit-mask-image: url("images/intellisense/class-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.interface::before { + -webkit-mask-image: url("images/intellisense/interface-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.struct::before { + -webkit-mask-image: url("images/intellisense/structure-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.type-parameter::before { + -webkit-mask-image: url("images/intellisense/parameter-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.module::before { + -webkit-mask-image: url("images/intellisense/namespace-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.property::before { + -webkit-mask-image: url("images/intellisense/property-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.unit::before { + -webkit-mask-image: url("images/intellisense/ruler-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.constant::before { + -webkit-mask-image: url("images/intellisense/constant-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.value::before, +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum::before { + -webkit-mask-image: url("images/intellisense/enumerator-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.enum-member::before { + -webkit-mask-image: url("images/intellisense/enum-member-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.keyword::before { + -webkit-mask-image: url("images/intellisense/keyword-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.text::before { + -webkit-mask-image: url("images/intellisense/string-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.color::before { + -webkit-mask-image: url("images/intellisense/color-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.file::before { + -webkit-mask-image: url("images/intellisense/file-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.reference::before { + -webkit-mask-image: url("images/intellisense/reference-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.snippet::before { + -webkit-mask-image: url("images/intellisense/snippet-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon.folder::before { + -webkit-mask-image: url("images/intellisense/folder-alt1.svg"); +} + +/**************** + Breadcrumbs +****************/ + +body[data-exploration^="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item::before { + width: 16px !important; +} + +body[data-exploration^="icon-exploration"] .monaco-workbench .breadcrumbs-control .symbol-icon::before, +body[data-exploration^="icon-exploration"] .monaco-workbench .monaco-breadcrumb-item .symbol-icon { + top: -2px; +} + +body[data-exploration^="icon-exploration"] .monaco-workbench .symbol-icon { + position: relative; + background-image: none !important; + -webkit-mask-position: left center; +} + +body[data-exploration^="icon-exploration"] .monaco-workbench .symbol-icon::before { + content: ""; + position: absolute; + left: -3px; + width: 16px; + height: 22px; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon::before { + -webkit-mask-image: url("images/intellisense/field-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.constant::before { + -webkit-mask-image: url("images/intellisense/constant-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.enum::before { + -webkit-mask-image: url("images/intellisense/enumerator-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.enum-member::before { + -webkit-mask-image: url("images/intellisense/enum-member-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.struct::before { + -webkit-mask-image: url("images/intellisense/structure-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.event::before { + -webkit-mask-image: url("images/intellisense/event-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.operator::before { + -webkit-mask-image: url("images/intellisense/operator-alt1.svg"); + background-color: var(--blue); +} + +ody[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.type-parameter::before { + -webkit-mask-image: url("images/intellisense/parameter-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.boolean::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.null::before { + -webkit-mask-image: url("images/intellisense/boolean-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.class::before { + -webkit-mask-image: url("images/intellisense/class-alt1.svg"); + background-color: var(--orange); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.constructor::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.method::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.function::before { + -webkit-mask-image: url("images/intellisense/method-alt1.svg"); + background-color: var(--purple); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.file::before { + -webkit-mask-image: url("images/intellisense/file-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.field::before { + -webkit-mask-image: url("images/intellisense/field-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.variable::before { + -webkit-mask-image: url("images/intellisense/variable-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.array::before { + -webkit-mask-image: url("images/intellisense/array-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.keyword::before { + -webkit-mask-image: url("images/intellisense/keyword-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.interface::before { + -webkit-mask-image: url("images/intellisense/interface-alt1.svg"); + background-color: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.object::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.namespace::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.package::before, +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.module::before { + -webkit-mask-image: url("images/intellisense/namespace-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.number::before { + -webkit-mask-image: url("images/intellisense/numeric-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.property::before { + -webkit-mask-image: url("images/intellisense/property-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.string::before { + -webkit-mask-image: url("images/intellisense/key-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .symbol-icon.key::before { + -webkit-mask-image: url("images/intellisense/key-alt1.svg"); +} + +body[data-exploration^="icon-exploration"] .monaco-editor .lightbulb-glyph { + background-image: none !important; + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center center; + -webkit-mask-size: 16px; +} + +body[data-exploration="icon-exploration"] .monaco-editor .lightbulb-glyph, +body[data-exploration="icon-exploration"] .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix { + -webkit-mask-image: url("images/intellisense/lightbulb-alt1.svg"); + background-color: var(--yellow); +} + +body[data-exploration="icon-exploration"] .monaco-editor .lightbulb-glyph.autofixable, +body[data-exploration="icon-exploration"] .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix.autofixable { + -webkit-mask-image: url("images/intellisense/lightbulb-autofix-alt1.svg"); + background-color: var(--blue); +} + + +/**************** + Notifications +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-icon.icon-info, +body[data-exploration="icon-exploration"] .markers-panel .marker-icon.info { + -webkit-mask-image: url("images/notifications/info-alt1.svg"); + background: var(--blue); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-icon.icon-warning, +body[data-exploration="icon-exploration"] .markers-panel .marker-icon.warning, +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-title .icon.warning { + -webkit-mask-image: url("images/notifications/warning-alt1.svg"); + background: var(--yellow); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-icon.icon-error, +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-title .icon.error, +body[data-exploration="icon-exploration"] .markers-panel .marker-icon.error { + -webkit-mask-image: url("images/notifications/error-alt1.svg"); + background: var(--redLight); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .clear-notification-action { + -webkit-mask-image: url("images/notifications/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .expand-notification-action { + -webkit-mask-image: url("images/notifications/up-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .collapse-notification-action { + -webkit-mask-image: url("images/notifications/down-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container .configure-notification-action { + -webkit-mask-image: url("images/notifications/configure-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench > .notifications-center > .notifications-center-header .clear-all-notifications-action { + -webkit-mask-image: url("images/notifications/closeall-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench > .notifications-center > .notifications-center-header .hide-all-notifications-action { + -webkit-mask-image: url("images/notifications/down-alt1.svg"); +} + +body[data-exploration^="icon-exploration"] .markers-panel .monaco-tl-contents .marker-icon { + min-width: 16px; +} + + +/**************** + Tree +****************/ + +body[data-exploration^="icon-exploration"] .monaco-panel-view .panel > .panel-header::before { + position: absolute; + left: 2px; + top: 2px; +} + +body[data-exploration="icon-exploration"] .file-icon-themable-tree .monaco-tree-row.has-children.expanded .content::before, +body[data-exploration="icon-exploration"] .monaco-panel-view .panel > .panel-header.expanded::before, +body[data-exploration="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-up, +body[data-exploration="icon-exploration"] .monaco-tl-twistie.collapsible:not(.loading) { + -webkit-mask-image: url("images/tree/expand-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .file-icon-themable-tree .monaco-tree-row.has-children .content::before, +body[data-exploration="icon-exploration"] .monaco-breadcrumbs .monaco-breadcrumb-item:not(:nth-child(2))::before, +body[data-exploration="icon-exploration"] .monaco-panel-view .panel > .panel-header::before, +body[data-exploration="icon-exploration"] .markers-panel .monaco-tl-contents .multiline-actions .action-label.octicon-chevron-down, +body[data-exploration="icon-exploration"] .monaco-tl-twistie.collapsible.collapsed:not(.loading) { + -webkit-mask-image: url("images/tree/collapse-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="workbench.action.closeActiveEditor"], +body[data-exploration="icon-exploration"] .monaco-editor .peekview-widget .head .peekview-actions .action-label.icon[data-title="peekview.close"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action, +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover, +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .close-editor-group, +body[data-exploration="icon-exploration"] .monaco-workbench .explorer-viewlet .explorer-open-editors .close-editor-action { + -webkit-mask-image: url("images/tree/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action, +body[data-exploration="icon-exploration"] .explorer-viewlet .explorer-open-editors .monaco-list .monaco-list-row.dirty:not(:hover) > .monaco-action-bar .close-editor-action { + -webkit-mask-image: url("images/tree/dirty-alt1.svg"); +} + + +/**************** + Tree +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="workbench.action.splitEditor"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.splitEditor"] { + -webkit-mask-image: url("images/editor/split-horizontal-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[title="Split Editor Down"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[title="Split Editor Down"] { + -webkit-mask-image: url("images/editor/split-vertical-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .title-actions .action-label[data-title="git.openChange"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="git.openChange"] { + -webkit-mask-image: url("images/editor/open-change-alt1.svg"); +} + + +/**************** + Find +****************/ + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .previous::before { + -webkit-mask-image: url("images/find/previous-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .next::before { + -webkit-mask-image: url("images/find/next-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .close-fw::before { + -webkit-mask-image: url("images/find/close-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .monaco-checkbox .label::before { + -webkit-mask-image: url("images/find/selection-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .replace::before { + -webkit-mask-image: url("images/find/replace-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .replace-all::before { + -webkit-mask-image: url("images/find/replace-all-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .expand::before { + -webkit-mask-image: url("images/find/expand-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .find-widget .collapse::before { + -webkit-mask-image: url("images/find/collapse-alt1.svg"); +} + +/**************** + Misc +****************/ + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="markdown.showPreviewToSide"]{ + -webkit-mask-image: url("images/misc/preview-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label.file-icon[title^="Preview"]::before{ + -webkit-mask-image: url("images/misc/preview-icon-alt1.svg"); + -webkit-mask-position: left center; +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="markdown.showSource"]{ + -webkit-mask-image: url("images/misc/gotofile-alt1.svg") +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="workbench.action.openGlobalKeybindingsFile"], +body[data-exploration="icon-exploration"] .monaco-workbench .part.editor > .content .editor-group-container > .title .editor-actions .action-label[data-title="settings.switchToJSON"]{ + -webkit-mask-image: url("images/misc/json-alt1.svg") +} + +body[data-exploration^="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .monaco-custom-checkbox::before { + display: block; +} + +body[data-exploration="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .record-keys::before { + -webkit-mask-image: url("images/misc/keyboard-alt1.svg") +} + +body[data-exploration="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .clear-input { + -webkit-mask-image: url("images/misc/clear-alt1.svg") +} + +body[data-exploration="icon-exploration"] .keybindings-editor .monaco-action-bar .action-item > .sort-by-precedence::before { + -webkit-mask-image: url("images/misc/precedence-alt1.svg") +} + +body[data-exploration="icon-exploration"] .monaco-workbench .part.panel > .title > .panel-switcher-container.composite-bar > .monaco-action-bar .action-label.toggle-more { + -webkit-mask-image: url("images/misc/more-alt1.svg"); + background: var(--gray) !important; +} + +body[data-exploration^="icon-exploration"] .monaco-editor .margin-view-overlays .folding, +body[data-exploration^="icon-exploration"] .monaco-editor .margin-view-overlays .folding.collapsed { + -webkit-mask-position: 75% 50%; +} + +body[data-exploration="icon-exploration"] .monaco-editor .margin-view-overlays .folding { + -webkit-mask-image: url("images/misc/fold-alt1.svg"); +} + +body[data-exploration="icon-exploration"] .monaco-editor .margin-view-overlays .folding.collapsed { + -webkit-mask-image: url("images/misc/unfold-alt1.svg"); +} \ No newline at end of file diff --git a/src/vs/workbench/browser/media/images/activitybar/debug-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/debug-alt1.svg new file mode 100644 index 00000000000..dfe350a283f --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/debug-alt1.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/extensions-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/extensions-alt1.svg new file mode 100644 index 00000000000..3fd6c5b9ca1 --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/extensions-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/files-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/files-alt1.svg new file mode 100644 index 00000000000..f2ddfd97b79 --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/files-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/git-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/git-alt1.svg new file mode 100644 index 00000000000..6ce8a7c1c51 --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/git-alt1.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/more-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/more-alt1.svg new file mode 100644 index 00000000000..6729ca3c90d --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/more-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/search-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/search-alt1.svg new file mode 100644 index 00000000000..fb1a6e7bd59 --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/search-alt1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/activitybar/settings-alt1.svg b/src/vs/workbench/browser/media/images/activitybar/settings-alt1.svg new file mode 100644 index 00000000000..b2a61102112 --- /dev/null +++ b/src/vs/workbench/browser/media/images/activitybar/settings-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/add-alt1.svg b/src/vs/workbench/browser/media/images/debug/add-alt1.svg new file mode 100644 index 00000000000..fb50c6c2849 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/add-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-activate-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-activate-alt1.svg new file mode 100644 index 00000000000..3e6b0a4c4df --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-activate-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-alt1.svg new file mode 100644 index 00000000000..e391c3b0852 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-conditional-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-conditional-alt1.svg new file mode 100644 index 00000000000..9794d6b5522 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-conditional-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-function-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-function-alt1.svg new file mode 100644 index 00000000000..76d1f05da2c --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-function-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-function-disabled-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-function-disabled-alt1.svg new file mode 100644 index 00000000000..76d1f05da2c --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-function-disabled-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-function-unverified-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-function-unverified-alt1.svg new file mode 100644 index 00000000000..ece98d0f356 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-function-unverified-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-log-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-log-alt1.svg new file mode 100644 index 00000000000..21ada7b2928 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-log-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-log-unverified-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-log-unverified-alt1.svg new file mode 100644 index 00000000000..f540bf94efb --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-log-unverified-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/breakpoint-unverified-alt1.svg b/src/vs/workbench/browser/media/images/debug/breakpoint-unverified-alt1.svg new file mode 100644 index 00000000000..6bfa8fd2f5a --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/breakpoint-unverified-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/close-alt1.svg b/src/vs/workbench/browser/media/images/debug/close-alt1.svg new file mode 100644 index 00000000000..8af24a5b1e8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/close-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/debug/continue-alt1.svg b/src/vs/workbench/browser/media/images/debug/continue-alt1.svg new file mode 100644 index 00000000000..80f23e711b1 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/continue-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/current-and-breakpoint-alt1.svg b/src/vs/workbench/browser/media/images/debug/current-and-breakpoint-alt1.svg new file mode 100644 index 00000000000..df3c2501a53 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/current-and-breakpoint-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/current-arrow-alt1.svg b/src/vs/workbench/browser/media/images/debug/current-arrow-alt1.svg new file mode 100644 index 00000000000..f62a9fb6db4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/current-arrow-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/disconnect-alt1.svg b/src/vs/workbench/browser/media/images/debug/disconnect-alt1.svg new file mode 100644 index 00000000000..71aae0dd887 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/disconnect-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/drag-alt1.svg b/src/vs/workbench/browser/media/images/debug/drag-alt1.svg new file mode 100644 index 00000000000..b6b93f31fdf --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/drag-alt1.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/debug/gear-alt1.svg b/src/vs/workbench/browser/media/images/debug/gear-alt1.svg new file mode 100644 index 00000000000..7db1664af78 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/gear-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/pause-alt1.svg b/src/vs/workbench/browser/media/images/debug/pause-alt1.svg new file mode 100644 index 00000000000..5a2d9954b7b --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/pause-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/repl-alt1.svg b/src/vs/workbench/browser/media/images/debug/repl-alt1.svg new file mode 100644 index 00000000000..6da42ae0f64 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/repl-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/restart-alt1.svg b/src/vs/workbench/browser/media/images/debug/restart-alt1.svg new file mode 100644 index 00000000000..54a5a0441d9 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/restart-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/stackframe-and-breakpoint-alt1.svg b/src/vs/workbench/browser/media/images/debug/stackframe-and-breakpoint-alt1.svg new file mode 100644 index 00000000000..df3c2501a53 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/stackframe-and-breakpoint-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/stackframe-arrow-alt1.svg b/src/vs/workbench/browser/media/images/debug/stackframe-arrow-alt1.svg new file mode 100644 index 00000000000..f62a9fb6db4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/stackframe-arrow-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/start-alt1.svg b/src/vs/workbench/browser/media/images/debug/start-alt1.svg new file mode 100644 index 00000000000..ecc3deb2d0f --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/start-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/debug/step-into-alt1.svg b/src/vs/workbench/browser/media/images/debug/step-into-alt1.svg new file mode 100644 index 00000000000..d5fd06e2d51 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/step-into-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/step-out-alt1.svg b/src/vs/workbench/browser/media/images/debug/step-out-alt1.svg new file mode 100644 index 00000000000..26961e11198 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/step-out-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/step-over-alt1.svg b/src/vs/workbench/browser/media/images/debug/step-over-alt1.svg new file mode 100644 index 00000000000..115613d2a71 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/step-over-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/debug/stop-alt1.svg b/src/vs/workbench/browser/media/images/debug/stop-alt1.svg new file mode 100644 index 00000000000..8886ecc9893 --- /dev/null +++ b/src/vs/workbench/browser/media/images/debug/stop-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/editor/open-change-alt1.svg b/src/vs/workbench/browser/media/images/editor/open-change-alt1.svg new file mode 100644 index 00000000000..da581cf940b --- /dev/null +++ b/src/vs/workbench/browser/media/images/editor/open-change-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/editor/split-horizontal-alt1.svg b/src/vs/workbench/browser/media/images/editor/split-horizontal-alt1.svg new file mode 100644 index 00000000000..c92025ddd92 --- /dev/null +++ b/src/vs/workbench/browser/media/images/editor/split-horizontal-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/editor/split-vertical-alt1.svg b/src/vs/workbench/browser/media/images/editor/split-vertical-alt1.svg new file mode 100644 index 00000000000..f407c08fa34 --- /dev/null +++ b/src/vs/workbench/browser/media/images/editor/split-vertical-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/add-file-alt1.svg b/src/vs/workbench/browser/media/images/explorer/add-file-alt1.svg new file mode 100644 index 00000000000..138351f66b2 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/add-file-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/add-folder-alt1.svg b/src/vs/workbench/browser/media/images/explorer/add-folder-alt1.svg new file mode 100644 index 00000000000..0f1a2bfb9ba --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/add-folder-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/close-alt1.svg b/src/vs/workbench/browser/media/images/explorer/close-alt1.svg new file mode 100644 index 00000000000..8af24a5b1e8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/close-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/collapse-alt1.svg b/src/vs/workbench/browser/media/images/explorer/collapse-alt1.svg new file mode 100644 index 00000000000..f2e0e5dd5f6 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/collapse-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/layout-alt1.svg b/src/vs/workbench/browser/media/images/explorer/layout-alt1.svg new file mode 100644 index 00000000000..40c1b46b197 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/layout-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/explorer/more-alt1.svg b/src/vs/workbench/browser/media/images/explorer/more-alt1.svg new file mode 100644 index 00000000000..3d7068f6b4c --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/more-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/explorer/refresh-alt1.svg b/src/vs/workbench/browser/media/images/explorer/refresh-alt1.svg new file mode 100644 index 00000000000..f8a6bdcaff8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/refresh-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/explorer/save-alt1.svg b/src/vs/workbench/browser/media/images/explorer/save-alt1.svg new file mode 100644 index 00000000000..5756795cb42 --- /dev/null +++ b/src/vs/workbench/browser/media/images/explorer/save-alt1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/clear-alt1.svg b/src/vs/workbench/browser/media/images/extensions/clear-alt1.svg new file mode 100644 index 00000000000..63be0fae215 --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/clear-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/download-alt1.svg b/src/vs/workbench/browser/media/images/extensions/download-alt1.svg new file mode 100644 index 00000000000..211864d2c8b --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/download-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/gear-alt1.svg b/src/vs/workbench/browser/media/images/extensions/gear-alt1.svg new file mode 100644 index 00000000000..7db1664af78 --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/gear-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/star-empty-alt1.svg b/src/vs/workbench/browser/media/images/extensions/star-empty-alt1.svg new file mode 100644 index 00000000000..a35ded971f7 --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/star-empty-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/star-full-alt1.svg b/src/vs/workbench/browser/media/images/extensions/star-full-alt1.svg new file mode 100644 index 00000000000..2413e6ecb1f --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/star-full-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/extensions/star-half-alt1.svg b/src/vs/workbench/browser/media/images/extensions/star-half-alt1.svg new file mode 100644 index 00000000000..4e8dcd71f3b --- /dev/null +++ b/src/vs/workbench/browser/media/images/extensions/star-half-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/find/close-alt1.svg b/src/vs/workbench/browser/media/images/find/close-alt1.svg new file mode 100644 index 00000000000..2512e9d61aa --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/find/collapse-alt1.svg b/src/vs/workbench/browser/media/images/find/collapse-alt1.svg new file mode 100644 index 00000000000..6d01adc07ea --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/collapse-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/find/expand-alt1.svg b/src/vs/workbench/browser/media/images/find/expand-alt1.svg new file mode 100644 index 00000000000..a1a96a60926 --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/expand-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/find/next-alt1.svg b/src/vs/workbench/browser/media/images/find/next-alt1.svg new file mode 100644 index 00000000000..254b9ca651a --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/next-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/find/previous-alt1.svg b/src/vs/workbench/browser/media/images/find/previous-alt1.svg new file mode 100644 index 00000000000..1590abcfcd3 --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/previous-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/find/replace-all-alt1.svg b/src/vs/workbench/browser/media/images/find/replace-all-alt1.svg new file mode 100644 index 00000000000..66437cf4410 --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/replace-all-alt1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/find/replace-alt1.svg b/src/vs/workbench/browser/media/images/find/replace-alt1.svg new file mode 100644 index 00000000000..b599b6e5432 --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/replace-alt1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/vs/workbench/browser/media/images/find/selection-alt1.svg b/src/vs/workbench/browser/media/images/find/selection-alt1.svg new file mode 100644 index 00000000000..e0503a93a51 --- /dev/null +++ b/src/vs/workbench/browser/media/images/find/selection-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/check-alt1.svg b/src/vs/workbench/browser/media/images/git/check-alt1.svg new file mode 100644 index 00000000000..a5597d7c404 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/check-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/clean-alt1.svg b/src/vs/workbench/browser/media/images/git/clean-alt1.svg new file mode 100644 index 00000000000..2f3dd525c0d --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/clean-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/close-alt1.svg b/src/vs/workbench/browser/media/images/git/close-alt1.svg new file mode 100644 index 00000000000..64618b61760 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/git/gotofile-alt1.svg b/src/vs/workbench/browser/media/images/git/gotofile-alt1.svg new file mode 100644 index 00000000000..aabfc34c3e4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/gotofile-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/git/next-alt1.svg b/src/vs/workbench/browser/media/images/git/next-alt1.svg new file mode 100644 index 00000000000..d2660e6e90f --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/next-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/previous-alt1.svg b/src/vs/workbench/browser/media/images/git/previous-alt1.svg new file mode 100644 index 00000000000..6f8d0cbcb6d --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/previous-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/refresh-alt1.svg b/src/vs/workbench/browser/media/images/git/refresh-alt1.svg new file mode 100644 index 00000000000..c5d90a34de5 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/refresh-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/git/stage-alt1.svg b/src/vs/workbench/browser/media/images/git/stage-alt1.svg new file mode 100644 index 00000000000..fb50c6c2849 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/stage-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/git/unstage-alt1.svg b/src/vs/workbench/browser/media/images/git/unstage-alt1.svg new file mode 100644 index 00000000000..ae942eb6748 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/unstage-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/git/whitespace-alt1.svg b/src/vs/workbench/browser/media/images/git/whitespace-alt1.svg new file mode 100644 index 00000000000..66f3fdbe7e0 --- /dev/null +++ b/src/vs/workbench/browser/media/images/git/whitespace-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/array-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/array-alt1.svg new file mode 100644 index 00000000000..b058a7ca9cc --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/array-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/boolean-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/boolean-alt1.svg new file mode 100644 index 00000000000..8fbcf89f2fd --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/boolean-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/class-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/class-alt1.svg new file mode 100644 index 00000000000..c939df47de5 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/class-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/close-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/close-alt1.svg new file mode 100644 index 00000000000..1d8840d9276 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/color-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/color-alt1.svg new file mode 100644 index 00000000000..914bb6f48d5 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/color-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/constant-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/constant-alt1.svg new file mode 100644 index 00000000000..bbb9e6dcbf8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/constant-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/enum-member-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/enum-member-alt1.svg new file mode 100644 index 00000000000..e182868e71e --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/enum-member-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/enumerator-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/enumerator-alt1.svg new file mode 100644 index 00000000000..7b87fce3202 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/enumerator-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/event-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/event-alt1.svg new file mode 100644 index 00000000000..9c7c2504c24 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/event-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/field-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/field-alt1.svg new file mode 100644 index 00000000000..e547fb51a2d --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/field-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/file-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/file-alt1.svg new file mode 100644 index 00000000000..9a0f5212ac7 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/file-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/folder-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/folder-alt1.svg new file mode 100644 index 00000000000..8d3f68206e0 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/folder-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/info-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/info-alt1.svg new file mode 100644 index 00000000000..ef9fe8777a3 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/info-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/interface-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/interface-alt1.svg new file mode 100644 index 00000000000..9114ce3f3e8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/interface-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/key-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/key-alt1.svg new file mode 100644 index 00000000000..58c6cf4ca11 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/key-alt1.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/keyword-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/keyword-alt1.svg new file mode 100644 index 00000000000..f21364efec0 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/keyword-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/lightbulb-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/lightbulb-alt1.svg new file mode 100644 index 00000000000..fcc5c13a1ff --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/lightbulb-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/lightbulb-autofix-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/lightbulb-autofix-alt1.svg new file mode 100644 index 00000000000..9ebb18334b6 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/lightbulb-autofix-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/method-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/method-alt1.svg new file mode 100644 index 00000000000..392febfaa6b --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/method-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/namespace-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/namespace-alt1.svg new file mode 100644 index 00000000000..bb4c103c752 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/namespace-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/numeric-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/numeric-alt1.svg new file mode 100644 index 00000000000..90cf05e747a --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/numeric-alt1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/operator-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/operator-alt1.svg new file mode 100644 index 00000000000..20f50387a69 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/operator-alt1.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/parameter-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/parameter-alt1.svg new file mode 100644 index 00000000000..00198f67f4e --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/parameter-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/property-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/property-alt1.svg new file mode 100644 index 00000000000..828113202a9 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/property-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/reference-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/reference-alt1.svg new file mode 100644 index 00000000000..aabfc34c3e4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/reference-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/ruler-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/ruler-alt1.svg new file mode 100644 index 00000000000..eec16f41fbf --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/ruler-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/snippet-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/snippet-alt1.svg new file mode 100644 index 00000000000..ee82045f2ac --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/snippet-alt1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/string-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/string-alt1.svg new file mode 100644 index 00000000000..1aa09c086cb --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/string-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/structure-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/structure-alt1.svg new file mode 100644 index 00000000000..f0e857ed7ca --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/structure-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/intellisense/variable-alt1.svg b/src/vs/workbench/browser/media/images/intellisense/variable-alt1.svg new file mode 100644 index 00000000000..8cf0dbb7116 --- /dev/null +++ b/src/vs/workbench/browser/media/images/intellisense/variable-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/misc/clear-alt1.svg b/src/vs/workbench/browser/media/images/misc/clear-alt1.svg new file mode 100644 index 00000000000..0e624a23191 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/clear-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/fold-alt1.svg b/src/vs/workbench/browser/media/images/misc/fold-alt1.svg new file mode 100644 index 00000000000..69efb3e6957 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/fold-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/misc/gotofile-alt1.svg b/src/vs/workbench/browser/media/images/misc/gotofile-alt1.svg new file mode 100644 index 00000000000..aabfc34c3e4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/gotofile-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/json-alt1.svg b/src/vs/workbench/browser/media/images/misc/json-alt1.svg new file mode 100644 index 00000000000..9e8f99141fc --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/json-alt1.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/keyboard-alt1.svg b/src/vs/workbench/browser/media/images/misc/keyboard-alt1.svg new file mode 100644 index 00000000000..6181acae7ef --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/keyboard-alt1.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/more-alt1.svg b/src/vs/workbench/browser/media/images/misc/more-alt1.svg new file mode 100644 index 00000000000..3d7068f6b4c --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/more-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/precedence-alt1.svg b/src/vs/workbench/browser/media/images/misc/precedence-alt1.svg new file mode 100644 index 00000000000..2609f1f40f9 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/precedence-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/preview-alt1.svg b/src/vs/workbench/browser/media/images/misc/preview-alt1.svg new file mode 100644 index 00000000000..0f0ffe4bffe --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/preview-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/misc/preview-icon-alt1.svg b/src/vs/workbench/browser/media/images/misc/preview-icon-alt1.svg new file mode 100644 index 00000000000..df907d5dd14 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/preview-icon-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/misc/split-alt1.svg b/src/vs/workbench/browser/media/images/misc/split-alt1.svg new file mode 100644 index 00000000000..c92025ddd92 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/split-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/misc/unfold-alt1.svg b/src/vs/workbench/browser/media/images/misc/unfold-alt1.svg new file mode 100644 index 00000000000..bb57558f608 --- /dev/null +++ b/src/vs/workbench/browser/media/images/misc/unfold-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/notifications/close-alt1.svg b/src/vs/workbench/browser/media/images/notifications/close-alt1.svg new file mode 100644 index 00000000000..64618b61760 --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/closeall-alt1.svg b/src/vs/workbench/browser/media/images/notifications/closeall-alt1.svg new file mode 100644 index 00000000000..72bf0a8b54a --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/closeall-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/configure-alt1.svg b/src/vs/workbench/browser/media/images/notifications/configure-alt1.svg new file mode 100644 index 00000000000..7db1664af78 --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/configure-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/down-alt1.svg b/src/vs/workbench/browser/media/images/notifications/down-alt1.svg new file mode 100644 index 00000000000..7042b08fddf --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/down-alt1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/error-alt1.svg b/src/vs/workbench/browser/media/images/notifications/error-alt1.svg new file mode 100644 index 00000000000..e39bf5e0e4a --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/error-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/notifications/info-alt1.svg b/src/vs/workbench/browser/media/images/notifications/info-alt1.svg new file mode 100644 index 00000000000..4a597c7b804 --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/info-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/up-alt1.svg b/src/vs/workbench/browser/media/images/notifications/up-alt1.svg new file mode 100644 index 00000000000..d5edcc4c305 --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/up-alt1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/notifications/warning-alt1.svg b/src/vs/workbench/browser/media/images/notifications/warning-alt1.svg new file mode 100644 index 00000000000..948c0b4decf --- /dev/null +++ b/src/vs/workbench/browser/media/images/notifications/warning-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/add-alt1.svg b/src/vs/workbench/browser/media/images/panel/add-alt1.svg new file mode 100644 index 00000000000..fb50c6c2849 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/add-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/panel/clear-alt1.svg b/src/vs/workbench/browser/media/images/panel/clear-alt1.svg new file mode 100644 index 00000000000..63be0fae215 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/clear-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/close-all-alt1.svg b/src/vs/workbench/browser/media/images/panel/close-all-alt1.svg new file mode 100644 index 00000000000..8af24a5b1e8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/close-all-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/close-alt1.svg b/src/vs/workbench/browser/media/images/panel/close-alt1.svg new file mode 100644 index 00000000000..3818f7d5350 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/panel/collapse-all-alt1.svg b/src/vs/workbench/browser/media/images/panel/collapse-all-alt1.svg new file mode 100644 index 00000000000..f2e0e5dd5f6 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/collapse-all-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/panel/down-alt1.svg b/src/vs/workbench/browser/media/images/panel/down-alt1.svg new file mode 100644 index 00000000000..de3313624a4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/down-alt1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/gear-alt1.svg b/src/vs/workbench/browser/media/images/panel/gear-alt1.svg new file mode 100644 index 00000000000..7db1664af78 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/gear-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/panel/gotofile-alt1.svg b/src/vs/workbench/browser/media/images/panel/gotofile-alt1.svg new file mode 100644 index 00000000000..aabfc34c3e4 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/gotofile-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/kill-alt1.svg b/src/vs/workbench/browser/media/images/panel/kill-alt1.svg new file mode 100644 index 00000000000..bc448290732 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/kill-alt1.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/panel/output-lock-alt1.svg b/src/vs/workbench/browser/media/images/panel/output-lock-alt1.svg new file mode 100644 index 00000000000..70d268965a0 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/output-lock-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/panel/output-unlock-alt1.svg b/src/vs/workbench/browser/media/images/panel/output-unlock-alt1.svg new file mode 100644 index 00000000000..cf8268d37d2 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/output-unlock-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/panel/split-horizontal-alt1.svg b/src/vs/workbench/browser/media/images/panel/split-horizontal-alt1.svg new file mode 100644 index 00000000000..c92025ddd92 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/split-horizontal-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/panel/split-vertical-alt1.svg b/src/vs/workbench/browser/media/images/panel/split-vertical-alt1.svg new file mode 100644 index 00000000000..f407c08fa34 --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/split-vertical-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/panel/up-alt1.svg b/src/vs/workbench/browser/media/images/panel/up-alt1.svg new file mode 100644 index 00000000000..e7ac370945f --- /dev/null +++ b/src/vs/workbench/browser/media/images/panel/up-alt1.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/search/case-sensitive-alt1.svg b/src/vs/workbench/browser/media/images/search/case-sensitive-alt1.svg new file mode 100644 index 00000000000..418172b6866 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/case-sensitive-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/search/clear-alt1.svg b/src/vs/workbench/browser/media/images/search/clear-alt1.svg new file mode 100644 index 00000000000..890a6cddaa1 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/clear-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/search/collapse-all-alt1.svg b/src/vs/workbench/browser/media/images/search/collapse-all-alt1.svg new file mode 100644 index 00000000000..f2e0e5dd5f6 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/collapse-all-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/search/collapse-alt1.svg b/src/vs/workbench/browser/media/images/search/collapse-alt1.svg new file mode 100644 index 00000000000..829e53760f2 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/collapse-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/search/exclude-alt1.svg b/src/vs/workbench/browser/media/images/search/exclude-alt1.svg new file mode 100644 index 00000000000..2257ec6dae9 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/exclude-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/search/expand-alt1.svg b/src/vs/workbench/browser/media/images/search/expand-alt1.svg new file mode 100644 index 00000000000..a1085f2ad07 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/expand-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/search/more-alt1.svg b/src/vs/workbench/browser/media/images/search/more-alt1.svg new file mode 100644 index 00000000000..a83faaa6ffb --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/more-alt1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/vs/workbench/browser/media/images/search/refresh-alt1.svg b/src/vs/workbench/browser/media/images/search/refresh-alt1.svg new file mode 100644 index 00000000000..f8a6bdcaff8 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/refresh-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/search/regex-alt1.svg b/src/vs/workbench/browser/media/images/search/regex-alt1.svg new file mode 100644 index 00000000000..bffb311a5be --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/regex-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/search/remove-alt1.svg b/src/vs/workbench/browser/media/images/search/remove-alt1.svg new file mode 100644 index 00000000000..64618b61760 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/remove-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/search/replace-all-alt1.svg b/src/vs/workbench/browser/media/images/search/replace-all-alt1.svg new file mode 100644 index 00000000000..1ef9b63cd60 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/replace-all-alt1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/vs/workbench/browser/media/images/search/replace-alt1.svg b/src/vs/workbench/browser/media/images/search/replace-alt1.svg new file mode 100644 index 00000000000..0979845e836 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/replace-alt1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/vs/workbench/browser/media/images/search/stop-alt1.svg b/src/vs/workbench/browser/media/images/search/stop-alt1.svg new file mode 100644 index 00000000000..52f3aa26ce2 --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/stop-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/search/whole-word-alt1.svg b/src/vs/workbench/browser/media/images/search/whole-word-alt1.svg new file mode 100644 index 00000000000..8a18eed8deb --- /dev/null +++ b/src/vs/workbench/browser/media/images/search/whole-word-alt1.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/vs/workbench/browser/media/images/tree/close-alt1.svg b/src/vs/workbench/browser/media/images/tree/close-alt1.svg new file mode 100644 index 00000000000..3818f7d5350 --- /dev/null +++ b/src/vs/workbench/browser/media/images/tree/close-alt1.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/vs/workbench/browser/media/images/tree/collapse-alt1.svg b/src/vs/workbench/browser/media/images/tree/collapse-alt1.svg new file mode 100644 index 00000000000..f6e6553774e --- /dev/null +++ b/src/vs/workbench/browser/media/images/tree/collapse-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/tree/dirty-alt1.svg b/src/vs/workbench/browser/media/images/tree/dirty-alt1.svg new file mode 100644 index 00000000000..e391c3b0852 --- /dev/null +++ b/src/vs/workbench/browser/media/images/tree/dirty-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/media/images/tree/expand-alt1.svg b/src/vs/workbench/browser/media/images/tree/expand-alt1.svg new file mode 100644 index 00000000000..a98a85b340e --- /dev/null +++ b/src/vs/workbench/browser/media/images/tree/expand-alt1.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 2b4586e1c88..e5a7f26622f 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -181,14 +181,15 @@ export class ActivitybarPart extends Part implements IActivityBarService { createContentArea(parent: HTMLElement): HTMLElement { this.element = parent; + const content = document.createElement('div'); addClass(content, 'content'); parent.appendChild(content); - // Top Actionbar with action items for each viewlet action + // Viewlets action bar this.compositeBar.create(content); - // Top Actionbar with action items for each viewlet action + // Global action bar const globalActivities = document.createElement('div'); addClass(globalActivities, 'global-activity'); content.appendChild(globalActivities); @@ -208,7 +209,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { const borderColor = this.getColor(ACTIVITY_BAR_BORDER) || this.getColor(contrastBorder); const isPositionLeft = this.layoutService.getSideBarPosition() === SideBarPosition.LEFT; - container.style.boxSizing = borderColor && isPositionLeft ? 'border-box' : null; + container.style.boxSizing = borderColor && isPositionLeft ? 'border-box' : ''; container.style.borderRightWidth = borderColor && isPositionLeft ? '1px' : null; container.style.borderRightStyle = borderColor && isPositionLeft ? 'solid' : null; container.style.borderRightColor = isPositionLeft ? borderColor : null; diff --git a/src/vs/workbench/browser/parts/compositeBarActions.ts b/src/vs/workbench/browser/parts/compositeBarActions.ts index 59e89ca7df4..34a0685818c 100644 --- a/src/vs/workbench/browser/parts/compositeBarActions.ts +++ b/src/vs/workbench/browser/parts/compositeBarActions.ts @@ -549,11 +549,11 @@ export class CompositeActionViewItem extends ActivityActionViewItem { })); // Activate on drag over to reveal targets - [this.badge, this.label].forEach(b => new DelayedDragHandler(b, () => { + [this.badge, this.label].forEach(b => this._register(new DelayedDragHandler(b, () => { if (!this.compositeTransfer.hasData(DraggedCompositeIdentifier.prototype) && !this.getAction().checked) { this.getAction().run(); } - })); + }))); this.updateStyles(); } diff --git a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts index 7f09ad3f84a..f907d999953 100644 --- a/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts +++ b/src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts @@ -496,10 +496,10 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, { }); MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { group: '5_editor', - order: 99, + order: 3, command: { id: 'breadcrumbs.toggle', - title: localize('miToggleBreadcrumbs', "Toggle &&Breadcrumbs"), + title: localize('miShowBreadcrumbs', "Show &&Breadcrumbs"), toggled: ContextKeyExpr.equals('config.breadcrumbs.enabled', true) } }); diff --git a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts index 960706afc92..266f09275db 100644 --- a/src/vs/workbench/browser/parts/editor/editorDropTarget.ts +++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts @@ -88,10 +88,10 @@ class DropOverlay extends Themable { // Overlay contrast border (if any) const activeContrastBorderColor = this.getColor(activeContrastBorder); - this.overlay.style.outlineColor = activeContrastBorderColor; - this.overlay.style.outlineOffset = activeContrastBorderColor ? '-2px' : null; - this.overlay.style.outlineStyle = activeContrastBorderColor ? 'dashed' : null; - this.overlay.style.outlineWidth = activeContrastBorderColor ? '2px' : null; + this.overlay.style.outlineColor = activeContrastBorderColor || ''; + this.overlay.style.outlineOffset = activeContrastBorderColor ? '-2px' : ''; + this.overlay.style.outlineStyle = activeContrastBorderColor ? 'dashed' : ''; + this.overlay.style.outlineWidth = activeContrastBorderColor ? '2px' : ''; } private registerListeners(): void { diff --git a/src/vs/workbench/browser/parts/editor/media/resourceviewer.css b/src/vs/workbench/browser/parts/editor/media/resourceviewer.css index 136cf28636c..385ab08f4d4 100644 --- a/src/vs/workbench/browser/parts/editor/media/resourceviewer.css +++ b/src/vs/workbench/browser/parts/editor/media/resourceviewer.css @@ -14,19 +14,23 @@ .monaco-resource-viewer.image { padding: 0; - background-position: 0 0, 8px 8px; - background-size: 16px 16px; display: flex; box-sizing: border-box; } -.vs .monaco-resource-viewer.image { +.monaco-resource-viewer.image img { + padding: 0; + background-position: 0 0, 8px 8px; + background-size: 16px 16px; +} + +.vs .monaco-resource-viewer.image img { background-image: linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230)), linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230)); } -.vs-dark .monaco-resource-viewer.image { +.vs-dark .monaco-resource-viewer.image img { background-image: linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20)), linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20)); diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 480aac9b036..7578bda2fc2 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -107,7 +107,7 @@ export class TabsTitleControl extends TitleControl { this.registerTabsContainerListeners(); // Tabs Scrollbar - this.tabsScrollbar = this.createTabsScrollbar(this.tabsContainer); + this.tabsScrollbar = this._register(this.createTabsScrollbar(this.tabsContainer)); tabsAndActionsContainer.appendChild(this.tabsScrollbar.getDomNode()); // Editor Toolbar Container @@ -710,10 +710,10 @@ export class TabsTitleControl extends TitleControl { element.style.outlineColor = activeContrastBorderColor; element.style.outlineOffset = isTab ? '-5px' : '-3px'; } else { - element.style.outlineWidth = null; - element.style.outlineStyle = null; - element.style.outlineColor = activeContrastBorderColor; - element.style.outlineOffset = null; + element.style.outlineWidth = ''; + element.style.outlineStyle = ''; + element.style.outlineColor = activeContrastBorderColor || ''; + element.style.outlineOffset = ''; } } @@ -850,7 +850,7 @@ export class TabsTitleControl extends TitleControl { // Borders / Outline const borderRightColor = (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)); tabContainer.style.borderRight = borderRightColor ? `1px solid ${borderRightColor}` : null; - tabContainer.style.outlineColor = this.getColor(activeContrastBorder); + tabContainer.style.outlineColor = this.getColor(activeContrastBorder) || ''; // Settings const options = this.accessor.partOptions; diff --git a/src/vs/workbench/browser/parts/notifications/notificationsList.ts b/src/vs/workbench/browser/parts/notifications/notificationsList.ts index fd26a6fa1d6..ad21cda900c 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsList.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsList.ts @@ -219,7 +219,7 @@ export class NotificationsList extends Themable { this.listContainer.style.background = background ? background.toString() : null; const outlineColor = this.getColor(contrastBorder); - this.listContainer.style.outlineColor = outlineColor ? outlineColor.toString() : null; + this.listContainer.style.outlineColor = outlineColor ? outlineColor.toString() : ''; } } diff --git a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts index b121c3ca2f0..b9d11dbd12b 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsStatus.ts @@ -3,16 +3,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, INotificationViewItem } from 'vs/workbench/common/notifications'; +import { INotificationsModel, INotificationChangeEvent, NotificationChangeType, INotificationViewItem, IStatusMessageChangeEvent, StatusMessageChangeType, IStatusMessageViewItem } from 'vs/workbench/common/notifications'; import { IStatusbarService, StatusbarAlignment, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/platform/statusbar/common/statusbar'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { HIDE_NOTIFICATIONS_CENTER, SHOW_NOTIFICATIONS_CENTER } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; import { localize } from 'vs/nls'; export class NotificationsStatus extends Disposable { - private statusItem: IStatusbarEntryAccessor; + + private notificationsCenterStatusItem: IStatusbarEntryAccessor; + private currentNotifications = new Set(); + + private currentStatusMessage: [IStatusMessageViewItem, IDisposable] | undefined; + private isNotificationsCenterVisible: boolean; - private _counter: Set; constructor( private model: INotificationsModel, @@ -20,29 +24,18 @@ export class NotificationsStatus extends Disposable { ) { super(); - this._counter = new Set(); + this.updateNotificationsCenterStatusItem(); - this.updateNotificationsStatusItem(); + if (model.statusMessage) { + this.doSetStatusMessage(model.statusMessage); + } this.registerListeners(); } - private get count(): number { - return this._counter.size; - } - - update(isCenterVisible: boolean): void { - if (this.isNotificationsCenterVisible !== isCenterVisible) { - this.isNotificationsCenterVisible = isCenterVisible; - - // Showing the notification center resets the counter to 0 - this._counter.clear(); - this.updateNotificationsStatusItem(); - } - } - private registerListeners(): void { this._register(this.model.onDidNotificationChange(e => this.onDidNotificationChange(e))); + this._register(this.model.onDidStatusMessageChange(e => this.onDidStatusMessageChange(e))); } private onDidNotificationChange(e: INotificationChangeEvent): void { @@ -52,29 +45,29 @@ export class NotificationsStatus extends Disposable { // Notification got Added if (e.kind === NotificationChangeType.ADD) { - this._counter.add(e.item); + this.currentNotifications.add(e.item); } // Notification got Removed else if (e.kind === NotificationChangeType.REMOVE) { - this._counter.delete(e.item); + this.currentNotifications.delete(e.item); } - this.updateNotificationsStatusItem(); + this.updateNotificationsCenterStatusItem(); } - private updateNotificationsStatusItem(): void { + private updateNotificationsCenterStatusItem(): void { const statusProperties: IStatusbarEntry = { - text: this.count === 0 ? '$(bell)' : `$(bell) ${this.count}`, + text: this.currentNotifications.size === 0 ? '$(bell)' : `$(bell) ${this.currentNotifications.size}`, command: this.isNotificationsCenterVisible ? HIDE_NOTIFICATIONS_CENTER : SHOW_NOTIFICATIONS_CENTER, tooltip: this.getTooltip(), showBeak: this.isNotificationsCenterVisible }; - if (!this.statusItem) { - this.statusItem = this.statusbarService.addEntry(statusProperties, StatusbarAlignment.RIGHT, -1000 /* towards the far end of the right hand side */); + if (!this.notificationsCenterStatusItem) { + this.notificationsCenterStatusItem = this.statusbarService.addEntry(statusProperties, StatusbarAlignment.RIGHT, -1000 /* towards the far end of the right hand side */); } else { - this.statusItem.update(statusProperties); + this.notificationsCenterStatusItem.update(statusProperties); } } @@ -87,14 +80,90 @@ export class NotificationsStatus extends Disposable { return localize('zeroNotifications', "No Notifications"); } - if (this.count === 0) { + if (this.currentNotifications.size === 0) { return localize('noNotifications', "No New Notifications"); } - if (this.count === 1) { + if (this.currentNotifications.size === 1) { return localize('oneNotification', "1 New Notification"); } - return localize('notifications', "{0} New Notifications", this.count); + return localize('notifications', "{0} New Notifications", this.currentNotifications.size); + } + + update(isCenterVisible: boolean): void { + if (this.isNotificationsCenterVisible !== isCenterVisible) { + this.isNotificationsCenterVisible = isCenterVisible; + + // Showing the notification center resets the counter to 0 + this.currentNotifications.clear(); + this.updateNotificationsCenterStatusItem(); + } + } + + private onDidStatusMessageChange(e: IStatusMessageChangeEvent): void { + const statusItem = e.item; + + switch (e.kind) { + + // Show status notification + case StatusMessageChangeType.ADD: + this.doSetStatusMessage(statusItem); + + break; + + // Hide status notification (if its still the current one) + case StatusMessageChangeType.REMOVE: + if (this.currentStatusMessage && this.currentStatusMessage[0] === statusItem) { + dispose(this.currentStatusMessage[1]); + this.currentStatusMessage = undefined; + } + + break; + } + } + + private doSetStatusMessage(item: IStatusMessageViewItem): void { + const message = item.message; + + const showAfter = item.options && typeof item.options.showAfter === 'number' ? item.options.showAfter : 0; + const hideAfter = item.options && typeof item.options.hideAfter === 'number' ? item.options.hideAfter : -1; + + // Dismiss any previous + if (this.currentStatusMessage) { + dispose(this.currentStatusMessage[1]); + } + + // Create new + let statusMessageEntry: IStatusbarEntryAccessor; + let showHandle: any = setTimeout(() => { + statusMessageEntry = this.statusbarService.addEntry({ text: message }, StatusbarAlignment.LEFT, -Number.MAX_VALUE /* far right on left hand side */); + showHandle = null; + }, showAfter); + + // Dispose function takes care of timeouts and actual entry + let hideHandle: any; + const statusMessageDispose = { + dispose: () => { + if (showHandle) { + clearTimeout(showHandle); + } + + if (hideHandle) { + clearTimeout(hideHandle); + } + + if (statusMessageEntry) { + statusMessageEntry.dispose(); + } + } + }; + + if (hideAfter > 0) { + hideHandle = setTimeout(() => statusMessageDispose.dispose(), hideAfter); + } + + // Remember as current status message + this.currentStatusMessage = [item, statusMessageDispose]; } } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index 19f9f0d7f4d..5e9021847a3 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -16,6 +16,7 @@ import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/ import { ActivityAction } from 'vs/workbench/browser/parts/compositeBarActions'; import { IActivity } from 'vs/workbench/common/activity'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; +import { ActivePanelContext, PanelPositionContext } from 'vs/workbench/common/panel'; export class ClosePanelAction extends Action { @@ -92,8 +93,8 @@ export class TogglePanelPositionAction extends Action { static readonly ID = 'workbench.action.togglePanelPosition'; static readonly LABEL = nls.localize('toggledPanelPosition', "Toggle Panel Position"); - private static readonly MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move Panel Right"); - private static readonly MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move Panel to Bottom"); + static readonly MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move Panel Right"); + static readonly MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move Panel to Bottom"); private toDispose: IDisposable[]; @@ -271,16 +272,28 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { group: '2_workbench_layout', command: { id: TogglePanelAction.ID, - title: nls.localize({ key: 'miTogglePanel', comment: ['&& denotes a mnemonic'] }, "Toggle &&Panel") + title: nls.localize({ key: 'miShowPanel', comment: ['&& denotes a mnemonic'] }, "Show &&Panel"), + toggled: ActivePanelContext }, order: 5 }); MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { - group: '2_workbench_layout', + group: '3_workbench_layout_move', command: { id: TogglePanelPositionAction.ID, - title: TogglePanelPositionAction.LABEL + title: TogglePanelPositionAction.MOVE_TO_RIGHT_LABEL }, - order: 3 + when: PanelPositionContext.isEqualTo('bottom'), + order: 5 +}); + +MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { + group: '3_workbench_layout_move', + command: { + id: TogglePanelPositionAction.ID, + title: TogglePanelPositionAction.MOVE_TO_BOTTOM_LABEL + }, + when: PanelPositionContext.isEqualTo('right'), + order: 5 }); diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index 01ef6886d13..88407e62b5e 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -27,7 +27,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; import { Emitter, Event } from 'vs/base/common/event'; import { Button } from 'vs/base/browser/ui/button/button'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import Severity from 'vs/base/common/severity'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -97,7 +97,7 @@ type Visibilities = { customButton?: boolean; }; -class QuickInput implements IQuickInput { +class QuickInput extends Disposable implements IQuickInput { private _title: string; private _steps: number; @@ -109,18 +109,17 @@ class QuickInput implements IQuickInput { private _ignoreFocusOut = false; private _buttons: IQuickInputButton[] = []; private buttonsUpdated = false; - private onDidTriggerButtonEmitter = new Emitter(); - private onDidHideEmitter = new Emitter(); + private readonly onDidTriggerButtonEmitter = this._register(new Emitter()); + private readonly onDidHideEmitter = this._register(new Emitter()); - protected visibleDisposables: IDisposable[] = []; - protected disposables: IDisposable[] = [ - this.onDidTriggerButtonEmitter, - this.onDidHideEmitter, - ]; + protected readonly visibleDisposables = this._register(new DisposableStore()); private busyDelay: TimeoutTimer | null; - constructor(protected ui: QuickInputUI) { + constructor( + protected ui: QuickInputUI + ) { + super(); } get title() { @@ -202,7 +201,7 @@ class QuickInput implements IQuickInput { if (this.visible) { return; } - this.visibleDisposables.push( + this.visibleDisposables.add( this.ui.onDidTriggerButton(button => { if (this.buttons.indexOf(button) !== -1) { this.onDidTriggerButtonEmitter.fire(button); @@ -223,7 +222,7 @@ class QuickInput implements IQuickInput { didHide(): void { this.visible = false; - this.visibleDisposables = dispose(this.visibleDisposables); + this.visibleDisposables.clear(); this.onDidHideEmitter.fire(); } @@ -317,7 +316,7 @@ class QuickInput implements IQuickInput { public dispose(): void { this.hide(); - this.disposables = dispose(this.disposables); + super.dispose(); } } @@ -327,9 +326,9 @@ class QuickPick extends QuickInput implements IQuickPi private _value = ''; private _placeholder: string; - private onDidChangeValueEmitter = new Emitter(); - private onDidAcceptEmitter = new Emitter(); - private onDidCustomEmitter = new Emitter(); + private readonly onDidChangeValueEmitter = this._register(new Emitter()); + private readonly onDidAcceptEmitter = this._register(new Emitter()); + private readonly onDidCustomEmitter = this._register(new Emitter()); private _items: Array = []; private itemsUpdated = false; private _canSelectMany = false; @@ -340,12 +339,12 @@ class QuickPick extends QuickInput implements IQuickPi private _activeItems: T[] = []; private activeItemsUpdated = false; private activeItemsToConfirm: T[] | null = []; - private onDidChangeActiveEmitter = new Emitter(); + private readonly onDidChangeActiveEmitter = this._register(new Emitter()); private _selectedItems: T[] = []; private selectedItemsUpdated = false; private selectedItemsToConfirm: T[] | null = []; - private onDidChangeSelectionEmitter = new Emitter(); - private onDidTriggerItemButtonEmitter = new Emitter>(); + private readonly onDidChangeSelectionEmitter = this._register(new Emitter()); + private readonly onDidTriggerItemButtonEmitter = this._register(new Emitter>()); private _valueSelection: Readonly<[number, number]>; private valueSelectionUpdated = true; private _validationMessage: string; @@ -356,17 +355,6 @@ class QuickPick extends QuickInput implements IQuickPi quickNavigate: IQuickNavigateConfiguration; - constructor(ui: QuickInputUI) { - super(ui); - this.disposables.push( - this.onDidChangeValueEmitter, - this.onDidAcceptEmitter, - this.onDidCustomEmitter, - this.onDidChangeActiveEmitter, - this.onDidChangeSelectionEmitter, - this.onDidTriggerItemButtonEmitter, - ); - } get value() { return this._value; @@ -542,7 +530,7 @@ class QuickPick extends QuickInput implements IQuickPi show() { if (!this.visible) { - this.visibleDisposables.push( + this.visibleDisposables.add( this.ui.inputBox.onDidChange(value => { if (value === this.value) { return; @@ -551,105 +539,104 @@ class QuickPick extends QuickInput implements IQuickPi this.ui.list.filter(this.ui.inputBox.value); this.trySelectFirst(); this.onDidChangeValueEmitter.fire(value); - }), - this.ui.inputBox.onMouseDown(event => { - if (!this.autoFocusOnList) { - this.ui.list.clearFocus(); - } - }), - this.ui.inputBox.onKeyDown(event => { - switch (event.keyCode) { - case KeyCode.DownArrow: - this.ui.list.focus('Next'); - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - event.preventDefault(); - break; - case KeyCode.UpArrow: - if (this.ui.list.getFocusedElements().length) { - this.ui.list.focus('Previous'); - } else { - this.ui.list.focus('Last'); - } - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - event.preventDefault(); - break; - case KeyCode.PageDown: - if (this.ui.list.getFocusedElements().length) { - this.ui.list.focus('NextPage'); - } else { - this.ui.list.focus('First'); - } - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - event.preventDefault(); - break; - case KeyCode.PageUp: - if (this.ui.list.getFocusedElements().length) { - this.ui.list.focus('PreviousPage'); - } else { - this.ui.list.focus('Last'); - } - if (this.canSelectMany) { - this.ui.list.domFocus(); - } - event.preventDefault(); - break; - } - }), - this.ui.onDidAccept(() => { - if (!this.canSelectMany && this.activeItems[0]) { - this._selectedItems = [this.activeItems[0]]; - this.onDidChangeSelectionEmitter.fire(this.selectedItems); - } - this.onDidAcceptEmitter.fire(undefined); - }), - this.ui.onDidCustom(() => { - this.onDidCustomEmitter.fire(undefined); - }), - this.ui.list.onDidChangeFocus(focusedItems => { - if (this.activeItemsUpdated) { - return; // Expect another event. - } - if (this.activeItemsToConfirm !== this._activeItems && equals(focusedItems, this._activeItems, (a, b) => a === b)) { - return; - } - this._activeItems = focusedItems as T[]; - this.onDidChangeActiveEmitter.fire(focusedItems as T[]); - }), - this.ui.list.onDidChangeSelection(selectedItems => { - if (this.canSelectMany) { - if (selectedItems.length) { - this.ui.list.setSelectedElements([]); + })); + this.visibleDisposables.add(this.ui.inputBox.onMouseDown(event => { + if (!this.autoFocusOnList) { + this.ui.list.clearFocus(); + } + })); + this.visibleDisposables.add(this.ui.inputBox.onKeyDown(event => { + switch (event.keyCode) { + case KeyCode.DownArrow: + this.ui.list.focus('Next'); + if (this.canSelectMany) { + this.ui.list.domFocus(); } - return; - } - if (this.selectedItemsToConfirm !== this._selectedItems && equals(selectedItems, this._selectedItems, (a, b) => a === b)) { - return; - } - this._selectedItems = selectedItems as T[]; - this.onDidChangeSelectionEmitter.fire(selectedItems as T[]); + event.preventDefault(); + break; + case KeyCode.UpArrow: + if (this.ui.list.getFocusedElements().length) { + this.ui.list.focus('Previous'); + } else { + this.ui.list.focus('Last'); + } + if (this.canSelectMany) { + this.ui.list.domFocus(); + } + event.preventDefault(); + break; + case KeyCode.PageDown: + if (this.ui.list.getFocusedElements().length) { + this.ui.list.focus('NextPage'); + } else { + this.ui.list.focus('First'); + } + if (this.canSelectMany) { + this.ui.list.domFocus(); + } + event.preventDefault(); + break; + case KeyCode.PageUp: + if (this.ui.list.getFocusedElements().length) { + this.ui.list.focus('PreviousPage'); + } else { + this.ui.list.focus('Last'); + } + if (this.canSelectMany) { + this.ui.list.domFocus(); + } + event.preventDefault(); + break; + } + })); + this.visibleDisposables.add(this.ui.onDidAccept(() => { + if (!this.canSelectMany && this.activeItems[0]) { + this._selectedItems = [this.activeItems[0]]; + this.onDidChangeSelectionEmitter.fire(this.selectedItems); + } + this.onDidAcceptEmitter.fire(undefined); + })); + this.visibleDisposables.add(this.ui.onDidCustom(() => { + this.onDidCustomEmitter.fire(undefined); + })); + this.visibleDisposables.add(this.ui.list.onDidChangeFocus(focusedItems => { + if (this.activeItemsUpdated) { + return; // Expect another event. + } + if (this.activeItemsToConfirm !== this._activeItems && equals(focusedItems, this._activeItems, (a, b) => a === b)) { + return; + } + this._activeItems = focusedItems as T[]; + this.onDidChangeActiveEmitter.fire(focusedItems as T[]); + })); + this.visibleDisposables.add(this.ui.list.onDidChangeSelection(selectedItems => { + if (this.canSelectMany) { if (selectedItems.length) { - this.onDidAcceptEmitter.fire(undefined); + this.ui.list.setSelectedElements([]); } - }), - this.ui.list.onChangedCheckedElements(checkedItems => { - if (!this.canSelectMany) { - return; - } - if (this.selectedItemsToConfirm !== this._selectedItems && equals(checkedItems, this._selectedItems, (a, b) => a === b)) { - return; - } - this._selectedItems = checkedItems as T[]; - this.onDidChangeSelectionEmitter.fire(checkedItems as T[]); - }), - this.ui.list.onButtonTriggered(event => this.onDidTriggerItemButtonEmitter.fire(event as IQuickPickItemButtonEvent)), - this.registerQuickNavigation() - ); + return; + } + if (this.selectedItemsToConfirm !== this._selectedItems && equals(selectedItems, this._selectedItems, (a, b) => a === b)) { + return; + } + this._selectedItems = selectedItems as T[]; + this.onDidChangeSelectionEmitter.fire(selectedItems as T[]); + if (selectedItems.length) { + this.onDidAcceptEmitter.fire(undefined); + } + })); + this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(checkedItems => { + if (!this.canSelectMany) { + return; + } + if (this.selectedItemsToConfirm !== this._selectedItems && equals(checkedItems, this._selectedItems, (a, b) => a === b)) { + return; + } + this._selectedItems = checkedItems as T[]; + this.onDidChangeSelectionEmitter.fire(checkedItems as T[]); + })); + this.visibleDisposables.add(this.ui.list.onButtonTriggered(event => this.onDidTriggerItemButtonEmitter.fire(event as IQuickPickItemButtonEvent))); + this.visibleDisposables.add(this.registerQuickNavigation()); this.valueSelectionUpdated = true; } super.show(); // TODO: Why have show() bubble up while update() trickles down? (Could move setComboboxAccessibility() here.) @@ -784,16 +771,8 @@ class InputBox extends QuickInput implements IInputBox { private _prompt: string; private noValidationMessage = InputBox.noPromptMessage; private _validationMessage: string; - private onDidValueChangeEmitter = new Emitter(); - private onDidAcceptEmitter = new Emitter(); - - constructor(ui: QuickInputUI) { - super(ui); - this.disposables.push( - this.onDidValueChangeEmitter, - this.onDidAcceptEmitter, - ); - } + private readonly onDidValueChangeEmitter = this._register(new Emitter()); + private readonly onDidAcceptEmitter = this._register(new Emitter()); get value() { return this._value; @@ -849,22 +828,21 @@ class InputBox extends QuickInput implements IInputBox { this.update(); } - onDidChangeValue = this.onDidValueChangeEmitter.event; + readonly onDidChangeValue = this.onDidValueChangeEmitter.event; - onDidAccept = this.onDidAcceptEmitter.event; + readonly onDidAccept = this.onDidAcceptEmitter.event; show() { if (!this.visible) { - this.visibleDisposables.push( + this.visibleDisposables.add( this.ui.inputBox.onDidChange(value => { if (value === this.value) { return; } this._value = value; this.onDidValueChangeEmitter.fire(value); - }), - this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire(undefined)), - ); + })); + this.visibleDisposables.add(this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire(undefined))); this.valueSelectionUpdated = true; } super.show(); @@ -921,9 +899,9 @@ export class QuickInputService extends Component implements IQuickInputService { private inQuickOpenWidgets: Record = {}; private inQuickOpenContext: IContextKey; private contexts: { [id: string]: IContextKey; } = Object.create(null); - private onDidAcceptEmitter = this._register(new Emitter()); - private onDidCustomEmitter = this._register(new Emitter()); - private onDidTriggerButtonEmitter = this._register(new Emitter()); + private readonly onDidAcceptEmitter = this._register(new Emitter()); + private readonly onDidCustomEmitter = this._register(new Emitter()); + private readonly onDidTriggerButtonEmitter = this._register(new Emitter()); private keyMods: Writeable = { ctrlCmd: false, alt: false }; private controller: QuickInput | null = null; diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts index 919feb5f560..dc87e480152 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts @@ -8,25 +8,24 @@ import * as dom from 'vs/base/browser/dom'; import { InputBox, IRange, MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; import { inputBackground, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder } from 'vs/platform/theme/common/colorRegistry'; import { ITheme } from 'vs/platform/theme/common/themeService'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import Severity from 'vs/base/common/severity'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; const $ = dom.$; -export class QuickInputBox { +export class QuickInputBox extends Disposable { private container: HTMLElement; private inputBox: InputBox; - private disposables: IDisposable[] = []; constructor( private parent: HTMLElement ) { + super(); this.container = dom.append(this.parent, $('.quick-input-box')); - this.inputBox = new InputBox(this.container, undefined); - this.disposables.push(this.inputBox); + this.inputBox = this._register(new InputBox(this.container, undefined)); } onKeyDown = (handler: (event: StandardKeyboardEvent) => void): IDisposable => { @@ -129,8 +128,4 @@ export class QuickInputBox { inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder), }); } - - dispose() { - this.disposables = dispose(this.disposables); - } } diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputList.ts b/src/vs/workbench/browser/parts/quickinput/quickInputList.ts index 78c08462c11..0a983881471 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputList.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputList.ts @@ -6,7 +6,7 @@ import 'vs/css!./quickInput'; import { IListVirtualDelegate, IListRenderer } from 'vs/base/browser/ui/list/list'; import * as dom from 'vs/base/browser/dom'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { WorkbenchList } from 'vs/platform/list/browser/listService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IQuickPickItem, IQuickPickItemButtonEvent, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; @@ -211,7 +211,7 @@ class ListElementDelegate implements IListVirtualDelegate { } } -export class QuickInputList { +export class QuickInputList extends Disposable { readonly id: string; private container: HTMLElement; @@ -235,14 +235,14 @@ export class QuickInputList { private _onLeave = new Emitter(); onLeave: Event = this._onLeave.event; private _fireCheckedEvents = true; - private elementDisposables: IDisposable[] = []; - private disposables: IDisposable[] = []; + private readonly elementDisposables = this._register(new DisposableStore()); constructor( private parent: HTMLElement, id: string, @IInstantiationService private readonly instantiationService: IInstantiationService ) { + super(); this.id = id; this.container = dom.append(this.parent, $('.quick-input-list')); const delegate = new ListElementDelegate(); @@ -254,8 +254,8 @@ export class QuickInputList { horizontalScrolling: false } as IListOptions) as WorkbenchList; this.list.getHTMLElement().id = id; - this.disposables.push(this.list); - this.disposables.push(this.list.onKeyDown(e => { + this._register(this.list); + this._register(this.list.onKeyDown(e => { const event = new StandardKeyboardEvent(e); switch (event.keyCode) { case KeyCode.Space: @@ -282,13 +282,13 @@ export class QuickInputList { break; } })); - this.disposables.push(this.list.onMouseDown(e => { + this._register(this.list.onMouseDown(e => { if (e.browserEvent.button !== 2) { // Works around / fixes #64350. e.browserEvent.preventDefault(); } })); - this.disposables.push(dom.addDisposableListener(this.container, dom.EventType.CLICK, e => { + this._register(dom.addDisposableListener(this.container, dom.EventType.CLICK, e => { if (e.x || e.y) { // Avoid 'click' triggered by 'space' on checkbox. this._onLeave.fire(); } @@ -360,7 +360,7 @@ export class QuickInputList { } setElements(inputElements: Array): void { - this.elementDisposables = dispose(this.elementDisposables); + this.elementDisposables.clear(); const fireButtonTriggered = (event: IQuickPickItemButtonEvent) => this.fireButtonTriggered(event); this.inputElements = inputElements; this.elements = inputElements.reduce((result, item, index) => { @@ -379,7 +379,10 @@ export class QuickInputList { } return result; }, [] as ListElement[]); - this.elementDisposables.push(...this.elements.map(element => element.onChecked(() => this.fireCheckedEvents()))); + + for (const element of this.elements) { + this.elementDisposables.add(element.onChecked(() => this.fireCheckedEvents())); + } this.elementsToIndexes = this.elements.reduce((map, element, index) => { map.set(element.item, index); @@ -556,11 +559,6 @@ export class QuickInputList { return this.container.style.display !== 'none'; } - dispose() { - this.elementDisposables = dispose(this.elementDisposables); - this.disposables = dispose(this.disposables); - } - private fireCheckedEvents() { if (this._fireCheckedEvents) { this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()); diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 1070575c2be..bbda9af0401 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -17,25 +17,27 @@ import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiat import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntryAccessor } from 'vs/platform/statusbar/common/statusbar'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { Action } from 'vs/base/common/actions'; +import { Action, IAction } from 'vs/base/common/actions'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector, ThemeColor } from 'vs/platform/theme/common/themeService'; import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_FOREGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_NO_FOLDER_BORDER } from 'vs/workbench/common/theme'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { isThemeColor } from 'vs/editor/common/editorCommon'; import { Color } from 'vs/base/common/color'; -import { addClass, EventHelper, createStyleSheet, addDisposableListener, addClasses, clearNode, removeClass } from 'vs/base/browser/dom'; +import { addClass, EventHelper, createStyleSheet, addDisposableListener, addClasses, clearNode, removeClass, EventType } from 'vs/base/browser/dom'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { Parts, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { coalesce } from 'vs/base/common/arrays'; +import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; +import { ToggleStatusbarVisibilityAction } from 'vs/workbench/browser/actions/layoutActions'; interface PendingEntry { entry: IStatusbarEntry; alignment: StatusbarAlignment; priority: number; accessor?: IStatusbarEntryAccessor; } export class StatusbarPart extends Part implements IStatusbarService { - _serviceBrand: ServiceIdentifier; + _serviceBrand: ServiceIdentifier; private static readonly PRIORITY_PROP = 'statusbar-entry-priority'; private static readonly ALIGNMENT_PROP = 'statusbar-entry-alignment'; @@ -49,20 +51,24 @@ export class StatusbarPart extends Part implements IStatusbarService { //#endregion - private statusMessageDispose: IDisposable; private styleElement: HTMLStyleElement; private pendingEntries: PendingEntry[] = []; + private hideStatusBarAction: ToggleStatusbarVisibilityAction; + constructor( @IInstantiationService private readonly instantiationService: IInstantiationService, @IThemeService themeService: IThemeService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IStorageService storageService: IStorageService, - @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService + @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, + @IContextMenuService private contextMenuService: IContextMenuService ) { super(Parts.STATUSBAR_PART, { hasTitle: false }, themeService, storageService, layoutService); + this.hideStatusBarAction = this._register(this.instantiationService.createInstance(ToggleStatusbarVisibilityAction, ToggleStatusbarVisibilityAction.ID, nls.localize('hideStatusBar', "Hide Status Bar"))); + this.registerListeners(); } @@ -161,6 +167,9 @@ export class StatusbarPart extends Part implements IStatusbarService { createContentArea(parent: HTMLElement): HTMLElement { this.element = parent; + // Context menu support + this._register(addDisposableListener(parent, EventType.CONTEXT_MENU, e => this.showContextMenu(e))); + // Fill in initial items that were contributed from the registry const registry = Registry.as(Extensions.Statusbar); @@ -199,6 +208,39 @@ export class StatusbarPart extends Part implements IStatusbarService { return this.element; } + private showContextMenu(e: MouseEvent): void { + EventHelper.stop(e, true); + + const event = new StandardMouseEvent(e); + this.contextMenuService.showContextMenu({ + getAnchor: () => { return { x: event.posx, y: event.posy }; }, + getActions: () => this.getContextMenuActions() + }); + } + + private getContextMenuActions(): IAction[] { + const actions: IAction[] = []; + + // TODO@Ben collect more context menu actions + // .map(({ id, name, activityAction }) => ({ + // id, + // label: name || id, + // checked: this.isPinned(id), + // run: () => { + // if (this.isPinned(id)) { + // this.unpin(id); + // } else { + // this.pin(id, true); + // } + // } + // })); + // actions.push(new Separator()); + + actions.push(this.hideStatusBarAction); + + return actions; + } + updateStyles(): void { super.updateStyles(); @@ -242,44 +284,6 @@ export class StatusbarPart extends Part implements IStatusbarService { return el; } - setStatusMessage(message: string, autoDisposeAfter: number = -1, delayBy: number = 0): IDisposable { - - // Dismiss any previous - dispose(this.statusMessageDispose); - - // Create new - let statusMessageEntry: IStatusbarEntryAccessor; - let showHandle: any = setTimeout(() => { - statusMessageEntry = this.addEntry({ text: message }, StatusbarAlignment.LEFT, -Number.MAX_VALUE /* far right on left hand side */); - showHandle = null; - }, delayBy); - let hideHandle: any; - - // Dispose function takes care of timeouts and actual entry - const statusMessageDispose = { - dispose: () => { - if (showHandle) { - clearTimeout(showHandle); - } - - if (hideHandle) { - clearTimeout(hideHandle); - } - - if (statusMessageEntry) { - statusMessageEntry.dispose(); - } - } - }; - this.statusMessageDispose = statusMessageDispose; - - if (typeof autoDisposeAfter === 'number' && autoDisposeAfter > 0) { - hideHandle = setTimeout(() => statusMessageDispose.dispose(), autoDisposeAfter); - } - - return statusMessageDispose; - } - layout(width: number, height: number): void { super.layoutContents(width, height); } diff --git a/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css b/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css index a215bde753c..2b1d303976e 100644 --- a/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css +++ b/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css @@ -41,7 +41,7 @@ } /* Windows/Linux: Rules for custom title (icon, window controls) */ - +.monaco-workbench.web .part.titlebar, .monaco-workbench.windows .part.titlebar, .monaco-workbench.linux .part.titlebar { padding: 0; @@ -51,6 +51,7 @@ overflow: visible; } +.monaco-workbench.web .part.titlebar > .window-title, .monaco-workbench.windows .part.titlebar > .window-title, .monaco-workbench.linux .part.titlebar > .window-title { cursor: default; diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index 32a8c9905cc..f043222e860 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -13,7 +13,7 @@ import { IAction, Action } from 'vs/base/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import * as DOM from 'vs/base/browser/dom'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { isMacintosh, isLinux } from 'vs/base/common/platform'; +import { isMacintosh, isWeb } from 'vs/base/common/platform'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { Event, Emitter } from 'vs/base/common/event'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -38,17 +38,12 @@ import { withNullAsUndefined } from 'vs/base/common/types'; export class MenubarControl extends Disposable { private keys = [ - 'files.autoSave', 'window.menuBarVisibility', - 'editor.multiCursorModifier', - 'workbench.sideBar.location', - 'workbench.statusBar.visible', - 'workbench.activityBar.visible', 'window.enableMenuBarMnemonics', 'window.nativeTabs' ]; - private topLevelMenus: { + private menus: { 'File': IMenu; 'Edit': IMenu; 'Selection': IMenu; @@ -77,6 +72,7 @@ export class MenubarControl extends Disposable { private container: HTMLElement; private recentlyOpened: IRecentlyOpened; private alwaysOnMnemonics: boolean; + private isNative: boolean; private readonly _onVisibilityChange: Emitter; private readonly _onFocusStateChange: Emitter; @@ -103,7 +99,9 @@ export class MenubarControl extends Disposable { super(); - this.topLevelMenus = { + this.isNative = !isWeb && (isMacintosh || this.currentTitlebarStyleSetting !== 'custom'); + + this.menus = { 'File': this._register(this.menuService.createMenu(MenuId.MenubarFileMenu, this.contextKeyService)), 'Edit': this._register(this.menuService.createMenu(MenuId.MenubarEditMenu, this.contextKeyService)), 'Selection': this._register(this.menuService.createMenu(MenuId.MenubarSelectionMenu, this.contextKeyService)), @@ -114,8 +112,8 @@ export class MenubarControl extends Disposable { 'Help': this._register(this.menuService.createMenu(MenuId.MenubarHelpMenu, this.contextKeyService)) }; - if (isMacintosh) { - this.topLevelMenus['Preferences'] = this._register(this.menuService.createMenu(MenuId.MenubarPreferencesMenu, this.contextKeyService)); + if (isMacintosh && this.isNative) { + this.menus['Preferences'] = this._register(this.menuService.createMenu(MenuId.MenubarPreferencesMenu, this.contextKeyService)); } this.menuUpdater = this._register(new RunOnceScheduler(() => this.doUpdateMenubar(false), 200)); @@ -123,9 +121,9 @@ export class MenubarControl extends Disposable { this._onVisibilityChange = this._register(new Emitter()); this._onFocusStateChange = this._register(new Emitter()); - if (isMacintosh || this.currentTitlebarStyleSetting !== 'custom') { - for (const topLevelMenuName of Object.keys(this.topLevelMenus)) { - const menu = this.topLevelMenus[topLevelMenuName]; + if (this.isNative) { + for (const topLevelMenuName of Object.keys(this.topLevelTitles)) { + const menu = this.menus[topLevelMenuName]; if (menu) { this._register(menu.onDidChange(() => this.updateMenubar())); } @@ -135,13 +133,11 @@ export class MenubarControl extends Disposable { this.windowService.getRecentlyOpened().then((recentlyOpened) => { this.recentlyOpened = recentlyOpened; - if (isMacintosh || this.currentTitlebarStyleSetting !== 'custom') { + if (this.isNative) { this.doUpdateMenubar(true); } }); - this.notifyExistingLinuxUser(); - this.notifyUserOfCustomMenubarAccessibility(); this.registerListeners(); @@ -156,28 +152,6 @@ export class MenubarControl extends Disposable { return enableMenuBarMnemonics; } - private get currentSidebarPosition(): string { - return this.configurationService.getValue('workbench.sideBar.location'); - } - - private get currentStatusBarVisibility(): boolean { - let setting = this.configurationService.getValue('workbench.statusBar.visible'); - if (typeof setting !== 'boolean') { - setting = true; - } - - return setting; - } - - private get currentActivityBarVisibility(): boolean { - let setting = this.configurationService.getValue('workbench.activityBar.visible'); - if (typeof setting !== 'boolean') { - setting = true; - } - - return setting; - } - private get currentMenubarVisibility(): MenuBarVisibility { return this.configurationService.getValue('window.menuBarVisibility'); } @@ -214,38 +188,8 @@ export class MenubarControl extends Disposable { }); } - // TODO@sbatten remove after feb19 - private notifyExistingLinuxUser(): void { - if (!isLinux) { - return; - } - - const isNewUser = !this.storageService.get('telemetry.lastSessionDate', StorageScope.GLOBAL); - const hasBeenNotified = this.storageService.getBoolean('menubar/linuxTitlebarRevertNotified', StorageScope.GLOBAL, false); - const titleBarConfiguration = this.configurationService.inspect('window.titleBarStyle'); - const customShown = getTitleBarStyle(this.configurationService, this.environmentService) === 'custom'; - - if (!hasBeenNotified) { - this.storageService.store('menubar/linuxTitlebarRevertNotified', true, StorageScope.GLOBAL); - } - - if (isNewUser || hasBeenNotified || (titleBarConfiguration && titleBarConfiguration.user) || customShown) { - return; - } - - const message = nls.localize('menubar.linuxTitlebarRevertNotification', "We have updated the default title bar on Linux to use the native setting. If you prefer, you can go back to the custom setting. More information is available in our [online documentation](https://go.microsoft.com/fwlink/?linkid=2074137)."); - this.notificationService.prompt(Severity.Info, message, [ - { - label: nls.localize('goToSetting', "Open Settings"), - run: () => { - return this.preferencesService.openGlobalSettings(undefined, { query: 'window.titleBarStyle' }); - } - } - ]); - } - private notifyUserOfCustomMenubarAccessibility(): void { - if (isMacintosh) { + if (isWeb || isMacintosh) { return; } @@ -285,7 +229,7 @@ export class MenubarControl extends Disposable { this._register(this.keybindingService.onDidUpdateKeybindings(() => this.updateMenubar())); // These listeners only apply when the custom menubar is being used - if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') { + if (!this.isNative) { // Listen for window focus changes this._register(this.windowService.onDidChangeFocus(e => this.onDidChangeWindowFocus(e))); @@ -301,7 +245,7 @@ export class MenubarControl extends Disposable { } private doUpdateMenubar(firstTime: boolean): void { - if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') { + if (!this.isNative) { this.setupCustomMenubar(firstTime); } else { // Send menus to main process to be rendered by Electron @@ -319,30 +263,6 @@ export class MenubarControl extends Disposable { private calculateActionLabel(action: IAction | IMenubarMenuItemAction): string { let label = action.label; switch (action.id) { - case 'workbench.action.toggleSidebarPosition': - if (this.currentSidebarPosition !== 'right') { - label = nls.localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right"); - } else { - label = nls.localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left"); - } - break; - - case 'workbench.action.toggleStatusbarVisibility': - if (this.currentStatusBarVisibility) { - label = nls.localize({ key: 'miHideStatusbar', comment: ['&& denotes a mnemonic'] }, "&&Hide Status Bar"); - } else { - label = nls.localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "&&Show Status Bar"); - } - break; - - case 'workbench.action.toggleActivityBarVisibility': - if (this.currentActivityBarVisibility) { - label = nls.localize({ key: 'miHideActivityBar', comment: ['&& denotes a mnemonic'] }, "Hide &&Activity Bar"); - } else { - label = nls.localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"); - } - break; - default: break; } @@ -469,7 +389,7 @@ export class MenubarControl extends Disposable { break; case 'workbench.action.showAboutDialog': - if (!isMacintosh) { + if (!isMacintosh && !isWeb) { const updateAction = this.getUpdateAction(); if (updateAction) { updateAction.label = mnemonicMenuLabel(updateAction.label); @@ -509,7 +429,7 @@ export class MenubarControl extends Disposable { } // Update the menu actions - const updateActions = (menu: IMenu, target: IAction[]) => { + const updateActions = (menu: IMenu, target: IAction[], topLevelTitle: string) => { target.splice(0); let groups = menu.getActions(); for (let group of groups) { @@ -518,11 +438,20 @@ export class MenubarControl extends Disposable { for (let action of actions) { this.insertActionsBefore(action, target); if (action instanceof SubmenuItemAction) { - const submenu = this.menuService.createMenu(action.item.submenu, this.contextKeyService); + if (!this.menus[action.item.submenu]) { + this.menus[action.item.submenu] = this.menuService.createMenu(action.item.submenu, this.contextKeyService); + const submenu = this.menus[action.item.submenu]; + this._register(submenu!.onDidChange(() => { + const actions: IAction[] = []; + updateActions(menu, actions, topLevelTitle); + this.menubar.updateMenu({ actions: actions, label: mnemonicMenuLabel(this.topLevelTitles[topLevelTitle]) }); + }, this)); + } + + const submenu = this.menus[action.item.submenu]!; const submenuActions: SubmenuAction[] = []; - updateActions(submenu, submenuActions); + updateActions(submenu, submenuActions, topLevelTitle); target.push(new SubmenuAction(mnemonicMenuLabel(action.label), submenuActions)); - submenu.dispose(); } else { action.label = mnemonicMenuLabel(this.calculateActionLabel(action)); target.push(action); @@ -535,19 +464,19 @@ export class MenubarControl extends Disposable { target.pop(); }; - for (const title of Object.keys(this.topLevelMenus)) { - const menu = this.topLevelMenus[title]; + for (const title of Object.keys(this.topLevelTitles)) { + const menu = this.menus[title]; if (firstTime && menu) { this._register(menu.onDidChange(() => { const actions: IAction[] = []; - updateActions(menu, actions); + updateActions(menu, actions, title); this.menubar.updateMenu({ actions: actions, label: mnemonicMenuLabel(this.topLevelTitles[title]) }); })); } const actions: IAction[] = []; if (menu) { - updateActions(menu, actions); + updateActions(menu, actions, title); } if (!firstTime) { @@ -588,6 +517,12 @@ export class MenubarControl extends Disposable { if (menuItem instanceof SubmenuItemAction) { const submenu = { items: [] }; + + if (!this.menus[menuItem.item.submenu]) { + this.menus[menuItem.item.submenu] = this.menuService.createMenu(menuItem.item.submenu, this.contextKeyService); + this._register(this.menus[menuItem.item.submenu]!.onDidChange(() => this.updateMenubar())); + } + const menuToDispose = this.menuService.createMenu(menuItem.item.submenu, this.contextKeyService); this.populateMenuItems(menuToDispose, submenu, keybindings); @@ -634,7 +569,7 @@ export class MenubarControl extends Disposable { private getAdditionalKeybindings(): { [id: string]: IMenubarKeybinding } { const keybindings = {}; - if (isMacintosh) { + if (isMacintosh && this.isNative) { keybindings['workbench.action.quit'] = (this.getMenubarKeybinding('workbench.action.quit')); } @@ -647,8 +582,8 @@ export class MenubarControl extends Disposable { } menubarData.keybindings = this.getAdditionalKeybindings(); - for (const topLevelMenuName of Object.keys(this.topLevelMenus)) { - const menu = this.topLevelMenus[topLevelMenuName]; + for (const topLevelMenuName of Object.keys(this.topLevelTitles)) { + const menu = this.menus[topLevelMenuName]; if (menu) { const menubarMenu: IMenubarMenu = { items: [] }; this.populateMenuItems(menu, menubarMenu, menubarData.keybindings); @@ -695,7 +630,7 @@ export class MenubarControl extends Disposable { // Build the menubar if (this.container) { - if (!isMacintosh && this.currentTitlebarStyleSetting === 'custom') { + if (!this.isNative) { this.doUpdateMenubar(true); } } diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index fa0315de8f5..a84eee1af52 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -22,7 +22,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_BACKGROUND, TITLE_BAR_BORDER } from 'vs/workbench/common/theme'; -import { isMacintosh, isWindows, isLinux } from 'vs/base/common/platform'; +import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { Color } from 'vs/base/common/color'; import { trim } from 'vs/base/common/strings'; @@ -50,8 +50,8 @@ export class TitlebarPart extends Part implements ITitleService { readonly minimumWidth: number = 0; readonly maximumWidth: number = Number.POSITIVE_INFINITY; - get minimumHeight(): number { return isMacintosh ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } - get maximumHeight(): number { return isMacintosh ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } + get minimumHeight(): number { return isMacintosh && !isWeb ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } + get maximumHeight(): number { return isMacintosh && !isWeb ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } //#endregion @@ -135,9 +135,9 @@ export class TitlebarPart extends Part implements ITitleService { } private onMenubarVisibilityChanged(visible: boolean) { - if (isWindows || isLinux) { + if (isWeb || isWindows || isLinux) { // Hide title when toggling menu bar - if (this.configurationService.getValue('window.menuBarVisibility') === 'toggle' && visible) { + if (!isWeb && this.configurationService.getValue('window.menuBarVisibility') === 'toggle' && visible) { // Hack to fix issue #52522 with layered webkit-app-region elements appearing under cursor hide(this.dragRegion); setTimeout(() => show(this.dragRegion), 50); @@ -150,7 +150,7 @@ export class TitlebarPart extends Part implements ITitleService { } private onMenubarFocusChanged(focused: boolean) { - if (isWindows || isLinux) { + if (!isWeb && (isWindows || isLinux)) { if (focused) { hide(this.dragRegion); } else { @@ -207,7 +207,7 @@ export class TitlebarPart extends Part implements ITitleService { this.pendingTitle = title; } - if ((isWindows || isLinux) && this.title) { + if ((isWeb || isWindows || isLinux) && this.title) { if (this.lastLayoutDimensions) { this.updateLayout(this.lastLayoutDimensions); } @@ -322,10 +322,12 @@ export class TitlebarPart extends Part implements ITitleService { this.element = parent; // Draggable region that we can manipulate for #52522 - this.dragRegion = append(this.element, $('div.titlebar-drag-region')); + if (!isWeb) { + this.dragRegion = append(this.element, $('div.titlebar-drag-region')); + } - // App Icon (Windows/Linux) - if (!isMacintosh) { + // App Icon (Native Windows/Linux) + if (!isMacintosh && !isWeb) { this.appIcon = append(this.element, $('div.window-appicon')); this.onUpdateAppIconDragBehavior(); @@ -341,7 +343,7 @@ export class TitlebarPart extends Part implements ITitleService { this.menubarPart.create(this.menubar); - if (!isMacintosh) { + if (!isMacintosh || isWeb) { this._register(this.menubarPart.onVisibilityChange(e => this.onMenubarVisibilityChanged(e))); this._register(this.menubarPart.onFocusStateChange(e => this.onMenubarFocusChanged(e))); } @@ -355,7 +357,7 @@ export class TitlebarPart extends Part implements ITitleService { } // Maximize/Restore on doubleclick - if (isMacintosh) { + if (isMacintosh && !isWeb) { this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => { EventHelper.stop(e); @@ -374,8 +376,8 @@ export class TitlebarPart extends Part implements ITitleService { })); }); - // Window Controls (Windows/Linux) - if (!isMacintosh) { + // Window Controls (Native Windows/Linux) + if (!isMacintosh && !isWeb) { this.windowControls = append(this.element, $('div.window-controls-container')); @@ -546,17 +548,24 @@ export class TitlebarPart extends Part implements ITitleService { } private adjustTitleMarginToCenter(): void { - if (!isMacintosh && - (this.appIcon.clientWidth + this.menubar.clientWidth + 10 > (this.element.clientWidth - this.title.clientWidth) / 2 || - this.element.clientWidth - this.windowControls.clientWidth - 10 < (this.element.clientWidth + this.title.clientWidth) / 2)) { - this.title.style.position = null; - this.title.style.left = null; - this.title.style.transform = null; - } else { - this.title.style.position = 'absolute'; - this.title.style.left = '50%'; - this.title.style.transform = 'translate(-50%, 0)'; + if (!isMacintosh || isWeb) { + const leftMarker = (this.appIcon ? this.appIcon.clientWidth : 0) + this.menubar.clientWidth + 10; + const rightMarker = this.element.clientWidth - (this.windowControls ? this.windowControls.clientWidth : 0) - 10; + + // Not enough space to center the titlebar within window, + // Center between menu and window controls + if (leftMarker > (this.element.clientWidth - this.title.clientWidth) / 2 || + rightMarker < (this.element.clientWidth + this.title.clientWidth) / 2) { + this.title.style.position = null; + this.title.style.left = null; + this.title.style.transform = null; + return; + } } + + this.title.style.position = 'absolute'; + this.title.style.left = '50%'; + this.title.style.transform = 'translate(-50%, 0)'; } updateLayout(dimension: Dimension): void { @@ -564,15 +573,15 @@ export class TitlebarPart extends Part implements ITitleService { if (getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') { // Only prevent zooming behavior on macOS or when the menubar is not visible - if (isMacintosh || this.configurationService.getValue('window.menuBarVisibility') === 'hidden') { + if ((!isWeb && isMacintosh) || this.configurationService.getValue('window.menuBarVisibility') === 'hidden') { this.title.style.zoom = `${1 / getZoomFactor()}`; - if (isWindows || isLinux) { + if (!isWeb && (isWindows || isLinux)) { this.appIcon.style.zoom = `${1 / getZoomFactor()}`; this.windowControls.style.zoom = `${1 / getZoomFactor()}`; } } else { this.title.style.zoom = null; - if (isWindows || isLinux) { + if (!isWeb && (isWindows || isLinux)) { this.appIcon.style.zoom = null; this.windowControls.style.zoom = null; } diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index db11dfab1ea..fcad87504db 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -60,9 +60,9 @@ export class CustomTreeViewPanel extends ViewletPanel { super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService); const { treeView } = (Registry.as(Extensions.ViewsRegistry).getView(options.id)); this.treeView = treeView; - this.treeView.onDidChangeActions(() => this.updateActions(), this, this.disposables); - this.disposables.push(toDisposable(() => this.treeView.setVisibility(false))); - this.disposables.push(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility())); + this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this)); + this._register(toDisposable(() => this.treeView.setVisibility(false))); + this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility())); this.updateTreeVisibility(); } @@ -98,11 +98,6 @@ export class CustomTreeViewPanel extends ViewletPanel { private updateTreeVisibility(): void { this.treeView.setVisibility(this.isBodyVisible()); } - - dispose(): void { - dispose(this.disposables); - super.dispose(); - } } class TitleMenus implements IDisposable { diff --git a/src/vs/workbench/browser/parts/views/panelViewlet.ts b/src/vs/workbench/browser/parts/views/panelViewlet.ts index ec1b456a8a1..982b5c906fc 100644 --- a/src/vs/workbench/browser/parts/views/panelViewlet.ts +++ b/src/vs/workbench/browser/parts/views/panelViewlet.ts @@ -46,16 +46,16 @@ export abstract class ViewletPanel extends Panel implements IView { private static AlwaysShowActionsConfig = 'workbench.view.alwaysShowHeaderActions'; - private _onDidFocus = new Emitter(); + private _onDidFocus = this._register(new Emitter()); readonly onDidFocus: Event = this._onDidFocus.event; - private _onDidBlur = new Emitter(); + private _onDidBlur = this._register(new Emitter()); readonly onDidBlur: Event = this._onDidBlur.event; - private _onDidChangeBodyVisibility = new Emitter(); + private _onDidChangeBodyVisibility = this._register(new Emitter()); readonly onDidChangeBodyVisibility: Event = this._onDidChangeBodyVisibility.event; - protected _onDidChangeTitleArea = new Emitter(); + protected _onDidChangeTitleArea = this._register(new Emitter()); readonly onDidChangeTitleArea: Event = this._onDidChangeTitleArea.event; private _isVisible: boolean = false; @@ -78,8 +78,6 @@ export abstract class ViewletPanel extends Panel implements IView { this.id = options.id; this.title = options.title; this.actionRunner = options.actionRunner; - - this.disposables.push(this._onDidFocus, this._onDidBlur, this._onDidChangeBodyVisibility, this._onDidChangeTitleArea); } setVisible(visible: boolean): void { @@ -113,9 +111,9 @@ export abstract class ViewletPanel extends Panel implements IView { super.render(); const focusTracker = trackFocus(this.element); - this.disposables.push(focusTracker); - this.disposables.push(focusTracker.onDidFocus(() => this._onDidFocus.fire())); - this.disposables.push(focusTracker.onDidBlur(() => this._onDidBlur.fire())); + this._register(focusTracker); + this._register(focusTracker.onDidFocus(() => this._onDidFocus.fire())); + this._register(focusTracker.onDidBlur(() => this._onDidBlur.fire())); } protected renderHeader(container: HTMLElement): void { @@ -132,11 +130,11 @@ export abstract class ViewletPanel extends Panel implements IView { actionRunner: this.actionRunner }); - this.disposables.push(this.toolbar); + this._register(this.toolbar); this.setActions(); const onDidRelevantConfigurationChange = Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration(ViewletPanel.AlwaysShowActionsConfig)); - onDidRelevantConfigurationChange(this.updateActionsVisibility, this, this.disposables); + this._register(onDidRelevantConfigurationChange(this.updateActionsVisibility, this)); this.updateActionsVisibility(); } diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts index 8db78ac9953..24bc347c337 100644 --- a/src/vs/workbench/browser/style.ts +++ b/src/vs/workbench/browser/style.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./media/style'; +import 'vs/css!./media/icons'; import { registerThemingParticipant, ITheme, ICssStyleCollector, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry'; diff --git a/src/vs/workbench/browser/web.simpleservices.ts b/src/vs/workbench/browser/web.simpleservices.ts index 49385f06a2e..848865e1803 100644 --- a/src/vs/workbench/browser/web.simpleservices.ts +++ b/src/vs/workbench/browser/web.simpleservices.ts @@ -629,6 +629,7 @@ export class SimpleCommentService implements ICommentService { unregisterCommentController: any; getCommentController: any; createCommentThreadTemplate: any; + updateCommentThreadTemplate: any; getCommentMenus: any; registerDataProvider: any; unregisterDataProvider: any; diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 696f351bc09..07fe800bd64 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -180,6 +180,12 @@ import { isMacintosh } from 'vs/base/common/platform'; 'default': true, 'description': nls.localize('activityBarVisibility', "Controls the visibility of the activity bar in the workbench.") }, + // TODO @misolori remove before shipping stable + 'workbench.iconExploration.enabled': { + 'type': 'boolean', + 'default': false, + 'description': nls.localize('iconExplorationEnabled', "Controls the visibility of the icon exploration in the workbench.") + }, 'workbench.view.alwaysShowHeaderActions': { 'type': 'boolean', 'default': false, diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index 8c79c0e728a..54b078b2755 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -260,6 +260,7 @@ export class Workbench extends Layout { const workbenchClasses = coalesce([ 'monaco-workbench', platformClass, + isWeb ? 'web' : undefined, this.state.sideBar.hidden ? 'nosidebar' : undefined, this.state.panel.hidden ? 'nopanel' : undefined, this.state.statusBar.hidden ? 'nostatusbar' : undefined, diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 6915bca4890..fff5882b5da 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -33,6 +33,7 @@ export const ActiveEditorGroupEmptyContext = new RawContextKey('activeE export const MultipleEditorGroupsContext = new RawContextKey('multipleEditorGroups', false); export const SingleEditorGroupsContext = MultipleEditorGroupsContext.toNegated(); export const InEditorZenModeContext = new RawContextKey('inZenMode', false); +export const IsCenteredLayoutContext = new RawContextKey('isCenteredLayout', false); export const SplitEditorsVertically = new RawContextKey('splitEditorsVertically', false); /** diff --git a/src/vs/workbench/common/notifications.ts b/src/vs/workbench/common/notifications.ts index c7ddc318215..e4718e06f67 100644 --- a/src/vs/workbench/common/notifications.ts +++ b/src/vs/workbench/common/notifications.ts @@ -3,10 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INotification, INotificationHandle, INotificationActions, INotificationProgress, NoOpNotification, Severity, NotificationMessage, IPromptChoice } from 'vs/platform/notification/common/notification'; +import { INotification, INotificationHandle, INotificationActions, INotificationProgress, NoOpNotification, Severity, NotificationMessage, IPromptChoice, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { toErrorMessage } from 'vs/base/common/errorMessage'; import { Event, Emitter } from 'vs/base/common/event'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { isPromiseCanceledError } from 'vs/base/common/errors'; import { Action } from 'vs/base/common/actions'; import { isErrorWithActions } from 'vs/base/common/errorsWithActions'; @@ -15,10 +15,25 @@ import { localize } from 'vs/nls'; export interface INotificationsModel { + // + // Notifications as Toasts/Center + // + readonly notifications: INotificationViewItem[]; + readonly onDidNotificationChange: Event; - notify(notification: INotification): INotificationHandle; + addNotification(notification: INotification): INotificationHandle; + + // + // Notifications as Status + // + + readonly statusMessage: IStatusMessageViewItem | undefined; + + readonly onDidStatusMessageChange: Event; + + showStatusMessage(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable; } export const enum NotificationChangeType { @@ -45,6 +60,29 @@ export interface INotificationChangeEvent { kind: NotificationChangeType; } +export const enum StatusMessageChangeType { + ADD, + REMOVE +} + +export interface IStatusMessageViewItem { + message: string; + options?: IStatusMessageOptions; +} + +export interface IStatusMessageChangeEvent { + + /** + * The status message item this change is about. + */ + item: IStatusMessageViewItem; + + /** + * The kind of status message change. + */ + kind: StatusMessageChangeType; +} + export class NotificationHandle implements INotificationHandle { private readonly _onDidClose: Emitter = new Emitter(); @@ -90,13 +128,16 @@ export class NotificationsModel extends Disposable implements INotificationsMode private readonly _onDidNotificationChange: Emitter = this._register(new Emitter()); get onDidNotificationChange(): Event { return this._onDidNotificationChange.event; } + private readonly _onDidStatusMessageChange: Emitter = this._register(new Emitter()); + get onDidStatusMessageChange(): Event { return this._onDidStatusMessageChange.event; } + private readonly _notifications: INotificationViewItem[] = []; + get notifications(): INotificationViewItem[] { return this._notifications; } - get notifications(): INotificationViewItem[] { - return this._notifications; - } + private _statusMessage: IStatusMessageViewItem | undefined; + get statusMessage(): IStatusMessageViewItem | undefined { return this._statusMessage; } - notify(notification: INotification): INotificationHandle { + addNotification(notification: INotification): INotificationHandle { const item = this.createViewItem(notification); if (!item) { return NotificationsModel.NO_OP_NOTIFICATION; // return early if this is a no-op @@ -174,6 +215,26 @@ export class NotificationsModel extends Disposable implements INotificationsMode return item; } + + showStatusMessage(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable { + const item = StatusMessageViewItem.create(message, options); + if (!item) { + return Disposable.None; + } + + // Remember as current status message and fire events + this._statusMessage = item; + this._onDidStatusMessageChange.fire({ kind: StatusMessageChangeType.ADD, item }); + + return toDisposable(() => { + + // Only reset status message if the item is still the one we had remembered + if (this._statusMessage === item) { + this._statusMessage = undefined; + this._onDidStatusMessageChange.fire({ kind: StatusMessageChangeType.REMOVE, item }); + } + }); + } } export interface INotificationViewItem { @@ -621,4 +682,26 @@ export class ChoiceAction extends Action { this._onDidRun.dispose(); } +} + +class StatusMessageViewItem { + + static create(notification: NotificationMessage, options?: IStatusMessageOptions): IStatusMessageViewItem | null { + if (!notification || isPromiseCanceledError(notification)) { + return null; // we need a message to show + } + + let message: string | undefined; + if (notification instanceof Error) { + message = toErrorMessage(notification, false); + } else if (typeof notification === 'string') { + message = notification; + } + + if (!message) { + return null; // we need a message to show + } + + return { message, options }; + } } \ No newline at end of file diff --git a/src/vs/workbench/common/panel.ts b/src/vs/workbench/common/panel.ts index 628846c404a..7b836be9552 100644 --- a/src/vs/workbench/common/panel.ts +++ b/src/vs/workbench/common/panel.ts @@ -8,5 +8,6 @@ import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; export const ActivePanelContext = new RawContextKey('activePanel', ''); export const PanelFocusContext = new RawContextKey('panelFocus', false); +export const PanelPositionContext = new RawContextKey('panelPosition', 'bottom'); export interface IPanel extends IComposite { } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 28f9f461c70..51139cefce6 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -11,7 +11,7 @@ import { ITreeViewDataProvider } from 'vs/workbench/common/views'; import { localize } from 'vs/nls'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { values, keys } from 'vs/base/common/map'; import { Registry } from 'vs/platform/registry/common/platform'; @@ -71,12 +71,12 @@ export class ViewContainer { protected constructor(readonly id: string, readonly hideIfEmpty: boolean, readonly extensionId?: ExtensionIdentifier) { } } -class ViewContainersRegistryImpl implements IViewContainersRegistry { +class ViewContainersRegistryImpl extends Disposable implements IViewContainersRegistry { - private readonly _onDidRegister = new Emitter(); + private readonly _onDidRegister = this._register(new Emitter()); readonly onDidRegister: Event = this._onDidRegister.event; - private readonly _onDidDeregister = new Emitter(); + private readonly _onDidDeregister = this._register(new Emitter()); readonly onDidDeregister: Event = this._onDidDeregister.event; private viewContainers: Map = new Map(); @@ -169,15 +169,15 @@ export interface IViewsRegistry { getViewContainer(id: string): ViewContainer | null; } -class ViewsRegistry implements IViewsRegistry { +class ViewsRegistry extends Disposable implements IViewsRegistry { - private readonly _onViewsRegistered: Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = new Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }>(); + private readonly _onViewsRegistered: Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = this._register(new Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }>()); readonly onViewsRegistered: Event<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = this._onViewsRegistered.event; - private readonly _onViewsDeregistered: Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = new Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }>(); + private readonly _onViewsDeregistered: Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = this._register(new Emitter<{ views: IViewDescriptor[], viewContainer: ViewContainer }>()); readonly onViewsDeregistered: Event<{ views: IViewDescriptor[], viewContainer: ViewContainer }> = this._onViewsDeregistered.event; - private readonly _onDidChangeContainer: Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }> = new Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }>(); + private readonly _onDidChangeContainer: Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }> = this._register(new Emitter<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }>()); readonly onDidChangeContainer: Event<{ views: IViewDescriptor[], from: ViewContainer, to: ViewContainer }> = this._onDidChangeContainer.event; private _viewContainers: ViewContainer[] = []; diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts index b949e001a30..5fac853caaa 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts @@ -9,7 +9,7 @@ import { Widget } from 'vs/base/browser/ui/widget'; import { Color } from 'vs/base/common/color'; import { Emitter, Event } from 'vs/base/common/event'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable } from 'vs/base/common/lifecycle'; import { mixin } from 'vs/base/common/objects'; import { isMacintosh } from 'vs/base/common/platform'; import { URI as uri } from 'vs/base/common/uri'; @@ -103,7 +103,6 @@ export class SuggestEnabledInput extends Widget implements IThemable { private _onInputDidChange = new Emitter(); readonly onInputDidChange: Event = this._onInputDidChange.event; - private disposables: IDisposable[] = []; private readonly inputWidget: CodeEditorWidget; private readonly inputModel: ITextModel; private stylingContainer: HTMLDivElement; @@ -134,31 +133,31 @@ export class SuggestEnabledInput extends Widget implements IThemable { contributions: [SuggestController, SnippetController2, ContextMenuController, MenuPreventer, SelectionClipboard], isSimpleWidget: true, }); - this.disposables.push(this.inputWidget); + this._register(this.inputWidget); let scopeHandle = uri.parse(resourceHandle); this.inputModel = modelService.createModel('', null, scopeHandle, true); this.inputWidget.setModel(this.inputModel); - this.disposables.push(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses + this._register(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses - this.disposables.push((this.inputWidget.onDidFocusEditorText(() => { + this._register((this.inputWidget.onDidFocusEditorText(() => { if (options.focusContextKey) { options.focusContextKey.set(true); } addClass(this.stylingContainer, 'synthetic-focus'); }))); - this.disposables.push((this.inputWidget.onDidBlurEditorText(() => { + this._register((this.inputWidget.onDidBlurEditorText(() => { if (options.focusContextKey) { options.focusContextKey.set(false); } removeClass(this.stylingContainer, 'synthetic-focus'); }))); const onKeyDownMonaco = Event.chain(this.inputWidget.onKeyDown); - onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this, this.disposables); - onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this, this.disposables); + this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this)); + this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this)); let preexistingContent = this.getValue(); const inputWidgetModel = this.inputWidget.getModel(); if (inputWidgetModel) { - this.disposables.push(inputWidgetModel.onDidChangeContent(() => { + this._register(inputWidgetModel.onDidChangeContent(() => { let content = this.getValue(); this.placeholderText.style.visibility = content ? 'hidden' : 'visible'; if (preexistingContent.trim() === content.trim()) { return; } @@ -175,7 +174,7 @@ export class SuggestEnabledInput extends Widget implements IThemable { this.setValue(options.value || ''); - this.disposables.push(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, { + this._register(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, { triggerCharacters: validatedSuggestProvider.triggerCharacters, provideCompletionItems: (model: ITextModel, position: Position, _context: modes.CompletionContext) => { let query = model.getValue(); @@ -249,11 +248,6 @@ export class SuggestEnabledInput extends Widget implements IThemable { private selectAll(): void { this.inputWidget.setSelection(new Range(1, 1, 1, this.getValue().length + 1)); } - - dispose(): void { - this.disposables = dispose(this.disposables); - super.dispose(); - } } // Override styles in selections.ts diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts index 96576810093..a7dc0be703a 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.ts @@ -36,7 +36,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { group: '5_editor', command: { id: ToggleMinimapAction.ID, - title: nls.localize({ key: 'miToggleMinimap', comment: ['&& denotes a mnemonic'] }, "Toggle &&Minimap"), + title: nls.localize({ key: 'miShowMinimap', comment: ['&& denotes a mnemonic'] }, "Show &&Minimap"), toggled: ContextKeyExpr.equals('config.editor.minimap.enabled', true) }, order: 2 diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts index ce2765e5efe..23410b162b6 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.ts @@ -37,8 +37,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { group: '5_editor', command: { id: ToggleRenderControlCharacterAction.ID, - title: nls.localize({ key: 'miToggleRenderControlCharacters', comment: ['&& denotes a mnemonic'] }, "Toggle &&Control Characters"), + title: nls.localize({ key: 'miToggleRenderControlCharacters', comment: ['&& denotes a mnemonic'] }, "Render &&Control Characters"), toggled: ContextKeyExpr.equals('config.editor.renderControlCharacters', true) }, - order: 4 + order: 5 }); diff --git a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts index db5bbbf573f..e5181da5c2e 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts @@ -45,8 +45,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { group: '5_editor', command: { id: ToggleRenderWhitespaceAction.ID, - title: nls.localize({ key: 'miToggleRenderWhitespace', comment: ['&& denotes a mnemonic'] }, "Toggle &&Render Whitespace"), + title: nls.localize({ key: 'miToggleRenderWhitespace', comment: ['&& denotes a mnemonic'] }, "&&Render Whitespace"), toggled: ContextKeyExpr.notEquals('config.editor.renderWhitespace', 'none') }, - order: 3 + order: 4 }); diff --git a/src/vs/workbench/contrib/codeinset/common/codeInset.ts b/src/vs/workbench/contrib/codeinset/common/codeInset.ts deleted file mode 100644 index cb37c59d8f9..00000000000 --- a/src/vs/workbench/contrib/codeinset/common/codeInset.ts +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { ITextModel } from 'vs/editor/common/model'; -import { onUnexpectedExternalError } from 'vs/base/common/errors'; -import { mergeSort } from 'vs/base/common/arrays'; -import { Event } from 'vs/base/common/event'; -import { CancellationToken } from 'vs/base/common/cancellation'; -import { LanguageFeatureRegistry } from 'vs/editor/common/modes/languageFeatureRegistry'; -import { ProviderResult } from 'vs/editor/common/modes'; -import { IRange } from 'vs/editor/common/core/range'; - -export interface ICodeInsetSymbol { - id: string; - range: IRange; - height?: number; -} - -export interface CodeInsetProvider { - onDidChange?: Event; - provideCodeInsets(model: ITextModel, token: CancellationToken): ProviderResult; - resolveCodeInset(model: ITextModel, codeInset: ICodeInsetSymbol, token: CancellationToken): ProviderResult; -} - -export const CodeInsetProviderRegistry = new LanguageFeatureRegistry(); - -export interface ICodeInsetData { - symbol: ICodeInsetSymbol; - provider: CodeInsetProvider; - resolved?: boolean; -} - -export function getCodeInsetData(model: ITextModel, token: CancellationToken): Promise { - - const symbols: ICodeInsetData[] = []; - const providers = CodeInsetProviderRegistry.ordered(model); - - const promises = providers.map(provider => - Promise.resolve(provider.provideCodeInsets(model, token)).then(result => { - if (Array.isArray(result)) { - for (let symbol of result) { - symbols.push({ symbol, provider }); - } - } - }).catch(onUnexpectedExternalError)); - - return Promise.all(promises).then(() => { - - return mergeSort(symbols, (a, b) => { - // sort by lineNumber, provider-rank, and column - if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { - return -1; - } else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { - return 1; - } else if (providers.indexOf(a.provider) < providers.indexOf(b.provider)) { - return -1; - } else if (providers.indexOf(a.provider) > providers.indexOf(b.provider)) { - return 1; - } else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { - return -1; - } else if (a.symbol.range.startColumn > b.symbol.range.startColumn) { - return 1; - } else { - return 0; - } - }); - }); -} diff --git a/src/vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution.ts b/src/vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution.ts deleted file mode 100644 index 8a8ef48b271..00000000000 --- a/src/vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution.ts +++ /dev/null @@ -1,353 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { CancelablePromise, createCancelablePromise, RunOnceScheduler } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { StableEditorScrollState } from 'vs/editor/browser/core/editorState'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; -import { CodeInsetProviderRegistry, getCodeInsetData, ICodeInsetData } from '../common/codeInset'; -import { CodeInsetWidget, CodeInsetHelper } from './codeInsetWidget'; -import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; -// import { localize } from 'vs/nls'; - -export class CodeInsetController implements editorCommon.IEditorContribution { - - static get(editor: editorBrowser.ICodeEditor): CodeInsetController { - return editor.getContribution(CodeInsetController.ID); - } - - private static readonly ID: string = 'css.editor.codeInset'; - - private _isEnabled: boolean; - - private _globalToDispose: IDisposable[]; - private _localToDispose: IDisposable[]; - private _insetWidgets: CodeInsetWidget[]; - private _pendingWebviews = new Map any>(); - private _currentFindCodeInsetSymbolsPromise: CancelablePromise | null; - private _modelChangeCounter: number; - private _currentResolveCodeInsetSymbolsPromise: CancelablePromise | null; - private _detectVisibleInsets: RunOnceScheduler; - - constructor( - private _editor: editorBrowser.ICodeEditor, - @IConfigurationService private readonly _configService: IConfigurationService, - ) { - this._isEnabled = this._configService.getValue('editor.codeInsets'); - - this._globalToDispose = []; - this._localToDispose = []; - this._insetWidgets = []; - this._currentFindCodeInsetSymbolsPromise = null; - this._modelChangeCounter = 0; - - this._globalToDispose.push(this._editor.onDidChangeModel(() => this._onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); - this._globalToDispose.push(this._configService.onDidChangeConfiguration(e => { - if (e.affectsConfiguration('editor.codeInsets')) { - let prevIsEnabled = this._isEnabled; - this._isEnabled = this._configService.getValue('editor.codeInsets'); - if (prevIsEnabled !== this._isEnabled) { - this._onModelChange(); - } - } - })); - this._globalToDispose.push(CodeInsetProviderRegistry.onDidChange(this._onModelChange, this)); - this._onModelChange(); - } - - dispose(): void { - this._localDispose(); - this._globalToDispose = dispose(this._globalToDispose); - } - - acceptWebview(symbolId: string, webviewElement: WebviewElement): boolean { - const pendingWebview = this._pendingWebviews.get(symbolId); - if (pendingWebview) { - pendingWebview(webviewElement); - this._pendingWebviews.delete(symbolId); - return true; - } - return false; - } - - private _localDispose(): void { - if (this._currentFindCodeInsetSymbolsPromise) { - this._currentFindCodeInsetSymbolsPromise.cancel(); - this._currentFindCodeInsetSymbolsPromise = null; - this._modelChangeCounter++; - } - if (this._currentResolveCodeInsetSymbolsPromise) { - this._currentResolveCodeInsetSymbolsPromise.cancel(); - this._currentResolveCodeInsetSymbolsPromise = null; - } - this._localToDispose = dispose(this._localToDispose); - } - - getId(): string { - return CodeInsetController.ID; - } - - private _onModelChange(): void { - this._localDispose(); - - const model = this._editor.getModel(); - if (!model || !this._isEnabled || !CodeInsetProviderRegistry.has(model)) { - return; - } - - for (const provider of CodeInsetProviderRegistry.all(model)) { - if (typeof provider.onDidChange === 'function') { - let registration = provider.onDidChange(() => scheduler.schedule()); - this._localToDispose.push(registration); - } - } - - this._detectVisibleInsets = new RunOnceScheduler(() => { - this._onViewportChanged(); - }, 500); - - const scheduler = new RunOnceScheduler(() => { - const counterValue = ++this._modelChangeCounter; - if (this._currentFindCodeInsetSymbolsPromise) { - this._currentFindCodeInsetSymbolsPromise.cancel(); - } - - this._currentFindCodeInsetSymbolsPromise = createCancelablePromise(token => getCodeInsetData(model, token)); - - this._currentFindCodeInsetSymbolsPromise.then(codeInsetData => { - if (counterValue === this._modelChangeCounter) { // only the last one wins - this._renderCodeInsetSymbols(codeInsetData); - this._detectVisibleInsets.schedule(); - } - }, onUnexpectedError); - }, 250); - - this._localToDispose.push(scheduler); - - this._localToDispose.push(this._detectVisibleInsets); - - this._localToDispose.push(this._editor.onDidChangeModelContent(() => { - this._editor.changeDecorations(changeAccessor => { - this._editor.changeViewZones(viewAccessor => { - let toDispose: CodeInsetWidget[] = []; - let lastInsetLineNumber: number = -1; - this._insetWidgets.forEach(inset => { - if (!inset.isValid() || lastInsetLineNumber === inset.getLineNumber()) { - // invalid -> Inset collapsed, attach range doesn't exist anymore - // line_number -> insets should never be on the same line - toDispose.push(inset); - } - else { - inset.reposition(viewAccessor); - lastInsetLineNumber = inset.getLineNumber(); - } - }); - let helper = new CodeInsetHelper(); - toDispose.forEach((l) => { - l.dispose(helper, viewAccessor); - this._insetWidgets.splice(this._insetWidgets.indexOf(l), 1); - }); - helper.commit(changeAccessor); - }); - }); - // Compute new `visible` code insets - this._detectVisibleInsets.schedule(); - // Ask for all references again - scheduler.schedule(); - })); - - this._localToDispose.push(this._editor.onDidScrollChange(e => { - if (e.scrollTopChanged && this._insetWidgets.length > 0) { - this._detectVisibleInsets.schedule(); - } - })); - - this._localToDispose.push(this._editor.onDidLayoutChange(() => { - this._detectVisibleInsets.schedule(); - })); - - this._localToDispose.push(toDisposable(() => { - if (this._editor.getModel()) { - const scrollState = StableEditorScrollState.capture(this._editor); - this._editor.changeDecorations((changeAccessor) => { - this._editor.changeViewZones((accessor) => { - this._disposeAllInsets(changeAccessor, accessor); - }); - }); - scrollState.restore(this._editor); - } else { - // No accessors available - this._disposeAllInsets(null, null); - } - })); - - scheduler.schedule(); - } - - private _disposeAllInsets(decChangeAccessor: IModelDecorationsChangeAccessor | null, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor | null): void { - let helper = new CodeInsetHelper(); - this._insetWidgets.forEach((Inset) => Inset.dispose(helper, viewZoneChangeAccessor)); - if (decChangeAccessor) { - helper.commit(decChangeAccessor); - } - this._insetWidgets = []; - } - - private _renderCodeInsetSymbols(symbols: ICodeInsetData[]): void { - if (!this._editor.hasModel()) { - return; - } - - let maxLineNumber = this._editor.getModel().getLineCount(); - let groups: ICodeInsetData[][] = []; - let lastGroup: ICodeInsetData[] | undefined; - - for (let symbol of symbols) { - let line = symbol.symbol.range.startLineNumber; - if (line < 1 || line > maxLineNumber) { - // invalid code Inset - continue; - } else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) { - // on same line as previous - lastGroup.push(symbol); - } else { - // on later line as previous - lastGroup = [symbol]; - groups.push(lastGroup); - } - } - - const scrollState = StableEditorScrollState.capture(this._editor); - - this._editor.changeDecorations(changeAccessor => { - this._editor.changeViewZones(accessor => { - - let codeInsetIndex = 0, groupsIndex = 0, helper = new CodeInsetHelper(); - - while (groupsIndex < groups.length && codeInsetIndex < this._insetWidgets.length) { - - let symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber; - let codeInsetLineNumber = this._insetWidgets[codeInsetIndex].getLineNumber(); - - if (codeInsetLineNumber < symbolsLineNumber) { - this._insetWidgets[codeInsetIndex].dispose(helper, accessor); - this._insetWidgets.splice(codeInsetIndex, 1); - } else if (codeInsetLineNumber === symbolsLineNumber) { - this._insetWidgets[codeInsetIndex].updateCodeInsetSymbols(groups[groupsIndex], helper); - groupsIndex++; - codeInsetIndex++; - } else { - this._insetWidgets.splice( - codeInsetIndex, - 0, - new CodeInsetWidget(groups[groupsIndex], this._editor, helper) - ); - codeInsetIndex++; - groupsIndex++; - } - } - - // Delete extra code insets - while (codeInsetIndex < this._insetWidgets.length) { - this._insetWidgets[codeInsetIndex].dispose(helper, accessor); - this._insetWidgets.splice(codeInsetIndex, 1); - } - - // Create extra symbols - while (groupsIndex < groups.length) { - this._insetWidgets.push(new CodeInsetWidget( - groups[groupsIndex], - this._editor, helper - )); - groupsIndex++; - } - - helper.commit(changeAccessor); - }); - }); - - scrollState.restore(this._editor); - } - - private _onViewportChanged(): void { - if (this._currentResolveCodeInsetSymbolsPromise) { - this._currentResolveCodeInsetSymbolsPromise.cancel(); - this._currentResolveCodeInsetSymbolsPromise = null; - } - - const model = this._editor.getModel(); - if (!model) { - return; - } - - const allWidgetRequests: ICodeInsetData[][] = []; - const insetWidgets: CodeInsetWidget[] = []; - this._insetWidgets.forEach(inset => { - const widgetRequests = inset.computeIfNecessary(model); - if (widgetRequests) { - allWidgetRequests.push(widgetRequests); - insetWidgets.push(inset); - } - }); - - if (allWidgetRequests.length === 0) { - return; - } - - this._currentResolveCodeInsetSymbolsPromise = createCancelablePromise(token => { - - const allPromises = allWidgetRequests.map((widgetRequests, r) => { - - const widgetPromises = widgetRequests.map(request => { - if (request.resolved) { - return Promise.resolve(undefined); - } - let a = new Promise(resolve => { - this._pendingWebviews.set(request.symbol.id, element => { - request.resolved = true; - insetWidgets[r].adoptWebview(element); - resolve(); - }); - }); - let b = request.provider.resolveCodeInset(model, request.symbol, token); - return Promise.all([a, b]); - }); - - return Promise.all(widgetPromises); - }); - - return Promise.all(allPromises); - }); - - this._currentResolveCodeInsetSymbolsPromise.then(() => { - this._currentResolveCodeInsetSymbolsPromise = null; - }).catch(err => { - this._currentResolveCodeInsetSymbolsPromise = null; - onUnexpectedError(err); - }); - } -} - -registerEditorContribution(CodeInsetController); - - -Registry.as(ConfigurationExtensions.Configuration).registerConfiguration({ - id: 'editor', - properties: { - // ['editor.codeInsets']: { - // description: localize('editor.codeInsets', "Enable/disable editor code insets"), - // type: 'boolean', - // default: false - // } - } -}); diff --git a/src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts b/src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts deleted file mode 100644 index d5e16dc47a9..00000000000 --- a/src/vs/workbench/contrib/codeinset/electron-browser/codeInsetWidget.ts +++ /dev/null @@ -1,193 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import 'vs/css!./codeInsetWidget'; -import { Range } from 'vs/editor/common/core/range'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; -import { ICodeInsetData } from '../common/codeInset'; -import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { IModelDeltaDecoration, IModelDecorationsChangeAccessor, ITextModel } from 'vs/editor/common/model'; -import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; - - -export interface IDecorationIdCallback { - (decorationId: string): void; -} - -export class CodeInsetHelper { - - private _removeDecorations: string[]; - private _addDecorations: IModelDeltaDecoration[]; - private _addDecorationsCallbacks: IDecorationIdCallback[]; - - constructor() { - this._removeDecorations = []; - this._addDecorations = []; - this._addDecorationsCallbacks = []; - } - - addDecoration(decoration: IModelDeltaDecoration, callback: IDecorationIdCallback): void { - this._addDecorations.push(decoration); - this._addDecorationsCallbacks.push(callback); - } - - removeDecoration(decorationId: string): void { - this._removeDecorations.push(decorationId); - } - - commit(changeAccessor: IModelDecorationsChangeAccessor): void { - let resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations); - for (let i = 0, len = resultingDecorations.length; i < len; i++) { - this._addDecorationsCallbacks[i](resultingDecorations[i]); - } - } -} - -export class CodeInsetWidget { - - private readonly _editor: editorBrowser.ICodeEditor; - private _webview: WebviewElement; - private _viewZone: editorBrowser.IViewZone; - private _viewZoneId?: number = undefined; - private _decorationIds: string[]; - private _data: ICodeInsetData[]; - private _range: Range; - - constructor( - data: ICodeInsetData[], // all the insets on the same line (often just one) - editor: editorBrowser.ICodeEditor, - helper: CodeInsetHelper - ) { - this._editor = editor; - this._data = data; - this._decorationIds = new Array(this._data.length); - - this._data.forEach((codeInsetData, i) => { - - helper.addDecoration({ - range: codeInsetData.symbol.range, - options: ModelDecorationOptions.EMPTY - }, id => this._decorationIds[i] = id); - - // the range contains all insets on this line - if (!this._range) { - this._range = Range.lift(codeInsetData.symbol.range); - } else { - this._range = Range.plusRange(this._range, codeInsetData.symbol.range); - } - }); - } - - public dispose(helper: CodeInsetHelper, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor | null): void { - while (this._decorationIds.length) { - const decoration = this._decorationIds.pop(); - if (decoration) { - helper.removeDecoration(decoration); - } - } - if (viewZoneChangeAccessor) { - if (typeof this._viewZoneId !== 'undefined') { - viewZoneChangeAccessor.removeZone(this._viewZoneId); - } - this._viewZone = undefined!; - } - if (this._webview) { - this._webview.dispose(); - } - } - - public isValid(): boolean { - return this._editor.hasModel() && this._decorationIds.some((id, i) => { - const range = this._editor.getModel()!.getDecorationRange(id); - const symbol = this._data[i].symbol; - return !!range && Range.isEmpty(symbol.range) === range.isEmpty(); - }); - } - - public updateCodeInsetSymbols(data: ICodeInsetData[], helper: CodeInsetHelper): void { - while (this._decorationIds.length) { - const decoration = this._decorationIds.pop(); - if (decoration) { - helper.removeDecoration(decoration); - } - } - this._data = data; - this._decorationIds = new Array(this._data.length); - this._data.forEach((codeInsetData, i) => { - helper.addDecoration({ - range: codeInsetData.symbol.range, - options: ModelDecorationOptions.EMPTY - }, id => this._decorationIds[i] = id); - }); - } - - public computeIfNecessary(model: ITextModel): ICodeInsetData[] { - // Read editor current state - for (let i = 0; i < this._decorationIds.length; i++) { - const range = model.getDecorationRange(this._decorationIds[i]); - if (range) { - this._data[i].symbol.range = range; - } - } - return this._data; - } - - public getLineNumber(): number { - if (this._editor.hasModel()) { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - if (range) { - return range.startLineNumber; - } - } - return -1; - } - - public adoptWebview(webview: WebviewElement): void { - - const lineNumber = this._range.endLineNumber; - this._editor.changeViewZones(accessor => { - - if (this._viewZoneId) { - accessor.removeZone(this._viewZoneId); - this._webview.dispose(); - } - - const div = document.createElement('div'); - div.className = 'code-inset'; - webview.mountTo(div); - webview.onMessage((e: { type: string, payload: any }) => { - // The webview contents can use a "size-info" message to report its size. - if (e && e.type === 'size-info') { - const margin = e.payload.height > 0 ? 5 : 0; - this._viewZone.heightInPx = e.payload.height + margin; - this._editor.changeViewZones(accessor => { - if (this._viewZoneId) { - accessor.layoutZone(this._viewZoneId); - } - }); - } - }); - this._viewZone = { - afterLineNumber: lineNumber, - heightInPx: 50, - domNode: div - }; - this._viewZoneId = accessor.addZone(this._viewZone); - this._webview = webview; - }); - } - - public reposition(viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { - if (this.isValid() && this._editor.hasModel()) { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - if (range) { - this._viewZone.afterLineNumber = range.endLineNumber; - } - if (this._viewZoneId) { - viewZoneChangeAccessor.layoutZone(this._viewZoneId); - } - } - } -} diff --git a/src/vs/workbench/contrib/comments/browser/commentService.ts b/src/vs/workbench/contrib/comments/browser/commentService.ts index 9b2286d4677..3ddfb902491 100644 --- a/src/vs/workbench/contrib/comments/browser/commentService.ts +++ b/src/vs/workbench/contrib/comments/browser/commentService.ts @@ -49,6 +49,7 @@ export interface ICommentService { unregisterCommentController(owner: string): void; getCommentController(owner: string): MainThreadCommentController | undefined; createCommentThreadTemplate(owner: string, resource: URI, range: Range): void; + updateCommentThreadTemplate(owner: string, threadHandle: number, range: Range): Promise; getCommentMenus(owner: string): CommentMenus; registerDataProvider(owner: string, commentProvider: DocumentCommentProvider): void; unregisterDataProvider(owner: string): void; @@ -154,6 +155,16 @@ export class CommentService extends Disposable implements ICommentService { commentController.createCommentThreadTemplate(resource, range); } + async updateCommentThreadTemplate(owner: string, threadHandle: number, range: Range) { + const commentController = this._commentControls.get(owner); + + if (!commentController) { + return; + } + + await commentController.updateCommentThreadTemplate(threadHandle, range); + } + disposeCommentThread(owner: string, threadId: string) { let controller = this.getCommentController(owner); if (controller) { diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts index 737fe7297d4..006da7e3b6b 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadWidget.ts @@ -772,7 +772,14 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget this._commentFormActions.setActions(menu); })); - this._commentFormActions = new CommentFormActions(container, (action: IAction) => { + this._commentFormActions = new CommentFormActions(container, async (action: IAction) => { + if (!commentThread.comments || !commentThread.comments.length) { + let newPosition = this.getPosition(); + + if (newPosition) { + this.commentService.updateCommentThreadTemplate(this.owner, commentThread.commentThreadHandle, new Range(newPosition.lineNumber, 1, newPosition.lineNumber, 1)); + } + } action.run({ thread: this._commentThread, text: this._commentEditor.getValue(), @@ -975,6 +982,13 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget const frameThickness = Math.round(lineHeight / 9) * 2; const computedLinesNumber = Math.ceil((headHeight + dimensions.height + arrowHeight + frameThickness + 8 /** margin bottom to avoid margin collapse */) / lineHeight); + + let currentPosition = this.getPosition(); + + if (this._viewZone && currentPosition && currentPosition.lineNumber !== this._viewZone.afterLineNumber) { + this._viewZone.afterLineNumber = currentPosition.lineNumber; + } + this._relayout(computedLinesNumber); } } diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts index 1e2006b9cb1..706bad0dd5a 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts @@ -7,7 +7,7 @@ import * as dom from 'vs/base/browser/dom'; import * as nls from 'vs/nls'; import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer'; import { onUnexpectedError } from 'vs/base/common/errors'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IDataSource, IFilter, IRenderer as ITreeRenderer, ITree } from 'vs/base/parts/tree/browser/tree'; import { IOpenerService } from 'vs/platform/opener/common/opener'; @@ -62,7 +62,7 @@ interface ICommentThreadTemplateData { icon: HTMLImageElement; userName: HTMLSpanElement; commentText: HTMLElement; - disposables: Disposable[]; + disposables: IDisposable[]; } export class CommentsModelRenderer implements ITreeRenderer { diff --git a/src/vs/workbench/contrib/comments/browser/media/review.css b/src/vs/workbench/contrib/comments/browser/media/review.css index 4ed2c4be005..5d147efe7ac 100644 --- a/src/vs/workbench/contrib/comments/browser/media/review.css +++ b/src/vs/workbench/contrib/comments/browser/media/review.css @@ -178,6 +178,7 @@ .monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions { display: none; background-image: url(./reaction.svg); + background-size: 24px; width: 26px; height: 16px; background-repeat: no-repeat; @@ -188,6 +189,7 @@ .monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions:hover .action-item a.action-label.toolbar-toggle-pickReactions { display: inline-block; + background-size: 24px; } .monaco-editor.vs-dark .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item a.action-label.toolbar-toggle-pickReactions { @@ -212,7 +214,7 @@ background-image: url(./reaction.svg); width: 18px; height: 18px; - background-size: 100% auto; + background-size: 24px; background-position: center; background-repeat: no-repeat; } diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 0922335f557..38fe05f0eb0 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -61,7 +61,7 @@ export class BreakpointsView extends ViewletPanel { super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService); this.minimumBodySize = this.maximumBodySize = this.getExpandedBodySize(); - this.disposables.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange())); + this._register(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange())); } public renderBody(container: HTMLElement): void { @@ -81,9 +81,9 @@ export class BreakpointsView extends ViewletPanel { CONTEXT_BREAKPOINTS_FOCUSED.bindTo(this.list.contextKeyService); - this.list.onContextMenu(this.onListContextMenu, this, this.disposables); + this._register(this.list.onContextMenu(this.onListContextMenu, this)); - this.disposables.push(this.list.onDidOpen(e => { + this._register(this.list.onDidOpen(e => { let isSingleClick = false; let isDoubleClick = false; let isMiddleClick = false; @@ -120,7 +120,7 @@ export class BreakpointsView extends ViewletPanel { this.list.splice(0, this.list.length, this.elements); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.needsRefresh) { this.onBreakpointsChange(); } diff --git a/src/vs/workbench/contrib/debug/browser/callStackView.ts b/src/vs/workbench/contrib/debug/browser/callStackView.ts index af8854bac34..fe3f3b88d50 100644 --- a/src/vs/workbench/contrib/debug/browser/callStackView.ts +++ b/src/vs/workbench/contrib/debug/browser/callStackView.ts @@ -63,7 +63,7 @@ export class CallStackView extends ViewletPanel { this.callStackItemType = CONTEXT_CALLSTACK_ITEM_TYPE.bindTo(contextKeyService); this.contributedContextMenu = menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService); - this.disposables.push(this.contributedContextMenu); + this._register(this.contributedContextMenu); // Create scheduler to prevent unnecessary flashing of tree when reacting to changes this.onCallStackChangeScheduler = new RunOnceScheduler(() => { @@ -149,8 +149,8 @@ export class CallStackView extends ViewletPanel { this.tree.setInput(this.debugService.getModel()).then(undefined, onUnexpectedError); const callstackNavigator = new TreeResourceNavigator2(this.tree); - this.disposables.push(callstackNavigator); - this.disposables.push(callstackNavigator.onDidOpenResource(e => { + this._register(callstackNavigator); + this._register(callstackNavigator.onDidOpenResource(e => { if (this.ignoreSelectionChangedEvent) { return; } @@ -189,7 +189,7 @@ export class CallStackView extends ViewletPanel { } })); - this.disposables.push(this.debugService.getModel().onDidChangeCallStack(() => { + this._register(this.debugService.getModel().onDidChangeCallStack(() => { if (!this.isBodyVisible()) { this.needsRefresh = true; return; @@ -200,7 +200,7 @@ export class CallStackView extends ViewletPanel { } })); const onCallStackChange = Event.any(this.debugService.getViewModel().onDidFocusStackFrame, this.debugService.getViewModel().onDidFocusSession); - this.disposables.push(onCallStackChange(() => { + this._register(onCallStackChange(() => { if (this.ignoreFocusStackFrameEvent) { return; } @@ -211,20 +211,20 @@ export class CallStackView extends ViewletPanel { this.updateTreeSelection(); })); - this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e))); + this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); // Schedule the update of the call stack tree if the viewlet is opened after a session started #14684 if (this.debugService.state === State.Stopped) { this.onCallStackChangeScheduler.schedule(0); } - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.needsRefresh) { this.onCallStackChangeScheduler.schedule(); } })); - this.disposables.push(this.debugService.onDidNewSession(s => { + this._register(this.debugService.onDidNewSession(s => { if (s.parentSession) { // Auto expand sessions that have sub sessions this.parentSessionToExpand.add(s.parentSession); diff --git a/src/vs/workbench/contrib/debug/browser/debugCommands.ts b/src/vs/workbench/contrib/debug/browser/debugCommands.ts index e637b312651..c3f9ed4592c 100644 --- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts +++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts @@ -412,24 +412,18 @@ export function registerCommands(): void { const widget = editorService.activeTextEditorWidget; if (isCodeEditor(widget)) { const position = widget.getPosition(); - if (!position || !widget.hasModel()) { - return undefined; - } + if (position && widget.hasModel() && debugService.getConfigurationManager().canSetBreakpointsIn(widget.getModel())) { + const modelUri = widget.getModel().uri; + const breakpointAlreadySet = debugService.getModel().getBreakpoints({ lineNumber: position.lineNumber, uri: modelUri }) + .some(bp => (bp.sessionAgnosticData.column === position.column || (!bp.column && position.column <= 1))); - const modelUri = widget.getModel().uri; - const bp = debugService.getModel().getBreakpoints({ lineNumber: position.lineNumber, uri: modelUri }) - .filter(bp => (bp.column === position.column || !bp.column && position.column <= 1)).pop(); - - if (bp) { - return undefined; - } - if (debugService.getConfigurationManager().canSetBreakpointsIn(widget.getModel())) { - return debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber, column: position.column > 1 ? position.column : undefined }], 'debugCommands.inlineBreakpointCommand'); + if (!breakpointAlreadySet) { + debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber, column: position.column > 1 ? position.column : undefined }], 'debugCommands.inlineBreakpointCommand'); + } } } - - return undefined; }; + KeybindingsRegistry.registerCommandAndKeybindingRule({ weight: KeybindingWeight.WorkbenchContrib, primary: KeyMod.Shift | KeyCode.F9, diff --git a/src/vs/workbench/contrib/debug/browser/debugStatus.ts b/src/vs/workbench/contrib/debug/browser/debugStatus.ts index 4bb9875ebac..03660fe9656 100644 --- a/src/vs/workbench/contrib/debug/browser/debugStatus.ts +++ b/src/vs/workbench/contrib/debug/browser/debugStatus.ts @@ -4,88 +4,77 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import * as dom from 'vs/base/browser/dom'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug'; -import { Themable } from 'vs/workbench/common/theme'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel'; +import { IStatusbarEntry, IStatusbarService, StatusbarAlignment, IStatusbarEntryAccessor } from 'vs/platform/statusbar/common/statusbar'; +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -const $ = dom.$; -export class DebugStatus extends Themable implements IStatusbarItem { - private container: HTMLElement; - private statusBarItem: HTMLElement; - private label: OcticonLabel; +export class DebugStatusContribution implements IWorkbenchContribution { + private showInStatusBar: 'never' | 'always' | 'onFirstSessionStart'; + private toDispose: IDisposable[] = []; + private entryAccessor: IStatusbarEntryAccessor | undefined; constructor( - @IQuickOpenService private readonly quickOpenService: IQuickOpenService, - @IDebugService private readonly debugService: IDebugService, - @IThemeService themeService: IThemeService, - @IConfigurationService configurationService: IConfigurationService + @IStatusbarService private readonly statusBarService: IStatusbarService, + @IDebugService readonly debugService: IDebugService, + @IConfigurationService readonly configurationService: IConfigurationService ) { - super(themeService); - this._register(this.debugService.getConfigurationManager().onDidSelectConfiguration(e => { - this.setLabel(); - })); - this._register(this.debugService.onDidChangeState(state => { - if (state !== State.Inactive && this.showInStatusBar === 'onFirstSessionStart') { - this.doRender(); - } else { - if (this.showInStatusBar !== 'never') { - this.updateStyles(); - } + + const setShowInStatusBar = () => { + this.showInStatusBar = configurationService.getValue('debug').showInStatusBar; + if (this.showInStatusBar === 'always' && !this.entryAccessor) { + this.entryAccessor = this.statusBarService.addEntry(this.entry, StatusbarAlignment.LEFT, 30 /* Low Priority */); + } + }; + setShowInStatusBar(); + + this.toDispose.push(this.debugService.onDidChangeState(state => { + if (state !== State.Inactive && this.showInStatusBar === 'onFirstSessionStart' && !this.entryAccessor) { + this.entryAccessor = this.statusBarService.addEntry(this.entry, StatusbarAlignment.LEFT, 30 /* Low Priority */); } })); - this.showInStatusBar = configurationService.getValue('debug').showInStatusBar; - this._register(configurationService.onDidChangeConfiguration(e => { + this.toDispose.push(configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration('debug.showInStatusBar')) { - this.showInStatusBar = configurationService.getValue('debug').showInStatusBar; - if (this.showInStatusBar === 'always') { - this.doRender(); - } - if (this.statusBarItem) { - dom.toggleClass(this.statusBarItem, 'hidden', this.showInStatusBar === 'never'); + setShowInStatusBar(); + if (this.entryAccessor && this.showInStatusBar === 'never') { + this.entryAccessor.dispose(); + this.entryAccessor = undefined; } } })); + this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(e => { + if (this.entryAccessor) { + this.entryAccessor.update(this.entry); + } + })); } - public render(container: HTMLElement): IDisposable { - this.container = container; - if (this.showInStatusBar === 'always') { - this.doRender(); + private getText(): string { + const manager = this.debugService.getConfigurationManager(); + const name = manager.selectedConfiguration.name || ''; + const nameAndLaunchPresent = name && manager.selectedConfiguration.launch; + if (nameAndLaunchPresent) { + return '$(play) ' + (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name); } - // noop, we render when we decide is best - return this; + + return ''; } - private doRender(): void { - if (!this.statusBarItem && this.container) { - this.statusBarItem = dom.append(this.container, $('.debug-statusbar-item')); - this._register(dom.addDisposableListener(this.statusBarItem, 'click', () => this.quickOpenService.show('debug '))); - this.statusBarItem.title = nls.localize('selectAndStartDebug', "Select and start debug configuration"); - const a = dom.append(this.statusBarItem, $('a')); - this.label = new OcticonLabel(a); - this.setLabel(); - } - - this.updateStyles(); + private get entry(): IStatusbarEntry { + return { + text: this.getText(), + tooltip: nls.localize('selectAndStartDebug', "Select and start debug configuration"), + command: 'workbench.action.debug.selectandstart' + }; } - private setLabel(): void { - if (this.label && this.statusBarItem) { - const manager = this.debugService.getConfigurationManager(); - const name = manager.selectedConfiguration.name || ''; - const nameAndLaunchPresent = name && manager.selectedConfiguration.launch; - dom.toggleClass(this.statusBarItem, 'hidden', this.showInStatusBar === 'never' || !nameAndLaunchPresent); - if (nameAndLaunchPresent) { - this.label.text = '$(play) ' + (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name); - } + dispose(): void { + if (this.entryAccessor) { + this.entryAccessor.dispose(); } + dispose(this.toDispose); } } diff --git a/src/vs/workbench/contrib/debug/browser/linkDetector.ts b/src/vs/workbench/contrib/debug/browser/linkDetector.ts index f40b2470cb8..58cbb394e5f 100644 --- a/src/vs/workbench/contrib/debug/browser/linkDetector.ts +++ b/src/vs/workbench/contrib/debug/browser/linkDetector.ts @@ -19,7 +19,7 @@ export class LinkDetector { // group 2: drive letter on windows with trailing backslash or leading slash on mac/linux // group 3: line number, matched by (:(\d+)) // group 4: column number, matched by ((?::(\d+))?) - // eg: at Context. (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11) + // e.g.: at Context. (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11) /(?![\(])(?:file:\/\/)?((?:([a-zA-Z]+:)|[^\(\)<>\'\"\[\]:\s]+)(?:[\\/][^\(\)<>\'\"\[\]:]*)?\.[a-zA-Z]+[0-9]*):(\d+)(?::(\d+))?/g ]; diff --git a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts index 14f4e16f2c5..3a4c68f4bfc 100644 --- a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts @@ -417,7 +417,7 @@ export class LoadedScriptsView extends ViewletPanel { const root = new RootTreeItem(this.debugService.getModel(), this.environmentService, this.contextService, this.labelService); this.treeLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility }); - this.disposables.push(this.treeLabels); + this._register(this.treeLabels); this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, this.treeContainer, new LoadedScriptsDelegate(), [new LoadedScriptsRenderer(this.treeLabels)], @@ -443,11 +443,11 @@ export class LoadedScriptsView extends ViewletPanel { this.tree.updateChildren(); } }, 300); - this.disposables.push(this.changeScheduler); + this._register(this.changeScheduler); const loadedScriptsNavigator = new TreeResourceNavigator2(this.tree); - this.disposables.push(loadedScriptsNavigator); - this.disposables.push(loadedScriptsNavigator.onDidOpenResource(e => { + this._register(loadedScriptsNavigator); + this._register(loadedScriptsNavigator.onDidOpenResource(e => { if (e.element instanceof BaseTreeItem) { const source = e.element.getSource(); if (source && source.available) { @@ -457,7 +457,7 @@ export class LoadedScriptsView extends ViewletPanel { } })); - this.disposables.push(this.tree.onDidChangeFocus(() => { + this._register(this.tree.onDidChangeFocus(() => { const focus = this.tree.getFocus(); if (focus instanceof SessionTreeItem) { this.loadedScriptsItemType.set('session'); @@ -467,7 +467,7 @@ export class LoadedScriptsView extends ViewletPanel { })); const registerLoadedSourceListener = (session: IDebugSession) => { - this.disposables.push(session.onDidLoadedSource(event => { + this._register(session.onDidLoadedSource(event => { let sessionRoot: SessionTreeItem; switch (event.reason) { case 'new': @@ -501,17 +501,17 @@ export class LoadedScriptsView extends ViewletPanel { })); }; - this.disposables.push(this.debugService.onDidNewSession(registerLoadedSourceListener)); + this._register(this.debugService.onDidNewSession(registerLoadedSourceListener)); this.debugService.getModel().getSessions().forEach(registerLoadedSourceListener); - this.disposables.push(this.debugService.onDidEndSession(session => { + this._register(this.debugService.onDidEndSession(session => { root.remove(session.getId()); this.changeScheduler.schedule(); })); this.changeScheduler.schedule(0); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.treeNeedsRefreshOnVisible) { this.changeScheduler.schedule(); } diff --git a/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css b/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css index e35540b8021..c4cdbf1d04e 100644 --- a/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css +++ b/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css @@ -110,20 +110,6 @@ box-sizing: border-box; } -/* Debug status */ -.monaco-workbench .part.statusbar > .statusbar-item > .debug-statusbar-item > a { - padding: 0 5px 0 5px; -} - -.monaco-workbench .part.statusbar > .statusbar-item > .debug-statusbar-item span.octicon { - text-align: center; - font-size: 14px; -} - -.monaco-workbench .part.statusbar .debug-statusbar-item.hidden { - display: none; -} - .monaco-workbench .debug-view-content .monaco-list-row .monaco-tl-contents { overflow: hidden; text-overflow: ellipsis; diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index ce3119aeb2e..644d9c8546f 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -134,11 +134,11 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati } this.selectSession(); })); - this._register(this.debugService.onWillNewSession(() => { + this._register(this.debugService.onWillNewSession(newSession => { // Need to listen to output events for sessions which are not yet fully initialised const input = this.tree.getInput(); if (!input || input.state === State.Inactive) { - this.selectSession(); + this.selectSession(newSession); } this.updateTitleArea(); })); diff --git a/src/vs/workbench/contrib/debug/browser/variablesView.ts b/src/vs/workbench/contrib/debug/browser/variablesView.ts index ec52acafed2..ccb7850984b 100644 --- a/src/vs/workbench/contrib/debug/browser/variablesView.ts +++ b/src/vs/workbench/contrib/debug/browser/variablesView.ts @@ -88,7 +88,7 @@ export class VariablesView extends ViewletPanel { this.toolbar.setActions([collapseAction])(); this.tree.updateChildren(); - this.disposables.push(this.debugService.getViewModel().onDidFocusStackFrame(sf => { + this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => { if (!this.isBodyVisible()) { this.needsRefresh = true; return; @@ -99,16 +99,16 @@ export class VariablesView extends ViewletPanel { const timeout = sf.explicit ? 0 : undefined; this.onFocusStackFrameScheduler.schedule(timeout); })); - this.disposables.push(variableSetEmitter.event(() => this.tree.updateChildren())); - this.disposables.push(this.tree.onMouseDblClick(e => this.onMouseDblClick(e))); - this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e))); + this._register(variableSetEmitter.event(() => this.tree.updateChildren())); + this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e))); + this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.needsRefresh) { this.onFocusStackFrameScheduler.schedule(); } })); - this.disposables.push(this.debugService.getViewModel().onDidSelectExpression(e => { + this._register(this.debugService.getViewModel().onDidSelectExpression(e => { if (e instanceof Variable) { this.tree.rerender(e); } diff --git a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts index 8961c0f6376..a76a133ba64 100644 --- a/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts +++ b/src/vs/workbench/contrib/debug/browser/watchExpressionsView.ts @@ -76,16 +76,16 @@ export class WatchExpressionsView extends ViewletPanel { const removeAllWatchExpressionsAction = new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService); this.toolbar.setActions([addWatchExpressionAction, collapseAction, removeAllWatchExpressionsAction])(); - this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e))); - this.disposables.push(this.tree.onMouseDblClick(e => this.onMouseDblClick(e))); - this.disposables.push(this.debugService.getModel().onDidChangeWatchExpressions(we => { + this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); + this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e))); + this._register(this.debugService.getModel().onDidChangeWatchExpressions(we => { if (!this.isBodyVisible()) { this.needsRefresh = true; } else { this.tree.updateChildren(); } })); - this.disposables.push(this.debugService.getViewModel().onDidFocusStackFrame(() => { + this._register(this.debugService.getViewModel().onDidFocusStackFrame(() => { if (!this.isBodyVisible()) { this.needsRefresh = true; return; @@ -95,14 +95,14 @@ export class WatchExpressionsView extends ViewletPanel { this.onWatchExpressionsUpdatedScheduler.schedule(); } })); - this.disposables.push(variableSetEmitter.event(() => this.tree.updateChildren())); + this._register(variableSetEmitter.event(() => this.tree.updateChildren())); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.needsRefresh) { this.onWatchExpressionsUpdatedScheduler.schedule(); } })); - this.disposables.push(this.debugService.getViewModel().onDidSelectExpression(e => { + this._register(this.debugService.getViewModel().onDidSelectExpression(e => { if (e instanceof Expression && e.name) { this.tree.rerender(e); } diff --git a/src/vs/workbench/contrib/debug/common/debugSchemas.ts b/src/vs/workbench/contrib/debug/common/debugSchemas.ts index 7b6a51c0e88..9cd391a66f6 100644 --- a/src/vs/workbench/contrib/debug/common/debugSchemas.ts +++ b/src/vs/workbench/contrib/debug/common/debugSchemas.ts @@ -47,7 +47,7 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE type: 'array' }, variables: { - description: nls.localize('vscode.extension.contributes.debuggers.variables', "Mapping from interactive variables (e.g ${action.pickProcess}) in `launch.json` to a command."), + description: nls.localize('vscode.extension.contributes.debuggers.variables', "Mapping from interactive variables (e.g. ${action.pickProcess}) in `launch.json` to a command."), type: 'object' }, initialConfigurations: { diff --git a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts index a847adde9fd..f3180cb6de6 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts @@ -15,8 +15,6 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v import { IWorkbenchActionRegistry, Extensions as WorkbenchActionRegistryExtensions } from 'vs/workbench/common/actions'; import { ShowViewletAction, Extensions as ViewletExtensions, ViewletRegistry, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelDescriptor } from 'vs/workbench/browser/panel'; -import { StatusbarItemDescriptor, IStatusbarRegistry, Extensions as StatusExtensions } from 'vs/workbench/browser/parts/statusbar/statusbar'; -import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { BreakpointsView } from 'vs/workbench/contrib/debug/browser/breakpointsView'; import { CallStackView } from 'vs/workbench/contrib/debug/browser/callStackView'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; @@ -40,7 +38,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { URI } from 'vs/base/common/uri'; import { DebugViewlet } from 'vs/workbench/contrib/debug/browser/debugViewlet'; import { DebugQuickOpenHandler } from 'vs/workbench/contrib/debug/browser/debugQuickOpen'; -import { DebugStatus } from 'vs/workbench/contrib/debug/browser/debugStatus'; +import { DebugStatusContribution } from 'vs/workbench/contrib/debug/browser/debugStatus'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; @@ -258,8 +256,7 @@ configurationRegistry.registerConfiguration({ }); // Register Debug Status -const statusBar = Registry.as(StatusExtensions.Statusbar); -statusBar.registerStatusbarItem(new StatusbarItemDescriptor(DebugStatus, StatusbarAlignment.LEFT, 30 /* Low Priority */)); +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually); // Debug toolbar @@ -532,7 +529,9 @@ if (isMacintosh) { const registerTouchBarEntry = (id: string, title: string, order: number, when: ContextKeyExpr, icon: string) => { MenuRegistry.appendMenuItem(MenuId.TouchBarContext, { command: { - id, title, iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/contrib/debug/electron-browser/media/${icon}`)) } + id, + title, + iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/contrib/debug/electron-browser/media/${icon}`)) } }, when, group: '9_debug', @@ -544,9 +543,9 @@ if (isMacintosh) { registerTouchBarEntry(RunAction.ID, RunAction.LABEL, 1, CONTEXT_IN_DEBUG_MODE.toNegated(), 'continue-without-debugging-tb.png'); registerTouchBarEntry(CONTINUE_ID, continueLabel, 0, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'continue-tb.png'); registerTouchBarEntry(PAUSE_ID, pauseLabel, 1, ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.notEquals('debugState', 'stopped')), 'pause-tb.png'); - registerTouchBarEntry(STEP_OVER_ID, stepOverLabel, 2, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepover-tb.png'); - registerTouchBarEntry(STEP_INTO_ID, stepIntoLabel, 3, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepinto-tb.png'); - registerTouchBarEntry(STEP_OUT_ID, stepOutLabel, 4, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepout-tb.png'); + registerTouchBarEntry(STEP_OVER_ID, stepOverLabel, 2, CONTEXT_IN_DEBUG_MODE, 'stepover-tb.png'); + registerTouchBarEntry(STEP_INTO_ID, stepIntoLabel, 3, CONTEXT_IN_DEBUG_MODE, 'stepinto-tb.png'); + registerTouchBarEntry(STEP_OUT_ID, stepOutLabel, 4, CONTEXT_IN_DEBUG_MODE, 'stepout-tb.png'); registerTouchBarEntry(RESTART_SESSION_ID, restartLabel, 5, CONTEXT_IN_DEBUG_MODE, 'restart-tb.png'); registerTouchBarEntry(STOP_ID, stopLabel, 6, CONTEXT_IN_DEBUG_MODE, 'stop-tb.png'); } diff --git a/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts b/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts index 60396f96a64..29d91beb05e 100644 --- a/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts +++ b/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts @@ -9,11 +9,10 @@ import { IExperimentService, IExperiment, ExperimentActionType, IExperimentActio import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { language } from 'vs/base/common/platform'; export class ExperimentalPrompts extends Disposable implements IWorkbenchContribution { - private _disposables: IDisposable[] = []; constructor( @IExperimentService private readonly experimentService: IExperimentService, @@ -23,11 +22,11 @@ export class ExperimentalPrompts extends Disposable implements IWorkbenchContrib ) { super(); - this.experimentService.onExperimentEnabled(e => { + this._register(this.experimentService.onExperimentEnabled(e => { if (e.action && e.action.type === ExperimentActionType.Prompt && e.state === ExperimentState.Run) { this.showExperimentalPrompts(e); } - }, this, this._disposables); + }, this)); } private showExperimentalPrompts(experiment: IExperiment): void { @@ -91,10 +90,6 @@ export class ExperimentalPrompts extends Disposable implements IWorkbenchContrib }); } - dispose() { - this._disposables = dispose(this._disposables); - } - static getLocalizedText(text: string | { [key: string]: string }, displayLanguage: string): string { if (typeof text === 'string') { return text; diff --git a/src/vs/workbench/contrib/experiments/node/experimentService.ts b/src/vs/workbench/contrib/experiments/node/experimentService.ts index ba112f8f055..b20c247e95a 100644 --- a/src/vs/workbench/contrib/experiments/node/experimentService.ts +++ b/src/vs/workbench/contrib/experiments/node/experimentService.ts @@ -115,9 +115,9 @@ export class ExperimentService extends Disposable implements IExperimentService private _curatedMapping = Object.create(null); private _disposables: IDisposable[] = []; - private readonly _onExperimentEnabled = new Emitter(); - + private readonly _onExperimentEnabled = this._register(new Emitter()); onExperimentEnabled: Event = this._onExperimentEnabled.event; + constructor( @IStorageService private readonly storageService: IStorageService, @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService, diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts index 3b55b40e836..abd20f5b63a 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts @@ -13,7 +13,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { Cache, CacheResult } from 'vs/base/common/cache'; import { Action } from 'vs/base/common/actions'; import { isPromiseCanceledError } from 'vs/base/common/errors'; -import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, toDisposable, Disposable } from 'vs/base/common/lifecycle'; import { domEvent } from 'vs/base/browser/event'; import { append, $, addClass, removeClass, finalHandler, join, toggleClass, hide, show } from 'vs/base/browser/dom'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; @@ -85,9 +85,9 @@ function removeEmbeddedSVGs(documentContent: string): string { return newDocument.documentElement.outerHTML; } -class NavBar { +class NavBar extends Disposable { - private _onChange = new Emitter<{ id: string | null, focus: boolean }>(); + private _onChange = this._register(new Emitter<{ id: string | null, focus: boolean }>()); get onChange(): Event<{ id: string | null, focus: boolean }> { return this._onChange.event; } private currentId: string | null = null; @@ -95,9 +95,10 @@ class NavBar { private actionbar: ActionBar; constructor(container: HTMLElement) { + super(); const element = append(container, $('.navbar')); this.actions = []; - this.actionbar = new ActionBar(element, { animated: false }); + this.actionbar = this._register(new ActionBar(element, { animated: false })); } push(id: string, label: string, tooltip: string): void { @@ -128,10 +129,6 @@ class NavBar { this.actions.forEach(a => a.enabled = a.id !== id); return Promise.resolve(undefined); } - - dispose(): void { - dispose(this.actionbar); - } } const NavbarSection = { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts index ba30a59883f..886d540c242 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts @@ -11,7 +11,7 @@ import { match } from 'vs/base/common/glob'; import * as json from 'vs/base/common/json'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, ExtensionRecommendationReason, EXTENSION_IDENTIFIER_PATTERN, - IExtensionsConfigContent, RecommendationChangeNotification, IExtensionRecommendation, ExtensionRecommendationSource, InstallOperation + IExtensionsConfigContent, RecommendationChangeNotification, IExtensionRecommendation, ExtensionRecommendationSource, InstallOperation, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ITextModel } from 'vs/editor/common/model'; @@ -87,7 +87,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe public loadWorkspaceConfigPromise: Promise; private proactiveRecommendationsFetched: boolean = false; - private readonly _onRecommendationChange = new Emitter(); + private readonly _onRecommendationChange = this._register(new Emitter()); onRecommendationChange: Event = this._onRecommendationChange.event; private sessionSeed: number; @@ -581,8 +581,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe * or prompt to search the marketplace if it has extensions that can support the file type */ private promptFiletypeBasedRecommendations(model: ITextModel): void { - let hasSuggestion = false; - const uri = model.uri; if (!uri || !this.fileService.canHandleResource(uri)) { return; @@ -596,231 +594,244 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe processedFileExtensions.push(fileExtension); } - // re-schedule this bit of the operation to be off - // the critical path - in case glob-match is slow - setImmediate(() => { - - let recommendationsToSuggest: string[] = []; - const now = Date.now(); - forEach(this._availableRecommendations, entry => { - let { key: pattern, value: ids } = entry; - if (match(pattern, uri.path)) { - for (let id of ids) { - if (caseInsensitiveGet(product.extensionImportantTips, id)) { - recommendationsToSuggest.push(id); - } - const filedBasedRecommendation = this._fileBasedRecommendations[id.toLowerCase()] || { recommendedTime: now, sources: [] }; - filedBasedRecommendation.recommendedTime = now; - if (!filedBasedRecommendation.sources.some(s => s instanceof URI && s.toString() === uri.toString())) { - filedBasedRecommendation.sources.push(uri); - } - this._fileBasedRecommendations[id.toLowerCase()] = filedBasedRecommendation; - } - } - }); - - this.storageService.store( - 'extensionsAssistant/recommendations', - JSON.stringify(Object.keys(this._fileBasedRecommendations).reduce((result, key) => { result[key] = this._fileBasedRecommendations[key].recommendedTime; return result; }, {})), - StorageScope.GLOBAL - ); - - const config = this.configurationService.getValue(ConfigurationKey); - if (config.ignoreRecommendations || config.showRecommendationsOnlyOnDemand) { + // re-schedule this bit of the operation to be off the critical path - in case glob-match is slow + setImmediate(async () => { + const installed = await this.extensionManagementService.getInstalled(ExtensionType.User); + if (await this.promptRecommendedExtensionForFileType(model, installed)) { return; } - const importantRecommendationsIgnoreList = JSON.parse(this.storageService.get('extensionsAssistant/importantRecommendationsIgnore', StorageScope.GLOBAL, '[]')); - recommendationsToSuggest = recommendationsToSuggest.filter(id => importantRecommendationsIgnoreList.indexOf(id) === -1 && this.isExtensionAllowedToBeRecommended(id)); + if (fileExtension) { + fileExtension = fileExtension.substr(1); // Strip the dot + } + if (!fileExtension) { + return; + } - const importantTipsPromise = recommendationsToSuggest.length === 0 ? Promise.resolve(null) : this.extensionWorkbenchService.queryLocal().then(local => { - const localExtensions = local.map(e => e.identifier); - recommendationsToSuggest = recommendationsToSuggest.filter(id => localExtensions.every(local => !areSameExtensions(local, { id }))); - if (!recommendationsToSuggest.length) { - return; - } - const id = recommendationsToSuggest[0]; - const entry = caseInsensitiveGet(product.extensionImportantTips, id); - if (!entry) { - return; - } - const name = entry['name']; + await this.extensionService.whenInstalledExtensionsRegistered(); + const mimeTypes = await guessMimeTypes(uri.fsPath); + if (mimeTypes.length !== 1 || mimeTypes[0] !== MIME_UNKNOWN) { + return; + } - // Indicates we have a suggested extension via the whitelist - hasSuggestion = true; + this.promptRecommendedExtensionForFileExtension(fileExtension, installed); + }); + } - let message = localize('reallyRecommended2', "The '{0}' extension is recommended for this file type.", name); - // Temporary fix for the only extension pack we recommend. See https://github.com/Microsoft/vscode/issues/35364 - if (id === 'vscjava.vscode-java-pack') { - message = localize('reallyRecommendedExtensionPack', "The '{0}' extension pack is recommended for this file type.", name); - } - - const setIgnoreRecommendationsConfig = (configVal: boolean) => { - this.configurationService.updateValue('extensions.ignoreRecommendations', configVal, ConfigurationTarget.USER); - if (configVal) { - const ignoreWorkspaceRecommendationsStorageKey = 'extensionsAssistant/workspaceRecommendationsIgnore'; - this.storageService.store(ignoreWorkspaceRecommendationsStorageKey, true, StorageScope.WORKSPACE); + private async promptRecommendedExtensionForFileType(model: ITextModel, installed: ILocalExtension[]): Promise { + let recommendationsToSuggest: string[] = []; + const now = Date.now(); + forEach(this._availableRecommendations, entry => { + let { key: pattern, value: ids } = entry; + if (match(pattern, model.uri.path)) { + for (let id of ids) { + if (caseInsensitiveGet(product.extensionImportantTips, id)) { + recommendationsToSuggest.push(id); } - }; - - this.notificationService.prompt(Severity.Info, message, - [{ - label: localize('install', 'Install'), - run: () => { - /* __GDPR__ - "extensionRecommendations:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'install', extensionId: name }); - this.instantiationService.createInstance(InstallRecommendedExtensionAction, id).run(); - } - }, { - label: localize('showRecommendations', "Show Recommendations"), - run: () => { - /* __GDPR__ - "extensionRecommendations:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'show', extensionId: name }); - - const recommendationsAction = this.instantiationService.createInstance(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, localize('showRecommendations', "Show Recommendations")); - recommendationsAction.run(); - recommendationsAction.dispose(); - } - }, { - label: choiceNever, - isSecondary: true, - run: () => { - importantRecommendationsIgnoreList.push(id); - this.storageService.store( - 'extensionsAssistant/importantRecommendationsIgnore', - JSON.stringify(importantRecommendationsIgnoreList), - StorageScope.GLOBAL - ); - /* __GDPR__ - "extensionRecommendations:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'neverShowAgain', extensionId: name }); - this.notificationService.prompt( - Severity.Info, - localize('ignoreExtensionRecommendations', "Do you want to ignore all extension recommendations?"), - [{ - label: localize('ignoreAll', "Yes, Ignore All"), - run: () => setIgnoreRecommendationsConfig(true) - }, { - label: localize('no', "No"), - run: () => setIgnoreRecommendationsConfig(false) - }] - ); - } - }], - { - sticky: true, - onCancel: () => { - /* __GDPR__ - "extensionRecommendations:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'cancelled', extensionId: name }); - } + const filedBasedRecommendation = this._fileBasedRecommendations[id.toLowerCase()] || { recommendedTime: now, sources: [] }; + filedBasedRecommendation.recommendedTime = now; + if (!filedBasedRecommendation.sources.some(s => s instanceof URI && s.toString() === model.uri.toString())) { + filedBasedRecommendation.sources.push(model.uri); } - ); - }); - - const mimeTypesPromise = this.extensionService.whenInstalledExtensionsRegistered() - .then(() => { - return guessMimeTypes(uri.fsPath); - }); - - Promise.all([importantTipsPromise, mimeTypesPromise]).then(result => { - - const fileExtensionSuggestionIgnoreList = JSON.parse(this.storageService.get - ('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]')); - const mimeTypes = result[1]; - - if (fileExtension) { - fileExtension = fileExtension.substr(1); // Strip the dot + this._fileBasedRecommendations[id.toLowerCase()] = filedBasedRecommendation; } + } + }); - if (hasSuggestion || - !fileExtension || - mimeTypes.length !== 1 || - mimeTypes[0] !== MIME_UNKNOWN || - fileExtensionSuggestionIgnoreList.indexOf(fileExtension) > -1 - ) { - return; - } + this.storageService.store( + 'extensionsAssistant/recommendations', + JSON.stringify(Object.keys(this._fileBasedRecommendations).reduce((result, key) => { result[key] = this._fileBasedRecommendations[key].recommendedTime; return result; }, {})), + StorageScope.GLOBAL + ); - const lookup = product.extensionKeywords || {}; - const keywords = lookup[fileExtension] || []; - this._galleryService.query({ text: `tag:"__ext_${fileExtension}" ${keywords.map(tag => `tag:"${tag}"`)}` }, CancellationToken.None).then(pager => { - if (!pager || !pager.firstPage || !pager.firstPage.length) { - return; + const config = this.configurationService.getValue(ConfigurationKey); + if (config.ignoreRecommendations || config.showRecommendationsOnlyOnDemand) { + return false; + } + + const importantRecommendationsIgnoreList = JSON.parse(this.storageService.get('extensionsAssistant/importantRecommendationsIgnore', StorageScope.GLOBAL, '[]')); + const installedExtensionsIds = installed.reduce((result, i) => { result.add(i.identifier.id.toLowerCase()); return result; }, new Set()); + recommendationsToSuggest = recommendationsToSuggest.filter(id => { + if (importantRecommendationsIgnoreList.indexOf(id) !== -1) { + return false; + } + if (!this.isExtensionAllowedToBeRecommended(id)) { + return false; + } + if (installedExtensionsIds.has(id.toLowerCase())) { + return false; + } + return true; + }); + + if (recommendationsToSuggest.length === 0) { + return false; + } + + const id = recommendationsToSuggest[0]; + const entry = caseInsensitiveGet(product.extensionImportantTips, id); + if (!entry) { + return false; + } + const name = entry['name']; + + let message = localize('reallyRecommended2', "The '{0}' extension is recommended for this file type.", name); + // Temporary fix for the only extension pack we recommend. See https://github.com/Microsoft/vscode/issues/35364 + if (id === 'vscjava.vscode-java-pack') { + message = localize('reallyRecommendedExtensionPack', "The '{0}' extension pack is recommended for this file type.", name); + } + + const setIgnoreRecommendationsConfig = (configVal: boolean) => { + this.configurationService.updateValue('extensions.ignoreRecommendations', configVal, ConfigurationTarget.USER); + if (configVal) { + const ignoreWorkspaceRecommendationsStorageKey = 'extensionsAssistant/workspaceRecommendationsIgnore'; + this.storageService.store(ignoreWorkspaceRecommendationsStorageKey, true, StorageScope.WORKSPACE); + } + }; + + this.notificationService.prompt(Severity.Info, message, + [{ + label: localize('install', 'Install'), + run: () => { + /* __GDPR__ + "extensionRecommendations:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } } + */ + this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'install', extensionId: name }); + this.instantiationService.createInstance(InstallRecommendedExtensionAction, id).run(); + } + }, { + label: localize('showRecommendations', "Show Recommendations"), + run: () => { + /* __GDPR__ + "extensionRecommendations:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'show', extensionId: name }); + const recommendationsAction = this.instantiationService.createInstance(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, localize('showRecommendations', "Show Recommendations")); + recommendationsAction.run(); + recommendationsAction.dispose(); + } + }, { + label: choiceNever, + isSecondary: true, + run: () => { + importantRecommendationsIgnoreList.push(id); + this.storageService.store( + 'extensionsAssistant/importantRecommendationsIgnore', + JSON.stringify(importantRecommendationsIgnoreList), + StorageScope.GLOBAL + ); + /* __GDPR__ + "extensionRecommendations:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'neverShowAgain', extensionId: name }); this.notificationService.prompt( Severity.Info, - localize('showLanguageExtensions', "The Marketplace has extensions that can help with '.{0}' files", fileExtension), + localize('ignoreExtensionRecommendations', "Do you want to ignore all extension recommendations?"), [{ - label: searchMarketplace, - run: () => { - /* __GDPR__ - "fileExtensionSuggestion:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'ok', fileExtension: fileExtension }); - this.viewletService.openViewlet('workbench.view.extensions', true) - .then(viewlet => viewlet as IExtensionsViewlet) - .then(viewlet => { - viewlet.search(`ext:${fileExtension}`); - viewlet.focus(); - }); - } + label: localize('ignoreAll', "Yes, Ignore All"), + run: () => setIgnoreRecommendationsConfig(true) }, { - label: localize('dontShowAgainExtension', "Don't Show Again for '.{0}' files", fileExtension), - run: () => { - fileExtensionSuggestionIgnoreList.push(fileExtension); - this.storageService.store( - 'extensionsAssistant/fileExtensionsSuggestionIgnore', - JSON.stringify(fileExtensionSuggestionIgnoreList), - StorageScope.GLOBAL - ); - /* __GDPR__ - "fileExtensionSuggestion:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'neverShowAgain', fileExtension: fileExtension }); - } - }], - { - sticky: true, - onCancel: () => { - /* __GDPR__ - "fileExtensionSuggestion:popup" : { - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'cancelled', fileExtension: fileExtension }); - } - } + label: localize('no', "No"), + run: () => setIgnoreRecommendationsConfig(false) + }] ); - }); - }); - }); + } + }], + { + sticky: true, + onCancel: () => { + /* __GDPR__ + "extensionRecommendations:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('extensionRecommendations:popup', { userReaction: 'cancelled', extensionId: name }); + } + } + ); + + return true; + } + + private async promptRecommendedExtensionForFileExtension(fileExtension: string, installed: ILocalExtension[]): Promise { + const fileExtensionSuggestionIgnoreList = JSON.parse(this.storageService.get('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]')); + if (fileExtensionSuggestionIgnoreList.indexOf(fileExtension) > -1) { + return; + } + + const text = `ext:${fileExtension}`; + const pager = await this.extensionWorkbenchService.queryGallery({ text, pageSize: 100 }, CancellationToken.None); + if (pager.firstPage.length === 0) { + return; + } + + const installedExtensionsIds = installed.reduce((result, i) => { result.add(i.identifier.id.toLowerCase()); return result; }, new Set()); + if (pager.firstPage.some(e => installedExtensionsIds.has(e.identifier.id.toLowerCase()))) { + return; + } + + this.notificationService.prompt( + Severity.Info, + localize('showLanguageExtensions', "The Marketplace has extensions that can help with '.{0}' files", fileExtension), + [{ + label: searchMarketplace, + run: () => { + /* __GDPR__ + "fileExtensionSuggestion:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'ok', fileExtension: fileExtension }); + this.viewletService.openViewlet('workbench.view.extensions', true) + .then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search(`ext:${fileExtension}`); + viewlet.focus(); + }); + } + }, { + label: localize('dontShowAgainExtension', "Don't Show Again for '.{0}' files", fileExtension), + run: () => { + fileExtensionSuggestionIgnoreList.push(fileExtension); + this.storageService.store( + 'extensionsAssistant/fileExtensionsSuggestionIgnore', + JSON.stringify(fileExtensionSuggestionIgnoreList), + StorageScope.GLOBAL + ); + /* __GDPR__ + "fileExtensionSuggestion:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'neverShowAgain', fileExtension: fileExtension }); + } + }], + { + sticky: true, + onCancel: () => { + /* __GDPR__ + "fileExtensionSuggestion:popup" : { + "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "fileExtension": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } + } + */ + this.telemetryService.publicLog('fileExtensionSuggestion:popup', { userReaction: 'cancelled', fileExtension: fileExtension }); + } + } + ); } //#endregion diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts index 34a7d2fa6e1..2b777b19e76 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts @@ -432,7 +432,7 @@ CommandsRegistry.registerCommand({ const installed = await extensionManagementService.getInstalled(ExtensionType.User); const [extensionToUninstall] = installed.filter(e => areSameExtensions(e.identifier, { id })); if (!extensionToUninstall) { - return Promise.reject(new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, eg: ms-vscode.csharp.", id))); + return Promise.reject(new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, e.g.: ms-vscode.csharp.", id))); } await extensionManagementService.uninstall(extensionToUninstall, true); } catch (e) { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts index d467820816f..81b11ad1ec7 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts @@ -12,7 +12,7 @@ import { Event } from 'vs/base/common/event'; import * as json from 'vs/base/common/json'; import { ActionViewItem, Separator, IActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionbar'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -148,7 +148,6 @@ export class InstallAction extends ExtensionAction { private static readonly Class = 'extension-action prominent install'; private static readonly InstallingClass = 'extension-action install installing'; - private readonly disposables = new DisposableStore(); private _manifest: IExtensionManifest | null; set manifest(manifest: IExtensionManifest) { @@ -170,7 +169,7 @@ export class InstallAction extends ExtensionAction { ) { super(`extensions.install`, InstallAction.INSTALL_LABEL, InstallAction.Class, false); this.update(); - this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); + this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); } update(): void { @@ -270,11 +269,6 @@ export class InstallAction extends ExtensionAction { } return null; } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class RemoteInstallAction extends ExtensionAction { @@ -286,7 +280,6 @@ export class RemoteInstallAction extends ExtensionAction { private static readonly InstallingClass = 'extension-action install installing'; updateWhenCounterExtensionChanges: boolean = true; - private readonly disposables = new DisposableStore(); private installing: boolean = false; constructor( @@ -298,7 +291,7 @@ export class RemoteInstallAction extends ExtensionAction { @IProductService private readonly productService: IProductService, ) { super(`extensions.remoteinstall`, RemoteInstallAction.INSTALL_LABEL, RemoteInstallAction.Class, false); - this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); + this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); this.updateLabel(); this.update(); } @@ -355,11 +348,6 @@ export class RemoteInstallAction extends ExtensionAction { } } } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class LocalInstallAction extends ExtensionAction { @@ -371,7 +359,6 @@ export class LocalInstallAction extends ExtensionAction { private static readonly InstallingClass = 'extension-action install installing'; updateWhenCounterExtensionChanges: boolean = true; - private readonly disposables = new DisposableStore(); private installing: boolean = false; constructor( @@ -383,7 +370,7 @@ export class LocalInstallAction extends ExtensionAction { @IProductService private readonly productService: IProductService, ) { super(`extensions.localinstall`, LocalInstallAction.INSTALL_LABEL, LocalInstallAction.Class, false); - this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); + this._register(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this)); this.updateLabel(); this.update(); } @@ -435,11 +422,6 @@ export class LocalInstallAction extends ExtensionAction { } } } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class UninstallAction extends ExtensionAction { @@ -503,15 +485,14 @@ export class CombinedInstallAction extends ExtensionAction { private static readonly NoExtensionClass = 'extension-action prominent install no-extension'; private installAction: InstallAction; private uninstallAction: UninstallAction; - private readonly disposables = new DisposableStore(); constructor( @IInstantiationService instantiationService: IInstantiationService ) { super('extensions.combinedInstall', '', '', false); - this.installAction = this.disposables.add(instantiationService.createInstance(InstallAction)); - this.uninstallAction = this.disposables.add(instantiationService.createInstance(UninstallAction)); + this.installAction = this._register(instantiationService.createInstance(InstallAction)); + this.uninstallAction = this._register(instantiationService.createInstance(UninstallAction)); this.update(); } @@ -564,11 +545,6 @@ export class CombinedInstallAction extends ExtensionAction { return Promise.resolve(); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class UpdateAction extends ExtensionAction { @@ -671,8 +647,6 @@ export class ExtensionActionViewItem extends ActionViewItem { export abstract class ExtensionDropDownAction extends ExtensionAction { - protected readonly disposables = new DisposableStore(); - constructor( id: string, label: string, @@ -696,17 +670,10 @@ export abstract class ExtensionDropDownAction extends ExtensionAction { } return Promise.resolve(); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class DropDownMenuActionViewItem extends ExtensionActionViewItem { - private readonly disposables = new DisposableStore(); - constructor(action: ExtensionDropDownAction, tabOnlyOnFocus: boolean, @IContextMenuService private readonly contextMenuService: IContextMenuService @@ -735,11 +702,6 @@ export class DropDownMenuActionViewItem extends ExtensionActionViewItem { } return actions.length ? actions.slice(0, actions.length - 1) : actions; } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class ManageExtensionAction extends ExtensionDropDownAction { @@ -1191,8 +1153,6 @@ export class UpdateAllAction extends Action { static readonly ID = 'workbench.extensions.action.updateAllExtensions'; static LABEL = localize('updateAll', "Update All Extensions"); - private readonly disposables = new DisposableStore(); - constructor( id = UpdateAllAction.ID, label = UpdateAllAction.LABEL, @@ -1203,7 +1163,7 @@ export class UpdateAllAction extends Action { ) { super(id, label, '', false); - this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update())); + this._register(this.extensionsWorkbenchService.onChange(() => this.update())); this.update(); } @@ -1226,11 +1186,6 @@ export class UpdateAllAction extends Action { return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService); }); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class ReloadAction extends ExtensionAction { @@ -1239,7 +1194,6 @@ export class ReloadAction extends ExtensionAction { private static readonly DisabledClass = `${ReloadAction.EnabledClass} disabled`; updateWhenCounterExtensionChanges: boolean = true; - private readonly disposables = new DisposableStore(); private _runningExtensions: IExtensionDescription[] | null = null; constructor( @@ -1253,7 +1207,7 @@ export class ReloadAction extends ExtensionAction { @IProductService private readonly productService: IProductService, ) { super('extensions.reload', localize('reloadAction', "Reload"), ReloadAction.DisabledClass, false); - this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); + this._register(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); this.updateRunningExtensions(); } @@ -1363,11 +1317,6 @@ export class ReloadAction extends ExtensionAction { run(): Promise { return Promise.resolve(this.windowService.reloadWindow()); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class SetColorThemeAction extends ExtensionAction { @@ -1379,7 +1328,6 @@ export class SetColorThemeAction extends ExtensionAction { private static readonly EnabledClass = 'extension-action theme'; private static readonly DisabledClass = `${SetColorThemeAction.EnabledClass} disabled`; - private readonly disposables = new DisposableStore(); constructor( private readonly colorThemes: IColorTheme[], @@ -1389,7 +1337,7 @@ export class SetColorThemeAction extends ExtensionAction { @IConfigurationService private readonly configurationService: IConfigurationService ) { super(`extensions.colorTheme`, localize('color theme', "Set Color Theme"), SetColorThemeAction.DisabledClass, false); - this.disposables.add(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this)); + this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this)); this.update(); } @@ -1435,11 +1383,6 @@ export class SetColorThemeAction extends ExtensionAction { const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER; return this.workbenchThemeService.setColorTheme(pickedTheme ? pickedTheme.id : currentTheme.id, target); } - - dispose() { - this.disposables.dispose(); - super.dispose(); - } } export class SetFileIconThemeAction extends ExtensionAction { @@ -1447,7 +1390,6 @@ export class SetFileIconThemeAction extends ExtensionAction { private static readonly EnabledClass = 'extension-action theme'; private static readonly DisabledClass = `${SetFileIconThemeAction.EnabledClass} disabled`; - private readonly disposables = new DisposableStore(); static getFileIconThemes(fileIconThemes: IFileIconTheme[], extension: IExtension): IFileIconTheme[] { return fileIconThemes.filter(c => c.extensionData && ExtensionIdentifier.equals(c.extensionData.extensionId, extension.identifier.id)); @@ -1461,7 +1403,7 @@ export class SetFileIconThemeAction extends ExtensionAction { @IConfigurationService private readonly configurationService: IConfigurationService ) { super(`extensions.fileIconTheme`, localize('file icon theme', "Set File Icon Theme"), SetFileIconThemeAction.DisabledClass, false); - this.disposables.add(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this)); + this._register(Event.any(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this)); this.update(); } @@ -1507,11 +1449,6 @@ export class SetFileIconThemeAction extends ExtensionAction { const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER; return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, target); } - - dispose() { - this.disposables.dispose(); - super.dispose(); - } } export class OpenExtensionsViewletAction extends ShowViewletAction { @@ -1609,8 +1546,6 @@ export class ClearExtensionsInputAction extends Action { static readonly ID = 'workbench.extensions.action.clearExtensionsInput'; static LABEL = localize('clearExtensionsInput', "Clear Extensions Input"); - private readonly disposables = new DisposableStore(); - constructor( id: string, label: string, @@ -1620,7 +1555,7 @@ export class ClearExtensionsInputAction extends Action { ) { super(id, label, 'clear-extensions', true); this.onSearchChange(value); - this.disposables.add(onSearchChange(this.onSearchChange, this)); + this._register(onSearchChange(this.onSearchChange, this)); } private onSearchChange(value: string): void { @@ -1635,10 +1570,6 @@ export class ClearExtensionsInputAction extends Action { viewlet.focus(); }); } - - dispose(): void { - this.disposables.dispose(); - } } export class ShowBuiltInExtensionsAction extends Action { @@ -1843,7 +1774,6 @@ export class IgnoreExtensionRecommendationAction extends Action { private static readonly Class = 'extension-action ignore'; - private readonly disposables = new DisposableStore(); extension: IExtension; constructor( @@ -1860,11 +1790,6 @@ export class IgnoreExtensionRecommendationAction extends Action { this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.identifier.id, true); return Promise.resolve(); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class UndoIgnoreExtensionRecommendationAction extends Action { @@ -1873,7 +1798,6 @@ export class UndoIgnoreExtensionRecommendationAction extends Action { private static readonly Class = 'extension-action undo-ignore'; - private readonly disposables = new DisposableStore(); extension: IExtension; constructor( @@ -1890,11 +1814,6 @@ export class UndoIgnoreExtensionRecommendationAction extends Action { this.extensionsTipsService.toggleIgnoredRecommendation(this.extension.identifier.id, false); return Promise.resolve(); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } @@ -1970,7 +1889,6 @@ export class ShowAzureExtensionsAction extends Action { export class ChangeSortAction extends Action { private query: Query; - private readonly disposables = new DisposableStore(); constructor( id: string, @@ -1987,7 +1905,7 @@ export class ChangeSortAction extends Action { this.query = Query.parse(''); this.enabled = false; - this.disposables.add(onSearchChange(this.onSearchChange, this)); + this._register(onSearchChange(this.onSearchChange, this)); } private onSearchChange(value: string): void { @@ -2292,7 +2210,6 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi static readonly ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions'; static LABEL = localize('configureWorkspaceRecommendedExtensions', "Configure Recommended Extensions (Workspace)"); - private readonly disposables = new DisposableStore(); constructor( id: string, @@ -2305,7 +2222,7 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi @ITextModelService textModelResolverService: ITextModelService ) { super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService); - this.disposables.add(this.contextService.onDidChangeWorkbenchState(() => this.update(), this)); + this._register(this.contextService.onDidChangeWorkbenchState(() => this.update(), this)); this.update(); } @@ -2322,11 +2239,6 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi } return Promise.resolve(); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction { @@ -2334,7 +2246,6 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac static readonly ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions'; static LABEL = localize('configureWorkspaceFolderRecommendedExtensions', "Configure Recommended Extensions (Workspace Folder)"); - private readonly disposables = new DisposableStore(); constructor( id: string, @@ -2348,7 +2259,7 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac @ICommandService private readonly commandService: ICommandService ) { super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService); - this.disposables.add(this.contextService.onDidChangeWorkspaceFolders(() => this.update(), this)); + this._register(this.contextService.onDidChangeWorkspaceFolders(() => this.update(), this)); this.update(); } @@ -2367,11 +2278,6 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac return null; }); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class AddToWorkspaceFolderRecommendationsAction extends AbstractConfigureRecommendedExtensionsAction { @@ -2660,7 +2566,6 @@ export class DisabledLabelAction extends ExtensionAction { private static readonly Class = 'disable-status'; updateWhenCounterExtensionChanges: boolean = true; - private readonly disposables = new DisposableStore(); private _runningExtensions: IExtensionDescription[] | null = null; constructor( @@ -2669,8 +2574,8 @@ export class DisabledLabelAction extends ExtensionAction { @IExtensionService private readonly extensionService: IExtensionService, ) { super('extensions.disabledLabel', warningAction.tooltip, `${DisabledLabelAction.Class} hide`, false); - this.disposables.add(warningAction.onDidChange(() => this.update(), this)); - this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); + this._register(warningAction.onDidChange(() => this.update(), this)); + this._register(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); this.updateRunningExtensions(); } @@ -2703,11 +2608,6 @@ export class DisabledLabelAction extends ExtensionAction { run(): Promise { return Promise.resolve(null); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class SystemDisabledWarningAction extends ExtensionAction { @@ -2717,7 +2617,6 @@ export class SystemDisabledWarningAction extends ExtensionAction { private static readonly INFO_CLASS = `${SystemDisabledWarningAction.CLASS} info`; updateWhenCounterExtensionChanges: boolean = true; - private readonly disposables = new DisposableStore(); private _runningExtensions: IExtensionDescription[] | null = null; constructor( @@ -2730,8 +2629,8 @@ export class SystemDisabledWarningAction extends ExtensionAction { @IExtensionService private readonly extensionService: IExtensionService, ) { super('extensions.install', '', `${SystemDisabledWarningAction.CLASS} hide`, false); - this.disposables.add(this.labelService.onDidChangeFormatters(() => this.update(), this)); - this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); + this._register(this.labelService.onDidChangeFormatters(() => this.update(), this)); + this._register(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this)); this.updateRunningExtensions(); this.update(); } @@ -2802,11 +2701,6 @@ export class SystemDisabledWarningAction extends ExtensionAction { run(): Promise { return Promise.resolve(null); } - - dispose(): void { - this.disposables.dispose(); - super.dispose(); - } } export class DisableAllAction extends Action { @@ -2814,7 +2708,6 @@ export class DisableAllAction extends Action { static readonly ID = 'workbench.extensions.action.disableAll'; static LABEL = localize('disableAll', "Disable All Installed Extensions"); - private readonly disposables = new DisposableStore(); constructor( id: string = DisableAllAction.ID, label: string = DisableAllAction.LABEL, @@ -2823,7 +2716,7 @@ export class DisableAllAction extends Action { ) { super(id, label); this.update(); - this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update())); + this._register(this.extensionsWorkbenchService.onChange(() => this.update())); } private update(): void { @@ -2833,11 +2726,6 @@ export class DisableAllAction extends Action { run(): Promise { return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.Disabled); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class DisableAllWorkpsaceAction extends Action { @@ -2845,7 +2733,6 @@ export class DisableAllWorkpsaceAction extends Action { static readonly ID = 'workbench.extensions.action.disableAllWorkspace'; static LABEL = localize('disableAllWorkspace', "Disable All Installed Extensions for this Workspace"); - private readonly disposables = new DisposableStore(); constructor( id: string = DisableAllWorkpsaceAction.ID, label: string = DisableAllWorkpsaceAction.LABEL, @@ -2854,8 +2741,8 @@ export class DisableAllWorkpsaceAction extends Action { ) { super(id, label); this.update(); - this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this)); - this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update(), this)); + this._register(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this)); + this._register(this.extensionsWorkbenchService.onChange(() => this.update(), this)); } private update(): void { @@ -2865,11 +2752,6 @@ export class DisableAllWorkpsaceAction extends Action { run(): Promise { return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local.filter(e => e.type === ExtensionType.User), EnablementState.WorkspaceDisabled); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class EnableAllAction extends Action { @@ -2877,7 +2759,6 @@ export class EnableAllAction extends Action { static readonly ID = 'workbench.extensions.action.enableAll'; static LABEL = localize('enableAll', "Enable All Extensions"); - private readonly disposables = new DisposableStore(); constructor( id: string = EnableAllAction.ID, label: string = EnableAllAction.LABEL, @@ -2886,7 +2767,7 @@ export class EnableAllAction extends Action { ) { super(id, label); this.update(); - this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update())); + this._register(this.extensionsWorkbenchService.onChange(() => this.update())); } private update(): void { @@ -2896,11 +2777,6 @@ export class EnableAllAction extends Action { run(): Promise { return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.Enabled); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class EnableAllWorkpsaceAction extends Action { @@ -2908,7 +2784,6 @@ export class EnableAllWorkpsaceAction extends Action { static readonly ID = 'workbench.extensions.action.enableAllWorkspace'; static LABEL = localize('enableAllWorkspace', "Enable All Extensions for this Workspace"); - private readonly disposables = new DisposableStore(); constructor( id: string = EnableAllWorkpsaceAction.ID, label: string = EnableAllWorkpsaceAction.LABEL, @@ -2918,8 +2793,8 @@ export class EnableAllWorkpsaceAction extends Action { ) { super(id, label); this.update(); - this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update(), this)); - this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this)); + this._register(this.extensionsWorkbenchService.onChange(() => this.update(), this)); + this._register(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this)); } private update(): void { @@ -2929,11 +2804,6 @@ export class EnableAllWorkpsaceAction extends Action { run(): Promise { return this.extensionsWorkbenchService.setEnablement(this.extensionsWorkbenchService.local, EnablementState.WorkspaceEnabled); } - - dispose(): void { - super.dispose(); - this.disposables.dispose(); - } } export class OpenExtensionsFolderAction extends Action { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts index aac51bff673..585a81141ec 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { append, $, addClass, removeClass, toggleClass } from 'vs/base/browser/dom'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecycle'; import { Action } from 'vs/base/common/actions'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -116,10 +116,10 @@ export class Renderer implements IPagedRenderer { const extensionContainers: ExtensionContainers = this.instantiationService.createInstance(ExtensionContainers, [...actions, ...widgets, disabledLabelAction]); actionbar.push(actions, actionOptions); - const disposables = [...actions, ...widgets, actionbar, extensionContainers]; + const disposables = combinedDisposable(...actions, ...widgets, actionbar, extensionContainers); return { - root, element, icon, name, installCount, ratings, author, description, disposables, actionbar, + root, element, icon, name, installCount, ratings, author, description, disposables: [disposables], actionbar, extensionDisposables: [], set extension(extension: IExtension) { extensionContainers.extension = extension; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts index 7bad502bda4..2fbc338c721 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts @@ -8,7 +8,7 @@ import { localize } from 'vs/nls'; import { timeout, Delayer } from 'vs/base/common/async'; import { isPromiseCanceledError } from 'vs/base/common/errors'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { Event as EventOf, Emitter } from 'vs/base/common/event'; import { IAction } from 'vs/base/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; @@ -338,7 +338,6 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio private extensionsBox: HTMLElement; private primaryActions: IAction[]; private secondaryActions: IAction[] | null; - private disposables: IDisposable[] = []; private searchViewletState: object; constructor( @@ -373,14 +372,14 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio this.recommendedExtensionsContextKey = RecommendedExtensionsContext.bindTo(contextKeyService); this.defaultRecommendedExtensionsContextKey = DefaultRecommendedExtensionsContext.bindTo(contextKeyService); this.defaultRecommendedExtensionsContextKey.set(!this.configurationService.getValue(ShowRecommendationsOnlyOnDemandKey)); - this.disposables.push(this.viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); + this._register(this.viewletService.onDidViewletOpen(this.onViewletOpen, this)); this.searchViewletState = this.getMemento(StorageScope.WORKSPACE); this.extensionManagementService.getInstalled(ExtensionType.User).then(result => { this.hasInstalledExtensionsContextKey.set(result.length > 0); }); - this.configurationService.onDidChangeConfiguration(e => { + this._register(this.configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(AutoUpdateConfigurationKey)) { this.secondaryActions = null; this.updateTitleArea(); @@ -388,7 +387,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio if (e.affectedKeys.indexOf(ShowRecommendationsOnlyOnDemandKey) > -1) { this.defaultRecommendedExtensionsContextKey.set(!this.configurationService.getValue(ShowRecommendationsOnlyOnDemandKey)); } - }, this, this.disposables); + }, this)); } create(parent: HTMLElement): void { @@ -415,18 +414,18 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio this.triggerSearch(); } - this.disposables.push(attachSuggestEnabledInputBoxStyler(this.searchBox, this.themeService)); + this._register(attachSuggestEnabledInputBoxStyler(this.searchBox, this.themeService)); - this.disposables.push(this.searchBox); + this._register(this.searchBox); const _searchChange = new Emitter(); this.onSearchChange = _searchChange.event; - this.searchBox.onInputDidChange(() => { + this._register(this.searchBox.onInputDidChange(() => { this.triggerSearch(); _searchChange.fire(this.searchBox.getValue()); - }, this, this.disposables); + }, this)); - this.searchBox.onShouldFocusResults(() => this.focusListView(), this, this.disposables); + this._register(this.searchBox.onShouldFocusResults(() => this.focusListView(), this)); this._register(this.onDidChangeVisibility(visible => { if (visible) { @@ -613,24 +612,19 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio this.notificationService.error(err); } - - dispose(): void { - this.disposables = dispose(this.disposables); - super.dispose(); - } } -export class StatusUpdater implements IWorkbenchContribution { +export class StatusUpdater extends Disposable implements IWorkbenchContribution { - private disposables: IDisposable[]; - private badgeHandle: IDisposable; + private badgeHandle?: IDisposable; constructor( @IActivityService private readonly activityService: IActivityService, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService ) { - extensionsWorkbenchService.onChange(this.onServiceChange, this, this.disposables); + super(); + this._register(extensionsWorkbenchService.onChange(this.onServiceChange, this)); } private onServiceChange(): void { @@ -650,15 +644,13 @@ export class StatusUpdater implements IWorkbenchContribution { } dispose(): void { - this.disposables = dispose(this.disposables); + super.dispose(); dispose(this.badgeHandle); } } export class MaliciousExtensionChecker implements IWorkbenchContribution { - private disposables: IDisposable[]; - constructor( @IExtensionManagementService private readonly extensionsManagementService: IExtensionManagementService, @IWindowService private readonly windowService: IWindowService, @@ -703,8 +695,4 @@ export class MaliciousExtensionChecker implements IWorkbenchContribution { }).then(() => undefined); }, err => this.logService.error(err)); } - - dispose(): void { - this.disposables = dispose(this.disposables); - } } diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts index ed90afcd03a..e5f177c88b1 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { dispose, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; import { Event, Emitter } from 'vs/base/common/event'; -import { isPromiseCanceledError } from 'vs/base/common/errors'; +import { isPromiseCanceledError, getErrorMessage } from 'vs/base/common/errors'; import { PagedModel, IPagedModel, IPager, DelayedPagedModel } from 'vs/base/common/paging'; import { SortBy, SortOrder, IQueryOptions, IExtensionTipsService, IExtensionRecommendation, IExtensionManagementServer, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; @@ -24,14 +24,13 @@ import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { OpenGlobalSettingsAction } from 'vs/workbench/contrib/preferences/browser/preferencesActions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ActionBar, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { InstallWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, ManageExtensionAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import { WorkbenchPagedList } from 'vs/platform/list/browser/listService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { INotificationService } from 'vs/platform/notification/common/notification'; +import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { distinct, coalesce } from 'vs/base/common/arrays'; @@ -43,10 +42,10 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { IAction } from 'vs/base/common/actions'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; -import product from 'vs/platform/product/node/product'; import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil'; import { IProductService } from 'vs/platform/product/common/product'; +import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon'; class ExtensionsViewState extends Disposable implements IExtensionsViewState { @@ -69,9 +68,13 @@ export interface ExtensionsListViewOptions extends IViewletViewOptions { server?: IExtensionManagementServer; } +class ExtensionListViewWarning extends Error { } + export class ExtensionsListView extends ViewletPanel { private readonly server: IExtensionManagementServer | undefined; + private messageContainer: HTMLElement; + private messageSeverityIcon: HTMLElement; private messageBox: HTMLElement; private extensionsList: HTMLElement; private badge: CountBadge; @@ -90,7 +93,6 @@ export class ExtensionsListView extends ViewletPanel { @IExtensionsWorkbenchService protected extensionsWorkbenchService: IExtensionsWorkbenchService, @IEditorService private readonly editorService: IEditorService, @IExtensionTipsService protected tipsService: IExtensionTipsService, - @IModeService private readonly modeService: IModeService, @ITelemetryService private readonly telemetryService: ITelemetryService, @IConfigurationService configurationService: IConfigurationService, @IWorkspaceContextService protected contextService: IWorkspaceContextService, @@ -112,12 +114,14 @@ export class ExtensionsListView extends ViewletPanel { this.badgeContainer = append(container, $('.count-badge-wrapper')); this.badge = new CountBadge(this.badgeContainer); - this.disposables.push(attachBadgeStyler(this.badge, this.themeService)); + this._register(attachBadgeStyler(this.badge, this.themeService)); } renderBody(container: HTMLElement): void { this.extensionsList = append(container, $('.extensions-list')); - this.messageBox = append(container, $('.message')); + this.messageContainer = append(container, $('.message-container')); + this.messageSeverityIcon = append(this.messageContainer, $('')); + this.messageBox = append(this.messageContainer, $('.message')); const delegate = new Delegate(); const extensionsViewState = new ExtensionsViewState(); const renderer = this.instantiationService.createInstance(Renderer, extensionsViewState); @@ -127,20 +131,20 @@ export class ExtensionsListView extends ViewletPanel { setRowLineHeight: false, horizontalScrolling: false }) as WorkbenchPagedList; - this.list.onContextMenu(e => this.onContextMenu(e), this, this.disposables); - this.list.onFocusChange(e => extensionsViewState.onFocusChange(coalesce(e.elements)), this, this.disposables); - this.disposables.push(this.list); - this.disposables.push(extensionsViewState); + this._register(this.list.onContextMenu(e => this.onContextMenu(e), this)); + this._register(this.list.onFocusChange(e => extensionsViewState.onFocusChange(coalesce(e.elements)), this)); + this._register(this.list); + this._register(extensionsViewState); - Event.chain(this.list.onOpen) + this._register(Event.chain(this.list.onOpen) .map(e => e.elements[0]) .filter(e => !!e) - .on(this.openExtension, this, this.disposables); + .on(this.openExtension, this)); - Event.chain(this.list.onPin) + this._register(Event.chain(this.list.onPin) .map(e => e.elements[0]) .filter(e => !!e) - .on(this.pin, this, this.disposables); + .on(this.pin, this)); } protected layoutBody(height: number, width: number): void { @@ -178,12 +182,11 @@ export class ExtensionsListView extends ViewletPanel { }; - const errorCallback = (e: Error) => { + const errorCallback = (e: any) => { const model = new PagedModel([]); if (!isPromiseCanceledError(e)) { this.queryRequest = null; - console.warn('Error querying extensions gallery', e); - this.setModel(model, true); + this.setModel(model, e); } return this.list ? this.list.model : model; }; @@ -238,7 +241,11 @@ export class ExtensionsListView extends ViewletPanel { if (ExtensionsListView.isLocalExtensionsQuery(query.value) || /@builtin/.test(query.value)) { return this.queryLocal(query, options); } - return this.queryGallery(query, options, token); + return this.queryGallery(query, options, token) + .then(null, e => { + console.warn('Error querying extensions gallery', getErrorMessage(e)); + return Promise.reject(new ExtensionListViewWarning(localize('galleryError', "We cannot connect to the Extensions Marketplace at this time, please try again later."))); + }); } private async queryByIds(ids: string[], options: IQueryOptions, token: CancellationToken): Promise> { @@ -430,29 +437,11 @@ export class ExtensionsListView extends ViewletPanel { return this.getCuratedModel(query, options, token); } - let text = query.value; - const extensionRegex = /\bext:([^\s]+)\b/g; + const text = query.value; - if (extensionRegex.test(query.value)) { - text = query.value.replace(extensionRegex, (m, ext) => { - - // Get curated keywords - const lookup = product.extensionKeywords || {}; - const keywords = lookup[ext] || []; - - // Get mode name - const modeId = this.modeService.getModeIdByFilepathOrFirstLine(`.${ext}`); - const languageName = modeId && this.modeService.getLanguageName(modeId); - const languageTag = languageName ? ` tag:"${languageName}"` : ''; - - // Construct a rich query - return `tag:"__ext_${ext}" tag:"__ext_.${ext}" ${keywords.map(tag => `tag:"${tag}"`).join(' ')}${languageTag} tag:"${ext}"`; - }); - - if (text !== query.value) { - options = assign(options, { text: text.substr(0, 350), source: 'file-extension-tags' }); - return this.extensionsWorkbenchService.queryGallery(options, token).then(pager => this.getPagedModel(pager)); - } + if (/\bext:([^\s]+)\b/g.test(text)) { + options = assign(options, { text, source: 'file-extension-tags' }); + return this.extensionsWorkbenchService.queryGallery(options, token).then(pager => this.getPagedModel(pager)); } let preferredResults: string[] = []; @@ -696,23 +685,30 @@ export class ExtensionsListView extends ViewletPanel { }); } - private setModel(model: IPagedModel, isGalleryError?: boolean) { + private setModel(model: IPagedModel, error?: any) { if (this.list) { this.list.model = new DelayedPagedModel(model); this.list.scrollTop = 0; const count = this.count(); toggleClass(this.extensionsList, 'hidden', count === 0); - toggleClass(this.messageBox, 'hidden', count > 0); + toggleClass(this.messageContainer, 'hidden', count > 0); this.badge.setCount(count); if (count === 0 && this.isBodyVisible()) { - this.messageBox.textContent = isGalleryError ? localize('galleryError', "We cannot connect to the Extensions Marketplace at this time, please try again later.") : localize('no extensions found', "No extensions found."); - if (isGalleryError) { - alert(this.messageBox.textContent); + if (error) { + if (error instanceof ExtensionListViewWarning) { + this.messageSeverityIcon.className = SeverityIcon.className(Severity.Warning); + this.messageBox.textContent = getErrorMessage(error); + } else { + this.messageSeverityIcon.className = SeverityIcon.className(Severity.Error); + this.messageBox.textContent = localize('error', "Error while loading extensions. {0}", getErrorMessage(error)); + } + } else { + this.messageSeverityIcon.className = ''; + this.messageBox.textContent = localize('no extensions found', "No extensions found."); } - } else { - this.messageBox.textContent = ''; + alert(this.messageBox.textContent); } } } @@ -770,7 +766,6 @@ export class ExtensionsListView extends ViewletPanel { this.queryRequest.request.cancel(); this.queryRequest = null; } - this.disposables = dispose(this.disposables); this.list = null; } @@ -845,7 +840,6 @@ export class ServerExtensionsView extends ExtensionsListView { @IExtensionService extensionService: IExtensionService, @IEditorService editorService: IEditorService, @IExtensionTipsService tipsService: IExtensionTipsService, - @IModeService modeService: IModeService, @ITelemetryService telemetryService: ITelemetryService, @IConfigurationService configurationService: IConfigurationService, @IWorkspaceContextService contextService: IWorkspaceContextService, @@ -856,8 +850,8 @@ export class ServerExtensionsView extends ExtensionsListView { @IProductService productService: IProductService, ) { options.server = server; - super(options, notificationService, keybindingService, contextMenuService, instantiationService, themeService, extensionService, extensionsWorkbenchService, editorService, tipsService, modeService, telemetryService, configurationService, contextService, experimentService, workbenchThemeService, extensionManagementServerService, productService); - this.disposables.push(onDidChangeTitle(title => this.updateTitle(title))); + super(options, notificationService, keybindingService, contextMenuService, instantiationService, themeService, extensionService, extensionsWorkbenchService, editorService, tipsService, telemetryService, configurationService, contextService, experimentService, workbenchThemeService, extensionManagementServerService, productService); + this._register(onDidChangeTitle(title => this.updateTitle(title))); } async show(query: string): Promise> { @@ -909,7 +903,7 @@ export class DefaultRecommendedExtensionsView extends ExtensionsListView { renderBody(container: HTMLElement): void { super.renderBody(container); - this.disposables.push(this.tipsService.onRecommendationChange(() => { + this._register(this.tipsService.onRecommendationChange(() => { this.show(''); })); } @@ -934,7 +928,7 @@ export class RecommendedExtensionsView extends ExtensionsListView { renderBody(container: HTMLElement): void { super.renderBody(container); - this.disposables.push(this.tipsService.onRecommendationChange(() => { + this._register(this.tipsService.onRecommendationChange(() => { this.show(''); })); } @@ -951,9 +945,9 @@ export class WorkspaceRecommendedExtensionsView extends ExtensionsListView { renderBody(container: HTMLElement): void { super.renderBody(container); - this.disposables.push(this.tipsService.onRecommendationChange(() => this.update())); - this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.setRecommendationsToInstall())); - this.disposables.push(this.contextService.onDidChangeWorkbenchState(() => this.update())); + this._register(this.tipsService.onRecommendationChange(() => this.update())); + this._register(this.extensionsWorkbenchService.onChange(() => this.setRecommendationsToInstall())); + this._register(this.contextService.onDidChangeWorkbenchState(() => this.update())); } renderHeader(container: HTMLElement): void { @@ -962,21 +956,19 @@ export class WorkspaceRecommendedExtensionsView extends ExtensionsListView { const listActionBar = $('.list-actionbar-container'); container.insertBefore(listActionBar, this.badgeContainer); - const actionbar = new ActionBar(listActionBar, { + const actionbar = this._register(new ActionBar(listActionBar, { animated: false - }); + })); actionbar.onDidRun(({ error }) => error && this.notificationService.error(error)); - this.installAllAction = this.instantiationService.createInstance(InstallWorkspaceRecommendedExtensionsAction, InstallWorkspaceRecommendedExtensionsAction.ID, InstallWorkspaceRecommendedExtensionsAction.LABEL, []); - const configureWorkspaceFolderAction = this.instantiationService.createInstance(ConfigureWorkspaceFolderRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction.ID, ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL); + this.installAllAction = this._register(this.instantiationService.createInstance(InstallWorkspaceRecommendedExtensionsAction, InstallWorkspaceRecommendedExtensionsAction.ID, InstallWorkspaceRecommendedExtensionsAction.LABEL, [])); + const configureWorkspaceFolderAction = this._register(this.instantiationService.createInstance(ConfigureWorkspaceFolderRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction.ID, ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL)); this.installAllAction.class = 'octicon octicon-cloud-download'; configureWorkspaceFolderAction.class = 'octicon octicon-pencil'; actionbar.push([this.installAllAction], { icon: true, label: false }); actionbar.push([configureWorkspaceFolderAction], { icon: true, label: false }); - - this.disposables.push(...[this.installAllAction, configureWorkspaceFolderAction, actionbar]); } async show(query: string): Promise> { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css index c41cf354246..8c5bd336f10 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css +++ b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css @@ -81,22 +81,6 @@ width: 10px; } -.monaco-action-bar .action-item .action-label.system-disable.warning.icon { - background: url('status-warning.svg') center center no-repeat; -} - -.vs-dark .monaco-action-bar .action-item .action-label.system-disable.warning.icon { - background: url('status-warning-inverse.svg') center center no-repeat; -} - -.monaco-action-bar .action-item .action-label.system-disable.info.icon { - background: url('status-info.svg') center center no-repeat; -} - -.vs-dark .monaco-action-bar .action-item .action-label.system-disable.info.icon { - background: url('status-info-inverse.svg') center center no-repeat; -} - .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css index ca9ddecdcbb..04a567032a9 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css +++ b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css @@ -38,7 +38,7 @@ } .extensions-viewlet > .extensions .extensions-list.hidden, -.extensions-viewlet > .extensions .message.hidden { +.extensions-viewlet > .extensions .message-container.hidden { display: none; visibility: hidden; } @@ -51,9 +51,14 @@ flex: 1; } -.extensions-viewlet > .extensions .message { +.extensions-viewlet > .extensions .message-container { padding: 5px 9px 5px 16px; cursor: default; + display: flex; +} + +.extensions-viewlet > .extensions .message-container .message { + padding-left: 5px; } .extensions-viewlet > .extensions .monaco-list-row > .bookmark { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/status-info-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/status-info-inverse.svg deleted file mode 100644 index d38c363e0e4..00000000000 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/status-info-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/status-info.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/status-info.svg deleted file mode 100644 index 6e2e22f67bc..00000000000 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/status-info.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning-inverse.svg deleted file mode 100644 index df44e61b326..00000000000 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning.svg deleted file mode 100644 index f4e2a84b0af..00000000000 --- a/src/vs/workbench/contrib/extensions/electron-browser/media/status-warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts index 1362c838196..90098f68f30 100644 --- a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts @@ -9,7 +9,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { index, distinct } from 'vs/base/common/arrays'; import { ThrottledDelayer } from 'vs/base/common/async'; import { isPromiseCanceledError } from 'vs/base/common/errors'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IPager, mapPager, singlePagePager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { @@ -35,6 +35,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IFileService } from 'vs/platform/files/common/files'; import { IExtensionManifest, ExtensionType, IExtension as IPlatformExtension, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; +import { IModeService } from 'vs/editor/common/services/modeService'; interface IExtensionStateProvider { (extension: Extension): T; @@ -478,7 +479,6 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension private readonly remoteExtensions: Extensions | null; private syncDelayer: ThrottledDelayer; private autoUpdateDelayer: ThrottledDelayer; - private disposables: IDisposable[] = []; private readonly _onChange: Emitter = new Emitter(); get onChange(): Event { return this._onChange.event; } @@ -500,7 +500,8 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension @IProgressService private readonly progressService: IProgressService, @IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService, @IStorageService private readonly storageService: IStorageService, - @IFileService private readonly fileService: IFileService + @IFileService private readonly fileService: IFileService, + @IModeService private readonly modeService: IModeService ) { super(); this.localExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.localExtensionManagementServer)); @@ -517,7 +518,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension urlService.registerHandler(this); - this.configurationService.onDidChangeConfiguration(e => { + this._register(this.configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(AutoUpdateConfigurationKey)) { if (this.isAutoUpdateEnabled()) { this.checkForUpdates(); @@ -528,7 +529,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension this.checkForUpdates(); } } - }, this, this.disposables); + }, this)); this.queryLocal().then(() => { this.resetIgnoreAutoUpdateExtensions(); @@ -582,6 +583,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension queryGallery(arg1: any, arg2?: any): Promise> { const options: IQueryOptions = CancellationToken.isCancellationToken(arg1) ? {} : arg1; const token: CancellationToken = CancellationToken.isCancellationToken(arg1) ? arg1 : arg2; + options.text = options.text ? this.resolveQueryText(options.text) : options.text; return this.extensionService.getExtensionsReport() .then(report => { const maliciousSet = getMaliciousExtensionsSet(report); @@ -598,6 +600,27 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension }); } + private resolveQueryText(text: string): string { + const extensionRegex = /\bext:([^\s]+)\b/g; + if (extensionRegex.test(text)) { + text = text.replace(extensionRegex, (m, ext) => { + + // Get curated keywords + const lookup = product.extensionKeywords || {}; + const keywords = lookup[ext] || []; + + // Get mode name + const modeId = this.modeService.getModeIdByFilepathOrFirstLine(`.${ext}`); + const languageName = modeId && this.modeService.getLanguageName(modeId); + const languageTag = languageName ? ` tag:"${languageName}"` : ''; + + // Construct a rich query + return `tag:"__ext_${ext}" tag:"__ext_.${ext}" ${keywords.map(tag => `tag:"${tag}"`).join(' ')}${languageTag} tag:"${ext}"`; + }); + } + return text.substr(0, 350); + } + open(extension: IExtension, sideByside: boolean = false): Promise { return Promise.resolve(this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), undefined, sideByside ? SIDE_GROUP : ACTIVE_GROUP)); } @@ -1056,7 +1079,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } dispose(): void { + super.dispose(); this.syncDelayer.cancel(); - this.disposables = dispose(this.disposables); } } diff --git a/src/vs/workbench/contrib/files/browser/fileActions.ts b/src/vs/workbench/contrib/files/browser/fileActions.ts index 3eaffd752ea..8db75c0c984 100644 --- a/src/vs/workbench/contrib/files/browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/browser/fileActions.ts @@ -83,15 +83,13 @@ export class NewFileAction extends Action { static readonly ID = 'workbench.files.action.createFileFromExplorer'; static readonly LABEL = nls.localize('createNewFile', "New File"); - private toDispose: IDisposable[] = []; - constructor( @IExplorerService explorerService: IExplorerService, @ICommandService private commandService: ICommandService ) { super('explorer.newFile', NEW_FILE_LABEL); this.class = 'explorer-action new-file'; - this.toDispose.push(explorerService.onDidChangeEditable(e => { + this._register(explorerService.onDidChangeEditable(e => { const elementIsBeingEdited = explorerService.isEditable(e); this.enabled = !elementIsBeingEdited; })); @@ -100,11 +98,6 @@ export class NewFileAction extends Action { run(): Promise { return this.commandService.executeCommand(NEW_FILE_COMMAND_ID); } - - dispose(): void { - super.dispose(); - dispose(this.toDispose); - } } /* New Folder */ @@ -112,15 +105,13 @@ export class NewFolderAction extends Action { static readonly ID = 'workbench.files.action.createFolderFromExplorer'; static readonly LABEL = nls.localize('createNewFolder', "New Folder"); - private toDispose: IDisposable[] = []; - constructor( @IExplorerService explorerService: IExplorerService, @ICommandService private commandService: ICommandService ) { super('explorer.newFolder', NEW_FOLDER_LABEL); this.class = 'explorer-action new-folder'; - this.toDispose.push(explorerService.onDidChangeEditable(e => { + this._register(explorerService.onDidChangeEditable(e => { const elementIsBeingEdited = explorerService.isEditable(e); this.enabled = !elementIsBeingEdited; })); @@ -129,11 +120,6 @@ export class NewFolderAction extends Action { run(): Promise { return this.commandService.executeCommand(NEW_FOLDER_COMMAND_ID); } - - dispose(): void { - super.dispose(); - dispose(this.toDispose); - } } /* Create new file from anywhere: Open untitled */ @@ -508,7 +494,6 @@ export class ToggleAutoSaveAction extends Action { } export abstract class BaseSaveAllAction extends Action { - private toDispose: IDisposable[]; private lastIsDirty: boolean; constructor( @@ -521,7 +506,6 @@ export abstract class BaseSaveAllAction extends Action { ) { super(id, label); - this.toDispose = []; this.lastIsDirty = this.textFileService.isDirty(); this.enabled = this.lastIsDirty; @@ -534,13 +518,13 @@ export abstract class BaseSaveAllAction extends Action { private registerListeners(): void { // listen to files being changed locally - this.toDispose.push(this.textFileService.models.onModelsDirty(e => this.updateEnablement(true))); - this.toDispose.push(this.textFileService.models.onModelsSaved(e => this.updateEnablement(false))); - this.toDispose.push(this.textFileService.models.onModelsReverted(e => this.updateEnablement(false))); - this.toDispose.push(this.textFileService.models.onModelsSaveError(e => this.updateEnablement(true))); + this._register(this.textFileService.models.onModelsDirty(e => this.updateEnablement(true))); + this._register(this.textFileService.models.onModelsSaved(e => this.updateEnablement(false))); + this._register(this.textFileService.models.onModelsReverted(e => this.updateEnablement(false))); + this._register(this.textFileService.models.onModelsSaveError(e => this.updateEnablement(true))); if (this.includeUntitled()) { - this.toDispose.push(this.untitledEditorService.onDidChangeDirty(resource => this.updateEnablement(this.untitledEditorService.isDirty(resource)))); + this._register(this.untitledEditorService.onDidChangeDirty(resource => this.updateEnablement(this.untitledEditorService.isDirty(resource)))); } } @@ -557,12 +541,6 @@ export abstract class BaseSaveAllAction extends Action { return false; }); } - - public dispose(): void { - this.toDispose = dispose(this.toDispose); - - super.dispose(); - } } export class SaveAllAction extends BaseSaveAllAction { @@ -664,16 +642,14 @@ export class CollapseExplorerView extends Action { public static readonly ID = 'workbench.files.action.collapseExplorerFolders'; public static readonly LABEL = nls.localize('collapseExplorerFolders', "Collapse Folders in Explorer"); - private toDispose: IDisposable[] = []; - constructor( - id: string, + constructor(id: string, label: string, @IViewletService private readonly viewletService: IViewletService, @IExplorerService readonly explorerService: IExplorerService ) { super(id, label, 'explorer-action collapse-explorer'); - this.toDispose.push(explorerService.onDidChangeEditable(e => { + this._register(explorerService.onDidChangeEditable(e => { const elementIsBeingEdited = explorerService.isEditable(e); this.enabled = !elementIsBeingEdited; })); @@ -687,11 +663,6 @@ export class CollapseExplorerView extends Action { } }); } - - dispose(): void { - super.dispose(); - dispose(this.toDispose); - } } export class RefreshExplorerView extends Action { @@ -699,16 +670,14 @@ export class RefreshExplorerView extends Action { public static readonly ID = 'workbench.files.action.refreshFilesExplorer'; public static readonly LABEL = nls.localize('refreshExplorer', "Refresh Explorer"); - private toDispose: IDisposable[] = []; constructor( - id: string, - label: string, + id: string, label: string, @IViewletService private readonly viewletService: IViewletService, @IExplorerService private readonly explorerService: IExplorerService ) { super(id, label, 'explorer-action refresh-explorer'); - this.toDispose.push(explorerService.onDidChangeEditable(e => { + this._register(explorerService.onDidChangeEditable(e => { const elementIsBeingEdited = explorerService.isEditable(e); this.enabled = !elementIsBeingEdited; })); @@ -719,11 +688,6 @@ export class RefreshExplorerView extends Action { this.explorerService.refresh() ); } - - dispose(): void { - super.dispose(); - dispose(this.toDispose); - } } export class ShowOpenedFileInNewWindow extends Action { @@ -788,14 +752,6 @@ export function validateFileName(item: ExplorerItem, name: string): string | nul return nls.localize('invalidFileNameError', "The name **{0}** is not valid as a file or folder name. Please choose a different name.", trimLongName(name)); } - // Max length restriction (on Windows) - if (isWindows) { - const fullPathLength = item.resource.fsPath.length + 1 /* path segment */; - if (fullPathLength > 255) { - return nls.localize('filePathTooLongError', "The name **{0}** results in a path that is too long. Please choose a shorter name.", trimLongName(name)); - } - } - return null; } diff --git a/src/vs/workbench/contrib/files/browser/saveErrorHandler.ts b/src/vs/workbench/contrib/files/browser/saveErrorHandler.ts index 996aa2f8031..3dac8f515d1 100644 --- a/src/vs/workbench/contrib/files/browser/saveErrorHandler.ts +++ b/src/vs/workbench/contrib/files/browser/saveErrorHandler.ts @@ -175,7 +175,7 @@ export class SaveErrorHandler extends Disposable implements ISaveErrorHandler, I // Show message and keep function to hide in case the file gets saved/reverted const handle = this.notificationService.notify({ severity: Severity.Error, message, actions }); - Event.once(handle.onDidClose)(() => dispose(...actions.primary!, ...actions.secondary!)); + Event.once(handle.onDidClose)(() => { dispose(actions.primary!), dispose(actions.secondary!); }); this.messages.set(model.getResource(), handle); } @@ -258,7 +258,7 @@ class ResolveSaveConflictAction extends Action { actions.secondary!.push(this.instantiationService.createInstance(DoNotShowResolveConflictLearnMoreAction)); const handle = this.notificationService.notify({ severity: Severity.Info, message: conflictEditorHelp, actions }); - Event.once(handle.onDidClose)(() => dispose(...actions.primary!, ...actions.secondary!)); + Event.once(handle.onDidClose)(() => { dispose(actions.primary!); dispose(actions.secondary!); }); pendingResolveSaveConflictMessages.push(handle); } diff --git a/src/vs/workbench/contrib/files/browser/views/emptyView.ts b/src/vs/workbench/contrib/files/browser/views/emptyView.ts index c661cd4ce37..dc40cbe11c2 100644 --- a/src/vs/workbench/contrib/files/browser/views/emptyView.ts +++ b/src/vs/workbench/contrib/files/browser/views/emptyView.ts @@ -68,7 +68,7 @@ export class EmptyView extends ViewletPanel { this.button = new Button(messageContainer); attachButtonStyler(this.button, this.themeService); - this.disposables.push(this.button.onDidClick(() => { + this._register(this.button.onDidClick(() => { if (!this.actionRunner) { return; } @@ -82,7 +82,7 @@ export class EmptyView extends ViewletPanel { }); })); - this.disposables.push(new DragAndDropObserver(container, { + this._register(new DragAndDropObserver(container, { onDrop: e => { const color = this.themeService.getTheme().getColor(SIDE_BAR_BACKGROUND); container.style.backgroundColor = color ? color.toString() : ''; diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index 98bbf896b45..9c673a6ec5f 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -92,7 +92,7 @@ export class ExplorerView extends ViewletPanel { super({ ...(options as IViewletPanelOptions), id: ExplorerView.ID, ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section") }, keybindingService, contextMenuService, configurationService); this.resourceContext = instantiationService.createInstance(ResourceContextKey); - this.disposables.push(this.resourceContext); + this._register(this.resourceContext); this.folderContext = ExplorerFolderContext.bindTo(contextKeyService); this.readonlyContext = ExplorerResourceReadonlyContext.bindTo(contextKeyService); this.rootContext = ExplorerRootContext.bindTo(contextKeyService); @@ -100,8 +100,8 @@ export class ExplorerView extends ViewletPanel { const decorationProvider = new ExplorerDecorationsProvider(this.explorerService, contextService); decorationService.registerDecorationsProvider(decorationProvider); - this.disposables.push(decorationProvider); - this.disposables.push(this.resourceContext); + this._register(decorationProvider); + this._register(this.resourceContext); } get name(): string { @@ -119,7 +119,7 @@ export class ExplorerView extends ViewletPanel { // Memoized locals @memoize private get contributedContextMenu(): IMenu { const contributedContextMenu = this.menuService.createMenu(MenuId.ExplorerContext, this.tree.contextKeyService); - this.disposables.push(contributedContextMenu); + this._register(contributedContextMenu); return contributedContextMenu; } @@ -147,8 +147,8 @@ export class ExplorerView extends ViewletPanel { titleElement.title = title; }; - this.disposables.push(this.contextService.onDidChangeWorkspaceName(setHeader)); - this.disposables.push(this.labelService.onDidChangeFormatters(setHeader)); + this._register(this.contextService.onDidChangeWorkspaceName(setHeader)); + this._register(this.labelService.onDidChangeFormatters(setHeader)); setHeader(); } @@ -164,13 +164,13 @@ export class ExplorerView extends ViewletPanel { this.toolbar.setActions(this.getActions(), this.getSecondaryActions())(); } - this.disposables.push(this.labelService.onDidChangeFormatters(() => { + this._register(this.labelService.onDidChangeFormatters(() => { this._onDidChangeTitleArea.fire(); })); - this.disposables.push(this.explorerService.onDidChangeRoots(() => this.setTreeInput())); - this.disposables.push(this.explorerService.onDidChangeItem(e => this.refresh(e.recursive, e.item))); - this.disposables.push(this.explorerService.onDidChangeEditable(async e => { + this._register(this.explorerService.onDidChangeRoots(() => this.setTreeInput())); + this._register(this.explorerService.onDidChangeItem(e => this.refresh(e.recursive, e.item))); + this._register(this.explorerService.onDidChangeEditable(async e => { const isEditing = !!this.explorerService.getEditableData(e); if (isEditing) { @@ -188,22 +188,22 @@ export class ExplorerView extends ViewletPanel { this.tree.domFocus(); } })); - this.disposables.push(this.explorerService.onDidSelectResource(e => this.onSelectResource(e.resource, e.reveal))); - this.disposables.push(this.explorerService.onDidCopyItems(e => this.onCopyItems(e.items, e.cut, e.previouslyCutItems))); + this._register(this.explorerService.onDidSelectResource(e => this.onSelectResource(e.resource, e.reveal))); + this._register(this.explorerService.onDidCopyItems(e => this.onCopyItems(e.items, e.cut, e.previouslyCutItems))); // Update configuration const configuration = this.configurationService.getValue(); this.onConfigurationUpdated(configuration); // When the explorer viewer is loaded, listen to changes to the editor input - this.disposables.push(this.editorService.onDidActiveEditorChange(() => { + this._register(this.editorService.onDidActiveEditorChange(() => { this.selectActiveFile(true); })); // Also handle configuration updates - this.disposables.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getValue(), e))); + this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getValue(), e))); - this.disposables.push(this.onDidChangeBodyVisibility(async visible => { + this._register(this.onDidChangeBodyVisibility(async visible => { if (visible) { // If a refresh was requested and we are now visible, run it if (this.shouldRefresh) { @@ -264,15 +264,15 @@ export class ExplorerView extends ViewletPanel { private createTree(container: HTMLElement): void { this.filter = this.instantiationService.createInstance(FilesFilter); - this.disposables.push(this.filter); + this._register(this.filter); const explorerLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility }); - this.disposables.push(explorerLabels); + this._register(explorerLabels); const updateWidth = (stat: ExplorerItem) => this.tree.updateWidth(stat); const filesRenderer = this.instantiationService.createInstance(FilesRenderer, explorerLabels, updateWidth); - this.disposables.push(filesRenderer); + this._register(filesRenderer); - this.disposables.push(createFileIconThemableTreeContainerScope(container, this.themeService)); + this._register(createFileIconThemableTreeContainerScope(container, this.themeService)); this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, container, new ExplorerDelegate(), [filesRenderer], this.instantiationService.createInstance(ExplorerDataSource), { @@ -302,19 +302,19 @@ export class ExplorerView extends ViewletPanel { dnd: this.instantiationService.createInstance(FileDragAndDrop), autoExpandSingleChildren: true }) as WorkbenchAsyncDataTree; - this.disposables.push(this.tree); + this._register(this.tree); // Bind context keys FilesExplorerFocusedContext.bindTo(this.tree.contextKeyService); ExplorerFocusedContext.bindTo(this.tree.contextKeyService); // Update resource context based on focused element - this.disposables.push(this.tree.onDidChangeFocus(e => this.onFocusChanged(e.elements))); + this._register(this.tree.onDidChangeFocus(e => this.onFocusChanged(e.elements))); this.onFocusChanged([]); const explorerNavigator = new TreeResourceNavigator2(this.tree); - this.disposables.push(explorerNavigator); + this._register(explorerNavigator); // Open when selecting via keyboard - this.disposables.push(explorerNavigator.onDidOpenResource(e => { + this._register(explorerNavigator.onDidOpenResource(e => { const selection = this.tree.getSelection(); // Do not react if the user is expanding selection via keyboard. // Check if the item was previously also selected, if yes the user is simply expanding / collapsing current selection #66589. @@ -337,12 +337,12 @@ export class ExplorerView extends ViewletPanel { } })); - this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e))); + this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); // save view state on shutdown - this.storageService.onWillSaveState(() => { + this._register(this.storageService.onWillSaveState(() => { this.storageService.store(ExplorerView.TREE_VIEW_STATE_STORAGE_KEY, JSON.stringify(this.tree.getViewState()), StorageScope.WORKSPACE); - }, null, this.disposables); + }, null)); } // React on events diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index 80704ef56f2..3232960d880 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -96,14 +96,14 @@ export class OpenEditorsView extends ViewletPanel { this.registerUpdateEvents(); // Also handle configuration updates - this.disposables.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(e))); + this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(e))); // Handle dirty counter - this.disposables.push(this.untitledEditorService.onDidChangeDirty(() => this.updateDirtyIndicator())); - this.disposables.push(this.textFileService.models.onModelsDirty(() => this.updateDirtyIndicator())); - this.disposables.push(this.textFileService.models.onModelsSaved(() => this.updateDirtyIndicator())); - this.disposables.push(this.textFileService.models.onModelsSaveError(() => this.updateDirtyIndicator())); - this.disposables.push(this.textFileService.models.onModelsReverted(() => this.updateDirtyIndicator())); + this._register(this.untitledEditorService.onDidChangeDirty(() => this.updateDirtyIndicator())); + this._register(this.textFileService.models.onModelsDirty(() => this.updateDirtyIndicator())); + this._register(this.textFileService.models.onModelsSaved(() => this.updateDirtyIndicator())); + this._register(this.textFileService.models.onModelsSaveError(() => this.updateDirtyIndicator())); + this._register(this.textFileService.models.onModelsReverted(() => this.updateDirtyIndicator())); } private registerUpdateEvents(): void { @@ -163,16 +163,16 @@ export class OpenEditorsView extends ViewletPanel { } } })); - this.disposables.push(groupDisposables.get(group.id)!); + this._register(groupDisposables.get(group.id)!); }; this.editorGroupService.groups.forEach(g => addGroupListener(g)); - this.disposables.push(this.editorGroupService.onDidAddGroup(group => { + this._register(this.editorGroupService.onDidAddGroup(group => { addGroupListener(group); updateWholeList(); })); - this.disposables.push(this.editorGroupService.onDidMoveGroup(() => updateWholeList())); - this.disposables.push(this.editorGroupService.onDidRemoveGroup(group => { + this._register(this.editorGroupService.onDidMoveGroup(() => updateWholeList())); + this._register(this.editorGroupService.onDidRemoveGroup(group => { dispose(groupDisposables.get(group.id)); updateWholeList(); })); @@ -184,7 +184,7 @@ export class OpenEditorsView extends ViewletPanel { const count = dom.append(container, $('.count')); this.dirtyCountElement = dom.append(count, $('.monaco-count-badge')); - this.disposables.push((attachStylerCallback(this.themeService, { badgeBackground, badgeForeground, contrastBorder }, colors => { + this._register((attachStylerCallback(this.themeService, { badgeBackground, badgeForeground, contrastBorder }, colors => { const background = colors.badgeBackground ? colors.badgeBackground.toString() : null; const foreground = colors.badgeForeground ? colors.badgeForeground.toString() : null; const border = colors.contrastBorder ? colors.contrastBorder.toString() : null; @@ -220,11 +220,11 @@ export class OpenEditorsView extends ViewletPanel { identityProvider: { getId: (element: OpenEditor | IEditorGroup) => element instanceof OpenEditor ? element.getId() : element.id.toString() }, dnd: new OpenEditorsDragAndDrop(this.instantiationService, this.editorGroupService) }) as WorkbenchList; - this.disposables.push(this.list); - this.disposables.push(this.listLabels); + this._register(this.list); + this._register(this.listLabels); this.contributedContextMenu = this.menuService.createMenu(MenuId.OpenEditorsContext, this.list.contextKeyService); - this.disposables.push(this.contributedContextMenu); + this._register(this.contributedContextMenu); this.updateSize(); @@ -233,11 +233,11 @@ export class OpenEditorsView extends ViewletPanel { ExplorerFocusedContext.bindTo(this.list.contextKeyService); this.resourceContext = this.instantiationService.createInstance(ResourceContextKey); - this.disposables.push(this.resourceContext); + this._register(this.resourceContext); this.groupFocusedContext = OpenEditorsGroupContext.bindTo(this.contextKeyService); this.dirtyEditorFocusedContext = DirtyEditorContext.bindTo(this.contextKeyService); - this.disposables.push(this.list.onContextMenu(e => this.onListContextMenu(e))); + this._register(this.list.onContextMenu(e => this.onListContextMenu(e))); this.list.onFocusChange(e => { this.resourceContext.reset(); this.groupFocusedContext.reset(); @@ -252,12 +252,12 @@ export class OpenEditorsView extends ViewletPanel { }); // Open when selecting via keyboard - this.disposables.push(this.list.onMouseMiddleClick(e => { + this._register(this.list.onMouseMiddleClick(e => { if (e && e.element instanceof OpenEditor) { e.element.group.closeEditor(e.element.editor, { preserveFocus: true }); } })); - this.disposables.push(this.list.onDidOpen(e => { + this._register(this.list.onDidOpen(e => { const browserEvent = e.browserEvent; let openToSide = false; @@ -280,7 +280,7 @@ export class OpenEditorsView extends ViewletPanel { this.listRefreshScheduler.schedule(0); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && this.needsRefresh) { this.listRefreshScheduler.schedule(0); } diff --git a/src/vs/workbench/contrib/files/common/explorerService.ts b/src/vs/workbench/contrib/files/common/explorerService.ts index 204b23e1f02..1bd53c9b3f3 100644 --- a/src/vs/workbench/contrib/files/common/explorerService.ts +++ b/src/vs/workbench/contrib/files/common/explorerService.ts @@ -5,7 +5,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { IExplorerService, IEditableData, IFilesConfiguration, SortOrder, SortOrderConfiguration } from 'vs/workbench/contrib/files/common/files'; import { ExplorerItem, ExplorerModel } from 'vs/workbench/contrib/files/common/explorerModel'; import { URI } from 'vs/base/common/uri'; @@ -26,7 +26,7 @@ function getFileEventsExcludes(configurationService: IConfigurationService, root return (configuration && configuration.files && configuration.files.exclude) || Object.create(null); } -export class ExplorerService implements IExplorerService { +export class ExplorerService extends Disposable implements IExplorerService { _serviceBrand: any; private static readonly EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first @@ -36,7 +36,6 @@ export class ExplorerService implements IExplorerService { private _onDidChangeEditable = new Emitter(); private _onDidSelectResource = new Emitter<{ resource?: URI, reveal?: boolean }>(); private _onDidCopyItems = new Emitter<{ items: ExplorerItem[], cut: boolean, previouslyCutItems: ExplorerItem[] | undefined }>(); - private disposables: IDisposable[] = []; private editable: { stat: ExplorerItem, data: IEditableData } | undefined; private _sortOrder: SortOrder; private cutItems: ExplorerItem[] | undefined; @@ -50,6 +49,7 @@ export class ExplorerService implements IExplorerService { @IClipboardService private clipboardService: IClipboardService, @IEditorService private editorService: IEditorService ) { + super(); this._sortOrder = this.configurationService.getValue('explorer.sortOrder'); } @@ -88,18 +88,18 @@ export class ExplorerService implements IExplorerService { (root?: URI) => getFileEventsExcludes(this.configurationService, root), (event: IConfigurationChangeEvent) => event.affectsConfiguration(FILES_EXCLUDE_CONFIG) ); - this.disposables.push(fileEventsFilter); + this._register(fileEventsFilter); return fileEventsFilter; } @memoize get model(): ExplorerModel { const model = new ExplorerModel(this.contextService); - this.disposables.push(model); - this.disposables.push(this.fileService.onAfterOperation(e => this.onFileOperation(e))); - this.disposables.push(this.fileService.onFileChanges(e => this.onFileChanges(e))); - this.disposables.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getValue()))); - this.disposables.push(this.fileService.onDidChangeFileSystemProviderRegistrations(e => { + this._register(model); + this._register(this.fileService.onAfterOperation(e => this.onFileOperation(e))); + this._register(this.fileService.onFileChanges(e => this.onFileChanges(e))); + this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getValue()))); + this._register(this.fileService.onDidChangeFileSystemProviderRegistrations(e => { if (e.added && this.fileSystemProviderSchemes.has(e.scheme)) { // A file system provider got re-registered, we should update all file stats since they might change (got read-only) this._onDidChangeItem.fire({ recursive: true }); @@ -107,7 +107,7 @@ export class ExplorerService implements IExplorerService { this.fileSystemProviderSchemes.add(e.scheme); } })); - this.disposables.push(model.onDidChangeRoots(() => this._onDidChangeRoots.fire())); + this._register(model.onDidChangeRoots(() => this._onDidChangeRoots.fire())); return model; } @@ -375,8 +375,4 @@ export class ExplorerService implements IExplorerService { } } } - - dispose(): void { - dispose(this.disposables); - } } diff --git a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts index 37762b7c66f..496534157ce 100644 --- a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts +++ b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts @@ -26,7 +26,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ITextModel } from 'vs/editor/common/model'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { ILabelService } from 'vs/platform/label/common/label'; import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -46,7 +45,6 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution { @INotificationService private readonly _notificationService: INotificationService, @IQuickInputService private readonly _quickInputService: IQuickInputService, @IModeService private readonly _modeService: IModeService, - @IStatusbarService private readonly _statusbarService: IStatusbarService, @ILabelService private readonly _labelService: ILabelService, ) { super(); @@ -97,7 +95,7 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution { // formatter does not target this file const label = this._labelService.getUriLabel(document.uri, { relative: true }); const message = nls.localize('miss', "Extension '{0}' cannot format '{1}'", extension.displayName || extension.name, label); - this._statusbarService.setStatusMessage(message, 4000); + this._notificationService.status(message, { hideAfter: 4000 }); return undefined; } } else if (formatter.length === 1) { diff --git a/src/vs/workbench/contrib/logs/common/logs.contribution.ts b/src/vs/workbench/contrib/logs/common/logs.contribution.ts index 3ce77b24967..6572ee0474a 100644 --- a/src/vs/workbench/contrib/logs/common/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/common/logs.contribution.ts @@ -17,22 +17,24 @@ import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } fro import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { OpenLogsFolderAction, SetLogLevelAction } from 'vs/workbench/contrib/logs/common/logsActions'; import { ILogService, LogLevel } from 'vs/platform/log/common/log'; +import { IFileService, FileChangeType } from 'vs/platform/files/common/files'; +import { dirname } from 'vs/base/common/resources'; class LogOutputChannels extends Disposable implements IWorkbenchContribution { constructor( @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, - @ILogService logService: ILogService + @ILogService logService: ILogService, + @IFileService private readonly fileService: IFileService ) { super(); - let outputChannelRegistry = Registry.as(OutputExt.OutputChannels); - outputChannelRegistry.registerChannel({ id: Constants.mainLogChannelId, label: nls.localize('mainLog', "Main"), file: URI.file(join(environmentService.logsPath, `main.log`)), log: true }); - outputChannelRegistry.registerChannel({ id: Constants.sharedLogChannelId, label: nls.localize('sharedLog', "Shared"), file: URI.file(join(environmentService.logsPath, `sharedprocess.log`)), log: true }); - outputChannelRegistry.registerChannel({ id: Constants.rendererLogChannelId, label: nls.localize('rendererLog', "Window"), file: URI.file(join(environmentService.logsPath, `renderer${environmentService.configuration.windowId}.log`)), log: true }); + this.registerLogChannel(Constants.mainLogChannelId, nls.localize('mainLog', "Main"), URI.file(join(environmentService.logsPath, `main.log`))); + this.registerLogChannel(Constants.sharedLogChannelId, nls.localize('sharedLog', "Shared"), URI.file(join(environmentService.logsPath, `sharedprocess.log`))); + this.registerLogChannel(Constants.rendererLogChannelId, nls.localize('rendererLog', "Window"), URI.file(join(environmentService.logsPath, `renderer${environmentService.configuration.windowId}.log`))); const registerTelemetryChannel = (level: LogLevel) => { - if (level === LogLevel.Trace && !outputChannelRegistry.getChannel(Constants.telemetryLogChannelId)) { - outputChannelRegistry.registerChannel({ id: Constants.telemetryLogChannelId, label: nls.localize('telemetryLog', "Telemetry"), file: URI.file(join(environmentService.logsPath, `telemetry.log`)), log: true }); + if (level === LogLevel.Trace && !Registry.as(OutputExt.OutputChannels).getChannel(Constants.telemetryLogChannelId)) { + this.registerLogChannel(Constants.telemetryLogChannelId, nls.localize('telemetryLog', "Telemetry"), URI.file(join(environmentService.logsPath, `telemetry.log`))); } }; registerTelemetryChannel(logService.getLevel()); @@ -43,6 +45,25 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution { workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenLogsFolderAction, OpenLogsFolderAction.ID, OpenLogsFolderAction.LABEL), 'Developer: Open Log Folder', devCategory); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SetLogLevelAction, SetLogLevelAction.ID, SetLogLevelAction.LABEL), 'Developer: Set Log Level', devCategory); } + + private async registerLogChannel(id: string, label: string, file: URI): Promise { + const outputChannelRegistry = Registry.as(OutputExt.OutputChannels); + const exists = await this.fileService.exists(file); + if (exists) { + outputChannelRegistry.registerChannel({ id, label, file, log: true }); + return; + } + + const watcher = this.fileService.watch(dirname(file)); + const disposable = this.fileService.onFileChanges(e => { + if (e.contains(file, FileChangeType.ADDED)) { + watcher.dispose(); + disposable.dispose(); + outputChannelRegistry.registerChannel({ id, label, file, log: true }); + } + }); + } + } -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LogOutputChannels, LifecyclePhase.Eventually); \ No newline at end of file +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(LogOutputChannels, LifecyclePhase.Restored); \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts index 5bd59feaed1..9e5568ee46b 100644 --- a/src/vs/workbench/contrib/markers/browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/browser/markers.contribution.ts @@ -19,12 +19,17 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { ToggleMarkersPanelAction, ShowProblemsPanelAction } from 'vs/workbench/contrib/markers/browser/markersPanelActions'; import Constants from 'vs/workbench/contrib/markers/browser/constants'; import Messages from 'vs/workbench/contrib/markers/browser/messages'; -import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IMarkersWorkbenchService, MarkersWorkbenchService, ActivityUpdater } from 'vs/workbench/contrib/markers/browser/markers'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { ActivePanelContext } from 'vs/workbench/common/panel'; +import { Disposable } from 'vs/base/common/lifecycle'; +import { IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment, IStatusbarEntry } from 'vs/platform/statusbar/common/statusbar'; +import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; +import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; registerSingleton(IMarkersWorkbenchService, MarkersWorkbenchService, false); @@ -253,3 +258,87 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, { }, order: 4 }); + +CommandsRegistry.registerCommand('workbench.actions.view.toggleProblems', accessor => { + const panelService = accessor.get(IPanelService); + const layoutService = accessor.get(IWorkbenchLayoutService); + const panel = accessor.get(IPanelService).getActivePanel(); + if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) { + layoutService.setPanelHidden(true); + } else { + panelService.openPanel(Constants.MARKERS_PANEL_ID, true); + } +}); + +class MarkersStatusBarContributions extends Disposable implements IWorkbenchContribution { + + private markersStatusItem: IStatusbarEntryAccessor; + + constructor( + @IMarkerService private readonly markerService: IMarkerService, + @IStatusbarService private readonly statusbarService: IStatusbarService + ) { + super(); + this.markersStatusItem = this._register(this.statusbarService.addEntry(this.getMarkersItem(), StatusbarAlignment.LEFT, 50 /* Medium Priority */)); + this.markerService.onMarkerChanged(() => this.markersStatusItem.update(this.getMarkersItem())); + } + + private getMarkersItem(): IStatusbarEntry { + const markersStatistics = this.markerService.getStatistics(); + return { + text: this.getMarkersText(markersStatistics), + tooltip: this.getMarkersTooltip(markersStatistics), + command: 'workbench.actions.view.toggleProblems' + }; + } + + private getMarkersTooltip(stats: MarkerStatistics): string { + const errorTitle = (n: number) => localize('totalErrors', "{0} Errors", n); + const warningTitle = (n: number) => localize('totalWarnings', "{0} Warnings", n); + const infoTitle = (n: number) => localize('totalInfos', "{0} Infos", n); + + const titles: string[] = []; + + if (stats.errors > 0) { + titles.push(errorTitle(stats.errors)); + } + + if (stats.warnings > 0) { + titles.push(warningTitle(stats.warnings)); + } + + if (stats.infos > 0) { + titles.push(infoTitle(stats.infos)); + } + + if (titles.length === 0) { + return localize('noProblems', "No Problems"); + } + + return titles.join(', '); + } + + private getMarkersText(stats: MarkerStatistics): string { + const problemsText: string[] = []; + + // Errors + problemsText.push('$(error) ' + this.packNumber(stats.errors)); + + // Warnings + problemsText.push('$(warning) ' + this.packNumber(stats.warnings)); + + // Info (only if any) + if (stats.infos > 0) { + problemsText.push('$(info) ' + this.packNumber(stats.infos)); + } + + return problemsText.join(' '); + } + + private packNumber(n: number): string { + const manyProblems = localize('manyProblems', "10K+"); + return n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString(); + } +} + +workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, LifecyclePhase.Restored); \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/markersPanel.ts b/src/vs/workbench/contrib/markers/browser/markersPanel.ts index 7f666a9052b..8d47cfd91af 100644 --- a/src/vs/workbench/contrib/markers/browser/markersPanel.ts +++ b/src/vs/workbench/contrib/markers/browser/markersPanel.ts @@ -40,7 +40,6 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; import { domEvent } from 'vs/base/browser/event'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ResourceLabels } from 'vs/workbench/browser/labels'; import { IMarker } from 'vs/platform/markers/common/markers'; import { withUndefinedAsNull } from 'vs/base/common/types'; @@ -84,13 +83,12 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { private filter: Filter; - private _onDidFilter = new Emitter(); + private _onDidFilter = this._register(new Emitter()); readonly onDidFilter: Event = this._onDidFilter.event; private cachedFilterStats: { total: number; filtered: number; } | undefined = undefined; private currentResourceGotAddedToMarkersData: boolean = false; readonly markersViewModel: MarkersViewModel; - private disposables: IDisposable[] = []; constructor( @IInstantiationService private readonly instantiationService: IInstantiationService, @@ -110,7 +108,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { this.panelFoucusContextKey = Constants.MarkerPanelFocusContextKey.bindTo(contextKeyService); this.panelState = this.getMemento(StorageScope.WORKSPACE); this.markersViewModel = instantiationService.createInstance(MarkersViewModel, this.panelState['multiline']); - this.markersViewModel.onDidChange(this.onDidChangeViewState, this, this.disposables); + this._register(this.markersViewModel.onDidChange(this.onDidChangeViewState, this)); this.setCurrentActiveEditor(); } @@ -734,6 +732,5 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { super.dispose(); this.tree.dispose(); this.markersViewModel.dispose(); - this.disposables = dispose(this.disposables); } } diff --git a/src/vs/workbench/contrib/markers/browser/markersPanelActions.ts b/src/vs/workbench/contrib/markers/browser/markersPanelActions.ts index 3d633a1686b..d5ec9b684db 100644 --- a/src/vs/workbench/contrib/markers/browser/markersPanelActions.ts +++ b/src/vs/workbench/contrib/markers/browser/markersPanelActions.ts @@ -18,7 +18,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachInputBoxStyler, attachStylerCallback, attachCheckboxStyler } from 'vs/platform/theme/common/styler'; import { IMarkersWorkbenchService } from 'vs/workbench/contrib/markers/browser/markers'; -import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; +import { toDisposable } from 'vs/base/common/lifecycle'; import { BaseActionViewItem, ActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { localize } from 'vs/nls'; @@ -296,8 +296,6 @@ export class QuickFixAction extends Action { private static readonly CLASS: string = 'markers-panel-action-quickfix'; private static readonly AUTO_FIX_CLASS: string = QuickFixAction.CLASS + ' autofixable'; - private disposables: IDisposable[] = []; - private readonly _onShowQuickFixes: Emitter = new Emitter(); readonly onShowQuickFixes: Event = this._onShowQuickFixes.event; @@ -324,11 +322,6 @@ export class QuickFixAction extends Action { this._onShowQuickFixes.fire(); return Promise.resolve(); } - - dispose(): void { - dispose(this.disposables); - super.dispose(); - } } export class QuickFixActionViewItem extends ActionViewItem { diff --git a/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts b/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts index 235154cc1ff..74b8ca01acb 100644 --- a/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts @@ -43,6 +43,7 @@ import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { applyCodeAction } from 'vs/editor/contrib/codeAction/codeActionCommands'; +import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon'; export type TreeElement = ResourceMarkers | Marker | RelatedInformation; @@ -139,10 +140,9 @@ interface RelatedInformationFilterData { export type FilterData = ResourceMarkersFilterData | MarkerFilterData | RelatedInformationFilterData; -export class ResourceMarkersRenderer implements ITreeRenderer { +export class ResourceMarkersRenderer extends Disposable implements ITreeRenderer { private renderedNodes = new Map, IResourceMarkersTemplateData>(); - private disposables: IDisposable[] = []; constructor( private labels: ResourceLabels, @@ -150,7 +150,8 @@ export class ResourceMarkersRenderer implements ITreeRenderer, templateData: IResourceMarkersTemplateData): void { templateData.count.setCount(node.children.reduce((r, n) => r + (n.visible ? 1 : 0), 0)); } - - dispose(): void { - this.disposables = dispose(this.disposables); - } } export class FileResourceMarkersRenderer extends ResourceMarkersRenderer { @@ -255,7 +252,7 @@ class MarkerWidget extends Disposable { this.actionBar = this._register(new ActionBar(dom.append(parent, dom.$('.actions')), { actionViewItemProvider: (action) => action.id === QuickFixAction.ID ? instantiationService.createInstance(QuickFixActionViewItem, action) : undefined })); - this.icon = dom.append(parent, dom.$('.icon')); + this.icon = dom.append(parent, dom.$('')); this.multilineActionbar = this._register(new ActionBar(dom.append(parent, dom.$('.multiline-actions')))); this.messageAndDetailsContainer = dom.append(parent, dom.$('.marker-message-details')); this._register(toDisposable(() => this.disposables = dispose(this.disposables))); @@ -269,7 +266,7 @@ class MarkerWidget extends Disposable { } dom.clearNode(this.messageAndDetailsContainer); - this.icon.className = 'marker-icon ' + MarkerWidget.iconClassNameFor(element.marker); + this.icon.className = `marker-icon ${SeverityIcon.className(MarkerSeverity.toSeverity(element.marker.severity))}`; this.renderQuickfixActionbar(element); this.renderMultilineActionbar(element); @@ -345,20 +342,6 @@ class MarkerWidget extends Disposable { const lnCol = dom.append(parent, dom.$('span.marker-line')); lnCol.textContent = Messages.MARKERS_PANEL_AT_LINE_COL_NUMBER(marker.startLineNumber, marker.startColumn); } - - private static iconClassNameFor(element: IMarker): string { - switch (element.severity) { - case MarkerSeverity.Hint: - return 'info'; - case MarkerSeverity.Info: - return 'info'; - case MarkerSeverity.Warning: - return 'warning'; - case MarkerSeverity.Error: - return 'error'; - } - return ''; - } } export class RelatedInformationRenderer implements ITreeRenderer { diff --git a/src/vs/workbench/contrib/markers/browser/media/markers.css b/src/vs/workbench/contrib/markers/browser/media/markers.css index dbe9c34097e..1adb0c258bc 100644 --- a/src/vs/workbench/contrib/markers/browser/media/markers.css +++ b/src/vs/workbench/contrib/markers/browser/media/markers.css @@ -160,31 +160,6 @@ .markers-panel .monaco-tl-contents .marker-icon { height: 22px; - width: 16px; -} - -.markers-panel .marker-icon.warning { - background: url('status-warning.svg') center center no-repeat; -} - -.markers-panel .marker-icon.error { - background: url('status-error.svg') center center no-repeat; -} - -.markers-panel .marker-icon.info { - background: url('status-info.svg') center center no-repeat; -} - -.vs-dark .markers-panel .marker-icon.warning { - background: url('status-warning-inverse.svg') center center no-repeat; -} - -.vs-dark .markers-panel .marker-icon.error { - background: url('status-error-inverse.svg') center center no-repeat; -} - -.vs-dark .markers-panel .marker-icon.info { - background: url('status-info-inverse.svg') center center no-repeat; } .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix { diff --git a/src/vs/workbench/contrib/markers/browser/media/status-error-inverse.svg b/src/vs/workbench/contrib/markers/browser/media/status-error-inverse.svg deleted file mode 100644 index 3c852a7ffde..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-error-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/media/status-error.svg b/src/vs/workbench/contrib/markers/browser/media/status-error.svg deleted file mode 100644 index a1ddb39fed6..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-error.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/media/status-info-inverse.svg b/src/vs/workbench/contrib/markers/browser/media/status-info-inverse.svg deleted file mode 100644 index d38c363e0e4..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-info-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/media/status-info.svg b/src/vs/workbench/contrib/markers/browser/media/status-info.svg deleted file mode 100644 index 6e2e22f67bc..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-info.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/media/status-warning-inverse.svg b/src/vs/workbench/contrib/markers/browser/media/status-warning-inverse.svg deleted file mode 100644 index df44e61b326..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-warning-inverse.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/media/status-warning.svg b/src/vs/workbench/contrib/markers/browser/media/status-warning.svg deleted file mode 100644 index f4e2a84b0af..00000000000 --- a/src/vs/workbench/contrib/markers/browser/media/status-warning.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/contrib/markers/browser/messages.ts b/src/vs/workbench/contrib/markers/browser/messages.ts index e6b752e0574..0dc99d4f066 100644 --- a/src/vs/workbench/contrib/markers/browser/messages.ts +++ b/src/vs/workbench/contrib/markers/browser/messages.ts @@ -28,7 +28,7 @@ export default class Messages { public static MARKERS_PANEL_ACTION_TOOLTIP_FILTER: string = nls.localize('markers.panel.action.filter', "Filter Problems"); public static MARKERS_PANEL_ACTION_TOOLTIP_QUICKFIX: string = nls.localize('markers.panel.action.quickfix', "Show fixes"); public static MARKERS_PANEL_FILTER_ARIA_LABEL: string = nls.localize('markers.panel.filter.ariaLabel', "Filter Problems"); - public static MARKERS_PANEL_FILTER_PLACEHOLDER: string = nls.localize('markers.panel.filter.placeholder', "Filter. Eg: text, **/*.ts, !**/node_modules/**"); + public static MARKERS_PANEL_FILTER_PLACEHOLDER: string = nls.localize('markers.panel.filter.placeholder', "Filter. E.g.: text, **/*.ts, !**/node_modules/**"); public static MARKERS_PANEL_FILTER_ERRORS: string = nls.localize('markers.panel.filter.errors', "errors"); public static MARKERS_PANEL_FILTER_WARNINGS: string = nls.localize('markers.panel.filter.warnings', "warnings"); public static MARKERS_PANEL_FILTER_INFOS: string = nls.localize('markers.panel.filter.infos', "infos"); diff --git a/src/vs/workbench/contrib/outline/browser/outlinePanel.ts b/src/vs/workbench/contrib/outline/browser/outlinePanel.ts index 6c835eb5c06..c2670678d6b 100644 --- a/src/vs/workbench/contrib/outline/browser/outlinePanel.ts +++ b/src/vs/workbench/contrib/outline/browser/outlinePanel.ts @@ -304,7 +304,7 @@ export class OutlinePanel extends ViewletPanel { this._inputContainer = dom.$('.outline-input'); this._progressBar = new ProgressBar(progressContainer); - this.disposables.push(attachProgressBarStyler(this._progressBar, this._themeService)); + this._register(attachProgressBarStyler(this._progressBar, this._themeService)); let treeContainer = dom.$('.outline-tree'); dom.append( @@ -340,13 +340,13 @@ export class OutlinePanel extends ViewletPanel { }); // feature: filter on type - keep tree and menu in sync - this.disposables.push(this._tree.onDidUpdateOptions(e => { + this._register(this._tree.onDidUpdateOptions(e => { this._outlineViewState.filterOnType = Boolean(e.filterOnType); })); // feature: expand all nodes when filtering (not when finding) let viewState: IDataTreeViewState | undefined; - this.disposables.push(this._tree.onDidChangeTypeFilterPattern(pattern => { + this._register(this._tree.onDidChangeTypeFilterPattern(pattern => { if (!this._tree.options.filterOnType) { return; } @@ -360,13 +360,13 @@ export class OutlinePanel extends ViewletPanel { })); // feature: toggle icons - this.disposables.push(this._configurationService.onDidChangeConfiguration(e => { + this._register(this._configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(OutlineConfigKeys.icons)) { this._tree.updateChildren(); } })); - this.disposables.push(this.onDidChangeBodyVisibility(visible => { + this._register(this.onDidChangeBodyVisibility(visible => { if (visible && !this._requestOracle) { this._requestOracle = this._instantiationService.createInstance(RequestOracle, (editor: ICodeEditor | undefined, event: IModelContentChangedEvent | undefined) => this._doUpdate(editor, event), DocumentSymbolProviderRegistry); } else if (!visible) { @@ -390,20 +390,21 @@ export class OutlinePanel extends ViewletPanel { } getSecondaryActions(): IAction[] { - let group = new RadioGroup([ + const group = this._register(new RadioGroup([ new SimpleToggleAction(this._outlineViewState, localize('sortByPosition', "Sort By: Position"), () => this._outlineViewState.sortBy === OutlineSortOrder.ByPosition, _ => this._outlineViewState.sortBy = OutlineSortOrder.ByPosition), new SimpleToggleAction(this._outlineViewState, localize('sortByName', "Sort By: Name"), () => this._outlineViewState.sortBy === OutlineSortOrder.ByName, _ => this._outlineViewState.sortBy = OutlineSortOrder.ByName), new SimpleToggleAction(this._outlineViewState, localize('sortByKind', "Sort By: Type"), () => this._outlineViewState.sortBy === OutlineSortOrder.ByKind, _ => this._outlineViewState.sortBy = OutlineSortOrder.ByKind), - ]); - let result = [ + ])); + const result = [ new SimpleToggleAction(this._outlineViewState, localize('followCur', "Follow Cursor"), () => this._outlineViewState.followCursor, action => this._outlineViewState.followCursor = action.checked), new SimpleToggleAction(this._outlineViewState, localize('filterOnType', "Filter on Type"), () => this._outlineViewState.filterOnType, action => this._outlineViewState.filterOnType = action.checked), new Separator(), ...group.actions, ]; + for (const r of result) { + this._register(r); + } - this.disposables.push(...result); - this.disposables.push(group); return result; } diff --git a/src/vs/workbench/contrib/output/browser/outputServices.ts b/src/vs/workbench/contrib/output/browser/outputServices.ts index eb8ef512efd..b0258a7a742 100644 --- a/src/vs/workbench/contrib/output/browser/outputServices.ts +++ b/src/vs/workbench/contrib/output/browser/outputServices.ts @@ -68,7 +68,7 @@ export class OutputService extends Disposable implements IOutputService, ITextMo private activeChannelIdInStorage: string; private activeChannel?: OutputChannel; - private readonly _onActiveOutputChannel = new Emitter(); + private readonly _onActiveOutputChannel = this._register(new Emitter()); readonly onActiveOutputChannel: Event = this._onActiveOutputChannel.event; private _outputPanel: OutputPanel; diff --git a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts index 7152a8c871b..ec3f140038b 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts @@ -20,7 +20,6 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { writeTransientState } from 'vs/workbench/contrib/codeEditor/browser/toggleWordWrap'; import { mergeSort } from 'vs/base/common/arrays'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import product from 'vs/platform/product/node/product'; import pkg from 'vs/platform/product/node/package'; @@ -73,7 +72,6 @@ class PerfModelContentProvider implements ITextModelContentProvider { @ICodeEditorService private readonly _editorService: ICodeEditorService, @ILifecycleService private readonly _lifecycleService: ILifecycleService, @ITimerService private readonly _timerService: ITimerService, - @IEnvironmentService private readonly _envService: IEnvironmentService, @IExtensionService private readonly _extensionService: IExtensionService, ) { } @@ -107,7 +105,7 @@ class PerfModelContentProvider implements ITextModelContentProvider { ]).then(([metrics]) => { if (this._model && !this._model.isDisposed()) { - let stats = this._envService.args['prof-modules'] ? LoaderStats.get() : undefined; + let stats = LoaderStats.get(); let md = new MarkdownBuilder(); this._addSummary(md, metrics); md.blank(); @@ -136,7 +134,7 @@ class PerfModelContentProvider implements ITextModelContentProvider { md.li(`Memory(System): ${(metrics.totalmem / (1024 * 1024 * 1024)).toFixed(2)} GB(${(metrics.freemem / (1024 * 1024 * 1024)).toFixed(2)}GB free)`); } if (metrics.meminfo) { - md.li(`Memory(Process): ${(metrics.meminfo.workingSetSize / 1024).toFixed(2)} MB working set(${(metrics.meminfo.peakWorkingSetSize / 1024).toFixed(2)}MB peak, ${(metrics.meminfo.privateBytes / 1024).toFixed(2)}MB private, ${(metrics.meminfo.sharedBytes / 1024).toFixed(2)}MB shared)`); + md.li(`Memory(Process): ${(metrics.meminfo.workingSetSize / 1024).toFixed(2)} MB working set(${(metrics.meminfo.privateBytes / 1024).toFixed(2)}MB private, ${(metrics.meminfo.sharedBytes / 1024).toFixed(2)}MB shared)`); } md.li(`VM(likelyhood): ${metrics.isVMLikelyhood}%`); md.li(`Initial Startup: ${metrics.initialStartup}`); diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts index 5d394de29a2..2600517f9b1 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts @@ -84,7 +84,7 @@ export class PreferencesEditor extends BaseEditor { readonly minimumHeight = 260; - private _onDidCreateWidget = new Emitter<{ width: number; height: number; } | undefined>(); + private _onDidCreateWidget = this._register(new Emitter<{ width: number; height: number; } | undefined>()); readonly onDidSizeConstraintsChange: Event<{ width: number; height: number; } | undefined> = this._onDidCreateWidget.event; constructor( @@ -330,11 +330,6 @@ export class PreferencesEditor extends BaseEditor { this._lastReportedFilter = filter; } } - - dispose(): void { - this._onDidCreateWidget.dispose(); - super.dispose(); - } } class SettingsNavigator extends ArrayNavigator { @@ -774,10 +769,10 @@ class SideBySidePreferencesWidget extends Widget { private settingsTargetsWidget: SettingsTargetsWidget; - private readonly _onFocus = new Emitter(); + private readonly _onFocus = this._register(new Emitter()); readonly onFocus: Event = this._onFocus.event; - private readonly _onDidSettingsTargetChange = new Emitter(); + private readonly _onDidSettingsTargetChange = this._register(new Emitter()); readonly onDidSettingsTargetChange: Event = this._onDidSettingsTargetChange.event; private splitview: SplitView; diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts index ff56b5797de..6e820f58d02 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts @@ -56,13 +56,13 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend private modelChangeDelayer: Delayer = new Delayer(200); private associatedPreferencesModel: IPreferencesEditorModel; - private readonly _onFocusPreference = new Emitter(); + private readonly _onFocusPreference = this._register(new Emitter()); readonly onFocusPreference: Event = this._onFocusPreference.event; - private readonly _onClearFocusPreference = new Emitter(); + private readonly _onClearFocusPreference = this._register(new Emitter()); readonly onClearFocusPreference: Event = this._onClearFocusPreference.event; - private readonly _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>(); + private readonly _onUpdatePreference = this._register(new Emitter<{ key: string, value: any, source: IIndexedSetting }>()); readonly onUpdatePreference: Event<{ key: string, value: any, source: IIndexedSetting }> = this._onUpdatePreference.event; private filterResult: IFilterResult | undefined; @@ -233,13 +233,13 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR private bracesHidingRenderer: BracesHidingRenderer; private filterResult: IFilterResult | undefined; - private readonly _onUpdatePreference: Emitter<{ key: string, value: any, source: IIndexedSetting }> = new Emitter<{ key: string, value: any, source: IIndexedSetting }>(); + private readonly _onUpdatePreference = this._register(new Emitter<{ key: string, value: any, source: IIndexedSetting }>()); readonly onUpdatePreference: Event<{ key: string, value: any, source: IIndexedSetting }> = this._onUpdatePreference.event; - private readonly _onFocusPreference = new Emitter(); + private readonly _onFocusPreference = this._register(new Emitter()); readonly onFocusPreference: Event = this._onFocusPreference.event; - private readonly _onClearFocusPreference = new Emitter(); + private readonly _onClearFocusPreference = this._register(new Emitter()); readonly onClearFocusPreference: Event = this._onClearFocusPreference.event; constructor(protected editor: ICodeEditor, readonly preferencesModel: DefaultSettingsEditorModel, @@ -436,13 +436,13 @@ class DefaultSettingsHeaderRenderer extends Disposable { export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider { - private readonly _onHiddenAreasChanged = new Emitter(); + private readonly _onHiddenAreasChanged = this._register(new Emitter()); get onHiddenAreasChanged(): Event { return this._onHiddenAreasChanged.event; } private settingsGroups: ISettingsGroup[]; private hiddenGroups: ISettingsGroup[] = []; private settingsGroupTitleWidgets: SettingsGroupTitleWidget[]; - private disposables: IDisposable[] = []; + private renderDisposables: IDisposable[] = []; constructor(private editor: ICodeEditor, @IInstantiationService private readonly instantiationService: IInstantiationService @@ -474,8 +474,8 @@ export class SettingsGroupTitleRenderer extends Disposable implements HiddenArea const settingsGroupTitleWidget = this.instantiationService.createInstance(SettingsGroupTitleWidget, this.editor, group); settingsGroupTitleWidget.render(); this.settingsGroupTitleWidgets.push(settingsGroupTitleWidget); - this.disposables.push(settingsGroupTitleWidget); - this.disposables.push(settingsGroupTitleWidget.onToggled(collapsed => this.onToggled(collapsed, settingsGroupTitleWidget.settingsGroup))); + this.renderDisposables.push(settingsGroupTitleWidget); + this.renderDisposables.push(settingsGroupTitleWidget.onToggled(collapsed => this.onToggled(collapsed, settingsGroupTitleWidget.settingsGroup))); } this.settingsGroupTitleWidgets.reverse(); } @@ -515,7 +515,7 @@ export class SettingsGroupTitleRenderer extends Disposable implements HiddenArea private disposeWidgets() { this.hiddenGroups = []; - this.disposables = dispose(this.disposables); + this.renderDisposables = dispose(this.renderDisposables); } dispose() { diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts index 4ea4dfafd7d..f45d098fb72 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts @@ -12,7 +12,7 @@ import { Action, IAction } from 'vs/base/common/actions'; import { Emitter, Event } from 'vs/base/common/event'; import { MarkdownString } from 'vs/base/common/htmlContent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IMarginData } from 'vs/editor/browser/controller/mouseTarget'; import { ICodeEditor, IEditorMouseEvent, IViewZone, MouseTargetType } from 'vs/editor/browser/editorBrowser'; @@ -302,8 +302,6 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem { private detailsElement: HTMLElement; private dropDownElement: HTMLElement; - private disposables: IDisposable[] = []; - constructor( action: IAction, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @@ -312,7 +310,7 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem { super(null, action); const workspace = this.contextService.getWorkspace(); this._folder = workspace.folders.length === 1 ? workspace.folders[0] : null; - this.disposables.push(this.contextService.onDidChangeWorkspaceFolders(() => this.onWorkspaceFoldersChanged())); + this._register(this.contextService.onDidChangeWorkspaceFolders(() => this.onWorkspaceFoldersChanged())); } get folder(): IWorkspaceFolder | null { @@ -347,8 +345,8 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem { 'tabindex': '0' }, this.labelElement, this.detailsElement, this.dropDownElement); this._register(DOM.addDisposableListener(this.anchorElement, DOM.EventType.MOUSE_DOWN, e => DOM.EventHelper.stop(e))); - this.disposables.push(DOM.addDisposableListener(this.anchorElement, DOM.EventType.CLICK, e => this.onClick(e))); - this.disposables.push(DOM.addDisposableListener(this.anchorElement, DOM.EventType.KEY_UP, e => this.onKeyUp(e))); + this._register(DOM.addDisposableListener(this.anchorElement, DOM.EventType.CLICK, e => this.onClick(e))); + this._register(DOM.addDisposableListener(this.anchorElement, DOM.EventType.KEY_UP, e => this.onKeyUp(e))); DOM.append(this.container, this.anchorElement); @@ -460,11 +458,6 @@ export class FolderSettingsActionViewItem extends BaseActionViewItem { return label; } - - dispose(): void { - dispose(this.disposables); - super.dispose(); - } } export type SettingsTarget = ConfigurationTarget.USER_LOCAL | ConfigurationTarget.USER_REMOTE | ConfigurationTarget.WORKSPACE | URI; @@ -484,7 +477,7 @@ export class SettingsTargetsWidget extends Widget { private _settingsTarget: SettingsTarget; - private readonly _onDidTargetChange = new Emitter(); + private readonly _onDidTargetChange = this._register(new Emitter()); readonly onDidTargetChange: Event = this._onDidTargetChange.event; constructor( @@ -751,7 +744,7 @@ export class EditPreferenceWidget extends Disposable { private _editPreferenceDecoration: string[]; - private readonly _onClick = new Emitter(); + private readonly _onClick = this._register(new Emitter()); get onClick(): Event { return this._onClick.event; } constructor(private editor: ICodeEditor diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index d1d6f454be4..f4f0d903e6f 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -25,7 +25,7 @@ import { Color, RGBA } from 'vs/base/common/color'; import { onUnexpectedError } from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ISpliceable } from 'vs/base/common/sequence'; import { escapeRegExpCharacters, startsWith } from 'vs/base/common/strings'; import { URI } from 'vs/base/common/uri'; @@ -250,7 +250,7 @@ export interface ISettingOverrideClickEvent { targetKey: string; } -export abstract class AbstractSettingRenderer implements ITreeRenderer { +export abstract class AbstractSettingRenderer extends Disposable implements ITreeRenderer { /** To override */ abstract get templateId(): string; @@ -262,19 +262,19 @@ export abstract class AbstractSettingRenderer implements ITreeRenderer(); + private readonly _onDidClickOverrideElement = this._register(new Emitter()); readonly onDidClickOverrideElement: Event = this._onDidClickOverrideElement.event; - protected readonly _onDidChangeSetting = new Emitter(); + protected readonly _onDidChangeSetting = this._register(new Emitter()); readonly onDidChangeSetting: Event = this._onDidChangeSetting.event; - protected readonly _onDidOpenSettings = new Emitter(); + protected readonly _onDidOpenSettings = this._register(new Emitter()); readonly onDidOpenSettings: Event = this._onDidOpenSettings.event; - private readonly _onDidClickSettingLink = new Emitter(); + private readonly _onDidClickSettingLink = this._register(new Emitter()); readonly onDidClickSettingLink: Event = this._onDidClickSettingLink.event; - private readonly _onDidFocusSetting = new Emitter(); + private readonly _onDidFocusSetting = this._register(new Emitter()); readonly onDidFocusSetting: Event = this._onDidFocusSetting.event; // Put common injections back here @@ -288,6 +288,7 @@ export abstract class AbstractSettingRenderer implements ITreeRenderer { + toDispose.add(checkbox); + toDispose.add(checkbox.onChange(() => { if (template.onChange) { template.onChange(checkbox.checked); } @@ -952,7 +953,7 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre // Need to listen for mouse clicks on description and toggle checkbox - use target ID for safety // Also have to ignore embedded links - too buried to stop propagation - toDispose.push(DOM.addDisposableListener(descriptionElement, DOM.EventType.MOUSE_DOWN, (e) => { + toDispose.add(DOM.addDisposableListener(descriptionElement, DOM.EventType.MOUSE_DOWN, (e) => { const targetElement = e.target; const targetId = descriptionElement.getAttribute('checkbox_label_target_id'); @@ -969,10 +970,10 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre checkbox.domNode.classList.add(AbstractSettingRenderer.CONTROL_CLASS); const toolbarContainer = DOM.append(container, $('.setting-toolbar-container')); const toolbar = this.renderSettingToolbar(toolbarContainer); - toDispose.push(toolbar); + toDispose.add(toolbar); const template: ISettingBoolItemTemplate = { - toDispose, + toDispose: [toDispose], containerElement: container, categoryElement, @@ -988,16 +989,16 @@ export class SettingBoolRenderer extends AbstractSettingRenderer implements ITre this.addSettingElementFocusHandler(template); // Prevent clicks from being handled by list - toDispose.push(DOM.addDisposableListener(controlElement, 'mousedown', (e: IMouseEvent) => e.stopPropagation())); + toDispose.add(DOM.addDisposableListener(controlElement, 'mousedown', (e: IMouseEvent) => e.stopPropagation())); - toDispose.push(DOM.addStandardDisposableListener(controlElement, 'keydown', (e: StandardKeyboardEvent) => { + toDispose.add(DOM.addStandardDisposableListener(controlElement, 'keydown', (e: StandardKeyboardEvent) => { if (e.keyCode === KeyCode.Escape) { e.browserEvent.stopPropagation(); } })); - toDispose.push(DOM.addDisposableListener(titleElement, DOM.EventType.MOUSE_ENTER, e => container.classList.add('mouseover'))); - toDispose.push(DOM.addDisposableListener(titleElement, DOM.EventType.MOUSE_LEAVE, e => container.classList.remove('mouseover'))); + toDispose.add(DOM.addDisposableListener(titleElement, DOM.EventType.MOUSE_ENTER, e => container.classList.add('mouseover'))); + toDispose.add(DOM.addDisposableListener(titleElement, DOM.EventType.MOUSE_LEAVE, e => container.classList.remove('mouseover'))); return template; } diff --git a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts index 52c336dadc6..e495a488cfa 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts @@ -203,7 +203,7 @@ export class ExcludeSettingWidget extends Disposable { private model = new ExcludeSettingListModel(); - private readonly _onDidChangeExclude = new Emitter(); + private readonly _onDidChangeExclude = this._register(new Emitter()); readonly onDidChangeExclude: Event = this._onDidChangeExclude.event; get domNode(): HTMLElement { diff --git a/src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts b/src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts index 8d72b3c257a..67fa33738d1 100644 --- a/src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts @@ -30,7 +30,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { Disposable } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { timeout } from 'vs/base/common/async'; export const ALL_COMMANDS_PREFIX = '>'; @@ -377,12 +377,14 @@ class ActionCommandEntry extends BaseCommandEntry { const wordFilter = or(matchesPrefix, matchesWords, matchesContiguousSubString); -export class CommandsHandler extends QuickOpenHandler { +export class CommandsHandler extends QuickOpenHandler implements IDisposable { static readonly ID = 'workbench.picker.commands'; private commandHistoryEnabled: boolean; - private commandsHistory: CommandsHistory; + private readonly commandsHistory: CommandsHistory; + + private readonly disposables = new DisposableStore(); private waitedForExtensionsRegistered: boolean; @@ -396,7 +398,7 @@ export class CommandsHandler extends QuickOpenHandler { ) { super(); - this.commandsHistory = this.instantiationService.createInstance(CommandsHistory); + this.commandsHistory = this.disposables.add(this.instantiationService.createInstance(CommandsHistory)); this.extensionService.whenInstalledExtensionsRegistered().then(() => this.waitedForExtensionsRegistered = true); @@ -588,6 +590,10 @@ export class CommandsHandler extends QuickOpenHandler { getEmptyLabel(searchString: string): string { return nls.localize('noCommandsMatching', "No commands matching"); } + + dispose() { + this.disposables.dispose(); + } } registerEditorAction(CommandPaletteEditorAction); diff --git a/src/vs/workbench/contrib/scm/browser/scmViewlet.ts b/src/vs/workbench/contrib/scm/browser/scmViewlet.ts index cc190234150..c8ce3149021 100644 --- a/src/vs/workbench/contrib/scm/browser/scmViewlet.ts +++ b/src/vs/workbench/contrib/scm/browser/scmViewlet.ts @@ -241,23 +241,23 @@ export class MainPanel extends ViewletPanel { horizontalScrolling: false }) as WorkbenchList; - renderer.onDidRenderElement(e => this.list.updateWidth(this.viewModel.repositories.indexOf(e)), null, this.disposables); - this.list.onSelectionChange(this.onListSelectionChange, this, this.disposables); - this.list.onFocusChange(this.onListFocusChange, this, this.disposables); - this.list.onContextMenu(this.onListContextMenu, this, this.disposables); + this._register(renderer.onDidRenderElement(e => this.list.updateWidth(this.viewModel.repositories.indexOf(e)), null)); + this._register(this.list.onSelectionChange(this.onListSelectionChange, this)); + this._register(this.list.onFocusChange(this.onListFocusChange, this)); + this._register(this.list.onContextMenu(this.onListContextMenu, this)); - this.viewModel.onDidChangeVisibleRepositories(this.updateListSelection, this, this.disposables); + this._register(this.viewModel.onDidChangeVisibleRepositories(this.updateListSelection, this)); - this.viewModel.onDidSplice(({ index, deleteCount, elements }) => this.splice(index, deleteCount, elements), null, this.disposables); + this._register(this.viewModel.onDidSplice(({ index, deleteCount, elements }) => this.splice(index, deleteCount, elements), null)); this.splice(0, 0, this.viewModel.repositories); - this.disposables.push(this.list); + this._register(this.list); - this.configurationService.onDidChangeConfiguration(e => { + this._register(this.configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration('scm.providers.visible')) { this.updateBodySize(); } - }, this.disposables); + })); this.updateListSelection(); } @@ -699,6 +699,7 @@ export class RepositoryPanel extends ViewletPanel { private cachedHeight: number | undefined = undefined; private cachedWidth: number | undefined = undefined; + private cachedScrollTop: number | undefined = undefined; private inputBoxContainer: HTMLElement; private inputBox: InputBox; private listContainer: HTMLElement; @@ -727,8 +728,8 @@ export class RepositoryPanel extends ViewletPanel { super(options, keybindingService, contextMenuService, configurationService); this.menus = instantiationService.createInstance(SCMMenus, this.repository.provider); - this.disposables.push(this.menus); - this.menus.onDidChangeTitle(this._onDidChangeTitleArea.fire, this._onDidChangeTitleArea, this.disposables); + this._register(this.menus); + this._register(this.menus.onDidChangeTitle(this._onDidChangeTitleArea.fire, this._onDidChangeTitleArea)); this.contextKeyService = contextKeyService.createScoped(this.element); this.contextKeyService.createKey('scmRepository', this.repository); @@ -736,7 +737,7 @@ export class RepositoryPanel extends ViewletPanel { render(): void { super.render(); - this.menus.onDidChangeTitle(this.updateActions, this, this.disposables); + this._register(this.menus.onDidChangeTitle(this.updateActions, this)); } protected renderHeaderTitle(container: HTMLElement): void { @@ -758,8 +759,8 @@ export class RepositoryPanel extends ViewletPanel { protected renderBody(container: HTMLElement): void { const focusTracker = trackFocus(container); - this.disposables.push(focusTracker.onDidFocus(() => this.repository.focus())); - this.disposables.push(focusTracker); + this._register(focusTracker.onDidFocus(() => this.repository.focus())); + this._register(focusTracker); // Input this.inputBoxContainer = append(container, $('.scm-editor')); @@ -789,33 +790,33 @@ export class RepositoryPanel extends ViewletPanel { this.inputBox = new InputBox(this.inputBoxContainer, this.contextViewService, { flexibleHeight: true }); this.inputBox.setEnabled(this.isBodyVisible()); - this.disposables.push(attachInputBoxStyler(this.inputBox, this.themeService)); - this.disposables.push(this.inputBox); + this._register(attachInputBoxStyler(this.inputBox, this.themeService)); + this._register(this.inputBox); - this.inputBox.onDidChange(triggerValidation, null, this.disposables); + this._register(this.inputBox.onDidChange(triggerValidation, null)); const onKeyUp = domEvent(this.inputBox.inputElement, 'keyup'); const onMouseUp = domEvent(this.inputBox.inputElement, 'mouseup'); - Event.any(onKeyUp, onMouseUp)(triggerValidation, null, this.disposables); + this._register(Event.any(onKeyUp, onMouseUp)(triggerValidation, null)); this.inputBox.value = this.repository.input.value; - this.inputBox.onDidChange(value => this.repository.input.value = value, null, this.disposables); - this.repository.input.onDidChange(value => this.inputBox.value = value, null, this.disposables); + this._register(this.inputBox.onDidChange(value => this.repository.input.value = value, null)); + this._register(this.repository.input.onDidChange(value => this.inputBox.value = value, null)); updatePlaceholder(); - this.repository.input.onDidChangePlaceholder(updatePlaceholder, null, this.disposables); - this.keybindingService.onDidUpdateKeybindings(updatePlaceholder, null, this.disposables); + this._register(this.repository.input.onDidChangePlaceholder(updatePlaceholder, null)); + this._register(this.keybindingService.onDidUpdateKeybindings(updatePlaceholder, null)); - this.disposables.push(this.inputBox.onDidHeightChange(() => this.layoutBody())); + this._register(this.inputBox.onDidHeightChange(() => this.layoutBody())); if (this.repository.provider.onDidChangeCommitTemplate) { - this.repository.provider.onDidChangeCommitTemplate(this.updateInputBox, this, this.disposables); + this._register(this.repository.provider.onDidChangeCommitTemplate(this.updateInputBox, this)); } this.updateInputBox(); // Input box visibility - this.repository.input.onDidChangeVisibility(this.updateInputBoxVisibility, this, this.disposables); + this._register(this.repository.input.onDidChangeVisibility(this.updateInputBoxVisibility, this)); this.updateInputBoxVisibility(); // List @@ -830,7 +831,7 @@ export class RepositoryPanel extends ViewletPanel { const actionViewItemProvider = (action: IAction) => this.getActionViewItem(action); this.listLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility }); - this.disposables.push(this.listLabels); + this._register(this.listLabels); const renderers = [ new ResourceGroupRenderer(actionViewItemProvider, this.themeService, this.menus), @@ -843,20 +844,20 @@ export class RepositoryPanel extends ViewletPanel { horizontalScrolling: false }) as WorkbenchList; - Event.chain(this.list.onDidOpen) + this._register(Event.chain(this.list.onDidOpen) .map(e => e.elements[0]) .filter(e => !!e && isSCMResource(e)) - .on(this.open, this, this.disposables); + .on(this.open, this)); - Event.chain(this.list.onPin) + this._register(Event.chain(this.list.onPin) .map(e => e.elements[0]) .filter(e => !!e && isSCMResource(e)) - .on(this.pin, this, this.disposables); + .on(this.pin, this)); - this.list.onContextMenu(this.onListContextMenu, this, this.disposables); - this.disposables.push(this.list); + this._register(this.list.onContextMenu(this.onListContextMenu, this)); + this._register(this.list); - this.viewModel.onDidChangeVisibility(this.onDidChangeVisibility, this, this.disposables); + this._register(this.viewModel.onDidChangeVisibility(this.onDidChangeVisibility, this)); this.onDidChangeVisibility(this.viewModel.isVisible()); this.onDidChangeBodyVisibility(visible => this.inputBox.setEnabled(visible)); } @@ -866,6 +867,7 @@ export class RepositoryPanel extends ViewletPanel { const listSplicer = new ResourceGroupSplicer(this.repository.provider.groups, this.list); this.visibilityDisposables.push(listSplicer); } else { + this.cachedScrollTop = this.list.scrollTop; this.visibilityDisposables = dispose(this.visibilityDisposables); } } @@ -894,6 +896,13 @@ export class RepositoryPanel extends ViewletPanel { this.listContainer.style.height = `${height}px`; this.list.layout(height, width); } + + if (this.cachedScrollTop !== undefined && this.list.scrollTop !== this.cachedScrollTop) { + this.list.scrollTop = Math.min(this.cachedScrollTop, this.list.scrollHeight); + // Applying the cached scroll position just once until the next leave. + // This, also, avoids the scrollbar to flicker when resizing the sidebar. + this.cachedScrollTop = undefined; + } } focus(): void { diff --git a/src/vs/workbench/contrib/search/browser/openFileHandler.ts b/src/vs/workbench/contrib/search/browser/openFileHandler.ts index e347f82a4f7..495381f6beb 100644 --- a/src/vs/workbench/contrib/search/browser/openFileHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openFileHandler.ts @@ -117,7 +117,6 @@ export class OpenFileHandler extends QuickOpenHandler { private cacheState: CacheState; constructor( - @IEditorService private readonly editorService: IEditorService, @IInstantiationService private readonly instantiationService: IInstantiationService, @IWorkbenchThemeService private readonly themeService: IWorkbenchThemeService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @@ -208,7 +207,7 @@ export class OpenFileHandler extends QuickOpenHandler { private doResolveQueryOptions(query: IPreparedQuery, cacheKey?: string, maxSortedResults?: number): IFileQueryBuilderOptions { const queryOptions: IFileQueryBuilderOptions = { _reason: 'openFileHandler', - extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService), + extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources), filePattern: query.original, cacheKey }; @@ -233,7 +232,7 @@ export class OpenFileHandler extends QuickOpenHandler { private cacheQuery(cacheKey: string): IFileQuery { const options: IFileQueryBuilderOptions = { _reason: 'openFileHandler', - extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService), + extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources), filePattern: '', cacheKey: cacheKey, maxResults: 0, diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 59c898568bd..b9d91e16a7e 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -1194,7 +1194,7 @@ export class SearchView extends ViewletPanel { const options: ITextQueryBuilderOptions = { _reason: 'searchView', - extraFileResources: getOutOfWorkspaceEditorResources(this.editorService, this.contextService), + extraFileResources: this.instantiationService.invokeFunction(getOutOfWorkspaceEditorResources), maxResults: SearchView.MAX_TEXT_RESULTS, disregardIgnoreFiles: !useExcludesAndIgnoreFiles || undefined, disregardExcludeSettings: !useExcludesAndIgnoreFiles || undefined, diff --git a/src/vs/workbench/contrib/search/common/queryBuilder.ts b/src/vs/workbench/contrib/search/common/queryBuilder.ts index 15b93dff778..68f4e987871 100644 --- a/src/vs/workbench/contrib/search/common/queryBuilder.ts +++ b/src/vs/workbench/contrib/search/common/queryBuilder.ts @@ -288,7 +288,7 @@ export class QueryBuilder { globPortion = normalizeGlobPattern(globPortion); } - // One pathPortion to multiple expanded search paths (eg duplicate matching workspace folders) + // One pathPortion to multiple expanded search paths (e.g. duplicate matching workspace folders) const oneExpanded = this.expandOneSearchPath(pathPortion); // Expanded search paths to multiple resolved patterns (with ** and without) diff --git a/src/vs/workbench/contrib/search/common/search.ts b/src/vs/workbench/contrib/search/common/search.ts index 4522bf19d74..0f87a2f56f6 100644 --- a/src/vs/workbench/contrib/search/common/search.ts +++ b/src/vs/workbench/contrib/search/common/search.ts @@ -12,6 +12,8 @@ import { URI } from 'vs/base/common/uri'; import { toResource, SideBySideEditor } from 'vs/workbench/common/editor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { CancellationToken } from 'vs/base/common/cancellation'; +import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { IFileService } from 'vs/platform/files/common/files'; export interface IWorkspaceSymbol { name: string; @@ -81,15 +83,14 @@ export interface IWorkbenchSearchConfiguration extends ISearchConfiguration { /** * Helper to return all opened editors with resources not belonging to the currently opened workspace. */ -export function getOutOfWorkspaceEditorResources(editorService: IEditorService, contextService: IWorkspaceContextService): URI[] { - const resources: URI[] = []; +export function getOutOfWorkspaceEditorResources(accessor: ServicesAccessor): URI[] { + const editorService = accessor.get(IEditorService); + const contextService = accessor.get(IWorkspaceContextService); + const fileService = accessor.get(IFileService); - editorService.editors.forEach(editor => { - const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }); - if (resource && !contextService.isInsideWorkspace(resource)) { - resources.push(resource); - } - }); + const resources = editorService.editors + .map(editor => toResource(editor, { supportSideBySide: SideBySideEditor.MASTER })) + .filter(resource => !!resource && !contextService.isInsideWorkspace(resource) && fileService.canHandleResource(resource)); - return resources; + return resources as URI[]; } diff --git a/src/vs/workbench/contrib/search/common/searchModel.ts b/src/vs/workbench/contrib/search/common/searchModel.ts index 040e86f87fd..b3f27dc9e0f 100644 --- a/src/vs/workbench/contrib/search/common/searchModel.ts +++ b/src/vs/workbench/contrib/search/common/searchModel.ts @@ -8,7 +8,7 @@ import { CancellationTokenSource } from 'vs/base/common/cancellation'; import * as errors from 'vs/base/common/errors'; import { Emitter, Event } from 'vs/base/common/event'; import { getBaseLabel } from 'vs/base/common/labels'; -import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; import { ResourceMap, TernarySearchTree, values } from 'vs/base/common/map'; import * as objects from 'vs/base/common/objects'; import { lcut } from 'vs/base/common/strings'; @@ -1044,12 +1044,11 @@ export class RangeHighlightDecorations implements IDisposable { private _decorationId: string | null = null; private _model: ITextModel | null = null; - private _modelDisposables: IDisposable[] = []; + private readonly _modelDisposables = new DisposableStore(); constructor( @IModelService private readonly _modelService: IModelService - ) { - } + ) { } removeHighlightRange() { if (this._model && this._decorationId) { @@ -1081,12 +1080,12 @@ export class RangeHighlightDecorations implements IDisposable { if (this._model !== model) { this.disposeModelListeners(); this._model = model; - this._modelDisposables.push(this._model.onDidChangeDecorations((e) => { + this._modelDisposables.add(this._model.onDidChangeDecorations((e) => { this.disposeModelListeners(); this.removeHighlightRange(); this._model = null; })); - this._modelDisposables.push(this._model.onWillDispose(() => { + this._modelDisposables.add(this._model.onWillDispose(() => { this.disposeModelListeners(); this.removeHighlightRange(); this._model = null; @@ -1095,8 +1094,7 @@ export class RangeHighlightDecorations implements IDisposable { } private disposeModelListeners() { - this._modelDisposables.forEach(disposable => disposable.dispose()); - this._modelDisposables = []; + this._modelDisposables.clear(); } dispose() { @@ -1105,6 +1103,7 @@ export class RangeHighlightDecorations implements IDisposable { this.disposeModelListeners(); this._model = null; } + this._modelDisposables.dispose(); } private static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ diff --git a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts index 7f5324ff6bf..ee158fb00bf 100644 --- a/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts +++ b/src/vs/workbench/contrib/snippets/browser/snippets.contribution.ts @@ -43,7 +43,7 @@ const languageScopeSchema: IJSONSchema = { type: ['string', 'array'] }, body: { - description: nls.localize('snippetSchema.json.body', 'The snippet content. Use \'$1\', \'${1:defaultText}\' to define cursor positions, use \'$0\' for the final cursor position. Insert variable values with \'${varName}\' and \'${varName:defaultText}\', e.g \'This is file: $TM_FILENAME\'.'), + description: nls.localize('snippetSchema.json.body', 'The snippet content. Use \'$1\', \'${1:defaultText}\' to define cursor positions, use \'$0\' for the final cursor position. Insert variable values with \'${varName}\' and \'${varName:defaultText}\', e.g. \'This is file: $TM_FILENAME\'.'), type: ['string', 'array'], items: { type: 'string' @@ -78,11 +78,11 @@ const globalSchema: IJSONSchema = { type: ['string', 'array'] }, scope: { - description: nls.localize('snippetSchema.json.scope', "A list of language names to which this snippet applies, e.g 'typescript,javascript'."), + description: nls.localize('snippetSchema.json.scope', "A list of language names to which this snippet applies, e.g. 'typescript,javascript'."), type: 'string' }, body: { - description: nls.localize('snippetSchema.json.body', 'The snippet content. Use \'$1\', \'${1:defaultText}\' to define cursor positions, use \'$0\' for the final cursor position. Insert variable values with \'${varName}\' and \'${varName:defaultText}\', e.g \'This is file: $TM_FILENAME\'.'), + description: nls.localize('snippetSchema.json.body', 'The snippet content. Use \'$1\', \'${1:defaultText}\' to define cursor positions, use \'$0\' for the final cursor position. Insert variable values with \'${varName}\' and \'${varName:defaultText}\', e.g. \'This is file: $TM_FILENAME\'.'), type: ['string', 'array'], items: { type: 'string' diff --git a/src/vs/workbench/contrib/stats/node/workspaceStats.ts b/src/vs/workbench/contrib/stats/node/workspaceStats.ts index 3305494a9c0..db4fcadd84a 100644 --- a/src/vs/workbench/contrib/stats/node/workspaceStats.ts +++ b/src/vs/workbench/contrib/stats/node/workspaceStats.ts @@ -458,7 +458,7 @@ export class WorkspaceStats implements IWorkbenchContribution { if (PyModulesToLookFor.indexOf(packageName) > -1) { tags['workspace.py.' + packageName] = true; } - // cognitive services has a lot of tiny packages. eg. 'azure-cognitiveservices-search-autosuggest' + // cognitive services has a lot of tiny packages. e.g. 'azure-cognitiveservices-search-autosuggest' if (packageName.indexOf('azure-cognitiveservices') > -1) { tags['workspace.py.azure-cognitiveservices'] = true; } diff --git a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts index e2d9e2be936..f21b1b2bbc2 100644 --- a/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts +++ b/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.ts @@ -50,7 +50,7 @@ const taskIdentifier: IJSONSchema = { properties: { type: { type: 'string', - description: nls.localize('JsonSchema.tasks.dependsOn.identifier', 'The task indentifier.') + description: nls.localize('JsonSchema.tasks.dependsOn.identifier', 'The task identifier.') } } }; @@ -77,6 +77,17 @@ const dependsOn: IJSONSchema = { ] }; +const dependsOrder: IJSONSchema = { + type: 'string', + enum: ['parallel', 'sequence'], + enumDescriptions: [ + nls.localize('JsonSchema.tasks.dependsOrder.parallel', 'Run all dependsOn tasks in parallel.'), + nls.localize('JsonSchema.tasks.dependsOrder.sequence', 'Run all dependsOn tasks in sequence.'), + ], + default: 'parallel', + description: nls.localize('JsonSchema.tasks.dependsOrder', 'Determines the order of the dependsOn tasks for this task. Note that this property is not recursive.') +}; + const presentation: IJSONSchema = { type: 'object', default: { @@ -353,6 +364,7 @@ let taskConfiguration: IJSONSchema = { }, runOptions: Objects.deepClone(runOptions), dependsOn: Objects.deepClone(dependsOn), + dependsOrder: Objects.deepClone(dependsOrder) } }; @@ -405,6 +417,7 @@ taskDescriptionProperties.command = Objects.deepClone(command); taskDescriptionProperties.args = Objects.deepClone(args); taskDescriptionProperties.isShellCommand = Objects.deepClone(shellCommand); taskDescriptionProperties.dependsOn = dependsOn; +taskDescriptionProperties.dependsOrder = dependsOrder; taskDescriptionProperties.identifier = Objects.deepClone(identifier); taskDescriptionProperties.type = Objects.deepClone(taskType); taskDescriptionProperties.presentation = Objects.deepClone(presentation); diff --git a/src/vs/workbench/contrib/tasks/common/problemCollectors.ts b/src/vs/workbench/contrib/tasks/common/problemCollectors.ts index 1e576997a74..cd400413246 100644 --- a/src/vs/workbench/contrib/tasks/common/problemCollectors.ts +++ b/src/vs/workbench/contrib/tasks/common/problemCollectors.ts @@ -13,6 +13,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { ILineMatcher, createLineMatcher, ProblemMatcher, ProblemMatch, ApplyToKind, WatchingPattern, getResource } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IMarkerService, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { generateUuid } from 'vs/base/common/uuid'; +import { IFileService } from 'vs/platform/files/common/files'; export const enum ProblemCollectorEventKind { BackgroundProcessingBegins = 'backgroundProcessingBegins', @@ -30,7 +31,7 @@ namespace ProblemCollectorEvent { } export interface IProblemMatcher { - processLine(line: string): void; + processLine(line: string): Promise; } export class AbstractProblemCollector implements IDisposable { @@ -55,10 +56,10 @@ export class AbstractProblemCollector implements IDisposable { protected _onDidStateChange: Emitter; - constructor(problemMatchers: ProblemMatcher[], protected markerService: IMarkerService, private modelService: IModelService) { + constructor(problemMatchers: ProblemMatcher[], protected markerService: IMarkerService, private modelService: IModelService, fileService?: IFileService) { this.matchers = Object.create(null); this.bufferLength = 1; - problemMatchers.map(elem => createLineMatcher(elem)).forEach((matcher) => { + problemMatchers.map(elem => createLineMatcher(elem, fileService)).forEach((matcher) => { let length = matcher.matchLength; if (length > this.bufferLength) { this.bufferLength = length; @@ -143,14 +144,14 @@ export class AbstractProblemCollector implements IDisposable { return result; } - protected shouldApplyMatch(result: ProblemMatch): boolean { + protected async shouldApplyMatch(result: ProblemMatch): Promise { switch (result.description.applyTo) { case ApplyToKind.allDocuments: return true; case ApplyToKind.openDocuments: - return !!this.openModels[result.resource.toString()]; + return !!this.openModels[(await result.resource).toString()]; case ApplyToKind.closedDocuments: - return !this.openModels[result.resource.toString()]; + return !this.openModels[(await result.resource).toString()]; default: return true; } @@ -333,8 +334,8 @@ export class StartStopProblemCollector extends AbstractProblemCollector implemen private currentOwner: string; private currentResource: string; - constructor(problemMatchers: ProblemMatcher[], markerService: IMarkerService, modelService: IModelService, _strategy: ProblemHandlingStrategy = ProblemHandlingStrategy.Clean) { - super(problemMatchers, markerService, modelService); + constructor(problemMatchers: ProblemMatcher[], markerService: IMarkerService, modelService: IModelService, _strategy: ProblemHandlingStrategy = ProblemHandlingStrategy.Clean, fileService?: IFileService) { + super(problemMatchers, markerService, modelService, fileService); let ownerSet: { [key: string]: boolean; } = Object.create(null); problemMatchers.forEach(description => ownerSet[description.owner] = true); this.owners = Object.keys(ownerSet); @@ -343,17 +344,17 @@ export class StartStopProblemCollector extends AbstractProblemCollector implemen }); } - public processLine(line: string): void { + public async processLine(line: string): Promise { let markerMatch = this.tryFindMarker(line); if (!markerMatch) { return; } let owner = markerMatch.description.owner; - let resource = markerMatch.resource; + let resource = await markerMatch.resource; let resourceAsString = resource.toString(); this.removeResourceToClean(owner, resourceAsString); - let shouldApplyMatch = this.shouldApplyMatch(markerMatch); + let shouldApplyMatch = await this.shouldApplyMatch(markerMatch); if (shouldApplyMatch) { this.recordMarker(markerMatch.marker, owner, resourceAsString); if (this.currentOwner !== owner || this.currentResource !== resourceAsString) { @@ -386,8 +387,8 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement private currentOwner: string | null; private currentResource: string | null; - constructor(problemMatchers: ProblemMatcher[], markerService: IMarkerService, modelService: IModelService) { - super(problemMatchers, markerService, modelService); + constructor(problemMatchers: ProblemMatcher[], markerService: IMarkerService, modelService: IModelService, fileService?: IFileService) { + super(problemMatchers, markerService, modelService, fileService); this.problemMatchers = problemMatchers; this.resetCurrentResource(); this.backgroundPatterns = []; @@ -415,19 +416,19 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement } } - public processLine(line: string): void { - if (this.tryBegin(line) || this.tryFinish(line)) { + public async processLine(line: string): Promise { + if (await this.tryBegin(line) || this.tryFinish(line)) { return; } let markerMatch = this.tryFindMarker(line); if (!markerMatch) { return; } - let resource = markerMatch.resource; + let resource = await markerMatch.resource; let owner = markerMatch.description.owner; let resourceAsString = resource.toString(); this.removeResourceToClean(owner, resourceAsString); - let shouldApplyMatch = this.shouldApplyMatch(markerMatch); + let shouldApplyMatch = await this.shouldApplyMatch(markerMatch); if (shouldApplyMatch) { this.recordMarker(markerMatch.marker, owner, resourceAsString); if (this.currentOwner !== owner || this.currentResource !== resourceAsString) { @@ -442,7 +443,7 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement this.reportMarkersForCurrentResource(); } - private tryBegin(line: string): boolean { + private async tryBegin(line: string): Promise { let result = false; for (const background of this.backgroundPatterns) { let matches = background.begin.regexp.exec(line); @@ -459,7 +460,7 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement let file = matches[background.begin.file!]; if (file) { let resource = getResource(file, background.matcher); - this.recordResourceToClean(owner, resource); + this.recordResourceToClean(owner, await resource); } else { this.recordResourcesToClean(owner); } diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts index 2f0a4cc5acc..69ec8620780 100644 --- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts @@ -21,11 +21,13 @@ import { IStringDictionary } from 'vs/base/common/collections'; import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { Event, Emitter } from 'vs/base/common/event'; +import { IFileService, IFileStat } from 'vs/platform/files/common/files'; export enum FileLocationKind { - Auto, + Default, Relative, - Absolute + Absolute, + AutoDetect } export module FileLocationKind { @@ -35,6 +37,8 @@ export module FileLocationKind { return FileLocationKind.Absolute; } else if (value === 'relative') { return FileLocationKind.Relative; + } else if (value === 'autodetect') { + return FileLocationKind.AutoDetect; } else { return undefined; } @@ -172,7 +176,7 @@ interface ProblemData { } export interface ProblemMatch { - resource: URI; + resource: Promise; marker: IMarkerData; description: ProblemMatcher; } @@ -182,13 +186,32 @@ export interface HandleResult { continue: boolean; } -export function getResource(filename: string, matcher: ProblemMatcher): URI { + +export async function getResource(filename: string, matcher: ProblemMatcher, fileService?: IFileService): Promise { let kind = matcher.fileLocation; let fullPath: string | undefined; if (kind === FileLocationKind.Absolute) { fullPath = filename; } else if ((kind === FileLocationKind.Relative) && matcher.filePrefix) { fullPath = join(matcher.filePrefix, filename); + } else if (kind === FileLocationKind.AutoDetect) { + const matcherClone = Objects.deepClone(matcher); + matcherClone.fileLocation = FileLocationKind.Relative; + if (fileService) { + const relative = await getResource(filename, matcherClone); + let stat: IFileStat | undefined = undefined; + try { + stat = await fileService.resolve(relative); + } catch (ex) { + // Do nothing, we just need to catch file resolution errors. + } + if (stat) { + return relative; + } + } + + matcherClone.fileLocation = FileLocationKind.Absolute; + return getResource(filename, matcherClone); } if (fullPath === undefined) { throw new Error('FileLocationKind is not actionable. Does the matcher have a filePrefix? This should never happen.'); @@ -210,12 +233,12 @@ export interface ILineMatcher { handle(lines: string[], start?: number): HandleResult; } -export function createLineMatcher(matcher: ProblemMatcher): ILineMatcher { +export function createLineMatcher(matcher: ProblemMatcher, fileService?: IFileService): ILineMatcher { let pattern = matcher.pattern; if (Types.isArray(pattern)) { - return new MultiLineMatcher(matcher); + return new MultiLineMatcher(matcher, fileService); } else { - return new SingleLineMatcher(matcher); + return new SingleLineMatcher(matcher, fileService); } } @@ -223,9 +246,11 @@ const endOfLine: string = Platform.OS === Platform.OperatingSystem.Windows ? '\r abstract class AbstractLineMatcher implements ILineMatcher { private matcher: ProblemMatcher; + private fileService?: IFileService; - constructor(matcher: ProblemMatcher) { + constructor(matcher: ProblemMatcher, fileService?: IFileService) { this.matcher = matcher; + this.fileService = fileService; } public handle(lines: string[], start: number = 0): HandleResult { @@ -312,8 +337,8 @@ abstract class AbstractLineMatcher implements ILineMatcher { return undefined; } - protected getResource(filename: string): URI { - return getResource(filename, this.matcher); + protected getResource(filename: string): Promise { + return getResource(filename, this.matcher, this.fileService); } private getLocation(data: ProblemData): Location | null { @@ -389,8 +414,8 @@ class SingleLineMatcher extends AbstractLineMatcher { private pattern: ProblemPattern; - constructor(matcher: ProblemMatcher) { - super(matcher); + constructor(matcher: ProblemMatcher, fileService?: IFileService) { + super(matcher, fileService); this.pattern = matcher.pattern; } @@ -425,8 +450,8 @@ class MultiLineMatcher extends AbstractLineMatcher { private patterns: ProblemPattern[]; private data: ProblemData | null; - constructor(matcher: ProblemMatcher) { - super(matcher); + constructor(matcher: ProblemMatcher, fileService?: IFileService) { + super(matcher, fileService); this.patterns = matcher.pattern; } @@ -1345,7 +1370,7 @@ export class ProblemMatcherParser extends Parser { kind = FileLocationKind.fromString(description.fileLocation); if (kind) { fileLocation = kind; - if (kind === FileLocationKind.Relative) { + if ((kind === FileLocationKind.Relative) || (kind === FileLocationKind.AutoDetect)) { filePrefix = '${workspaceFolder}'; } } @@ -1355,7 +1380,7 @@ export class ProblemMatcherParser extends Parser { kind = FileLocationKind.fromString(values[0]); if (values.length === 1 && kind === FileLocationKind.Absolute) { fileLocation = kind; - } else if (values.length === 2 && kind === FileLocationKind.Relative && values[1]) { + } else if (values.length === 2 && (kind === FileLocationKind.Relative || kind === FileLocationKind.AutoDetect) && values[1]) { fileLocation = kind; filePrefix = values[1]; } @@ -1573,7 +1598,7 @@ export namespace Schemas { oneOf: [ { type: 'string', - enum: ['absolute', 'relative'] + enum: ['absolute', 'relative', 'autoDetect'] }, { type: 'array', diff --git a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts index daf4f6a189c..28f45c4edf7 100644 --- a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts +++ b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts @@ -312,6 +312,11 @@ export interface ConfigurationProperties { */ dependsOn?: string | TaskIdentifier | Array; + /** + * The order the dependsOn tasks should be executed in. + */ + dependsOrder?: string; + /** * Controls the behavior of the used terminal */ @@ -1214,6 +1219,18 @@ namespace TaskDependency { } } +namespace DependsOrder { + export function from(order: string | undefined): Tasks.DependsOrder { + switch (order) { + case Tasks.DependsOrder.sequence: + return Tasks.DependsOrder.sequence; + case Tasks.DependsOrder.parallel: + default: + return Tasks.DependsOrder.parallel; + } + } +} + namespace ConfigurationProperties { const properties: MetaData[] = [ @@ -1269,6 +1286,7 @@ namespace ConfigurationProperties { result.dependsOn = dependsOnValue ? [dependsOnValue] : undefined; } } + result.dependsOrder = DependsOrder.from(external.dependsOrder); if (includeCommandOptions && (external.presentation !== undefined || (external as LegacyCommandProperties).terminal !== undefined)) { result.presentation = CommandConfiguration.PresentationOptions.from(external, context); } @@ -1389,7 +1407,6 @@ namespace ConfiguringTask { } namespace CustomTask { - export function from(this: void, external: CustomTask, context: ParseContext, index: number): Tasks.CustomTask | undefined { if (!external) { return undefined; diff --git a/src/vs/workbench/contrib/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts index 4eadfa8c4fe..a9bab79d9ce 100644 --- a/src/vs/workbench/contrib/tasks/common/tasks.ts +++ b/src/vs/workbench/contrib/tasks/common/tasks.ts @@ -431,6 +431,11 @@ export const enum GroupType { user = 'user' } +export const enum DependsOrder { + parallel = 'parallel', + sequence = 'sequence' +} + export interface ConfigurationProperties { /** @@ -478,6 +483,11 @@ export interface ConfigurationProperties { */ dependsOn?: TaskDependency[]; + /** + * The order the dependsOn tasks should be executed in. + */ + dependsOrder?: DependsOrder; + /** * The problem watchers to use for this task */ @@ -607,7 +617,7 @@ export class CustomTask extends CommonTask { type: '$customized'; // CUSTOMIZED_TASK_TYPE /** - * Indicated the source of the task (e.g tasks.json or extension) + * Indicated the source of the task (e.g. tasks.json or extension) */ _source: WorkspaceTaskSource; @@ -714,7 +724,7 @@ export class CustomTask extends CommonTask { export class ConfiguringTask extends CommonTask { /** - * Indicated the source of the task (e.g tasks.json or extension) + * Indicated the source of the task (e.g. tasks.json or extension) */ _source: WorkspaceTaskSource; @@ -740,7 +750,7 @@ export class ConfiguringTask extends CommonTask { export class ContributedTask extends CommonTask { /** - * Indicated the source of the task (e.g tasks.json or extension) + * Indicated the source of the task (e.g. tasks.json or extension) */ _source: ExtensionTaskSource; @@ -807,7 +817,7 @@ export class ContributedTask extends CommonTask { export class InMemoryTask extends CommonTask { /** - * Indicated the source of the task (e.g tasks.json or extension) + * Indicated the source of the task (e.g. tasks.json or extension) */ _source: InMemoryTaskSource; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts index 9f1d9500cdd..9f053c9515e 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts @@ -29,7 +29,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { MenuRegistry, MenuId, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IMarkerService, MarkerStatistics } from 'vs/platform/markers/common/markers'; +import { IMarkerService } from 'vs/platform/markers/common/markers'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IFileService, IFileStat } from 'vs/platform/files/common/files'; @@ -108,102 +108,35 @@ namespace ConfigureTaskAction { export class TaskStatusBarContributions extends Disposable implements IWorkbenchContribution { private runningTasksStatusItem: IStatusbarEntryAccessor | undefined; - private problemsStatusItem: IStatusbarEntryAccessor; - private activeTasksCount: number = 0; constructor( @ITaskService private readonly taskService: ITaskService, - @IMarkerService private readonly markerService: IMarkerService, - @IStatusbarService private readonly statusbarService: IStatusbarService + @IStatusbarService private readonly statusbarService: IStatusbarService, + @IProgressService private readonly progressService: IProgressService ) { super(); - - this.problemsStatusItem = this._register(this.statusbarService.addEntry(this.getProblemsItem(), StatusbarAlignment.LEFT, 50 /* Medium Priority */)); - this.registerListeners(); } - private getProblemsItem(): IStatusbarEntry { - const problems = this.markerService.getStatistics(); - - return { - text: this.getProblemsText(problems), - tooltip: this.getProblemsTooltip(problems), - command: 'workbench.action.tasks.toggleProblems' - }; - } - - private getProblemsTooltip(stats: MarkerStatistics): string { - const errorTitle = (n: number) => nls.localize('totalErrors', "{0} Errors", n); - const warningTitle = (n: number) => nls.localize('totalWarnings', "{0} Warnings", n); - const infoTitle = (n: number) => nls.localize('totalInfos', "{0} Infos", n); - - const titles: string[] = []; - - if (stats.errors > 0) { - titles.push(errorTitle(stats.errors)); - } - - if (stats.warnings > 0) { - titles.push(warningTitle(stats.warnings)); - } - - if (stats.infos > 0) { - titles.push(infoTitle(stats.infos)); - } - - if (titles.length === 0) { - return nls.localize('noProblems', "No Problems"); - } - - return titles.join(', '); - } - - private getProblemsText(stats: MarkerStatistics): string { - const problemsText: string[] = []; - - // Errors - problemsText.push('$(error) ' + this.packNumber(stats.errors)); - - // Warnings - problemsText.push('$(warning) ' + this.packNumber(stats.warnings)); - - // Info (only if any) - if (stats.infos > 0) { - problemsText.push('$(info) ' + this.packNumber(stats.infos)); - } - - // Building (only if any running tasks) - if (this.activeTasksCount > 0) { - problemsText.push(nls.localize('building', 'Building...')); - } - - return problemsText.join(' '); - } - - private packNumber(n: number): string { - const manyProblems = nls.localize('manyProblems', "10K+"); - - return n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString(); - } - private registerListeners(): void { - this.markerService.onMarkerChanged(() => this.updateProblemsStatus()); - + let promise: Promise | undefined = undefined; + let resolver: (value?: void | Thenable) => void; this.taskService.onDidStateChange(event => { if (event.kind === TaskEventKind.Changed) { this.updateRunningTasksStatus(); } if (!this.ignoreEventForUpdateRunningTasksCount(event)) { - let needsUpdate = false; - switch (event.kind) { case TaskEventKind.Active: this.activeTasksCount++; if (this.activeTasksCount === 1) { - needsUpdate = true; + if (!promise) { + promise = new Promise((resolve) => { + resolver = resolve; + }); + } } break; case TaskEventKind.Inactive: @@ -212,21 +145,30 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench if (this.activeTasksCount > 0) { this.activeTasksCount--; if (this.activeTasksCount === 0) { - needsUpdate = true; + if (promise && resolver!) { + resolver!(); + } } } break; case TaskEventKind.Terminated: if (this.activeTasksCount !== 0) { this.activeTasksCount = 0; - needsUpdate = true; + if (promise && resolver!) { + resolver!(); + } } break; } + } - if (needsUpdate) { - this.updateProblemsStatus(); - } + if (promise && (event.kind === TaskEventKind.Active) && (this.activeTasksCount === 1)) { + this.progressService.withProgress({ location: ProgressLocation.Window }, progress => { + progress.report({ message: nls.localize('building', 'Building...') }); + return promise!; + }).then(() => { + promise = undefined; + }); } }); } @@ -253,10 +195,6 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench } } - private updateProblemsStatus(): void { - this.problemsStatusItem.update(this.getProblemsItem()); - } - private ignoreEventForUpdateRunningTasksCount(event: TaskEvent): boolean { if (!this.taskService.inTerminal()) { return false; @@ -1297,7 +1235,7 @@ class TaskService extends Disposable implements ITaskService { this.terminalService, this.outputService, this.panelService, this.markerService, this.modelService, this.configurationResolverService, this.telemetryService, this.contextService, this.environmentService, - TaskService.OutputChannelId, + TaskService.OutputChannelId, this.fileService, (workspaceFolder: IWorkspaceFolder) => { if (!workspaceFolder) { return undefined; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts index 4c647da9057..06892d7f253 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts @@ -17,7 +17,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { isUNC } from 'vs/base/common/extpath'; import { win32 } from 'vs/base/node/processes'; - +import { IFileService } from 'vs/platform/files/common/files'; import { IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -29,10 +29,10 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import { IOutputService } from 'vs/workbench/contrib/output/common/output'; -import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/contrib/tasks/common/problemCollectors'; +import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind, ProblemHandlingStrategy } from 'vs/workbench/contrib/tasks/common/problemCollectors'; import { Task, CustomTask, ContributedTask, RevealKind, CommandOptions, ShellConfiguration, RuntimeType, PanelKind, - TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration, ExtensionTaskSource, TaskScope, RevealProblemKind + TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration, ExtensionTaskSource, TaskScope, RevealProblemKind, DependsOrder } from 'vs/workbench/contrib/tasks/common/tasks'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver, @@ -171,6 +171,7 @@ export class TerminalTaskSystem implements ITaskSystem { private contextService: IWorkspaceContextService, private environmentService: IWorkbenchEnvironmentService, private outputChannelId: string, + private fileService: IFileService, taskSystemInfoResolver: TaskSystemInfoResovler, ) { @@ -332,10 +333,11 @@ export class TerminalTaskSystem implements ITaskSystem { return Promise.all(promises); } - private executeTask(task: Task, resolver: ITaskResolver, trigger: string): Promise { + private async executeTask(task: Task, resolver: ITaskResolver, trigger: string): Promise { let promises: Promise[] = []; if (task.configurationProperties.dependsOn) { - task.configurationProperties.dependsOn.forEach((dependency) => { + for (let index in task.configurationProperties.dependsOn) { + const dependency = task.configurationProperties.dependsOn[index]; let dependencyTask = resolver.resolve(dependency.workspaceFolder, dependency.task!); if (dependencyTask) { let key = dependencyTask.getMapKey(); @@ -344,6 +346,9 @@ export class TerminalTaskSystem implements ITaskSystem { this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.DependsOnStarted, task)); promise = this.executeTask(dependencyTask, resolver, trigger); } + if (task.configurationProperties.dependsOrder === DependsOrder.sequence) { + promise = Promise.resolve(await promise); + } promises.push(promise); } else { this.log(nls.localize('dependencyFailed', @@ -353,7 +358,7 @@ export class TerminalTaskSystem implements ITaskSystem { )); this.showOutput(); } - }); + } } if ((ContributedTask.is(task) || CustomTask.is(task)) && (task.command)) { @@ -424,12 +429,12 @@ export class TerminalTaskSystem implements ITaskSystem { variables.forEach(variable => variablesArray.push(variable)); return new Promise((resolve, reject) => { - this.configurationResolverService.resolveWithInteraction(workspaceFolder, variablesArray, 'tasks').then(resolvedVariablesMap => { + this.configurationResolverService.resolveWithInteraction(workspaceFolder, variablesArray, 'tasks').then(async resolvedVariablesMap => { if (resolvedVariablesMap) { if (isProcess) { let processVarValue: string; if (Platform.isWindows) { - processVarValue = win32.findExecutable( + processVarValue = await win32.findExecutable( this.configurationResolverService.resolve(workspaceFolder, CommandString.value(task.command.name!)), cwd ? this.configurationResolverService.resolve(workspaceFolder, cwd) : undefined, envPath ? envPath.split(path.delimiter).map(p => this.configurationResolverService.resolve(workspaceFolder, p)) : undefined @@ -509,7 +514,7 @@ export class TerminalTaskSystem implements ITaskSystem { if (task.configurationProperties.isBackground) { promise = new Promise((resolve, reject) => { const problemMatchers = this.resolveMatchers(resolver, task.configurationProperties.problemMatchers); - let watchingProblemMatcher = new WatchingProblemCollector(problemMatchers, this.markerService, this.modelService); + let watchingProblemMatcher = new WatchingProblemCollector(problemMatchers, this.markerService, this.modelService, this.fileService); let toDispose: IDisposable[] | undefined = []; let eventCounter: number = 0; toDispose.push(watchingProblemMatcher.onDidStateChange((event) => { @@ -554,13 +559,14 @@ export class TerminalTaskSystem implements ITaskSystem { this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Start, task, terminal.id)); const registeredLinkMatchers = this.registerLinkMatchers(terminal, problemMatchers); const onData = terminal.onLineData((line) => { - watchingProblemMatcher.processLine(line); - if (!delayer) { - delayer = new Async.Delayer(3000); - } - delayer.trigger(() => { - watchingProblemMatcher.forceDelivery(); - delayer = undefined; + return watchingProblemMatcher.processLine(line).then(() => { + if (!delayer) { + delayer = new Async.Delayer(3000); + } + delayer.trigger(() => { + watchingProblemMatcher.forceDelivery(); + delayer = undefined; + }); }); }); const onExit = terminal.onExit((exitCode) => { @@ -630,10 +636,10 @@ export class TerminalTaskSystem implements ITaskSystem { this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Start, task, terminal.id)); this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Active, task)); let problemMatchers = this.resolveMatchers(resolver, task.configurationProperties.problemMatchers); - let startStopProblemMatcher = new StartStopProblemCollector(problemMatchers, this.markerService, this.modelService); + let startStopProblemMatcher = new StartStopProblemCollector(problemMatchers, this.markerService, this.modelService, ProblemHandlingStrategy.Clean, this.fileService); const registeredLinkMatchers = this.registerLinkMatchers(terminal, problemMatchers); const onData = terminal.onLineData((line) => { - startStopProblemMatcher.processLine(line); + return startStopProblemMatcher.processLine(line); }); const onExit = terminal.onExit((exitCode) => { onData.dispose(); diff --git a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts index 6d27ba51b44..17744b20a9e 100644 --- a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts @@ -258,15 +258,16 @@ export class ProcessTaskSystem implements ITaskSystem { const onProgress = (progress: LineData) => { let line = Strings.removeAnsiEscapeCodes(progress.line); this.appendOutput(line + '\n'); - watchingProblemMatcher.processLine(line); - if (delayer === null) { - delayer = new Async.Delayer(3000); - } - delayer.trigger(() => { - watchingProblemMatcher.forceDelivery(); - return null; - }).then(() => { - delayer = null; + return watchingProblemMatcher.processLine(line).then(() => { + if (delayer === null) { + delayer = new Async.Delayer(3000); + } + delayer.trigger(() => { + watchingProblemMatcher.forceDelivery(); + return null; + }).then(() => { + delayer = null; + }); }); }; const startPromise = this.childProcess.start(onProgress); @@ -322,7 +323,7 @@ export class ProcessTaskSystem implements ITaskSystem { const onProgress = (progress: LineData) => { let line = Strings.removeAnsiEscapeCodes(progress.line); this.appendOutput(line + '\n'); - startStopProblemMatcher.processLine(line); + return startStopProblemMatcher.processLine(line); }; const startPromise = this.childProcess.start(onProgress); this.childProcess.pid.then(pid => { diff --git a/src/vs/workbench/contrib/terminal/browser/media/xterm.css b/src/vs/workbench/contrib/terminal/browser/media/xterm.css index 9c52131931b..37429d9646b 100644 --- a/src/vs/workbench/contrib/terminal/browser/media/xterm.css +++ b/src/vs/workbench/contrib/terminal/browser/media/xterm.css @@ -128,7 +128,7 @@ } .xterm.enable-mouse-events { - /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ + /* When mouse events are enabled (e.g. tmux), revert to the standard pointer cursor */ cursor: default; } diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts index 0466fb5a593..5ceb7b32104 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts @@ -260,15 +260,10 @@ configurationRegistry.registerConfiguration({ default: 'inherited' }, 'terminal.integrated.windowsEnableConpty': { - description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication. Winpty will be used if this is false. Note that ConPTY will be disabled regardless of this setting when the Windows 10 build number is lower than 18309 or when you're running the 32-bit VS Code client under 64-bit Windows."), + description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."), type: 'boolean', default: true }, - 'terminal.integrated.enableLatencyMitigation': { - description: nls.localize('terminal.integrated.enableLatencyMitigation', "Whether to enable the latency mitigation feature for high-latency terminals."), - type: 'boolean', - default: false - }, 'terminal.integrated.experimentalRefreshOnResume': { description: nls.localize('terminal.integrated.experimentalRefreshOnResume', "An experimental setting that will refresh the terminal renderer when the system is resumed."), type: 'boolean', diff --git a/src/vs/workbench/contrib/terminal/browser/terminal.ts b/src/vs/workbench/contrib/terminal/browser/terminal.ts index 07d8a21d414..db8cf7855b3 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminal.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Terminal as XTermTerminal } from 'vscode-xterm'; -import { ITerminalInstance, IWindowsShellHelper, ITerminalProcessManager, ITerminalConfigHelper, ITerminalChildProcess, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; +import { Terminal as XTermTerminal } from 'xterm'; +import { ITerminalInstance, IWindowsShellHelper, ITerminalConfigHelper, ITerminalChildProcess, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IProcessEnvironment, Platform } from 'vs/base/common/platform'; @@ -15,7 +15,6 @@ export interface ITerminalInstanceService { getXtermConstructor(): Promise; createWindowsShellHelper(shellProcessId: number, instance: ITerminalInstance, xterm: XTermTerminal): IWindowsShellHelper; - createTerminalProcessManager(id: number, configHelper: ITerminalConfigHelper): ITerminalProcessManager; createTerminalProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, windowsEnableConpty: boolean): ITerminalChildProcess; getDefaultShell(p: Platform): string; } diff --git a/src/vs/workbench/contrib/terminal/browser/terminalCommandTracker.ts b/src/vs/workbench/contrib/terminal/browser/terminalCommandTracker.ts index a3189db77c4..c50fcfc8496 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalCommandTracker.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalCommandTracker.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Terminal, IMarker } from 'vscode-xterm'; +import { Terminal, IMarker } from 'xterm'; import { ITerminalCommandTracker } from 'vs/workbench/contrib/terminal/common/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts index 716e1f872cb..0bcd16f1530 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.ts @@ -10,7 +10,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITerminalConfiguration, ITerminalFont, IShellLaunchConfig, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING, LinuxDistro } from 'vs/workbench/contrib/terminal/common/terminal'; import Severity from 'vs/base/common/severity'; -import { Terminal as XTermTerminal } from 'vscode-xterm'; +import { Terminal as XTermTerminal } from 'xterm'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IBrowserTerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/terminal'; import { mergeDefaultShellPathAndArgs } from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 8781958723b..ff16d22e2e6 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -32,16 +32,17 @@ import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/term import { TerminalLinkHandler } from 'vs/workbench/contrib/terminal/browser/terminalLinkHandler'; import { TerminalCommandTracker } from 'vs/workbench/contrib/terminal/browser/terminalCommandTracker'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import { ISearchOptions, Terminal as XTermTerminal, IBuffer } from 'vscode-xterm'; +import { Terminal as XTermTerminal, IBuffer } from 'xterm'; import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility'; import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; +import { SearchAddon, ISearchOptions } from 'xterm-addon-search'; +import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager'; // How long in milliseconds should an average frame take to render for a notification to appear // which suggests the fallback DOM-based renderer const SLOW_CANVAS_RENDER_THRESHOLD = 50; const NUMBER_OF_FRAMES_TO_MEASURE = 20; - export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [ TERMINAL_COMMAND_ID.CLEAR_SELECTION, TERMINAL_COMMAND_ID.CLEAR, @@ -148,6 +149,8 @@ export const DEFAULT_COMMANDS_TO_SKIP_SHELL: string[] = [ 'workbench.action.toggleMaximizedPanel' ]; +let xtermConstructor: Promise | undefined; + export class TerminalInstance implements ITerminalInstance { private static readonly EOL_REGEX = /\r?\n/g; @@ -166,6 +169,7 @@ export class TerminalInstance implements ITerminalInstance { private _title: string; private _wrapperElement: HTMLDivElement; private _xterm: XTermTerminal; + private _xtermSearch: SearchAddon; private _xtermElement: HTMLDivElement; private _terminalHasTextContextKey: IContextKey; private _cols: number; @@ -391,11 +395,26 @@ export class TerminalInstance implements ITerminalInstance { return TerminalInstance._lastKnownDimensions; } + private async _getXtermConstructor(): Promise { + if (xtermConstructor) { + return xtermConstructor; + } + xtermConstructor = new Promise(async (resolve) => { + const Terminal = await this._terminalInstanceService.getXtermConstructor(); + // Localize strings + Terminal.strings.blankLine = nls.localize('terminal.integrated.a11yBlankLine', 'Blank line'); + Terminal.strings.promptLabel = nls.localize('terminal.integrated.a11yPromptLabel', 'Terminal input'); + Terminal.strings.tooMuchOutput = nls.localize('terminal.integrated.a11yTooMuchOutput', 'Too much output to announce, navigate to rows manually to read'); + resolve(Terminal); + }); + return xtermConstructor; + } + /** * Create xterm.js instance and attach data listeners. */ protected async _createXterm(): Promise { - const Terminal = await this._terminalInstanceService.getXtermConstructor(); + const Terminal = await this._getXtermConstructor(); const font = this._configHelper.getFont(undefined, true); const config = this._configHelper.config; this._xterm = new Terminal({ @@ -414,10 +433,10 @@ export class TerminalInstance implements ITerminalInstance { macOptionClickForcesSelection: config.macOptionClickForcesSelection, rightClickSelectsWord: config.rightClickBehavior === 'selectWord', // TODO: Guess whether to use canvas or dom better - rendererType: config.rendererType === 'auto' ? 'canvas' : config.rendererType, - // TODO: Remove this once the setting is removed upstream - experimentalCharAtlas: 'dynamic' + rendererType: config.rendererType === 'auto' ? 'canvas' : config.rendererType }); + this._xtermSearch = new SearchAddon(); + this._xterm.loadAddon(this._xtermSearch); if (this._shellLaunchConfig.initialText) { this._xterm.writeln(this._shellLaunchConfig.initialText); } @@ -595,19 +614,6 @@ export class TerminalInstance implements ITerminalInstance { if (this._processManager) { this._widgetManager = new TerminalWidgetManager(this._wrapperElement); this._processManager.onProcessReady(() => this._linkHandler.setWidgetManager(this._widgetManager)); - - this._processManager.onProcessReady(() => { - if (this._configHelper.config.enableLatencyMitigation) { - if (!this._processManager) { - return; - } - this._processManager.getLatency().then(latency => { - if (latency > 20 && (this._xterm as any).typeAheadInit) { - (this._xterm as any).typeAheadInit(this._processManager, this._themeService); - } - }); - } - }); } else if (this._shellLaunchConfig.isRendererOnly) { this._widgetManager = new TerminalWidgetManager(this._wrapperElement); this._linkHandler.setWidgetManager(this._widgetManager); @@ -714,11 +720,11 @@ export class TerminalInstance implements ITerminalInstance { } public findNext(term: string, searchOptions: ISearchOptions): boolean { - return this._xterm.findNext(term, searchOptions); + return this._xtermSearch.findNext(term, searchOptions); } public findPrevious(term: string, searchOptions: ISearchOptions): boolean { - return this._xterm.findPrevious(term, searchOptions); + return this._xtermSearch.findPrevious(term, searchOptions); } public notifyFindWidgetFocusChanged(isFocused: boolean): void { @@ -775,7 +781,7 @@ export class TerminalInstance implements ITerminalInstance { public rendererExit(exitCode: number): void { // The use of this API is for cases where there is no backing process behind a terminal - // instance (eg. a custom execution task). + // instance (e.g. a custom execution task). if (!this.shellLaunchConfig.isRendererOnly) { throw new Error('rendererExit is only expected to be called on a renderer only terminal'); } @@ -915,7 +921,7 @@ export class TerminalInstance implements ITerminalInstance { } protected _createProcess(): void { - this._processManager = this._terminalInstanceService.createTerminalProcessManager(this._id, this._configHelper); + this._processManager = this._instantiationService.createInstance(TerminalProcessManager, this._id, this._configHelper); this._processManager.onProcessReady(() => this._onProcessIdReady.fire(this)); this._processManager.onProcessExit(exitCode => this._onProcessExit(exitCode)); this._processManager.onProcessData(data => this._onData.fire(data)); @@ -959,7 +965,7 @@ export class TerminalInstance implements ITerminalInstance { /** * Called when either a process tied to a terminal has exited or when a terminal renderer - * simulates a process exiting (eg. custom execution task). + * simulates a process exiting (e.g. custom execution task). * @param exitCode The exit code of the process, this is undefined when the terminal was exited * through user action. */ diff --git a/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts b/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts index 60227bf8b64..3231630a6aa 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalLinkHandler.ts @@ -14,9 +14,10 @@ import { ITerminalService, ITerminalProcessManager } from 'vs/workbench/contrib/ import { ITextEditorSelection } from 'vs/platform/editor/common/editor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IFileService } from 'vs/platform/files/common/files'; -import { ILinkMatcherOptions } from 'vscode-xterm'; +import { ILinkMatcherOptions } from 'xterm'; import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts'; import { posix, win32 } from 'vs/base/common/path'; +import { WebLinksAddon } from 'xterm-addon-web-links'; const pathPrefix = '(\\.\\.?|\\~)'; const pathSeparatorClause = '\\/'; @@ -138,12 +139,12 @@ export class TerminalLinkHandler { const wrappedHandler = this._wrapLinkHandler(uri => { this._handleHypertextLink(uri); }); - this._xterm.webLinksInit(wrappedHandler, { + this._xterm.loadAddon(new WebLinksAddon(wrappedHandler, { validationCallback: (uri: string, callback: (isValid: boolean) => void) => this._validateWebLink(uri, callback), tooltipCallback: this._tooltipCallback, leaveCallback: this._leaveCallback, willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e) - }); + })); } public registerLocalLinkHandler(): void { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts index b70d3a28732..53999a3856b 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts @@ -5,7 +5,6 @@ import * as platform from 'vs/base/common/platform'; import * as terminalEnvironment from 'vs/workbench/contrib/terminal/common/terminalEnvironment'; -import { IDisposable } from 'vs/base/common/lifecycle'; import { ProcessState, ITerminalProcessManager, IShellLaunchConfig, ITerminalConfigHelper, ITerminalChildProcess, IBeforeProcessDataEvent, ITerminalEnvironment } from 'vs/workbench/contrib/terminal/common/terminal'; import { ILogService } from 'vs/platform/log/common/log'; import { Emitter, Event } from 'vs/base/common/event'; @@ -48,7 +47,6 @@ export class TerminalProcessManager implements ITerminalProcessManager { private _process: ITerminalChildProcess | null = null; private _preLaunchInputQueue: string[] = []; - private _disposables: IDisposable[] = []; private _latency: number = -1; private _latencyRequest: Promise; private _latencyLastMeasured: number = 0; @@ -97,12 +95,6 @@ export class TerminalProcessManager implements ITerminalProcessManager { this._process.shutdown(immediate); this._process = null; } - this._disposables.forEach(d => d.dispose()); - this._disposables.length = 0; - } - - public addDisposable(disposable: IDisposable) { - this._disposables.push(disposable); } public createProcess( diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts b/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts deleted file mode 100644 index 03eb7660199..00000000000 --- a/src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts +++ /dev/null @@ -1,136 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { Terminal as XTermTerminal } from 'vscode-xterm'; -import { ITerminalProcessManager } from 'vs/workbench/contrib/terminal/common/terminal'; -import { IThemeService } from 'vs/platform/theme/common/themeService'; - -export interface ITerminalCore { - buffer: any; -} - -export interface ITypeAheadAddonTerminal { - _core: ITerminalCore; - on: any; - write(data: string): void; - cols: number; - - __typeAheadQueue: string[]; - __typeAheadState: TypeAheadState; - __typeAheadCurrentYBase: number; - __typeAheadCurrentY: number; -} - -enum TypeAheadState { - /** - * The normal state, ready to type if it starts. - */ - Normal, - /** - * Something happens such that we cannot make a good guess on what to print, - * wait until the cursor row changes before proceeding. - */ - AwaitingRowChange -} - -function isCharPrintable(data: string): boolean { - const code = data.charCodeAt(0); - return data.length === 1 && code >= 32 && code <= 126; -} - -function init(terminal: any, processManager: ITerminalProcessManager, themeService: IThemeService): void { - const t = terminal as ITypeAheadAddonTerminal; - - t.__typeAheadQueue = []; - t.__typeAheadState = TypeAheadState.Normal; - t.__typeAheadCurrentYBase = 0; - t.__typeAheadCurrentY = 0; - - function typeAhead(data: string): void { - for (let i = 0; i < data.length; i++) { - t.__typeAheadQueue.push(data[i]); - } - t.write(data); - } - - t.on('cursormove', () => { - // Reset if the cursor row changed - if (t._core.buffer.ybase !== t.__typeAheadCurrentYBase || t._core.buffer.y !== t.__typeAheadCurrentY) { - t.__typeAheadCurrentYBase = t._core.buffer.ybase; - t.__typeAheadCurrentY = t._core.buffer.y; - t.__typeAheadState = TypeAheadState.Normal; - } - }); - - t.on('data', (data: string) => { - // Exit if we're waiting for a row change - if (t.__typeAheadState === TypeAheadState.AwaitingRowChange) { - return; - } - - // Only enable in the normal buffer - if (!t._core.buffer._hasScrollback) { - return; - } - - // // Handle enter - // if (data === '\r') { - // typeAhead('\r\n'); - // return; - // } - - // // Left arrow - // if (data === '\x1b[D') { - // // TODO: How to stop it from going beyond prompt? - // typeAhead(String.fromCharCode(8)); - // } - - // // Right arrow - // if (data === '\x1b[C') { - // // TODO: How to stop it from going beyond prompt? - // typeAhead('\x1b[C'); - // } - - // // Backspace (DEL) - // if (data.charCodeAt(0) === 127) { - // // TODO: This would require knowing the prompt length to be able to shift everything - // } - - if (!isCharPrintable(data)) { - t.__typeAheadState = TypeAheadState.AwaitingRowChange; - return; - } - - if (t._core.buffer.x === t.cols - 1) { - // TODO: Does the space get added on Windows/Linux too? - data += ' \r'; - } - typeAhead(data); - }); - - processManager.onBeforeProcessData(event => { - let consumeCount = 0; - for (let i = 0; i < event.data.length; i++) { - if (t.__typeAheadQueue[0] === event.data[i]) { - t.__typeAheadQueue.shift(); - consumeCount++; - } else { - t.__typeAheadQueue.length = 0; - break; - } - } - if (consumeCount === event.data.length) { - event.data = ''; - } else if (consumeCount > 0) { - event.data = event.data.substr(consumeCount); - } - }); -} - -export function apply(terminalConstructor: typeof XTermTerminal) { - (terminalConstructor.prototype).typeAheadInit = function (processManager: ITerminalProcessManager, themeService: IThemeService): void { - init(this, processManager, themeService); - }; -} \ No newline at end of file diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index b5ba60c4369..4ffff387091 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -101,7 +101,6 @@ export interface ITerminalConfiguration { experimentalBufferImpl: 'JsArray' | 'TypedArray'; splitCwd: 'workspaceRoot' | 'initial' | 'inherited'; windowsEnableConpty: boolean; - enableLatencyMitigation: boolean; experimentalRefreshOnResume: boolean; } @@ -162,7 +161,7 @@ export interface IShellLaunchConfig { env?: ITerminalEnvironment; /** - * Whether to ignore a custom cwd from the `terminal.integrated.cwd` settings key (eg. if the + * Whether to ignore a custom cwd from the `terminal.integrated.cwd` settings key (e.g. if the * shell is being launched by an extension). */ ignoreConfigurationCwd?: boolean; @@ -435,7 +434,7 @@ export interface ITerminalInstance { /** * Whether to disable layout for the terminal. This is useful when the size of the terminal is - * being manipulating (eg. adding a split pane) and we want the terminal to ignore particular + * being manipulating (e.g. adding a split pane) and we want the terminal to ignore particular * resize events. */ disableLayout: boolean; @@ -672,7 +671,6 @@ export interface ITerminalProcessManager extends IDisposable { readonly onProcessTitle: Event; readonly onProcessExit: Event; - addDisposable(disposable: IDisposable): void; dispose(immediate?: boolean): void; createProcess(shellLaunchConfig: IShellLaunchConfig, cols: number, rows: number): void; write(data: string): void; diff --git a/src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts b/src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts index 0c12352b58c..80c756977d3 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts @@ -5,37 +5,36 @@ import { Event, Emitter } from 'vs/base/common/event'; import { ITerminalService, ITerminalProcessExtHostProxy, IShellLaunchConfig, ITerminalChildProcess, ITerminalConfigHelper } from 'vs/workbench/contrib/terminal/common/terminal'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import * as nls from 'vs/nls'; let hasReceivedResponse: boolean = false; -export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerminalProcessExtHostProxy { - private _disposables: IDisposable[] = []; +export class TerminalProcessExtHostProxy extends Disposable implements ITerminalChildProcess, ITerminalProcessExtHostProxy { - private readonly _onProcessData = new Emitter(); - public get onProcessData(): Event { return this._onProcessData.event; } - private readonly _onProcessExit = new Emitter(); - public get onProcessExit(): Event { return this._onProcessExit.event; } + private readonly _onProcessData = this._register(new Emitter()); + public readonly onProcessData: Event = this._onProcessData.event; + private readonly _onProcessExit = this._register(new Emitter()); + public readonly onProcessExit: Event = this._onProcessExit.event; private readonly _onProcessReady = new Emitter<{ pid: number, cwd: string }>(); - public get onProcessReady(): Event<{ pid: number, cwd: string }> { return this._onProcessReady.event; } - private readonly _onProcessTitleChanged = new Emitter(); - public get onProcessTitleChanged(): Event { return this._onProcessTitleChanged.event; } + public get onProcessReady(): Event<{ pid: number, cwd: string }> { return this._onProcessReady.event; }t; + private readonly _onProcessTitleChanged = this._register(new Emitter()); + public readonly onProcessTitleChanged: Event = this._onProcessTitleChanged.event; - private readonly _onInput = new Emitter(); - public get onInput(): Event { return this._onInput.event; } - private readonly _onResize: Emitter<{ cols: number, rows: number }> = new Emitter<{ cols: number, rows: number }>(); - public get onResize(): Event<{ cols: number, rows: number }> { return this._onResize.event; } - private readonly _onShutdown = new Emitter(); - public get onShutdown(): Event { return this._onShutdown.event; } - private readonly _onRequestInitialCwd = new Emitter(); - public get onRequestInitialCwd(): Event { return this._onRequestInitialCwd.event; } - private readonly _onRequestCwd = new Emitter(); - public get onRequestCwd(): Event { return this._onRequestCwd.event; } - private readonly _onRequestLatency = new Emitter(); - public get onRequestLatency(): Event { return this._onRequestLatency.event; } + private readonly _onInput = this._register(new Emitter()); + public readonly onInput: Event = this._onInput.event; + private readonly _onResize: Emitter<{ cols: number, rows: number }> = this._register(new Emitter<{ cols: number, rows: number }>()); + public readonly onResize: Event<{ cols: number, rows: number }> = this._onResize.event; + private readonly _onShutdown = this._register(new Emitter()); + public readonly onShutdown: Event = this._onShutdown.event; + private readonly _onRequestInitialCwd = this._register(new Emitter()); + public readonly onRequestInitialCwd: Event = this._onRequestInitialCwd.event; + private readonly _onRequestCwd = this._register(new Emitter()); + public readonly onRequestCwd: Event = this._onRequestCwd.event; + private readonly _onRequestLatency = this._register(new Emitter()); + public readonly onRequestLatency: Event = this._onRequestLatency.event; private _pendingInitialCwdRequests: ((value?: string | Thenable) => void)[] = []; private _pendingCwdRequests: ((value?: string | Thenable) => void)[] = []; @@ -51,6 +50,7 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm @ITerminalService private readonly _terminalService: ITerminalService, @IRemoteAgentService readonly remoteAgentService: IRemoteAgentService ) { + super(); remoteAgentService.getEnvironment().then(env => { if (!env) { throw new Error('Could not fetch environment'); @@ -62,11 +62,6 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm } } - public dispose(): void { - this._disposables.forEach(d => d.dispose()); - this._disposables.length = 0; - } - public emitData(data: string): void { this._onProcessData.fire(data); } diff --git a/src/vs/workbench/contrib/terminal/common/terminalShellConfig.ts b/src/vs/workbench/contrib/terminal/common/terminalShellConfig.ts new file mode 100644 index 00000000000..6867fd01871 --- /dev/null +++ b/src/vs/workbench/contrib/terminal/common/terminalShellConfig.ts @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as nls from 'vs/nls'; +import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { Platform } from 'vs/base/common/platform'; + +export function registerShellConfiguration(getDefaultShell?: (p: Platform) => string): void { + const configurationRegistry = Registry.as(Extensions.Configuration); + configurationRegistry.registerConfiguration({ + id: 'terminal', + order: 100, + title: nls.localize('terminalIntegratedConfigurationTitle', "Integrated Terminal"), + type: 'object', + properties: { + 'terminal.integrated.shell.linux': { + markdownDescription: + getDefaultShell + ? nls.localize('terminal.integrated.shell.linux', "The path of the shell that the terminal uses on Linux (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(Platform.Linux)) + : nls.localize('terminal.integrated.shell.linux.noDefault', "The path of the shell that the terminal uses on Linux. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), + type: ['string', 'null'], + default: null + }, + 'terminal.integrated.shell.osx': { + markdownDescription: + getDefaultShell + ? nls.localize('terminal.integrated.shell.osx', "The path of the shell that the terminal uses on macOS (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(Platform.Mac)) + : nls.localize('terminal.integrated.shell.osx.noDefault', "The path of the shell that the terminal uses on macOS. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), + type: ['string', 'null'], + default: null + }, + 'terminal.integrated.shell.windows': { + markdownDescription: + getDefaultShell + ? nls.localize('terminal.integrated.shell.windows', "The path of the shell that the terminal uses on Windows (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(Platform.Windows)) + : nls.localize('terminal.integrated.shell.windows.noDefault', "The path of the shell that the terminal uses on Windows. [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration)."), + type: ['string', 'null'], + default: null + } + } + }); +} diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts index 616bf9eba8a..3f2d9227c0d 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts @@ -3,41 +3,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as platform from 'vs/base/common/platform'; -import * as nls from 'vs/nls'; -import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { Registry } from 'vs/platform/registry/common/platform'; import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { ITerminalService } from 'vs/workbench/contrib/terminal/common/terminal'; import { TerminalInstanceService } from 'vs/workbench/contrib/terminal/electron-browser/terminalInstanceService'; import { TerminalService } from 'vs/workbench/contrib/terminal/electron-browser/terminalService'; import { getDefaultShell } from 'vs/workbench/contrib/terminal/node/terminal'; +import { registerShellConfiguration } from 'vs/workbench/contrib/terminal/common/terminalShellConfig'; -const configurationRegistry = Registry.as(Extensions.Configuration); -configurationRegistry.registerConfiguration({ - id: 'terminal', - order: 100, - title: nls.localize('terminalIntegratedConfigurationTitle', "Integrated Terminal"), - type: 'object', - properties: { - 'terminal.integrated.shell.linux': { - markdownDescription: nls.localize('terminal.integrated.shell.linux', "The path of the shell that the terminal uses on Linux (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(platform.Platform.Linux)), - type: ['string', 'null'], - default: null - }, - 'terminal.integrated.shell.osx': { - markdownDescription: nls.localize('terminal.integrated.shell.osx', "The path of the shell that the terminal uses on macOS (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(platform.Platform.Mac)), - type: ['string', 'null'], - default: null - }, - 'terminal.integrated.shell.windows': { - markdownDescription: nls.localize('terminal.integrated.shell.windows', "The path of the shell that the terminal uses on Windows (default: {0}). [Read more about configuring the shell](https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration).", getDefaultShell(platform.Platform.Windows)), - type: ['string', 'null'], - default: null - } - } -}); - +registerShellConfiguration(getDefaultShell); registerSingleton(ITerminalService, TerminalService, true); registerSingleton(ITerminalInstanceService, TerminalInstanceService, true); diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts index 53445235342..5b1ae46ff42 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts @@ -3,16 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; import { ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { Terminal as XTermTerminal } from 'vscode-xterm'; -import { ITerminalInstance, IWindowsShellHelper, ITerminalConfigHelper, ITerminalProcessManager, IShellLaunchConfig, ITerminalChildProcess } from 'vs/workbench/contrib/terminal/common/terminal'; +import { Terminal as XTermTerminal } from 'xterm'; +import { ITerminalInstance, IWindowsShellHelper, IShellLaunchConfig, ITerminalChildProcess } from 'vs/workbench/contrib/terminal/common/terminal'; import { WindowsShellHelper } from 'vs/workbench/contrib/terminal/node/windowsShellHelper'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/browser/terminalProcessManager'; import { IProcessEnvironment, Platform } from 'vs/base/common/platform'; import { TerminalProcess } from 'vs/workbench/contrib/terminal/node/terminalProcess'; -import * as typeAheadAddon from 'vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon'; import { getDefaultShell } from 'vs/workbench/contrib/terminal/node/terminal'; let Terminal: typeof XTermTerminal; @@ -32,15 +29,7 @@ export class TerminalInstanceService implements ITerminalInstanceService { public async getXtermConstructor(): Promise { if (!Terminal) { - Terminal = (await import('vscode-xterm')).Terminal; - // Enable xterm.js addons - Terminal.applyAddon(require.__$__nodeRequire('vscode-xterm/lib/addons/search/search')); - Terminal.applyAddon(require.__$__nodeRequire('vscode-xterm/lib/addons/webLinks/webLinks')); - Terminal.applyAddon(typeAheadAddon); - // Localize strings - Terminal.strings.blankLine = nls.localize('terminal.integrated.a11yBlankLine', 'Blank line'); - Terminal.strings.promptLabel = nls.localize('terminal.integrated.a11yPromptLabel', 'Terminal input'); - Terminal.strings.tooMuchOutput = nls.localize('terminal.integrated.a11yTooMuchOutput', 'Too much output to announce, navigate to rows manually to read'); + Terminal = (await import('xterm')).Terminal; } return Terminal; } @@ -49,10 +38,6 @@ export class TerminalInstanceService implements ITerminalInstanceService { return new WindowsShellHelper(shellProcessId, instance, xterm); } - public createTerminalProcessManager(id: number, configHelper: ITerminalConfigHelper): ITerminalProcessManager { - return this._instantiationService.createInstance(TerminalProcessManager, id, configHelper); - } - public createTerminalProcess(shellLaunchConfig: IShellLaunchConfig, cwd: string, cols: number, rows: number, env: IProcessEnvironment, windowsEnableConpty: boolean): ITerminalChildProcess { return this._instantiationService.createInstance(TerminalProcess, shellLaunchConfig, cwd, cols, rows, env, windowsEnableConpty); } diff --git a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts index 4e35926b4f2..21228cb208f 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts @@ -54,14 +54,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { this._initialCwd = cwd; - // Only use ConPTY when the client is non WoW64 (see #72190) and the Windows build number is at least 18309 (for - // stability/performance reasons) - const is32ProcessOn64Windows = process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432'); - const useConpty = windowsEnableConpty && - process.platform === 'win32' && - !is32ProcessOn64Windows && - getWindowsBuildNumber() >= 18309; - + const useConpty = windowsEnableConpty && process.platform === 'win32' && getWindowsBuildNumber() >= 18309; const options: pty.IPtyForkOptions | pty.IWindowsPtyForkOptions = { name: shellName, cwd, diff --git a/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts b/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts index 1bc875456dd..ced2d3ee265 100644 --- a/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts +++ b/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts @@ -6,7 +6,7 @@ import * as platform from 'vs/base/common/platform'; import { Emitter, Event } from 'vs/base/common/event'; import { ITerminalInstance, IWindowsShellHelper } from 'vs/workbench/contrib/terminal/common/terminal'; -import { Terminal as XTermTerminal } from 'vscode-xterm'; +import { Terminal as XTermTerminal } from 'xterm'; import WindowsProcessTreeType = require('windows-process-tree'); const SHELL_EXECUTABLES = [ diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalCommandTracker.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalCommandTracker.test.ts index a2d20eb2c2e..6216173e3a2 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalCommandTracker.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalCommandTracker.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { Terminal, TerminalCore } from 'vscode-xterm'; +import { Terminal, TerminalCore } from 'xterm'; import { TerminalCommandTracker } from 'vs/workbench/contrib/terminal/browser/terminalCommandTracker'; import { isWindows } from 'vs/base/common/platform'; diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts index bfb91e02998..e54e34df8b5 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -24,7 +24,7 @@ class TestTerminalLinkHandler extends TerminalLinkHandler { } class TestXterm { - public webLinksInit() { } + public loadAddon() { } public registerLinkMatcher() { } } diff --git a/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts b/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts index efa834b0e6d..b7a6f3d7989 100644 --- a/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts +++ b/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts @@ -11,7 +11,7 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr import { IGlobalActivityRegistry, GlobalActivityExtensions } from 'vs/workbench/common/activity'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, Win3264BitContribution, Linux32BitContribution } from './update'; +import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, Win3264BitContribution } from './update'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; const workbench = Registry.as(WorkbenchExtensions.Workbench); @@ -24,13 +24,6 @@ if (platform.isWindows) { } } -// TODO@ben remove me after a while -if (platform.isLinux) { - if (process.arch === 'ia32') { - workbench.registerWorkbenchContribution(Linux32BitContribution, LifecyclePhase.Restored); - } -} - Registry.as(GlobalActivityExtensions) .registerActivity(UpdateContribution); diff --git a/src/vs/workbench/contrib/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts index cea347aca03..47de95dcafa 100644 --- a/src/vs/workbench/contrib/update/electron-browser/update.ts +++ b/src/vs/workbench/contrib/update/electron-browser/update.ts @@ -212,53 +212,6 @@ export class Win3264BitContribution implements IWorkbenchContribution { } } -export class Linux32BitContribution implements IWorkbenchContribution { - - private static readonly KEY = 'update/linux32-64bits'; - private static readonly URL = 'https://code.visualstudio.com/updates/v1_32#_linux-32-bit-support-ends-soon'; - private static readonly INSIDER_URL = 'https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_32.md#linux-32-bit-support-ends-soon'; - - constructor( - @IStorageService storageService: IStorageService, - @INotificationService notificationService: INotificationService, - @IEnvironmentService environmentService: IEnvironmentService - ) { - if (environmentService.disableUpdates) { - return; - } - - const neverShowAgain = new NeverShowAgain(Linux32BitContribution.KEY, storageService); - - if (!neverShowAgain.shouldShow()) { - return; - } - - const url = product.quality === 'insider' - ? Linux32BitContribution.INSIDER_URL - : Linux32BitContribution.URL; - - const handle = notificationService.prompt( - severity.Info, - nls.localize('linux64bits', "{0} for 32-bit Linux will soon be discontinued. Please update to the 64-bit version.", product.nameShort, url), - [{ - label: nls.localize('learnmore', "Learn More"), - run: () => { - window.open(url); - } - }, - { - label: nls.localize('neveragain', "Don't Show Again"), - isSecondary: true, - run: () => { - neverShowAgain.action.run(handle); - neverShowAgain.action.dispose(); - } - }], - { sticky: true } - ); - } -} - class CommandAction extends Action { constructor( diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts index 85975f66fb2..8eb33010acb 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts @@ -327,4 +327,4 @@ export class RevivedWebviewEditorInput extends WebviewEditorInput { } return super.resolve(); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 48e77cdadce..148b2cb8300 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -532,10 +532,13 @@ export class WebviewElement extends Disposable implements Webview { if (this._webview.parentElement) { this._webview.parentElement.removeChild(this._webview); } + this._webview = undefined; } - this._webview = undefined; - this._webviewFindWidget = undefined; + if (this._webviewFindWidget) { + this._webviewFindWidget.dispose(); + this._webviewFindWidget = undefined; + } super.dispose(); } diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index d415c93b8d3..048706c0869 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -21,7 +21,7 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ADD_ROOT_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands'; -import { SupportsWorkspacesContext, IsMacContext, HasMacNativeTabsContext, IsDevelopmentContext, WorkbenchStateContext, WorkspaceFolderCountContext, RemoteFileDialogContext } from 'vs/workbench/browser/contextkeys'; +import { SupportsWorkspacesContext, IsMacContext, HasMacNativeTabsContext, IsDevelopmentContext, WorkbenchStateContext, WorkspaceFolderCountContext, RemoteFileDialogContext, IsFullscreenContext } from 'vs/workbench/browser/contextkeys'; import { NoEditorsVisibleContext, SingleEditorGroupsContext } from 'vs/workbench/common/editor'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { LogStorageAction } from 'vs/platform/storage/node/storageService'; @@ -362,7 +362,8 @@ import { LogStorageAction } from 'vs/platform/storage/node/storageService'; group: '1_toggle_view', command: { id: ToggleFullScreenAction.ID, - title: nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "Toggle &&Full Screen") + title: nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "&&Full Screen"), + toggled: IsFullscreenContext }, order: 1 }); diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index b5c5364d18a..6b58a8de754 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -28,7 +28,7 @@ import { IMenuService, MenuId, IMenu, MenuItemAction, ICommandAction } from 'vs/ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { fillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem'; import { RunOnceScheduler } from 'vs/base/common/async'; -import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; +import { IDisposable, Disposable, DisposableStore } from 'vs/base/common/lifecycle'; import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { IIntegrityService } from 'vs/workbench/services/integrity/common/integrity'; @@ -61,7 +61,7 @@ export class ElectronWindow extends Disposable { private touchBarMenu?: IMenu; private touchBarUpdater: RunOnceScheduler; - private touchBarDisposables: IDisposable[]; + private readonly touchBarDisposables = this._register(new DisposableStore()); private lastInstalledTouchedBar: ICommandAction[][]; private previousConfiguredZoomLevel: number; @@ -95,8 +95,6 @@ export class ElectronWindow extends Disposable { ) { super(); - this.touchBarDisposables = []; - this.pendingFoldersToAdd = []; this.addFoldersScheduler = this._register(new RunOnceScheduler(() => this.doAddFolders(), 100)); @@ -352,20 +350,20 @@ export class ElectronWindow extends Disposable { } // Dispose old - this.touchBarDisposables = dispose(this.touchBarDisposables); + this.touchBarDisposables.clear(); this.touchBarMenu = undefined; // Create new (delayed) this.touchBarUpdater = new RunOnceScheduler(() => this.doUpdateTouchbarMenu(), 300); - this.touchBarDisposables.push(this.touchBarUpdater); + this.touchBarDisposables.add(this.touchBarUpdater); this.touchBarUpdater.schedule(); } private doUpdateTouchbarMenu(): void { if (!this.touchBarMenu) { this.touchBarMenu = this.editorService.invokeWithinEditorContext(accessor => this.menuService.createMenu(MenuId.TouchBarContext, accessor.get(IContextKeyService))); - this.touchBarDisposables.push(this.touchBarMenu); - this.touchBarDisposables.push(this.touchBarMenu.onDidChange(() => this.touchBarUpdater.schedule())); + this.touchBarDisposables.add(this.touchBarMenu); + this.touchBarDisposables.add(this.touchBarMenu.onDidChange(() => this.touchBarUpdater.schedule())); } const actions: Array = []; @@ -533,10 +531,4 @@ export class ElectronWindow extends Disposable { // Otherwise open all return this.editorService.openEditors(resources); } - - dispose(): void { - this.touchBarDisposables = dispose(this.touchBarDisposables); - - super.dispose(); - } } diff --git a/src/vs/workbench/services/configuration/browser/configuration.ts b/src/vs/workbench/services/configuration/browser/configuration.ts index 1ffabf5c9bd..02331934375 100644 --- a/src/vs/workbench/services/configuration/browser/configuration.ts +++ b/src/vs/workbench/services/configuration/browser/configuration.ts @@ -21,8 +21,8 @@ import { extname, join } from 'vs/base/common/path'; import { equals } from 'vs/base/common/objects'; import { Schemas } from 'vs/base/common/network'; import { IConfigurationModel, compare } from 'vs/platform/configuration/common/configuration'; -import { createSHA1 } from 'vs/base/browser/hash'; import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; +import { hash } from 'vs/base/common/hash'; export class RemoteUserConfiguration extends Disposable { @@ -672,7 +672,7 @@ class CachedFolderConfiguration extends Disposable implements IFolderConfigurati readonly onDidChange: Event = this._onDidChange.event; private configurationModel: ConfigurationModel; - private readonly key: Thenable; + private readonly key: ConfigurationKey; constructor( folder: URI, @@ -680,14 +680,13 @@ class CachedFolderConfiguration extends Disposable implements IFolderConfigurati private readonly configurationCache: IConfigurationCache ) { super(); - this.key = createSHA1(join(folder.path, configFolderRelativePath)).then(key => ({ type: 'folder', key })); + this.key = { type: 'folder', key: hash(join(folder.path, configFolderRelativePath)).toString(16) }; this.configurationModel = new ConfigurationModel(); } async loadConfiguration(): Promise { try { - const key = await this.key; - const contents = await this.configurationCache.read(key); + const contents = await this.configurationCache.read(this.key); const parsed: IConfigurationModel = JSON.parse(contents.toString()); this.configurationModel = new ConfigurationModel(parsed.contents, parsed.keys, parsed.overrides); } catch (e) { @@ -696,11 +695,10 @@ class CachedFolderConfiguration extends Disposable implements IFolderConfigurati } async updateConfiguration(configurationModel: ConfigurationModel): Promise { - const key = await this.key; if (configurationModel.keys.length) { - await this.configurationCache.write(key, JSON.stringify(configurationModel.toJSON())); + await this.configurationCache.write(this.key, JSON.stringify(configurationModel.toJSON())); } else { - await this.configurationCache.remove(key); + await this.configurationCache.remove(this.key); } } diff --git a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts index b3c90ce98d9..4fabf919787 100644 --- a/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/electron-browser/configurationEditingService.test.ts @@ -186,7 +186,7 @@ suite('ConfigurationEditingService', () => { test('do not notify error', () => { instantiationService.stub(ITextFileService, 'isDirty', true); const target = sinon.stub(); - instantiationService.stub(INotificationService, { prompt: target, _serviceBrand: null, notify: null!, error: null!, info: null!, warn: null! }); + instantiationService.stub(INotificationService, { prompt: target, _serviceBrand: null!, notify: null!, error: null!, info: null!, warn: null!, status: null! }); return testObject.writeConfiguration(EditableConfigurationTarget.USER_LOCAL, { key: 'configurationEditing.service.testSetting', value: 'value' }, { donotNotifyError: true }) .then(() => assert.fail('Should fail with ERROR_CONFIGURATION_FILE_DIRTY error.'), (error: ConfigurationEditingError) => { diff --git a/src/vs/workbench/services/extensions/node/proxyResolver.ts b/src/vs/workbench/services/extensions/node/proxyResolver.ts index 209546ff772..5480a882d78 100644 --- a/src/vs/workbench/services/extensions/node/proxyResolver.ts +++ b/src/vs/workbench/services/extensions/node/proxyResolver.ts @@ -457,8 +457,8 @@ async function readCaCertificates() { return undefined; } -function readWindowsCaCertificates() { - const winCA = require.__$__nodeRequire('vscode-windows-ca-certs'); +async function readWindowsCaCertificates() { + const winCA = await import('vscode-windows-ca-certs'); let ders: any[] = []; const store = winCA(); diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index 2207d362f16..81f4a303766 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -28,7 +28,6 @@ import { IKeybindingItem, IKeybindingRule2, KeybindingWeight, KeybindingsRegistr import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { keybindingsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; import { ExtensionMessageCollector, ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; @@ -216,7 +215,7 @@ let keybindingType: IJSONSchema = { description: nls.localize('vscode.extension.contributes.keybindings.args', "Arguments to pass to the command to execute.") }, key: { - description: nls.localize('vscode.extension.contributes.keybindings.key', 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g Ctrl+O and Ctrl+L L for a chord).'), + description: nls.localize('vscode.extension.contributes.keybindings.key', 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord).'), type: 'string' }, mac: { @@ -277,12 +276,11 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService { @ITelemetryService telemetryService: ITelemetryService, @INotificationService notificationService: INotificationService, @IEnvironmentService environmentService: IEnvironmentService, - @IStatusbarService statusBarService: IStatusbarService, @IConfigurationService configurationService: IConfigurationService, @IWindowService private readonly windowService: IWindowService, @IExtensionService extensionService: IExtensionService ) { - super(contextKeyService, commandService, telemetryService, notificationService, statusBarService); + super(contextKeyService, commandService, telemetryService, notificationService); updateSchema(); diff --git a/src/vs/workbench/services/layout/browser/layoutService.ts b/src/vs/workbench/services/layout/browser/layoutService.ts index 815af5edeb2..c89bbef87c1 100644 --- a/src/vs/workbench/services/layout/browser/layoutService.ts +++ b/src/vs/workbench/services/layout/browser/layoutService.ts @@ -45,6 +45,21 @@ export interface IWorkbenchLayoutService extends ILayoutService { */ readonly onZenModeChange: Event; + /** + * Emits when fullscreen is enabled or disabled. + */ + readonly onFullscreenChange: Event; + + /** + * Emits when centered layout is enabled or disabled. + */ + readonly onCenteredLayoutChange: Event; + + /** + * Emit when panel position changes. + */ + readonly onPanelPositionChange: Event; + /** * Asks the part service if all parts have been fully restored. For editor part * this means that the contents of editors have loaded. diff --git a/src/vs/workbench/services/notification/common/notificationService.ts b/src/vs/workbench/services/notification/common/notificationService.ts index f64821ca7da..74d3dd598a7 100644 --- a/src/vs/workbench/services/notification/common/notificationService.ts +++ b/src/vs/workbench/services/notification/common/notificationService.ts @@ -3,15 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { INotificationService, INotification, INotificationHandle, Severity, NotificationMessage, INotificationActions, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification'; +import { INotificationService, INotification, INotificationHandle, Severity, NotificationMessage, INotificationActions, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { INotificationsModel, NotificationsModel, ChoiceAction } from 'vs/workbench/common/notifications'; -import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; +import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; import { Event } from 'vs/base/common/event'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; +import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; export class NotificationService extends Disposable implements INotificationService { - _serviceBrand: any; + _serviceBrand: ServiceIdentifier; private _model: INotificationsModel = this._register(new NotificationsModel()); @@ -26,7 +27,7 @@ export class NotificationService extends Disposable implements INotificationServ return; } - this.model.notify({ severity: Severity.Info, message }); + this.model.addNotification({ severity: Severity.Info, message }); } warn(message: NotificationMessage | NotificationMessage[]): void { @@ -36,7 +37,7 @@ export class NotificationService extends Disposable implements INotificationServ return; } - this.model.notify({ severity: Severity.Warning, message }); + this.model.addNotification({ severity: Severity.Warning, message }); } error(message: NotificationMessage | NotificationMessage[]): void { @@ -46,11 +47,11 @@ export class NotificationService extends Disposable implements INotificationServ return; } - this.model.notify({ severity: Severity.Error, message }); + this.model.addNotification({ severity: Severity.Error, message }); } notify(notification: INotification): INotificationHandle { - return this.model.notify(notification); + return this.model.addNotification(notification); } prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { @@ -104,6 +105,10 @@ export class NotificationService extends Disposable implements INotificationServ return handle; } + + status(message: NotificationMessage, options?: IStatusMessageOptions): IDisposable { + return this.model.showStatusMessage(message, options); + } } registerSingleton(INotificationService, NotificationService, true); \ No newline at end of file diff --git a/src/vs/workbench/services/output/common/outputChannelModel.ts b/src/vs/workbench/services/output/common/outputChannelModel.ts index 6be8813a35c..be87bf1aecc 100644 --- a/src/vs/workbench/services/output/common/outputChannelModel.ts +++ b/src/vs/workbench/services/output/common/outputChannelModel.ts @@ -51,10 +51,10 @@ export abstract class AsbtractOutputChannelModelService { export abstract class AbstractFileOutputChannelModel extends Disposable implements IOutputChannelModel { - protected _onDidAppendedContent = new Emitter(); + protected readonly _onDidAppendedContent = this._register(new Emitter()); readonly onDidAppendedContent: Event = this._onDidAppendedContent.event; - protected _onDispose = new Emitter(); + protected readonly _onDispose = this._register(new Emitter()); readonly onDispose: Event = this._onDispose.event; protected modelUpdater: RunOnceScheduler; diff --git a/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts b/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts index af7555454f4..316a6f97a50 100644 --- a/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts +++ b/src/vs/workbench/services/textMate/browser/abstractTextMateService.ts @@ -27,15 +27,16 @@ import { IEmbeddedLanguagesMap as IEmbeddedLanguagesMap2, IGrammar, ITokenTypeMa import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -export class TMScopeRegistry { +export class TMScopeRegistry extends Disposable { private _scopeNameToLanguageRegistration: { [scopeName: string]: TMLanguageRegistration; }; private _encounteredLanguages: boolean[]; - private readonly _onDidEncounterLanguage = new Emitter(); + private readonly _onDidEncounterLanguage = this._register(new Emitter()); public readonly onDidEncounterLanguage: Event = this._onDidEncounterLanguage.event; constructor() { + super(); this.reset(); } diff --git a/src/vs/workbench/services/themes/common/colorThemeData.ts b/src/vs/workbench/services/themes/common/colorThemeData.ts index acc4ba8788d..08253f09445 100644 --- a/src/vs/workbench/services/themes/common/colorThemeData.ts +++ b/src/vs/workbench/services/themes/common/colorThemeData.ts @@ -251,7 +251,7 @@ export class ColorThemeData implements IColorTheme { break; case 'themeTokenColors': case 'id': case 'label': case 'settingsId': case 'extensionData': case 'watch': - theme[key] = data[key]; + (theme as any)[key] = data[key]; break; } } diff --git a/src/vs/workbench/services/themes/common/fileIconThemeData.ts b/src/vs/workbench/services/themes/common/fileIconThemeData.ts index 7d84be48b03..306d58f9155 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeData.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeData.ts @@ -118,7 +118,7 @@ export class FileIconThemeData implements IFileIconTheme { case 'hidesExplorerArrows': case 'hasFolderIcons': case 'watch': - theme[key] = data[key]; + (theme as any)[key] = data[key]; break; case 'location': theme.location = URI.revive(data.location); diff --git a/src/vs/workbench/services/themes/common/fileIconThemeStore.ts b/src/vs/workbench/services/themes/common/fileIconThemeStore.ts index b887b23dea3..dfc2b180f4e 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeStore.ts @@ -13,6 +13,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import { Event, Emitter } from 'vs/base/common/event'; import { FileIconThemeData } from 'vs/workbench/services/themes/common/fileIconThemeData'; import { URI } from 'vs/base/common/uri'; +import { Disposable } from 'vs/base/common/lifecycle'; const iconThemeExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'iconThemes', @@ -46,16 +47,16 @@ export interface FileIconThemeChangeEvent { added: FileIconThemeData[]; } -export class FileIconThemeStore { +export class FileIconThemeStore extends Disposable { private knownIconThemes: FileIconThemeData[]; - private readonly onDidChangeEmitter: Emitter; - public get onDidChange(): Event { return this.onDidChangeEmitter.event; } + private readonly onDidChangeEmitter = this._register(new Emitter()); + readonly onDidChange: Event = this.onDidChangeEmitter.event; constructor(@IExtensionService private readonly extensionService: IExtensionService) { + super(); this.knownIconThemes = []; - this.onDidChangeEmitter = new Emitter(); this.initialize(); } @@ -167,5 +168,4 @@ export class FileIconThemeStore { return this.knownIconThemes; }); } - } diff --git a/src/vs/workbench/services/timer/electron-browser/timerService.ts b/src/vs/workbench/services/timer/electron-browser/timerService.ts index b26edf948a8..e7cddc25d67 100644 --- a/src/vs/workbench/services/timer/electron-browser/timerService.ts +++ b/src/vs/workbench/services/timer/electron-browser/timerService.ts @@ -12,7 +12,6 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/ import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; import { IUpdateService } from 'vs/platform/update/common/update'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -23,14 +22,12 @@ import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessi /* __GDPR__FRAGMENT__ "IMemoryInfo" : { "workingSetSize" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, - "peakWorkingSetSize": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "privateBytes": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "sharedBytes": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true } } */ export interface IMemoryInfo { readonly workingSetSize: number; - readonly peakWorkingSetSize: number; readonly privateBytes: number; readonly sharedBytes: number; } @@ -211,7 +208,7 @@ export interface IStartupMetrics { readonly ellapsedWorkspaceServiceInit: number; /** - * The time it took to load the main-bundle of the workbench, e.g `workbench.main.js`. + * The time it took to load the main-bundle of the workbench, e.g. `workbench.main.js`. * * * Happens in the renderer-process * * Measured with the `willLoadWorkbenchMain` and `didLoadWorkbenchMain` performance marks. @@ -355,7 +352,13 @@ class TimerService implements ITimerService { release = os.release(); arch = os.arch(); loadavg = os.loadavg(); - meminfo = process.getProcessMemoryInfo(); + + const processMemoryInfo = await process.getProcessMemoryInfo(); + meminfo = { + workingSetSize: processMemoryInfo.residentSet, + privateBytes: processMemoryInfo.private, + sharedBytes: processMemoryInfo.shared + }; isVMLikelyhood = Math.round((virtualMachineHint.value() * 100)); @@ -428,16 +431,16 @@ export function didUseCachedData(): boolean { if (!Boolean((global).require.getConfig().nodeCachedData)) { return false; } - // whenever cached data is produced or rejected a onNodeCachedData-callback is invoked. That callback - // stores data in the `MonacoEnvironment.onNodeCachedData` global. See: - // https://github.com/Microsoft/vscode/blob/efe424dfe76a492eab032343e2fa4cfe639939f0/src/vs/workbench/electron-browser/bootstrap/index.js#L299 - if (isNonEmptyArray(MonacoEnvironment.onNodeCachedData)) { - return false; + // There are loader events that signal if cached data was missing, rejected, + // or used. The former two mean no cached data. + for (const event of require.getStats()) { + switch (event.type) { + case LoaderEventType.CachedDataRejected: + case LoaderEventType.CachedDataMissed: + return false; + } } return true; } -declare type OnNodeCachedDataArgs = [{ errorCode: string, path: string, detail?: string }, { path: string, length: number }]; -declare const MonacoEnvironment: { onNodeCachedData: OnNodeCachedDataArgs[] }; - //#endregion diff --git a/src/vs/workbench/test/common/notifications.test.ts b/src/vs/workbench/test/common/notifications.test.ts index 678c6aab20b..30312d509e3 100644 --- a/src/vs/workbench/test/common/notifications.test.ts +++ b/src/vs/workbench/test/common/notifications.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { NotificationsModel, NotificationViewItem, INotificationChangeEvent, NotificationChangeType, NotificationViewItemLabelKind } from 'vs/workbench/common/notifications'; +import { NotificationsModel, NotificationViewItem, INotificationChangeEvent, NotificationChangeType, NotificationViewItemLabelKind, IStatusMessageChangeEvent, StatusMessageChangeType } from 'vs/workbench/common/notifications'; import { Action } from 'vs/base/common/actions'; import { INotification, Severity } from 'vs/platform/notification/common/notification'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; @@ -132,9 +132,14 @@ suite('Notifications', () => { test('Model', () => { const model = new NotificationsModel(); - let lastEvent!: INotificationChangeEvent; + let lastNotificationEvent!: INotificationChangeEvent; model.onDidNotificationChange(e => { - lastEvent = e; + lastNotificationEvent = e; + }); + + let lastStatusMessageEvent!: IStatusMessageChangeEvent; + model.onDidStatusMessageChange(e => { + lastStatusMessageEvent = e; }); let item1: INotification = { severity: Severity.Error, message: 'Error Message', actions: { primary: [new Action('id', 'label')] } }; @@ -142,23 +147,23 @@ suite('Notifications', () => { let item2Duplicate: INotification = { severity: Severity.Warning, message: 'Warning Message', source: 'Some Source' }; let item3: INotification = { severity: Severity.Info, message: 'Info Message' }; - let item1Handle = model.notify(item1); - assert.equal(lastEvent.item.severity, item1.severity); - assert.equal(lastEvent.item.message.value, item1.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.ADD); + let item1Handle = model.addNotification(item1); + assert.equal(lastNotificationEvent.item.severity, item1.severity); + assert.equal(lastNotificationEvent.item.message.value, item1.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD); - let item2Handle = model.notify(item2); - assert.equal(lastEvent.item.severity, item2.severity); - assert.equal(lastEvent.item.message.value, item2.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.ADD); + let item2Handle = model.addNotification(item2); + assert.equal(lastNotificationEvent.item.severity, item2.severity); + assert.equal(lastNotificationEvent.item.message.value, item2.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD); - model.notify(item3); - assert.equal(lastEvent.item.severity, item3.severity); - assert.equal(lastEvent.item.message.value, item3.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.ADD); + model.addNotification(item3); + assert.equal(lastNotificationEvent.item.severity, item3.severity); + assert.equal(lastNotificationEvent.item.message.value, item3.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD); assert.equal(model.notifications.length, 3); @@ -170,29 +175,48 @@ suite('Notifications', () => { item1Handle.close(); assert.equal(called, 1); assert.equal(model.notifications.length, 2); - assert.equal(lastEvent.item.severity, item1.severity); - assert.equal(lastEvent.item.message.value, item1.message); - assert.equal(lastEvent.index, 2); - assert.equal(lastEvent.kind, NotificationChangeType.REMOVE); + assert.equal(lastNotificationEvent.item.severity, item1.severity); + assert.equal(lastNotificationEvent.item.message.value, item1.message); + assert.equal(lastNotificationEvent.index, 2); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.REMOVE); - model.notify(item2Duplicate); + model.addNotification(item2Duplicate); assert.equal(model.notifications.length, 2); - assert.equal(lastEvent.item.severity, item2Duplicate.severity); - assert.equal(lastEvent.item.message.value, item2Duplicate.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.ADD); + assert.equal(lastNotificationEvent.item.severity, item2Duplicate.severity); + assert.equal(lastNotificationEvent.item.message.value, item2Duplicate.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.ADD); item2Handle.close(); assert.equal(model.notifications.length, 1); - assert.equal(lastEvent.item.severity, item2Duplicate.severity); - assert.equal(lastEvent.item.message.value, item2Duplicate.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.REMOVE); + assert.equal(lastNotificationEvent.item.severity, item2Duplicate.severity); + assert.equal(lastNotificationEvent.item.message.value, item2Duplicate.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.REMOVE); model.notifications[0].expand(); - assert.equal(lastEvent.item.severity, item3.severity); - assert.equal(lastEvent.item.message.value, item3.message); - assert.equal(lastEvent.index, 0); - assert.equal(lastEvent.kind, NotificationChangeType.CHANGE); + assert.equal(lastNotificationEvent.item.severity, item3.severity); + assert.equal(lastNotificationEvent.item.message.value, item3.message); + assert.equal(lastNotificationEvent.index, 0); + assert.equal(lastNotificationEvent.kind, NotificationChangeType.CHANGE); + + const disposable = model.showStatusMessage('Hello World'); + assert.equal(model.statusMessage!.message, 'Hello World'); + assert.equal(lastStatusMessageEvent.item.message, model.statusMessage!.message); + assert.equal(lastStatusMessageEvent.kind, StatusMessageChangeType.ADD); + disposable.dispose(); + assert.ok(!model.statusMessage); + assert.equal(lastStatusMessageEvent.kind, StatusMessageChangeType.REMOVE); + + let disposable2 = model.showStatusMessage('Hello World 2'); + const disposable3 = model.showStatusMessage('Hello World 3'); + + assert.equal(model.statusMessage!.message, 'Hello World 3'); + + disposable2.dispose(); + assert.equal(model.statusMessage!.message, 'Hello World 3'); + + disposable3.dispose(); + assert.ok(!model.statusMessage); }); }); \ No newline at end of file diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index d73ba1096ac..ff72eb8df42 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -194,7 +194,7 @@ suite('ExtHostLanguageFeatures', function () { await rpcProtocol.sync(); const value = await getCodeLensData(model, CancellationToken.None); - assert.equal(value.length, 1); + assert.equal(value.lenses.length, 1); }); test('CodeLens, do not resolve a resolved lens', async () => { @@ -212,8 +212,8 @@ suite('ExtHostLanguageFeatures', function () { await rpcProtocol.sync(); const value = await getCodeLensData(model, CancellationToken.None); - assert.equal(value.length, 1); - const data = value[0]; + assert.equal(value.lenses.length, 1); + const [data] = value.lenses; const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None)); assert.equal(symbol!.command!.id, 'id'); assert.equal(symbol!.command!.title, 'Title'); @@ -229,8 +229,8 @@ suite('ExtHostLanguageFeatures', function () { await rpcProtocol.sync(); const value = await getCodeLensData(model, CancellationToken.None); - assert.equal(value.length, 1); - let data = value[0]; + assert.equal(value.lenses.length, 1); + let [data] = value.lenses; const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None)); assert.equal(symbol!.command!.id, 'missing'); assert.equal(symbol!.command!.title, '!!MISSING: command!!'); diff --git a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts index 9ffa9aee794..556d88a5512 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostMessagerService.test.ts @@ -6,9 +6,11 @@ import * as assert from 'assert'; import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMessageService'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; -import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification'; +import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; +import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; const emptyDialogService = new class implements IDialogService { _serviceBrand: 'dialogService'; @@ -30,7 +32,7 @@ const emptyCommandService: ICommandService = { }; const emptyNotificationService = new class implements INotificationService { - _serviceBrand: 'notificiationService'; + _serviceBrand: ServiceIdentifier; notify(...args: any[]): never { throw new Error('not implemented'); } @@ -46,11 +48,13 @@ const emptyNotificationService = new class implements INotificationService { prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { throw new Error('not implemented'); } + status(message: string | Error, options?: IStatusMessageOptions): IDisposable { + return Disposable.None; + } }; class EmptyNotificationService implements INotificationService { - - _serviceBrand: any; + _serviceBrand: ServiceIdentifier; constructor(private withNotify: (notification: INotification) => void) { } @@ -72,6 +76,9 @@ class EmptyNotificationService implements INotificationService { prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle { throw new Error('not implemented'); } + status(message: string, options?: IStatusMessageOptions): IDisposable { + return Disposable.None; + } } suite('ExtHostMessageService', function () { diff --git a/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts b/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts index a0d8a8c41ad..2650c602cdf 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostWebview.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { MainThreadWebviews } from 'vs/workbench/api/electron-browser/mainThreadWebview'; +import { MainThreadWebviews } from 'vs/workbench/api/browser/mainThreadWebview'; import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview'; import { mock } from 'vs/workbench/test/electron-browser/api/mock'; import * as vscode from 'vscode'; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 99e06ec62c2..09b4ed6f217 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -456,6 +456,9 @@ export class TestLayoutService implements IWorkbenchLayoutService { container: HTMLElement = window.document.body; onZenModeChange: Event = Event.None; + onCenteredLayoutChange: Event = Event.None; + onFullscreenChange: Event = Event.None; + onPanelPositionChange: Event = Event.None; onLayout = Event.None; private _onTitleBarVisibilityChange = new Emitter(); diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 78cc5e95942..9667ecad1d4 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -7,7 +7,7 @@ import 'vs/editor/editor.all'; -import 'vs/workbench/api/electron-browser/extensionHost.contribution'; +import 'vs/workbench/api/browser/extensionHost.contribution'; import 'vs/workbench/electron-browser/main.contribution'; import 'vs/workbench/browser/workbench.contribution'; @@ -324,9 +324,6 @@ import 'vs/workbench/contrib/outline/browser/outline.contribution'; // Experiments import 'vs/workbench/contrib/experiments/electron-browser/experiments.contribution'; -// Code Insets -import 'vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution'; - // Issues import 'vs/workbench/contrib/issue/electron-browser/issue.contribution'; diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 147c0818ae4..b6609ac5f97 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -322,9 +322,6 @@ import 'vs/workbench/contrib/outline/browser/outline.contribution'; // Experiments // import 'vs/workbench/contrib/experiments/electron-browser/experiments.contribution'; -// Code Insets -// import 'vs/workbench/contrib/codeinset/electron-browser/codeInset.contribution'; - // Issues // import 'vs/workbench/contrib/issue/electron-browser/issue.contribution'; diff --git a/test/smoke/README.md b/test/smoke/README.md index 0a6527ec0f6..b5be966e518 100644 --- a/test/smoke/README.md +++ b/test/smoke/README.md @@ -22,7 +22,7 @@ yarn smoketest --build PATH_TO_NEW_BUILD_PARENT_FOLDER --remote ### Run for a release -You must always run the smoketest version which matches the release you are testing. So, if you want to run the smoketest for a release build (eg `release/1.22`), you need that version of the smoke tests too: +You must always run the smoketest version which matches the release you are testing. So, if you want to run the smoketest for a release build (e.g. `release/1.22`), you need that version of the smoke tests too: ```bash git checkout release/1.22 diff --git a/test/smoke/package.json b/test/smoke/package.json index 00b04f8453d..e19de8f9de2 100644 --- a/test/smoke/package.json +++ b/test/smoke/package.json @@ -17,12 +17,12 @@ "@types/mkdirp": "0.5.1", "@types/mocha": "2.2.41", "@types/ncp": "2.0.1", - "@types/node": "8.0.33", + "@types/node": "^10.14.8", "@types/rimraf": "2.0.2", "@types/webdriverio": "4.6.1", "concurrently": "^3.5.1", "cpx": "^1.5.0", - "electron": "3.1.8", + "electron": "4.2.3", "htmlparser2": "^3.9.2", "mkdirp": "^0.5.1", "mocha": "^5.2.0", diff --git a/test/smoke/src/application.ts b/test/smoke/src/application.ts index 58e5b301a2c..5d764176846 100644 --- a/test/smoke/src/application.ts +++ b/test/smoke/src/application.ts @@ -47,6 +47,10 @@ export class Application { return this.options.logger; } + get remote(): boolean { + return !!this.options.remote; + } + private _workspacePathOrFolder: string; get workspacePathOrFolder(): string { return this._workspacePathOrFolder; @@ -135,8 +139,12 @@ export class Application { await this.code.waitForWindowIds(ids => ids.length > 0); await this.code.waitForElement('.monaco-workbench'); + if (this.remote) { + await this.code.waitForElement('.monaco-workbench .statusbar-item.statusbar-entry a[title="Editing on TestResolver"]'); + } + // wait a bit, since focus might be stolen off widgets - // as soon as they open (eg quick open) + // as soon as they open (e.g. quick open) await new Promise(c => setTimeout(c, 1000)); } } diff --git a/test/smoke/src/areas/extensions/extensions.test.ts b/test/smoke/src/areas/extensions/extensions.test.ts index 4215a7fe247..1ff6dce2df3 100644 --- a/test/smoke/src/areas/extensions/extensions.test.ts +++ b/test/smoke/src/areas/extensions/extensions.test.ts @@ -20,6 +20,10 @@ export function setup() { await app.workbench.extensions.installExtension('michelkaporin.vscode-smoketest-check', 'vscode-smoketest-check'); await app.workbench.extensions.waitForExtensionsViewlet(); + + if (app.remote) { + await app.reload(); + } await app.workbench.quickopen.runCommand('Smoke Test Check'); await app.workbench.statusbar.waitForStatusbarText('smoke test', 'VS Code Smoke Test Check'); }); diff --git a/test/smoke/src/areas/multiroot/multiroot.test.ts b/test/smoke/src/areas/multiroot/multiroot.test.ts index f3ca92b8868..d6c656bc433 100644 --- a/test/smoke/src/areas/multiroot/multiroot.test.ts +++ b/test/smoke/src/areas/multiroot/multiroot.test.ts @@ -47,7 +47,8 @@ export function setup() { const app = this.app as Application; await app.workbench.quickopen.openQuickOpen('*.*'); - await app.workbench.quickopen.waitForQuickOpenElements(names => names.length === 6); + // TODO roblourens: Go to files finds welcome page: issue 74875 + await app.workbench.quickopen.waitForQuickOpenElements(names => names.length === 6 || names.length === 7); await app.workbench.quickopen.closeQuickOpen(); }); diff --git a/test/smoke/src/vscode/code.ts b/test/smoke/src/vscode/code.ts index b50e1caa847..0b9c739cb69 100644 --- a/test/smoke/src/vscode/code.ts +++ b/test/smoke/src/vscode/code.ts @@ -7,6 +7,7 @@ import * as path from 'path'; import * as cp from 'child_process'; import * as os from 'os'; import * as fs from 'fs'; +import * as mkdirp from 'mkdirp'; import { tmpName } from 'tmp'; import { IDriver, connect as connectDriver, IDisposable, IElement, Thenable } from './driver'; import { Logger } from '../logger'; @@ -123,6 +124,8 @@ export async function spawn(options: SpawnOptions): Promise { '--driver', handle ]; + const env = process.env; + if (options.remote) { // Replace workspace path with URI args.shift(); @@ -139,6 +142,9 @@ export async function spawn(options: SpawnOptions): Promise { } } args.push('--enable-proposed-api=vscode.vscode-test-resolver'); + const remoteDataDir = `${options.userDataDir}-server`; + mkdirp.sync(remoteDataDir); + env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir; } if (!codePath) { @@ -157,7 +163,7 @@ export async function spawn(options: SpawnOptions): Promise { args.push(...options.extraArgs); } - const spawnOptions: cp.SpawnOptions = {}; + const spawnOptions: cp.SpawnOptions = { env }; const child = cp.spawn(electronPath, args, spawnOptions); diff --git a/test/smoke/yarn.lock b/test/smoke/yarn.lock index 5e1fd36aa4f..cdcb6f7dada 100644 --- a/test/smoke/yarn.lock +++ b/test/smoke/yarn.lock @@ -44,15 +44,15 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ== -"@types/node@8.0.33": - version "8.0.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd" - integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A== +"@types/node@^10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== -"@types/node@^8.0.24": - version "8.10.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.23.tgz#e5ccfdafff42af5397c29669b6d7d65f7d629a00" - integrity sha512-aEp5ZTLr4mYhR9S85cJ+sEYkcsgFY10N1Si5m49iTAVzanZXOwp/pgw6ibFLKXxpflqm71aSWZCRtnTXXO56gA== +"@types/node@^10.14.8": + version "10.14.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.8.tgz#fe444203ecef1162348cd6deb76c62477b2cc6e9" + integrity sha512-I4+DbJEhLEg4/vIy/2gkWDvXBOOtPKV9EnLhYjMoqxcRW+TTZtUftkHktz/a8suoD5mUL7m6ReLrkPvSsCQQmw== "@types/rimraf@2.0.2": version "2.0.2" @@ -596,12 +596,12 @@ electron-download@^4.1.0: semver "^5.4.1" sumchecker "^2.0.2" -electron@3.1.8: - version "3.1.8" - resolved "https://registry.yarnpkg.com/electron/-/electron-3.1.8.tgz#01b0b147dfcca47967ff07dbf72bf5e96125a2ac" - integrity sha512-1MiFoMzxGaR0wDfwFE5Ydnuk6ry/4lKgF0c+NFyEItxM/WyEHNZPNjJAeKJ+M/0sevmZ+6W4syNZnQL5M3GgsQ== +electron@4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/electron/-/electron-4.2.3.tgz#5d45da9dd5ae97269dbee2623840da808c72d29d" + integrity sha512-nx+jHxj2eNhaYHXFGdzr7zgSphpVHEU9WAu6qqEUsQ936X3c6bQ5Bdg08KbHZj+cyRRQ06JMu6/ILh5pWrDZaA== dependencies: - "@types/node" "^8.0.24" + "@types/node" "^10.12.18" electron-download "^4.1.0" extract-zip "^1.0.3" diff --git a/tslint.json b/tslint.json index 2d3f8afc80f..00b551ce907 100644 --- a/tslint.json +++ b/tslint.json @@ -506,7 +506,9 @@ { "target": "**/vs/workbench/contrib/terminal/browser/**", "restrictions": [ - "vscode-xterm", + // xterm and its addons are strictly browser-only components + "xterm", + "xterm-addon-*", "**/vs/**" ] }, diff --git a/yarn.lock b/yarn.lock index 6b266cfeffb..44f44baf8fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1466,14 +1466,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -clean-css@3.4.6: - version "3.4.6" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-3.4.6.tgz#fcb4f17057ddb7f8721616f70b07b294d95ffc45" - integrity sha1-/LTxcFfdt/hyFhb3CweylNlf/EU= - dependencies: - commander "2.8.x" - source-map "0.4.x" - cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1691,13 +1683,6 @@ commander@2.3.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" integrity sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM= -commander@2.8.x: - version "2.8.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" - integrity sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ= - dependencies: - graceful-readlink ">= 1.0.0" - commander@^2.12.1, commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" @@ -3815,11 +3800,6 @@ graceful-fs@4.1.11, graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= - growl@1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" @@ -6131,10 +6111,10 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-pty@0.9.0-beta13: - version "0.9.0-beta13" - resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.9.0-beta13.tgz#615cae7447ac232aefa65a263d6821bc04d0f213" - integrity sha512-hO1U8Hd4OhSZMryTqfsog2bJnRGh8Ct3yTsfKRbLK8qhUnqmyOdHzLQkGTx5J7aG7iA8mDVcWBSx2YX2MpkDRQ== +node-pty@0.9.0-beta16: + version "0.9.0-beta16" + resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.9.0-beta16.tgz#f11521e73bb4a26df23c40a05f4ca1be93340864" + integrity sha512-5onsCFXGTPcOZFAKh+E+aYalMomMAGqCnz/ibxCEL3xP73VAHRD6L+EadxRXFGbAG9o/EQzT0Wso+xLqhxXtgQ== dependencies: nan "^2.13.2" @@ -8301,18 +8281,18 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.4.x, source-map@^0.4.4: +source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" integrity sha1-66T12pwNyZneaAMti092FzZSA2s= dependencies: amdefine ">=0.0.4" -source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -9075,10 +9055,10 @@ typescript-formatter@7.1.0: commandpost "^1.0.0" editorconfig "^0.15.0" -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.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" + integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== typescript@^2.6.2: version "2.6.2" @@ -9590,10 +9570,10 @@ vscode-nls-dev@3.2.5: xml2js "^0.4.19" yargs "^10.1.1" -vscode-nsfw@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/vscode-nsfw/-/vscode-nsfw-1.1.1.tgz#7c3febe153677c5850b197a0b64a197cd11e95c7" - integrity sha512-Wg3vzN1U3T6P1uE13LdVVRIhdy7XWnWkwmAXhkLsIkH2QY0E/pvNDRLrwAMMW6GC1Fvvbxm3hzdIrCmr7Hq3FA== +vscode-nsfw@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vscode-nsfw/-/vscode-nsfw-1.1.2.tgz#9cb9073b5854386801afe41f7152f721b4ea9e80" + integrity sha512-J0So+JNK/5kQboTO1hKNk4ie/wwUegrJilYSY5sVxU9JJlo3aQdP0zi2NtU8CEK3kkN6qRp0MbXCzbT0LKGorg== dependencies: fs-extra "^7.0.0" lodash.isinteger "^4.0.4" @@ -9643,11 +9623,6 @@ vscode-windows-registry@1.0.1: dependencies: nan "^2.12.1" -vscode-xterm@3.14.0-beta6: - version "3.14.0-beta6" - resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.14.0-beta6.tgz#657f5f68d73c53298b53f912a0dea178445c1c54" - integrity sha512-4E9ioj78LRZbMruEmxrDDSOeoPt3GX87MkY2HaPIT+PNIWNxCRiTCFDwbwXSWLzZdYLBNV6QEqLtnel5w8+1rA== - vso-node-api@6.1.2-preview: version "6.1.2-preview" resolved "https://registry.yarnpkg.com/vso-node-api/-/vso-node-api-6.1.2-preview.tgz#aab3546df2451ecd894e071bb99b5df19c5fa78f" @@ -9917,6 +9892,21 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" +xterm-addon-search@0.1.0-beta5: + version "0.1.0-beta5" + resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.1.0-beta5.tgz#a9ad03d8fc02f8dfaab57809d446d4100b194fda" + integrity sha512-+50eYWs6D77kDHOFxaVss6r4lRskvkrmEXiz5x5aAgO07YIhOfQ3S0RFnQPch2kQ1mS66hsRnnUf0NGNEIZ1+A== + +xterm-addon-web-links@0.1.0-beta9: + version "0.1.0-beta9" + resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.1.0-beta9.tgz#8d30e41f54887ba668974d736488518322bea2c5" + integrity sha512-2UbhFqYMNGY2Eg6jrn+j2jpK2gGRqluiF5I++lSDYbKrxtfj7+WJZYhBzb0EeE7gbzDfcGZqsoueM/q+fAWB8Q== + +xterm@3.15.0-beta14: + version "3.15.0-beta14" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.15.0-beta14.tgz#75afb888be23a31db26cf14131513cd85d0dd550" + integrity sha512-faqJWrweQ2zyD2iQGV6XOq/Evl6iob7vRPQlF2VauBnVg0Nwbuh+/2suD2Oc5BKHyq8dsftpooOsIbIPfiVdnQ== + y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"