diff --git a/.gitignore b/.gitignore index a94d9ea..36ce117 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ hidden .vs **/*.ilk **/*.pdb +.vscode/ipch/ \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index fc531f8..a9dec82 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -16,7 +16,25 @@ "cppStandard": "c++17", "intelliSenseMode": "windows-clang-x64", "configurationProvider": "ms-vscode.cmake-tools" + }, + { + "name": "Process", + "includePath": [ + "${workspaceFolder}/**", + "src\\process\\node-v20.15.1\\include\\node", + "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.22621.0\\ucrt" + ], + "defines": [ + "_DEBUG" + ], + "windowsSdkVersion": "10.0.19041.0", + "compilerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-cl.exe", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "windows-clang-x64", + "configurationProvider": "ms-vscode.cmake-tools" } + ], "version": 4 } diff --git a/.vscode/launch.json b/.vscode/launch.json index c4ea53f..9f82397 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,6 +16,7 @@ "outFiles": [ "${workspaceFolder}/out/**/*.js" ], + "trace": true, "preLaunchTask": "npm: watch" }, { @@ -38,7 +39,15 @@ "name": "Attach Debugger", "type":"cppvsdbg", "request": "attach", - "processId":"${command:pickProcess}" + "processId":"${command:pickProcess}", + "sourceFileMap": { + "minkernel/crts/ucrt/src/appcrt": "C:/Program Files (x86)/Windows Kits/10/Source/10.0.22621.0/ucrt", + "minkernel/crts": "C:/Program Files (x86)/Windows Kits/10/Source/10.0.22621.0", + "VCCRT/vcruntime/inc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/crt/src/vcruntime", + "D:\\a\\_work\\1\\s\\src\\vctools\\delayimp":"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\include", + "D:\\a\\_work\\1\\s\\src\\vctools\\crt\\vcstartup\\src\\misc": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\crt\\src\\vcruntime" + + }, } ] diff --git a/.vscode/settings.json b/.vscode/settings.json index b3fde15..5985560 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -74,6 +74,11 @@ "ratio": "cpp", "stop_token": "cpp", "thread": "cpp", - "xhash": "cpp" - } + "xhash": "cpp", + "functional": "cpp", + "cstdarg": "cpp", + "mutex": "cpp", + "unordered_set": "cpp" + }, + "svg.preview.background": "transparent" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4a85c45..8940473 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -16,79 +16,89 @@ "isDefault": true } }, - { - "type": "npm", - "script": "compile", - "problemMatcher": ["$tsc"], - "label": "npm: compile" - }, { - "type": "shell", - "label": "Build reg.exe", - "command": "clang-cl", - "args": [ - "-g", - "reg\\reg.cpp", - "-DUNICODE", "-D_UNICODE", "-DWIN32_LEAN_AND_MEAN", - "-o", "reg\\reg.exe", - "/MTd", - "/link", "advapi32.lib" - ], - "problemMatcher": { - "owner": "cpp", + "type": "npm", + "script": "compile", + "problemMatcher": ["$tsc"], + "label": "npm: compile" + }, + { + "type": "shell", + "label": "Build reg.exe", + "command": "clang-cl", + "args": [ + "-g", + "reg\\reg.cpp", + "-DUNICODE", "-D_UNICODE", "-DWIN32_LEAN_AND_MEAN", + "-o", "reg\\reg.exe", + "/MTd", + "/link", "advapi32.lib" + ], + "problemMatcher": { + "owner": "cpp", "fileLocation": [ "relative", "${workspaceFolder}" ], - "pattern": { - "regexp": "(.*)\\((.*)\\) *: *(warning|error) *: *(.*)", - "file": 1, - "location": 2, - "severity": 3, - "message": 4 - } - }, - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "type": "shell", - "label": "Build Release reg.exe", - "command": "clang-cl", - "args": [ - "reg\\reg.cpp", - "-DUNICODE", "-D_UNICODE", "-DWIN32_LEAN_AND_MEAN", - "-O2", - "-o", "reg\\reg.exe", - "/MD", - "/link", "advapi32.lib" - ], - "problemMatcher": [ - "$msCompile" - ], - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "type": "shell", - "label": "prepublish", - "command": "git add . & npm version minor --force", - "problemMatcher": [], - "dependsOn": [ - "npm: compile", - "Build Release reg.exe" - ] - }, + "pattern": { + "regexp": "(.*)\\((.*)\\) *: *(warning|error) *: *(.*)", + "file": 1, + "location": 2, + "severity": 3, + "message": 4 + } + }, + "group": "build", + }, + { + "type": "shell", + "label": "Build Release reg.exe", + "command": "clang-cl", + "args": [ + "reg\\reg.cpp", + "-DUNICODE", "-D_UNICODE", "-DWIN32_LEAN_AND_MEAN", + "-O2", + "-o", "reg\\reg.exe", + "/MD", + "/link", "advapi32.lib" + ], + "problemMatcher": [ + "$msCompile" + ], + "group": "build", + }, + + { + "type": "shell", + "label": "prepublish", + "command": "git add . & if not ${input:version}==none npm version ${input:version} --force", + "problemMatcher": [], + "dependsOn": [ + "npm: compile", + "Build Release reg.exe" + ] + }, + { + "type": "shell", + "label": "PUBLISH", + "command": "node E:\\Github\\vscode-vsce\\vsce publish", + "problemMatcher": [], + "dependsOn": "prepublish" + }, { "type": "shell", - "label": "PUBLISH", - "command": "vsce publish", + "label": "PACKAGE", + "command": "node E:\\Github\\vscode-vsce\\vsce package", "problemMatcher": [], "dependsOn": "prepublish" } - + ], + "inputs": [ + { + "id": "version", + "description": "Version bump:", + "type": "pickString", + "options": ["none", "patch", "minor", "major"], + "default": "none" + }, ] } \ No newline at end of file diff --git a/README.md b/README.md index ea6e66c..b84d31a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +"😀" + # Visual Studio Code Registry Editor This extension adds a registry editor to the explorer, and general support for .reg files. @@ -39,3 +41,4 @@ Exposes the following commands for inclusion in launch scripts, etc: ## Author Adrian Stephens + diff --git a/assets/Registry.psd b/assets/Registry.psd new file mode 100644 index 0000000..7b9c002 Binary files /dev/null and b/assets/Registry.psd differ diff --git a/assets/Registry.svg b/assets/Registry.svg new file mode 100644 index 0000000..a6ffcf5 --- /dev/null +++ b/assets/Registry.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + + + + + + + + + + + \ No newline at end of file diff --git a/language/syntax.reg.json b/language/syntax.reg.json index 7afa2ff..784e275 100644 --- a/language/syntax.reg.json +++ b/language/syntax.reg.json @@ -1,111 +1,109 @@ { - "scopeName": "source.reg", - "patterns": [ - { - "name": "keyword.control.import.reg", - "match": "Windows Registry Editor Version 5\\.00|REGEDIT4" - }, - { - "include": "#comments" - }, - { - "include": "#keys" - } - ], - "repository": { - "comments": { - "patterns": [ - { - "name": "comment.line.reg", - "match": ";.*$" - } - ] - }, - "keys": { - "patterns": [ - { - "begin": "\\[(HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKEY_CURRENT_CONFIG)(\\\\.*)*\\]", - "end": "^$", - "name": "keyword.control.reg", - "patterns": [ - {"include": "#values"}, - {"include": "#comments"} - ] - }, - { - "begin": "\\[-(HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKEY_CURRENT_CONFIG)(\\\\.*)*\\]", - "end": "^$", - "name": "keyword.deprecated.reg" - } - ] - }, - "values": { - "patterns": [ - { - "match": "^(.*?)=\\s*-", - "name": "keyword.deprecated.reg" - }, - { - "begin": "^(.*?)=", - "beginCaptures": { - "1": { - "name": "variable.name.reg" - } - }, - "end": "(?=16.0.0" @@ -89,22 +89,22 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", + "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" }, @@ -190,9 +190,9 @@ } }, "node_modules/@types/node": { - "version": "18.19.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", - "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "version": "18.19.53", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.53.tgz", + "integrity": "sha512-GLxgUgHhDKO1Edw9Q0lvMbiO/IQXJwJlMaqxSGBXMpPy8uhkCs2iiPFaB2Q/gmobnFkckD3rqTBMVjXdwq+nKg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -562,12 +562,12 @@ } }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -621,16 +621,16 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -1217,9 +1217,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/natural-compare": { @@ -1573,9 +1573,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 45003dd..541c546 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,25 @@ "files": [ "out/*", "assets/*", + "!assets/*.psd", "language/*", "reg/reg.cpp", "reg/reg.exe", - "LICENSE.txt", - "CHANGELOG.md" + "LICENSE.txt" ], "main": "./out/extension.js", "contributes": { + "viewsContainers": { + "activitybar": [ + { + "id": "regedit-container", + "title": "Registry", + "icon": "assets/Registry.svg" + } + ] + }, "views": { - "explorer": [ + "regedit-container": [ { "id": "regedit-view", "name": "Registry" diff --git a/reg/base.h b/reg/base.h index 993e71c..bb29095 100644 --- a/reg/base.h +++ b/reg/base.h @@ -1,5 +1,6 @@ #pragma once #include +#include //----------------------------------------------------------------------------- // bare minimum @@ -18,7 +19,7 @@ template using enable_if_t = type_t struct T_if; template struct T_if : T_type {}; template struct T_if : T_type {}; -template using if_t = type_t>; +template using if_t = type_t>; template struct T_exists : T_type {}; template using exists_t = type_t>; @@ -35,7 +36,7 @@ template struct T_noref : T_type {}; template struct T_noref : T_type {}; template struct T_noref : T_type {}; template using noref_t = type_t>; -template noref_t& declval() noexcept; +template constexpr noref_t& declval() noexcept; template struct T_deref : T_type())>> {}; template<> struct T_deref : T_type {}; @@ -44,6 +45,26 @@ template struct T_deref : T_type {}; template struct T_deref : T_type {}; template using deref_t = type_t>; +template struct remove_const : T_type {}; +template struct remove_const : T_type {}; +template using remove_const_t = type_t>; + + +template struct typelist { static const auto size = sizeof...(T); }; +template using last_t = typename decltype((T_exists{}, ...))::type; + +template struct T_head; +template struct T_head> : T_head {}; +template struct T_head : T_type { using tail = typelist; }; +template using head_t = type_t>; +template using tail_t = typename T_head::tail; + +template struct T_except_last; +template struct T_except_last, typelist> : T_except_last, R...> {}; +template struct T_except_last, M, R...> : T_except_last, R...> {}; +template struct T_except_last, R> : T_type> {}; +template using except_last_t = typename T_except_last, T...>::type; + struct _none { template operator T() const { return T(); } }; @@ -102,6 +123,7 @@ template struct range { constexpr range(_none) : range() {} constexpr range(T a, T b) : a(a), b(b) {} constexpr range(T a, size_t n) : a(a), b(a + n) {} + constexpr range(std::initializer_list list) : a(list.begin()), b(list.end()) {} template::value>* = nullptr> constexpr range(const range &b) : a(b.a), b(b.b) {} constexpr auto empty() const { return a == b; } constexpr auto size() const { return size_t(b - a); } @@ -111,6 +133,7 @@ template struct range { constexpr auto& back() const { return *(b - 1); } constexpr range slice(int i) const { return {a + i, b}; } constexpr range slice(int i, int j) const { return {a + i, min(a + i + j, b)}; } + constexpr auto at(size_t i) const { return a + i; } constexpr auto& item(int i) const { return *(a + i); } constexpr auto& operator[](int i) const { return *(a + i); } constexpr explicit operator bool() const { return !!a; } @@ -161,3 +184,10 @@ template struct dynamic_range : range { p -= size; } }; + +template struct save { + T &t, t0; + save(T &t, T t1) : t(t), t0(t) { t = t1;} + ~save() { t = t0; } +}; + diff --git a/reg/reg.exe b/reg/reg.exe index 0269b9d..f3884dc 100644 Binary files a/reg/reg.exe and b/reg/reg.exe differ