diff --git a/Documentation/Debugger/How To Debug MIEngine.md b/Documentation/Debugger/How To Debug MIEngine.md index 79b19f74e0..f69cc3d6eb 100644 --- a/Documentation/Debugger/How To Debug MIEngine.md +++ b/Documentation/Debugger/How To Debug MIEngine.md @@ -15,12 +15,13 @@ You can open the solution file **MIDebugEngine.sln** located under **src** and c * Microsoft.MIDebugEngine.dll * vscode\OpenDebugAD7.exe * vscode\Microsoft.DebugEngineHost.dll +* vscode\Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.dll The symbol files are as follows: **On Windows** * Microsoft.MICore.pdb -* Microsoft.MIDebugEngine.dll +* Microsoft.MIDebugEngine.pdb * vscode\OpenDebugAD7.pdb * vscode\Microsoft.DebugEngineHost.pdb @@ -51,11 +52,13 @@ This will cause the debugger to look like it has hung once you start debugging, ### Debugging MIEngine running on Linux or Mac OS X +#### With MonoDevelop + On Linux and Mac OS X, we use `mono` as our framework. You can download Xamarin Studio v5.10.1.6 and remotely attach to your Mac or Linux box to debug there. -#### Install Prerequisites -1. Install [GTK](http://www.mono-project.com/download/) -2. Install [Xamarin Studio v5.10.1.6](http://download.xamarin.com/studio/Windows/XamarinStudio-5.10.1.6-0.msi) +##### Install Prerequisites +1. Install [GTK](http://www.mono-project.com/download/). +2. Install [Xamarin Studio v5.10.1.6](http://download.xamarin.com/studio/Windows/XamarinStudio-5.10.1.6-0.msi). Remote attach functionality behind a flag. You can run it like this: ```PowerShell @@ -64,26 +67,60 @@ set MONODEVELOP_SDB_TEST=1 MonoDevelop.exe ``` -#### Create an empty project for attaching (one-time setup) +##### Create an empty project for attaching (one-time setup) -1. Launch MonoDevelop -2. File -> New Solution -3. Misc/Generic Project -4. Name project and hit "Create" -5. Right-click the project node (blue square) and do "Options" +1. Launch MonoDevelop. +2. File -> New Solution. +3. Misc/Generic Project. +4. Name project and hit "Create". +5. Right-click the project node (blue square) and do "Options". 6. Under Run -> Custom Commands, select "Execute" in the lower dropdown and choose a command (I use `c:\windows\notepad.exe` - it doesn't matter what the command is, but MonoDevelop requires it to exist before it'll light up the Run menu). -#### Configure the extension to enable remote debugging +##### Configure the extension to enable remote debugging Open the **~/.vscode/extensions/ms-vscode.cpptools-\/debugAdapters/OpenDebugAD7** file with a text editor and locate and uncomment the line at the bottom. When you start debugging, it will now hang until the remote debugger is attached from Xamarin Studio. -#### Attach the remote debugger +##### Attach the remote debugger -In MonoDevelop: Run -> Run With -> Custom Command Mono Soft Debugger -Fill in the IP and port of the Linux/Mac OS X machine and hit "Connect" to start debugging +In MonoDevelop: Run -> Run With -> Custom Command Mono Soft Debugger. +Fill in the IP and port of the Linux/Mac OS X machine and hit "Connect" to start debugging. After you've done this once, you can hit the MonoDevelop "Play" button or F5 to bring up the connect dialog again. -Note: If you are debugging to CentOS, you will need to make an exception in the firewall +#### With VS Code + Mono Debug + +##### Install Prerequisites +1. Install [VS Code](https://code.visualstudio.com/Download). +2. Install Mono Debug extension for VS Code. + +##### Create an empty project (one-time setup) +1. Open to a new folder and create `.vscode/launch.json`. +2. Create the following configuration in launch.json. +``` +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Mono", + "request": "attach", + "type": "mono", + "address": "", + "port": 1234 + } + ] +} +``` + +##### Configure the extension to enable remote debugging + +Open the **~/.vscode/extensions/ms-vscode.cpptools-\/debugAdapters/OpenDebugAD7** file with a text editor and locate and uncomment the line at the bottom. When you start debugging, it will now hang until the remote debugger is attached from VS Code. + +##### Attach the remote debugger + +Select the `Attach to Mono` configuration and hit F5. + +#### Additional Notes + +Note: If you are debugging to CentOS, you will need to make an exception in the firewall. * `sudo firewall-cmd --zone=public --add-port=1234/tcp --permanent` * `sudo firewall-cmd --reload` diff --git a/Documentation/FAQs.md b/Documentation/FAQs.md index b7535a3ac4..19c675227c 100644 --- a/Documentation/FAQs.md +++ b/Documentation/FAQs.md @@ -23,7 +23,7 @@ When you start debugging, if it is showing that your breakpoints aren't bound (s ### Debugging starts but all the lines in my stack trace are grey -If your debugger is showing a grey stacktrace or won't stop at a breakpoint,or the symbols in the call stack are grey then your executable was compiled without [debug symbols](#how-to-enable-debug-symbols). +If your debugger is showing a grey stacktrace or won't stop at a breakpoint, or the symbols in the call stack are grey then your executable was compiled without [debug symbols](#how-to-enable-debug-symbols). ## How to enable debug symbols? diff --git a/Documentation/LanguageServer/MinGW.md b/Documentation/LanguageServer/MinGW.md index 2030efa165..a56d535fce 100644 --- a/Documentation/LanguageServer/MinGW.md +++ b/Documentation/LanguageServer/MinGW.md @@ -20,6 +20,12 @@ When you set the `compilerPath` property and change `intelliSenseMode` to `clang } ``` +Replace "gcc.exe" with whatever compiler you're using, e.g. "g++.exe", "clang-5.0.exe", etc. -- just make sure the file is a valid Windows executable (not a 0 size symlink). + +For Cygwin, set the `compilerPath` to the appropriate Cygwin path, e.g. "C:/cygwin64/bin/g++.exe". + +If it seems like the `compilerPath` is not getting used, you can debug the issue via [enabling logging](Enabling%20logging.md). + ## Extension version 0.16.1 and earlier: If you have an older version of the C/C++ extension installed, use [these instructions](Archive/MinGW.md) instead. diff --git a/Extension/.vscode/launch.json b/Extension/.vscode/launch.json index 022eaed81c..8aafc7deee 100644 --- a/Extension/.vscode/launch.json +++ b/Extension/.vscode/launch.json @@ -15,7 +15,7 @@ "outFiles": [ "${workspaceFolder}/out/**/*.js" ], - "preLaunchTask": "compile", + "preLaunchTask": "TypeScript Compile", }, { "name": "Launch Tests", @@ -31,7 +31,7 @@ "outFiles": [ "${workspaceFolder}/out/test/**/*.js" ], - "preLaunchTask": "compile" + "preLaunchTask": "TypeScript Compile" }, { "name": "Node Attach", diff --git a/Extension/.vscode/tasks.json b/Extension/.vscode/tasks.json index bcf5503854..13b233108a 100644 --- a/Extension/.vscode/tasks.json +++ b/Extension/.vscode/tasks.json @@ -5,7 +5,6 @@ "tasks": [ { "label": "TypeScript Compile", - "identifier": "compile", "group": { "kind": "build", "isDefault": true @@ -29,7 +28,6 @@ }, { "label": "TypeScript Lint", - "identifier": "tslint", "group": "build", "isBackground": false, "type": "shell", @@ -53,7 +51,7 @@ ] }, "dependsOn": [ - "compile" + "TypeScript Compile" ] } ] diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index d91e074646..811394644c 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,52 @@ # C/C++ for Visual Studio Code Change Log +## Version 0.21.0 January 17, 2019 +### New Features +* Add documentation comments for hover, completion, and signature help. [#399](https://github.com/Microsoft/vscode-cpptools/issues/399) +* Add completion committing for methods after `(`. [#1184](https://github.com/Microsoft/vscode-cpptools/issues/1184) +* Add macro expansions to hover. [#1734](https://github.com/Microsoft/vscode-cpptools/issues/1734) +* Add support for `__int128_t` and `__uint128_t` types. [#1815](https://github.com/Microsoft/vscode-cpptools/issues/1815) +* Add Italian translations for command titles. + * Julien Russo (@Dotpys) [PR #2663](https://github.com/Microsoft/vscode-cpptools/pull/2663) +* Add icons for operators, structs/unions, enum values, template arguments, and macros. [#2849](https://github.com/Microsoft/vscode-cpptools/issues/2849) +* Change `#include` completion to show individual folders instead of the entire paths, fixing previous performance problems. [#2836](https://github.com/Microsoft/vscode-cpptools/issues/2836) +* Add text `(declaration)`, `(typedef)`, `(type alias)`, and `(union)` to symbols. [#2851](https://github.com/Microsoft/vscode-cpptools/issues/2851) +* Add a refresh button to the `Attach to Process` picker. [#2885](https://github.com/Microsoft/vscode-cpptools/issues/2885) + * Matt Bise (@mbise1993) [PR #2895](https://github.com/Microsoft/vscode-cpptools/pull/2895) +* Add completion committing for templates after `<`. [#2953](https://github.com/Microsoft/vscode-cpptools/issues/2953) + +### Bug Fixes +* Add the Microsoft digital signature to Windows binaries to avoid getting incorrectly flagged by virus scanners. [#1103](https://github.com/Microsoft/vscode-cpptools/issues/1103), [#2970](https://github.com/Microsoft/vscode-cpptools/issues/2970) +* Fix bugs when UTF-8 characters > 1 byte are used. [#1504](https://github.com/Microsoft/vscode-cpptools/issues/1504), [#1525](https://github.com/Microsoft/vscode-cpptools/issues/1525), [#2034](https://github.com/Microsoft/vscode-cpptools/issues/2034), [#2082](https://github.com/Microsoft/vscode-cpptools/issues/2082), [#2883](https://github.com/Microsoft/vscode-cpptools/issues/2883) +* Fix some IntelliSense process crashes. [#1785](https://github.com/Microsoft/vscode-cpptools/issues/1785), [#2913](https://github.com/Microsoft/vscode-cpptools/issues/2913) +* Fix several incorrect IntelliSense error squiggles. [#1942](https://github.com/Microsoft/vscode-cpptools/issues/1942), [#2422](https://github.com/Microsoft/vscode-cpptools/issues/2422), [#2474](https://github.com/Microsoft/vscode-cpptools/issues/2474), [#2478](https://github.com/Microsoft/vscode-cpptools/issues/2478), [#2597](https://github.com/Microsoft/vscode-cpptools/issues/2597), [#2763](https://github.com/Microsoft/vscode-cpptools/issues/2763) +* Fix some main process crashes. [#2505](https://github.com/Microsoft/vscode-cpptools/issues/2505), [#2768](https://github.com/Microsoft/vscode-cpptools/issues/2768) +* Fix incorrect IntelliSense error with Mac clang 10.0 libraries. [#2608](https://github.com/Microsoft/vscode-cpptools/issues/2608) +* Fix completion not working in template specializations. [#2620](https://github.com/Microsoft/vscode-cpptools/issues/2620) +* Fix incorrect completions after Enter is used after struct, class, etc. [#2734](https://github.com/Microsoft/vscode-cpptools/issues/2734) +* Fix memory "leak" when parsing a large workspace. [#2737](https://github.com/Microsoft/vscode-cpptools/issues/2737) +* Fix IntelliSense-based `Go to Definition` with overloads that return a template with a default param (e.g. vector) [#2736](https://github.com/Microsoft/vscode-cpptools/issues/2736) +* Fix `Go to Definition` when `__catch()`, `_NO_EXCEPT_DEBUG`, or `_LIBCPP_BEGIN_NAMESPACE_STD` is used. [#2761](https://github.com/Microsoft/vscode-cpptools/issues/2761), [#2766](https://github.com/Microsoft/vscode-cpptools/issues/2766) +* Fix `Go to Definition` when `method(void)` is used. [#2802](https://github.com/Microsoft/vscode-cpptools/issues/2802) +* Fix error `"TypeError: Cannot read property 'map' of undefined at asCompletionResult"`. [#2807](https://github.com/Microsoft/vscode-cpptools/issues/2807) +* Fix quotes around defines not supported for custom configuration providers. [#2820](https://github.com/Microsoft/vscode-cpptools/issues/2820) +* Fix PowerShell bug on Win7. [#2822](https://github.com/Microsoft/vscode-cpptools/issues/2822) +* Fix Tag Parser completion details missing keywords (i.e. `using`, `class`, `#define`, etc.). [#2850](https://github.com/Microsoft/vscode-cpptools/issues/2850) +* Fix problem with empty recursive include paths. [#2855](https://github.com/Microsoft/vscode-cpptools/issues/2855) +* Fix `NullReferenceException` on debugger launch with VS Code Insiders. [#2858](https://github.com/Microsoft/vscode-cpptools/issues/2858), [PR Microsoft/MIEngine#810](https://github.com/Microsoft/MIEngine/pull/810) +* Fix IntelliSense errors with template argument deduction. [#2907](https://github.com/Microsoft/vscode-cpptools/issues/2907), [#2912](https://github.com/Microsoft/vscode-cpptools/issues/2912) +* Retry Insider VSIX downloading with `http.proxySupport` `"off"`. [#2927](https://github.com/Microsoft/vscode-cpptools/issues/2927) +* Fix snippet completions being offered when they shouldn't be. [#2942](https://github.com/Microsoft/vscode-cpptools/issues/2942) +* Set the `editor.wordBasedSuggestions` to `false` by default to prevent incorrect completions. [#2943](https://github.com/Microsoft/vscode-cpptools/issues/2943) +* Fix IntelliSense-based `Go to Definition` for functions with function pointer parameters. [#2981](https://github.com/Microsoft/vscode-cpptools/issues/2981) +* Fix `<` incorrectly triggering completions. [#2985](https://github.com/Microsoft/vscode-cpptools/issues/2985) +* Fix recursive includes not adding paths used by `forcedInclude` files. [#2986](https://github.com/Microsoft/vscode-cpptools/issues/2986) +* Fix crash when `//` is used in a recursive `includePath`. [#2987](https://github.com/Microsoft/vscode-cpptools/issues/2987) +* Fix compiler in `compile_commands.json` not taking precedence over the `Cpp.default.compilerPath`. [#2793](https://github.com/Microsoft/vscode-cpptools/issues/2793) +* Fix `#include` completion not working for symlinks. [#2843](https://github.com/Microsoft/vscode-cpptools/issues/2843) +* Fix IntelliSense-based `Go to Definition` for `const` methods. [#3014](https://github.com/Microsoft/vscode-cpptools/issues/3014) +* Support `C_Cpp.updateChannel` for VS Code Exploration builds. + ## Version 0.20.1: October 31, 2018 * Fix IntelliSense-based `Go to Declaration` when there's only a definition in a TU. [#2743](https://github.com/Microsoft/vscode-cpptools/issues/2743) * Fix `#include` completion for standalone header files. [#2744](https://github.com/Microsoft/vscode-cpptools/issues/2744) @@ -45,7 +92,7 @@ * Gabriel Arjones (@g-arjones) [PR #2495](https://github.com/Microsoft/vscode-cpptools/pull/2495), [PR #2503](https://github.com/Microsoft/vscode-cpptools/pull/2503) * Fix bug with variable resolution. [#2532](https://github.com/Microsoft/vscode-cpptools/issues/2532) * Fix off-by-one bug with hover and `Go to Definition`. [#2535](https://github.com/Microsoft/vscode-cpptools/issues/2535) -* Fix for [Microsoft/vscode#54213](https://github.com/Microsoft/vscode/issues/54213) +* Fix [Microsoft/vscode#54213](https://github.com/Microsoft/vscode/issues/54213) ## Version 0.18.1: August 17, 2018 * Fix 0.18.0 regression causing non-MinGW compilers to use `-fms-extensions` on Windows. [#2424](https://github.com/Microsoft/vscode-cpptools/issues/2424), [#2425](https://github.com/Microsoft/vscode-cpptools/issues/2425) @@ -109,10 +156,11 @@ * Fix variables not resolving in `macFrameworkPath`. [#2234](https://github.com/Microsoft/vscode-cpptools/issues/2234) * Fix `Go to Definition` not working for macros followed by `.` or `->`. [#2245](https://github.com/Microsoft/vscode-cpptools/issues/2245) * Fix `#include` autocomplete with Mac framework headers. [#2251](https://github.com/Microsoft/vscode-cpptools/issues/2251) -* Fix for debugging to support empty arguments for debuggee. [#2258](https://github.com/Microsoft/vscode-cpptools/issues/2258) +* Fix debugging to support empty arguments for debuggee. [#2258](https://github.com/Microsoft/vscode-cpptools/issues/2258) * Fix `Go to Definition` bug (missing symbols outside the workspace). [#2281](https://github.com/Microsoft/vscode-cpptools/issues/2281) +* Fix incorrect hover in enum definitions. [#2286](https://github.com/Microsoft/vscode-cpptools/issues/2286) * Add a setting to silence configuration provider warnings. [#2292](https://github.com/Microsoft/vscode-cpptools/issues/2292) -* Fix for debugging async Visual C++ causing debugger to hang. +* Fix debugging async Visual C++ causing debugger to hang. * Fix `main` snippet. ## Version 0.17.6: July 2, 2018 @@ -147,9 +195,9 @@ * On Windows, `compilerPath` now populates with the guessed `cl.exe` path, and the `MSVC` include path is based on the `cl.exe` path. * Fix files under a non-recursive `browse.path` being removed from the database. * Fix `*` not working in `browse.path` with WSL. -* Fix for -break-insert main returning multiple bind points. [#729](https://github.com/Microsoft/MIEngine/pull/729) -* Use -- instead of -x for gnome-terminal. [#733](https://github.com/Microsoft/MIEngine/pull/733) -* Added `miDebuggerArgs` in order to pass arguments to the program in `miDebuggerPath`. [#720](https://github.com/Microsoft/MIEngine/pull/720) +* Fix -break-insert main returning multiple bind points. [PR Microsoft/MIEngine#729](https://github.com/Microsoft/MIEngine/pull/729) +* Use -- instead of -x for gnome-terminal. [PR Microsoft/MIEngine#733](https://github.com/Microsoft/MIEngine/pull/733) +* Added `miDebuggerArgs` in order to pass arguments to the program in `miDebuggerPath`. [PR Microsoft/MIEngine#720](https://github.com/Microsoft/MIEngine/pull/720) ## Version 0.17.4: May 31, 2018 * Fix infinite loop (caused by deadlock) when using recursive includes. [#2043](https://github.com/Microsoft/vscode-cpptools/issues/2043) @@ -254,9 +302,9 @@ * Add `C_Cpp.exclusionPolicy` default to `checkFolders` to avoid expensive `files.exclude` checking on every file. ## Version 0.14.5: December 18, 2017 -* Fix for stackwalk `NullReferenceException`. [#1339](https://github.com/Microsoft/vscode-cpptools/issues/1339) -* Fix for `-isystem` (or `-I`) not being used in `compile_commands.json` if there's a space after it. [#1343](https://github.com/Microsoft/vscode-cpptools/issues/1343) -* Fix for header switching from `.cc` to `.hpp` files (and other cases). [#1341](https://github.com/Microsoft/vscode-cpptools/issues/1341) +* Fix stackwalk `NullReferenceException`. [#1339](https://github.com/Microsoft/vscode-cpptools/issues/1339) +* Fix `-isystem` (or `-I`) not being used in `compile_commands.json` if there's a space after it. [#1343](https://github.com/Microsoft/vscode-cpptools/issues/1343) +* Fix header switching from `.cc` to `.hpp` files (and other cases). [#1341](https://github.com/Microsoft/vscode-cpptools/issues/1341) * Fix reload prompts not appearing in debugging scenarios (after the initial installation). [#1344](https://github.com/Microsoft/vscode-cpptools/issues/1344) * Add a "wait" message when commands are invoked during download/installation. [#1344](https://github.com/Microsoft/vscode-cpptools/issues/1344) * Prevent blank "C/C++ Configuration" from appearing when debugging is started but the language service is not. [#1353](https://github.com/Microsoft/vscode-cpptools/issues/1353) @@ -275,9 +323,9 @@ * Improve performance for fetching call stacks with large arguments. [#363](https://github.com/Microsoft/vscode-cpptools/issues/363) ## Version 0.14.3: November 27, 2017 -* Fix for disappearing parameter hints tooltip. [#1165](https://github.com/Microsoft/vscode-cpptools/issues/1165) -* Fix for parameter hints only showing up after the opening parenthesis. [#902](https://github.com/Microsoft/vscode-cpptools/issues/902), [#819](https://github.com/Microsoft/vscode-cpptools/issues/819) -* Fix for customer reported crashes in the TypeScript extension code. [#1240](https://github.com/Microsoft/vscode-cpptools/issues/1240), [#1245](https://github.com/Microsoft/vscode-cpptools/issues/1245) +* Fix disappearing parameter hints tooltip. [#1165](https://github.com/Microsoft/vscode-cpptools/issues/1165) +* Fix parameter hints only showing up after the opening parenthesis. [#902](https://github.com/Microsoft/vscode-cpptools/issues/902), [#819](https://github.com/Microsoft/vscode-cpptools/issues/819) +* Fix customer reported crashes in the TypeScript extension code. [#1240](https://github.com/Microsoft/vscode-cpptools/issues/1240), [#1245](https://github.com/Microsoft/vscode-cpptools/issues/1245) * Fix .browse.VC-#.db files being unnecessarily created when an shm file exists. [#1234](https://github.com/Microsoft/vscode-cpptools/issues/1234) * Fix language service to only activate after a C/C++ file is opened or a C/Cpp command is used (not onDebug). * Fix database resetting if shutdown got blocked by an IntelliSense operation. [#1260](https://github.com/Microsoft/vscode-cpptools/issues/1260) @@ -345,7 +393,7 @@ * Support `${env:VAR}` syntax for environment variables in `c_cpp_properties.json`. [#1000](https://github.com/Microsoft/vscode-cpptools/issues/1000) * Support semicolon delimiters for include paths in `c_cpp_properties.json` to better support environment variables. [#1001](https://github.com/Microsoft/vscode-cpptools/issues/1001) * Add `__LITTLE_ENDIAN__=1` to default defines so that "endian.h" is not needed on Mac projects. [#1005](https://github.com/Microsoft/vscode-cpptools/issues/1005) -* Fix for source code files on Windows with incorrect casing. [#984](https://github.com/Microsoft/vscode-cpptools/issues/984) +* Fix source code files on Windows with incorrect casing. [#984](https://github.com/Microsoft/vscode-cpptools/issues/984) ## Version 0.12.3: August 17, 2017 * Fix regression for paths containing multibyte characters. [#958](https://github.com/Microsoft/vscode-cpptools/issues/958) @@ -381,7 +429,7 @@ * Update Microsoft Visual C++ debugger to Visual Studio 2017 released components. * Fix issue with showing wrong thread. [#550](https://github.com/Microsoft/vscode-cpptools/issues/550) * Fix issue with binaries compiled with /FASTLINK causing debugger to hang. [#484](https://github.com/Microsoft/vscode-cpptools/issues/484) -* Fix issue in MinGW/Cygwin debugging where stop debugging causes VS Code to hang. [Microsoft/MIEngine#636](https://github.com/Microsoft/MIEngine/pull/636) +* Fix issue in MinGW/Cygwin debugging where stop debugging causes VS Code to hang. [PR Microsoft/MIEngine#636](https://github.com/Microsoft/MIEngine/pull/636) ## Version 0.12.0: June 26, 2017 * The default IntelliSense engine now provides semantic-aware autocomplete suggestions for `.`, `->`, and `::` operators. [#13](https://github.com/Microsoft/vscode-cpptools/issues/13) @@ -398,8 +446,8 @@ * Fix `Go to Definition` not working until all `browse.path` files are re-scanned. [#788](https://github.com/Microsoft/vscode-cpptools/issues/788) ## Version 0.11.4: June 2, 2017 -* Fix for `System.Xml.Serialization.XmlSerializationReader threw an exception` when debugging on Linux. [#792](https://github.com/Microsoft/vscode-cpptools/issues/792) -* Fix for escaping for `${workspaceRoot}` in `launch.json`. +* Fix `System.Xml.Serialization.XmlSerializationReader threw an exception` when debugging on Linux. [#792](https://github.com/Microsoft/vscode-cpptools/issues/792) +* Fix escaping for `${workspaceRoot}` in `launch.json`. ## Version 0.11.3: May 31, 2017 * Fix `x86_64-pc-linux-gnu` and `x86_64-linux-gnu` paths missing from the default `includePath`. @@ -447,7 +495,7 @@ ## Version 0.10.5: March 21, 2017 * Fix a crash that randomly occurred when the size of a document increased. [#430](https://github.com/Microsoft/vscode-cpptools/issues/430) -* Fix for browsing not working for Linux/Mac stdlib.h functions. [#578](https://github.com/Microsoft/vscode-cpptools/issues/578) +* Fix browsing not working for Linux/Mac stdlib.h functions. [#578](https://github.com/Microsoft/vscode-cpptools/issues/578) * Additional fixes for switch header/source not respecting `files.exclude`. [#485](https://github.com/Microsoft/vscode-cpptools/issues/485) * Made `editor.quickSuggestions` dependent on `C_Cpp.autocomplete`. [#572](https://github.com/Microsoft/vscode-cpptools/issues/572) * We recommend you close and reopen your settings.json file anytime you change the `C_Cpp.autocomplete` setting. [More info here](https://github.com/Microsoft/vscode-cpptools/releases). diff --git a/Extension/README.md b/Extension/README.md index bdd02a2504..b8be24a4f1 100644 --- a/Extension/README.md +++ b/Extension/README.md @@ -2,7 +2,7 @@ This preview release of the extension adds language support for C/C++ to Visual Studio Code including: * Language service * Code Formatting (clang-format) - * Auto-Completion (experimental) + * Auto-Completion * Symbol Searching * Go to Definition/Declaration * Peek Definition/Declaration diff --git a/Extension/ReleaseNotes.html b/Extension/ReleaseNotes.html index e9718e8103..8eaca692d6 100644 --- a/Extension/ReleaseNotes.html +++ b/Extension/ReleaseNotes.html @@ -205,8 +205,8 @@

Microsoft C/C++ Extension for VS Code

-

October 2018 Update

-
Thank you for installing the C/C++ extension. In the October update, we finished our semantic-aware implementation of Go To Definition. We also added IntegratedTerminal support for debugging.
+

January 2019 Update

+
Thank you for installing the C/C++ extension. In the January update, we added documentation comments for hover, completion, and signature help.

Additional features and bug fixes are detailed in the full release notes.
@@ -231,9 +231,9 @@

Getting Started

Blog Posts

+ -
diff --git a/Extension/assets/Refresh.svg b/Extension/assets/Refresh.svg new file mode 100644 index 0000000000..e034574819 --- /dev/null +++ b/Extension/assets/Refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Extension/assets/Refresh_inverse.svg b/Extension/assets/Refresh_inverse.svg new file mode 100644 index 0000000000..d79fdaa4e8 --- /dev/null +++ b/Extension/assets/Refresh_inverse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Extension/cpp_snippets.json b/Extension/cpp_snippets.json deleted file mode 100644 index ccb7dc811f..0000000000 --- a/Extension/cpp_snippets.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "class": { - "prefix": "class", - "body": "\nclass ${1:${TM_FILENAME_BASE}}\n{\nprivate:\n\t${2:/* data */}\npublic:\n\t${1}(${3:/* args */});\n\t~${1}();\n};\n\n${1}::${1}(${3})\n{\n}\n\n${1}::~${1}()\n{\n}\n", - "description": "Code snippet for class", - "scope": "source.c++, source.objc++" - }, - "classi": { - "prefix": "classi", - "body": "\nclass ${1:${TM_FILENAME_BASE}}\n{\nprivate:\n\t${2:/* data */}\npublic:\n\t${1}(${3:/* args */}) { $0}\n\t~${1}() { }\n};", - "description": "Code snippet for class with inlined constructor/destructor", - "scope": "source.c++, source.objc++" - }, - "classt": { - "prefix": "classt", - "body": "\ntemplate\nclass ${1:${TM_FILENAME_BASE}}\n{\nprivate:\n\tT ${2:/* data */}\npublic:\n\t${1}(T ${3:/* args */});\n};\n", - "description": "Code snippet for class template", - "scope": "source.c++, source.objc++" - }, - "struct": { - "prefix": "struct", - "body": "\nstruct ${1:${TM_FILENAME_BASE}}\n{\n\t${0:/* data */}\n};\n", - "description": "Code snippet for struct", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "union": { - "prefix": "union", - "body": "\nunion ${1:${TM_FILENAME_BASE}}\n{\n\t${0:/* data */}\n};\n", - "description": "Code snippet for union", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "if": { - "prefix": "if", - "body": "\nif (${1:/* condition */}) {\n\t${0:/* code */}\n}\n", - "description": "Code snippet for if()", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "ifel": { - "prefix": "ifel", - "body": "\nif (${1:/* condition */}) {\n\t${2:/* code */}\n}\nelse {\n\t${0:/* code */}\n}\n", - "description": "Code snippet for if() else", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "ifelif": { - "prefix": "ifelif", - "body": "\nif (${1:/* condition */}) {\n\t${2:/* code */}\n}\nelse if(${3:/* condition */}) {\n\t${4:/* code */}\n}\nelse {\n\t${0:/* code */}\n}\n", - "description": "Code snippet for if() else if() else", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "else": { - "prefix": "else", - "body": "\nelse\n{\n\t${0:/* code */}\n}\n", - "description": "Code snippet for else", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "elif": { - "prefix": "elif", - "body": "\nelse if (${1:/* condition */})\n{\n\t${0:/* code */}\n}\n", - "description": "Code snippet for else if ()", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "switch": { - "prefix": "switch", - "body": "\nswitch (${1:expression})\n{\n\tcase ${2:/* constant-expression */}:\n\t\t${3:/* code */}\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n}", - "description": "Code snippet for switch", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "main": { - "prefix": "main", - "body": "main(int argc, char const *argv[])\n{\n\t${1:/* code */}\n\treturn 0;\n}\n", - "description": "Code snippet for main()", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "do": { - "prefix": "do_", - "body": "\ndo\n{\n\t${0:/* code */}\n} while (${1:/* condition */});\n", - "description": "Code snippet for do while loop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "for": { - "prefix": "for", - "body": "\nfor(${1:size_t} ${2:i} = 0; $2 < ${3:count}; ${4:$2++})\n{\n\t${0:/* code */}\n}\n", - "description": "Code snippet for for loop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "forr": { - "prefix": "forr", - "body": "\nfor(int ${1:i} = ${2:length} - 1; $1 >= 0; ${3:$1--})\n{\n\t${0:/* code */}\n}\n", - "description": "Code snippet for reverse for loop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "foreach": { - "prefix": "foreach", - "body": "\nfor(${1:object} = ${2:var} in ${3:collection})\n{\n\t${0:/* code */}\n}\n", - "description": "Code snippet for foreach loop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "forrange": { - "prefix": "forrange", - "body": "\nfor(auto&& ${1:i} : ${2:v})\n{\n\t$0\n}\n", - "description": "Code snippet for range-based forloop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "while": { - "prefix": "while", - "body": "\nwhile(${1:/* condition */}){\n\t${2:/* code */}\n}\n", - "description": "Code snippet for while loop", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "ifd": { - "prefix": "ifnd", - "body": "\n#if defined($1)\n\n${0}\n\n#endif // $1\n", - "description": "Code snippet for if defined()", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "ifnd": { - "prefix": "ifnd", - "body": "\n#if !defined($1)\n#define ${1:MACRO}\n\n${0}\n\n#endif // $1\n", - "description": "Code snippet for if !defined()", - "scope": "source.c, source.objc, source.c++, source.objc++" - }, - "mitl": { - "prefix": "mitl", - "body": "\n// The MIT License (MIT)\n\n// Copyright (c) ${1:YEAR} ${2:NAME}\n\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the \"Software\"),\n// to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense,\n// and/or sell copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\n${0:/* code */}\n", - "description": "Code snippet for MIT License", - "scope": "" - }, - "namesp": { - "prefix": "namesp", - "body": "\nnamespace ${1:name}\n{\n\t$0\n} // $1\n", - "description": "Code snippet for namespace", - "scope": "source.c++, source.objc++" - }, - "try": { - "prefix": "try", - "body": "\ntry\n{\n\t${1:/* code */}\n}\ncatch(${2:const std::exception& e})\n{\n\t${0:std::cerr << e.what() << '\\n';}\n}\n", - "description": "Code snippet for try catch block", - "scope": "source.c++, source.objc++, source.c++11" - } -} diff --git a/Extension/package-lock.json b/Extension/package-lock.json index 8f1748e902..ab00d5abab 100644 --- a/Extension/package-lock.json +++ b/Extension/package-lock.json @@ -4,6 +4,11 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" + }, "@types/mocha": { "version": "2.2.45", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.45.tgz", @@ -20,9 +25,9 @@ "dev": true }, "agent-base": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.1.2.tgz", - "integrity": "sha512-VE6QoEdaugY86BohRtfGmTDabxdU5sCKOkbcPA6PXKJsRzEi/7A3RCTxJal1ft/4qSfPht5/iQLhMh/wzSkkNw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "requires": { "es6-promisify": "^5.0.0" } @@ -410,9 +415,9 @@ } }, "applicationinsights": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.0.5.tgz", - "integrity": "sha512-T6V4ZyhikGKnuqYGbNz1q5+ORROutUp58UqfLLwHH+X1RkcnEU+gW15kIKWJ8zqGWbilhn6bONJa+T5en642mg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.0.6.tgz", + "integrity": "sha512-VQT3kBpJVPw5fCO5n+WUeSx0VHjxFtD7znYbILBlVgOS9/cMDuGFmV2Br3ObzFyZUDGNbEfW36fD1y2/vAiCKw==", "requires": { "diagnostic-channel": "0.2.0", "diagnostic-channel-publishers": "0.2.1", @@ -811,9 +816,9 @@ } }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1582,9 +1587,9 @@ } }, "es6-promise": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.2.tgz", - "integrity": "sha512-LSas5vsuA6Q4nEdf9wokY5/AJYXry98i0IzXsv49rYsgDGDNDPbqAYR1Pe23iFxygfbGZNR/5VrHXBCh2BhvUQ==" + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" }, "es6-promisify": { "version": "5.0.0", @@ -3636,12 +3641,17 @@ }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" } } }, @@ -4006,9 +4016,9 @@ "dev": true }, "jsonc-parser": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-1.0.0.tgz", - "integrity": "sha1-3cyGSucI5gp6bdNtrqABcvqNknI=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-1.0.3.tgz", + "integrity": "sha512-hk/69oAeaIzchq/v3lS50PXuzn5O2ynldopMC+SWBql7J2WtdptfB9dy8Y7+Og5rPkTCpn83zTiO8FMcqlXJ/g==" }, "jsonify": { "version": "0.0.0", @@ -7058,39 +7068,47 @@ "integrity": "sha1-28EOjX2VsQJyehmvPw/O9+JSsI4=" }, "vscode-extension-telemetry": { - "version": "0.0.22", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.22.tgz", - "integrity": "sha512-6/xT3UG6nPcNbBT29RPRJ6uRplI0l1m5ZBX9VXV3XGWrINDvWw2Nk/84xMeWDF1zI1YoPCcjeD0u4gH2OIsrcA==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.0.tgz", + "integrity": "sha512-WVCnP+uLxlqB6UD98yQNV47mR5Rf79LFxpuZhSPhEf0Sb4tPZed3a63n003/dchhOwyCTCBuNN4n8XKJkLEI1Q==", "requires": { - "applicationinsights": "1.0.5" + "applicationinsights": "1.0.6" } }, "vscode-jsonrpc": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz", - "integrity": "sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", + "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" }, "vscode-languageclient": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.1.tgz", - "integrity": "sha512-GTQ+hSq/o4c/y6GYmyP9XNrVoIu0NFZ67KltSkqN+tO0eUNDIlrVNX+3DJzzyLhSsrctuGzuYWm3t87mNAcBmQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-5.1.1.tgz", + "integrity": "sha512-jMxshi+BPRQFNG8GB00dJv7ldqMda0be26laYYll/udtJuHbog6RqK10GSxHWDN0PgY0b0m5fePyTk3bq8a0TA==", "requires": { - "vscode-languageserver-protocol": "3.5.1" + "semver": "^5.5.0", + "vscode-languageserver-protocol": "3.13.0" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } } }, "vscode-languageserver-protocol": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.1.tgz", - "integrity": "sha512-1fPDIwsAv1difCV+8daOrJEGunClNJWqnUHq/ncWrjhitKWXgGmRCjlwZ3gDUTt54yRcvXz1PXJDaRNvNH6pYA==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz", + "integrity": "sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==", "requires": { - "vscode-jsonrpc": "3.5.0", - "vscode-languageserver-types": "3.5.0" + "vscode-jsonrpc": "^4.0.0", + "vscode-languageserver-types": "3.13.0" } }, "vscode-languageserver-types": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz", - "integrity": "sha1-5I15li8LjgLelV4/UkkI4rGcA3Q=" + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz", + "integrity": "sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==" }, "which": { "version": "1.3.0", diff --git a/Extension/package.json b/Extension/package.json index 238654be3a..d977e238e0 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -12,7 +12,7 @@ }, "license": "SEE LICENSE IN LICENSE.txt", "engines": { - "vscode": "^1.23.0" + "vscode": "^1.26.0" }, "bugs": { "url": "https://github.com/Microsoft/vscode-cpptools/issues", @@ -472,88 +472,83 @@ "commands": [ { "command": "C_Cpp.ConfigurationSelect", - "title": "Select a Configuration...", - "category": "C/Cpp" + "title": "%c_cpp.command.configurationSelect.title%", + "category": "C/C++" }, { "command": "C_Cpp.ConfigurationProviderSelect", - "title": "Change Configuration Provider...", - "category": "C/Cpp" + "title": "%c_cpp.command.configurationProviderSelect.title%", + "category": "C/C++" }, { "command": "C_Cpp.ConfigurationEdit", - "title": "Edit Configurations...", - "category": "C/Cpp" + "title": "%c_cpp.command.configurationEdit.title%", + "category": "C/C++" }, { "command": "C_Cpp.GoToDeclaration", - "title": "Go to Declaration", - "category": "C/Cpp" + "title": "%c_cpp.command.goToDeclaration.title%", + "category": "C/C++" }, { "command": "C_Cpp.PeekDeclaration", - "title": "Peek Declaration", - "category": "C/Cpp" + "title": "%c_cpp.command.peekDeclaration.title%", + "category": "C/C++" }, { "command": "C_Cpp.SwitchHeaderSource", - "title": "Switch Header/Source", - "category": "C/Cpp" + "title": "%c_cpp.command.switchHeaderSource.title%", + "category": "C/C++" }, { "command": "C_Cpp.Navigate", - "title": "Navigate...", - "category": "C/Cpp" - }, - { - "command": "C_Cpp.ToggleSnippets", - "title": "Toggle Snippets", - "category": "C/Cpp" + "title": "%c_cpp.command.navigate.title%", + "category": "C/C++" }, { "command": "C_Cpp.ToggleErrorSquiggles", - "title": "Toggle Error Squiggles", - "category": "C/Cpp" + "title": "%c_cpp.command.toggleErrorSquiggles.title%", + "category": "C/C++" }, { "command": "C_Cpp.ToggleIncludeFallback", - "title": "Toggle IntelliSense Engine Fallback on Include Errors", - "category": "C/Cpp" + "title": "%c_cpp.command.toggleIncludeFallback.title%", + "category": "C/C++" }, { "command": "C_Cpp.ToggleDimInactiveRegions", - "title": "Toggle Inactive Region Colorization", - "category": "C/Cpp" + "title": "%c_cpp.command.toggleDimInactiveRegions.title%", + "category": "C/C++" }, { "command": "C_Cpp.ShowReleaseNotes", - "title": "Show Release Notes", - "category": "C/Cpp" + "title": "%c_cpp.command.showReleaseNotes.title%", + "category": "C/C++" }, { "command": "C_Cpp.ResetDatabase", - "title": "Reset IntelliSense Database", - "category": "C/Cpp" + "title": "%c_cpp.command.resetDatabase.title%", + "category": "C/C++" }, { "command": "C_Cpp.PauseParsing", - "title": "Pause Parsing", - "category": "C/Cpp" + "title": "%c_cpp.command.pauseParsing.title%", + "category": "C/C++" }, { "command": "C_Cpp.ResumeParsing", - "title": "Resume Parsing", - "category": "C/Cpp" + "title": "%c_cpp.command.resumeParsing.title%", + "category": "C/C++" }, { "command": "C_Cpp.ShowParsingCommands", - "title": "Show Parsing Commands", - "category": "C/Cpp" + "title": "%c_cpp.command.showParsingCommands.title%", + "category": "C/C++" }, { "command": "C_Cpp.TakeSurvey", - "title": "Take Survey", - "category": "C/Cpp" + "title": "%c_cpp.command.takeSurvey.title%", + "category": "C/C++" } ], "keybindings": [ @@ -728,8 +723,12 @@ "type": "object", "default": {}, "properties": { - "name": "string", - "value": "string" + "name": { + "type": "string" + }, + "value": { + "type": "string" + } } }, "default": [] @@ -801,7 +800,12 @@ }, "externalConsole": { "type": "boolean", - "description": "If true, a console is launched for the debuggee. If false, no console is launched. Note this option is ignored in some cases for technical reasons.", + "description": "If true, a console is launched for the debuggee. If false, on Linux and Windows, it will appear in the Integrated Console.", + "default": false + }, + "avoidWindowsConsoleRedirection": { + "type": "boolean", + "description": "If true, disables debuggee console redirection that is required for Integrated Terminal support.", "default": false }, "sourceFileMap": { @@ -1140,8 +1144,12 @@ "type": "object", "default": {}, "properties": { - "name": "string", - "value": "string" + "name": { + "type": "string" + }, + "value": { + "type": "string" + } } }, "default": [] @@ -1354,22 +1362,12 @@ }, "configurationDefaults": { "[cpp]": { - "editor.autoIndent": false + "editor.wordBasedSuggestions": false }, "[c]": { - "editor.autoIndent": false + "editor.wordBasedSuggestions": false } - }, - "snippets": [ - { - "language": "cpp", - "path": "./cpp_snippets.json" - }, - { - "language": "c", - "path": "./cpp_snippets.json" - } - ] + } }, "scripts": { "compile": "npm run vscode:prepublish", @@ -1402,6 +1400,7 @@ "vscode": "^1.1.18" }, "dependencies": { + "@types/minimatch": "^3.0.3", "http-proxy-agent": "~2.1.0", "https-proxy-agent": "~2.2.0", "jsonc-parser": "^1.0.0", @@ -1411,14 +1410,14 @@ "vscode-cpptools": "2.1.1", "vscode-debugadapter": "~1.24.0", "vscode-debugprotocol": "~1.24.0", - "vscode-extension-telemetry": "~0.0.22", - "vscode-languageclient": "3.5.1", + "vscode-extension-telemetry": "~0.1.0", + "vscode-languageclient": "5.1.1", "yauzl": "~2.8.0" }, "runtimeDependencies": [ { "description": "C/C++ language components (Linux / x86_64)", - "url": "https://go.microsoft.com/fwlink/?linkid=2036673", + "url": "https://go.microsoft.com/fwlink/?linkid=2037608", "platforms": [ "linux" ], @@ -1432,7 +1431,7 @@ }, { "description": "C/C++ language components (Linux / x86)", - "url": "https://go.microsoft.com/fwlink/?linkid=2036672", + "url": "https://go.microsoft.com/fwlink/?linkid=2037526", "platforms": [ "linux" ], @@ -1448,7 +1447,7 @@ }, { "description": "C/C++ language components (OS X)", - "url": "https://go.microsoft.com/fwlink/?linkid=2036674", + "url": "https://go.microsoft.com/fwlink/?linkid=2037527", "platforms": [ "darwin" ], @@ -1459,7 +1458,7 @@ }, { "description": "C/C++ language components (Windows)", - "url": "https://go.microsoft.com/fwlink/?linkid=2036671", + "url": "https://go.microsoft.com/fwlink/?linkid=2037609", "platforms": [ "win32" ], diff --git a/Extension/package.nls.it.json b/Extension/package.nls.it.json new file mode 100644 index 0000000000..e6735b8399 --- /dev/null +++ b/Extension/package.nls.it.json @@ -0,0 +1,18 @@ +{ + "c_cpp.command.configurationSelect.title": "Scegli una configurazione...", + "c_cpp.command.configurationProviderSelect.title": "Cambia provider configurazioni...", + "c_cpp.command.configurationEdit.title": "Modifica configurazioni...", + "c_cpp.command.goToDeclaration.title": "Vai a dichiarazione", + "c_cpp.command.peekDeclaration.title": "Visualizza dichiarazione", + "c_cpp.command.switchHeaderSource.title": "Visualizza Header/Sorgente", + "c_cpp.command.navigate.title": "Naviga...", + "c_cpp.command.toggleErrorSquiggles.title": "Attiva/Disattiva sottolineamento errori", + "c_cpp.command.toggleIncludeFallback.title": "Attiva/Disattiva motore di fallback IntelliSense negli errori di inclusione", + "c_cpp.command.toggleDimInactiveRegions.title": "Attiva/Disattiva colorazione regioni inattive", + "c_cpp.command.showReleaseNotes.title": "Mostra note di rilascio", + "c_cpp.command.resetDatabase.title": "Reimposta il database di IntelliSense", + "c_cpp.command.pauseParsing.title": "Metti in pausa l'analisi del codice", + "c_cpp.command.resumeParsing.title": "Riprendi l'analisi del codice", + "c_cpp.command.showParsingCommands.title": "Mostra comandi per l'analisi del codice", + "c_cpp.command.takeSurvey.title": "Partecipa al Sondaggio" +} \ No newline at end of file diff --git a/Extension/package.nls.json b/Extension/package.nls.json new file mode 100644 index 0000000000..07190b6125 --- /dev/null +++ b/Extension/package.nls.json @@ -0,0 +1,18 @@ +{ + "c_cpp.command.configurationSelect.title": "Select a configuration...", + "c_cpp.command.configurationProviderSelect.title": "Change configuration provider...", + "c_cpp.command.configurationEdit.title": "Edit configurations...", + "c_cpp.command.goToDeclaration.title": "Go to declaration", + "c_cpp.command.peekDeclaration.title": "Peek declaration", + "c_cpp.command.switchHeaderSource.title": "Switch Header/Source", + "c_cpp.command.navigate.title": "Navigate...", + "c_cpp.command.toggleErrorSquiggles.title": "Toggle error squiggles", + "c_cpp.command.toggleIncludeFallback.title": "Toggle IntelliSense engine fallback on include errors", + "c_cpp.command.toggleDimInactiveRegions.title": "Toggle inactive region colorization", + "c_cpp.command.showReleaseNotes.title": "Show release notes", + "c_cpp.command.resetDatabase.title": "Reset IntelliSense database", + "c_cpp.command.pauseParsing.title": "Pause parsing", + "c_cpp.command.resumeParsing.title": "Resume parsing", + "c_cpp.command.showParsingCommands.title": "Show parsing commands", + "c_cpp.command.takeSurvey.title": "Take survey" +} \ No newline at end of file diff --git a/Extension/src/Debugger/attachQuickPick.ts b/Extension/src/Debugger/attachQuickPick.ts new file mode 100644 index 0000000000..914281607f --- /dev/null +++ b/Extension/src/Debugger/attachQuickPick.ts @@ -0,0 +1,70 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All Rights Reserved. + * See 'LICENSE' in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +import * as util from '../common'; +import * as vscode from 'vscode'; + +class RefreshButton implements vscode.QuickInputButton { + get iconPath(): { dark: vscode.Uri; light: vscode.Uri } { + const refreshImagePathDark: string = util.getExtensionFilePath("assets/Refresh_inverse.svg"); + const refreshImagePathLight: string = util.getExtensionFilePath("assets/Refresh.svg"); + + return { + dark: vscode.Uri.file(refreshImagePathDark), + light: vscode.Uri.file(refreshImagePathLight) + }; + } + + get tooltip(): string { + return "Refresh process list"; + } +} + +export interface AttachItem extends vscode.QuickPickItem { + id: string; +} + +export function showQuickPick(getAttachItems: () => Promise): Promise { + return getAttachItems().then(processEntries => { + return new Promise((resolve, reject) => { + let quickPick: vscode.QuickPick = vscode.window.createQuickPick(); + quickPick.title = "Attach to process"; + quickPick.canSelectMany = false; + quickPick.matchOnDescription = true; + quickPick.matchOnDetail = true; + quickPick.placeholder = "Select the process to attach to"; + quickPick.items = processEntries; + quickPick.buttons = [new RefreshButton()]; + + let disposables: vscode.Disposable[] = []; + + quickPick.onDidTriggerButton(button => { + getAttachItems().then(processEntries => quickPick.items = processEntries); + }, undefined, disposables); + + quickPick.onDidAccept(() => { + if (quickPick.selectedItems.length !== 1) { + reject(new Error("Process not selected")); + } + + let selectedId: string = quickPick.selectedItems[0].id; + + disposables.forEach(item => item.dispose()); + quickPick.dispose(); + + resolve(selectedId); + }, undefined, disposables); + + quickPick.onDidHide(() => { + disposables.forEach(item => item.dispose()); + quickPick.dispose(); + + reject(new Error("Process not selected.")); + }, undefined, disposables); + + quickPick.show(); + }); + }); +} diff --git a/Extension/src/Debugger/attachToProcess.ts b/Extension/src/Debugger/attachToProcess.ts index 6dac5a462d..156e90806c 100644 --- a/Extension/src/Debugger/attachToProcess.ts +++ b/Extension/src/Debugger/attachToProcess.ts @@ -5,6 +5,7 @@ import { execChildProcess } from '../common'; import { PsProcessParser } from './nativeAttach'; +import { AttachItem, showQuickPick } from './attachQuickPick'; import * as debugUtils from './utils'; import * as fs from 'fs'; @@ -13,10 +14,6 @@ import * as path from 'path'; import * as util from '../common'; import * as vscode from 'vscode'; -export interface AttachItem extends vscode.QuickPickItem { - id: string; -} - export interface AttachItemsProvider { getAttachItems(): Promise; } @@ -29,19 +26,7 @@ export class AttachPicker { 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(new Error("Process not selected.")); - }); - }); + return showQuickPick(() => this.attachItemsProvider.getAttachItems()); } }); } @@ -74,7 +59,7 @@ export class RemoteAttachPicker { !fs.existsSync(pipeTransport.pipeProgram)) { const pipeProgramStr: string = pipeTransport.pipeProgram.toLowerCase().trim(); const expectedArch: debugUtils.ArchType = debugUtils.ArchType[process.arch]; - + // Check for pipeProgram if (!fs.existsSync(config.pipeTransport.pipeProgram)) { pipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(pipeProgramStr, expectedArch); @@ -84,7 +69,7 @@ export class RemoteAttachPicker { if (!pipeProgram && config.pipeTransport.pipeCwd) { const pipeCwdStr: string = config.pipeTransport.pipeCwd.toLowerCase().trim(); const newPipeProgramStr: string = path.join(pipeCwdStr, pipeProgramStr); - + if (!fs.existsSync(newPipeProgramStr)) { pipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(newPipeProgramStr, expectedArch); } diff --git a/Extension/src/Debugger/nativeAttach.ts b/Extension/src/Debugger/nativeAttach.ts index facc258ab8..0e34e1bf26 100644 --- a/Extension/src/Debugger/nativeAttach.ts +++ b/Extension/src/Debugger/nativeAttach.ts @@ -5,7 +5,8 @@ import * as child_process from 'child_process'; import * as os from 'os'; -import { AttachItem, AttachItemsProvider } from './attachToProcess'; +import { AttachItemsProvider } from './attachToProcess'; +import { AttachItem } from './attachQuickPick'; class Process { constructor(public name: string, public pid: string, public commandLine: string) { } diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 1b0dbd1c7c..a4ba37098a 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -29,6 +29,7 @@ import { SettingsTracker, getTracker } from './settingsTracker'; import { getTestHook, TestHook } from '../testHook'; import { getCustomConfigProviders, CustomConfigurationProviderCollection, CustomConfigurationProvider1 } from '../LanguageServer/customProviders'; import { ABTestSettings, getABTestSettings } from '../abTesting'; +import * as fs from 'fs'; let ui: UI; const configProviderTimeout: number = 2000; @@ -353,6 +354,10 @@ class DefaultClient implements Client { private createLanguageClient(allClients: ClientCollection, workspaceFolder?: vscode.WorkspaceFolder): LanguageClient { let serverModule: string = getLanguageServerFileName(); + let exeExists: boolean = fs.existsSync(serverModule); + if (!exeExists) { + throw String('Missing binary at ' + serverModule); + } let serverName: string = this.getName(workspaceFolder); let serverOptions: ServerOptions = { diff --git a/Extension/src/LanguageServer/clientCollection.ts b/Extension/src/LanguageServer/clientCollection.ts index 76e9f368e3..e14ad626de 100644 --- a/Extension/src/LanguageServer/clientCollection.ts +++ b/Extension/src/LanguageServer/clientCollection.ts @@ -119,7 +119,7 @@ export class ClientCollection { this.languageClients.set(key, cpptools.createNullClient()); } - if (this.activeClient === client) { + if (this.activeClient === client && this.activeDocument) { this.activeClient = this.getClientFor(this.activeDocument.uri); this.activeClient.activeDocumentChanged(this.activeDocument); } @@ -154,7 +154,7 @@ export class ClientCollection { client.TrackedDocuments.forEach(document => this.transferOwnership(document, client)); client.TrackedDocuments.clear(); - if (this.activeClient === client) { + if (this.activeClient === client && this.activeDocument) { // Need to make a different client the active client. this.activeClient = this.getClientFor(this.activeDocument.uri); this.activeClient.activeDocumentChanged(this.activeDocument); diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index b754670240..ae9df20d3c 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -22,6 +22,7 @@ import { Range } from 'vscode-languageclient'; import { ChildProcess, spawn, execSync } from 'child_process'; import * as tmp from 'tmp'; import { getTargetBuildInfo } from '../githubAPI'; +import { PackageVersion } from '../packageVersion'; let prevCrashFile: string; let clients: ClientCollection; @@ -239,9 +240,11 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise const vsCodeScriptPath: string = function(platformInfo): string { if (platformInfo.platform === 'win32') { const vsCodeBinName: string = path.basename(process.execPath); - let cmdFile: string; // Windows VS Code Insiders breaks VS Code naming conventions + let cmdFile: string; // Windows VS Code Insiders/Exploration breaks VS Code naming conventions if (vsCodeBinName === 'Code - Insiders.exe') { cmdFile = 'code-insiders.cmd'; + } else if (vsCodeBinName === 'Code - Exploration.exe') { + cmdFile = 'code-exploration.cmd'; } else { cmdFile = 'code.cmd'; } @@ -264,7 +267,25 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise return Promise.reject(new Error('Failed to find VS Code script')); } - // Install the VSIX + // 1.28.0 changes the CLI for making installations + let userVersion: PackageVersion = new PackageVersion(vscode.version); + let breakingVersion: PackageVersion = new PackageVersion('1.28.0'); + if (userVersion.isGreaterThan(breakingVersion, 'insider')) { + return new Promise((resolve, reject) => { + let process: ChildProcess; + try { + process = spawn(vsCodeScriptPath, ['--install-extension', vsixLocation, '--force']); + if (process.pid === undefined) { + throw new Error(); + } + } catch (error) { + reject(new Error('Failed to launch VS Code script process for installation')); + return; + } + resolve(); + }); + } + return new Promise((resolve, reject) => { let process: ChildProcess; try { @@ -280,8 +301,8 @@ async function installVsix(vsixLocation: string, updateChannel: string): Promise // Timeout the process if no response is sent back. Ensures this Promise resolves/rejects const timer: NodeJS.Timer = setTimeout(() => { process.kill(); - reject(new Error('Failed to receive response from VS Code script process for installation within 10s.')); - }, 10000); + reject(new Error('Failed to receive response from VS Code script process for installation within 30s.')); + }, 30000); // If downgrading, the VS Code CLI will prompt whether the user is sure they would like to downgrade. // Respond to this by writing 0 to stdin (the option to override and install the VSIX package) @@ -325,11 +346,33 @@ async function checkAndApplyUpdate(updateChannel: string): Promise { // then the .catch call will return a resolved promise // Thusly, the .catch call must also throw, as a return would simply return an unused promise // instead of returning early from this function scope + let config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(); + let originalProxySupport: string = config.inspect('http.proxySupport').globalValue; + while (true) { // Might need to try again with a different http.proxySupport setting. + try { + await util.downloadFileToDestination(buildInfo.downloadUrl, vsixPath); + } catch { + // Try again with the proxySupport to "off". + if (originalProxySupport !== config.inspect('http.proxySupport').globalValue) { + config.update('http.proxySupport', originalProxySupport, true); // Reset the http.proxySupport. + reject(new Error('Failed to download VSIX package with proxySupport off')); // Changing the proxySupport didn't help. + return; + } + if (config.get('http.proxySupport') !== "off" && originalProxySupport !== "off") { + config.update('http.proxySupport', "off", true); + continue; + } + reject(new Error('Failed to download VSIX package')); + return; + } + if (originalProxySupport !== config.inspect('http.proxySupport').globalValue) { + config.update('http.proxySupport', originalProxySupport, true); // Reset the http.proxySupport. + telemetry.logLanguageServerEvent('installVsix', { 'error': "Success with proxySupport off", 'success': 'true' }); + } + break; + } try { - await util.downloadFileToDestination(buildInfo.downloadUrl, vsixPath) - .catch(() => { throw new Error('Failed to download VSIX package'); }); - await installVsix(vsixPath, updateChannel) - .catch((error: Error) => { throw error; }); + await installVsix(vsixPath, updateChannel); } catch (error) { reject(error); return; @@ -371,7 +414,6 @@ function registerCommands(): void { disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationEdit', onEditConfiguration)); disposables.push(vscode.commands.registerCommand('C_Cpp.AddToIncludePath', onAddToIncludePath)); disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleErrorSquiggles', onToggleSquiggles)); - disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleSnippets', onToggleSnippets)); disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', onToggleIncludeFallback)); disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', onToggleDimInactiveRegions)); disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReleaseNotes', onShowReleaseNotes)); @@ -518,47 +560,6 @@ function onToggleSquiggles(): void { settings.toggleSetting("errorSquiggles", "Enabled", "Disabled"); } -function onToggleSnippets(): void { - onActivationEvent(); - - // This will apply to all clients as it's a global toggle. It will require a reload. - const snippetsCatName: string = "Snippets"; - let newPackageJson: any = util.getRawPackageJson(); - - if (newPackageJson.categories.findIndex(cat => cat === snippetsCatName) === -1) { - // Add the Snippet category and snippets node. - - newPackageJson.categories.push(snippetsCatName); - newPackageJson.contributes.snippets = [{"language": "cpp", "path": "./cpp_snippets.json"}, {"language": "c", "path": "./cpp_snippets.json"}]; - - fs.writeFile(util.getPackageJsonPath(), util.stringifyPackageJson(newPackageJson), () => { - showReloadPrompt("Reload Window to finish enabling C++ snippets"); - }); - - } else { - // Remove the category and snippets node. - let ndxCat: number = newPackageJson.categories.indexOf(snippetsCatName); - if (ndxCat !== -1) { - newPackageJson.categories.splice(ndxCat, 1); - } - - delete newPackageJson.contributes.snippets; - - fs.writeFile(util.getPackageJsonPath(), util.stringifyPackageJson(newPackageJson), () => { - showReloadPrompt("Reload Window to finish disabling C++ snippets"); - }); - } -} - -function showReloadPrompt(msg: string): void { - let reload: string = "Reload"; - vscode.window.showInformationMessage(msg, reload).then(value => { - if (value === reload) { - vscode.commands.executeCommand("workbench.action.reloadWindow"); - } - }); - } - function onToggleIncludeFallback(): void { onActivationEvent(); // This only applies to the active client. @@ -645,32 +646,66 @@ function reportMacCrashes(): void { } } -function handleCrashFileRead(err: NodeJS.ErrnoException, data: string): void { +function logCrashTelemetry(data: string): void { let crashObject: { [key: string]: string } = {}; + crashObject["CrashingThreadCallStack"] = data; + telemetry.logLanguageServerEvent("MacCrash", crashObject, null); +} + +function handleCrashFileRead(err: NodeJS.ErrnoException, data: string): void { if (err) { - crashObject["readFile: err.code"] = err.code; - telemetry.logLanguageServerEvent("MacCrash", crashObject, null); - return; + return logCrashTelemetry("readFile: " + err.code); } - let startCrash: number = data.indexOf(" Crashed:"); + + // Extract the crashing thread's call stack. + const crashStart: string = " Crashed:"; + let startCrash: number = data.indexOf(crashStart); if (startCrash < 0) { - startCrash = 0; + return logCrashTelemetry("No crash start"); } + startCrash += crashStart.length + 1; // Skip past crashStart. let endCrash: number = data.indexOf("Thread ", startCrash); - if (endCrash < startCrash) { - endCrash = data.length - 1; + if (endCrash < 0) { + endCrash = data.length - 1; // Not expected, but just in case. + } + if (endCrash <= startCrash) { + return logCrashTelemetry("No crash end"); } data = data.substr(startCrash, endCrash - startCrash); + + // Get rid of the memory addresses (which breaks being able get a hit count for each crash call stack). + data = data.replace(/0x................ /g, ""); + + // Get rid of the process names on each line and just add it to the start. + const process1: string = "Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin\t"; + const process2: string = "Microsoft.VSCode.CPP.Extension.darwin\t"; + if (data.includes(process1)) { + data = data.replace(new RegExp(process1, "g"), ""); + data = process1 + "\n" + data; + } else if (data.includes(process2)) { + data = data.replace(new RegExp(process2, "g"), ""); + data = process2 + "\n" + data; + } else { + return logCrashTelemetry("No process"); // Not expected, but just in case. + } + + // Remove runtime lines because they can be different on different machines. + let lines: string[] = data.split("\n"); + data = ""; + lines.forEach((line: string) => { + if (!line.includes(".dylib") && !line.includes("???")) { + line = line.replace(/^\d+\s+/, ""); // Remove from the start of the line. + line = line.replace(/std::__1::/g, "std::"); // __1:: is not helpful. + data += (line + "\n"); + } + }); + data = data.trimRight(); + if (data.length > 8192) { // The API has an 8k limit. data = data.substr(0, 8189) + "..."; } - if (data.length < 2) { - return; // Don't send telemetry if there's no call stack. - } - // Get rid of the memory addresses (which breaks being able get a hit count for each crash call stack). - data = data.replace(/0x................ /g, ""); - crashObject["CrashingThreadCallStack"] = data; - telemetry.logLanguageServerEvent("MacCrash", crashObject, null); + + logCrashTelemetry(data); } export function deactivate(): Thenable { diff --git a/Extension/src/LanguageServer/protocolFilter.ts b/Extension/src/LanguageServer/protocolFilter.ts index 70581380b9..d81b39b6d8 100644 --- a/Extension/src/LanguageServer/protocolFilter.ts +++ b/Extension/src/LanguageServer/protocolFilter.ts @@ -47,7 +47,7 @@ export function createProtocolFilter(me: Client, clients: ClientCollection): Mid } }, - provideCompletionItem: invoke3, + provideCompletionItem: invoke4, resolveCompletionItem: invoke2, provideHover: invoke3, provideSignatureHelp: invoke3, diff --git a/Extension/src/commands.ts b/Extension/src/commands.ts index de78bfe03b..de94515aa9 100644 --- a/Extension/src/commands.ts +++ b/Extension/src/commands.ts @@ -24,7 +24,6 @@ class TemporaryCommandRegistrar { "C_Cpp.ToggleErrorSquiggles", "C_Cpp.ToggleIncludeFallback", "C_Cpp.ToggleDimInactiveRegions", - "C_Cpp.ToggleSnippets", "C_Cpp.ShowReleaseNotes", "C_Cpp.ResetDatabase", "C_Cpp.PauseParsing", diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 8a4a809cf5..b0729d01a3 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -167,8 +167,16 @@ export function getProgressExecutableSuccess(): number { return progressExecutab export function getProgressParseRootSuccess(): number { return progressParseRootSuccess; } // Parse root was successful (i.e. not blocked by processing taking too long). export function getProgressIntelliSenseNoSquiggles(): number { return progressIntelliSenseNoSquiggles; } // IntelliSense was successful and the user got no squiggles. -export function showReleaseNotes(): void { - vscode.commands.executeCommand('vscode.previewHtml', vscode.Uri.file(getExtensionFilePath("ReleaseNotes.html")), vscode.ViewColumn.One, "C/C++ Extension Release Notes"); +let releaseNotesPanel: vscode.WebviewPanel = undefined; + +export async function showReleaseNotes(): Promise { + if (releaseNotesPanel) { + releaseNotesPanel.reveal(); + } else { + releaseNotesPanel = vscode.window.createWebviewPanel('releaseNotes', "C/C++ Extension Release Notes", vscode.ViewColumn.One); + releaseNotesPanel.webview.html = await readFileText(getExtensionFilePath("ReleaseNotes.html")); + releaseNotesPanel.onDidDispose(() => releaseNotesPanel = undefined, null, extensionContext.subscriptions); + } } export function isUri(input: any): input is vscode.Uri { @@ -622,10 +630,10 @@ export function downloadFileToDestination(urlStr: string, destinationPath: strin // Write file using downloaded data let createdFile: fs.WriteStream = fs.createWriteStream(destinationPath); createdFile.on('finish', () => { resolve(); }); - response.on('error', (error) => { reject(); }); + response.on('error', (error) => { reject(error); }); response.pipe(createdFile); }); - request.on('error', (error) => { reject(); }); + request.on('error', (error) => { reject(error); }); request.end(); }); } @@ -655,10 +663,10 @@ export function downloadFileToStr(urlStr: string, headers?: OutgoingHttpHeaders) } let downloadedData: string = ''; response.on('data', (data) => { downloadedData += data; }); - response.on('error', (error) => { reject(); }); + response.on('error', (error) => { reject(error); }); response.on('end', () => { resolve(downloadedData); }); }); - request.on('error', (error) => { reject(); }); + request.on('error', (error) => { reject(error); }); request.end(); }); } \ No newline at end of file diff --git a/Extension/src/githubAPI.ts b/Extension/src/githubAPI.ts index c6313631a6..56adc7c347 100644 --- a/Extension/src/githubAPI.ts +++ b/Extension/src/githubAPI.ts @@ -211,7 +211,15 @@ function isRateLimit(input: any): input is RateLimit { async function getRateLimit(): Promise { const header: OutgoingHttpHeaders = { 'User-Agent': 'vscode-cpptools' }; const data: string = await util.downloadFileToStr('https://api.github.com/rate_limit', header) - .catch(() => { throw new Error('Failed to download rate limit JSON'); }); + .catch((error) => { + if (error.code && error.code !== "ENOENT") { + // Only throw if the user is connected to the Internet. + throw new Error('Failed to download rate limit JSON'); + } + }); + if (!data) { + return Promise.resolve(null); + } let rateLimit: any; try { @@ -229,7 +237,7 @@ async function getRateLimit(): Promise { async function rateLimitExceeded(): Promise { const rateLimit: RateLimit = await getRateLimit(); - return rateLimit.rate.remaining <= 0; + return rateLimit && rateLimit.rate.remaining <= 0; } /** @@ -246,7 +254,15 @@ async function getReleaseJson(): Promise { const header: OutgoingHttpHeaders = { 'User-Agent': 'vscode-cpptools' }; const data: string = await util.downloadFileToStr(releaseUrl, header) - .catch(() => { throw new Error('Failed to download release JSON'); }); + .catch((error) => { + if (error.code && error.code !== "ENOENT") { + // Only throw if the user is connected to the Internet. + throw new Error('Failed to download release JSON'); + } + }); + if (!data) { + return Promise.resolve(null); + } // Parse the file let releaseJson: any; diff --git a/Extension/src/main.ts b/Extension/src/main.ts index 6d991349c3..039b595104 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -299,7 +299,7 @@ async function finalizeExtensionActivation(): Promise { // (this may result in rewriting the package.json file) let packageJsonPath: string = util.getExtensionFilePath("package.json"); - if (!packageJsonPath.includes(".vscode-insiders")) { + if (!packageJsonPath.includes(".vscode-insiders") && !packageJsonPath.includes(".vscode-exploration")) { let abTestSettings: cpptoolsJsonUtils.ABTestSettings = cpptoolsJsonUtils.getABTestSettings(); let packageJson: any = util.getRawPackageJson(); let prevIntelliSenseEngineDefault: any = packageJson.contributes.configuration.properties["C_Cpp.intelliSenseEngine"].default; @@ -339,7 +339,6 @@ function rewriteManifest(): Promise { "onCommand:C_Cpp.ToggleErrorSquiggles", "onCommand:C_Cpp.ToggleIncludeFallback", "onCommand:C_Cpp.ToggleDimInactiveRegions", - "onCommand:C_Cpp.ToggleSnippets", "onCommand:C_Cpp.ShowReleaseNotes", "onCommand:C_Cpp.ResetDatabase", "onCommand:C_Cpp.PauseParsing", diff --git a/Extension/src/packageVersion.ts b/Extension/src/packageVersion.ts index 422596b1fb..7033a78950 100644 --- a/Extension/src/packageVersion.ts +++ b/Extension/src/packageVersion.ts @@ -40,9 +40,8 @@ export class PackageVersion { } } - public isGreaterThan(other: PackageVersion): boolean { - // PackageVersions cannot be compared if either have a suffix that is not 'insiders' - if ((this.suffix && !this.suffix.startsWith('insiders')) || (other.suffix && !other.suffix.startsWith('insiders'))) { + public isGreaterThan(other: PackageVersion, suffixStr: string = 'insiders'): boolean { + if ((this.suffix && !this.suffix.startsWith(suffixStr)) || (other.suffix && !other.suffix.startsWith(suffixStr))) { return false; } diff --git a/Extension/test/integrationTests/debug.integration.test.ts b/Extension/test/integrationTests/debug.integration.test.ts index 12b7b75801..434e35fd7d 100644 --- a/Extension/test/integrationTests/debug.integration.test.ts +++ b/Extension/test/integrationTests/debug.integration.test.ts @@ -6,10 +6,10 @@ 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) { +suite(`Debug Integration Test: `, function(): void { + suiteSetup(async function(): Promise { + let extension: vscode.Extension = vscode.extensions.getExtension("ms-vscode.cpptools"); + if (!extension.isActive) { await extension.activate(); } }); @@ -17,14 +17,14 @@ suite(`Debug Integration Test: `, function() { 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 => { + let debugSessionTerminated: Promise = new Promise(resolve => { vscode.debug.onDidTerminateDebugSession((e) => resolve()); }); try { assert.equal(vscode.debug.activeDebugSession.type, "cppdbg"); } catch (e) { - assert.fail("Debugger failed to launch. Did the extension activate correctly?") + assert.fail("Debugger failed to launch. Did the extension activate correctly?"); } await debugSessionTerminated; diff --git a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json index 2aeffb6403..a25a78b199 100644 --- a/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json +++ b/Extension/test/integrationTests/testAssets/SimpleCppProject/.vscode/tasks.json @@ -1,16 +1,34 @@ { - "version": "0.1.0", + "version": "2.0.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" - } + "label": "build", + "command": "g++", + "type": "shell", + "args": [ + "main.cpp", + "-g", + "-o", + "program" + ], + "group":{ + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "windows": { + "command": "C:\\MinGW\\bin\\g++.exe" + }, + "problemMatcher": [ + "$gcc" + ] } ] } \ No newline at end of file diff --git a/Extension/tools/OptionsSchema.json b/Extension/tools/OptionsSchema.json index 212a99c698..07163c7178 100644 --- a/Extension/tools/OptionsSchema.json +++ b/Extension/tools/OptionsSchema.json @@ -110,8 +110,12 @@ "type": "object", "default": {}, "properties": { - "name": "string", - "value": "string" + "name": { + "type": "string" + }, + "value": { + "type": "string" + } } }, "CppdbgLaunchOptions": { @@ -259,7 +263,12 @@ }, "externalConsole": { "type": "boolean", - "description": "If true, a console is launched for the debuggee. If false, no console is launched. Note this option is ignored in some cases for technical reasons.", + "description": "If true, a console is launched for the debuggee. If false, on Linux and Windows, it will appear in the Integrated Console.", + "default": false + }, + "avoidWindowsConsoleRedirection": { + "type": "boolean", + "description": "If true, disables debuggee console redirection that is required for Integrated Terminal support.", "default": false }, "sourceFileMap": { diff --git a/launch.md b/launch.md index 436854ab57..bbdf08e07d 100644 --- a/launch.md +++ b/launch.md @@ -26,6 +26,9 @@ Set or change the following options to control VS Code's behavior during debuggi Linux: When set to true, it will notify VS Code to spawn an external console. When set to false, it will use VS Code's integratedTerminal. macOS: When set to true, it will spawn an external console through `lldb-mi`. When set to false, the output can be seen in VS Code's debugConsole. Due to limitations within `lldb-mi`, integratedTerminal support is not available. +* #### `avoidWindowsConsoleRedirection` + In order to support VSCode's Integrated terminal with gdb on Windows, the extension adds console redirection commands to the debuggee's arguments to have console input and output show up in the integrated terminal. Setting this option to `true` will disable it. + * #### `logging` Optional flags to determine what types of messages should be logged to the Debug Console. * ##### `exceptions` @@ -75,7 +78,7 @@ The following options enable you to modify the state of the target application w JSON array of command line arguments to pass to the program when it is launched. Example `["arg1", "arg2"]`. If you are escaping characters you will need to double escape them. For example `["{\\\"arg\\\": true}]` will send `{"arg1": true}` to your application. * #### `cwd` - Sets the the working directory of the application launched by the debugger. + Sets the working directory of the application launched by the debugger. * #### `environment` Environment variables to add to the environment for the program. Example: `[ { "name": "squid", "value": "clam" } ]`. @@ -166,7 +169,7 @@ _Note: core dump debugging is not supported with MinGw._ Full path to debug server to launch. * #### `debugServerArgs` - Arguments for the the debugger server. + Arguments for the debugger server. * #### `serverStarted` Server-started pattern to look for in the debug server output.