Compare commits
59
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
536182cf1f | ||
|
|
7a39edaf65 | ||
|
|
fd7b691885 | ||
|
|
42ddf188f3 | ||
|
|
3512cb370b | ||
|
|
aa0f613dfb | ||
|
|
b68d1e173e | ||
|
|
58e403d9e0 | ||
|
|
d46c0594b5 | ||
|
|
44f65f2e14 | ||
|
|
fca11d63c4 | ||
|
|
572f21a7e2 | ||
|
|
c2c84aaf7f | ||
|
|
0eae7fd7a3 | ||
|
|
ca777a2172 | ||
|
|
c57da0d645 | ||
|
|
dd2ca57532 | ||
|
|
f614c75ab6 | ||
|
|
be1bae2321 | ||
|
|
0af3069091 | ||
|
|
8e86dd333a | ||
|
|
31a53bd95f | ||
|
|
4d0490edf7 | ||
|
|
02dc3fecda | ||
|
|
84fd6a21eb | ||
|
|
b1c332ba34 | ||
|
|
1e8ea4a656 | ||
|
|
510094a71d | ||
|
|
6f9a8e10a8 | ||
|
|
4ab47bd2c9 | ||
|
|
1ccc670265 | ||
|
|
e4634395c3 | ||
|
|
3c012719c6 | ||
|
|
74f567db16 | ||
|
|
d444874f0d | ||
|
|
762de3ff28 | ||
|
|
24c4f7f8c3 | ||
|
|
0622ade175 | ||
|
|
ecd1b06bef | ||
|
|
dfec64f233 | ||
|
|
0bdd303978 | ||
|
|
6c21e5445b | ||
|
|
02201d3961 | ||
|
|
be11d40e4e | ||
|
|
5c8fdabe74 | ||
|
|
2f10eb8fd0 | ||
|
|
2847a96622 | ||
|
|
69282d25e0 | ||
|
|
9ea384fc23 | ||
|
|
ca13ab99c9 | ||
|
|
20e4dd1aa8 | ||
|
|
c9ca99423f | ||
|
|
476b5791cc | ||
|
|
62eb613f12 | ||
|
|
9232ed8ead | ||
|
|
bc721d3f5a | ||
|
|
5885388ae4 | ||
|
|
eb74a9a834 | ||
|
|
9e7b370aca |
+21
-3
@@ -3,23 +3,41 @@ language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
before_install:
|
||||
# Do not modify. Required for GUI based tests: See https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
|
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then
|
||||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
|
||||
sh -e /etc/init.d/xvfb start;
|
||||
sleep 3;
|
||||
fi
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'deb https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main'
|
||||
key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
|
||||
packages:
|
||||
- gdb
|
||||
- g++-4.9
|
||||
|
||||
|
||||
script:
|
||||
# Download debugAdapters from an existing extension version. See TravisCI settings to set CPPTOOL_VERSION
|
||||
- mkdir -p ~/.vscode/extensions/ms-vscode.cpptools-$CPPTOOL_VERSION
|
||||
- wget https://github.com/Microsoft/vscode-cpptools/releases/download/$CPPTOOL_VERSION/cpptools.vsix -O ~/cpptools.vsix
|
||||
- unzip ~/cpptools.vsix "extension/debugAdapters/*" -d ~/.
|
||||
- mv ~/extension/debugAdapters ~/.vscode/extensions/ms-vscode.cpptools-$CPPTOOL_VERSION/debugAdapters
|
||||
# Build and then run tests
|
||||
- cd Extension
|
||||
- npm install
|
||||
- npm run tslint
|
||||
- npm run pretest
|
||||
- npm run compile
|
||||
- npm run test
|
||||
|
||||
after_failure:
|
||||
- ./.travis/printLogs.sh
|
||||
- find ~ -name "integrationTests.log" -type f -exec cat {} \;
|
||||
|
||||
after_success:
|
||||
- ./.travis/printLogs.sh
|
||||
- find ~ -name "integrationTests.log" -type f -exec cat {} \;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
### Microsoft Open Source Code of Conduct
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
|
||||
@@ -0,0 +1,18 @@
|
||||
# How to Contribute Changes
|
||||
|
||||
## Contribution Steps:
|
||||
* [Build and debug the extension](Documentation/Getting%20started.md#build-and-debug-the-cpptools-extension).
|
||||
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
|
||||
* If the change affects functionality, add a line describing the change to [CHANGELOG.md](Extension/CHANGELOG.md).
|
||||
* Try and add a test in [test/extension.test.ts](Extension/test/unitTests/extension.test.ts).
|
||||
* Run tests via opening the [Extension](https://github.com/Microsoft/vscode-cpptools/tree/master/Extension) folder in Visual Studio Code, selecting the `Launch Tests` configuration in the Debug pane, and choosing `Start Debugging`.
|
||||
|
||||
## About the Code
|
||||
* Execution starts in the `activate` method in [main.ts](Extension/src/main.ts).
|
||||
* `processRuntimeDependencies` handles the downloading and installation of the OS-dependent files. Downloading code exists in [packageManager.ts](Extension/src/packageManager.ts).
|
||||
* `downloadCpptoolsJsonPkg` handles the `cpptools.json`, which can be used to enable changes to occur mid-update, such as turning the `intelliSenseEngine` to `"Default"` for a certain percentage of users.
|
||||
* The debugger code is in the [Debugger](https://github.com/Microsoft/vscode-cpptools/tree/master/Extension/src/Debugger) folder.
|
||||
* [LanguageServer/client.ts](Extension/src/LanguageServer/client.ts) handles various language server functionality.
|
||||
* [LanguageServer/configurations.ts](Extension/src/LanguageServer/configurations.ts) handles functionality related to `c_cpp_properties.json`.
|
||||
* [telemetry.ts](Extension/src/telemetry.ts): Telemetry data gets sent to either `logLanguageServerEvent` or `logDebuggerEvent`.
|
||||
* The Tag Parser (symbol database) doesn't automatically expand macros, so the [cpp.hint](Extension/cpp.hint) file contains definitions of macros that should be expanded in order for symbols to be parsed correctly.
|
||||
@@ -3,7 +3,7 @@
|
||||
These steps will allow you to debug the typescript code that is part of the Microsoft CppTools extension for Visual Studio Code.
|
||||
|
||||
Prerequisite steps:
|
||||
* Clone [this](https://github.com/Microsoft/msvscode-cpptools) repository.
|
||||
* Clone [this](https://github.com/Microsoft/vscode-cpptools) repository.
|
||||
* Install [npm](https://nodejs.org).
|
||||
* From a command line, run the following commands from the Extension folder in the root of the repository:
|
||||
* `npm install -g vsce`
|
||||
@@ -18,7 +18,7 @@ Prerequisite steps:
|
||||
|
||||
This page describes how to configure include paths for folders containing C or C++ files to get the full IntelliSense experience. If you're seeing the following message when opening a folder in VS Code, it means the C++ IntelliSense engine needs additional information about the paths in which your include files are located.
|
||||
|
||||

|
||||

|
||||
|
||||
## Where are the include paths defined?
|
||||
|
||||
@@ -26,34 +26,34 @@ The include paths are defined in the `"includePath"` setting in a file called **
|
||||
|
||||
You can create or open this file by either using the `"C/Cpp: Edit Configurations"` command in the command palette or by selecting `"Edit "includePath" setting"` in the lightbulb menu (see the screenshot below). The quickiest way to locate a lightbulb is to scroll to the top of the source file and click on any green squiggle that shows up under a #include statement.
|
||||
|
||||

|
||||

|
||||
|
||||
When a folder is opened, the extension attempts to locate your system headers based on your operating system, but it does not know about any other libraries that your project depends on. You can hover over the green squiggles or open the Problems window to understand which headers the IntelliSense engine is unable to open - sometimes it's the dependent headers that can't be located.
|
||||
|
||||

|
||||

|
||||
|
||||
## How to specify the include paths?
|
||||
|
||||
You can specify the remaining paths using one of the techniques described below.
|
||||
You can specify the remaining paths using one of the techniques described below.
|
||||
|
||||
#### 1. Use compile_commands.json file to supply includePaths and defines information
|
||||
|
||||
The extension can get the information for `"includePath"` and `"defines"` from a compile_commands.json file, which can be auto-generated by many build systems such as CMake and Ninja. Look for the section where your current configuration is defined (by default there's one configuration per OS, such as "Win32 or "Mac"), and set the `"compileCommands"` property in **c_cpp_properties.json** to the full path to your compile_commands.json file and the extension will use that instead of the `"includes"` and `"defines"` properties for IntelliSense.
|
||||
|
||||

|
||||

|
||||
|
||||
#### 2. Use the lightbulb suggestions to auto-resolve includePath
|
||||
|
||||
The first thing to try is to leverage the lightbulb path suggestions to auto-resolve the include paths. When you open a folder, the extension will **recursively** search for potential include paths that match the header files your code is using based on the paths set by the `"browse.path"` setting in **c_cpp_properties.json**. Click on the green squiggles under #include statements and you'll see a lightbulb offering suggestions of paths that will allow IntelliSense to resolve the included file.
|
||||
|
||||

|
||||

|
||||
|
||||
If you don't see path suggestions in the lightbulb, try adding the root folder where the headers are likely located in to the `"browse.path"` setting in **c_cpp_properties.json**. This allows the extension to **recursively** search in these folders and offer more suggestions in the lightbulb as the search process goes on.
|
||||
|
||||
#### 3. Manually add include paths
|
||||
If none of the above fully resolves the paths, you could manually specify the paths to the headers that your project depends on in the **c_cpp_properties.json** file. Look for the section where your current configuration is defined (by default there's one configuration per OS, such as "Win32 or "Mac"), and add your paths in the `"includePath"` setting and defines in the `"defines"` setting. For example, the following screenshot shows a snippet of the file specifying path for the Mac configuration.
|
||||
|
||||

|
||||

|
||||
|
||||
## Verify the include paths are correctly resolved
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# How to Contribute Changes
|
||||
|
||||
## Contribution Steps:
|
||||
* [Build and debug the extension](../Getting%20started.md#build-and-debug-the-cpptools-extension).
|
||||
* File an [issue](https://github.com/Microsoft/vscode-cpptools/issues) and a [pull request](https://github.com/Microsoft/vscode-cpptools/pulls) with the change and we will review it.
|
||||
* If the change affects functionality, add a line describing the change to [CHANGELOG.md](../../Extension/CHANGELOG.md).
|
||||
* Try and add a test in [test/extension.test.ts](../../Extension/test/extension.test.ts).
|
||||
* Run tests via opening the [Extension](https://github.com/Microsoft/vscode-cpptools/Extension) folder in Visual Studio Code, selecting the `Launch Tests` configuration in the Debug pane, and choosing `Start Debugging`.
|
||||
|
||||
## About the Code
|
||||
* Execution starts in the `activate` method in [main.ts](../../Extension/src/main.ts).
|
||||
* `processRuntimeDependencies` handles the downloading and installation of the OS-dependent files. Downloading code exists in [packageManager.ts](../../Extension/src/packageManager.ts).
|
||||
* `downloadCpptoolsJsonPkg` handles the `cpptools.json`, which can be used to enable changes to occur mid-update, such as turning the `intelliSenseEngine` to `"Default"` for a certain percentage of users.
|
||||
* The debugger code is in the [Debugger](https://github.com/Microsoft/vscode-cpptools/Extension/src/Debugger) folder.
|
||||
* [LanguageServer/client.ts](../../Extension/src/LanguageServer/client.ts) handles various language server functionality.
|
||||
* [LanguageServer/configurations.ts](../../Extension/src/LanguageServer/configurations.ts) handles functionality related to `c_cpp_properties.json`.
|
||||
* [telemetry.ts](../../Extension/src/telemetry.ts): Telemetry data gets sent to either `logLanguageServerEvent` or `logDebuggerEvent`.
|
||||
* The Tag Parser (symbol database) doesn't automatically expand macros, so the [cpp.hint](../../Extension/cpp.hint) file contains definitions of macros that should be expanded in order for symbols to be parsed correctly.
|
||||
@@ -14,4 +14,7 @@ bin/Microsoft.VSCode.CPP.*
|
||||
install.lock
|
||||
|
||||
# ignore generated packages
|
||||
*.vsix
|
||||
*.vsix
|
||||
|
||||
# ignore vscode test
|
||||
.vscode-test/
|
||||
Vendored
+19
-3
@@ -10,7 +10,7 @@
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outDir": "${workspaceRoot}/out/src",
|
||||
"outFiles": ["${workspaceRoot}/out/src"],
|
||||
"preLaunchTask": "npm"
|
||||
},
|
||||
{
|
||||
@@ -21,7 +21,7 @@
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outDir": "${workspaceRoot}/out/test",
|
||||
"outFiles": ["${workspaceRoot}/out/test"],
|
||||
"preLaunchTask": "npm"
|
||||
},
|
||||
{
|
||||
@@ -29,6 +29,22 @@
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 5858
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"${workspaceRoot}/test/integrationTests/testAssets/SimpleCppProject",
|
||||
"--extensionDevelopmentPath=${workspaceRoot}",
|
||||
"--extensionTestsPath=${workspaceRoot}/out/test/integrationTests"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/out/test/**/*.js"
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
+19
-8
@@ -1,17 +1,28 @@
|
||||
# C/C++ for Visual Studio Code Change Log
|
||||
|
||||
## Version 0.14.6: Janurary 16, 2017
|
||||
## Version 0.15.0-insiders: February 1, 2018
|
||||
* Add colorization for inactive regions. [#1466](https://github.com/Microsoft/vscode-cpptools/issues/1466)
|
||||
* Fix 3 highest hitting crashes. [#1137](https://github.com/Microsoft/vscode-cpptools/issues/1137), [#1337](https://github.com/Microsoft/vscode-cpptools/issues/1337)
|
||||
* Update IntelliSense compiler (bug fixes and more C++17 support). [#1067](https://github.com/Microsoft/vscode-cpptools/issues/1067), [#1313](https://github.com/Microsoft/vscode-cpptools/issues/1313), [#1461](https://github.com/Microsoft/vscode-cpptools/issues/1461)
|
||||
* Fix `Go to Symbol in File...` being slow for large workspaces. [#1472](https://github.com/Microsoft/vscode-cpptools/issues/1472)
|
||||
* Fix duplicate `cannot open source file` errors. [#1469](https://github.com/Microsoft/vscode-cpptools/issues/1469)
|
||||
* Fix error popup appearing with non-workspace files when using `compile_commands.json`. [#1475](https://github.com/Microsoft/vscode-cpptools/issues/1475)
|
||||
* Add more macros to `cpp.hint` (fixing missing symbols).
|
||||
|
||||
## Version 0.14.6: January 17, 2018
|
||||
* Fix tag parser failing (and continuing to fail after edits) when it shouldn't. [#1367](https://github.com/Microsoft/vscode-cpptools/issues/1367)
|
||||
* Fix tag parser taking too long due to redundant processing. [#1288](https://github.com/Microsoft/vscode-cpptools/issues/1288)
|
||||
* Fix debugging silently failing the 1st time if a C/C++ file isn't opened. [#1366](https://github.com/Microsoft/vscode-cpptools/issues/1366)
|
||||
* Skip automatically adding to `files.associations` if it matches an existing glob pattern or if `C_Cpp.files.associations.autoAdd` is `false`. [#722](https://github.com/Microsoft/vscode-cpptools/issues/722)
|
||||
* Fix extra reload message after installing with VS Code 1.19. [#1362](https://github.com/Microsoft/vscode-cpptools/issues/1362)
|
||||
* Skip automatically adding to `files.associations` if it matches an existing glob pattern or if `C_Cpp.autoAddFileAssociations` is `false`. [#722](https://github.com/Microsoft/vscode-cpptools/issues/722)
|
||||
* The debugger no longer requires an extra reload. [#1362](https://github.com/Microsoft/vscode-cpptools/issues/1362)
|
||||
* Fix incorrect "Warning: Expected file ... is missing" message after installing on Linux. [#1334](https://github.com/Microsoft/vscode-cpptools/issues/1334)
|
||||
* Fix "Include file not found" messages not re-appearing after settings changes. [#1363](https://github.com/Microsoft/vscode-cpptools/issues/1363)
|
||||
* Performance improvements with `browse.path` parsing, and stop showing "Parsing files" when there's no actual parsing. [#1393](https://github.com/Microsoft/vscode-cpptools/issues/1393)
|
||||
* Fix crash when settings with the wrong type are used. [#1396](https://github.com/Microsoft/vscode-cpptools/issues/1396)
|
||||
* Allow semicolons in `browse.path`. [#1415](https://github.com/Microsoft/vscode-cpptools/issues/1415)
|
||||
* Add `C_Cpp.workspaceParsingPriority` setting to avoid using 100% CPU during parsing of workspace files.
|
||||
* Fix to handle relative pathing in source file paths properly when normalizing. [#1228](https://github.com/Microsoft/vscode-cpptools/issues/1228)
|
||||
* Fix delay in language service activation caused by cpptools.json downloading. [#1429](https://github.com/Microsoft/vscode-cpptools/issues/1429)
|
||||
* Add `C_Cpp.workspaceParsingPriority` setting to enable using less than 100% CPU during parsing of workspace files.
|
||||
* Add `C_Cpp.exclusionPolicy` default to `checkFolders` to avoid expensive `files.exclude` checking on every file.
|
||||
|
||||
## Version 0.14.5: December 18, 2017
|
||||
@@ -50,7 +61,7 @@
|
||||
|
||||
## Version 0.14.1: November 9, 2017
|
||||
* Add support for multi-root workspaces. [#1070](https://github.com/Microsoft/vscode-cpptools/issues/1070)
|
||||
* Fix files temporarly being unsavable after Save As and other scenarios on Windows. [Microsoft/vscode#27329](https://github.com/Microsoft/vscode/issues/27329)
|
||||
* Fix files temporarily being unsavable after Save As and other scenarios on Windows. [Microsoft/vscode#27329](https://github.com/Microsoft/vscode/issues/27329)
|
||||
* Fix files "permanently" being unsavable if the IntelliSense process launches during tag parsing of the file. [#1040](https://github.com/Microsoft/vscode-cpptools/issues/1040)
|
||||
* Show pause and resume parsing commands after clicking the database icon. [#1141](https://github.com/Microsoft/vscode-cpptools/issues/1141)
|
||||
* Don't show the install output unless an error occurs. [#1160](https://github.com/Microsoft/vscode-cpptools/issues/1160)
|
||||
@@ -73,7 +84,7 @@
|
||||
* Fix `limitSymbolsToIncludedHeaders` not working with single files. [#1109](https://github.com/Microsoft/vscode-cpptools/issues/1109)
|
||||
* Add logging to Output window. Errors will be logged by default. Verbosity is controlled by the `"C_Cpp.loggingLevel"` setting.
|
||||
* Add new database status bar icon for "Indexing" or "Parsing" with progress numbers, and the previous flame icon is now just for "Updating IntelliSense".
|
||||
* Stop showing `(Global Scope)` if there's actually an error in identifiying the correct scope.
|
||||
* Stop showing `(Global Scope)` if there's actually an error in identifying the correct scope.
|
||||
* Fix crash with the IntelliSense process when parsing certain template code (the most frequently hit crash).
|
||||
* Fix main thread being blocked while searching for files to remove after changing `files.exclude`.
|
||||
* Fix incorrect code action include path suggestion when a folder comes after "..".
|
||||
@@ -264,7 +275,7 @@
|
||||
* Debugging for Visual C++ applications on Windows (Program Database files) is now available.
|
||||
* `clang-format` is now automatically installed as a part of the extension and formats code as you type.
|
||||
* `clang-format` options have been moved from c_cpp_properties.json file to settings.json (File->Preferences->User settings).
|
||||
* `clang-format` fall-back style is now set to 'Visual Studio'.
|
||||
* `clang-format` fallback style is now set to 'Visual Studio'.
|
||||
* Attach now requires a request type of `attach` instead of `launch`.
|
||||
* Support for additional console logging using the keyword `logging` inside `launch.json`.
|
||||
* Bug fixes.
|
||||
@@ -298,7 +309,7 @@
|
||||
* Support for debugging with GDB on Cygwin.
|
||||
* Debugging on 32-bit Linux now enabled.
|
||||
* Format code using clang-format.
|
||||
* Experimental fuzzy autocompletion.
|
||||
* Experimental fuzzy auto-completion.
|
||||
* Bug fixes.
|
||||
|
||||
## Version 0.5.0: April 14, 2016
|
||||
|
||||
@@ -205,8 +205,8 @@
|
||||
<tr>
|
||||
<td>
|
||||
<div>
|
||||
<h2 class="caption">December 2017 Update</h2>
|
||||
<div>Thank you for installing the C/C++ extension. In the December update, we added support for offline installation, 32-bit Linux, and Linux distros without glibc 2.18 (e.g. CentOS, RHEL, Scientific Linux).<br />
|
||||
<h2 class="caption">January 2018 Update</h2>
|
||||
<div>Thank you for installing the C/C++ extension. In the January update, we fixed a performance regression in the code browsing service (aka: Tag Parser). We also added the setting: <code>C_Cpp.workspaceParsingPriority</code> which allows you to control how aggressively the extension should index your workspace.<br />
|
||||
<br />
|
||||
Additional features and bug fixes are detailed in the <a href="https://github.com/Microsoft/vscode-cpptools/releases">full release notes</a>.</div>
|
||||
</div>
|
||||
@@ -231,9 +231,9 @@
|
||||
<td>
|
||||
<div>
|
||||
<h3 class="caption">Blog Posts</h3>
|
||||
<div><a href="https://blogs.msdn.microsoft.com/vcblog/2017/12/11/visual-studio-code-cc-extension-dec-2017-update-support-for-more-linux-distros/">December 2017 Update</a></div>
|
||||
<div><a href="https://blogs.msdn.microsoft.com/vcblog/2017/11/09/visual-studio-code-cc-extension-nov-2017-update-multi-root-workspaces-support-is-here/">November 2017 Update</a></div>
|
||||
<div><a href="https://blogs.msdn.microsoft.com/vcblog/2017/10/20/visual-studio-code-cc-extension-october-2017-update/">October 2017 Update</a></div>
|
||||
<div><a href="https://blogs.msdn.microsoft.com/vcblog/2017/10/04/visual-studio-code-cc-extension-september-2017-update-more-intellisense-goodness/">September 2017 Update</a></div>
|
||||
<div><a href="https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extension-for-visual-studio-code/">C/C++ Extension anouncement</a></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"defaults": [
|
||||
"--clang",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"--framework_include_directory=/System/Library/Frameworks"
|
||||
"8"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
"--rtti",
|
||||
"--edge",
|
||||
"--exceptions",
|
||||
"--error_limit",
|
||||
"25000",
|
||||
"-D_EDG_COMPILER",
|
||||
"-D_USE_DECLSPECS_FOR_SAL=1"
|
||||
],
|
||||
|
||||
+349
-3
@@ -561,12 +561,14 @@
|
||||
|
||||
// Miscellaneous
|
||||
#define __RPC_FAR
|
||||
#define CONST const
|
||||
#define CALLBACK
|
||||
#define EXPORT
|
||||
#define FAR
|
||||
#define far
|
||||
#define FASTCALL __fastcall
|
||||
#define NEAR
|
||||
#define near
|
||||
#define PASCAL
|
||||
#define SIZE_T_MAX UINT_MAX
|
||||
#define UNALIGNED
|
||||
@@ -674,6 +676,8 @@
|
||||
#define PURE = 0
|
||||
#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
|
||||
#define STDMETHOD_(type,method) virtual type STDMETHODCALLTYPE method
|
||||
#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE * method)
|
||||
#define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE * method)
|
||||
#define STDMETHODCALLTYPE __stdcall
|
||||
#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
|
||||
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
|
||||
@@ -693,11 +697,39 @@
|
||||
#define TEXT(name) name
|
||||
#define WINAPI __stdcall
|
||||
#define importlib(name)
|
||||
#define DECLSPEC_IMPORT
|
||||
#define DECLSPEC_NORETURN
|
||||
#define DECLSPEC_NOTHROW
|
||||
#define DECLSPEC_ALIGN(x)
|
||||
#define DECLSPEC_UUID(x)
|
||||
#define DECLSPEC_NOVTABLE
|
||||
#define DECLSPEC_SELECTANY
|
||||
#define DECLSPEC_ADDRSAFE
|
||||
#define DECLSPEC_CACHEALIGN
|
||||
#define DECLSPEC_SAFEBUFFERS
|
||||
#define DECLSPEC_NOINLINE
|
||||
#define DECLSPEC_GUARDNOCF
|
||||
#define DECLSPEC_GUARD_SUPPRESS
|
||||
#define DECLSPEC_CHPE_GUEST
|
||||
#define DECLSPEC_CHPE_PATCHABLE
|
||||
#define DECLSPEC_DEPRECATED
|
||||
#define DECLSPEC_DEPRECATED_DDK
|
||||
#define __allowed(p)
|
||||
#define __in_data_source(src_sym)
|
||||
#define __out_data_source(src_sym)
|
||||
#define __field_data_source(src_sym)
|
||||
#define __this_out_data_source(src_syn)
|
||||
#define _VARIANT_BOOL
|
||||
#define RPCNSAPI
|
||||
|
||||
// C++ Standard Library
|
||||
#define _STD_BEGIN namespace std {
|
||||
#define _STD_END } ;
|
||||
#define _STD std::
|
||||
#define _STD_BEGIN namespace std {
|
||||
#define _STD_END }
|
||||
#define _STD ::std::
|
||||
#define _STDEXT_BEGIN namespace stdext {
|
||||
#define _STDEXT_END }
|
||||
#define _STDEXT ::stdext::
|
||||
#define _CSTD ::
|
||||
#define _TRY_BEGIN try {
|
||||
#define _CATCH(x) } catch (x) {
|
||||
#define _CATCH_ALL } catch (...) {
|
||||
@@ -719,6 +751,51 @@
|
||||
#define _CATCH_IO_(x)
|
||||
#define _NOEXCEPT
|
||||
|
||||
#define _W64
|
||||
#define _ADVSIMD_ALIGN(x)
|
||||
#define IVEC_LOGICALS(vect,element)
|
||||
#define IVEC_ADD_SUB(vect,element,opsize)
|
||||
#define IVEC_SELECT(vect12,vect34,element,selop)
|
||||
#define IVEC128_LOGICALS(vect,element)
|
||||
#define IVEC128_ADD_SUB(vect,element,opsize)
|
||||
#define IVEC128_SELECT(vect12,vect34,element,selop)
|
||||
#define F64vec2_COMP(op)
|
||||
#define F64vec2_COMI(op)
|
||||
#define F64vec2_SELECT(op)
|
||||
#define F64vec2_UCOMI(op)
|
||||
#define Fvec32s4_SELECT(op)
|
||||
#define Fvec32s4_COMP(op)
|
||||
#define Fvec32s1_SELECT(op)
|
||||
#define Fvec32s1_COMP(op)
|
||||
#define _FS_DLL
|
||||
#define _CMPLX(T) complex<T >
|
||||
#define _CTR(T) _Ctraits<T >
|
||||
#define _TMPLT(T) template<class T >
|
||||
#define _OMPIMP
|
||||
#define _RTCINTERNAL_DEPRECATED
|
||||
#define _NON_MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT)
|
||||
#define _NON_MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT)
|
||||
#define _NON_MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT)
|
||||
#define _NON_MEMBER_CALL_CV_REF_NOEXCEPT(FUNC)
|
||||
#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS)
|
||||
#define _GENERIC_MATH1R(FUN, RET, CRTTYPE)
|
||||
#define _GENERIC_MATH1(FUN, CRTTYPE)
|
||||
#define _GENERIC_MATH1X(FUN, ARG2, CRTTYPE)
|
||||
#define _GENERIC_MATH2_CALL(FUN, CRTTYPE, CALL_OPT)
|
||||
#define _GENERIC_MATH2(FUN, CRTTYPE)
|
||||
#define _IMPLEMENT_INVOKE(NAME_PREFIX, CONSTEXPR)
|
||||
#define _GENERIC_MATHC0X(FUN, VAL)
|
||||
#define _GENERIC_MATHC1X(FUN, VAL)
|
||||
#define _MEMBER_CALL(FUNC, CV_OPT, REF_OPT, NOEXCEPT_OPT)
|
||||
#define _MEMBER_CALL_CV(FUNC, REF_OPT, NOEXCEPT_OPT)
|
||||
#define _MEMBER_CALL_CV_REF(FUNC, NOEXCEPT_OPT)
|
||||
#define _MEMBER_CALL_CV_REF_NOEXCEPT(FUNC)
|
||||
#define _CLASS_DEFINE_CONST(CLASS)
|
||||
#define _CLASS_DEFINE_CV(CLASS)
|
||||
#define _CLASS_DEFINE_CV_REF_NOEXCEPT(CLASS)
|
||||
#define _COLLECTION_ATTRIBUTES
|
||||
#define _COLLECTION_TRANSLATE } catch (const ::std::bad_alloc&) { throw ref new OutOfMemoryException; } catch (const ::std::exception&) { throw ref new FailureException; }
|
||||
|
||||
// CRT
|
||||
#define __CRTDECL
|
||||
#define __CLR_OR_THIS_CALL
|
||||
@@ -745,6 +822,62 @@
|
||||
#define _MRTIMP
|
||||
#define _SWPRINTFS_DEPRECATED
|
||||
|
||||
#define _ACRTIMP
|
||||
#define _ACRTIMP_ALT
|
||||
#define _CRTALLOCATOR
|
||||
#define _CRT_BEGIN_C_HEADER
|
||||
#define _CRT_END_C_HEADER
|
||||
#define _CRT_STDIO_INLINE
|
||||
#define _CRT_UNUSED(x)
|
||||
#define _DCRTIMP
|
||||
#define _NO_CRT_STDIO_INLINE
|
||||
#define _WCSTOK_DEPRECATED
|
||||
#define _CONCRTIMP
|
||||
#define _MRTIMP2
|
||||
#define _MRTIMP2_NPURE
|
||||
#define _MRTIMP2_PURE_NPURE
|
||||
#define _CRT_GUARDOVERFLOW
|
||||
#define _CRT_HYBRIDPATCHABLE
|
||||
#define _CRT_MANAGED_FP_DEPRECATE
|
||||
#define _BEGIN_PRAGMA_OPTIMIZE_ENABLE(flags, bug, reason)
|
||||
#define _BEGIN_PRAGMA_OPTIMIZE_DISABLE(flags, bug, reason)
|
||||
#define _END_PRAGMA_OPTIMIZE()
|
||||
#define _PGLOBAL
|
||||
#define RPCRTAPI
|
||||
|
||||
// yvals
|
||||
#define _INLINE_VAR
|
||||
#define _CONSTEXPR17
|
||||
#define _NOEXCEPT_COND(...)
|
||||
#define _NOEXCEPT_OPER(...)
|
||||
#define _EXTERN_C extern "C" {
|
||||
#define _END_EXTERN_C }
|
||||
#define _CRTIMP2_PURE_IMPORT
|
||||
#define _CRTDATA2_IMPORT
|
||||
#define _CRTIMP2_NCEEPURE_IMPORT
|
||||
#define _NODISCARD
|
||||
#define _DECLSPEC_ALLOCATOR
|
||||
#define _DEPRECATE_TR1_NAMESPACE
|
||||
#define _DEPRECATE_TR2_SYS_NAMESPACE
|
||||
#define _DEPRECATE_IDENTITY_STRUCT
|
||||
#define _CXX17_DEPRECATE_C_HEADER
|
||||
#define _CXX17_DEPRECATE_STRSTREAM
|
||||
#define _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION
|
||||
#define _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS
|
||||
#define _CXX17_DEPRECATE_NEGATORS
|
||||
#define _CXX17_DEPRECATE_ALLOCATOR_VOID
|
||||
#define _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS
|
||||
#define _CXX17_DEPRECATE_RAW_STORAGE_ITERATOR
|
||||
#define _CXX17_DEPRECATE_TEMPORARY_BUFFER
|
||||
#define _CXX17_DEPRECATE_IS_LITERAL_TYPE
|
||||
#define _CXX17_DEPRECATE_RESULT_OF
|
||||
#define _CXX17_DEPRECATE_ITERATOR_BASE_CLASS
|
||||
#define _CXX17_DEPRECATE_SHARED_PTR_UNIQUE
|
||||
#define _CXX17_DEPRECATE_CODECVT_HEADER
|
||||
#define _EXPERIMENTAL_PARALLEL_ALGORITHMS
|
||||
#define __PURE_APPDOMAIN_GLOBAL
|
||||
#define _SCL_INSECURE_DEPRECATE_FN(_Func)
|
||||
|
||||
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(_ReturnType, _FuncName, _DstType, _Dst) template <size_t _Size> _ReturnType _FuncName(_DstType (&_Dst)[_Size]);
|
||||
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1) template <size_t _Size> _ReturnType _FuncName(_DstType (&_Dst)[_Size], _TType1 _TArg1);
|
||||
#define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_2(_ReturnType, _FuncName, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2) template <size_t _Size> _ReturnType _FuncName(_DstType (&_Dst)[_Size], _TType1 _TArg1, _TType2 _TArg2);
|
||||
@@ -780,6 +913,57 @@
|
||||
#define __DECLARE_CPP_OVERLOAD_INLINE_NFUNC_0_3_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3) _ReturnType __CRTDECL _FuncName(_DstType *_Dst, _TType1 _TArg1, _TType2 _TArg2, _TType3 _TArg3)
|
||||
#define __DEFINE_CPP_OVERLOAD_INLINE_NFUNC_0_3_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3, _TType4, _TArg4)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_2_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _HType2, _HArg2, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST(_ReturnType, _ReturnPolicy, _DeclSpec, _CC, _FuncName, _VFuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST(_ReturnType, _ReturnPolicy, _DeclSpec, _CC, _FuncName, _VFuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_SIZE(_DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_SIZE(_DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_1(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_4(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3, _TType4, _TArg4)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_1_1(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_2_0(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _HType1, _HArg1, _HType2, _HArg2, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_1_ARGLIST(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _VFuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_SIZE(_DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_3_SIZE(_DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
|
||||
#define __DECLARE_CPP_OVERLOAD_INLINE_FUNC_0_0_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_INLINE_FUNC_0_0_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst)
|
||||
#define __DECLARE_CPP_OVERLOAD_INLINE_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_INLINE_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DECLARE_CPP_OVERLOAD_INLINE_FUNC_0_2_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_INLINE_FUNC_0_2_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DECLARE_CPP_OVERLOAD_INLINE_FUNC_0_3_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
#define __DEFINE_CPP_OVERLOAD_INLINE_FUNC_0_3_EX(_ReturnType, _ReturnPolicy, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_0_CGETS(_ReturnType, _DeclSpec, _FuncName, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_4_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3, _TType4, _TArg4)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_1_1_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _HType1, _HArg1, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_2_0_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _FuncName, _SecureFuncName, _HType1, _HArg1, _HType2, _HArg2, _SalAttributeDst, _DstType, _Dst)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_1_ARGLIST_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _CC, _FuncName, _SecureFuncName, _VFuncName, _SecureVFuncName, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_ARGLIST_EX(_ReturnType, _ReturnPolicy, _DeclSpec, _CC, _FuncName, _VFuncName, _SecureVFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_2_SIZE_EX(_DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2)
|
||||
#define __DEFINE_CPP_OVERLOAD_STANDARD_FUNC_0_3_SIZE_EX(_DeclSpec, _FuncName, _SecureFuncName, _SecureDstType, _SalAttributeDst, _DstType, _Dst, _TType1, _TArg1, _TType2, _TArg2, _TType3, _TArg3)
|
||||
|
||||
// VCRuntime
|
||||
#define _VCRTIMP
|
||||
#define _VCRT_ALLOCATOR
|
||||
#define _VCRT_ALIGN(x)
|
||||
#define _CRT_DEPRECATE_TEXT(_Text)
|
||||
|
||||
// Core Windows
|
||||
#define APIENTRY
|
||||
#define NTAPI
|
||||
@@ -816,6 +1000,37 @@
|
||||
#define __MACHINE(X) X;
|
||||
#define __MACHINEWVMPURE(X) X;
|
||||
#define _INTERLOCKEDCALL __cdecl
|
||||
#define __MACHINEX86 __MACHINE
|
||||
#define __MACHINEX86_X64 __MACHINE
|
||||
#define __MACHINEARM __MACHINE
|
||||
#define __MACHINEARM64 __MACHINE
|
||||
#define __MACHINEARM_ARM64 __MACHINE
|
||||
#define __MACHINEARM_ARM64_X64 __MACHINE
|
||||
#define __MACHINEARM64_X64 __MACHINE
|
||||
#define __MACHINECHPEX86ARM64 __MACHINE
|
||||
|
||||
#define CFORCEINLINE
|
||||
#define STKFORCEINLINE
|
||||
#define PFORCEINLINE
|
||||
#define WINCRYPT_DWORD_CPP_ONLY
|
||||
#define DECLARE_INTERFACE_IID(iface, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface
|
||||
#define DECLARE_INTERFACE_IID_(iface, baseiface, iid) interface DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE iface : public baseiface
|
||||
#define WINGDIAPI
|
||||
#define WINSPOOLAPI
|
||||
#define WINOLECTLAPI_
|
||||
#define WINOLECTLAPI_(type)
|
||||
#define WINNORMALIZEAPI
|
||||
#define PROPSHEETPAGEA_V1_FIELDS
|
||||
#define PROPSHEETHEADERA_V1_FIELDS
|
||||
#define PROPSHEETPAGEW_V1_FIELDS
|
||||
#define PROPSHEETHEADERW_V1_FIELDS
|
||||
#define __WRAPPED__
|
||||
#define DEPRECATED(x)
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE)
|
||||
#define _ENUM_FLAG_CONSTEXPR
|
||||
|
||||
// WinRT
|
||||
#define ROAPI
|
||||
|
||||
// OLE
|
||||
#define BEGIN_INTERFACE
|
||||
@@ -1843,6 +2058,137 @@
|
||||
#define _Check_return_opt_
|
||||
#define _Check_return_wat_
|
||||
|
||||
#define __ANNOTATION(fun)
|
||||
#define __inner_fallthrough
|
||||
#define __inner_fallthrough_dec
|
||||
#define __PRIMOP(type, fun)
|
||||
#define __QUALIFIER(fun)
|
||||
#define _In_function_class_(x)
|
||||
#define _Called_from_function_class_(x)
|
||||
#define _Function_class_(x)
|
||||
#define _Enum_is_bitflag_
|
||||
#define _Strict_type_match_
|
||||
#define _Maybe_raises_SEH_exception_
|
||||
#define _Raises_SEH_exception_
|
||||
#define __nothrow
|
||||
#define _Struct_size_bytes_(size)
|
||||
#define _SAL1_Source_(Name, args, annotes)
|
||||
#define _SAL1_1_Source_(Name, args, annotes)
|
||||
#define _SAL1_2_Source_(Name, args, annotes)
|
||||
#define _SAL2_Source_(Name, args, annotes)
|
||||
#define _SAL_L_Source_(Name, args, annotes)
|
||||
#define _SA_annotes0(n)
|
||||
#define _SA_annotes1(n,pp1)
|
||||
#define _SA_annotes2(n,pp1,pp2)
|
||||
#define _SA_annotes3(n,pp1,pp2,pp3)
|
||||
#define _Translates_Win32_to_HRESULT_(errorCode)
|
||||
#define __RETURN_POLICY_SAME(_FunctionCall)
|
||||
#define __RETURN_POLICY_DST(_FunctionCall)
|
||||
#define __RETURN_POLICY_VOID(_FunctionCall)
|
||||
#define __EMPTY_DECLSPEC
|
||||
#define __drv_allocatesMem(kind)
|
||||
#define __drv_freesMem(kind)
|
||||
#define __drv_preferredFunction(func,why)
|
||||
#define _Analysis_noreturn_
|
||||
#define _Guarded_by_(lock)
|
||||
#define _Write_guarded_by_(lock)
|
||||
#define _Interlocked_
|
||||
#define _Requires_lock_held_(lock)
|
||||
#define _Requires_exclusive_lock_held_(lock)
|
||||
#define _Requires_shared_lock_held_(lock)
|
||||
#define _Requires_lock_not_held_(lock)
|
||||
#define _Requires_no_locks_held_
|
||||
#define _Acquires_lock_(lock)
|
||||
#define _Acquires_exclusive_lock_(lock)
|
||||
#define _Acquires_shared_lock_(lock)
|
||||
#define _Releases_lock_(lock)
|
||||
#define _Releases_exclusive_lock_(lock)
|
||||
#define _Releases_shared_lock_(lock)
|
||||
#define _Acquires_nonreentrant_lock_(lock)
|
||||
#define _Releases_nonreentrant_lock_(lock)
|
||||
#define _Post_same_lock_(lock1,lock2)
|
||||
#define _Internal_set_lock_count_(lock, count)
|
||||
#define _Create_lock_level_(level)
|
||||
#define _Has_lock_level_(level)
|
||||
#define _Internal_lock_level_order_(a,b)
|
||||
#define _Csalcat1_(x,y)
|
||||
#define _Csalcat2_(x,y)
|
||||
#define _Lock_level_order_(a,b)
|
||||
#define _No_competing_thread_
|
||||
#define _Analysis_assume_lock_acquired_(lock)
|
||||
#define _Analysis_assume_lock_released_(lock)
|
||||
#define _Analysis_assume_lock_held_(lock)
|
||||
#define _Analysis_assume_lock_not_held_(lock)
|
||||
#define _Analysis_assume_same_lock_(lock1, lock2)
|
||||
#define _Function_ignore_lock_checking_(lock)
|
||||
#define _Analysis_suppress_lock_checking_(lock)
|
||||
#define _Benign_race_begin_ __pragma(warning(push))
|
||||
#define _Benign_race_end_ __pragma(warning(pop))
|
||||
#define _No_competing_thread_begin_
|
||||
#define _No_competing_thread_end_
|
||||
#define _Has_lock_kind_(kind)
|
||||
#define _Analysis_assume_
|
||||
#define _Analysis_assume_nullterminated_(s)
|
||||
#define _Analysis_mode_(m)
|
||||
#define _Function_class_(n)
|
||||
#define _Interlocked_operand_
|
||||
#define _IRQL_raises_(i)
|
||||
#define _IRQL_requires_(i)
|
||||
#define _IRQL_requires_max_(i)
|
||||
#define _IRQL_requires_min_(i)
|
||||
#define _IRQL_saves_
|
||||
#define _IRQL_saves_global_(k,s)
|
||||
#define _IRQL_restores_
|
||||
#define _IRQL_restores_global_(k,s)
|
||||
#define _IRQL_always_function_min_(i)
|
||||
#define _IRQL_always_function_max_(i)
|
||||
#define _IRQL_requires_same_
|
||||
#define _IRQL_uses_cancel_
|
||||
#define _IRQL_is_cancel_
|
||||
#define _Kernel_float_saved_
|
||||
#define _Kernel_float_restored_
|
||||
#define _Kernel_float_used_
|
||||
#define _Kernel_acquires_resource_(k)
|
||||
#define _Kernel_releases_resource_(k)
|
||||
#define _Kernel_requires_resource_held_(k)
|
||||
#define _Kernel_requires_resource_not_held_(k)
|
||||
#define _Kernel_clear_do_init_(yn)
|
||||
#define _Kernel_IoGetDmaAdapter_
|
||||
#define _Outref_result_buffer_(s)
|
||||
#define _Outref_result_bytebuffer_(s)
|
||||
#define _Outref_result_buffer_to_(s,c)
|
||||
#define _Outref_result_bytebuffer_to_(s,c)
|
||||
#define _Outref_result_buffer_all_(s)
|
||||
#define _Outref_result_bytebuffer_all_(s)
|
||||
#define _Outref_result_buffer_maybenull_(s)
|
||||
#define _Outref_result_bytebuffer_maybenull_(s)
|
||||
#define _Outref_result_buffer_to_maybenull_(s,c)
|
||||
#define _Outref_result_bytebuffer_to_maybenull_(s,c)
|
||||
#define _Outref_result_buffer_all_maybenull_(s)
|
||||
#define _Outref_result_bytebuffer_all_maybenull_(s)
|
||||
#define _In_defensive_(a)
|
||||
#define _Out_defensive_(a)
|
||||
#define _Inout_defensive_(a)
|
||||
#define _Acquires_nonreentrant_lock_(e)
|
||||
#define _Releases_nonreentrant_lock_(e)
|
||||
#define _Function_ignore_lock_checking_(e)
|
||||
#define _Analysis_suppress_lock_checking_(e)
|
||||
#define _Pre_readable_size_(s)
|
||||
#define _Pre_writable_size_(s)
|
||||
#define _Pre_readable_byte_size_(s)
|
||||
#define _Pre_writable_byte_size_(s)
|
||||
#define _Post_readable_size_(s)
|
||||
#define _Post_writable_size_(s)
|
||||
#define _Post_readable_byte_size_(s)
|
||||
#define _Post_writable_byte_size_(s)
|
||||
#define _Internal_create_CSAL_identifier_(id)
|
||||
#define _Reallocation_function_(after, before, size)
|
||||
#define _Ret_reallocated_bytes_(before, size)
|
||||
|
||||
// Code Analysis
|
||||
#define SA( id ) id
|
||||
#define REPEATABLE [repeatable]
|
||||
|
||||
// BOOST
|
||||
#define BOOST_TRY { try
|
||||
#define BOOST_CATCH(x) catch(x)
|
||||
|
||||
+31
-1
@@ -6,15 +6,45 @@
|
||||
'use strict';
|
||||
|
||||
const gulp = require('gulp');
|
||||
const env = require('gulp-env')
|
||||
const tslint = require('gulp-tslint');
|
||||
const mocha = require('gulp-mocha');
|
||||
|
||||
gulp.task('unitTest', () => {
|
||||
gulp.task('allTests', () => {
|
||||
gulp.start('unitTests');
|
||||
gulp.start('integrationTests');
|
||||
});
|
||||
|
||||
gulp.task('unitTests', () => {
|
||||
gulp.src('./out/test/unitTests', {read: false}).pipe(
|
||||
mocha({
|
||||
ui: "tdd"
|
||||
})
|
||||
).once('error', err => {
|
||||
process.exit(1);
|
||||
})
|
||||
.once('end', () => {
|
||||
process.exit();
|
||||
})
|
||||
});
|
||||
|
||||
gulp.task('integrationTests', () => {
|
||||
env.set({
|
||||
CODE_TESTS_PATH: "./out/test/integrationTests",
|
||||
CODE_TESTS_WORKSPACE: "./test/integrationTests/testAssets/SimpleCppProject"
|
||||
}
|
||||
);
|
||||
gulp.src('./test/runVsCodeTestsWithAbsolutePaths.js', {read: false}).pipe(
|
||||
mocha({
|
||||
ui: "tdd",
|
||||
delay: true
|
||||
})
|
||||
).once('error', err => {
|
||||
process.exit(1);
|
||||
})
|
||||
.once('end', () => {
|
||||
process.exit();
|
||||
})
|
||||
});
|
||||
|
||||
/// Misc Tasks
|
||||
|
||||
Generated
+42
-16
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cpptools",
|
||||
"version": "0.14.6",
|
||||
"version": "0.15.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -85,9 +85,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"applicationinsights": {
|
||||
"version": "0.18.0",
|
||||
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz",
|
||||
"integrity": "sha1-Fi67SKODQIvE3kTbMrQXMH9Fu8E="
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.0.1.tgz",
|
||||
"integrity": "sha1-U0Rrgw/o1dYZ7uKieLMdPSUDCSc=",
|
||||
"requires": {
|
||||
"diagnostic-channel": "0.2.0",
|
||||
"diagnostic-channel-publishers": "0.2.1",
|
||||
"zone.js": "0.7.6"
|
||||
}
|
||||
},
|
||||
"archy": {
|
||||
"version": "1.0.0",
|
||||
@@ -719,6 +724,19 @@
|
||||
"integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
|
||||
"dev": true
|
||||
},
|
||||
"diagnostic-channel": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz",
|
||||
"integrity": "sha1-zJmvlhLCP7H/8TYSxy8sv6qNWhc=",
|
||||
"requires": {
|
||||
"semver": "5.4.1"
|
||||
}
|
||||
},
|
||||
"diagnostic-channel-publishers": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz",
|
||||
"integrity": "sha1-ji1geottef6IC1SLxYzGvrKIxPM="
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz",
|
||||
@@ -1751,6 +1769,16 @@
|
||||
"through2": "2.0.3"
|
||||
}
|
||||
},
|
||||
"gulp-env": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/gulp-env/-/gulp-env-0.4.0.tgz",
|
||||
"integrity": "sha1-g3BkaUmjJJPcBtrZSgZDKW+q2+g=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ini": "1.3.5",
|
||||
"through2": "2.0.3"
|
||||
}
|
||||
},
|
||||
"gulp-filter": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz",
|
||||
@@ -3944,8 +3972,7 @@
|
||||
"semver": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
|
||||
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="
|
||||
},
|
||||
"sequencify": {
|
||||
"version": "0.0.7",
|
||||
@@ -5108,12 +5135,11 @@
|
||||
"integrity": "sha1-28EOjX2VsQJyehmvPw/O9+JSsI4="
|
||||
},
|
||||
"vscode-extension-telemetry": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.10.tgz",
|
||||
"integrity": "sha512-5yiT9MAsdipdTV+xUK485PKluNL40jqhTy94TGDweTO/ecPS/qy4qSaJGI9gaKBwpOr5oP6jiI8Bm3yIOjB/2w==",
|
||||
"version": "0.0.11",
|
||||
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz",
|
||||
"integrity": "sha512-P1ALLofywtfpQy9TB5Sx2edp80fHXby+CGG5pq8P1vPL2zKIUjYy3eK8mFHCOGeljTf2PTTmXJ98DeBV0kCafQ==",
|
||||
"requires": {
|
||||
"applicationinsights": "0.18.0",
|
||||
"winreg": "1.2.3"
|
||||
"applicationinsights": "1.0.1"
|
||||
}
|
||||
},
|
||||
"vscode-jsonrpc": {
|
||||
@@ -5152,11 +5178,6 @@
|
||||
"isexe": "2.0.0"
|
||||
}
|
||||
},
|
||||
"winreg": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz",
|
||||
"integrity": "sha1-k60RayaW2ofVj3JlqPzqUlSpZdU="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
@@ -5192,6 +5213,11 @@
|
||||
"requires": {
|
||||
"buffer-crc32": "0.2.13"
|
||||
}
|
||||
},
|
||||
"zone.js": {
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.7.6.tgz",
|
||||
"integrity": "sha1-+7w50+AmHQmG8boGMG6zrrDSIAk="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-12
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "0.14.6",
|
||||
"version": "0.15.0-insiders",
|
||||
"publisher": "ms-vscode",
|
||||
"preview": true,
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
@@ -48,7 +48,7 @@
|
||||
"owner": "cpptools",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceRoot}"
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
@@ -167,7 +167,7 @@
|
||||
"description": "The verbosity of logging in the Output Panel. The order of levels from least verbose to most verbose is: None < Error < Warning < Information.",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.files.associations.autoAdd": {
|
||||
"C_Cpp.autoAddFileAssociations": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Controls whether files are automatically added to files.associations when they are the target of a navigation operation from a C/C++ file.",
|
||||
@@ -178,11 +178,11 @@
|
||||
"enum": [
|
||||
"highest",
|
||||
"high",
|
||||
"normal",
|
||||
"medium",
|
||||
"low"
|
||||
],
|
||||
"default": "normal",
|
||||
"description": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values highest/high/normal/low correspond to approximately 100/75/50/25% CPU usage.",
|
||||
"default": "highest",
|
||||
"description": "Controls whether parsing of the non-active workspace files uses sleeps to avoid using 100% CPU. The values highest/high/medium/low correspond to approximately 100/75/50/25% CPU usage.",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.exclusionPolicy": {
|
||||
@@ -1041,16 +1041,19 @@
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "npm run vscode:prepublish && tsc -p ./",
|
||||
"integrationTests": "gulp integrationTests",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"pretest": "tsc -p ./",
|
||||
"test": "gulp unitTest",
|
||||
"test": "gulp allTests",
|
||||
"tslint": "gulp tslint",
|
||||
"unitTests": "gulp unitTests",
|
||||
"vscode:prepublish": "npm install && tsc -p ./ && node ./out/src/Debugger/copyScript.js",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^2.2.43",
|
||||
"@types/node": "^8.0.46",
|
||||
"gulp-env": "0.4.0",
|
||||
"gulp-mocha": "5.0.0",
|
||||
"gulp-tslint": "8.1.2",
|
||||
"gulp": "3.9.1",
|
||||
@@ -1070,14 +1073,14 @@
|
||||
"tmp": "~0.0.33",
|
||||
"vscode-debugadapter": "~1.24.0",
|
||||
"vscode-debugprotocol": "~1.24.0",
|
||||
"vscode-extension-telemetry": "~0.0.10",
|
||||
"vscode-extension-telemetry": "~0.0.11",
|
||||
"vscode-languageclient": "~3.4.5",
|
||||
"yauzl": "~2.8.0"
|
||||
},
|
||||
"runtimeDependencies": [
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86_64)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=865475",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=866913",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1091,7 +1094,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=865476",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=866914",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1107,7 +1110,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (OS X)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=865477",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=866915",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
],
|
||||
@@ -1118,7 +1121,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Windows)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=865478",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=866916",
|
||||
"platforms": [
|
||||
"win32"
|
||||
],
|
||||
|
||||
@@ -20,23 +20,25 @@ export class AttachPicker {
|
||||
constructor(private attachItemsProvider: AttachItemsProvider) { }
|
||||
|
||||
public ShowAttachEntries(): Promise<string> {
|
||||
if (util.getShowReloadPrompt()) {
|
||||
util.showReloadOrWaitPrompt();
|
||||
} else {
|
||||
return this.attachItemsProvider.getAttachItems()
|
||||
.then(processEntries => {
|
||||
let attachPickOptions: vscode.QuickPickOptions = {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: "Select the process to attach to"
|
||||
};
|
||||
return util.isExtensionReady().then(ready => {
|
||||
if (!ready) {
|
||||
util.displayExtensionNotReadyPrompt();
|
||||
} else {
|
||||
return this.attachItemsProvider.getAttachItems()
|
||||
.then(processEntries => {
|
||||
let attachPickOptions: vscode.QuickPickOptions = {
|
||||
matchOnDescription: true,
|
||||
matchOnDetail: true,
|
||||
placeHolder: "Select the process to attach to"
|
||||
};
|
||||
|
||||
return vscode.window.showQuickPick(processEntries, attachPickOptions)
|
||||
.then(chosenProcess => {
|
||||
return chosenProcess ? chosenProcess.id : Promise.reject<string>(new Error("Process not selected."));
|
||||
});
|
||||
});
|
||||
}
|
||||
return vscode.window.showQuickPick(processEntries, attachPickOptions)
|
||||
.then(chosenProcess => {
|
||||
return chosenProcess ? chosenProcess.id : Promise.reject<string>(new Error("Process not selected."));
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,38 +50,40 @@ export class RemoteAttachPicker {
|
||||
private _channel: vscode.OutputChannel = null;
|
||||
|
||||
public ShowAttachEntries(args: any): Promise<string> {
|
||||
if (util.getShowReloadPrompt()) {
|
||||
util.showReloadOrWaitPrompt();
|
||||
} else {
|
||||
this._channel.clear();
|
||||
return util.isExtensionReady().then(ready => {
|
||||
if (!ready) {
|
||||
util.displayExtensionNotReadyPrompt();
|
||||
} else {
|
||||
this._channel.clear();
|
||||
|
||||
let pipeTransport: any = args ? args.pipeTransport : null;
|
||||
let pipeTransport: any = args ? args.pipeTransport : null;
|
||||
|
||||
if (pipeTransport === null) {
|
||||
return Promise.reject<string>(new Error("Chosen debug configuration does not contain pipeTransport"));
|
||||
if (pipeTransport === null) {
|
||||
return Promise.reject<string>(new Error("Chosen debug configuration does not contain pipeTransport"));
|
||||
}
|
||||
|
||||
let pipeProgram: string = pipeTransport.pipeProgram;
|
||||
let pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
|
||||
let argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
|
||||
let pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
|
||||
return this.getRemoteOSAndProcesses(pipeCmd)
|
||||
.then(processes => {
|
||||
let attachPickOptions: vscode.QuickPickOptions = {
|
||||
matchOnDetail: true,
|
||||
matchOnDescription: true,
|
||||
placeHolder: "Select the process to attach to"
|
||||
};
|
||||
|
||||
return vscode.window.showQuickPick(processes, attachPickOptions)
|
||||
.then(item => {
|
||||
return item ? item.id : Promise.reject<string>(new Error("Process not selected."));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
let pipeProgram: string = pipeTransport.pipeProgram;
|
||||
let pipeArgs: string[] = pipeTransport.pipeArgs;
|
||||
|
||||
let argList: string = RemoteAttachPicker.createArgumentList(pipeArgs);
|
||||
|
||||
let pipeCmd: string = `"${pipeProgram}" ${argList}`;
|
||||
|
||||
return this.getRemoteOSAndProcesses(pipeCmd)
|
||||
.then(processes => {
|
||||
let attachPickOptions: vscode.QuickPickOptions = {
|
||||
matchOnDetail: true,
|
||||
matchOnDescription: true,
|
||||
placeHolder: "Select the process to attach to"
|
||||
};
|
||||
|
||||
return vscode.window.showQuickPick(processes, attachPickOptions)
|
||||
.then(item => {
|
||||
return item ? item.id : Promise.reject<string>(new Error("Process not selected."));
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getRemoteOSAndProcesses(pipeCmd: string): Promise<AttachItem[]> {
|
||||
@@ -92,34 +96,34 @@ export class RemoteAttachPicker {
|
||||
// Processess will follow if listed
|
||||
let lines: string[] = output.split(/\r?\n/);
|
||||
|
||||
if (lines.length == 0) {
|
||||
if (lines.length === 0) {
|
||||
return Promise.reject<AttachItem[]>(new Error("Pipe transport failed to get OS and processes."));
|
||||
} else {
|
||||
let remoteOS: string = lines[0].replace(/[\r\n]+/g, '');
|
||||
|
||||
if (remoteOS != "Linux" && remoteOS != "Darwin") {
|
||||
if (remoteOS !== "Linux" && remoteOS !== "Darwin") {
|
||||
return Promise.reject<AttachItem[]>(new Error(`Operating system "${remoteOS}" not supported.`));
|
||||
}
|
||||
|
||||
// Only got OS from uname
|
||||
if (lines.length == 1) {
|
||||
if (lines.length === 1) {
|
||||
return Promise.reject<AttachItem[]>(new Error("Transport attach could not obtain processes list."));
|
||||
} else {
|
||||
let processes: string[] = lines.slice(1);
|
||||
return PsProcessParser.ParseProcessFromPsArray(processes)
|
||||
.sort((a, b) => {
|
||||
if (a.name == undefined) {
|
||||
if (b.name == undefined) {
|
||||
if (a.name === undefined) {
|
||||
if (b.name === undefined) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (b.name == undefined) {
|
||||
if (b.name === undefined) {
|
||||
return -1;
|
||||
}
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let bLower: string = b.name.toLowerCase();
|
||||
if (aLower == bLower) {
|
||||
if (aLower === bLower) {
|
||||
return 0;
|
||||
}
|
||||
return aLower < bLower ? -1 : 1;
|
||||
|
||||
@@ -81,7 +81,7 @@ abstract class DefaultConfigurationProvider implements IConfigurationAssetProvid
|
||||
configurationSnippet.push(configuration.GetLaunchConfiguration());
|
||||
});
|
||||
|
||||
let initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType == debuggerType && snippet.isInitialConfiguration)
|
||||
let initialConfigurations: any = configurationSnippet.filter(snippet => snippet.debuggerType === debuggerType && snippet.isInitialConfiguration)
|
||||
.map(snippet => JSON.parse(snippet.bodyText));
|
||||
|
||||
// If configurations is empty, then it will only have an empty configurations array in launch.json. Users can still add snippets.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* This file is used for packaging the application and should not be referenced
|
||||
@@ -62,7 +63,7 @@ function findCppToolsExtensionDebugAdapterFolder(): string {
|
||||
}
|
||||
}
|
||||
|
||||
if (dirPath == os.homedir()) {
|
||||
if (dirPath === os.homedir()) {
|
||||
console.error("Could not find installed C/C++ extension.");
|
||||
return null;
|
||||
}
|
||||
@@ -80,7 +81,7 @@ function enableDevWorkflow(): Boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (EnableDevWorkflow || (process.env.CPPTOOLS_DEV != null));
|
||||
return (EnableDevWorkflow || (process.env.CPPTOOLS_DEV !== null));
|
||||
}
|
||||
|
||||
function copySourceDependencies(): void {
|
||||
|
||||
@@ -40,9 +40,6 @@ export function initialize(): void {
|
||||
// ConfigurationSnippetProvider needs to be initiallized after configurationProvider calls getConfigurationSnippets.
|
||||
disposables.push(vscode.languages.registerCompletionItemProvider(launchJsonDocumentSelector, new ConfigurationSnippetProvider(configurationProvider)));
|
||||
|
||||
disposables.push(vscode.window.onDidChangeActiveTextEditor(onDidChangeActiveTextEditor));
|
||||
onDidChangeActiveTextEditor(vscode.window.activeTextEditor);
|
||||
|
||||
// Activate Adapter Commands
|
||||
registerAdapterExecutableCommands();
|
||||
|
||||
@@ -53,18 +50,12 @@ export function dispose(): void {
|
||||
disposables.forEach(d => d.dispose());
|
||||
}
|
||||
|
||||
function onDidChangeActiveTextEditor(editor: vscode.TextEditor): void {
|
||||
if (util.getShowReloadPromptOnce() && editor && editor.document.fileName.endsWith(path.sep + "launch.json")) {
|
||||
util.showReloadOrWaitPromptOnce();
|
||||
}
|
||||
}
|
||||
|
||||
// Registers adapterExecutableCommands for cppdbg and cppvsdbg. If it is not ready, it will prompt waiting for the download.
|
||||
//
|
||||
// Note: util.extensionContext.extensionPath is needed for the commands because VsCode does not support relative paths for adapterExecutableComand
|
||||
function registerAdapterExecutableCommands(): void {
|
||||
disposables.push(vscode.commands.registerCommand('extension.cppdbgAdapterExecutableCommand', () => {
|
||||
return util.checkInstallLockFile().then(ready => {
|
||||
return util.isExtensionReady().then(ready => {
|
||||
if (ready) {
|
||||
let command: string = path.join(util.extensionContext.extensionPath, './debugAdapters/OpenDebugAD7');
|
||||
|
||||
@@ -77,28 +68,24 @@ function registerAdapterExecutableCommands(): void {
|
||||
command: command
|
||||
};
|
||||
} else {
|
||||
util.showReloadOrWaitPromptOnce();
|
||||
// TODO: VsCode displays null return as "Cannot find executable 'null'". Fix if they have a way to not display their prompt.
|
||||
return null;
|
||||
throw new Error(util.extensionNotReadyString);
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
disposables.push(vscode.commands.registerCommand('extension.cppvsdbgAdapterExecutableCommand', () => {
|
||||
if (os.platform() != 'win32') {
|
||||
if (os.platform() !== 'win32') {
|
||||
vscode.window.showErrorMessage("Debugger type 'cppvsdbg' is not avaliable for non-Windows machines.");
|
||||
return null;
|
||||
} else {
|
||||
return util.checkInstallLockFile().then(ready => {
|
||||
return util.isExtensionReady().then(ready => {
|
||||
if (ready) {
|
||||
return {
|
||||
command: path.join(util.extensionContext.extensionPath, './debugAdapters/vsdbg/bin/vsdbg.exe'),
|
||||
args: ['--interpreter=vscode']
|
||||
};
|
||||
} else {
|
||||
util.showReloadOrWaitPromptOnce();
|
||||
// TODO: VsCode displays null return as "Cannot find executable 'null'". Fix if they have a way to not display their prompt.
|
||||
return null;
|
||||
throw new Error(util.extensionNotReadyString);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@ abstract class NativeAttachItemsProvider implements AttachItemsProvider {
|
||||
// localeCompare is significantly slower than < and > (2000 ms vs 80 ms for 10,000 elements)
|
||||
// We can change to localeCompare if this becomes an issue
|
||||
processEntries.sort((a, b) => {
|
||||
if (a.name == undefined) {
|
||||
if (b.name == undefined) {
|
||||
if (a.name === undefined) {
|
||||
if (b.name === undefined) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (b.name == undefined) {
|
||||
if (b.name === undefined) {
|
||||
return -1;
|
||||
}
|
||||
let aLower: string = a.name.toLowerCase();
|
||||
let bLower: string = b.name.toLowerCase();
|
||||
if (aLower == bLower) {
|
||||
if (aLower === bLower) {
|
||||
return 0;
|
||||
}
|
||||
return aLower < bLower ? -1 : 1;
|
||||
|
||||
@@ -20,6 +20,7 @@ import { ClientCollection } from './clientCollection';
|
||||
import { createProtocolFilter } from './protocolFilter';
|
||||
import { DataBinding } from './dataBinding';
|
||||
import minimatch = require("minimatch");
|
||||
import * as logger from '../logger';
|
||||
|
||||
let ui: UI;
|
||||
|
||||
@@ -68,6 +69,21 @@ interface OutputNotificationBody {
|
||||
output: string;
|
||||
}
|
||||
|
||||
interface InactiveRegionParams {
|
||||
uri: string;
|
||||
regions: InputRegion[];
|
||||
}
|
||||
|
||||
interface InputRegion {
|
||||
startLine: number;
|
||||
endLine: number;
|
||||
}
|
||||
|
||||
interface DecorationRangesPair {
|
||||
decoration: vscode.TextEditorDecorationType;
|
||||
ranges: vscode.Range[];
|
||||
}
|
||||
|
||||
// Requests
|
||||
const NavigationListRequest: RequestType<TextDocumentIdentifier, string, void, void> = new RequestType<TextDocumentIdentifier, string, void, void>('cpptools/requestNavigationList');
|
||||
const GoToDeclarationRequest: RequestType<void, void, void, void> = new RequestType<void, void, void, void>('cpptools/goToDeclaration');
|
||||
@@ -96,6 +112,7 @@ const ReportTagParseStatusNotification: NotificationType<ReportStatusNotificatio
|
||||
const ReportStatusNotification: NotificationType<ReportStatusNotificationBody, void> = new NotificationType<ReportStatusNotificationBody, void>('cpptools/reportStatus');
|
||||
const DebugProtocolNotification: NotificationType<OutputNotificationBody, void> = new NotificationType<OutputNotificationBody, void>('cpptools/debugProtocol');
|
||||
const DebugLogNotification: NotificationType<OutputNotificationBody, void> = new NotificationType<OutputNotificationBody, void>('cpptools/debugLog');
|
||||
const InactiveRegionNotification: NotificationType<InactiveRegionParams, void> = new NotificationType<InactiveRegionParams, void>('cpptools/inactiveRegions');
|
||||
|
||||
const maxSettingLengthForTelemetry: number = 50;
|
||||
let previousCppSettings: { [key: string]: any } = {};
|
||||
@@ -103,7 +120,7 @@ let previousCppSettings: { [key: string]: any } = {};
|
||||
/**
|
||||
* track settings changes for telemetry
|
||||
*/
|
||||
function collectSettings(filter: (key: string, val: string, settings: vscode.WorkspaceConfiguration) => boolean, resource: vscode.Uri): { [key: string]: string } {
|
||||
function collectSettingsForTelemetry(filter: (key: string, val: string, settings: vscode.WorkspaceConfiguration) => boolean, resource: vscode.Uri): { [key: string]: string } {
|
||||
let settings: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("C_Cpp", resource);
|
||||
let result: { [key: string]: string } = {};
|
||||
|
||||
@@ -115,9 +132,54 @@ function collectSettings(filter: (key: string, val: string, settings: vscode.Wor
|
||||
if (val instanceof Object) {
|
||||
continue; // ignore settings that are objects since tostring on those is not useful (e.g. navigation.length)
|
||||
}
|
||||
|
||||
// Skip values that don't match the setting's enum.
|
||||
let curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
|
||||
if (curSetting) {
|
||||
let curEnum: any[] = curSetting["enum"];
|
||||
if (curEnum && curEnum.indexOf(val) === -1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (filter(key, val, settings)) {
|
||||
previousCppSettings[key] = val;
|
||||
result[key] = (key == "clang_format_path") ? "..." : String(previousCppSettings[key]);
|
||||
switch (String(key).toLowerCase()) {
|
||||
case "clang_format_path": {
|
||||
continue;
|
||||
}
|
||||
case "clang_format_style":
|
||||
case "clang_format_fallbackstyle": {
|
||||
let newKey: string = String(key) + "2";
|
||||
if (val) {
|
||||
switch (String(val).toLowerCase()) {
|
||||
case "visual studio":
|
||||
case "llvm":
|
||||
case "google":
|
||||
case "chromium":
|
||||
case "mozilla":
|
||||
case "webkit":
|
||||
case "file":
|
||||
case "none": {
|
||||
result[newKey] = String(previousCppSettings[key]);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
result[newKey] = "...";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result[newKey] = "null";
|
||||
}
|
||||
key = newKey;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
result[key] = String(previousCppSettings[key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (result[key].length > maxSettingLengthForTelemetry) {
|
||||
result[key] = result[key].substr(0, maxSettingLengthForTelemetry) + "...";
|
||||
}
|
||||
@@ -128,7 +190,7 @@ function collectSettings(filter: (key: string, val: string, settings: vscode.Wor
|
||||
}
|
||||
|
||||
function initializeSettingsCache(resource: vscode.Uri): void {
|
||||
collectSettings(() => true, resource);
|
||||
collectSettingsForTelemetry(() => true, resource);
|
||||
}
|
||||
|
||||
function getNonDefaultSettings(resource: vscode.Uri): { [key: string]: string } {
|
||||
@@ -136,7 +198,7 @@ function getNonDefaultSettings(resource: vscode.Uri): { [key: string]: string }
|
||||
return val !== settings.inspect(key).defaultValue;
|
||||
};
|
||||
initializeSettingsCache(resource);
|
||||
return collectSettings(filter, resource);
|
||||
return collectSettingsForTelemetry(filter, resource);
|
||||
}
|
||||
|
||||
interface ClientModel {
|
||||
@@ -158,6 +220,7 @@ export interface Client {
|
||||
Name: string;
|
||||
TrackedDocuments: Set<vscode.TextDocument>;
|
||||
onDidChangeSettings(): void;
|
||||
onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void;
|
||||
takeOwnership(document: vscode.TextDocument): void;
|
||||
requestGoToDeclaration(): Thenable<void>;
|
||||
requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable<string>;
|
||||
@@ -197,6 +260,7 @@ class DefaultClient implements Client {
|
||||
private crashTimes: number[] = [];
|
||||
private failureMessageShown = new PersistentState<boolean>("DefaultClient.failureMessageShown", false);
|
||||
private isSupported: boolean = true;
|
||||
private inactiveRegionsDecorations = new Map<string, DecorationRangesPair>();
|
||||
|
||||
// The "model" that is displayed via the UI (status bar).
|
||||
private model: ClientModel = {
|
||||
@@ -374,13 +438,23 @@ class DefaultClient implements Client {
|
||||
let filter: (key: string, val: string) => boolean = (key: string, val: string) => {
|
||||
return !(key in previousCppSettings) || val !== previousCppSettings[key];
|
||||
};
|
||||
let changedSettings: any = collectSettings(filter, this.RootUri);
|
||||
let changedSettings: any = collectSettingsForTelemetry(filter, this.RootUri);
|
||||
|
||||
if (Object.keys(changedSettings).length > 0) {
|
||||
telemetry.logLanguageServerEvent("CppSettingsChange", changedSettings, null);
|
||||
}
|
||||
}
|
||||
|
||||
public onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
//Apply text decorations to inactive regions
|
||||
for (let e of editors) {
|
||||
let valuePair: DecorationRangesPair = this.inactiveRegionsDecorations.get(e.document.uri.toString());
|
||||
if (valuePair) {
|
||||
e.setDecorations(valuePair.decoration, valuePair.ranges); // VSCode clears the decorations when the text editor becomes invisible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take ownership of a document that was previously serviced by another client.
|
||||
* This process involves sending a textDocument/didOpen message to the server so
|
||||
@@ -433,6 +507,7 @@ class DefaultClient implements Client {
|
||||
this.languageClient.onNotification(ReportNavigationNotification, (e) => this.navigate(e));
|
||||
this.languageClient.onNotification(ReportStatusNotification, (e) => this.updateStatus(e));
|
||||
this.languageClient.onNotification(ReportTagParseStatusNotification, (e) => this.updateTagParseStatus(e));
|
||||
this.languageClient.onNotification(InactiveRegionNotification, (e) => this.updateInactiveRegions(e));
|
||||
this.setupOutputHandlers();
|
||||
}
|
||||
|
||||
@@ -491,7 +566,7 @@ class DefaultClient implements Client {
|
||||
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) {
|
||||
this.outputChannel = vscode.window.createOutputChannel(`C/C++: ${this.Name}`);
|
||||
} else {
|
||||
this.outputChannel = util.getOutputChannel();
|
||||
this.outputChannel = logger.getOutputChannel();
|
||||
}
|
||||
this.disposables.push(this.outputChannel);
|
||||
}
|
||||
@@ -520,7 +595,7 @@ class DefaultClient implements Client {
|
||||
let cppSettings: CppSettings = new CppSettings(this.RootUri);
|
||||
|
||||
// TODO: Move this code to a different place?
|
||||
if (cppSettings.filesAssociationsAutoAdd && payload.navigation.startsWith("<def")) {
|
||||
if (cppSettings.autoAddFileAssociations && payload.navigation.startsWith("<def")) {
|
||||
this.addFileAssociations(payload.navigation.substr(4));
|
||||
return;
|
||||
}
|
||||
@@ -552,7 +627,7 @@ class DefaultClient implements Client {
|
||||
continue; // File already has an association.
|
||||
}
|
||||
let j: number = file.lastIndexOf('.');
|
||||
if (j != -1) {
|
||||
if (j !== -1) {
|
||||
let ext: string = file.substr(j);
|
||||
if ((("*" + ext) in assocs) || (("**/*" + ext) in assocs)) {
|
||||
continue; // Extension already has an association.
|
||||
@@ -619,6 +694,44 @@ class DefaultClient implements Client {
|
||||
this.model.tagParserStatus.Value = notificationBody.status;
|
||||
}
|
||||
|
||||
private updateInactiveRegions(params: InactiveRegionParams): void {
|
||||
let renderOptions: vscode.DecorationRenderOptions = {
|
||||
light: { color: "rgba(175,175,175,1.0)" },
|
||||
dark: { color: "rgba(155,155,155,1.0)" }
|
||||
};
|
||||
let decoration: vscode.TextEditorDecorationType = vscode.window.createTextEditorDecorationType(renderOptions);
|
||||
|
||||
// We must convert to vscode.Ranges in order to make use of the API's
|
||||
let ranges: vscode.Range[] = [];
|
||||
params.regions.forEach(element => {
|
||||
let newRange : vscode.Range = new vscode.Range(element.startLine, 0, element.endLine, 0);
|
||||
ranges.push(newRange);
|
||||
});
|
||||
|
||||
// Find entry for cached file and act accordingly
|
||||
let valuePair: DecorationRangesPair = this.inactiveRegionsDecorations.get(params.uri);
|
||||
if (valuePair) {
|
||||
// Disposing of and resetting the decoration will undo previously applied text decorations
|
||||
valuePair.decoration.dispose();
|
||||
valuePair.decoration = decoration;
|
||||
|
||||
// As vscode.TextEditor.setDecorations only applies to visible editors, we must cache the range for when another editor becomes visible
|
||||
valuePair.ranges = ranges;
|
||||
} else { // The entry does not exist. Make a new one
|
||||
let toInsert: DecorationRangesPair = {
|
||||
decoration: decoration,
|
||||
ranges: ranges
|
||||
};
|
||||
this.inactiveRegionsDecorations.set(params.uri, toInsert);
|
||||
}
|
||||
|
||||
// Apply the decorations to all *visible* text editors
|
||||
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === params.uri);
|
||||
for (let e of editors) {
|
||||
e.setDecorations(decoration, ranges);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* requests to the language server
|
||||
*********************************************/
|
||||
@@ -738,9 +851,9 @@ class DefaultClient implements Client {
|
||||
this.notifyWhenReady(() => {
|
||||
ui.showParsingCommands()
|
||||
.then((index: number) => {
|
||||
if (index == 0) {
|
||||
if (index === 0) {
|
||||
this.pauseParsing();
|
||||
} else if (index == 1) {
|
||||
} else if (index === 1) {
|
||||
this.resumeParsing();
|
||||
}
|
||||
});
|
||||
@@ -782,11 +895,11 @@ class DefaultClient implements Client {
|
||||
function getLanguageServerFileName(): string {
|
||||
let extensionProcessName: string = 'Microsoft.VSCode.CPP.Extension';
|
||||
let plat: NodeJS.Platform = process.platform;
|
||||
if (plat == 'linux') {
|
||||
if (plat === 'linux') {
|
||||
extensionProcessName += '.linux';
|
||||
} else if (plat == 'darwin') {
|
||||
} else if (plat === 'darwin') {
|
||||
extensionProcessName += '.darwin';
|
||||
} else if (plat == 'win32') {
|
||||
} else if (plat === 'win32') {
|
||||
extensionProcessName += '.exe';
|
||||
} else {
|
||||
throw "Invalid Platform";
|
||||
@@ -808,6 +921,7 @@ class NullClient implements Client {
|
||||
Name: string = "(empty)";
|
||||
TrackedDocuments = new Set<vscode.TextDocument>();
|
||||
onDidChangeSettings(): void {}
|
||||
onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {}
|
||||
takeOwnership(document: vscode.TextDocument): void {}
|
||||
requestGoToDeclaration(): Thenable<void> { return Promise.resolve(); }
|
||||
requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable<string> { return Promise.resolve(""); }
|
||||
|
||||
@@ -203,7 +203,7 @@ export class CppProperties {
|
||||
if (this.configurationIncomplete && this.defaultIncludes !== undefined && this.defaultFrameworks !== undefined) {
|
||||
this.configurationJson.configurations[this.CurrentConfiguration].includePath = this.defaultIncludes;
|
||||
this.configurationJson.configurations[this.CurrentConfiguration].browse.path = this.defaultIncludes;
|
||||
if (process.platform == 'darwin') {
|
||||
if (process.platform === 'darwin') {
|
||||
this.configurationJson.configurations[this.CurrentConfiguration].macFrameworkPath = this.defaultFrameworks;
|
||||
}
|
||||
this.configurationIncomplete = false;
|
||||
@@ -216,15 +216,15 @@ export class CppProperties {
|
||||
}
|
||||
let nodePlatform: NodeJS.Platform = process.platform;
|
||||
let plat: string;
|
||||
if (nodePlatform == 'linux') {
|
||||
if (nodePlatform === 'linux') {
|
||||
plat = "Linux";
|
||||
} else if (nodePlatform == 'darwin') {
|
||||
} else if (nodePlatform === 'darwin') {
|
||||
plat = "Mac";
|
||||
} else if (nodePlatform == 'win32') {
|
||||
} else if (nodePlatform === 'win32') {
|
||||
plat = "Win32";
|
||||
}
|
||||
for (let i: number = 0; i < this.configurationJson.configurations.length; i++) {
|
||||
if (config.configurations[i].name == plat) {
|
||||
if (config.configurations[i].name === plat) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -233,14 +233,14 @@ export class CppProperties {
|
||||
|
||||
private getIntelliSenseModeForPlatform(name: string): string {
|
||||
// Do the built-in configs first.
|
||||
if (name == "Linux" || name == "Mac") {
|
||||
if (name === "Linux" || name === "Mac") {
|
||||
return "clang-x64";
|
||||
} else if (name == "Win32") {
|
||||
} else if (name === "Win32") {
|
||||
return "msvc-x64";
|
||||
} else {
|
||||
// Custom configs default to the OS's preference.
|
||||
let nodePlatform: NodeJS.Platform = process.platform;
|
||||
if (nodePlatform == 'linux' || nodePlatform == 'darwin') {
|
||||
if (nodePlatform === 'linux' || nodePlatform === 'darwin') {
|
||||
return "clang-x64";
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
public select(index: number): Configuration {
|
||||
if (index == this.configurationJson.configurations.length) {
|
||||
if (index === this.configurationJson.configurations.length) {
|
||||
this.handleConfigurationEditCommand(vscode.window.showTextDocument);
|
||||
return;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ export class CppProperties {
|
||||
});
|
||||
filePaths.forEach((path: string) => {
|
||||
this.compileCommandFileWatchers.push(fs.watch(path, (event: string, filename: string) => {
|
||||
if (event != "rename") {
|
||||
if (event !== "rename") {
|
||||
this.onCompileCommandsChanged(path);
|
||||
}
|
||||
}));
|
||||
@@ -389,7 +389,7 @@ export class CppProperties {
|
||||
private parsePropertiesFile(): void {
|
||||
try {
|
||||
let readResults: string = fs.readFileSync(this.propertiesFile.fsPath, 'utf8');
|
||||
if (readResults == "") {
|
||||
if (readResults === "") {
|
||||
return; // Repros randomly when the file is initially created. The parse will get called again after the file is written.
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ export class CppProperties {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.configurationJson.version != configVersion) {
|
||||
if (this.configurationJson.version !== configVersion) {
|
||||
dirty = true;
|
||||
if (this.configurationJson.version === undefined) {
|
||||
this.updateToVersion2();
|
||||
@@ -477,13 +477,13 @@ export class CppProperties {
|
||||
let propertiesFile: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
fs.stat(propertiesFile, (err, stats) => {
|
||||
if (err) {
|
||||
if (this.propertiesFile != null) {
|
||||
if (this.propertiesFile !== null) {
|
||||
this.propertiesFile = null; // File deleted.
|
||||
this.resetToDefaultSettings(true);
|
||||
this.handleConfigurationChange();
|
||||
}
|
||||
} else if (stats.mtime > this.configFileWatcherFallbackTime) {
|
||||
if (this.propertiesFile == null) {
|
||||
if (this.propertiesFile === null) {
|
||||
this.propertiesFile = vscode.Uri.file(propertiesFile); // File created.
|
||||
}
|
||||
this.handleConfigurationChange();
|
||||
|
||||
@@ -59,7 +59,7 @@ const multilineCommentRules: any = {
|
||||
/**
|
||||
* activate: set up the extension for language services
|
||||
*/
|
||||
export function activate(delayedCommandsToExecute: Set<string>): void {
|
||||
export function activate(activationEventOccurred: boolean): void {
|
||||
console.log("activating extension");
|
||||
|
||||
// Activate immediately if an activation event occurred in the previous workspace session.
|
||||
@@ -69,18 +69,19 @@ export function activate(delayedCommandsToExecute: Set<string>): void {
|
||||
activatedPreviously.Value = false;
|
||||
realActivation();
|
||||
}
|
||||
|
||||
registerCommands();
|
||||
tempCommands.push(vscode.workspace.onDidOpenTextDocument(d => onDidOpenTextDocument(d)));
|
||||
|
||||
// Check if an activation event has already occurred.
|
||||
if (delayedCommandsToExecute.size > 0) {
|
||||
if (activationEventOccurred) {
|
||||
return onActivationEvent();
|
||||
}
|
||||
|
||||
if (vscode.workspace.textDocuments !== undefined && vscode.workspace.textDocuments.length > 0) {
|
||||
for (let i: number = 0; i < vscode.workspace.textDocuments.length; ++i) {
|
||||
let document: vscode.TextDocument = vscode.workspace.textDocuments[i];
|
||||
if (document.languageId == "cpp" || document.languageId == "c") {
|
||||
if (document.languageId === "cpp" || document.languageId === "c") {
|
||||
return onActivationEvent();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,7 @@ function onDidOpenTextDocument(document: vscode.TextDocument): void {
|
||||
}
|
||||
|
||||
function onActivationEvent(): void {
|
||||
if (tempCommands.length == 0) {
|
||||
if (tempCommands.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,6 +126,7 @@ function realActivation(): void {
|
||||
disposables.push(vscode.workspace.onDidSaveTextDocument(onDidSaveTextDocument));
|
||||
disposables.push(vscode.window.onDidChangeActiveTextEditor(onDidChangeActiveTextEditor));
|
||||
disposables.push(vscode.window.onDidChangeTextEditorSelection(onDidChangeTextEditorSelection));
|
||||
disposables.push(vscode.window.onDidChangeVisibleTextEditors(onDidChangeVisibleTextEditors));
|
||||
|
||||
disposables.push(vscode.languages.setLanguageConfiguration('c', multilineCommentRules));
|
||||
disposables.push(vscode.languages.setLanguageConfiguration('cpp', multilineCommentRules));
|
||||
@@ -162,11 +164,8 @@ function onDidChangeActiveTextEditor(editor: vscode.TextEditor): void {
|
||||
}
|
||||
|
||||
let activeEditor: vscode.TextEditor = vscode.window.activeTextEditor;
|
||||
if (!activeEditor || (activeEditor.document.languageId != "cpp" && activeEditor.document.languageId != "c")) {
|
||||
if (!activeEditor || (activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "c")) {
|
||||
activeDocument = "";
|
||||
if (util.getShowReloadPromptOnce() && activeEditor && activeEditor.document.fileName.endsWith(path.sep + "launch.json")) {
|
||||
util.showReloadOrWaitPromptOnce();
|
||||
}
|
||||
} else {
|
||||
activeDocument = editor.document.uri.toString();
|
||||
clients.activeDocumentChanged(editor.document);
|
||||
@@ -182,7 +181,7 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeDocument != event.textEditor.document.uri.toString()) {
|
||||
if (activeDocument !== event.textEditor.document.uri.toString()) {
|
||||
// For some strange (buggy?) reason we don't reliably get onDidChangeActiveTextEditor callbacks.
|
||||
activeDocument = event.textEditor.document.uri.toString();
|
||||
clients.activeDocumentChanged(event.textEditor.document);
|
||||
@@ -191,6 +190,10 @@ function onDidChangeTextEditorSelection(event: vscode.TextEditorSelectionChangeE
|
||||
clients.ActiveClient.selectionChanged(event.selections[0].start);
|
||||
}
|
||||
|
||||
function onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]): void {
|
||||
clients.forEach(client => client.onDidChangeVisibleTextEditors(editors));
|
||||
}
|
||||
|
||||
function onInterval(): void {
|
||||
// TODO: do we need to pump messages to all clients? depends on what we do with the icons, I suppose.
|
||||
clients.ActiveClient.onInterval();
|
||||
@@ -247,7 +250,7 @@ function onSwitchHeaderSource(): void {
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeEditor.document.languageId != "cpp" && activeEditor.document.languageId != "c") {
|
||||
if (activeEditor.document.languageId !== "cpp" && activeEditor.document.languageId !== "c") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -381,7 +384,7 @@ function onTakeSurvey(): void {
|
||||
}
|
||||
|
||||
function reportMacCrashes(): void {
|
||||
if (process.platform == "darwin") {
|
||||
if (process.platform === "darwin") {
|
||||
prevCrashFile = "";
|
||||
let crashFolder: string = path.resolve(process.env.HOME, "Library/Logs/DiagnosticReports");
|
||||
fs.stat(crashFolder, (err, stats) => {
|
||||
|
||||
@@ -41,7 +41,7 @@ export class CppSettings extends Settings {
|
||||
public get autoComplete(): string { return super.Section.get<string>("autocomplete"); }
|
||||
public get loggingLevel(): string { return super.Section.get<string>("loggingLevel"); }
|
||||
public get navigationLength(): number { return super.Section.get<number>("navigation.length", 60); }
|
||||
public get filesAssociationsAutoAdd(): boolean { return super.Section.get<boolean>("files.associations.autoAdd"); }
|
||||
public get autoAddFileAssociations(): boolean { return super.Section.get<boolean>("autoAddFileAssociations"); }
|
||||
public get workspaceParsingPriority(): boolean { return super.Section.get<boolean>("workspaceParsingPriority"); }
|
||||
public get exclusionPolicy(): boolean { return super.Section.get<boolean>("exclusionPolicy"); }
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ export class UI {
|
||||
});
|
||||
}
|
||||
|
||||
public showWorkspaces(workspaceNames: { name: string, key: string }[]): Thenable<string> {
|
||||
public showWorkspaces(workspaceNames: { name: string; key: string }[]): Thenable<string> {
|
||||
let options: vscode.QuickPickOptions = {};
|
||||
options.placeHolder = "Select a Workspace...";
|
||||
|
||||
@@ -187,7 +187,7 @@ export class UI {
|
||||
|
||||
let items: IndexableQuickPickItem[];
|
||||
items = [];
|
||||
if (this.browseEngineStatusBarItem.tooltip == "Parsing paused") {
|
||||
if (this.browseEngineStatusBarItem.tooltip === "Parsing paused") {
|
||||
items.push({ label: "Resume Parsing", description: "", index: 1 });
|
||||
} else {
|
||||
items.push({ label: "Pause Parsing", description: "", index: 0 });
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import * as url from 'url';
|
||||
import * as https from 'https';
|
||||
import { ClientRequest } from 'http';
|
||||
import * as vscode from 'vscode';
|
||||
import * as fs from 'fs';
|
||||
import * as util from './common';
|
||||
|
||||
import * as Telemetry from './telemetry';
|
||||
|
||||
const userBucketMax: number = 100;
|
||||
const userBucketString: string = "CPP.UserBucket";
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
if (context.globalState.get<number>(userBucketString, -1) === -1) {
|
||||
let bucket: number = Math.floor(Math.random() * userBucketMax) + 1; // Range is [1, userBucketMax].
|
||||
context.globalState.update(userBucketString, bucket);
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
// Redownload occasionally to prevent an extra reload during long sessions.
|
||||
downloadCpptoolsJsonPkg();
|
||||
}, 30 * 60 * 1000); // 30 minutes.
|
||||
}
|
||||
|
||||
// NOTE: Code is copied from DownloadPackage in packageManager.ts, but with ~75% fewer lines.
|
||||
function downloadCpptoolsJson(urlString): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let parsedUrl: url.Url = url.parse(urlString);
|
||||
let request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: util.GetHttpsProxyAgent(),
|
||||
rejectUnauthorized: vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true)
|
||||
}, (response) => {
|
||||
if (response.statusCode === 301 || response.statusCode === 302) {
|
||||
let redirectUrl: string | string[];
|
||||
if (typeof response.headers.location === "string") {
|
||||
redirectUrl = response.headers.location;
|
||||
} else {
|
||||
redirectUrl = response.headers.location[0];
|
||||
}
|
||||
return resolve(downloadCpptoolsJson(redirectUrl)); // Redirect - download from new location
|
||||
}
|
||||
if (response.statusCode !== 200) {
|
||||
return reject();
|
||||
}
|
||||
let downloadedBytes = 0; // tslint:disable-line
|
||||
let cppToolsJsonFile: fs.WriteStream = fs.createWriteStream(util.getExtensionFilePath("cpptools.json"));
|
||||
response.on('data', (data) => { downloadedBytes += data.length; });
|
||||
response.on('end', () => { cppToolsJsonFile.close(); });
|
||||
cppToolsJsonFile.on('close', () => { resolve(); });
|
||||
response.on('error', (error) => { reject(); });
|
||||
response.pipe(cppToolsJsonFile, { end: false });
|
||||
});
|
||||
request.on('error', (error) => { reject(); });
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
export function downloadCpptoolsJsonPkg(): Promise<void> {
|
||||
let hasError: boolean = false;
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
return downloadCpptoolsJson("https://go.microsoft.com/fwlink/?linkid=852750")
|
||||
.catch((error) => {
|
||||
// More specific error info is not likely to be helpful, and we get detailed download data from the initial install.
|
||||
hasError = true;
|
||||
})
|
||||
.then(() => {
|
||||
telemetryProperties['success'] = (!hasError).toString();
|
||||
Telemetry.logDebuggerEvent("cpptoolsJsonDownload", telemetryProperties);
|
||||
});
|
||||
}
|
||||
|
||||
export function processCpptoolsJson(cpptoolsString: string): Promise<void> {
|
||||
let cpptoolsObject: any = JSON.parse(cpptoolsString);
|
||||
let intelliSenseEnginePercentage: number = cpptoolsObject.intelliSenseEngine_default_percentage;
|
||||
|
||||
if (!util.packageJson.extensionFolderPath.includes(".vscode-insiders")) {
|
||||
let prevIntelliSenseEngineDefault: any = util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default;
|
||||
if (util.extensionContext.globalState.get<number>(userBucketString, userBucketMax + 1) <= intelliSenseEnginePercentage) {
|
||||
util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default = "Default";
|
||||
} else {
|
||||
util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default = "Tag Parser";
|
||||
}
|
||||
if (prevIntelliSenseEngineDefault !== util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default) {
|
||||
return util.writeFileText(util.getPackageJsonPath(), util.getPackageJsonString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as LanguageServer from './LanguageServer/extension';
|
||||
|
||||
class TemporaryCommandRegistrar {
|
||||
// Used to save/re-execute commands used before the extension has activated (e.g. delayed by dependency downloading).
|
||||
private delayedCommandsToExecute: Set<string>;
|
||||
private tempCommands: vscode.Disposable[]; // Need to save this to unregister/dispose the temporary commands.
|
||||
|
||||
private commandsToRegister: string[] = [
|
||||
"C_Cpp.ConfigurationEdit",
|
||||
"C_Cpp.ConfigurationSelect",
|
||||
"C_Cpp.SwitchHeaderSource",
|
||||
"C_Cpp.Navigate",
|
||||
"C_Cpp.GoToDeclaration",
|
||||
"C_Cpp.PeekDeclaration",
|
||||
"C_Cpp.ToggleErrorSquiggles",
|
||||
"C_Cpp.ToggleIncludeFallback",
|
||||
"C_Cpp.ShowReleaseNotes",
|
||||
"C_Cpp.ResetDatabase",
|
||||
"C_Cpp.PauseParsing",
|
||||
"C_Cpp.ResumeParsing",
|
||||
"C_Cpp.ShowParsingCommands",
|
||||
"C_Cpp.TakeSurvey"
|
||||
];
|
||||
|
||||
constructor() {
|
||||
this.tempCommands = [];
|
||||
this.delayedCommandsToExecute = new Set<string>();
|
||||
|
||||
// Add temp commands that invoke the real commands after download/install is complete (preventing an error message)
|
||||
this.commandsToRegister.forEach(command => {
|
||||
this.registerTempCommand(command);
|
||||
});
|
||||
}
|
||||
|
||||
public registerTempCommand(command: string): void {
|
||||
this.tempCommands.push(vscode.commands.registerCommand(command, () => {
|
||||
this.delayedCommandsToExecute.add(command);
|
||||
}));
|
||||
}
|
||||
|
||||
public activateLanguageServer(): void {
|
||||
// Main activation code.
|
||||
this.tempCommands.forEach((command) => {
|
||||
command.dispose();
|
||||
});
|
||||
this.tempCommands = [];
|
||||
|
||||
LanguageServer.activate(this.delayedCommandsToExecute.size > 0);
|
||||
|
||||
this.delayedCommandsToExecute.forEach((command) => {
|
||||
vscode.commands.executeCommand(command);
|
||||
});
|
||||
this.delayedCommandsToExecute.clear();
|
||||
}
|
||||
}
|
||||
|
||||
let tempCommandRegistrar: TemporaryCommandRegistrar;
|
||||
|
||||
export function initializeTemporaryCommandRegistrar(): void {
|
||||
tempCommandRegistrar = new TemporaryCommandRegistrar();
|
||||
}
|
||||
|
||||
export function getTemporaryCommandRegistrarInstance(): TemporaryCommandRegistrar {
|
||||
return tempCommandRegistrar;
|
||||
}
|
||||
+54
-96
@@ -11,6 +11,8 @@ import * as vscode from 'vscode';
|
||||
import * as Telemetry from './telemetry';
|
||||
import HttpsProxyAgent = require('https-proxy-agent');
|
||||
import * as url from 'url';
|
||||
import { PlatformInformation } from './platform';
|
||||
import { getOutputChannelLogger, showOutputChannel } from './logger';
|
||||
|
||||
export let extensionContext: vscode.ExtensionContext;
|
||||
export function setExtensionContext(context: vscode.ExtensionContext): void {
|
||||
@@ -19,55 +21,6 @@ export function setExtensionContext(context: vscode.ExtensionContext): void {
|
||||
|
||||
export let packageJson: any = vscode.extensions.getExtension("ms-vscode.cpptools").packageJSON;
|
||||
|
||||
// Used to show a one-time wait/reload popup when launch.json becomes active.
|
||||
let showReloadPromptOnce: boolean = false;
|
||||
let showWaitForDownloadPromptOnce: boolean = false;
|
||||
|
||||
let showReloadPromptAlways: boolean = false; // Used to show wait/reload in the launch/attach debug scenarios.
|
||||
|
||||
export function enableReloadOrWaitPrompt(): void {
|
||||
showReloadPromptOnce = showReloadPromptAlways = showWaitForDownloadPromptOnce = true;
|
||||
}
|
||||
|
||||
export function getShowReloadPromptOnce(): boolean { return showReloadPromptOnce; }
|
||||
export function getShowReloadPrompt(): boolean { return showReloadPromptAlways; }
|
||||
export function getShowWaitForDownloadPromptOnce(): boolean { return showWaitForDownloadPromptOnce; }
|
||||
|
||||
export function showReloadPrompt(): void {
|
||||
showReloadPromptOnce = false;
|
||||
let reload: string = "Reload";
|
||||
vscode.window.showInformationMessage("Reload the window to finish installing the C/C++ extension.", reload).then(value => {
|
||||
if (value === reload) {
|
||||
vscode.commands.executeCommand("workbench.action.reloadWindow");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function showWaitForDownloadPrompt(): void {
|
||||
showWaitForDownloadPromptOnce = false;
|
||||
getOutputChannel().show();
|
||||
vscode.window.showInformationMessage("Please wait for the C/C++ extension dependencies to finish downloading and installing.");
|
||||
}
|
||||
|
||||
function showReloadOrWaitPromptImpl(once: boolean): void {
|
||||
checkInstallLockFile().then((installLockExists: boolean) => {
|
||||
if (installLockExists) {
|
||||
showReloadPrompt();
|
||||
} else {
|
||||
if (!once || getShowWaitForDownloadPromptOnce()) {
|
||||
setDebuggerReloadLater();
|
||||
showWaitForDownloadPrompt();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function showReloadOrWaitPrompt(): void { showReloadOrWaitPromptImpl(false); }
|
||||
export function showReloadOrWaitPromptOnce(): void { showReloadOrWaitPromptImpl(true); }
|
||||
|
||||
// Warning: The methods involving getExtensionFilePath are duplicated in debugProxyUtils.ts,
|
||||
// because the extensionContext is not set in that context.
|
||||
|
||||
export function getExtensionFilePath(extensionfile: string): string {
|
||||
return path.resolve(extensionContext.extensionPath, extensionfile);
|
||||
}
|
||||
@@ -79,6 +32,29 @@ export function getPackageJsonString(): string {
|
||||
return JSON.stringify(packageJson, null, 2);
|
||||
}
|
||||
|
||||
// Extension is ready if install.lock exists and debugAdapters folder exist.
|
||||
export async function isExtensionReady(): Promise<boolean> {
|
||||
const doesInstallLockFileExist: boolean = await checkInstallLockFile();
|
||||
|
||||
return doesInstallLockFileExist;
|
||||
}
|
||||
|
||||
let isExtensionNotReadyPromptDisplayed: boolean = false;
|
||||
export const extensionNotReadyString: string = 'The C/C++ extension is still installing. See the output window for more information.';
|
||||
|
||||
export function displayExtensionNotReadyPrompt(): void {
|
||||
|
||||
if (!isExtensionNotReadyPromptDisplayed) {
|
||||
isExtensionNotReadyPromptDisplayed = true;
|
||||
showOutputChannel();
|
||||
|
||||
getOutputChannelLogger().showInformationMessage(extensionNotReadyString).then(
|
||||
() => { isExtensionNotReadyPromptDisplayed = false; },
|
||||
() => { isExtensionNotReadyPromptDisplayed = false; }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// This Progress global state tracks how far users are able to get before getting blocked.
|
||||
// Users start with a progress of 0 and it increases as they get further along in using the tool.
|
||||
// This eliminates noise/problems due to re-installs, terminated installs that don't send errors,
|
||||
@@ -151,14 +127,14 @@ export function resolveVariables(input: string): string {
|
||||
let regexp: RegExp = /\$\{(env:|env.)?(.*?)\}/g;
|
||||
let ret: string = input.replace(regexp, (match: string, ignored: string, name: string) => {
|
||||
let newValue: string = process.env[name];
|
||||
return (newValue != null) ? newValue : match;
|
||||
return (newValue) ? newValue : match;
|
||||
});
|
||||
|
||||
// Resolve '~' at the start of the path.
|
||||
regexp = /^\~/g;
|
||||
ret = ret.replace(regexp, (match: string, name: string) => {
|
||||
let newValue: string = process.env.HOME;
|
||||
return (newValue != null) ? newValue : match;
|
||||
return (newValue) ? newValue : match;
|
||||
});
|
||||
|
||||
return ret;
|
||||
@@ -176,16 +152,15 @@ export function asFolder(uri: vscode.Uri): string {
|
||||
* get the default open command for the current platform
|
||||
*/
|
||||
export function getOpenCommand(): string {
|
||||
if (os.platform() == 'win32') {
|
||||
if (os.platform() === 'win32') {
|
||||
return 'explorer';
|
||||
} else if (os.platform() == 'darwin') {
|
||||
} else if (os.platform() === 'darwin') {
|
||||
return '/usr/bin/open';
|
||||
} else {
|
||||
return '/usr/bin/xdg-open';
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function getDebugAdaptersPath(file: string): string {
|
||||
return path.resolve(getExtensionFilePath("debugAdapters"), file);
|
||||
}
|
||||
@@ -216,12 +191,7 @@ export function GetHttpsProxyAgent(): HttpsProxyAgent {
|
||||
return new HttpsProxyAgent(proxyOptions);
|
||||
}
|
||||
|
||||
let reloadLater: boolean = false;
|
||||
export function setDebuggerReloadLater(): void { reloadLater = true; }
|
||||
export function getDebuggerReloadLater(): boolean { return reloadLater; }
|
||||
|
||||
/** Creates the lock file if it doesn't exist */
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
/** Creates a file if it doesn't exist */
|
||||
function touchFile(file: string): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
fs.writeFile(file, "", (err) => {
|
||||
@@ -238,10 +208,6 @@ export function touchInstallLockFile(): Promise<void> {
|
||||
return touchFile(getInstallLockPath());
|
||||
}
|
||||
|
||||
export function touchPackageLockFile(): Promise<void> {
|
||||
return touchFile(getPackageLockPath());
|
||||
}
|
||||
|
||||
export function touchExtensionFolder(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
fs.utimes(path.resolve(extensionContext.extensionPath, ".."), new Date(Date.now()), new Date(Date.now()), (err) => {
|
||||
@@ -255,7 +221,6 @@ export function touchExtensionFolder(): Promise<void> {
|
||||
}
|
||||
|
||||
/** Test whether a file exists */
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function checkFileExists(filePath: string): Promise<boolean> {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.stat(filePath, (err, stats) => {
|
||||
@@ -269,16 +234,10 @@ export function checkFileExists(filePath: string): Promise<boolean> {
|
||||
}
|
||||
|
||||
/** Test whether the lock file exists.*/
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function checkInstallLockFile(): Promise<boolean> {
|
||||
return checkFileExists(getInstallLockPath());
|
||||
}
|
||||
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function checkPackageLockFile(): Promise<boolean> {
|
||||
return checkFileExists(getPackageLockPath());
|
||||
}
|
||||
|
||||
/** Reads the content of a text file */
|
||||
export function readFileText(filePath: string, encoding: string = "utf8"): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
@@ -308,23 +267,10 @@ export function writeFileText(filePath: string, content: string, encoding: strin
|
||||
}
|
||||
|
||||
// Get the path of the lock file. This is used to indicate that the platform-specific dependencies have been downloaded.
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function getInstallLockPath(): string {
|
||||
return getExtensionFilePath("install.lock");
|
||||
}
|
||||
|
||||
// This 2nd lock is needed for the debugger launch scenario to detect if a reload has been done yet.
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function getPackageLockPath(): string {
|
||||
return getExtensionFilePath("package.lock");
|
||||
}
|
||||
|
||||
// Used to communicate from the debugProxy to the extension code.
|
||||
// NOTE: This function is duplicated in debugProxyUtils.ts because common.ts cannot be imported by debugProxy.ts.
|
||||
export function getDebuggerReloadPath(): string {
|
||||
return getExtensionFilePath(`debugger.reload`);
|
||||
}
|
||||
|
||||
export function getReadmeMessage(): string {
|
||||
const readmePath: string = getExtensionFilePath("README.md");
|
||||
const readmeMessage: string = `Please refer to ${readmePath} for troubleshooting information. Issues can be created at https://github.com/Microsoft/vscppsamples/issues`;
|
||||
@@ -402,18 +348,9 @@ export function spawnChildProcess(process: string, args: string[], workingDirect
|
||||
});
|
||||
}
|
||||
|
||||
let outputChannel: vscode.OutputChannel;
|
||||
|
||||
export function getOutputChannel(): vscode.OutputChannel {
|
||||
if (outputChannel == undefined) {
|
||||
outputChannel = vscode.window.createOutputChannel("C/C++");
|
||||
}
|
||||
return outputChannel;
|
||||
}
|
||||
|
||||
export function allowExecution(file: string): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (process.platform != 'win32') {
|
||||
if (process.platform !== 'win32') {
|
||||
checkFileExists(file).then((exists: boolean) => {
|
||||
if (exists) {
|
||||
fs.chmod(file, '755', (err: NodeJS.ErrnoException) => {
|
||||
@@ -424,8 +361,8 @@ export function allowExecution(file: string): Promise<void> {
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
getOutputChannel().appendLine("");
|
||||
getOutputChannel().appendLine(`Warning: Expected file ${file} is missing.`);
|
||||
getOutputChannelLogger().appendLine("");
|
||||
getOutputChannelLogger().appendLine(`Warning: Expected file ${file} is missing.`);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
@@ -434,3 +371,24 @@ export function allowExecution(file: string): Promise<void> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function removePotentialPII(str: string): string {
|
||||
let words: string[] = str.split(" ");
|
||||
let result: string = "";
|
||||
for (let word of words) {
|
||||
if (word.indexOf(".") === -1 && word.indexOf("/") === -1 && word.indexOf("\\") === -1 && word.indexOf(":") === -1) {
|
||||
result += word + " ";
|
||||
} else {
|
||||
result += "? ";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function checkDistro(platformInfo: PlatformInformation): void {
|
||||
if (platformInfo.platform !== 'win32' && platformInfo.platform !== 'linux' && platformInfo.platform !== 'darwin') {
|
||||
// this should never happen because VSCode doesn't run on FreeBSD
|
||||
// or SunOS (the other platforms supported by node)
|
||||
getOutputChannelLogger().appendLine(`Warning: Debugging has not been tested for this platform. ${getReadmeMessage()}`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
export class InstallationInformation {
|
||||
stage: string;
|
||||
hasError: boolean;
|
||||
telemetryProperties: { [key: string]: string };
|
||||
|
||||
constructor() {
|
||||
this.hasError = false;
|
||||
this.telemetryProperties = {};
|
||||
}
|
||||
}
|
||||
|
||||
let installBlob: InstallationInformation ;
|
||||
|
||||
export function initializeInstallationInformation(): void {
|
||||
installBlob = new InstallationInformation ();
|
||||
}
|
||||
|
||||
export function getInstallationInformationInstance(): InstallationInformation {
|
||||
return installBlob;
|
||||
}
|
||||
|
||||
export function setInstallationStage(stage: string): void {
|
||||
if (!installBlob) {
|
||||
initializeInstallationInformation();
|
||||
}
|
||||
installBlob.stage = stage;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ export class LinuxDistribution {
|
||||
let keyValues: string[] = data.split(os.EOL);
|
||||
for (let i: number = 0; i < keyValues.length; i++) {
|
||||
let keyValue: string[] = keyValues[i].split('=');
|
||||
if (keyValue.length == 2) {
|
||||
if (keyValue.length === 2) {
|
||||
if (keyValue[0] === idKey) {
|
||||
distroName = keyValue[1];
|
||||
} else if (keyValue[0] === versionKey) {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
|
||||
// This is used for testing purposes
|
||||
let Subscriber: (message: string) => void;
|
||||
export function subscribeToAllLoggers(subscriber: (message: string) => void): void {
|
||||
Subscriber = subscriber;
|
||||
}
|
||||
|
||||
export class Logger {
|
||||
private writer: (message: string) => void;
|
||||
|
||||
constructor(writer: (message: string) => void) {
|
||||
this.writer = writer;
|
||||
}
|
||||
|
||||
public append(message: string): void {
|
||||
this.writer(message);
|
||||
if (Subscriber) {
|
||||
Subscriber(message);
|
||||
}
|
||||
}
|
||||
|
||||
public appendLine(message: string): void {
|
||||
this.writer(message + os.EOL);
|
||||
if (Subscriber) {
|
||||
Subscriber(message + os.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
public showInformationMessage(message: string, items?: string[]): Thenable<string> {
|
||||
this.appendLine(message);
|
||||
|
||||
return vscode.window.showInformationMessage(message, ...items);
|
||||
}
|
||||
|
||||
public showWarningMessage(message: string, items?: string[]): Thenable<string> {
|
||||
this.appendLine(message);
|
||||
|
||||
return vscode.window.showWarningMessage(message, ...items);
|
||||
}
|
||||
|
||||
public showErrorMessage(message: string, items?: string[]): Thenable<string> {
|
||||
this.appendLine(message);
|
||||
|
||||
return vscode.window.showErrorMessage(message, ...items);
|
||||
}
|
||||
}
|
||||
|
||||
let outputChannel: vscode.OutputChannel;
|
||||
|
||||
export function getOutputChannel(): vscode.OutputChannel {
|
||||
if (outputChannel === undefined) {
|
||||
outputChannel = vscode.window.createOutputChannel("C/C++");
|
||||
}
|
||||
return outputChannel;
|
||||
}
|
||||
|
||||
export function showOutputChannel(): void {
|
||||
getOutputChannel().show();
|
||||
}
|
||||
|
||||
let outputChannelLogger: Logger;
|
||||
|
||||
export function getOutputChannelLogger(): Logger {
|
||||
if (!outputChannelLogger) {
|
||||
outputChannelLogger = new Logger(message => getOutputChannel().append(message));
|
||||
}
|
||||
return outputChannelLogger;
|
||||
}
|
||||
+166
-317
@@ -4,339 +4,171 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as util from './common';
|
||||
import * as Telemetry from './telemetry';
|
||||
import * as LanguageServer from './LanguageServer/extension';
|
||||
import * as cpptoolsJsonUtils from './abTesting';
|
||||
import * as DebuggerExtension from './Debugger/extension';
|
||||
import * as fs from 'fs';
|
||||
import * as LanguageServer from './LanguageServer/extension';
|
||||
import * as os from 'os';
|
||||
import * as Telemetry from './telemetry';
|
||||
import * as util from './common';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistrar } from './commands';
|
||||
import { PlatformInformation } from './platform';
|
||||
import { PackageManager, PackageManagerError, PackageManagerWebResponseError, IPackage } from './packageManager';
|
||||
import { PersistentState } from './LanguageServer/persistentState';
|
||||
import * as url from 'url';
|
||||
import * as https from 'https';
|
||||
import { extensionContext } from './common';
|
||||
import { ClientRequest } from 'http';
|
||||
import { initializeInstallationInformation, getInstallationInformationInstance, InstallationInformation, setInstallationStage } from './installationInformation';
|
||||
import { Logger, getOutputChannelLogger, showOutputChannel } from './logger';
|
||||
|
||||
const releaseNotesVersion: number = 3;
|
||||
const userBucketMax: number = 100;
|
||||
|
||||
// Used to save/re-execute commands used before the extension has activated (e.g. delayed by dependency downloading).
|
||||
let delayedCommandsToExecute: Set<string>;
|
||||
let tempCommands: vscode.Disposable[]; // Need to save this to unregister/dispose the temporary commands.
|
||||
|
||||
function registerTempCommand(command: string): void {
|
||||
tempCommands.push(vscode.commands.registerCommand(command, () => {
|
||||
delayedCommandsToExecute.add(command);
|
||||
util.checkInstallLockFile().then((installLockExists: boolean) => {
|
||||
if (!installLockExists) {
|
||||
util.showWaitForDownloadPrompt();
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
const userBucketString: string = "CPP.UserBucket";
|
||||
|
||||
// NOTE: Code is copied from DownloadPackage in packageManager.ts, but with ~75% fewer lines.
|
||||
function downloadCpptoolsJson(urlString): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let parsedUrl: url.Url = url.parse(urlString);
|
||||
let request: ClientRequest = https.request({
|
||||
host: parsedUrl.host,
|
||||
path: parsedUrl.path,
|
||||
agent: util.GetHttpsProxyAgent(),
|
||||
rejectUnauthorized: vscode.workspace.getConfiguration().get("http.proxyStrictSSL", true)
|
||||
}, (response) => {
|
||||
if (response.statusCode == 301 || response.statusCode == 302) {
|
||||
let redirectUrl: string | string[];
|
||||
if (typeof response.headers.location === "string") {
|
||||
redirectUrl = response.headers.location;
|
||||
} else {
|
||||
redirectUrl = response.headers.location[0];
|
||||
}
|
||||
return resolve(downloadCpptoolsJson(redirectUrl)); // Redirect - download from new location
|
||||
}
|
||||
if (response.statusCode != 200) {
|
||||
return reject();
|
||||
}
|
||||
let downloadedBytes = 0; // tslint:disable-line
|
||||
let cppToolsJsonFile: fs.WriteStream = fs.createWriteStream(util.getExtensionFilePath("cpptools.json"));
|
||||
response.on('data', (data) => { downloadedBytes += data.length; });
|
||||
response.on('end', () => { cppToolsJsonFile.close(); });
|
||||
cppToolsJsonFile.on('close', () => { resolve(); });
|
||||
response.on('error', (error) => { reject(); });
|
||||
response.pipe(cppToolsJsonFile, { end: false });
|
||||
});
|
||||
request.on('error', (error) => { reject(); });
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
||||
function downloadCpptoolsJsonPkg(): Promise<void> {
|
||||
let hasError: boolean = false;
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
return downloadCpptoolsJson("https://go.microsoft.com/fwlink/?linkid=852750")
|
||||
.catch((error) => {
|
||||
// More specific error info is not likely to be helpful, and we get detailed download data from the initial install.
|
||||
hasError = true;
|
||||
})
|
||||
.then(() => {
|
||||
telemetryProperties['success'] = (!hasError).toString();
|
||||
Telemetry.logDebuggerEvent("cpptoolsJsonDownload", telemetryProperties);
|
||||
});
|
||||
}
|
||||
|
||||
function processCpptoolsJson(cpptoolsString: string): Promise<void> {
|
||||
let cpptoolsObject: any = JSON.parse(cpptoolsString);
|
||||
let intelliSenseEnginePercentage: number = cpptoolsObject.intelliSenseEngine_default_percentage;
|
||||
|
||||
if (!util.packageJson.extensionFolderPath.includes(".vscode-insiders")) {
|
||||
let prevIntelliSenseEngineDefault: any = util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default;
|
||||
if (util.extensionContext.globalState.get<number>(userBucketString, userBucketMax + 1) <= intelliSenseEnginePercentage) {
|
||||
util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default = "Default";
|
||||
} else {
|
||||
util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default = "Tag Parser";
|
||||
}
|
||||
if (prevIntelliSenseEngineDefault != util.packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default) {
|
||||
return util.writeFileText(util.getPackageJsonPath(), util.getPackageJsonString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
export function activate(context: vscode.ExtensionContext): void | Promise<void> {
|
||||
initializeTemporaryCommandRegistrar();
|
||||
util.setExtensionContext(context);
|
||||
Telemetry.activate();
|
||||
util.setProgress(0);
|
||||
cpptoolsJsonUtils.activate(context);
|
||||
initializeInstallationInformation();
|
||||
|
||||
// Initialize the DebuggerExtension and register the related commands and providers.
|
||||
DebuggerExtension.initialize();
|
||||
|
||||
if (context.globalState.get<number>(userBucketString, -1) == -1) {
|
||||
let bucket: number = Math.floor(Math.random() * userBucketMax) + 1; // Range is [1, userBucketMax].
|
||||
context.globalState.update(userBucketString, bucket);
|
||||
}
|
||||
|
||||
// Add temp commands that invoke the real commands after download/install is complete (preventing an error message),
|
||||
// and also show the C/C++ output pane and the "wait for download" message.
|
||||
tempCommands = [];
|
||||
delayedCommandsToExecute = new Set<string>();
|
||||
registerTempCommand("C_Cpp.ConfigurationEdit");
|
||||
registerTempCommand("C_Cpp.ConfigurationSelect");
|
||||
registerTempCommand("C_Cpp.SwitchHeaderSource");
|
||||
registerTempCommand("C_Cpp.Navigate");
|
||||
registerTempCommand("C_Cpp.GoToDeclaration");
|
||||
registerTempCommand("C_Cpp.PeekDeclaration");
|
||||
registerTempCommand("C_Cpp.ToggleErrorSquiggles");
|
||||
registerTempCommand("C_Cpp.ToggleIncludeFallback");
|
||||
registerTempCommand("C_Cpp.ShowReleaseNotes");
|
||||
registerTempCommand("C_Cpp.ResetDatabase");
|
||||
registerTempCommand("C_Cpp.PauseParsing");
|
||||
registerTempCommand("C_Cpp.ResumeParsing");
|
||||
registerTempCommand("C_Cpp.ShowParsingCommands");
|
||||
registerTempCommand("C_Cpp.TakeSurvey");
|
||||
|
||||
processRuntimeDependencies(() => {
|
||||
downloadCpptoolsJsonPkg().then(() => {
|
||||
util.readFileText(util.getExtensionFilePath("cpptools.json"))
|
||||
.then((cpptoolsString) => {
|
||||
processCpptoolsJson(cpptoolsString);
|
||||
})
|
||||
.catch((error) => {
|
||||
// We already log telemetry if cpptools.json fails to download.
|
||||
})
|
||||
.then(() => {
|
||||
// Main activation code.
|
||||
tempCommands.forEach((command) => {
|
||||
command.dispose();
|
||||
});
|
||||
tempCommands = [];
|
||||
LanguageServer.activate(delayedCommandsToExecute);
|
||||
delayedCommandsToExecute.forEach((command) => {
|
||||
vscode.commands.executeCommand(command);
|
||||
});
|
||||
delayedCommandsToExecute.clear();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
// Redownload occasionally to prevent an extra reload during long sessions.
|
||||
downloadCpptoolsJsonPkg();
|
||||
}, 30 * 60 * 1000); // 30 minutes.
|
||||
return processRuntimeDependencies();
|
||||
}
|
||||
|
||||
export function deactivate(): Thenable<void> {
|
||||
DebuggerExtension.dispose();
|
||||
|
||||
tempCommands.forEach((command) => {
|
||||
command.dispose();
|
||||
});
|
||||
|
||||
Telemetry.deactivate();
|
||||
return LanguageServer.deactivate();
|
||||
}
|
||||
|
||||
function removePotentialPII(str: string): string {
|
||||
let words: string[] = str.split(" ");
|
||||
let result: string = "";
|
||||
for (let word of words) {
|
||||
if (word.indexOf(".") == -1 && word.indexOf("/") == -1 && word.indexOf("\\") == -1 && word.indexOf(":") == -1) {
|
||||
result += word + " ";
|
||||
async function processRuntimeDependencies(): Promise<void> {
|
||||
const installLockExists: boolean = await util.checkInstallLockFile();
|
||||
|
||||
if (installLockExists) {
|
||||
// Offline Scenario: Lock file exists but package.json has not had its activationEvents rewritten.
|
||||
if (util.packageJson.activationEvents && util.packageJson.activationEvents.length === 1) {
|
||||
try {
|
||||
await offlineInstallation();
|
||||
} catch (error) {
|
||||
getOutputChannelLogger().showErrorMessage('The installation of the C/C++ extension failed. Please see the output window for more information.');
|
||||
showOutputChannel();
|
||||
}
|
||||
// The extension have been installed and activated before.
|
||||
} else {
|
||||
result += "? ";
|
||||
await finalizeExtensionActivation();
|
||||
}
|
||||
// No lock file, need to download and install dependencies.
|
||||
} else {
|
||||
try {
|
||||
await onlineInstallation();
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
interface InstallBlob {
|
||||
stage: string;
|
||||
hasError: boolean;
|
||||
telemetryProperties: { [key: string]: string };
|
||||
info?: PlatformInformation;
|
||||
packageManager?: PackageManager;
|
||||
async function offlineInstallation(): Promise<void> {
|
||||
setInstallationStage('getPlatformInfo');
|
||||
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
|
||||
|
||||
setInstallationStage('makeBinariesExecutable');
|
||||
await makeBinariesExecutable();
|
||||
|
||||
setInstallationStage('makeOfflineBinariesExecutable');
|
||||
await makeOfflineBinariesExecutable(info);
|
||||
|
||||
setInstallationStage('removeUnnecessaryFile');
|
||||
await removeUnnecessaryFile();
|
||||
|
||||
setInstallationStage('rewriteManifest');
|
||||
await rewriteManifest();
|
||||
|
||||
setInstallationStage('postInstall');
|
||||
await postInstall(info);
|
||||
}
|
||||
|
||||
// During activation, the C++ extension must perform the following steps:
|
||||
// 1. Check the package.lock - if present, we're done.
|
||||
// 2. Check for the install.lock file - if present, we write the package.lock and activate if activationEvents is not "*".
|
||||
// 3. If activationEvents is "*", then we do the offline installation (everything after download/install).
|
||||
// 4. If there's no install.lock, download and install (i.e. unzip) the required dependencies.
|
||||
// 5. For both online and offline install, make sure all binaries are marked as executable.
|
||||
// 6. And rewrite the package.json to launch the actual debugger instead of the proxy stub.
|
||||
// 7. Create the install.lock file on success, but if a command is done before this time, a wait message is shown.
|
||||
// 8. Log installation telemetry.
|
||||
// 9. After the install is finished, show a reload prompt if a debug attach/launch occurrs or launch.json is opened.
|
||||
// 10. We also download a cpptool.json in case we want to use the data in it to alter the behavior post-shipping (i.e. a/b testing).
|
||||
// 11. After reloading, the package.lock is written, which causes the reload prompt to no longer appear.
|
||||
function processRuntimeDependencies(activateExtensions: () => void): void {
|
||||
util.checkPackageLockFile().then((packageLockExists: boolean) => {
|
||||
if (packageLockExists) {
|
||||
return activateExtensions();
|
||||
}
|
||||
async function onlineInstallation(): Promise<void> {
|
||||
setInstallationStage('getPlatformInfo');
|
||||
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
|
||||
|
||||
util.checkInstallLockFile().then((installLockExists: boolean) => {
|
||||
let installBlob: InstallBlob = {
|
||||
stage: 'getPlatformInfo',
|
||||
hasError: false,
|
||||
telemetryProperties: {}
|
||||
};
|
||||
await downloadAndInstallPackages(info);
|
||||
|
||||
if (installLockExists) {
|
||||
if (util.packageJson.activationEvents && util.packageJson.activationEvents.length == 1) {
|
||||
// If the lock exists, but package.json hasn't been rewritten, then there are some setup steps that have been skipped (offline install)
|
||||
setInstallationStage('makeBinariesExecutable');
|
||||
await makeBinariesExecutable();
|
||||
|
||||
// Need to watch for debugger.reload in case launch debugging is done.
|
||||
fs.watch(extensionContext.extensionPath, (event: string, filename: string) => {
|
||||
if (filename == "debugger.reload") {
|
||||
util.showReloadPrompt();
|
||||
}
|
||||
});
|
||||
PlatformInformation.GetPlatformInformation()
|
||||
.then((info) => {
|
||||
installBlob.info = info;
|
||||
makeBinariesExecutable(installBlob);
|
||||
})
|
||||
.then(() => makeOfflineBinariesExecutable(installBlob))
|
||||
.then(() => rewriteManifest(installBlob))
|
||||
.then(() => touchInstallLockFile(installBlob))
|
||||
.catch(error => handleError(installBlob, error))
|
||||
.then(() => postInstall(installBlob))
|
||||
.then(() => activateExtensions());
|
||||
} else {
|
||||
util.touchPackageLockFile();
|
||||
return activateExtensions();
|
||||
}
|
||||
} else {
|
||||
// Need to watch for debugger.reload in case launch debugging is done.
|
||||
fs.watch(extensionContext.extensionPath, (event: string, filename: string) => {
|
||||
if (filename == "debugger.reload") {
|
||||
util.checkInstallLockFile().then((installLockExists) => {
|
||||
if (installLockExists) {
|
||||
util.showReloadPrompt();
|
||||
} else {
|
||||
util.setDebuggerReloadLater();
|
||||
util.showWaitForDownloadPrompt();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
let channel: vscode.OutputChannel = util.getOutputChannel();
|
||||
channel.appendLine("Updating C/C++ dependencies...");
|
||||
setInstallationStage('removeUnnecessaryFile');
|
||||
await removeUnnecessaryFile();
|
||||
|
||||
let statusItem: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
|
||||
let packageManager: PackageManager;
|
||||
setInstallationStage('rewriteManifest');
|
||||
await rewriteManifest();
|
||||
|
||||
PlatformInformation.GetPlatformInformation()
|
||||
.then((info) => {
|
||||
installBlob.info = info;
|
||||
packageManager = new PackageManager(info, channel, statusItem);
|
||||
channel.appendLine("");
|
||||
installBlob.stage = "downloadPackages";
|
||||
return packageManager.DownloadPackages();
|
||||
})
|
||||
.then(() => {
|
||||
channel.appendLine("");
|
||||
installBlob.stage = "installPackages";
|
||||
return packageManager.InstallPackages();
|
||||
})
|
||||
.then(() => makeBinariesExecutable(installBlob))
|
||||
.then(() => removeUnnecessaryFile(installBlob))
|
||||
.then(() => rewriteManifest(installBlob))
|
||||
.then(() => touchInstallLockFile(installBlob))
|
||||
.catch(error => handleError(installBlob, error))
|
||||
.then(() => statusItem.dispose())
|
||||
.then(() => postInstall(installBlob))
|
||||
.then(() => activateExtensions());
|
||||
}
|
||||
});
|
||||
});
|
||||
setInstallationStage('touchInstallLockFile');
|
||||
await touchInstallLockFile();
|
||||
|
||||
setInstallationStage('postInstall');
|
||||
await postInstall(info);
|
||||
}
|
||||
|
||||
function makeBinariesExecutable(installBlob: InstallBlob): Thenable<void> {
|
||||
installBlob.stage = "makeBinariesExecutable";
|
||||
async function downloadAndInstallPackages(info: PlatformInformation): Promise<void> {
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine("Updating C/C++ dependencies...");
|
||||
|
||||
let statusItem: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
|
||||
let packageManager: PackageManager = new PackageManager(info, outputChannelLogger, statusItem);
|
||||
|
||||
outputChannelLogger.appendLine('');
|
||||
setInstallationStage('downloadPackages');
|
||||
await packageManager.DownloadPackages();
|
||||
|
||||
outputChannelLogger.appendLine('');
|
||||
setInstallationStage('installPackages');
|
||||
await packageManager.InstallPackages();
|
||||
|
||||
statusItem.dispose();
|
||||
}
|
||||
|
||||
function makeBinariesExecutable(): Promise<void> {
|
||||
return util.allowExecution(util.getDebugAdaptersPath("OpenDebugAD7"));
|
||||
}
|
||||
|
||||
function makeOfflineBinariesExecutable(installBlob: InstallBlob): Thenable<void> {
|
||||
function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void> {
|
||||
let promises: Thenable<void>[] = [];
|
||||
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
|
||||
packages.forEach(p => {
|
||||
if (p.binaries && p.binaries.length > 0 &&
|
||||
p.platforms.findIndex(plat => plat === installBlob.info.platform) !== -1 &&
|
||||
p.architectures.findIndex(arch => arch === installBlob.info.architecture) !== - 1) {
|
||||
p.platforms.findIndex(plat => plat === info.platform) !== -1 &&
|
||||
(p.architectures === undefined || p.architectures.findIndex(arch => arch === info.architecture) !== - 1)) {
|
||||
p.binaries.forEach(binary => promises.push(util.allowExecution(util.getExtensionFilePath(binary))));
|
||||
}
|
||||
});
|
||||
return Promise.all(promises).then(() => { });
|
||||
}
|
||||
|
||||
function removeUnnecessaryFile(installBlob: InstallBlob): void {
|
||||
function removeUnnecessaryFile(): Promise<void> {
|
||||
if (os.platform() !== 'win32') {
|
||||
installBlob.stage = "removeUnnecessaryFile";
|
||||
let sourcePath: string = util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config");
|
||||
if (fs.existsSync(sourcePath)) {
|
||||
fs.rename(sourcePath, util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config.unused"), (err) => {
|
||||
util.getOutputChannel().appendLine("removeUnnecessaryFile: fs.rename failed: " + err.message);
|
||||
fs.rename(sourcePath, util.getDebugAdaptersPath("bin/OpenDebugAD7.exe.config.unused"), (err: NodeJS.ErrnoException) => {
|
||||
if (err) {
|
||||
getOutputChannelLogger().appendLine(`ERROR: fs.rename failed with "${err.message}". Delete ${sourcePath} manually to enable debugging.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function touchInstallLockFile(installBlob: InstallBlob): Thenable<void> {
|
||||
checkDistro(util.getOutputChannel(), installBlob.info);
|
||||
|
||||
installBlob.stage = "touchInstallLockFile";
|
||||
function touchInstallLockFile(): Promise<void> {
|
||||
return util.touchInstallLockFile();
|
||||
}
|
||||
|
||||
function handleError(installBlob: InstallBlob, error: any): void {
|
||||
installBlob.hasError = true;
|
||||
installBlob.telemetryProperties['stage'] = installBlob.stage;
|
||||
function handleError(error: any): void {
|
||||
let installationInformation: InstallationInformation = getInstallationInformationInstance();
|
||||
installationInformation.hasError = true;
|
||||
installationInformation.telemetryProperties['stage'] = installationInformation.stage;
|
||||
let errorMessage: string;
|
||||
let channel: vscode.OutputChannel = util.getOutputChannel();
|
||||
|
||||
if (error instanceof PackageManagerError) {
|
||||
// If this is a WebResponse error, log the IP that it resolved from the package URL
|
||||
@@ -345,63 +177,60 @@ function handleError(installBlob: InstallBlob, error: any): void {
|
||||
if (webRequestPackageError.socket) {
|
||||
let address: any = webRequestPackageError.socket.address();
|
||||
if (address) {
|
||||
installBlob.telemetryProperties['error.targetIP'] = address.address + ':' + address.port;
|
||||
installationInformation.telemetryProperties['error.targetIP'] = address.address + ':' + address.port;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let packageError: PackageManagerError = error;
|
||||
|
||||
installBlob.telemetryProperties['error.methodName'] = packageError.methodName;
|
||||
installBlob.telemetryProperties['error.message'] = packageError.message;
|
||||
installationInformation.telemetryProperties['error.methodName'] = packageError.methodName;
|
||||
installationInformation.telemetryProperties['error.message'] = packageError.message;
|
||||
|
||||
if (packageError.innerError) {
|
||||
errorMessage = packageError.innerError.toString();
|
||||
installBlob.telemetryProperties['error.innerError'] = removePotentialPII(errorMessage);
|
||||
installationInformation.telemetryProperties['error.innerError'] = util.removePotentialPII(errorMessage);
|
||||
} else {
|
||||
errorMessage = packageError.message;
|
||||
}
|
||||
|
||||
if (packageError.pkg) {
|
||||
installBlob.telemetryProperties['error.packageName'] = packageError.pkg.description;
|
||||
installBlob.telemetryProperties['error.packageUrl'] = packageError.pkg.url;
|
||||
installationInformation.telemetryProperties['error.packageName'] = packageError.pkg.description;
|
||||
installationInformation.telemetryProperties['error.packageUrl'] = packageError.pkg.url;
|
||||
}
|
||||
|
||||
if (packageError.errorCode) {
|
||||
installBlob.telemetryProperties['error.errorCode'] = removePotentialPII(packageError.errorCode);
|
||||
installationInformation.telemetryProperties['error.errorCode'] = util.removePotentialPII(packageError.errorCode);
|
||||
}
|
||||
} else {
|
||||
errorMessage = error.toString();
|
||||
installBlob.telemetryProperties['error.toString'] = removePotentialPII(errorMessage);
|
||||
installationInformation.telemetryProperties['error.toString'] = util.removePotentialPII(errorMessage);
|
||||
}
|
||||
|
||||
// Show the actual message and not the sanitized one
|
||||
if (installBlob.stage == "downloadPackages") {
|
||||
channel.appendLine("");
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
if (installationInformation.stage === 'downloadPackages') {
|
||||
outputChannelLogger.appendLine("");
|
||||
}
|
||||
channel.appendLine(`Failed at stage: ${installBlob.stage}`);
|
||||
channel.appendLine(errorMessage);
|
||||
channel.appendLine("");
|
||||
channel.appendLine(`If you work in an offline environment or repeatedly see this error, try downloading a version of the extension with all the dependencies pre-included from https://github.com/Microsoft/vscode-cpptools/releases, then use the "Install from VSIX" command in VS Code to install it.`);
|
||||
channel.show();
|
||||
// Show the actual message and not the sanitized one
|
||||
outputChannelLogger.appendLine(`Failed at stage: ${installationInformation.stage}`);
|
||||
outputChannelLogger.appendLine(errorMessage);
|
||||
outputChannelLogger.appendLine("");
|
||||
outputChannelLogger.appendLine(`If you work in an offline environment or repeatedly see this error, try downloading a version of the extension with all the dependencies pre-included from https://github.com/Microsoft/vscode-cpptools/releases, then use the "Install from VSIX" command in VS Code to install it.`);
|
||||
showOutputChannel();
|
||||
}
|
||||
|
||||
function postInstall(installBlob: InstallBlob): Thenable<void> {
|
||||
let channel: vscode.OutputChannel = util.getOutputChannel();
|
||||
function sendTelemetry(info: PlatformInformation): boolean {
|
||||
let installBlob: InstallationInformation = getInstallationInformationInstance();
|
||||
const success: boolean = !installBlob.hasError;
|
||||
|
||||
channel.appendLine("");
|
||||
channel.appendLine("Finished installing dependencies");
|
||||
channel.appendLine("");
|
||||
installBlob.stage = '';
|
||||
installBlob.telemetryProperties['success'] = success.toString();
|
||||
|
||||
installBlob.telemetryProperties['success'] = (!installBlob.hasError).toString();
|
||||
|
||||
if (installBlob.info.distribution) {
|
||||
installBlob.telemetryProperties['linuxDistroName'] = installBlob.info.distribution.name;
|
||||
installBlob.telemetryProperties['linuxDistroVersion'] = installBlob.info.distribution.version;
|
||||
if (info.distribution) {
|
||||
installBlob.telemetryProperties['linuxDistroName'] = info.distribution.name;
|
||||
installBlob.telemetryProperties['linuxDistroVersion'] = info.distribution.version;
|
||||
}
|
||||
|
||||
if (!installBlob.hasError) {
|
||||
if (success) {
|
||||
util.setProgress(util.getProgressInstallSuccess());
|
||||
let versionShown: PersistentState<number> = new PersistentState<number>("CPP.ReleaseNotesVersion", -1);
|
||||
if (versionShown.Value < releaseNotesVersion) {
|
||||
@@ -410,33 +239,53 @@ function postInstall(installBlob: InstallBlob): Thenable<void> {
|
||||
}
|
||||
}
|
||||
|
||||
installBlob.telemetryProperties['osArchitecture'] = installBlob.info.architecture;
|
||||
installBlob.telemetryProperties['osArchitecture'] = info.architecture;
|
||||
|
||||
Telemetry.logDebuggerEvent("acquisition", installBlob.telemetryProperties);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
let outputChannelLogger: Logger = getOutputChannelLogger();
|
||||
outputChannelLogger.appendLine("");
|
||||
outputChannelLogger.appendLine("Finished installing dependencies");
|
||||
outputChannelLogger.appendLine("");
|
||||
|
||||
const installSuccess: boolean = sendTelemetry(info);
|
||||
|
||||
// If there is a download failure, we shouldn't continue activating the extension in some broken state.
|
||||
if (installBlob.hasError) {
|
||||
if (!installSuccess) {
|
||||
return Promise.reject<void>("");
|
||||
}
|
||||
} else {
|
||||
// Notify user's if debugging may not be supported on their OS.
|
||||
util.checkDistro(info);
|
||||
|
||||
if (util.getDebuggerReloadLater()) {
|
||||
util.showReloadPrompt();
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
function checkDistro(channel: vscode.OutputChannel, platformInfo: PlatformInformation): void {
|
||||
if (platformInfo.platform != 'win32' && platformInfo.platform != 'linux' && platformInfo.platform != 'darwin') {
|
||||
// this should never happen because VSCode doesn't run on FreeBSD
|
||||
// or SunOS (the other platforms supported by node)
|
||||
channel.appendLine(`Warning: Debugging has not been tested for this platform. ${util.getReadmeMessage()}`);
|
||||
return finalizeExtensionActivation();
|
||||
}
|
||||
}
|
||||
|
||||
function rewriteManifest(installBlob: InstallBlob): Promise<void> {
|
||||
installBlob.stage = "rewriteManifest";
|
||||
async function finalizeExtensionActivation(): Promise<void> {
|
||||
const cpptoolsJsonFile: string = util.getExtensionFilePath("cpptools.json");
|
||||
|
||||
try {
|
||||
const exists: boolean = await util.checkFileExists(cpptoolsJsonFile);
|
||||
if (exists) {
|
||||
const cpptoolsString: string = await util.readFileText(cpptoolsJsonFile);
|
||||
await cpptoolsJsonUtils.processCpptoolsJson(cpptoolsString);
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignore any cpptoolsJsonFile errors
|
||||
}
|
||||
|
||||
getTemporaryCommandRegistrarInstance().activateLanguageServer();
|
||||
|
||||
// Redownload cpptools.json after activation so it's not blocked.
|
||||
// It'll be used after the extension reloads.
|
||||
return cpptoolsJsonUtils.downloadCpptoolsJsonPkg();
|
||||
}
|
||||
|
||||
function rewriteManifest(): Promise<void> {
|
||||
// Replace activationEvents with the events that the extension should be activated for subsequent sessions.
|
||||
util.packageJson.activationEvents = [
|
||||
"onLanguage:cpp",
|
||||
|
||||
@@ -17,6 +17,7 @@ import * as util from './common';
|
||||
import { PlatformInformation } from './platform';
|
||||
import * as Telemetry from './telemetry';
|
||||
import { IncomingMessage, ClientRequest } from 'http';
|
||||
import { Logger } from './logger';
|
||||
|
||||
export interface IPackage {
|
||||
// Description of the package
|
||||
@@ -66,7 +67,7 @@ export class PackageManager {
|
||||
|
||||
public constructor(
|
||||
private platformInfo: PlatformInformation,
|
||||
private outputChannel?: vscode.OutputChannel,
|
||||
private outputChannel?: Logger,
|
||||
private statusItem?: vscode.StatusBarItem) {
|
||||
// Ensure our temp files get cleaned up in case of error
|
||||
tmp.setGracefulCleanup();
|
||||
@@ -179,7 +180,7 @@ export class PackageManager {
|
||||
});
|
||||
}).then(() => {
|
||||
this.AppendLineChannel(" Done!");
|
||||
if (retryCount != 0) {
|
||||
if (retryCount !== 0) {
|
||||
// Log telemetry to see if retrying helps.
|
||||
let telemetryProperties: { [key: string]: string } = {};
|
||||
telemetryProperties["success"] = `OnRetry${retryCount}`;
|
||||
@@ -215,19 +216,19 @@ export class PackageManager {
|
||||
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let secondsDelay: number = Math.pow(2, delay);
|
||||
if (secondsDelay == 1) {
|
||||
if (secondsDelay === 1) {
|
||||
secondsDelay = 0;
|
||||
}
|
||||
if (secondsDelay > 4) {
|
||||
this.AppendChannel(`Waiting ${secondsDelay} seconds...`);
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!pkg.tmpFile || pkg.tmpFile.fd == 0) {
|
||||
if (!pkg.tmpFile || pkg.tmpFile.fd === 0) {
|
||||
return reject(new PackageManagerError('Temporary Package file unavailable', 'DownloadFile', pkg));
|
||||
}
|
||||
|
||||
let handleHttpResponse: (response: IncomingMessage) => void = (response: IncomingMessage) => {
|
||||
if (response.statusCode == 301 || response.statusCode == 302) {
|
||||
if (response.statusCode === 301 || response.statusCode === 302) {
|
||||
// Redirect - download from new location
|
||||
let redirectUrl: string | string[];
|
||||
if (typeof response.headers.location === "string") {
|
||||
@@ -236,7 +237,7 @@ export class PackageManager {
|
||||
redirectUrl = response.headers.location[0];
|
||||
}
|
||||
return resolve(this.DownloadFile(redirectUrl, pkg, 0));
|
||||
} else if (response.statusCode != 200) {
|
||||
} else if (response.statusCode !== 200) {
|
||||
// Download failed - print error message
|
||||
let errorMessage: string = `failed (error code '${response.statusCode}')`;
|
||||
return reject(new PackageManagerWebResponseError(response.socket, 'HTTP/HTTPS Response Error', 'DownloadFile', pkg, errorMessage, response.statusCode.toString()));
|
||||
@@ -306,7 +307,7 @@ export class PackageManager {
|
||||
this.SetStatusTooltip(`Installing package '${pkg.description}'`);
|
||||
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (!pkg.tmpFile || pkg.tmpFile.fd == 0) {
|
||||
if (!pkg.tmpFile || pkg.tmpFile.fd === 0) {
|
||||
return reject(new PackageManagerError('Downloaded file unavailable', 'InstallPackage', pkg));
|
||||
}
|
||||
|
||||
@@ -357,7 +358,7 @@ export class PackageManager {
|
||||
});
|
||||
} else {
|
||||
// Skip the message for text files, because there is a duplicate text file unzipped.
|
||||
if (path.extname(absoluteEntryPath) != ".txt") {
|
||||
if (path.extname(absoluteEntryPath) !== ".txt") {
|
||||
this.AppendLineChannel(`Warning: File '${absoluteEntryPath}' already exists and was not updated.`);
|
||||
}
|
||||
zipfile.readEntry();
|
||||
|
||||
@@ -69,4 +69,4 @@ export class PlatformInformation {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as assert from 'assert';
|
||||
|
||||
suite(`Debug Integration Test: `, function() {
|
||||
suiteSetup(async function() {
|
||||
let extension = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
}
|
||||
});
|
||||
|
||||
test("Starting (gdb) Launch from the workspace root should create an Active Debug Session", async () => {
|
||||
await vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], "(gdb) Launch");
|
||||
|
||||
let debugSessionTerminated = new Promise(resolve => {
|
||||
vscode.debug.onDidTerminateDebugSession((e) => resolve());
|
||||
});
|
||||
|
||||
assert.equal(vscode.debug.activeDebugSession.type, "cppdbg");
|
||||
|
||||
await debugSessionTerminated;
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All Rights Reserved.
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
import * as fs from "fs";
|
||||
import * as path from 'path';
|
||||
|
||||
import { subscribeToAllLoggers } from "../../src/logger";
|
||||
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// This file is providing the test runner to use when running extension tests.
|
||||
// By default the test runner in use is Mocha based.
|
||||
//
|
||||
// You can provide your own test runner if you want to override it by exporting
|
||||
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
|
||||
// host can call to run the tests. The test runner is expected to use console.log
|
||||
// to report the results back to the caller. When the tests are finished, return
|
||||
// a possible error to the callback or null if none.
|
||||
|
||||
var testRunner = require('vscode/lib/testrunner');
|
||||
|
||||
// You can directly control Mocha options by uncommenting the following lines
|
||||
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
||||
testRunner.configure({
|
||||
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
|
||||
useColors: true, // colored output from test results
|
||||
timeout: 60000
|
||||
});
|
||||
|
||||
const logFolder = path.join( __dirname, ".logs")
|
||||
|
||||
if (!fs.existsSync(logFolder)) {
|
||||
fs.mkdirSync(logFolder);
|
||||
}
|
||||
const logFilePath = path.join(logFolder, "integrationTests.log");
|
||||
subscribeToAllLoggers(message => fs.appendFileSync(logFilePath, message));
|
||||
|
||||
module.exports = testRunner;
|
||||
@@ -0,0 +1,2 @@
|
||||
program
|
||||
program.exe
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "(gdb) Launch",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}/program",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": true,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/bin/gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"windows": {
|
||||
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe"
|
||||
},
|
||||
"osx": {
|
||||
"miDebuggerPath": "/usr/bin/lldb"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"tasks": [
|
||||
{
|
||||
"taskName": "build",
|
||||
"command": "g++",
|
||||
"isShellCommand": true,
|
||||
"args": ["main.cpp", "-g", "-o", "program"],
|
||||
"showOutput": "always",
|
||||
"isBuildCommand": true,
|
||||
"windows": {
|
||||
"command": "C:\\MinGW\\bin\\g++.exe"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
int main(int argc, char* arv[]) {
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
path = require('path');
|
||||
|
||||
if (process.env.CODE_TESTS_PATH
|
||||
&& process.env.CODE_TESTS_PATH.startsWith('.')){
|
||||
process.env.CODE_TESTS_PATH = path.join(process.cwd(), process.env.CODE_TESTS_PATH.substr(2));
|
||||
}
|
||||
|
||||
require(path.resolve(__dirname, '../node_modules/vscode/bin/test'));
|
||||
@@ -13,6 +13,8 @@
|
||||
"one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace", "check-whitespace"],
|
||||
"promise-must-complete": true,
|
||||
"semicolon": true,
|
||||
"triple-equals": true,
|
||||
"type-literal-delimiter": true,
|
||||
"typedef": [true, "variable-declaration", "call-signature"],
|
||||
"whitespace": [true, "check-branch", "check-operator", "check-separator", "check-preblock", "check-type"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user