Compare commits

...
689 Commits
Author SHA1 Message Date
Sean McManus 3ed087134c Merge pull request #3869 from microsoft/seanmcm/0_24_0_release
Seanmcm/0 24 0 release
2019-07-02 19:04:05 -07:00
Sean McManus 902355e021 Merge branch 'release' into seanmcm/0_24_0_release 2019-07-02 18:36:53 -07:00
Sean McManus 32e98912df Change version 2019-07-02 18:33:53 -07:00
Colen Garoutte-Carson 6bc49d595e Update release notes and changelog for June 2019 release (#3868)
* Update release notes and changelog for June 2019 release
2019-07-02 18:29:19 -07:00
Pierson Lee 6b3c0f1b10 Update default for externalConsole to false (#3828) 2019-07-02 17:12:23 -07:00
Sean McManus 35501431f8 Add the binaryVersion to Mac crash telemetry. (#3865) 2019-07-02 11:43:56 -07:00
Colen Garoutte-Carson 27a3c9958d Add output of current configuration to diagnostics command (#3866) 2019-07-01 19:38:25 -07:00
Sean McManus 5b3d4ebf44 Update dev dependencies and ThirdPartyNotices.txt (#3863)
* Update dev dependencies.
* Update ThirdPartyNotices.txt
2019-07-01 15:50:40 -07:00
Andrew Wang cfc064efcd Support resolving ${env:...} in sourceFileMap (#3857)
* Support resolving ${env:...} in sourceFileMap

This PR addresses ${env:...} variables in sourceFileMap keys and values.
2019-07-01 11:25:51 -07:00
Colen Garoutte-Carson 4f7a64a1a2 Add support parent scope syntax in theme loader for enhancedColorization (#3855) 2019-07-01 11:05:32 -07:00
Sean McManus c84cb36004 Update changelog for 0.24.0-insiders3. (#3850) 2019-06-27 19:10:25 -07:00
Andrew Wang 0502351002 Update envFile variable substitution (#3848)
* Update envFile variable substitution

In launch.json, the `envFile` configuration can substitute
${workspaceFolder}, ${workspaceRoot} and ${env::???}.

* Fix lint issues
2019-06-27 17:52:58 -07:00
Andrew Wang 5de420ee70 Decrease F5 workflow time w/ VSCode (#3843)
* Decrease F5 workflow time w/ VSCode

webpack is being called twice. Once with --mode production and then
rewritten with --mode development. Fixing tasks and launch.
2019-06-27 15:57:49 -07:00
Bob Brown 6a73275924 This message wasn't being sent by the language server (#3840) 2019-06-27 12:29:40 -07:00
Michelle Matias d12591062e validate advanced settings input (#3838) 2019-06-27 11:45:35 -07:00
Colen Garoutte-Carson 3926110b33 Update colorization.md to remove (syntactic) identifier (#3832) 2019-06-25 18:16:38 -07:00
Bob Brown f5975e6534 update fwlink for abtesting (#3830) 2019-06-25 13:19:07 -07:00
Pierson Lee b55e2c7ac5 Add useful links at the top of the README.md in the extension (#3808)
* Add useful links at the top of the README.md in the extension

* add liveshare badge
2019-06-25 10:52:38 -07:00
Colen Garoutte-Carson 73fda38d71 Enable enhanced colorization by default (#3824)
* Enable enhanced colorization by default
2019-06-25 10:21:11 -07:00
TheGreatRambler 9211292b60 Update FAQ.md (#3812) 2019-06-25 10:19:03 -07:00
Colen Garoutte-Carson f63a8da581 Remove syntactic colorization in favor of text mate colorization (#3821) 2019-06-24 17:42:10 -07:00
Colen Garoutte-Carson fd314b1b04 Handle comma-delimited scopes in JSON themes (#3814) 2019-06-21 16:54:48 -07:00
Sean McManus ea52c76595 Change to use machine scopes for clang_format_path.. (#3810)
* Change to use machine scopes for clang_format_path.
2019-06-21 11:49:23 -07:00
Colen Garoutte-Carson 7659e2826b Remove incorrect editor background setting (#3806) 2019-06-20 11:34:42 -07:00
Michelle Matias 8e898151f6 resolve cache path (#3807) 2019-06-20 11:20:24 -07:00
Colen Garoutte-Carson b2b0ad37af Avoid applying edits to cached colorization tokens until needed (#3793) 2019-06-17 18:12:28 -07:00
Bob Brown cee6ebe1d9 Disabling enhanced colorization for now. (#3785) 2019-06-17 17:31:40 -07:00
Colen Garoutte-Carson 566e657fad Make handleSquiggles no longer dependent on special escaping in parsePropertiesFile (#3778) 2019-06-17 10:38:59 -07:00
Colen Garoutte-Carson db1f631396 Fix colorization issue where only 1 of multiple get colorized (#3777) 2019-06-14 13:29:06 -07:00
Colen Garoutte-Carson 426c08293d Attempt to address colorization issue with flickering on Mac (#3775) 2019-06-14 13:00:06 -07:00
Colen Garoutte-Carson 631a4452d0 Enable enhancedColorization by default. Fix refresh race in colorization.ts (#3770) 2019-06-13 16:46:46 -07:00
Michelle Matias 9b29698b0e fix cl.exe check and other UI fixes (#3769) 2019-06-13 15:39:18 -07:00
Colen Garoutte-Carson b5c94e9e1f Address issue with AB default not applied. Fix issue with non file URIs (#3767) 2019-06-13 14:18:48 -07:00
Sean McManus 384cd35d6b Fix configuration squiggles not appearing for multiple occurrences of the same error. (#3766) 2019-06-13 13:55:55 -07:00
Sean McManus 2d4df9149f Update changelog for Insiders. (#3763)
* Update changelog for Insiders.
2019-06-12 19:44:57 -07:00
Michelle Matias d3c2ccbb93 return empty string if path is not set (#3761) 2019-06-12 17:15:56 -07:00
Colen Garoutte-Carson c637221b92 Update colorization support to only return tokens for currently visible ranges (#3738) 2019-06-12 16:28:40 -07:00
Michelle Matias 814f01b263 Change cache path default (#3747)
* change cache path default

* update check for falsy

* change default path name and location

* Update cache path description in json
2019-06-12 15:20:41 -07:00
Andrew Wang b763aa57d3 Fix windows remote attach experience (#3757)
* Check host machine for specific quotes for command

Attach to process is not working on Windows OS due to the single quote
then double inner quote. However, this is required for linux because if
you do not, it will evaluate the variables within the double quotes.
2019-06-12 15:06:02 -07:00
Michelle Matias 54b1e69975 Update IntelliSense mode and compiler compatibility validation (#3752)
* get compiler name

* get name for case when there are no args
2019-06-12 14:03:14 -07:00
Andrew Wang dacfe08033 Enable 'envFile' for cppdbg (#3723)
* Enable 'envFile' for cppdbg

This PR allows the cppdbg configuration to set environment variables
via a envFile.

Example envFile:
ENVIRONMENT_VAR_1=Hello
ENVIRONMENT_VAR_2=15
2019-06-10 17:54:00 -07:00
Michelle Matias f5aa7dc33e change text of include path. code clean up. (#3743) 2019-06-07 16:27:34 -07:00
Michelle Matias 90c6e9876a Configuration UI - V2 (#3732)
* edit config name

* button active style

* refactor settings.ts

* clean up configurations.ts

* advanced settings

* telemetry compilerPath & listen to forecedInclude

* fix lint

* fix spelling

* spelling & fix contrast color for buttons

* remove outline of button on click

* save view state & code cleanup
2019-06-07 09:46:43 -07:00
Bob Brown 9fa950db6a Add a command to rescan the workspace (#3658) 2019-06-05 15:12:29 -07:00
Bob Brown 8ea627e085 Telemetry not being logged for intellisense mode mismatch (#3726) 2019-06-04 11:39:47 -07:00
Andrew Wang 536d38e3bf Remove minify from webpack compile (#3724)
This will cause the code to still be webpacked but will not minify it.
2019-06-03 13:52:11 -07:00
Sean McManus c10c626869 Change multi-root storagePath to use the index instead of name. (#3715)
* Change multi-root storagePath to use the index as a subfolder when the name is a duplicate.
2019-05-31 14:47:45 -07:00
Sean McManus 24d37bc233 Update TPN from plist dependency. (#3719) 2019-05-31 13:35:06 -07:00
Sean McManus 158719cf46 Fixes to gcc problem matcher. (#3714)
* Fixes to gcc problem matcher.
2019-05-30 14:41:21 -07:00
Colen Garoutte-Carson b6327ed6c3 Add colorization support to cpptools (#3651) 2019-05-30 13:42:18 -07:00
Michelle Matias c60a2c6752 Add list of detected compiler paths to IntelliSense config UI (#3708)
* editable select control for compilerPath field

* set compiler path values

* update comments and width

* normalize path, update description
2019-05-30 11:27:49 -07:00
Michelle Matias 1f7c27d7f9 fix elementId.configName (#3692) 2019-05-24 17:25:50 -07:00
Karsten Thoms 1d82458a3a Fix typo in intelliSenseMode description (#3682) 2019-05-23 15:54:53 -07:00
Michelle Matias 25d122c3f7 Add telemetry to configuration UI (#3661)
* add telemetry to config ui

* cache telemetry and log when settingsPanel object is disposed

* fix linting
2019-05-22 14:41:39 -07:00
Andreea Isac 627acc535e Refresh IntelliSense time (#3680)
* Flame on timing

* Fixed linter errors

* Log IntelliSense refresh time information for debug logging level.

* Rephrasing log message

* Print the message in the output window instead of the console.
2019-05-22 14:03:04 -07:00
Sean McManus 515d858b4d Fix ${workspaceFolderBasename} resolving to "untitled", and add ${workspaceStorage} (#3643)
* Fix ${workspaceFolderBasename} resolving to "untitled".
* Enable ${workspaceStorage} in intelliSenseCachePath.
2019-05-21 15:26:05 -07:00
Bob Brown 7ec15af47c Clarify data collection policy #3299 (#3660) 2019-05-17 11:22:14 -07:00
Bob Brown cac58e9f88 Fix unit tests (#3659) 2019-05-16 11:46:29 -07:00
Sean McManus 0c28725628 Update versions. (#3641)
* Update versions.
2019-05-14 18:03:16 -07:00
Sean McManus 084a8e708c Merge pull request #3630 from microsoft/0_23_1_release
0 23 1 release
2019-05-10 15:57:24 -07:00
Sean McManus 045d50bb90 Merge branch 'release' into 0_23_1_release 2019-05-10 15:17:20 -07:00
Sean McManus 68eda19665 Update version. 2019-05-10 15:14:16 -07:00
Sean McManus ae564c8428 Update changelog for 0.23.1. (#3629) 2019-05-10 15:12:41 -07:00
Sean McManus 5241ce28e0 Add telemetry for missing language service extension binary (#3611)
Add telemetry for missing language service extension binary
2019-05-10 14:55:10 -07:00
Sean McManus febb880e32 Fix launch.json creation with intelliSenseEngine Disabled. (#3612)
* Fix launch.json creation with intelliSenseEngine Disabled.
2019-05-09 15:56:30 -07:00
Sean McManus d1c344b944 Fix .vscodeignore issues. (#3623) 2019-05-09 14:49:00 -07:00
Colen Garoutte-Carson a19d1c325e Fix issue with extension context not being set before initializeTemporaryCommandRegistrar (#3622) 2019-05-09 13:48:23 -07:00
Sean McManus 82225338c4 Update ThirdPartyNotices.txt -- removed a lot of unnecessary stuff. (#3606)
* Update ThirdPartyNotices.txt -- removed a lot of unnecessary stuff.
* Minor update to changelog.
2019-05-08 12:11:55 -07:00
Sean McManus fa72ab582d Seanmcm/update dependencies (#3605)
* Update the dependencies.
2019-05-07 17:19:57 -07:00
Sean McManus 0b3e43c93f Update TPN. (#3601) 2019-05-07 12:51:21 -07:00
Sean McManus 8b332a7795 Update version and fwlinks. (#3600)
* Update version and fwlinks.
* Some package-lock.json changes.
2019-05-07 12:18:10 -07:00
Sean McManus 39ab866a10 Merge pull request #3595 from microsoft/seanmcm/0_23_0_release
Seanmcm/0 23 0 release
2019-05-06 18:47:28 -07:00
Sean McManus d4cdfe6994 Merge branch 'release' into seanmcm/0_23_0_release 2019-05-06 18:42:11 -07:00
Sean McManus 4e20f27127 Seanmcm/0 23 0 changelog (#3593)
* 0.23.0 changelog.
2019-05-06 18:31:48 -07:00
Michelle Matias 4e2f1b8ba5 update release notes for 5-2019 (#3592)
* update release notes for 5-2019
2019-05-06 18:21:54 -07:00
Sean McManus 0cffa4e27a Dev/waan/fix test run (#3581)
* Fix integration tests and fail if tests fail
2019-05-06 16:51:51 -07:00
Colen Garoutte-Carson b67e701fc9 Address issue with trailing backslashes in config path not squiggled (#3573) 2019-05-01 15:58:19 -07:00
Sean McManus 77f3747630 Fix includePath code actions and configuration actions. (#3576)
* Fix `includePath` code actions amd configuration actions.
2019-05-01 14:26:55 -07:00
Sean McManus dc8813f449 Fix undefined access if there's no includePath. (#3572)
* Fix undefined access if there's no includePath.
2019-05-01 11:38:57 -07:00
Sean McManus e0543a64c1 Seanmcm/0 23 0 insiders2 changelog2 (#3571)
* Update changelog for crash fixes.
2019-04-30 16:12:52 -07:00
Sean McManus e5b118c707 Update changelog for 0.23.0-insiders2. (#3570)
* Update changelog for 0.23.0-insiders2.
2019-04-30 14:23:34 -07:00
Colen Garoutte-Carson f465766d1e Undo tab size change (#3568) 2019-04-30 12:29:15 -07:00
Michelle Matias 7f4fc339c7 Add input validation on configuration UI (#3563)
* show errors on config UI
2019-04-29 19:10:15 -07:00
Sean McManus 788cee3ecf Fix out dir not getting created. (#3562) 2019-04-29 16:42:43 -07:00
Michelle Matias 05939c19a9 add depends on (#3561) 2019-04-29 16:14:24 -07:00
Colen Garoutte-Carson 110e683790 Work around issue with getting stale contents from openTextDocument (#3545)
* Work around issue with getting stale contents from openTextDocument

* Avoid calling openTextDocument when creating a new file, and use only writeFile.  Unsubscribe from window activation when settings UI is not visible.

* Switch to using editorTabSize for settings file
2019-04-29 15:17:01 -07:00
Andrew Wang 6a88c9917b Adding support for .env files for cppvsdbg (#3500)
* Adding support for .env files for cppvsdbg

This PR allows users to have a .env file that listed as
KEY=VALUE or KEY="VALUE WITH SPACE" to be used as environment variables
when launching a process. Anything that begins with '#' is treated as a
comment. Blank lines are ignored.

This .env file will be used if envFile passed in with the launch.json.
It will also work with the existing environment variable, however
anything listed in the .env file will overwrite anything from the
environment field in the launch.json.

* Update 'envFile' description and add documentation
2019-04-26 14:59:43 -07:00
Sean McManus 2ac33971ed Update webpack dependency, fix linter errors (#3544)
* Update webpack dependency.
* Fix lint errors.
2019-04-26 14:43:29 -07:00
Sean McManus a5905276ce Bobbrow/webpack (#3411)
* Use webpack to consolidate JavaScript files
2019-04-25 18:34:15 -07:00
Colen Garoutte-Carson d6726e5d42 Switch to using the installExtension command for offline/insider vsix installing (#3521) 2019-04-25 18:02:23 -07:00
Colen Garoutte-Carson aa6873b84e Work around vscode not treating .C files as C++ (#3536) 2019-04-25 17:53:07 -07:00
Colen Garoutte-Carson e3ddec66ee Update config squiggle parsing to squiggle bad paths delimited by semicolons (#3517) 2019-04-25 17:45:42 -07:00
Sean McManus 26d83d136e Skip first install release notes (#3534)
* Don't show release notes if the extension has never been installed before
2019-04-25 17:13:08 -07:00
Colen Garoutte-Carson 6f4439ca88 Various settings UI load/save related changes (#3529) 2019-04-25 10:09:10 -07:00
Colen Garoutte-Carson 3fbeba779c Unescape backslashes in settings for UI (#3527) 2019-04-24 13:49:43 -07:00
Colen Garoutte-Carson cfc908a1ac Update Select Configurations command to offer Edit Configs JSON option (#3519)
* Update Select Configurations command to offer Edit Configs JSON option

* Add 'Edit Configurations (UI)' option to Select Configuration menu
2019-04-24 11:19:53 -07:00
Sean McManus f3a02fde4e Change version. (#3520) 2019-04-23 18:10:57 -07:00
Sean McManus e863e88e95 Merge pull request #3516 from Microsoft/seanmcm/0_23_0_changelog2
Seanmcm/0 23 0 changelog2
2019-04-23 17:11:53 -07:00
Sean McManus bc70ea8c79 Merge branch 'master' into seanmcm/0_23_0_changelog2 2019-04-23 16:58:14 -07:00
Michelle Matias bbfea25a1d Config UI data sync fix (#3515)
* fix data sync, rewording

* add default to intellisense mode. rewording.

* fix lint

* update description

* remove extra padding
2019-04-23 16:57:50 -07:00
Sean McManus 968d6c5919 Add a reported by. 2019-04-23 14:46:32 -07:00
Sean McManus 33d23b3a5e Revert line endings. 2019-04-23 14:27:09 -07:00
Sean McManus 4bf3691f7f Move issue. 2019-04-23 14:26:27 -07:00
Sean McManus bf9d69a8ad Update changelog. 2019-04-23 14:22:35 -07:00
Bob Brown 9a78289fec encode the installation type in install telemetry (#3513) 2019-04-23 10:28:23 -07:00
Michelle Matias 7960904575 changelog for 0.23.0 insiders (#3499)
* Log new features and minor changes

* fix quotes

* Update changelog.

* Separate sections.

* Fix.

* Minor change.

* More changes.
2019-04-19 18:19:50 -07:00
Michelle Matias dd590ea1f5 Config UI - fix colors on some html elements. Change some wording. (#3498)
* fix empty compilerPath. Clarify some descriptions

* fix colors

* removed unused code
2019-04-19 18:08:55 -07:00
Sean McManus 5d1e503480 Merge pull request #3497 from Microsoft/seanmcm/showLogDiagnostics
Seanmcm/show log diagnostics
2019-04-19 15:50:49 -07:00
Sean McManus 3b15f515d1 Merge branch 'master' into seanmcm/showLogDiagnostics 2019-04-19 15:44:50 -07:00
Sean McManus d7a3384a07 Merge pull request #3495 from Microsoft/seanmcm/updateThirdPartyNotices
Update ThirdPartyNotices.txt
2019-04-19 15:44:30 -07:00
Sean McManus 4cdcd72990 Merge branch 'master' into seanmcm/showLogDiagnostics 2019-04-19 15:40:52 -07:00
Sean McManus 740705973e Merge branch 'master' into seanmcm/updateThirdPartyNotices 2019-04-19 15:34:26 -07:00
Colen Garoutte-Carson 3a78e96785 Add check for undefined compilerPath in isCompilerIntelliSenseModeCompatible (#3496) 2019-04-19 15:15:15 -07:00
Sean McManus 39b89bdb5b Undo newline change. 2019-04-19 14:33:37 -07:00
Sean McManus d4d68cb808 Show the log diagnostics. 2019-04-19 14:32:34 -07:00
Sean McManus d3e8958b29 Update ThirdPartyNotices.txt 2019-04-19 13:11:18 -07:00
Colen Garoutte-Carson 0e3fea978a Add command to log language service diagnostics (#3489)
* Add support for showing diagnostics
2019-04-18 18:12:08 -07:00
Sean McManus a39b1a5d6c Merge pull request #3486 from Microsoft/bobbrow/tasksIndentation
When generating tasks.json, use the editor's tab setting
2019-04-18 17:45:11 -07:00
Sean McManus f15994a58c Merge branch 'master' into bobbrow/tasksIndentation 2019-04-18 17:35:01 -07:00
Sean McManus 009c77d45f Merge pull request #3453 from Microsoft/seanmcm/fixJsonParse
Fix for 0.22.0 regression caused by squiggle work: https://github.com/Microsoft/vscode-cpptools/issues/3449 .
2019-04-18 17:34:41 -07:00
Sean McManus 94e213449f Merge branch 'master' into seanmcm/fixJsonParse 2019-04-18 17:14:14 -07:00
Michelle Matias 7ae6818bfb Add styling to configuration UI (#3487)
* add styling to configuration UI

* fix casing on command text. style cleanup

* edit wording for command palette tip

* change wording. Disable editing of config name

* update webview on config selection changed
2019-04-18 17:03:48 -07:00
Sean McManus 03a6c04629 Merge branch 'master' into seanmcm/fixJsonParse 2019-04-18 16:07:44 -07:00
Andrew Wang 8526bc90cb Add debugHeap toggle and turn off by default (#3488)
* Add debugHeap toggle and turn off by default

This PR adds a launch.json setting to enable debugHeap if users are
intersted in using it. By default, debug heap will be disabled.
2019-04-18 15:52:37 -07:00
Bob Brown 105760833d Merge branch 'master' into bobbrow/tasksIndentation 2019-04-18 15:04:33 -07:00
Colen Garoutte-Carson 239e4015d6 Add config squiggle for intelliSenseMode/compilerPath mismatch (#3483)
* Add squiggle for intelliSenseMode/compilerPath mismatch

* Break out function for isCompilerIntelliSenseModeCompatible.
2019-04-18 14:02:29 -07:00
Bob Brown (DEVDIV) 7e7b38acd7 When generating tasks.json, use the editor's tab setting 2019-04-18 11:22:04 -07:00
Sean McManus 260dc5d840 Merge branch 'master' into seanmcm/fixJsonParse 2019-04-17 18:01:34 -07:00
Michelle Matias 99b290513b Configuration UI (#3479)
* Add settings webview

* Add setting: useSettingsUI

* Use existing global setting (workbench.settings.editor == ui | json)

* handle changes from webview

* Add content security policy to html

* Move use of workbench settings into OtherSettings class

* sync ui and json file

* Add functions for each way to open settings (UI, JSON, based on config)

* Remove unnecesary command

* add telemetry. handle failed parse. Add UI command to toast notification.

* add newline

* fix value properties of HTML element

* fix another html value

* fix formatting

* add typedef

* fix more formatting and ===

* fix code styling. fixed some bugs.

* move configDirty flag reset

* add typedef to onWindowStateChanged

* small clean up
2019-04-17 16:31:46 -07:00
Sean McManus 76b3d9ca28 Merge pull request #3455 from Microsoft/seanmcm/fixMultiRootHover
Fix hover using the active client instead of the owning client.
2019-04-17 16:11:19 -07:00
Sean McManus 806dc8ac43 Merge branch 'master' into seanmcm/fixMultiRootHover 2019-04-17 16:04:30 -07:00
Colen Garoutte-Carson 03cf4d7aaf Default intelliSenseEngineFallback to Disabled. Add additional settings value to errorSquiggles (#3421)
* Update package.json to reflect new values

* Break ToggleErrorSquiggles out into Enable/Disable

* Update localization files
2019-04-17 16:00:28 -07:00
Sean McManus 569a7cb53d Merge pull request #3478 from Microsoft/seanmcm/fixRegExpInConfigName
Seanmcm/fix reg exp in config name
2019-04-17 14:17:03 -07:00
Sean McManus 6de2250fef Merge branch 'master' into seanmcm/fixRegExpInConfigName 2019-04-17 14:08:29 -07:00
Sean McManus ae861b3605 Change sorting. 2019-04-17 14:07:19 -07:00
Bob Brown 2aeadbd395 Update FAQs.md for ipch folder (#3424) 2019-04-16 22:03:38 -07:00
Sean McManus 0b500cefb7 Fix line endings. 2019-04-16 14:57:28 -07:00
Sean McManus 2e8cd7f406 Fix bug with special chars in config name. 2019-04-16 14:56:23 -07:00
Sean McManus 8c8c2c22e3 Undo line changes. 2019-04-16 14:35:34 -07:00
Sean McManus bdc8322da3 Go back to my original fix. 2019-04-16 14:34:39 -07:00
Sean McManus eeb2ba207c Work in progress. 2019-04-16 14:11:34 -07:00
Sean McManus f848bf392a Fix hover using the active client instead of the owning client. 2019-04-11 18:18:29 -07:00
Sean McManus f72a3ded96 Undo activation events change. 2019-04-11 16:00:05 -07:00
Sean McManus 31b993941b Another attempt to undo changes. 2019-04-11 15:59:07 -07:00
Sean McManus 59b0b3f924 Merge branch 'seanmcm/fixJsonParse' of https://github.com/Microsoft/vscode-cpptools into seanmcm/fixJsonParse 2019-04-11 15:57:57 -07:00
Sean McManus 5b90fc6bd3 Attempt to undo commits. 2019-04-11 15:57:06 -07:00
Sean McManus a4e9df0e6e Merge branch 'seanmcm/fixJsonParse' of https://github.com/Microsoft/vscode-cpptools into seanmcm/fixJsonParse 2019-04-11 15:55:17 -07:00
Sean McManus 3ef0b7597f Undo checked in files. 2019-04-11 15:54:47 -07:00
Sean McManus 74c9b0b967 Replace 3 replace with 1.
Signed-off-by: Sean McManus <[email protected]>
2019-04-11 15:52:29 -07:00
Sean McManus 3b5a8466d7 Update line endings. 2019-04-11 15:27:22 -07:00
Sean McManus fbf8ed4e35 Fix bug with json parsing. 2019-04-11 15:26:07 -07:00
Colen Garoutte-Carson c978eb0755 Reorder contents of provideCustomConfiguration, as an optimization (#3437) 2019-04-11 10:06:24 -07:00
Sean McManus 0f67f54b42 Seanmcm/small changes for insiders (#3435)
* Update changelog.
* Remove confusing quotes from clang_format_style descriptions, and use the Visual Studio style as the clang_format_style examples.
2019-04-08 21:50:46 -07:00
Sean McManus b770030ec2 Update changelog for 0.22.2-insiders. (#3409)
* Update changelog for 0.22.2-insiders.
2019-04-04 14:11:08 -07:00
Colen Garoutte-Carson 8129ce337e Add call to notifyWhenReady, to prevent crash (#3406)
Addresses an issue with a prior change, which added use of languageClient when it may not yet be available.

Use requestWhenReady(), to prevent crash.
2019-04-04 13:00:34 -07:00
Colen Garoutte-Carson 93a88c948a Ensure clearCustomConfigurations() is called when changing the configurationProvider (#3404)
* Ensure clearCustomConfigurations() is called when changing the configurationProvider
2019-04-03 17:00:14 -07:00
Sean McManus 34d8874754 Seanmcm/disable cpp squiggles (#3405)
* Add enableConfigurationSquiggles.
2019-04-03 16:42:44 -07:00
Sean McManus 0773ec8c41 Fix compile_commands prompt not being per-folder. (#3399) 2019-04-03 13:07:19 -07:00
Colen Garoutte-Carson 9f842ac0d9 Add use of queryTranslationUnitSource to determine if custom configuration can be skipped (#3393)
Add call in provideCustomConfiguration to new QueryTranslationUnitSourceRequest. Use result to decide whether it's necessary to request a custom configuration.

* Add queryTranslationUnitSource

* Update "Building the Extension.md"
2019-04-03 12:39:17 -07:00
Sean McManus e8d0ded816 Fix for null ref race condition when using custom config providers. (#3377)
* Fix for null ref race condition when using custom config providers.
2019-04-02 15:22:25 -07:00
Tara Raj f5bdac9889 Merge pull request #3314 from Microsoft/taraj/box-sample
Taraj/box sample
2019-04-02 14:36:59 -07:00
Sean McManus eb976d5ca5 Merge branch 'master' into taraj/box-sample 2019-03-28 19:11:35 -07:00
Sean McManus d5a902e144 Enable environment variables with intelliSenseCachePath. (#3368)
* Enable environment variables with intelliSenseCachePath.
2019-03-27 18:28:07 -07:00
Sean McManus b0c2d54144 Merge branch 'master' into taraj/box-sample 2019-03-27 18:02:57 -07:00
Sean McManus bcdabc9c36 Attempt to fix Azure Pipelines Cl. (#3371) 2019-03-27 17:02:53 -07:00
Sean McManus e054287c48 Update for 0.22.2. (#3359) 2019-03-27 12:40:57 -07:00
Sean McManus dcf480990b Merge branch 'master' into taraj/box-sample 2019-03-26 12:52:53 -07:00
Sean McManus 02a3152f0f Fix duplicate build task when compilerPath has args. (#3360) 2019-03-26 12:52:27 -07:00
Sean McManus 77806f657f Add squiggle for compilerPath with args and spaces missing quotes. (#3358) 2019-03-26 12:41:59 -07:00
Bob Brown 7e5f22f862 updates 2019-03-25 21:10:52 -07:00
Sean McManus 0f8e7b2d7b Merge branch 'master' into taraj/box-sample 2019-03-25 15:34:43 -07:00
Sean McManus 088276b4af Seanmcm/component governance (#3346)
* Add Component Governance.
2019-03-25 11:44:55 -07:00
Tara Raj a7cefc9d4d Merge branch 'master' into taraj/box-sample 2019-03-22 09:53:05 -07:00
Bob Brown 30d8a1daa4 Update FAQ.md 2019-03-22 09:08:58 -07:00
Bob Brown (DEVDIV) 148ae1d325 ignore cache files 2019-03-22 08:52:21 -07:00
Tara Raj 968ce8acba Adding gitignore file 2019-03-21 12:56:54 -07:00
Tara Raj ff6e13e829 Add Box Sample and Remove Stale Clang Sample 2019-03-21 11:45:05 -07:00
Sean McManus c18592b5a3 Merge pull request #3332 from Microsoft/0_22_1_release
0 22 1 release
2019-03-20 19:06:23 -07:00
Sean McManus fee924b374 Merge branch 'release' into 0_22_1_release 2019-03-20 18:46:03 -07:00
Sean McManus 6724e13c63 Update for 0.22.1. 2019-03-20 18:44:44 -07:00
Sean McManus 798e90574c Update for 0.22.1. (#3331) 2019-03-20 18:24:13 -07:00
Sean McManus 1eb064e020 Build tasks.json deletion. Configure Task. (#3328)
* Build tasks.json deletion. Configure Task.
2019-03-20 15:39:06 -07:00
Sean McManus 717de54b06 Merge pull request #3321 from Microsoft/0_22_0_release
0 22 0 release
2019-03-19 16:52:44 -07:00
Sean McManus 51cd214f1e Merge branch 'release' into 0_22_0_release 2019-03-19 16:40:15 -07:00
Sean McManus 4ca9ad8b3a Update changelog. (#3312)
* Update changelog.
2019-03-19 14:01:54 -07:00
Sean McManus 8aadd40a58 Fix squiggles with WSL compilerPath with args. (#3313)
* Fix squiggles with WSL compilerPath with args.
* Normalize path separators.
2019-03-19 13:44:58 -07:00
Tara Raj 7088f546aa Additional box sample files 2019-03-18 19:53:33 -07:00
Tara Raj 64ca48b50e BoxConsoleSample for build and debug demo 2019-03-18 19:52:49 -07:00
Sean McManus 0c61ee96b7 Fix variable resolving not working with ${default}. (#3310) 2019-03-18 15:47:57 -07:00
Bob Brown e020801dac readme feedback #3300 (#3307) 2019-03-18 13:12:18 -07:00
Sean McManus 270a4f7d38 Update changelog for 0.22.0-insiders3. (#3294)
* Update changelog for 0.22.0-insiders3.
2019-03-14 17:27:22 -07:00
Sean McManus 342de46452 Disable the IntelliSense cache on Mac. (#3293)
* Disable the IntelliSense cache on Mac.
2019-03-14 14:22:32 -07:00
Bob Brown cd0dde9e27 Update release notes (#3291) 2019-03-14 13:14:40 -07:00
Bob Brown 79f8262d26 show squiggles when invalid properties are added to the c_cpp_properties.json file (#3283) 2019-03-12 16:58:30 -07:00
Sean McManus 24b69c7873 Seanmcm/add cl debug support (#3264)
* Add cl.exe support.
* Fix Build and Debug too early.
* Make menus better.
2019-03-12 16:55:15 -07:00
Andrew Wang 260124b39b Updating vsdbg (#3267) 2019-03-11 13:02:44 -07:00
Sean McManus 2426a66be4 Seanmcm/change mac mi debugger path default (#3262)
* Change default miDebuggerPath on Mac.
2019-03-07 11:27:30 -08:00
Sean McManus 6f5c9e362b Fix unwanted compilerPath squiggle with cl.exe. (#3263) 2019-03-07 11:22:21 -08:00
Sean McManus 868799af10 Disable AutoPCH for older Macs. (#3261)
* Disable AutoPCH for older Macs.
2019-03-07 11:10:32 -08:00
Sean McManus 01d013723f Fix install vsix. (#3251)
* Fix install vsix.
2019-03-05 16:42:09 -08:00
Sean McManus 1a8e84bca3 Seanmcm/debug fixes (#3244)
* Fix debug launch bugs.
2019-03-05 16:29:43 -08:00
lh123 3db3c8da9a Suggest user switching to insiders channel (#3221)
* suggested user switch to insiders
2019-03-04 17:26:12 -08:00
Sean McManus 670a105c1f Update changelog. (#3243) 2019-03-01 17:26:25 -08:00
Andrew Wang 5445eff250 Update vsdbg for 0.23.0 (#3242) 2019-03-01 17:23:33 -08:00
Sean McManus 95dd5386ed Reduce VS Code requirement. (#3241)
* Reduce VS Code requirement.
* Remove more addresses in crash telemetry.
2019-03-01 16:02:41 -08:00
Sean McManus 55120359a4 Remove trailing "/" from intelliSenseCachePath setting. (#3240) 2019-03-01 14:44:11 -08:00
Sean McManus bb2d23c694 Change AutoPch to AutoPCH. (#3239) 2019-03-01 13:59:19 -08:00
Sean McManus 15ac01d70c Update date. (#3238) 2019-03-01 13:56:03 -08:00
Sean McManus 0c77b9e6cf Fix "cl.exe" in the compilerPath squiggle. (#3237)
* Fix "cl.exe" and missing ".exe" in the compilerPath squiggle.
2019-03-01 13:53:19 -08:00
Sean McManus c39579010b Fix bugs with compilerPath squiggles and build tasks. (#3228) 2019-03-01 11:10:16 -08:00
Bob Brown e928bfb0a9 Fix tslint issues (#3234) 2019-03-01 10:51:11 -08:00
Sean McManus 1d47bc4160 Seanmcm/0 22 0 insiders2 changelog (#3226)
* Update changelog for 0.22.0-insiders.
2019-02-28 17:56:27 -08:00
Griffin Downs 3d7937feeb Grdowns/launch configs (#3215)
* Implement debug configurations that will build the active C/C++ file and launch a debugger (disabled)
* Handle compilerPath in build and squiggles.
2019-02-28 16:46:26 -08:00
Andrew Wang 98260f96ea Remove Travis-CI (#3205)
Removing .travis.yml and will be removing webhooks/app integration of
Travis-CI from vscode-cpptools.

Minor fixes and add debug integration tests back.
2019-02-28 14:55:14 -08:00
Bob Brown 8d96465cb6 Enable ${command:cpptools.activeConfigName} in tasks #1524 (#3219)
* Enable ${command:cpptools.activeConfigName} in tasks #1524

* PR feedback
2019-02-26 20:09:20 -08:00
Bob Brown ece90711fb fix typos (#3218) 2019-02-26 14:54:22 -08:00
Bob Brown 361ca45b50 Merge pull request #3184 from Microsoft/mimatias/add_pch_settings
Add settings for auto pch
2019-02-25 14:51:34 -08:00
Sean McManus 28e8f1f2ed Seanmcm/cpp properties squiggles (#3196)
* Add c_cpp_properties.json warning squiggles for invalid paths.
2019-02-25 14:46:05 -08:00
Michelle Matias d27e609d92 Merge branch 'mimatias/add_pch_settings' of https://github.com/Microsoft/vscode-cpptools into mimatias/add_pch_settings 2019-02-22 13:59:41 -08:00
Michelle Matias fdcbfee87c update cache path 2019-02-22 13:59:26 -08:00
Sean McManus bda5bbf89c Merge branch 'master' into mimatias/add_pch_settings 2019-02-22 13:50:29 -08:00
Sean McManus 50ddd670c7 Fix command not found and empty c_cpp_properties.json if activation is too slow. (#3178)
* Fix command not found if activation is too slow.
* Fix empty c_cpp_properties.json.
2019-02-22 13:50:11 -08:00
Andrew Wang cc81b4bb8f Set up CI with Azure Pipelines (#3191)
Set up CI with Azure Pipelines
2019-02-22 11:51:01 -08:00
Michelle Matias a0f6eb61ad Update cachePath description 2019-02-22 11:05:09 -08:00
Michelle Matias 10a06af93d rename cachePath and cacheSize 2019-02-22 10:39:07 -08:00
Michelle Matias b28ab0a874 add slash at end of default path 2019-02-15 16:20:56 -08:00
Michelle Matias f1ca548849 filter autoPCH cache for telemetry 2019-02-15 16:16:40 -08:00
Michelle Matias f860223723 fix auto pch settings 2019-02-15 16:16:40 -08:00
Michelle Matias e2aaababc4 Add settings for cached pre-compiled headers 2019-02-15 16:16:40 -08:00
Andrew Wang 49aa55261f Fix quoting for process picker (#3181) 2019-02-15 12:58:11 -08:00
Griffin Downs 035d0284d9 Grdowns/build tasks (#3118)
* Generate a C/C++ build task

* Cleaning

* Move args into definition

* Add args to shellexecution to allow calling the task without first configuring; Add TODO's

* Read compiler paths sent in defaults to generate task list

* Rename compilerPaths to compilerInfo; Filter tasks based on file extension

* Use our own file extension filters to decide whether tasks are presented

* Show dialog when no compilers are found

* Display a message if no compilers are found

* Add compilerPath getter to config; Use it to offer another task

* Refactoring; Commenting

* Remove CompilerInfo namespace; Formatting; Change return vals

* Commenting; Add telemetry; Inverse condition

* Change output program based on OS; Remove message and collect telemetry instead

* Filter out redundant compiler entries

* Remove TODO; Get proper exe name; Properly reassign compilerPaths after filtering

* Commenting; Fix cwd mingw bug

* Commenting; Refactor

* Mark compilerInfo const

* Remove whitespace; Remove bad comment

* Remove whitespace

* Replace unique algorithm with a map

* pre-compute basename

* Move comment

* Commenting; Ensure user's compilerPath setting is used

* Use indexOf instead of find

* Simplify isHeader calculation by using some instead of every

* Don't redundantly check extensions; Use some instead of indexOf

* Add comment punctuation

Use file macro instead of fileDirName and fileBaseName

Change path provider name; expose cwd in definition

Add shell task definition (it's not built into vs code apparently)

* Lowercase file extension to match; Count extensionless files as headers

* Add newline

* Change CompilerInfo to KnownCompiler

* Support ambiguous file extension

* Early out for extensionless files

* Commenting

* Commenting; Rename telemetry event

* Change languageAssociation to isC

* Fix bug where cwd was not used; Add comment
2019-02-13 16:00:31 -08:00
Sean McManus f216e0262a Update extend version. (#3146) 2019-02-08 18:47:52 -08:00
Sean McManus 373e9be4cb Update changelog for 0.22.0-insiders. (#3137)
* Update changelog for 0.22.0-insiders.
2019-02-06 14:44:40 -08:00
Sean McManus 7a20270b10 Seanmcm/suggest snippets setting (#3135)
* Add suggestSnippets setting.
2019-02-05 15:46:49 -08:00
Bob Brown 41a4e14e4c Merge pull request #3128 from xisui-MSFT/xisui/chinese_command_support
Add Chinese support for commands
2019-02-04 09:38:58 -08:00
xisui-MSFT 13b78f2129 Add Chinese support for commands 2019-02-02 18:24:42 -08:00
Tucker Kern bf6b4aa54e Fix regex to allow non-recursive includePath (#3122)
* Fix regex to allow non-recursive includePath when constructing browse.path from includePath
2019-01-31 18:20:23 -08:00
Bob Brown f978719dea Merge pull request #3113 from Microsoft/bobbrow/cc
#3102 - fix compilerPath/compileCommands policy
2019-01-29 14:07:32 -08:00
Bob Brown (DEVDIV) 2713e70563 #3102 - fix compilerPath/compileCommands policy 2019-01-29 10:39:37 -08:00
Sean McManus af516b9515 Seanmcm/0 22 0 changelog1 (#3101)
* Update changelog, version, and fwlinks.
* Add telemetry for C/C++ Clang Command Adapter usage.
* Update language-service.md.
2019-01-28 17:44:04 -08:00
Andrew Wang 243f21380d Updating debugAdapterExecutable to new API (#2921)
https://code.visualstudio.com/updates/v1_30#_debugging-api has
depricated adapterExecutableCommand. This PR updates the extension to
use DebugAdapterDescriptorFactory.
2019-01-23 15:05:37 -08:00
Sean McManus da277c8593 Seanmcm/0 21 0 release2 (#3070)
* Update yauzl version and changelog date. (#3069)
2019-01-22 19:17:42 -08:00
Sean McManus 6fc9f7b682 Update yauzl version and changelog date. (#3069) 2019-01-22 19:05:23 -08:00
Bob Brown b3cce807bb Merge pull request #3068 from Microsoft/seanmcm/0_21_0_release 2019-01-22 14:43:34 -08:00
Sean McManus a533eb9a43 Merge branch 'release' into seanmcm/0_21_0_release 2019-01-22 14:32:57 -08:00
Sean McManus 9702eae953 Update package.json. 2019-01-22 14:32:04 -08:00
Sean McManus a4b51997ff Update version. 2019-01-22 14:30:32 -08:00
Sean McManus ec9270f5a9 Update ReleaseNotes. (#3067) 2019-01-22 14:25:09 -08:00
Griffin Downs 75f35a1fd7 Fix CLI mismatch for downgrading (#3065) 2019-01-22 13:24:00 -08:00
Sean McManus dcc0174133 Update changelog. (#3050) 2019-01-18 11:23:33 -08:00
jogo- 3b8c3143e4 Fix typos in launch.md (#3027)
* Fix typos in launch.md
2019-01-16 16:24:56 -08:00
jogo- 33e7d70324 Fix typo in How To Debug MIEngine.md (#3028) 2019-01-14 16:47:54 -08:00
jogo- 703e23a62b Update FAQs.md (#3029)
Missing whitespace
2019-01-14 13:15:28 -08:00
Jmnote 39ba7fc6ba extenion → extension (#3002)
extenion → extension
2019-01-08 16:00:02 -08:00
Sean McManus 6488a11dc3 Update changelog (#2997) 2019-01-03 14:31:12 -08:00
Sean McManus 5ca48e24cf Update changelog for 0.21.0-insiders3. (#2958)
* Update changelog for 0.21.0-insiders3.
2019-01-03 13:20:33 -08:00
Sean McManus de9cc715fc Give a better message if the binary is missing. (#2975)
* Give a better message if the binary is missing.
2019-01-02 18:15:05 -08:00
Sean McManus c727ceca1b Remove json-based snippets, handled by the server now. (#2945)
* Remove json-based snippets, handled by the server now.
2018-12-27 18:36:27 -08:00
Sean McManus f58af4fb2e Disable wordBasedSuggestions by default. (#2944) 2018-12-20 14:39:41 -08:00
Andrew Wang 7935b97329 Update How To Debug MIEngine.md (#2935)
* Update How To Debug MIEngine.md

Added information on how to debug with VS Code

* Update How To Debug MIEngine.md

* .dll -> .pdb

Mistake on symbol list
2018-12-17 14:33:09 -08:00
Sean McManus bd6f8f0df3 Update date in changelog. (#2926)
* Update changelog.
2018-12-17 14:11:40 -08:00
Sean McManus 4b22333f5c Attempt to fix download failure. (#2931)
* Retry vsix download with http.proxySupport "off".
2018-12-17 13:58:43 -08:00
Sean McManus 968e0d2aae Fix bug with Insiders updating. 2018-12-14 18:39:36 -08:00
Sean McManus 8dc8b3bc37 Update changelog for 0.21.0-insiders2. (#2911)
* Update changelog for 0.21.0-insiders2.
* Update README.md.
* Update to 5.1.1 of the vscode-languageclient.
2018-12-13 18:02:35 -08:00
Matt Bise bb962b91e8 Add refresh button to process picker (#2895)
* Add attach QuickView with refresh

* vscode engine 1.23 -> 1.26

* Clean up disposables

* Add entry to CHANGELOG

* Provide refresh image for dark and light themes

* Add title to QuickPick
2018-12-10 15:50:53 -08:00
Sean McManus 8c53c027ca Protect against no activeDocument. (#2875) 2018-11-28 16:05:27 -08:00
Sean McManus b864126494 Fix missed package.json issue from my last checkin. (#2873) 2018-11-28 11:33:16 -08:00
Bob Brown b78e85619a bump up the timeout (#2872) 2018-11-28 09:17:16 -08:00
Sean McManus f474ba8539 Seanmcm/fix insiders debugging (#2871)
* Fix debugging with VS Code Insiders and other Linter fixes.
2018-11-27 16:34:31 -08:00
Sean McManus 0f1071a5c9 Seanmcm/exploration build (#2829)
* Treat the Exploration build like Insiders.
* Update changelog.
2018-11-16 15:11:05 -08:00
Sean McManus f69e6e191b Update telemetry API. (#2828) 2018-11-14 19:38:49 -08:00
Sean McManus 230895d6ba Remove <numbers><spaces> from the start of call stack lines. (#2827)
* Remove <numbers><spaces> from the start of call stack lines.
* Remove __1::.
2018-11-14 19:06:08 -08:00
Sean McManus fa8173076d Update MinGW.md (#2813)
* Update MinGW.md
2018-11-14 17:51:23 -08:00
Bob Brown 3079fb58ae ignore update failures caused by no network present (#2808) 2018-11-13 15:37:35 -08:00
Julien Russo 9f1b482de4 Translation improvements (#2663)
Moved command english translation to package.nls.json, added command translation for italian and modified package.json to use localization files.
2018-11-12 16:54:22 -08:00
Sean McManus 8f6714254a Seanmcm/0 21 0 changelog3 (#2796)
* Change "Fix for" to "Fix" in changelog.
2018-11-08 17:34:34 -08:00
Sean McManus 5246cdc527 Update changelog. (#2795) 2018-11-08 17:21:36 -08:00
Sean McManus 4938f5b2f4 Update changelog for 0.21.0-insiders. (#2794) 2018-11-08 16:14:52 -08:00
Bob Brown 21fef3b067 use WebviewPanel (#2781) (#2783) 2018-11-07 14:47:57 -08:00
Pierson Lee 71582d1883 Add avoidWindowsConsoleRedirection and fix externalConsole comment (#2772)
* Add avoidWindowsConsoleRedirection and fix externalConsole comment

* Update OptionsSchema.json

* Making Andrew happy by updating npm@latest
2018-11-06 13:33:04 -08:00
Pierson Lee 23fc338f71 Update launch.md 2018-11-05 10:31:37 -08:00
Sean McManus 4a8b143ce0 Add more crash telemetry filtering. (#2759) 2018-11-01 15:55:47 -07:00
Sean McManus b1274d3c76 Merge pull request #2749 from Microsoft/seanmcm/0_20_1_release
Seanmcm/0 20 1 release
2018-10-31 17:24:43 -07:00
Sean McManus 8f8565dbfd Merge branch 'seanmcm/0_20_1_release' of https://github.com/Microsoft/vscode-cpptools into seanmcm/0_20_1_release 2018-10-31 17:16:30 -07:00
Sean McManus 7f4614c31c Merge again. 2018-10-31 17:15:52 -07:00
Sean McManus eccee49017 Fix punctuation/spacing inconsistencies. (#2750) 2018-10-31 17:12:30 -07:00
Sean McManus e231453778 Merge branch 'release' into seanmcm/0_20_1_release 2018-10-31 16:29:33 -07:00
Sean McManus 8729804dc2 Update version. 2018-10-31 16:27:42 -07:00
Anandlal c607604b6b "taskName" changed to "label" as per version 2.0.0 (#2741)
https://code.visualstudio.com/docs/editor/tasks#_migrating-to-tasks-200
2018-10-31 16:24:50 -07:00
Sean McManus 460b95920f Update changelog, fwlinks, and update telemetry API (#2748)
Update changelog, fwlinks, and update telemetry API
2018-10-31 16:06:34 -07:00
Pierson Lee 1c38b55b9f Update external Console notes
Updated external console option to show changes to support for integratedTerminal.
2018-10-31 12:08:00 -07:00
Sean McManus 0cf237c839 Merge pull request #2725 from Microsoft/master
2nd merge for 0.20.0
2018-10-25 16:46:17 -07:00
Sean McManus e12bad5172 Fix 2 typos in the changelog. (#2723) 2018-10-25 16:42:57 -07:00
Bob Brown 04bb260577 update release notes (#2722) 2018-10-25 16:42:15 -07:00
Bob Brown ddc1f901c2 Merge pull request #2721 from Microsoft/seanmcm/0_20_0_release
Seanmcm/0 20 0 release
2018-10-25 16:21:08 -07:00
Sean McManus 9ca27af2df Merge. 2018-10-25 15:58:34 -07:00
Sean McManus b964d4ebc4 Fix comment for intelliSenseEngine setting. (#2720) 2018-10-25 15:57:20 -07:00
Sean McManus 082435ec8b Fix comment for intelliSenseEngine setting. 2018-10-25 15:48:28 -07:00
Sean McManus 324c5f59f4 Update changelog for 0.20.0 release. 2018-10-25 15:38:26 -07:00
Sean McManus 72581c23b7 Update changelog for 0.20.0. (#2718)
* Update changelog for 0.20.0.

* Revise changelog for 0.20.0.
2018-10-25 15:29:44 -07:00
Sean McManus 807ff80f56 Update vscode telemetry api used. (#2707) 2018-10-23 20:23:12 -07:00
Griffin Downs b0e17a1fd9 Don't update pre-releases (#2693) 2018-10-19 16:00:55 -07:00
Griffin Downs bc64d25a1d Ensure that package version suffix + version suffix version are set (#2686) 2018-10-19 15:29:38 -07:00
Sean McManus ed5d8c8fac Get rid of the MacCrash memory addresses. (#2695) 2018-10-18 19:17:36 -07:00
Sean McManus 3a9f4c404d Update changelog for 0.19.1-insiders3. (#2694) 2018-10-18 17:19:28 -07:00
Bob Brown 4330679e23 Don't allow configuration providers to activate the extension when IntelliSense is disabled (#2692) 2018-10-18 12:29:06 -07:00
Andrew Wang 88e9724892 Attempt to fix security and gulp 4.0 (#2689) 2018-10-17 14:34:21 -07:00
Sean McManus acf7b464eb Update changelog.md. (#2676)
* Update changelog.md.
2018-10-16 13:38:58 -07:00
Sean McManus 78f5a38110 Update changelog for 0.19.1-insiders2 (#2649)
* Update changelog for 0.19.1-insiders2
2018-10-11 15:59:02 -07:00
Pierson Lee 31eed4cee2 Add missing interop 15 file to dev workflow (#2643) 2018-10-11 12:28:32 -07:00
Pierson Lee ea8ab1358f Update CHANGELOG.md and copyDebuggerDependencies (#2641)
Update for VSCodeDebugProtocol dll and for the Integratedterminal Work.
2018-10-10 17:53:20 -07:00
Pierson Lee 55558a53e3 Update links for mono framework and runtime (#2640)
Updating to 5.14.0.177 of mono. Update TPN header per CELA
2018-10-10 16:37:23 -07:00
Griffin Downs 536685c8a0 Grdowns/update channel fix (#2637)
* Use shell optional arg

* Add try/catch around spawn to override any possible exceptions

* Default vsixname to cpptools-linux32.vsix

* Move logFailure inline

* Remove potential PII from error message to be on the safe side

* Fix linter errors

* Remove spawn optional arg; instead remove quotes surrounding command

* Remove rethrowing of error at the top level checkAndApplyUpdate

* Commenting

* Remove default case in switch statement for vsixName; Add x86, i383, i686 cases
2018-10-10 15:51:29 -07:00
Sean McManus b6f184744c Update changelog. (#2625) 2018-10-08 15:04:16 -07:00
Sean McManus 539ecc536f Update the changlog for 0.19.1-insiders. (#2615)
* Update the changlog for 0.19.1-insiders.
2018-10-08 11:42:59 -07:00
Sean McManus e819f36e91 Fix error when rootRui is null. (#2614) 2018-10-05 15:34:44 -07:00
Bob Brown 140670c371 Update c_cpp_properties.json.md 2018-10-04 08:48:54 -07:00
Pierson Lee 102ffc1616 Fixing quoting around ssh's command (#2604)
This fixes #2585
2018-10-03 17:35:02 -07:00
Bob Brown 28981f3ce6 remove telemetry that is already being blocked (#2603) 2018-10-03 16:45:53 -07:00
shankaryoga21 775aba8650 don't use falsy comparisons when resolving default settings. (#2592) 2018-10-02 13:18:16 -07:00
Bob Brown b3fb2558fd update telemetry version (#2593) 2018-10-02 12:46:35 -07:00
Griffin Downs 80716ae228 Grdowns/update channel4 (#2576)
* Remove redundant error telemetry
* Check rate limit before attempting to download release JSON
2018-10-02 10:13:10 -07:00
Bob Brown 6d71c6dd4f Merge pull request #2575 from Microsoft/bobbrow/releaseToMaster
Merge release to master
2018-09-28 09:54:40 -07:00
Bob Brown (DEVDIV) da68908e3e update version and fwlinks for October release 2018-09-28 09:35:26 -07:00
Sean McManus 963ee02117 Merge pull request #2572 from Microsoft/master
Merge latest changes
2018-09-27 15:05:13 -07:00
Sean McManus 45a1804da4 Update changelog. (#2571) 2018-09-27 14:57:45 -07:00
Pierson Lee f66eb138f4 Return null config to VS Code (#2570)
return null to trigger VS Code to open a configuration file
https://github.com/Microsoft/vscode/issues/54213
2018-09-27 14:32:35 -07:00
Bob Brown da862646c3 Merge pull request #2566 from Microsoft/bobbrow/release-19.0
Bobbrow/release 19.0
2018-09-26 16:32:14 -07:00
Bob Brown (DEVDIV) 1bcaa540b6 update version number and fwlink for abtesting json 2018-09-26 16:30:07 -07:00
Bob Brown 96e3386288 september release notes/string changes (#2563) 2018-09-26 13:38:54 -07:00
Sean McManus 862a10f3f8 Merge branch 'master' of https://github.com/Microsoft/vscode-cpptools 2018-09-26 13:16:13 -07:00
Sean McManus 2e62382b24 Update changelog for 0.19.0. 2018-09-26 13:15:40 -07:00
Sean McManus 5f9ef54c54 Add ab testing for Go to Def (fix some ab testing bugs) (#2559)
* Add goto_def_intellisense abTesting.
2018-09-26 09:39:31 -07:00
Bob Brown 4575e2840e incorrect warning messages (#2560) 2018-09-25 17:13:10 -07:00
Bob Brown a9a09dcd11 Only serialize tasks that require it (#2553)
* Remove serialization in the queuing except for cases that actually need it
2018-09-25 13:28:14 -07:00
Bob Brown e0e7944f3a Don't add workspaceFolderBasename to new config files (#2552) 2018-09-25 12:48:14 -07:00
Griffin Downs 63e18afcf1 Update Channel pt 3 (#2543)
* Instead of uninstalling then installing, install and override when prompted
2018-09-24 16:32:06 -07:00
Bob Brown fcdcd80157 Fixing queuing logic that stalls LS on Mac (#2540) 2018-09-24 15:01:06 -07:00
Griffin Downs 126cf7cef6 Update channel feature pt 2 (#2541)
* Find Mac code script; Commenting; Move code into try catches correctly filter errors; Add notification on installation

* Merge files from correct commit

* Revert changes made from not having master branch code
2018-09-21 16:25:27 -07:00
Bob Brown ad451bb438 Resolve empty array environment variables #2532 (#2534) 2018-09-20 16:15:32 -07:00
Griffin Downs 83be111769 Add updateChannel setting (#2465)
* Read json from harded-coded file location

* Expose settings tracker

* Get linux download url

* Remove unused imports

* Correctly get changed setting

* Add update timer

* Minimum end to end

* Refactoring; Commenting; Renaming

* Commenting

* Add optional param to download fn; Refactoring; Renaming

* Commenting; Then parse fn

* Mark vars const; Add todos; Refactoring

* Commenting; Refactoring

* url from any to string; Index into parsed json as separate step

* Use temp files to prevent clutter

* Correct windows platform name check; Replace quotes

* Resolve vsixName for mac + win

* Factor version comparisons into ParsedVersion class while correcting version comparison

* Use which utility to find code script

* Update timer to once per hour

* Move downloadFileToDestination to common; Replace downloadCpptoolsJsonAsync

* Return changed settings on onDidChangeSettings

* Get changed settings without stealing them

* Remove tracker from client interface

* Add basic isReleaseJson fn; Add telemetry; Add catch functions

* Write type predicates for release json

* Refactoring; Rewrite version check; Rewrite build selection

* Factor target build search into helper fn

* Reorder fn defs

* Uninstall version before installing if downgrading

* Add undefined checks; Update version comparison

* Reorder fn

* Telemetry rename; Parse versions more safely

* Turn ParsedVersion into interface; Rename release to build

* Fix fn return types

* Commenting

* Remove unneeded validity check

* Rename telemetry event; Correct fn return type

* Update setting description

* Remove promise rejection

* Remove unwanted changes

* Rename var

* Remove imports; Move call to updateSettingsAsync to .then in abTesting

* Remove import; Remove unneeded uses of await

* Remove comment

* Reformat else ifs

* Remove '| undefined' instances

* Use find fn more idiomatically

* Add type specification for predicates + rename them

* Add url var to shorten call to downloadFileToDestination

* Move parsedVersion to separate file

* Move parsedVersion into PackageVersion class

* Move helper fn's to separate file

* Get script name for both insiders and release VSCode (untested)

* Move packageVersion + ghAPI from LanguageServe to src

* Update imports to reflect mv; Check isValid on PackageVersion

* Add todo's

* Correctly get download URL; Correctly verify releaseJson by only checking recent 5 builds

* Check version numbers against undefined instead of 0

* Await install command before removing install file; Change var name

* Re-merge package.json

* Rename ghAPI.ts to githubAPI.ts

* Rename vars; Remove TODO

* Modify version comparison (untested)

* Remove todo

* Create file async

* Download and install file async

* Rework promises

* Make functions async where possible

* Commenting

* Grandfather in insiders users

* Change syntax via await keyword

* Re-enable interval timer

* Add updateChannel settings get

* Immediately check for update on extension activation if on insiders

* Surround windows code script path in quotes

* Rename versionStr to version

* Change telemetry event

* Update telemetry/exception handling

* Update telemetry strings; Reformat is functions

* Another pass at promises + telemetry

* Commenting

* Remove undefined from fn return

* Fix headers not being forwarded to recursive call

* Another pass at promises

* Correctly return promise in checkAndApplyUpdate

* Remove debug vars

* Rename fns

* Fix version parsing

* Tidy version comparison

* Remove commented out code

* Variable rename; Add newline at EOF

* Add newline at EOF

* Commenting; Unbind functions and use function syntax for .thens

* Error message; add rejection

* Correct exceptions being handled one promise too late

* PR feedback

* Rewrite promise chain to await to allow premature cancellation of promise chain

* Mark vars const; Comment; Rename var
2018-09-19 10:44:24 -07:00
Bob Brown 2f931d930d Implement provider API v2 (#2531)
* Implement provider API v2
2018-09-18 16:33:08 -07:00
Sean McManus bc6cb3e55f Add the active selection end. (#2511)
* Add the active selection end.
2018-09-17 14:11:13 -07:00
Gabriel Arjones f44e9068ca Allow workspaceFolderBasename in default settings (#2503) 2018-09-10 12:33:30 -07:00
Gabriel Arjones c206a4b88c Add support for 'workspaceFolderBasename' expansion (#2491) (#2495) 2018-09-07 15:06:08 -07:00
Bob Brown 9e95e412a8 The user settings were not considered when querying the active configuration provider (#2485) 2018-09-05 12:40:28 -07:00
Bob Brown 86ce6c6115 Update c_cpp_properties.json.md 2018-09-04 09:17:44 -07:00
Pierson Lee ecd3eb24f4 Fix sh command (#2475)
When the change from bash to sh happened, the comparison operator was
not updated.

Fixes #2444
2018-08-31 15:30:33 -07:00
Bob Brown 25e29a01c2 Fix bug in default CL macros (#2468)
* incorrect cl macros being defined
2018-08-30 17:00:56 -07:00
Bob Brown e9b8ad66a1 fix bad line endings (#2469) 2018-08-30 16:48:44 -07:00
Bob Brown 3e5a6aae80 Update c_cpp_properties.json.md 2018-08-28 10:47:22 -07:00
Bob Brown 49fea0249d Update MinGW.md 2018-08-28 10:45:36 -07:00
Bob Brown 7de9956a92 Update Windows Subsystem for Linux.md
a few people seem to be getting confused about the example usage
2018-08-28 08:38:29 -07:00
Bob Brown 9abf44b7ac Update language-service.md (#2454) 2018-08-27 12:52:35 -07:00
Bob Brown daaf169c8a Update Enabling logging.md 2018-08-24 11:27:23 -07:00
Bob Brown 23d94452bb Update MinGW.md 2018-08-20 08:29:41 -07:00
Bob Brown 705122a168 update master branch version (#2428) 2018-08-17 13:53:15 -07:00
Sean McManus 757f1f94be Merge pull request #2427 from Microsoft/master
Update changelog and version for 0.18.1. fwlinks don't need to change…
2018-08-17 11:08:28 -07:00
Sean McManus 7fe2db1202 Update changelog and version for 0.18.1. fwlinks don't need to change. (#2426) 2018-08-17 10:53:49 -07:00
Sean McManus d8738c3e0c Merge pull request #2421 from Microsoft/master
Update changelog. (#2420)
2018-08-17 06:07:19 -07:00
Sean McManus b1bd33b8f4 Update changelog. (#2420) 2018-08-17 06:05:16 -07:00
Sean McManus 436c483d35 Merge pull request #2418 from Microsoft/master
Register the config provider for new clients. (#2416)
2018-08-17 05:05:56 -07:00
Sean McManus 99bd382707 Register the config provider for new clients. (#2416) 2018-08-16 15:50:36 -07:00
Bob Brown 356bb903d0 Merge pull request #2414 from Microsoft/master
Merge for 0.18.0
2018-08-16 10:34:19 -07:00
Sean McManus b0fc9427cf Merge branch 'release' into master 2018-08-16 10:01:07 -07:00
Sean McManus 60b20dce8d Update package-lock and fix new linter errors. (#2412)
Update package-lock and fix new linter errors.
2018-08-16 09:59:18 -07:00
Sean McManus 906fd2d8f0 Seanmcm/auto open cpp properties (#2410)
* Invoke `Edit Configurations...` when the `Configuration Help` button is clicked.
2018-08-16 09:34:20 -07:00
Bob Brown 4afadad93b update changelog (#2411) 2018-08-16 09:22:46 -07:00
Sean McManus 3790fa95e7 Add intelliSenseEngine "Disabled". (#2392)
* Add intelliSenseEngine "Disabled".
2018-08-16 09:12:32 -07:00
Griffin Downs a0882446d9 Update changelog to reflect compile commands parsing fix (#2409)
* Update changelog to reflect compile commands parsing fix
2018-08-16 06:35:39 -07:00
Sean McManus ce59810a6d Update changelog for 0.18.0. (#2384)
* Update changelog for 0.18.0.
2018-08-15 13:45:38 -07:00
Sean McManus 770013d77e Enable environment variables with clang_format_path. (#2380)
* Enable environment variables with clang_format_path.
2018-08-15 09:39:45 -07:00
Pierson Lee 2388fa97f4 Update FAQs.md (#2343) 2018-08-08 11:26:53 -07:00
Sean McManus 3381cde61c Update changelog for 0.17.8-insiders. (#2353)
* Update changelog for 0.17.8-insiders.
2018-08-03 17:36:17 -07:00
Sean McManus 3a46f10d97 Add gcc-x64 intelliSenseMode. (#2315)
* Add gcc-x64 intelliSenseMode.
2018-08-02 13:53:19 -07:00
Bob Brown 2b4b5d397d add a setting to modify the behavior of go to symbol in workspace (#2349)
* add a setting to modify the behavior of go to symbol in workspace
2018-08-02 13:37:47 -07:00
Andy Neff c36eb8e7b1 Using sh instead of bash (#2340)
Fixes #569
2018-07-30 15:37:55 -07:00
Bob Brown ad46d3887a Only allow one configuration popup at a time (#2337) 2018-07-30 14:28:19 -07:00
Bob Brown 8b704f5972 allow users to use ~ for ${userprofile} on Windows (#2333) 2018-07-27 12:50:56 -07:00
Bob Brown 1009b76b22 minor tweaks to config provider experience (#2302) 2018-07-27 09:27:14 -07:00
John Patterson 84ff661e15 adds CHANGELOG entry for PR 2322 (#2325)
Realized I had left out the CHANGELOG update. For [PR
2322](https://github.com/Microsoft/vscode-cpptools/pull/2322).
2018-07-27 09:24:11 -07:00
Xeonacid 2292e7d762 Improve description in Extension/README.md (#2336)
`MinGW` is the proper spelling

`OS X` is now called `macOS`
2018-07-27 09:23:40 -07:00
Andrew Wang c8e30c70b1 Allow telemetry to detect failed downloads (#2332) 2018-07-26 13:35:34 -07:00
John Patterson 7947dd80d6 Add multi-pass environment variable resolution (#2322)
* Dependent variable definition
```
"env": {
    "envRoot": "apps/tool/builldenv",
    "arm6.include": "${envRoot}/arm6/include"
},
...
"some_config": "${arm6.include}
```

* Additionally, this fixes an open bug that was not reported. If a variable contained "env", "config", or "workspaceFolder" it would not be parsed correctly. If you used a variable ${envRoot} it would match "envR" as the type and "oot" as the variable. This has been resolved.

* Also fixes travis-ci to run the unit tests as part of checkin validation
2018-07-24 14:40:58 -07:00
John Patterson 913f740cc2 adds settings for inactive region font & bg color (#2308)
* adds settings for inactive region font & bg color

This adds the inactiveRegionForegroundColor and inactiveRegionBackgroundColor
settings. If a preprocessor block is found to be inactive, it will be
colored by these fields if they are set. They accept hexadecimal font
strings or valid theme colors as their values.These fields also
interactive with the dimInactiveRegions setting.

This was requested in issue
https://github.com/Microsoft/vscode-cpptools/issues/2212.
2018-07-23 15:52:41 -07:00
Sean McManus 2cbc90d98b Fix empty windowsSDKVersion. (#2301) 2018-07-20 17:07:14 -07:00
Bob Brown 25a29d0bc3 update fwlinks 2018-07-20 10:45:55 -07:00
Bob Brown 052f4e7b39 update version 2018-07-20 10:34:59 -07:00
Bob Brown 2b245202b5 Merge pull request #2295 from Microsoft/bobbrow/merge_release
0.17.7
2018-07-19 12:27:41 -07:00
Bob Brown 15c6c0a50e update version number 2018-07-19 12:23:32 -07:00
Bob Brown a0e0254c73 Add a setting to silence configuration provider warnings (#2293)
* Add a setting to silence configuration provider warnings
2018-07-19 12:14:05 -07:00
Sean McManus 528905326f Update changelog. (#2289) 2018-07-19 12:03:37 -07:00
Sean McManus 458b2be489 Update changelog for 0.17.7. (#2288)
* Update changelog for 0.17.7.
* Fix main snippet.
2018-07-18 16:10:00 -07:00
Pierson Lee 95d4724dc8 Update launch.md with miDebuggerArgs (#2270) 2018-07-13 15:56:49 -07:00
Sean McManus a178faab9b Update cpp.hint to use the injected defaults. (#2261) 2018-07-12 15:22:47 -07:00
Sean McManus 25aa8206a0 Update changelog. (#2257)
* Update changelog.
2018-07-12 14:54:21 -07:00
Sean McManus 879d880c82 Seanmcm/windows sdk version (#2241)
* Add windowsSDKVersion.
2018-07-10 15:57:03 -07:00
Bob Brown 16c4defcd0 Add a command to change the active custom config provider (#2247) 2018-07-09 16:03:35 -07:00
Bob Brown 725828c1c5 disable the config provider message for headers outside the workspace & while debugging (#2239)
* disable the config provider message for headers & while debugging

* leave the message on for headers inside the workspace folder
2018-07-07 15:11:46 -07:00
Bob Brown 8b188541ba fix spelling 2018-07-06 14:09:42 -07:00
Sean McManus 28f1bc991e Add ${VcpkgRoot} variable 2018-07-06 14:08:37 -07:00
Sean McManus aa424f1946 Fix bug c_cpp_properties.json creation after being deleted. (#2235)
Fix bug c_cpp_properties.json creation after being deleted: https://github.com/Microsoft/vscode-cpptools/issues/2214
2018-07-06 13:12:08 -07:00
Bob Brown 130711f4c5 Update Building the Extension.md 2018-07-03 10:25:12 -07:00
Bob Brown 863d26451c Merge pull request #2218 from Microsoft/master
merge master -> release
2018-07-02 11:38:35 -07:00
Bob Brown 0a85b6c115 Merge branch 'release' into master 2018-07-02 11:38:11 -07:00
Sean McManus f2b3bd5a18 Update changelog. (#2213)
* Update changelog.
2018-07-02 11:33:07 -07:00
Bob Brown ab3e498c17 update version for insiders branch (#2211) 2018-06-29 14:08:08 -07:00
Bob Brown bfad3045bd Merge branch 'insiders' into master 2018-06-29 14:00:30 -07:00
Andrew Wang 842e685a6a Removing dashes for ps command (#2185) 2018-06-29 13:59:14 -07:00
Bob Brown 3b36a23956 Merge pull request #2203 from Microsoft/master
merge master (one more change for 0.17.6)
2018-06-28 16:11:04 -07:00
Bob Brown bf7287e70b Merge branch 'master' of https://github.com/Microsoft/vscode-cpptools 2018-06-28 16:09:01 -07:00
Bob Brown 63ce03573c vscode-cpptools is in the wrong dependency list 2018-06-28 16:08:48 -07:00
Bob Brown 9ddf1098f7 update version for release (#2201)
* Update package.json

* Update package-lock.json
2018-06-28 12:58:02 -07:00
Bob Brown 56f4be1f65 Merge pull request #2200 from Microsoft/master
merge master to release for 0.17.6
2018-06-28 12:56:01 -07:00
Bob Brown 3b6dc61562 sanitize inputs (#2199) 2018-06-28 12:47:06 -07:00
Sean McManus b8a15ddfe6 Updated changelog and fwlinks. (#2195)
* Updated changelog and fwlinks.
2018-06-27 20:23:31 -07:00
Bob Brown f3e188c0ce fix version number (#2194)
* Update package.json

* Update package-lock.json
2018-06-27 13:20:12 -07:00
Bob Brown d403c8f984 Polishing the custom configuration provider experience (#2188) 2018-06-26 13:10:49 -07:00
Bob Brown 35288aad17 start sending installation failure telemetry again (#2189) 2018-06-26 12:35:58 -07:00
Bob Brown 9604256fb8 Merge pull request #2168 from Microsoft/master
Fix ${config:a.b} https://github.com/Microsoft/vscode-cpptools/issues…
2018-06-21 18:42:58 -07:00
Bob Brown d3f701823d Merge branch 'release' into master 2018-06-21 18:42:44 -07:00
Sean McManus 987347c4b6 Update CHANGELOG.md (#2161)
* Update CHANGELOG.md
2018-06-21 18:04:33 -07:00
Sean McManus 7e7a522603 Fix ${config:a.b} https://github.com/Microsoft/vscode-cpptools/issues… (#2166)
* Fix ${config:a.b} https://github.com/Microsoft/vscode-cpptools/issues/2165 .
2018-06-21 18:04:05 -07:00
Bob Brown 14bc488e5b Merge pull request #2154 from Microsoft/master
merge 0.17.5 release notes
2018-06-19 14:57:20 -07:00
Bob Brown 352745754b update (#2153) 2018-06-19 14:52:37 -07:00
Bob Brown dde3b515db update version numbers (#2152)
* Update package.json

* Update package-lock.json
2018-06-19 12:12:30 -07:00
Bob Brown cc6d7f3cac Merge pull request #2150 from Microsoft/master
0.17.5 merge from master
2018-06-19 12:10:38 -07:00
Bob Brown f8dbe57da7 Merge branch 'release' into master 2018-06-19 11:51:57 -07:00
Sean McManus 4fe877ed26 Update changelog, fwlinks, and fix an issue with abTesting. (#2143)
* Update changelog, fwlinks, and fix an issue with abTesting.
* Adding debugger changes to changelog
2018-06-19 11:41:22 -07:00
Griffin Downs 974ecd3ecb Grdowns/detect compile commands (#2137) 2018-06-19 10:36:01 -07:00
Bob Brown 7be69a0880 Bobbrow/recursive includes (#2136)
* Make recursive includePath the default again. Refactor A/B testing stuff.

* fix initialization dependency bug

* bugfix
2018-06-15 16:39:01 -07:00
Bob Brown d77470f753 make browse.path optional (#2135) 2018-06-15 16:34:57 -07:00
James Hamm 846cdc3a32 Updated the link for creating issues. (#2126)
The current link returns a 301 (permanent redirect) so we may as well just point straight to the site.
2018-06-13 07:41:45 -07:00
Andrew Wang 17c307a369 Adding miDebuggerArgs (#1974)
Fixing GenerateOptionsSchema too, due to linting fixes
2018-06-07 18:26:47 -07:00
Andrew Wang 485d762d70 Updating debugging MI Engine docs (#2103)
* Updating debugging MI Engine docs

* Forgot extensions
2018-06-07 18:18:31 -07:00
Sean McManus 4b90e4c151 Merge pull request #2100 from Microsoft/0_17_5_insiders
0 17 5 insiders
2018-06-07 16:26:44 -07:00
Sean McManus cc85f3d7c3 Merge, Also updated changelog and versions. 2018-06-07 16:15:56 -07:00
Sean McManus 73c025dcee Update dependencies due to vulnerabilities from npm audit. (#2095)
* Update dependencies due to vulnerabilities from npm audit.
2018-06-07 14:24:12 -07:00
Bob Brown 90b1ebd74c update version (#2097)
* Update package.json
* Update package-lock.json
2018-06-07 09:16:50 -07:00
Griffin Downs 3027e18968 Grdowns/inactive region opacity (#2061) 2018-06-06 12:14:19 -07:00
Pierson Lee 7729d0a700 Update issue templates (#2087)
* Update issue templates

* Remove old issues_template.md
2018-06-04 16:54:33 -07:00
Sean McManus c0e32437df Update version. (#2071) 2018-05-31 16:11:05 -07:00
Sean McManus b580b7347f Merge pull request #2069 from Microsoft/master
0.17.4 release
2018-05-31 16:07:20 -07:00
Bob Brown 4b5b086150 Merge branch 'release' into master 2018-05-31 16:01:48 -07:00
Sean McManus c5105f0731 Update for 0.17.4. (#2067) 2018-05-31 15:53:11 -07:00
b5e00c068e disable recursive includePath for ${workspaceFolder} in default c_cpp_properties.json (#2059) 2018-05-31 12:44:44 -07:00
Bob Brown 9b33938293 Fix startup bug (#2065) 2018-05-31 12:16:36 -07:00
Bob Brown a096ec9c6f Update Customizing Default Settings.md
typo
2018-05-25 10:00:42 -07:00
Bob Brown 847a2e3d5a reduce promise reject messages in the standard case (#2041) 2018-05-24 16:32:46 -07:00
Bob Brown 7b91a97ba7 Update extension version (#2035)
* Update package.json

* Update package-lock.json
2018-05-24 12:21:48 -07:00
henrywiechert 306a55da2e Update IntelliSense engine.md (#2040)
fix a link
2018-05-24 12:20:58 -07:00
Sean McManus 7553bb9358 Update ISSUE_TEMPLATE.md (#2030) 2018-05-22 13:34:39 -07:00
Sean McManus d786b0f602 Merge pull request #2029 from Microsoft/seanmcm/0_17_3_release
Seanmcm/0 17 3 release
2018-05-22 13:17:55 -07:00
Bob Brown a60c1c51f5 doc updates (#2028) 2018-05-22 12:58:29 -07:00
Bob Brown 891d590562 add support for ${workspaceFolder:<folder_name>} (#2027) 2018-05-22 12:58:09 -07:00
Sean McManus df7b77b6cf Update for 0.17.3. 2018-05-22 12:54:40 -07:00
Bob Brown 94a2b67e14 add support for ${workspaceFolder:<folder_name>} 2018-05-22 12:49:13 -07:00
Sean McManus fbbe28458a Merge for 0.17.2-insiders. 2018-05-21 19:24:59 -07:00
Sean McManus 5883747474 Update package-lock.json. (#2024) 2018-05-21 16:49:05 -07:00
Sean McManus 3f62ffd135 Merge pull request #2023 from Microsoft/seanmcm/0_17_2_release
Seanmcm/0 17 2 release
2018-05-21 16:00:03 -07:00
Sean McManus 7de9d166b8 Update version. 2018-05-21 15:19:50 -07:00
Sean McManus 2edf7267e8 Update for 0.17.2. (#2022) 2018-05-21 15:18:37 -07:00
Sean McManus 3f5b0b7220 Update for 0.17.2. (#2022) 2018-05-21 15:14:40 -07:00
Bob Brown baebe0acec Merge pull request #2011 from Microsoft/bobbrow/regression
fix regression from extension API change
2018-05-18 14:20:32 -07:00
Bob Brown 6d1264e6b1 fix regression from extension API change 2018-05-18 14:11:17 -07:00
Bob Brown 0d80edba3d Update package.json 2018-05-18 13:33:00 -07:00
Bob Brown 76870c637c Merge pull request #2010 from Microsoft/master
Merge master into insiders
2018-05-18 13:32:20 -07:00
Bob Brown 7cd7d3422c Update package.json 2018-05-18 13:31:37 -07:00
Bob Brown a4edf98976 Update package.json 2018-05-18 13:31:25 -07:00
Bob Brown bffafc058a Merge branch 'insiders' into master 2018-05-18 13:30:35 -07:00
Sherry Shi 01efb1a584 Allow other VS Code extensions to provide custom intellisense configurations. (#1804) 2018-05-18 11:03:08 -07:00
Sean McManus b1e40a4ccc Merge pull request #2005 from Microsoft/seanmcm/0_17_1_release
Seanmcm/0 17 1 release
2018-05-17 12:10:07 -07:00
Sean McManus 7d4aed2009 Update version. 2018-05-17 11:34:10 -07:00
Sean McManus 20d782349d Merge branch 'master' into release 2018-05-17 11:30:23 -07:00
Sean McManus a3a0572325 Merge branch 'release' 2018-05-17 11:28:44 -07:00
Sean McManus c9473b21d4 Update changelog. (#2003) 2018-05-16 19:57:30 -07:00
Sean McManus 74b5867660 Seanmcm/0 17 1 changelog (#1996)
* Updates for 0.17.1.
* Add C++17 fixes for msvc-x64.
2018-05-15 15:48:06 -07:00
Bob Brown d1e90b507f Remove outdated logic from getConfigIndexForPlatform (#1992) 2018-05-14 23:02:35 -07:00
Bob Brown 7f10e90a6f update https-proxy-agent version (#1984) 2018-05-11 16:38:30 -07:00
Bob Brown fbfb83ac30 Update Enabling logging.md 2018-05-11 14:08:45 -07:00
Bob Brown 8f8ed52aae Fix the file watcher (#1983) 2018-05-11 12:33:42 -07:00
Bob Brown a190707f67 update telemetry for settings changes (#1973)
update telemetry for settings changes
2018-05-09 15:11:29 -07:00
Bob Brown 79871a6587 update c_cpp_properties.json reference 2018-05-08 16:10:30 -07:00
Bob Brown ba65c4877c documentation updates for 0.17.0 (#1952)
* documentation updates for 0.17.0

* updates to logging docs

* PR feedback
2018-05-08 15:01:15 -07:00
Bob Brown 8c6a167787 update package.json for release (#1951)
* update package.json for release

* Update package-lock.json
2018-05-07 13:49:53 -07:00
Bob Brown 0ac4744c11 Merge pull request #1950 from Microsoft/master
Merge master -> release
2018-05-07 13:47:11 -07:00
Bob Brown 7ea61221bc update release notes and don't enable recursive includes by default in new folders (#1948)
* update release notes and don't enable recursive includes by default in new folders.

* changelog bug
2018-05-07 13:44:53 -07:00
Andrew Wang ff31eef0a2 Extension Development Improvements (#1941)
1. Updated tasks.json to 2.0
2. Added tslint problem matcher
   - Weird issue that problem does not disappear when resolved.
3. Adding tslint for class and function names.
   - class must be in PascalCase
   - funcitons must be in camelCase
4. Addressing vulnerability warning
   - https://github.com/Microsoft/vscode/issues/49146
2018-05-07 11:22:12 -07:00
jogo- 842856f08a Fix typo in README.md (#1944) 2018-05-07 10:41:38 -07:00
jogo- 2ded5b241e Fix typo in c_cpp_properties.schema.json (#1945) 2018-05-07 10:40:56 -07:00
Bob Brown 58cfb5ee10 add support for custom variables (#1921)
* add support for custom variables

* support for string[] variables

* rename "variables" to "env"
2018-05-04 20:18:42 -07:00
Andrew Wang 8deee74b68 Adding OptionsSchema generation (#1937)
* Adding OptionsSchema generation

This is to prevent repetitive fields from being copy and pasted
improperly.

* Move tslint to be after compile

* Address PR issues
2018-05-04 16:19:53 -07:00
Sean McManus d6aa178cac Fix issues introduced with VS Code 1.23.0. (#1925) 2018-05-03 16:57:38 -07:00
Bob Brown b5b1ceea98 trim the path before checking if it exists (#1924) 2018-05-03 16:27:03 -07:00
Bob Brown 264ed5eb23 trim the path before checking if it exists (#1924) 2018-05-03 16:21:52 -07:00
Griffin Downs ded26d66b0 Move settings update into updateToVersion4 function (#1916) 2018-05-03 12:47:45 -07:00
Bob Brown 90d28133e4 Update package.json (#1923)
* Update package.json
* Update package-lock.json
2018-05-02 22:16:21 -07:00
Bob Brown 39273f1087 Merge pull request #1922 from Microsoft/master
merge master into insiders for April insiders2
2018-05-02 22:12:14 -07:00
Sean McManus 00008a2d80 Dev/seanmcm/update changelog master0 17 0 insiders2 (#1920)
* Update changelog.

* Update changelog with snippets/vcpkg change.
2018-05-02 22:09:52 -07:00
Bob Brown 9396786be8 update changelog (#1918)
* update changelog

* PR feedback
2018-05-02 16:59:44 -07:00
Jim Griesmer da17254c03 Provide user hint through IntelliSense fallback msg that vcpkg is installed and is being used. (#1910) 2018-05-02 15:42:06 -07:00
Andrew Wang 3ddc2292cd Improve README, issue template, and test error output (#1898)
* Improve README and test error output

* Adding popular feature requests

* Feature Requests gets thumbs up, not issues.

* Adding info for issues
2018-05-02 13:47:04 -07:00
Sean McManus f58217f03f Recursive includePath changes. (#1896)
* Recursive includePath changes.
* Keep config/icons visible with settings json files.
2018-04-30 14:16:51 -07:00
Jim Griesmer f2d328161e Slight tweak for what vcpkg will do. (#1897) 2018-04-30 14:04:41 -07:00
Jim Griesmer 947fb78e9a Users/jimgries/snippets (#1823) 2018-04-30 13:55:01 -07:00
Bob Brown 0521bbec32 additional logging for language server spawn failure (#1895)
* additional logging for language server spawn failure
* Show the client failure message once per session instead of once in forever
2018-04-30 08:11:00 -07:00
Jim Griesmer 9249e27df5 Initial implementation for supporting vcpkg (#1886)
* Initial implementation for supporting vcpkg
2018-04-27 14:50:24 -07:00
Bob Brown 063c4bd753 shouldn't be attempting to re-register vscode's commands (#1893) 2018-04-27 13:30:48 -07:00
Andrew Wang 7c34669c60 Updating License.txt (#1879)
* Updating EULA

* Fix text

* Updated fwlink for vsdbg
2018-04-27 12:09:37 -07:00
Bob Brown 7f2fa088d8 remove bad bracket 2018-04-24 21:00:57 -07:00
Bob Brown 548d32f21b workspaceFolder 2018-04-24 20:58:44 -07:00
Bob Brown e55ef6e153 fix commas 2018-04-24 20:57:37 -07:00
Bob Brown 8a0fe21176 Merge branch 'master' into insiders 2018-04-24 08:32:06 -07:00
Bob Brown fdff9df795 wrong name for enum (#1872) 2018-04-24 08:31:39 -07:00
Bob Brown d4e23a6063 merge master for 0.17.0 insiders build 2018-04-23 15:24:34 -07:00
Sean McManus 80da21f199 Seanmcm/update changelog0 17 insiders1 (#1867)
* Update changelog.md.

* Added the clang-format 6.0 update.
2018-04-23 15:19:14 -07:00
Sean McManus b60b17b6a5 Update changelog.md. (#1866) 2018-04-23 15:02:39 -07:00
Bob Brown 6faac1071f Fixing issues found while testing settings changes (#1865)
* Fixing issues found while testing settings changes

* missed a property in the schema

* additional safety around config updates
2018-04-23 14:13:34 -07:00
Sean McManus 6648c400b7 Add preferredPathSeparator setting and update package.json version and fwlinks (#1854)
* Add preferredPathSeparator setting
* Update package.json version and fwlinks.
2018-04-20 14:15:56 -07:00
Bob Brown 8f21515eeb Add VS Code settings for configuration properties (#1848)
* Add VS Code settings for configuration properties
2018-04-19 15:20:20 -07:00
Sean McManus 313ce1928f Update c_cpp_properties.json.md (#1851) 2018-04-19 14:52:40 -07:00
Bob Brown 999aad5633 fix typo 2018-04-18 14:40:01 -07:00
Bob Brown 136091e8ce Updates to MinGW documentation (#1844)
* documentation update for mingw
2018-04-17 13:32:24 -07:00
Sean McManus 91e4f64f3d Update MinGW.md (#1841) 2018-04-16 08:44:25 -07:00
Andrew Wang 1318cce09f Adding snippet to fix pipeProgram in pipeTransport (#1829)
* Adding snippet to fix pipeProgram in pipeTransport

Now with VSCode 64 bit, WSL users need to use the correct pipeProgram in
the correct folder. We will attempt to help users with this.

* Fix tslint issue

* Remove 64 bit check and check for relative path
2018-04-13 18:02:21 -07:00
Andrew Wang 308e5a5c13 Download and Install Progress Window for Packages (#1806)
* Adding progress bar

* Updating vscode requirement and package version

* Updating message
2018-04-10 16:19:39 -07:00
Bob Brown e2b5bf9fbc Address config issues: #1599, #1790 (#1807)
* addresses #1599, #1790

* Update all configs when c_cpp_properties.json is parsed
2018-04-10 14:34:43 -07:00
Andrew Wang 7cff0f175d Prevent package.json rewrite from being checked in with test (#1809)
* Fix up package.json rewrite

VSCode package.json is readonly.

Rewriting package.json will use the disk package.json to prevent getting
expanded fields from VSCode. It will only read from disk once.

Added `gulp pr-check` to make sure that package.json activationEvents has
not been rewritten for open source contributers.

* run pr-check needs to be before run test

* Update log message
2018-04-10 12:04:29 -07:00
Pierson Lee 6517b8e395 Update launch.md for args to include comment about doublequoting (#1794)
* Update launch.md

* Update launch.md
2018-04-10 11:05:01 -07:00
Sean McManus a44bab5589 Fix https://github.com/Microsoft/vscode-cpptools/issues/1792 . (#1793) 2018-04-04 17:10:40 -07:00
Sean McManus 28102494b1 Update CONTRIBUTING.md (#1776)
Fix broken link.
2018-04-03 15:22:20 -07:00
Sean McManus 88a0494ce5 Merge pull request #1766 from Microsoft/master
Merge for 0.16.1 release
2018-03-30 17:08:02 -07:00
Sean McManus b32debdb76 Update package-lock.json version. (#1765) 2018-03-30 16:27:55 -07:00
Sean McManus 480af0c155 Dev/seanmcm/0 16 1 update (#1762)
* Update for 0.16.1.
2018-03-30 15:45:36 -07:00
Andrew Wang b65a89733c Adding file validation for download and unzip. (#1751)
* Adding file validation for download and unzip.

Refactored the download retry code.

Added error handlers for read and write streams.

WriteStream writes to a *.tmp file and then renames. This catches the
case if VSCode dies in the middle of this process and the file is
partially written. We will continue where we left off.

* Adding return to resolve/reject calls.

* Fix retry loop and check err in unlink and rename

* Actually wait for those promises

* Fix TSLint error
2018-03-28 15:58:08 -07:00
Bob Brown 3bbfed643f Merge pull request #1746 from Microsoft/master
Merge to release 0.16.0
2018-03-27 20:36:40 -07:00
Sean McManus 638fd678dc Update changelog date. (#1745) 2018-03-27 20:34:35 -07:00
Sean McManus ff5d363926 Don't set the compilerPath if the default is empty. (#1741)
* Don't set the compilerPath if the default is empty or compile commands is set.
* Guard against empty std.
2018-03-27 18:43:07 -07:00
Andrew Wang e0bb796423 Boolean default types should be boolean not string (#1732) 2018-03-23 13:27:59 -07:00
Sean McManus 1b218b2bd9 Merge pull request #1731 from Microsoft/dev/seanmcm/0_16_0_insiders2
Dev/seanmcm/0 16 0 insiders2
2018-03-23 13:26:27 -07:00
Sean McManus ddd85515fa Merge and update for 0.16.0-insiders2 2018-03-23 13:18:29 -07:00
Bob Brown d079892710 Merge pull request #1726 from Microsoft/master
Merge to release for 0.16.0
2018-03-22 12:23:03 -07:00
Sean McManus 56fd1e7076 Update changelog. (#1721)
* Update changelog.

* Minor edit.

* Forgot a bug fix.

* Add debugger bug.
2018-03-22 07:50:58 -07:00
Andrew Wang 1699ec02cd Adding -c flag to WSL configurations (#1722)
Missing the -c flag for bash.exe
2018-03-21 19:18:53 -07:00
Shubham Bhattar 97a635bf2d "taskName" changed to "label" as per version 2.0.0 (#1713)
Reference Link: https://code.visualstudio.com/docs/editor/tasks#_migrating-to-tasks-200
2018-03-21 12:44:47 -07:00
Bob Brown f5a2192235 update documentation (#1710) 2018-03-20 17:14:56 -07:00
Bob Brown 5d85eae737 Database icon is not using the theme color (#1638) (#1711) 2018-03-20 17:14:04 -07:00
Sean McManus 4fe2ec1bfe Dev/seanmcm/fix blank config with file watcher limit (#1709)
Fix blank config in the status bar (and browse engine stuck initializing) when the file watcher limit is hit.
2018-03-20 16:14:27 -07:00
Bob Brown 83a9cb2b02 anticipating release (#1703) 2018-03-19 15:58:57 -07:00
Bob Brown 905041068f More guards against crashes in configuration processing (#1702) 2018-03-19 15:58:25 -07:00
Sean McManus c68ad37d98 Seanmcm/change compiler path comments (#1688)
* Modify compilerPath description.

* Modification.
2018-03-15 13:04:29 -07:00
Bob Brown f857bc45c3 deal with error cases in configurations (#1687) 2018-03-14 13:28:48 -07:00
Bob Brown 263b69ed15 Merge pull request #1654 from Microsoft/master
don't repeatedly mark the c_cpp_properties.json file as dirty on Windows
2018-03-08 15:21:29 -08:00
Bob Brown 1177ab5cee don't repeatedly mark the c_cpp_properties.json file as dirty on Windows (#1653) 2018-03-08 15:16:19 -08:00
Bob Brown 3ca02dac55 Merge pull request #1652 from Microsoft/master
merge master
2018-03-08 08:59:51 -08:00
Sean McManus 17d19a93e0 Fix bug with compilerPath/cppVersion. (#1650) 2018-03-07 20:32:28 -08:00
Sean McManus 42698a85cd Update changelog.md and merge fix for https://github.com/Microsoft/vscode-cpptools/issues/1640. 2018-03-07 17:52:35 -08:00
Sean McManus 5fb96a6d02 Fix launch.json and activation stuck on cpptools.json downloading. (#1649)
* Fix launch.json and activation stuck on cpptools.json downloading.
2018-03-07 17:45:11 -08:00
Bob Brown 605adb1edd Merge pull request #1648 from Microsoft/master
merge master into insiders
2018-03-07 15:29:54 -08:00
Bob Brown 5e88dbfd79 Merge branch 'insiders' into master 2018-03-07 15:28:50 -08:00
Griffin Downs 35e002756e Check whether propertiesFile is null before accessing (#1647)
Travis looks like it's stalled. I'm going to force this in so we can build an insiders package.
2018-03-07 12:54:33 -08:00
Bob Brown 70cff29645 replace workspaceRoot with workspaceFolder (#1641)
* replace workspaceRoot with workspaceFolder (actual support is on the server side)
* update changelog
2018-03-06 08:35:03 -08:00
Sean McManus bd181c3b8f add compilerPath, cStandard, and cppStandard settings, fix inactive region deletion bug (#1549)
* Add compilerPath setting.
* Add code to query the default compiler.
* Add cStandard and cppStandard settings.
* Fix bug with inactive region deletion.
2018-03-02 16:29:27 -08:00
Bob Brown 00f70aed7c add support for force includes in c_cpp_properties.json (#1630) 2018-03-02 15:11:00 -08:00
Bob Brown bea033ef67 TypeScript compile needs to happen as part of prepublish step. (#1629) 2018-03-01 10:46:27 -08:00
Pierson Lee b05e8c5627 Correct Fix to make sure debugger dependencies are copied (#1621)
* Correct Fix to make sure debugger dependencies are copied

Fix double compile and make sure that it is only run once.

* Fix log

* Andrew requested outDir
2018-02-28 14:32:26 -08:00
Pierson Lee 523e8c9c26 Fixing misisng compile step before executing .js file (#1618) 2018-02-27 17:04:36 -08:00
Andrew Wang 6ad4814173 copySourceDependencies needs to be run every time (#1617)
This fixes the nightly builds
2018-02-27 15:58:20 -08:00
Bob Brown 6756be66d5 update c_cpp_properties.json documentation to version 3 (#1615) 2018-02-27 13:29:40 -08:00
Bob Brown a6c6c7e691 Add a setting to manage inactive region colorization (#1604) 2018-02-26 15:56:44 -08:00
Bob Brown 9937753e3a Add setting to enable multiline comment customizations (#1583)
* Work in progress.  Wrote framework for comment pattern handling.  Implementation incomplete and some bugs remain.

* address TODOs

* incorrect disposal

* incorrect type decorations

* WIP: update changelog, add a test

* test updates

* rename the setting, update package.json and add more tests

* deal with whitespace continuations

* address PR feedback
2018-02-21 13:35:51 -08:00
Andrew Wang 03cc6b26ec Adding setupCommands to attach configuraitons (#1593)
Addressing #1581
2018-02-20 17:11:29 -08:00
Hogyun Yu  (aka Philographer) 8cb05ed0cb Update ReleaseNotes.html (#1572) 2018-02-16 08:59:48 -08:00
Bob Brown d5fb6a1d15 faster launch times for extension debugging (#1555)
* add a way to speed up subsequent launches of the extension.

* A cleaner way to exit

* update package.json

* read the environment variable to short-circuit the node_modules check.
2018-02-15 12:44:05 -08:00
Sean McManus e5976d2656 Merge pull request #1557 from Microsoft/master
Merge for release.
2018-02-14 16:55:56 -08:00
Bob Brown e70f625212 release notes (#1566) 2018-02-14 16:42:48 -08:00
Bob Brown 625e5478be define __CHAR_BIT__ for Mac (#1564)
* define `__CHAR_BIT__` for Mac
* update changelog
2018-02-14 12:49:44 -08:00
Sean McManus e825292931 Update changelog. (#1556)
* Update changelog.
2018-02-13 17:29:36 -08:00
Charles Milette 2fcd4b4943 Add _UNICODE to default defines on Windows (#1540)
* Add _UNICODE to default defines on Windows
Fixes #1538
2018-02-08 17:42:22 -08:00
ronglums f5b2d30182 Moved the extension building instructions into a separate file. (#1537)
Moved the extension building instructions into a separate file.
2018-02-08 12:02:32 -08:00
Joshua Cannon d5af9a1b45 Adding configuration variable replacement in c_cpp_properties.json. (#1529)
* Adding configuration variable replacement in c_cpp_properties.json. #314

* Fixing issues brought up by linter
2018-02-07 10:35:31 -08:00
Faheel Ahmad e6d8d1fb28 Improve documentation (#1515)
* improve Markdown formatting
* use consistent formatting rules for all Markdown files
* fix typos
* fix broken links
2018-02-07 08:04:18 -08:00
Sean McManus 536182cf1f Change for insiders. 2018-02-01 12:58:43 -08:00
Bob Brown 7a39edaf65 Fix crash in client module (#1506)
Temporary key name was lost outside of the switch block, resulting in an attempt to access .length of 'undefined'
2018-01-31 14:29:16 -08:00
Griffin Downs fd7b691885 Inactive region highlight (#1505)
* Add intermediary type to safely construct vscode.Ranges for use

* Fix incorrect object definition

* Fix file empty edge case; refactor + comment out code while testing

* Use InputRegions (lines only); Remove commented out code

* Commenting

* Fix linter error from merge with master
2018-01-31 14:02:01 -08:00
Sean McManus 42ddf188f3 Fix for https://github.com/Microsoft/vscode-extension-telemetry/issues/7 (#1499)
* Fix for https://github.com/Microsoft/vscode-extension-telemetry/issues/7 .
* Filter out settings values that don't match enum values.
2018-01-29 17:24:08 -08:00
Sean McManus 3512cb370b Seanmcm/telemetry fix (#1494)
* Fix telemetry.
2018-01-29 12:56:43 -08:00
Andrew Wang aa0f613dfb Force semicolon in object literal (#1493) 2018-01-26 11:01:44 -08:00
Griffin Downs b68d1e173e Add intermediary type to safely construct vscode.Ranges for use (#1492)
* Add intermediary type to safely construct vscode.Ranges for use

* Fix incorrect object definition
2018-01-25 16:46:24 -08:00
Sean McManus 58e403d9e0 Merge pull request #1490 from Microsoft/seanmcm/update0_15_0
Update stuff for 0.15.0 in preparation for the insider release.
2018-01-25 15:52:14 -08:00
Sean McManus d46c0594b5 Merge branch 'seanmcm/update0_15_0' of https://github.com/Microsoft/vscode-cpptools into seanmcm/update0_15_0 2018-01-25 14:35:19 -08:00
Sean McManus 44f65f2e14 Merge. 2018-01-25 14:35:01 -08:00
Bob Brown fca11d63c4 Merge branch 'master' into seanmcm/update0_15_0 2018-01-25 14:33:44 -08:00
grdowns 572f21a7e2 Merge pull request #1482 from Microsoft/inactive-region-highlight
Inactive region highlight
2018-01-25 14:31:09 -08:00
Sean McManus c2c84aaf7f Change date to 14th. 2018-01-25 14:13:46 -08:00
Griffin Downs 0eae7fd7a3 Rename method; Re-word commenting 2018-01-25 14:11:22 -08:00
Sean McManus ca777a2172 Change date. 2018-01-25 13:12:51 -08:00
Sean McManus c57da0d645 Change error limit to 25000. 2018-01-25 12:27:51 -08:00
Griffin Downs dd2ca57532 Compare each range by value instead of by reference 2018-01-25 11:52:43 -08:00
Griffin Downs f614c75ab6 Fix no return error 2018-01-25 11:05:42 -08:00
Griffin Downs be1bae2321 *Correctly* use guard 2018-01-25 10:37:25 -08:00
Griffin Downs 0af3069091 Guard against decorations being set on update but without changes 2018-01-25 10:26:30 -08:00
Sean McManus 8e86dd333a Update stuff for 0.15.0. 2018-01-24 19:47:17 -08:00
Griffin Downs 31a53bd95f Merge branch 'inactive-region-highlight' of https://github.com/Microsoft/vscode-cpptools into inactive-region-highlight 2018-01-24 14:27:02 -08:00
Griffin Downs 4d0490edf7 Merge branch 'master' of https://github.com/Microsoft/vscode-cpptools into inactive-region-highlight 2018-01-24 14:25:52 -08:00
Griffin Downs 02dc3fecda Express conditional more idiomatically 2018-01-24 14:25:20 -08:00
Griffin Downs 84fd6a21eb Uncomment guard block; Move comment 2018-01-24 14:11:55 -08:00
Griffin Downs b1c332ba34 Move interface + capitalize 2018-01-24 13:57:09 -08:00
grdowns 1e8ea4a656 Merge branch 'master' into inactive-region-highlight 2018-01-24 13:54:44 -08:00
Bob Brown 510094a71d fix a bug in resolveVariables util function (#1488) 2018-01-24 13:54:17 -08:00
Griffin Downs 6f9a8e10a8 Modify light theme coloration; Add decorationRangePair interface; Guard against undefined return value 2018-01-24 13:45:56 -08:00
Griffin Downs 4ab47bd2c9 Var rename for consistence + commenting 2018-01-24 10:23:16 -08:00
Griffin Downs 1ccc670265 Wording on comment 2018-01-24 10:08:35 -08:00
Griffin Downs e4634395c3 Refactor updateInactiveRegions + comment 2018-01-24 10:04:25 -08:00
Griffin Downs 3c012719c6 Use Map to track text editors and apply decorations as they become visible 2018-01-24 09:41:10 -08:00
Griffin Downs 74f567db16 Rename and move decoration object 2018-01-23 14:14:20 -08:00
Griffin Downs d444874f0d Remove auto-generated files/changes; Properly set text decorations 2018-01-23 13:38:44 -08:00
Griffin Downs 762de3ff28 Merge branch 'master' of https://github.com/Microsoft/vscode-cpptools into inactive-region-highlight 2018-01-22 17:03:38 -08:00
Griffin Downs 24c4f7f8c3 Add TODO 2018-01-22 15:59:25 -08:00
Griffin Downs 0622ade175 Fix deprecated launch.json; Add auto-generated files 2018-01-22 15:58:13 -08:00
Andrew Wang ecd1b06bef Adding triple-equals to tslint (#1480)
https://stackoverflow.com/questions/48270127/can-a-1-a-2-a-3-ever-evaluate-to-true
2018-01-22 11:12:45 -08:00
jogo- dfec64f233 Fix typos in CHANGELOG.md (#1478) 2018-01-22 08:51:36 -08:00
Griffin Downs 0bdd303978 Add notification for inactive regions; Respond by changing text color 2018-01-19 16:15:46 -08:00
Bob Brown 6c21e5445b Create CODE_OF_CONDUCT.md 2018-01-19 08:47:11 -08:00
Seokhwan Song 02201d3961 fix wrong URL (msvscode -> vscode) (#1470) 2018-01-19 08:12:46 -08:00
Pierson Lee (PIE) cdab065ded Merge remote-tracking branch 'origin/master' into release 2018-01-17 13:09:00 -08:00
Andrew Wang be11d40e4e Fix rename error and its message and linux build (#1462)
* Fix rename error and its message and linux build

Rename was always outputting an error message since the callback is
always called. Included and error check. For offline install, if
opendebug.exe.config exists, rename needs to happen too. Added function
call for offline installation.

'use strict' was erroring on ubuntu build in copyScript.ts
2018-01-17 13:02:42 -08:00
Sean McManus 3f62c3d244 Merge pull request #1458 from Microsoft/master
0.14.6 release
2018-01-16 15:51:11 -08:00
Bob Brown 5c8fdabe74 rename files.associations.autoAdd setting (#1452) 2018-01-16 14:36:53 -08:00
Sean McManus 2f10eb8fd0 Add CONTRIBUTING.md. (#1456) 2018-01-16 14:33:02 -08:00
Sean McManus 2847a96622 Rename LICENSE.txt. (#1457) 2018-01-16 14:32:37 -08:00
Sean McManus 69282d25e0 Modify changelog. (#1455) 2018-01-16 14:32:05 -08:00
Bob Brown 9ea384fc23 update comment for workspaceParsingPriority setting (#1454) 2018-01-16 13:00:08 -08:00
Bob Brown ca13ab99c9 update release notes for January 2018 (#1451) 2018-01-16 12:59:28 -08:00
Andrew Wang 20e4dd1aa8 Enable support for Integration Tests (#1441)
* Enable support for Integration Tests

Added Logger to help tests retrieve output from the installation of the
extension.
2018-01-12 16:55:01 -08:00
Bob Brown c9ca99423f Merge pull request #1438 from vitosamson/doc-img-links
fix image links in Getting Started docs
2018-01-11 16:59:00 -08:00
Vito 476b5791cc fix image links in Getting Started docs 2018-01-11 18:47:10 -05:00
Andrew Wang 62eb613f12 Fix activating language server for 2nd launch (#1435)
* Fix activating language server for 2nd launch

* Moving check distro to run only on install

Fix function name for getTempRegistrarInstance
2018-01-11 12:37:51 -08:00
Andrew Wang 9232ed8ead Cleanup reload dialog and processRuntimeDependencies flow. (#1428)
* Removing reload code and insert wait code

Lots of refactoring to improve readability.
2018-01-10 17:20:49 -08:00
Sean McManus bc721d3f5a Fix delay in language service activation caused by cpptools.json downloading. (#1433)
* Prevent downloadCpptoolsJsonPkg from delaying activation.
* Also, changed the default workspaceParsingPriority to "highest" and the "normal" enum to "medium".
* And updated the changelog.
2018-01-10 13:56:39 -08:00
Bob Brown 5885388ae4 Merge pull request #1425 from Microsoft/users/seanmcm/fixMacInstall
Fix install on Mac.
2018-01-09 16:41:06 -08:00
Sean McManus eb74a9a834 Change == to ===. 2018-01-09 12:50:39 -08:00
Sean McManus 9e7b370aca Fix install on Mac. 2018-01-09 03:19:08 -08:00
Sean McManus 1bfb2477c1 Add setting to throttle workspace parsing. (#1389)
Add workspaceParsingPriority and exclusionPolicy settings.
2018-01-08 17:54:28 -08:00
Andrew Wang 0b8cdac4a6 rewriteManifest did not actually rewrite package (#1423) 2018-01-08 17:18:25 -08:00
Bob Brown 698d1e4014 Merge pull request #1422 from Microsoft/bobbrow/faq
Add the gcc command to check include paths to the FAQ
2018-01-08 16:14:51 -08:00
Bob Brown 11e0ffcaae Add the gcc command to check include paths to the FAQ 2018-01-08 15:31:04 -08:00
Bob Brown 68b8965dfe Merge pull request #1420 from Microsoft/bobbrow/split-paths
move path-splitting code into TypeScript and add support for browse.path
2018-01-08 14:59:17 -08:00
Bob Brown (DEVDIV) 484051c3d5 tslint 2018-01-08 14:23:13 -08:00
Bob Brown (DEVDIV) ce917b5243 move path-splitting code into TypeScript and add support for browse.path 2018-01-08 14:16:25 -08:00
Andrew Wang c728178de6 Adding tslint and gulp (#1403)
* Adding Gulp and tslint

Adding tslint and the associated changes that it complains about.

Adding gulp to do tests, tslint, and more.

Including package-lock.json that it keeps complaining about.

* Adding back license that was accidently deleted.

* Updating package-lock.json and missing import

* Sorting and fixing commands for npm run

Added npm run test, watch, and tslint.

* Adding rules for whitespace and types for tslint

* Updating .gitignore rules

* Adding more rules and sorting tslint.json

new-parens for forcing all constructor calls to have parenthesis.
no more than 1 consecutive blank lines
no useage of String(), Boolean(), or Number(), use native type.

* Adding rule to force brance on the same line

* tslint rule to add function return types

* Adding tslint as part of travisci
2018-01-05 13:57:55 -08:00
Andrew Wang ab5ff3ccf2 Adding .travis.yml (#1405)
Addition to compile and run tests per PR.
2018-01-04 13:07:22 -08:00
Pierson Lee 965ba124af Add natvis schema and a quick page on natvis (#1400)
* Add natvis schema and a quick page on natvis

* PR Feedback
2018-01-03 12:26:11 -08:00
Andrew Wang f5f7fa17c1 CompletionItemProvider for launch.json (#1401)
* Creating CompletionItemProvider for launch.json

* Address PR issues

* Adding jsonc-paser to ThirdPartyNotice
2018-01-03 12:22:16 -08:00
Pierson Lee 9a83d3e9bb Changes to copy from installed extension if CPPTOOLS_DEV has been set. (#1388)
We still allow overrides for different package locations but this will
use the vscode extension folder as a fallback if you have the extension
installed to get the extension location.
2018-01-02 16:23:33 -08:00
Andrew Wang 11509bed69 Moving from debugProxy to AdapterExecutableCommand (#1387)
* Moving from debugProxy to AdapterExecutableCommand

* Addressing PR issues

Moving registerAdapterExecutableCommand to Debugger/extension.ts

* Updating comment
2017-12-29 17:07:05 -08:00
Sean McManus aa4550c95d Update How to Contribute Changes.md (#1386)
Changed references to old files that got renamed.
2017-12-28 18:00:34 -08:00
Sean McManus 45aaee1a62 Remove CMakeLists.txt. (#1384) 2017-12-28 14:57:12 -08:00
Pierson Lee fb09db9b4b Add debugger code sample - Fib (#1383)
Add debugger code sample - Fib
2017-12-28 14:40:21 -08:00
Pierson Lee 92d0deceb7 Merge pull request #1382 from Microsoft/users/piel/merge
Move extension code to github.
2017-12-28 14:10:21 -08:00
Pierson Lee (PIE) b36642e5dc Move extension code to github.
* Update LICENSE file and license headers

U
2017-12-28 13:55:35 -08:00
ronglums 0fac6a32e1 Merge pull request #1336 from Microsoft/ronglu-edit
updated links
2017-12-11 17:03:58 -08:00
Rong Lu c6842db40c updated links 2017-12-11 17:02:37 -08:00
ronglums 92ac0b4ede Merge pull request #1335 from Microsoft/ronglu-edit
Ronglu edit
2017-12-11 17:00:09 -08:00
Rong Lu 5e4afa93e5 updates 2017-12-11 16:59:17 -08:00
Rong Lu d7ce37e641 minor edit 2017-12-08 15:36:10 -08:00
Rong Lu a2a3fc47ca format update 2017-12-08 15:34:52 -08:00
Rong Lu f613aeb25b added see also links 2017-12-08 15:33:36 -08:00
Rong Lu debfef31cd updated getting started and added intellisense engine page 2017-12-08 15:27:37 -08:00
Pierson Lee 1834e13c46 Update launch.md
Fix description
2017-12-08 11:20:54 -08:00
Pierson Lee 4d948fe03e Add sourceFileMap instructions 2017-12-07 23:25:11 -08:00
Rong Lu cce6db2f5d updated doc 2017-12-07 17:03:45 -08:00
Rong Lu 64288a3661 updated doc 2017-12-07 17:01:12 -08:00
Rong Lu aeccd7c762 updated screenshots 2017-12-07 16:50:06 -08:00
Rong Lu 9fad87f12b updated doc and include error screenshot 2017-12-07 16:26:29 -08:00
Rong Lu 7c5ed6dccb updated the doc 2017-12-07 16:21:47 -08:00
Rong Lu 815c22a0bb update 2017-12-07 16:11:01 -08:00
Rong Lu 20e51dbbb4 updates 2017-12-07 15:32:14 -08:00
Rong Lu 03c6c4df1d updated doc and screenshots 2017-12-07 15:24:09 -08:00
Rong Lu ab6b27759b updated text for c_cpp_properties.json link 2017-12-07 11:00:00 -08:00
Rong Lu 6b602f7914 updated reference links 2017-12-07 10:58:41 -08:00
Rong Lu 40e0563489 updated link to the lightbulb suggestion screenshot 2017-12-07 10:56:17 -08:00
Rong Lu 94b4de096b updated two links 2017-12-07 10:54:27 -08:00
Rong Lu fb4642c0ef Updated getting started page and screenshots. Added IntelliSense engine.md 2017-12-07 10:52:08 -08:00
ronglums 6276de6084 Merge pull request #1320 from Microsoft/ronglu-edit
update screenshots
2017-12-07 10:11:59 -08:00
Rong Lu 43dba74621 More screenshots 2017-12-07 10:09:09 -08:00
Rong Lu 53b48b1286 updated screenshot 2017-12-06 15:49:30 -08:00
ronglums e7b710896c Merge pull request #1314 from Microsoft/ronglu-edit
add images
2017-12-06 11:19:43 -08:00
Rong Lu 66df256fe6 add images 2017-12-06 11:12:29 -08:00
158 changed files with 30936 additions and 480 deletions
+30
View File
@@ -0,0 +1,30 @@
---
name: Debugger
about: Issues pertaining to debugging such as call stack, breakpoints, watch window,
launching or attaching to a debuggee.
---
Type: Debugger
**Input information below**
**Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.**
**Describe the bug**
- OS and Version:
- VS Code Version:
- C/C++ Extension Version:
- Other extensions you installed (and if the issue persists after disabling them):
- A clear and concise description of what the bug is.
**To Reproduce**
*Please include a code sample and `launch.json` configuration.*
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Additional context**
*If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your `launch.json`*
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.
@@ -0,0 +1,34 @@
---
name: General Extension
about: Issues pertaining to downloading, installing, or building the extension.
---
Type: General
**Input information below**
**Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.**
**Describe the bug**
- OS and Version:
- VS Code Version:
- C/C++ Extension Version:
- Other extensions you installed (and if the issue persists after disabling them):
- A clear and concise description of what the bug is.
**To Reproduce**
*Please include code sample and `task.json` files.*
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here including log messages from the Output window.
@@ -0,0 +1,39 @@
---
name: Language Service
about: 'Issues pertaining to IntelliSense, autocomplete, code editing, etc. '
---
**Type: LanguageService**
<!----- Input information below ----->
<!--
**Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.**
-->
**Describe the bug**
- OS and Version:
- VS Code Version:
- C/C++ Extension Version:
- Other extensions you installed (and if the issue persists after disabling them):
- A clear and concise description of what the bug is.
**To Reproduce**
<!-- Steps to reproduce the behavior: -->
<!-- *The most actionable issue reports include a code sample including configuration files such as c_cpp_properties.json* -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->
**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->
**Additional context**
<!--
* Call Stacks: For bugs like crashes, deadlocks, infinite loops, etc. that we are not able to repro and for which the call stack may be useful, please attach a debugger and/or create a dmp and provide the call stacks. Windows binaries have symbols available in VS Code by setting your "symbolSearchPath" to "https://msdl.microsoft.com/download/symbols".
* Add any other context about the problem here including log messages in your Output window ("C_Cpp.loggingLevel": "Debug" in settings.json).
-->
+7
View File
@@ -0,0 +1,7 @@
# ignore cache files for sample projects
.vscode/ipch
browse*.db*
*.obj
*.pdb
*.exe
*.ilk
+3
View File
@@ -0,0 +1,3 @@
## 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 opencode@microsoft.com with any additional questions or comments.
+20
View File
@@ -0,0 +1,20 @@
# How to Contribute Changes
## Contribution Steps
* [Build and debug the extension](Documentation/Building%20the%20Extension.md).
* 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.
@@ -0,0 +1,19 @@
#ifndef BOX_H
#define BOX_H
/**
* Definition of a box object with three dimensions.
*/
struct box
{
int length;
int width;
int height;
int volume()
{
return length * width * height;
}
};
#endif
+24
View File
@@ -0,0 +1,24 @@
# Box Sample
This sample is a simple C++ program that computes and outputs the volume of a box.
We use this example in our blog posts to illustrate new extension features.
## Build and Debug Active File
Available as of March 2019, "Build and Debug Active File" automatically configures the build tasks and kicks off a build and debug session. There are
three ways to get started with this feature.
### Command
While editing a file in your workspace folder, you can open the command palette and select the `C/C++: Build and Debug Active File` command.
This option will generate a tasks.json file for you, build your active source file, and then launch the debugger.
![Open command palette and select Build and Debug Active File](build_debug_command.png)
### Context Menu
While editing a file in a workspace folder, you can right click in the editor field and select the "Build and Debug Active File" context menu option.
This option will generate a tasks.json file for you, build your active source file, and then launch the debugger.
![Right click and select Build and Debug Active File](build_debug_context_menu.png)
### F5
Another way to begin building and debugging your active file is to execute the command by pressing <kbd>F5</kbd>. This method will configure
both a tasks.json and launch.json file for you, build your active source file, and then launch the debugger.
@@ -0,0 +1,16 @@
#include <iostream>
#include "Objects/box.h"
using namespace std;
/**
* Calculate and print the volume of a box.
*/
int main()
{
box package{ 10, 10, 10 };
cout << "Package length: " << package.length << endl;
cout << "Package width: " << package.width << endl;
cout << "Package height: " << package.height << endl;
cout << "Package volume: " << package.volume() << endl;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

+40
View File
@@ -0,0 +1,40 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"preLaunchTask": "build",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"logging": {
"engineLogging": false,
"trace": false
},
"windows": {
"program": "${workspaceRoot}/fib.exe",
"MIMode": "gdb",
"miDebuggerPath": "<Path/To/GDB>" // Path to gdb on windows
},
"linux": {
"program": "${workspaceRoot}/fib.out",
"MIMode": "gdb"
},
"osx": {
"program": "${workspaceRoot}/fib.out",
"MIMode": "lldb"
}
}
]
}
+50
View File
@@ -0,0 +1,50 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"windows": {
"command": "${workspaceRoot}/build.cmd",
"args": [
"<Path/To/MinGW/Cygwin/Bin/Folder>", // Path to the bin folder containing g++ to compile
"fib.exe" // Output executable name
]
},
"linux": {
"command": "g++",
"args": [
"-g",
"*.cpp",
"-lpthread",
"--std=c++11",
"-o",
"fib.out"
]
},
"osx": {
"command": "g++",
"args": [
"-g",
"*.cpp",
"-lpthread",
"--std=c++11",
"-o",
"fib.out"
]
}
}
]
}
+3
View File
@@ -0,0 +1,3 @@
# Fib
This code sample is to show debugging. Update `launch.json` and `tasks.json` in the `.vscode` folder to use your setup to build and debug.
+2
View File
@@ -0,0 +1,2 @@
SET PATH=%PATH%;%1
g++ -g *.cpp -lpthread --std=c++11 -O0 -o %2
+58
View File
@@ -0,0 +1,58 @@
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "thread.h"
#define THREAD_COUNT 10
static char block[] = "--block";
int test = 0;
int main(int argc, char **argv)
{
srand(time(NULL));
static char pidText[] = "PID: ";
std::string helpText = "Attach a debugger and execute 'set foo=0' to continue";
char helloText[] = "Hello World!";
std::cout << helloText << std::endl;
pthread_t threads[THREAD_COUNT];
if (argc == 2 && !strcmp(block, argv[1]))
{
std::cout << helpText << std::endl;
volatile int foo = 1;
while (foo)
;
}
if (argc == 2 && !strcmp("--crash", argv[1]))
{
int foo = 0;
int bar = 1 / foo;
}
for (int i = 0; i < THREAD_COUNT; i++)
{
std::cout << "Test " << i << std::endl;
pthread_create(&threads[i], NULL, &thread_proc, NULL);
}
for (int i = 0; i < THREAD_COUNT; i++)
{
pthread_join(threads[i], NULL);
test++;
}
std::cout << "All threads exited!" << std::endl;
return 1;
}
+48
View File
@@ -0,0 +1,48 @@
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "thread.h"
static int g_tid = 0;
static int fib(int n){
switch (n) {
case 0: return 1;
case 1: return 1;
default: return (fib(n-2) + fib(n-1));
}
}
void * thread_proc(void* ctx)
{
int tid = g_tid++;
char thread_name[16];
sprintf(thread_name, "Thread %d", tid);
#ifdef __APPLE__
pthread_setname_np(thread_name);
#else
pthread_setname_np(pthread_self(), thread_name);
#endif
// Random delay, 0 - 0.5 sec
timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 500000000 + ((float)rand() / (float)RAND_MAX) * 500000000;
nanosleep(&ts, NULL);
volatile int i = 0;
while (i <= 30) {
std::cout << "Thread " << tid << ": fib(" << i << ") = " << fib(i) << std::endl;
i++;
nanosleep(&ts, NULL);
}
std::cout << thread_name << " exited!" << std::endl;
}
+1
View File
@@ -0,0 +1 @@
void * thread_proc(void* ctx);
+14
View File
@@ -0,0 +1,14 @@
## How to build and debug the Microsoft CppTools Extension
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 the release branch of [this](https://github.com/Microsoft/vscode-cpptools) repository.
* git clone -b release https://github.com/Microsoft/vscode-cpptools
* 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` will install the dependencies needed to build the extension.
* **(optional)** `npm install -g vsce` will install `vsce` globally to create a VSIX package that you can install.
* **(optional)** Set an environment variable `CPPTOOLS_DEV=1`.
* This enables the local developer workflow when testing the debugger, copying dependencies from the **node_modules** folder. Testing the language server does not require this step.
* Open the **Extension** folder in Visual Studio Code and press F5. This will launch a VS Code Extension Host window and activate the TypeScript debugger. You can set breakpoints on the extension source code and debug your scenario.
+82 -33
View File
@@ -1,7 +1,6 @@
# How To Debug MIEngine (Work in Progress)
*This is a work in progress. Please create a pull request with updates if there is anything wrong with it.*
# How To Debug MIEngine
MIEngine is one of the components used to enable the C/C++ debugging scenario with the Microsoft C/C++ extension with VS Code. This document is to help enable users who want to debug and contribute to MIEngine to fix issues or extend functionality. MIEngine is used to communicate with `gdb/lldb` using the MI protocol.
MIEngine is one of the components used to enable the C/C++ debugging scenario with the Microsoft C/C++ extension with VS Code. This document is to help enable users who want to debug and contribute to MIEngine to fix issues or extend functionality. MIEngine is used to communicate with `gdb`/`lldb` using the MI protocol.
**Repository:** https://github.com/Microsoft/MIEngine
@@ -9,69 +8,119 @@ MIEngine is one of the components used to enable the C/C++ debugging scenario wi
To build MIEngine, you will either need Visual Studio 2015+ installed or at the very least [MSBuild](https://github.com/Microsoft/msbuild) installed. The configuration you want to build is `Desktop.Debug`.
You can open the solution file `MIDebugEngine.sln` located under `src` and change the configuration and build. You will want to look in the `bin\Desktop.Debug` folder for the compiled bits. You will need to copy the following files to your `.vscode\extensions\ms-vscode.cpptools-<version>\debugadapters\bin` folder in your users/home folder:
You can open the solution file **MIDebugEngine.sln** located under **src** and change the configuration and build. You will want to look in the **bin\Desktop.Debug** folder for the compiled bits. You will need to copy the following files to your **.vscode\extensions\ms-vscode.cpptools-\<version\>\debugadapters\bin** folder in your users/home folder:
* Microsoft.MICore.dll
* Microsoft.MICore.XmlSerializers.dll
* 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
**On Linux/Mac**
* Microsoft.MICore.dll.mdb
* Microsoft.MIDebugEngine.dll.mdb
* vscode\OpenDebugAD7.exe.mdb
* vscode\Microsoft.DebugEngineHost.dll.mdb
### Debugging On Windows
On Windows, the easiest way to debug is to use Visual Studio. Locate the `package.json` file in the extension folder and open it in an editor.
On Windows, the easiest way to debug is to use Visual Studio. Locate the **src\Debugger\extension.ts** file in the **Extension** folder and open it in an editor.
Locate the following line:
If you are not building the extension, Locate the **out\src\Debugger\extension.ts** file in the **.vscode\extensions\ms-vscode.cpptools** folder and open it in an editor.
Locate the following lines:
```json
"program": "./debugAdapters/OpenDebugAD7",
return {
command: command
};
```
and add the following line below it:
and add the following line to the object:
```json
"args": ["--pauseForDebugger"],
args: ["--pauseForDebugger"]
```
This will cause the debugger to look like it has hung once you start debugging, but in reality it is waiting for a debugger to attach. Set your breakpoints and attach your debugger to the `OpenDebugAD7.exe` process. Once the debugger is attached, VS Code should start debugging and you can reproduce your scenario.
### 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:
```
cd "\Program Files (x86)\MonoDevelop\bin"
set MONODEVELOP_SDB_TEST=1
MonoDevelop.exe
```PowerShell
cd "\Program Files (x86)\MonoDevelop\bin"
set MONODEVELOP_SDB_TEST=1
MonoDevelop.exe
```
#### 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"
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).
##### Create an empty project for attaching (one-time setup)
#### Configure the extension to enable remote debugging
Open the `~/.vscode/extensions/ms-vscode.cpptools-<version>/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.
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).
#### 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
##### Configure the extension to enable remote debugging
After you've done this once, you can hit the MonoDevelop "Play" button or F5 to bring up the connect dialog again.
Open the **~/.vscode/extensions/ms-vscode.cpptools-\<version\>/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.
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
##### 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.
After you've done this once, you can hit the MonoDevelop "Play" button or <kbd>F5</kbd> to bring up the connect dialog again.
#### 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": "<INSERT_MACHINE_IP_ADDRESS_HERE>",
"port": 1234
}
]
}
```
##### Configure the extension to enable remote debugging
Open the **~/.vscode/extensions/ms-vscode.cpptools-\<version\>/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`
+36 -34
View File
@@ -1,52 +1,54 @@
# Pipe Transport
Pipe Transport allows communication through a pipe program to a remote shell. An example on linux would be `ssh`.
Pipe Transport allows communication through a pipe program to a remote shell. An example on Linux would be `ssh`.
## How-To
We have added `"pipeTransport"` as an option within the `launch.json` file. The structure looks as follows:
```
"pipeTransport": {
"pipeCwd": "/usr/bin",
"pipeProgram": "/usr/bin/ssh",
"pipeArgs": [
"-pw",
"<password>",
"[email protected]"
],
"debuggerPath": "/usr/bin/gdb"
},
We have added `"pipeTransport"` as an option within the **launch.json** file. The structure looks as follows:
```json
"pipeTransport": {
"pipeCwd": "/usr/bin",
"pipeProgram": "/usr/bin/ssh",
"pipeArgs": [
"-pw",
"<password>",
"[email protected]"
],
"debuggerPath": "/usr/bin/gdb"
},
```
The `pipeArgs` can be any set of arguments necessary to setup and authenticate the pipe connection. In the example, a password is used but you can also use an ssh key.
You may also need to add a `sourceFileMap` to map the path of where the code exists on the remote shell to where it is locally:
```
"sourceFileMap": {
// "remote": "local"
"/home/user/src": "/src/projectA/src"
}
```json
"sourceFileMap": {
// "remote": "local"
"/home/user/src": "/src/projectA/src"
}
```
## Attach
You can also use the above `pipeTransport` block to attach to a remote process. In the attach case, you will need to specify a `processId`. We have added the ability to query processes from the remote machine. To do this, change `"processId": "${command.pickProcess}"` to `"processId": "${command.pickRemoteProcess}"`. The `pipeTransport` settings will be used to query the processes on the remote machine. Then select the process from the drop down list. As with `launch`, you may need to configure `sourceFileMap`.
## Docker example
The `pipeTransport` can also be used to debug a process in a Docker container. For an attach, the `launch.json` will include:
The `pipeTransport` can also be used to debug a process in a Docker container. For an attach, **launch.json** will include:
```json
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "docker",
"pipeArgs": [
"exec",
"-i",
"hello_gdb",
"sh",
"-c"
],
"debuggerPath": "/usr/bin/gdb"
},
```
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "docker",
"pipeArgs": [
"exec",
"-i",
"hello_gdb",
"sh",
"-c"
],
"debuggerPath": "/usr/bin/gdb"
},
```
Where `hello_gdb` is the name of your container.
Launching a process is accomplished by starting a container and then using the same `pipeTransport` launch additional processes in the container. See this [`launch.json`](https://github.com/andyneff/hello-world-gdb/blob/master/.vscode/launch.json) for a [full example](https://github.com/andyneff/hello-world-gdb/)
Launching a process is accomplished by starting a container and then using the same `pipeTransport` launch additional processes in the container. See this [**launch.json**](https://github.com/andyneff/hello-world-gdb/blob/master/.vscode/launch.json) for a [full example](https://github.com/andyneff/hello-world-gdb/).
@@ -1,88 +1,91 @@
# Windows 10's Windows Subsystem for Linux
With the release of Windows 10 Creators Update (Build 15063), you will now be able to use Visual Studio Code and the Microsoft C/C++ extension to debug your `Windows Subsystem for Linux (WSL)` [Bash on Ubuntu](https://msdn.microsoft.com/en-us/commandline/wsl/about) projects.
With the release of Windows 10 Creators Update (Build 15063), you will now be able to use Visual Studio Code and the Microsoft C/C++ extension to debug your [Windows Subsystem for Linux (WSL)](https://msdn.microsoft.com/en-us/commandline/wsl/about) projects.
Code can be written on Windows itself using VSCode and debugged through `bash.exe` to the Bash on Windows layer.
As of the Fall Creator's Update, you can have multiple distros installed, but `bash.exe` and `wsl.exe` use the default distro. Use [WSL Config](https://msdn.microsoft.com/en-us/commandline/wsl/wsl-config) to set your default distro.
**NOTE: Creator's Update (Build 15063 or later) is required due to bugfixes within the subsystem that we rely on to provide debugging. Debugging using a previous version of WSL is unsupported and likely will not work. To check your Windows version, enter `winver` in a command prompt.**
**NOTE: Creator's Update (Build 15063 or later) is required due to bug-fixes within the subsystem that we rely on to provide debugging. Debugging using a previous version of WSL is unsupported and likely will not work. To check your Windows version, enter `winver` in a command prompt.**
## Prerequisites
* [Windows 10 Creators Update or later with Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) installed.
* Install g++/gcc and gdb within `WSL` to allow compiling and debugging. You can use the package manager to do this. For example, to install g++, you can run `sudo apt install g++` in the Bash window.
* [Visual Studio Code](https://code.visualstudio.com) + Microsoft C/C++ extension for VSCode.
## How-To
To debug, commands will be routed from Windows through `bash.exe` to set up debugging. Because our extension runs as a 32-bit process, it will need to use the `C:\Windows\SysNative` folder to access the `bash.exe` executable that is normally in `C:\Windows\System32`. We will be using the `"pipeTransport"` ability within the extension to do debugging and `"sourceFileMap"` to map the source from the subsystem's paths back to Windows path.
To debug, commands will be routed from Windows through `bash.exe` to set up debugging. Because our extension runs as a 32-bit process, it will need to use the `C:\Windows\SysNative` folder to access the `bash.exe` executable that is normally in `C:\Windows\System32`. We will be using the `"pipeTransport"` ability within the extension to do debugging and `"sourceFileMap"` to map the source from the subsystem's paths back to Windows path.
**NOTE: Applications will need to be compiled in the `Windows Subsystem for Linux (WSL)` prior to debugging.**
### Example `launch.json` for Launching
In the following example, I have a local drive, `Z:\` that has my source code within windows for an app called kitchensink. I have set up the `"program"` and `"cwd"` paths to point to the directory within `WSL`. I have set up the `"pipeTransport"` to use `bash.exe`. I have also set up a `"sourceFileMap"` to have everything that is returned by `gdb` that starts with `/mnt/z` to point to `Z:\\` in Windows.
In the following example, I have a local drive, `Z:\` that has my source code within windows for an app called _kitchensink_. I have set up the `"program"` and `"cwd"` paths to point to the directory within `WSL`. I have set up the `"pipeTransport"` to use `bash.exe`. I have also set up a `"sourceFileMap"` to have everything that is returned by `gdb` that starts with `/mnt/z` to point to `Z:\\` in Windows.
```
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "/mnt/z/Bash/kitchensink/a.out",
"args": ["-fThreading"],
"stopAtEntry": false,
"cwd": "/mnt/z/Bash/kitchensink",
"environment": [],
"externalConsole": true,
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/z": "z:\\"
```json
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "/mnt/z/Bash/kitchensink/a.out",
"args": ["-fThreading"],
"stopAtEntry": false,
"cwd": "/mnt/z/Bash/kitchensink",
"environment": [],
"externalConsole": true,
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
}
]
},
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/z": "z:\\"
}
}
```
### Example `launch.json` for Attaching to an Existing Process
This configuration similar to the launch process above. I have chosen to start the same application above from the Bash command line and now I want to attach to it for debugging. I have changed the `"processID"` to use the remote process picker by specifying the command `"${command:pickRemoteProcess}"` and set up the same `"sourceFileMap"`. When I press F5 to attach, I get a picker drop down showing the running processes within `WSL`. I can scroll or search for the process I want to attach to and start debugging.
This configuration similar to the launch process above. I have chosen to start the same application above from the Bash command line and now I want to attach to it for debugging. I have changed the `"processID"` to use the remote process picker by specifying the command `"${command:pickRemoteProcess}"` and set up the same `"sourceFileMap"`. When I press <kbd>F5</kbd> to attach, I get a picker drop down showing the running processes within `WSL`. I can scroll or search for the process I want to attach to and start debugging.
```
{
"name": "C++ Attach",
"type": "cppdbg",
"request": "attach",
"program": "/mnt/z/Bash/kitchensink/a.out",
"processId": "${command:pickRemoteProcess}",
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/z": "z:\\"
```json
{
"name": "C++ Attach",
"type": "cppdbg",
"request": "attach",
"program": "/mnt/z/Bash/kitchensink/a.out",
"processId": "${command:pickRemoteProcess}",
"windows": {
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
}
]
},
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/z": "z:\\"
}
}
```
+15
View File
@@ -0,0 +1,15 @@
# Natvis - Custom views for native objects
The Natvis framework allows developers to write custom schemas to help visualize native objects.
For gdb/lldb debugging (`"type": "cppdbg"`), a subset of the Natvis framework has been ported to the C/C++ extension and the code resides in the [MIEngine](https://github.com/Microsoft/MIEngine) shared component. If additional features that are not implemented are requested, please file an [issue](https://github.com/Microsoft/MIEngine/issues) on the MIEngine GitHub page with details of what is missing.
For Visual C++ debugging (`"type": "cppvsdbg"`), the debugger contains the full implementation of the Natvis framework as Visual Studio.
## Documentation
The official documentation can be found [here](https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects).
## Schema
The Natvis schema can be found [here](natvis.xsd).
File diff suppressed because it is too large Load Diff
+102
View File
@@ -0,0 +1,102 @@
# FAQs
## Table of Contents
* Setup: [Debugging Setup](#debugging-setup)
* Setup: [What is the .vscode/ipch folder?](#what-is-the-vscodeipch-folder)
* Setup: [How do I disable the IntelliSense cache (ipch)?](#how-do-i-disable-the-intellisense-cache-ipch)
* Debugger: [Why is debugging not working?](#why-is-debugging-not-working)
* Build: [How to enable debug symbols](#how-to-enable-debug-symbols)
* Logging: [How to enable logging](#how-to-enable-logging)
## Debugging Setup
The debugger needs to be configured to know which executable and debugger to use:
Click menu item: `Debug` -> `Add Configuration...`
The file **launch.json** will now be open for editing with a new configuration. The default settings will *probably* work except that you need to specify the **program** setting.
See the [**Documentation/Debugger**](https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation/Debugger) folder in this repository for more in-depth documentation on how to configure the debugger.
## What is the .vscode/ipch folder?
The language server caches information about included header files to improve the performance of IntelliSense. When you edit C/C++ files in your workspace folder, the language server will store cache files in the `.vscode/ipch` folder by default. VS Code per-workspace storage folders were not selected for the following reasons:
* The workspace storage location provided by VS Code is somewhat obscure and we had reservations about writing GB's worth of files in this location where users may not see them or know where to find them.
* Parity with Visual Studio. This is how Visual Studio works and they receive little to no feedback/complaints on the location.
With this in mind we knew that we wouldn't be able to please everyone, so we provided settings to allow you to customize this the way that works best for your situation. We also figured that putting the files in the workspace folder would bring the issue to your attention quickly so that you can take action if you don't like the default behavior.
#### `"C_Cpp.intelliSenseCachePath": <string>`
This setting allows you to set workspace or global overrides for the cache path. For example, if you want to share a single cache location for all workspace folders, you just open the VS Code settings, and add a "User" setting for "IntelliSense Cache Path".
#### `"C_Cpp.intelliSenseCacheSize": <number>`
This setting allows you to set a limit on the amount of caching the extension does. This is an approximation, but the extension will make a best effort to keep the cache size as close to the limit you set as possible. If you are sharing the cache location across workspaces as explained above, you can still increase/decrease the limit, but you should make sure that you add a "User" setting for "IntelliSense Cache Size".
## How do I disable the IntelliSense cache (ipch)?
If you do not want to use the IntelliSense caching feature to improve the performance of IntelliSense, you can disable the feature by setting the "IntelliSense Cache Size" setting to 0. (or `"C_Cpp.intelliSenseCacheSize": 0"` in the JSON settings editor)
## Why is debugging not working?
### My breakpoints aren't being hit
When you start debugging, if it is showing that your breakpoints aren't bound (solid red circle) or they are not being hit, you may need to enable [debug symbols](#how-to-enable-debug-symbols) during compilation.
### 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).
## How to enable debug symbols?
Enabling debug symbols are dependent on the type of compiler you are using. Below are some of the compilers and the compiler options necessary to enable debug symbols.
When in doubt, please check your compiler's documentation for the options necessary to include debug symbols in the output. This may be some variant of `-g` or `--debug`.
* #### Clang (C++)
* If you invoke the compiler manually then add the `--debug` option.
* If you're using a script then make sure the `CXXFLAGS` environment variable is set; e.g. `export CXXFLAGS="${CXXFLAGS} --debug"`
* If you're using CMake then set make sure the `CMAKE_CXX_FLAGS` is set; e.g. `export CMAKE_CXX_FLAGS=${CXXFLAGS}`
* #### Clang (C)
See Clang C++ but use `CFLAGS` instead of `CXXFLAGS`.
* #### gcc or g++
If you invoke the compiler manually, add the `-g` option.
* #### cl.exe
Symbols are located in the `*.pdb` file.
## How to enable logging
Enabling logging will show communication information between VS Code and our extension and between our extension and the debugger.
### Logging for `MI` debuggers
The logging block with its defaults is as follows:
```
"logging": {
"trace": false,
"traceResponse": false,
"engineLogging": false
}
```
#### VS Code and the CppTools extension
The logging here is called `trace` logging and can be enabled by setting `trace` and `traceResponse` to `true` in the logging block inside `launch.json`. This will help diagnose issues related to VS Code's communication to our extension and our responses.
#### CppTools extension and the debugger
The logging between CppTools and the debugger is called `engineLogging`. When using an `MI` debugger such as `gdb` or `lldb`, this will show the request, response and events using the `mi` interpreter. This logging will help us determine whether the debugger is receiving the right commands and generating the correct responses.
### Logging for `Visual C++` debugger
The logging block with its defaults is as follows:
```
"logging": {
"engineLogging": false
}
```
The `Visual C++` debugger logging will show only the communication to and from VS Code as all communication to the debugger is done internally to the process and is not visible through logging.
@@ -0,0 +1,56 @@
# Configuring includePath for better IntelliSense results
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.
![Configure includePath for better IntelliSense](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/configure%20includepath.jpg)
## Where are the include paths defined?
The include paths are defined in the `"includePath"` setting in a file called **c_cpp_properties.json** located in the **.vscode** directory in the opened folder.
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 quickest 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.
![lightbulb menu "Edit "includePath" setting"](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/Lightbulb.png)
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.
![include error message](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/Include%20errors.png)
## How to specify the include paths?
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.
![use compileCommands setting](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/compile_commands.png)
#### 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.
![lightbulb suggestions](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/lightbulb%20suggestion.png)
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.
![c_cpp_properties file snippet](https://github.com/Microsoft/vscode-cpptools/raw/master/Images/c_cpp_properties%20file.PNG)
## Verify the include paths are correctly resolved
There are two ways to verify that the include paths are correctly resolved:
1. The green squiggles in the source file are no longer showing
2. Error messages are cleared in the Problems window
This indicates that the IntelliSense engine has got the include paths resolved so you can start enjoying the full IntelliSense for your C or C++ code for the current translation unit. Note that you may still see errors on other files if they belong to a different translation unit that requires additional include paths to be configured.
## See Also
[IntelliSense engines](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/IntelliSense%20engine.md)
[**c_cpp_properties.json** reference guide](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/c_cpp_properties.json.md)
-23
View File
@@ -1,23 +0,0 @@
# Getting started
## Configuring IntelliSense
**Quick summary**: Open your settings file and add `"C_Cpp.intelliSenseEngine": "Default"` to preview the new and improved IntelliSense. Then add the necessary include paths and preprocessor defines to your c_cpp_properties.json file so that IntelliSense can find your symbols.
#### The IntelliSense engines
When the extension was first released, we shipped an IntelliSense engine that provided quick, but "fuzzy" results for common operations like auto-complete, parameter help, quick info tooltips, and goto definition. This "tag parser" built up a database of symbols by parsing the most important "tags" from your source files, ignoring preprocessor blocks, local variables, and most errors. More recently, we have begun the process of porting the MSVC IntelliSense engine from Visual Studio to VS Code to provide more accurate results.
You can choose the engine that works best for your projects by editing your [user or workspace settings](https://code.visualstudio.com/docs/getstarted/settings). The setting you should modify is `"C_Cpp.intelliSenseEngine"`. There are two values for this setting:
* `"Default"` - use Visual Studio's IntelliSense engine (in preview, the default for VS Code Insiders)
* `"Tag Parser"` - use the "fuzzy" IntelliSense engine (the default for users on the stable VS Code build)
#### Include paths
In order to get accurate IntelliSense results with either engine, the extension needs some information about your project. When you open a folder, the extension will attempt to locate your system headers based on your operating system, but it does not know about any auxiliary libraries that your project depends on. You can specify the remaining paths by using the `"C/Cpp: Edit Configurations"` command in the command palette.
This command will create or open a file called **c_cpp_properties.json** in your workspace. In this file, you can specify the paths to the headers that your project depends on. There are two settings in this file that you should pay particular attention to: `"includePath"` and `"browse.path"`. `"includePath"` is the setting used by the `"Default"` IntelliSense engine and `"browse.path"` is the setting used by the tag parser engine. [More information about these settings is documented here](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/FAQ.md#what-is-the-difference-between-includepath-and-browsepath-in-c_cpp_propertiesjson).
If your build system is able to produce a compile_commands.json file, the extension can get the information for the `"includePath"` and `"defines"` from that. Set the `"compileCommands"` property to the full path to your compile_commands.json file and the extension will use that instead of the `"includePath"` and `"defines"` properties for IntelliSense. You should still set the `"browse.path"` property since code navigation uses that property.
@@ -0,0 +1,16 @@
#### Old information (it still works, but is no longer recommended):
Logging is controlled by environment variables and is disabled by default. To enable logging, launch VS Code from an environment that contains the following variables:
```
VSCODE_CPP_LOGDIR=c:\path\to\logfolder
VSCODE_CPP_LOGFILE_LEVEL=5
```
When you open your folder in VS Code, we will create a **vscode.cpp.log.\<pid\>.txt** file for each extension process launched (\<pid\> = process id).
The log file level is a number that determines how much detail we'll log. Level 5 is generally detailed enough to give us information about what is going on in your session. We don't recommend you set this higher than 7 since the log quickly becomes cluttered with information that doesn't really help us diagnose your issues and actually makes it harder for us to spot problems. It may also slow down the extension considerably and make it harder for you to reproduce your problem.
**Note:** You will likely need to reload the window or close VS Code to flush the contents of the log file since we do not flush the log after every call. If your log file seems to be empty, try reloading the window after you have followed the steps to reproduce your issue.
**Don't forget to remove the environment variables when you are finished providing us with the logs.** You wouldn't want the extension to needlessly spend CPU time and disk space writing data you don't need into log files.
@@ -0,0 +1,76 @@
## Extension version 0.16.1 and earlier:
For developers using MinGW on Windows, we recommend you start with the following **c_cpp_properties.json** template. Select "C/Cpp: Edit Configurations" from the command palette to create this file if you haven't already.
In earlier versions of the extension, the `includePath` and a some system defines need to be set in order for IntelliSense to work properly. Note that you may have to change the MinGW version number to match what you have installed. Eg. `C:/MinGW/lib/gcc/mingw32/5.3.0/` instead of `C:/MinGW/lib/gcc/mingw32/6.3.0/`.
```json
{
"configurations": [
{
"name": "MinGW",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/mingw32",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/backward",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
}
```
The `includePath` above includes the system header paths that gcc uses in version 6.3.0 for C++ projects and matches the output of `"gcc -v -E -x c++ nul"`. The `intelliSenseMode` should be set to **"clang-x64"** to get MinGW projects to work properly with IntelliSense. The `__GNUC__=#` define should match the major version of the toolchain in your installation (6 in this example).
For C projects, simply remove the C++ lines:
```json
{
"configurations": [
{
"name": "MinGW",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
}
```
@@ -0,0 +1,139 @@
# Windows Subsystem for Linux
To use the Windows Subsystem for Linux with this extension you need to add a configuration to your **c_cpp_properties.json** file which adds the necessary header paths from within the WSL filesystem to the `includePath`.
Select "C/Cpp: Edit Configurations" from the command palette to create the **c_cpp_properties.json** file if you haven't already.
## Release
For developers using Ubuntu with the current version of WSL released with the Fall Creators Update, you can add the following configuration template to your **c_cpp_properties.json** file.
```json
{
"name": "WSL",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5/backward",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
```
The `includePath` above includes the system header paths that gcc uses for C++ projects and matches the output of `gcc -v -E -x c++ - < /dev/null`. The intelliSenseMode should be set to **"clang-x64"** to get WSL projects to work properly with IntelliSense.
Note that `${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/` is the path to the root of the Ubuntu filesystem. This will be different if you are using a different distro. You can discover the paths to your distro's filesystem by using this handy PowerShell command:
```Powershell
PS R:\> ($(get-appxpackage).PackageFamilyName | findstr /i 'SUSE Ubuntu') -replace '^', "$`{localappdata`}/Packages/"
${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
${localappdata}/Packages/46932SUSE.openSUSELeap42.2_022rs5jcyhyac
${localappdata}/Packages/46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac
```
For C projects, simply remove the C++ lines:
```json
{
"name": "WSL",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
```
### Beta
For developers using Bash on Ubuntu on Windows with the beta version of WSL from before the Fall Creators Update, you can add the following configuration template to your **c_cpp_properties.json** file.
```json
{
"name": "WSL (Beta)",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"${localappdata}/lxss/rootfs/usr/include/c++/5",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/lxss/rootfs/usr/include/c++/5/backward",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/lxss/rootfs/usr/local/include",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/lxss/rootfs/usr/include"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/lxss/rootfs/usr/include/c++/5",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/lxss/rootfs/usr/local/include",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/lxss/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
```
The `includePath` above includes the system header paths that gcc uses for C++ projects and matches the output of `gcc -v -E -x c++ - < /dev/null`. The intelliSenseMode should be set to **"clang-x64"** to get WSL projects to work properly with IntelliSense.
Note that `${localappdata}/lxss/rootfs/` is the path to the root of the filesystem for Bash on Ubuntu on Windows.
For C projects, simply remove the C++ lines as in the previous example.
---
With these configurations, you should be all set up to use the new IntelliSense engine for linting, memberlist autocomplete, and quick info (tooltips). Add `"C_Cpp.intelliSenseEngine": "Default"` to your **settings.json** file to try out the new IntelliSense engine.
And remember to [heed the warnings of the Windows team about not creating or editing Linux files from a Windows app](https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/)!
@@ -0,0 +1,99 @@
# Customizing Default Settings
In version 0.17.0 we introduced new settings that allow you to override the extension's default values for properties set in **c_cpp_properties.json**.
## New VS Code settings
The following `C_Cpp.default.*` settings map to each of the properties in a configuration block of **c_cpp_properties.json**. Namely:
```
C_Cpp.default.includePath : string[]
C_Cpp.default.defines : string[]
C_Cpp.default.compileCommands : string
C_Cpp.default.macFrameworkPath : string[]
C_Cpp.default.forcedIncludes : string[]
C_Cpp.default.intelliSenseMode : string
C_Cpp.default.compilerPath : string
C_Cpp.default.cStandard : c89 | c99 | c11
C_Cpp.default.cppStandard : c++98 | c++03 | c++11 | c++14 | c++17
C_Cpp.default.browse.path : string[]
C_Cpp.default.browse.databaseFilename : string
C_Cpp.default.browse.limitSymbolsToIncludedHeaders : boolean
```
These settings have all of the benefits of VS Code settings, meaning that they can have default, "User", "Workspace", and "Folder" values. So you can set a global value for `C_Cpp.default.cppStandard` in your "User" settings and have it apply to all of the folders you open. If any one folder needs a different value, you can override the value by adding a "Folder" or "Workspace" value.
This property of VS Code settings allows you to configure each of your workspaces independently - making the **c_cpp_properties.json** file optional.
## Updated **c_cpp_properties.json** syntax
A special variable has been added to the accepted syntax of **c_cpp_properties.json** that will instruct the extension to insert the value from the VS Code settings mentioned above. If you set the value of any setting in **c_cpp_properties.json** to "${default}" it will instruct the extension to read the VS Code default setting for that property and insert it. For example:
```
"configurations": [
{
"name": "Win32",
"includePath": [
"additional/paths",
"${default}"
],
"defines": [
"${default}",
],
"macFrameworkPath": [
"${default}",
"additional/paths"
],
"forceInclude": [
"${default}",
"additional/paths"
],
"compileCommands": "${default}",
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${default}",
"path": [
"${default}",
"additional/paths"
]
},
"intelliSenseMode": "${default}",
"cStandard": "${default}",
"cppStandard": "${default}",
"compilerPath": "${default}"
}
],
```
Take note that for the properties that accept string[], the syntax proposed above allows you to augment the VS Code setting with additional values, thus allowing you to have common paths listed in the VS Code settings and configuration-specific settings in **c_cpp_properties.json**.
If a property is missing from **c_cpp_properties.json**, the extension will use the value in the VS Code setting. If a developer assigns values to all of the settings that apply for a given folder, then **c_cpp_properties.json** could be removed from the .vscode folder as it will no longer be needed.
### System includes
A new setting will be added that allows you specify the system include path separate from the folder's include path. If this setting has a value, then the system include path the extension gets from the compiler specified in the `compilerPath` setting will not be added to the path array that the extension uses for IntelliSense. We may want to provide a VS Code command to populate this value from the compiler's default for users who are interested in using it in case they want to make some modifications to the defaults.
```
C_Cpp.default.systemIncludePath : string[]
```
### System Include Path/Defines Resolution Strategies
The extension determines the system includePath and defines to send to the IntelliSense engine in the following manner:
1. If `compileCommands` has a valid value and the file open in the editor is in the database, use the compile command in the database entry to determine the include path and defines.
* The system include path and defines are determined using the following logic (in order):
1. If `systemIncludePath` has a value, use it (continue to the next step to search for system defines).
2. If `compilerPath` is valid, query it.
3. Interpret the first argument in the command as the compiler and attempt to query it.
4. If `compilerPath` is `""`, use an empty array for system include path and defines.
5. If `compilerPath` is undefined, look for a compiler on the system and query it.
2. If `compileCommands` is invalid or the current file is not listed in the database, use the `includePath` and `defines` properties in the configuration for IntelliSense.
* The system include path and defines are determined using the following logic (in order):
1. If `systemIncludePath` has a value, use it (continue to the next step to search for system defines).
2. If `compilerPath` is valid, query it.
3. If `compilerPath` is `""`, use an empty array for system include path and defines (they are assumed to be in the `includePath` and `defines` for the current config already).
4. If `compilerPath` is undefined, look for a compiler on the system and query it.
System includes should no longer be added to the `"includePath"` or `"browse.path"` variables. If the extension detects any system include paths in the `"includePath"` property it will silently remove them so that it can ensure system include paths are added last and in the correct order (this is especially important for GCC/Clang). In a future update we may add a notification message to the extension to remind developers to remove system include paths from their `"includePath"` and `'browse.path"` as they will be ignored.
@@ -2,21 +2,11 @@
If you are experiencing a problem that we are unable to diagnose based on information in your issue report, we might ask you to enable logging and send us your logs.
As of version 0.14.0 of the extension, logging information is now delivered directly to the Output window in VSCode. To turn on full logging for an issue report, add `"C_Cpp.loggingLevel": "Information"` to your settings.json.
As of version 0.14.0 of the extension, logging information is now delivered directly to the Output window in VSCode. To turn on full logging for an issue report, add `"C_Cpp.loggingLevel": "Information"` or `"C_Cpp.loggingLevel": "Debug"` to your **settings.json**.
![image](https://user-images.githubusercontent.com/12818240/31898313-b32ff284-b7cd-11e7-97f5-89df93b5d9de.png)
![image](https://user-images.githubusercontent.com/12818240/44601186-8a2af380-a790-11e8-9094-7064d1ba3cfb.png)
#### Old information (it still works, but is no longer recommended):
VS Code organizes the logging from different extensions to improve readability so you must select the "C/C++" option in the log filter selector to see logging from the C/C++ extension:
~~Logging is controlled by environment variables and is disabled by default. To enable logging, launch VS Code from an environment that contains the following variables:~~
![image](https://user-images.githubusercontent.com/12818240/39769357-d6673bea-52a0-11e8-86c6-3be91618e8fc.png)
```
VSCODE_CPP_LOGDIR=c:\path\to\logfolder
VSCODE_CPP_LOGFILE_LEVEL=5
```
~~When you open your folder in VS Code, we will create a vscode.cpp.log.\<pid\>.txt file for each extension process launched (\<pid\> = process id).~~
~~The log file level is a number that determines how much detail we'll log. Level 5 is generally detailed enough to give us information about what is going on in your session. We don't recommend you set this higher than 7 since the log quickly becomes cluttered with information that doesn't really help us diagnose your issues and actually makes it harder for us to spot problems. It may also slow down the extension considerably and make it harder for you to reproduce your problem.~~
~~**Don't forget to remove the environment variables when you are finished providing us with the logs.** You wouldn't want the extension to needlessly spend CPU time and disk space writing data you don't need into log files.~~
+38 -19
View File
@@ -1,25 +1,29 @@
# Frequently asked questions
[How do I get IntelliSense to work correctly](#how-do-i-get-intellisense-to-work-correctly)?
* [Why are my files corrupted on format?](#why-are-my-files-corrupted-on-format)
* [How do I get IntelliSense to work correctly?](#how-do-i-get-intellisense-to-work-correctly)
* [Why do I see red squiggles under Standard Library types?](#why-do-i-see-red-squiggles-under-standard-library-types)
* [How do I get the new IntelliSense to work with MinGW on Windows?](#how-do-i-get-the-new-intellisense-to-work-with-mingw-on-windows)
* [How do I get the new IntelliSense to work with the Windows Subsystem for Linux?](#how-do-i-get-the-new-intellisense-to-work-with-the-windows-subsystem-for-linux)
* [What is the difference between `"includePath"` and `"browse.path"` in **c_cpp_properties.json**?](#what-is-the-difference-between-includepath-and-browsepath-in-c_cpp_propertiesjson)
* [How do I re-create the IntelliSense database?](#how-do-i-re-create-the-intellisense-database)
[How do I get the new IntelliSense to work with MinGW on Windows](#how-do-i-get-the-new-intellisense-to-work-with-mingw-on-windows)?
## Why are my files corrupted on format?
[What is the difference between "includePath" and "browse.path" in c\_cpp\_properties.json](#what-is-the-difference-between-includepath-and-browsepath-in-c_cpp_propertiesjson)?
[How do I re-create the IntelliSense database](#how-do-i-re-create-the-intellisense-database)?
This is likely due to the fact that you either have a multi-root workspace where one folder is a child of the other, or you are using symlinks to open your file. Reduce the folders in the workspace to one and remove the symlink. This should fix your problem.
## How do I get IntelliSense to work correctly?
There are two IntelliSense engines present in the extension: the "fuzzy" engine (or Tag Parser), and the new "Default" engine. If you are using version 0.11.0 or higher of the cpptools extension, then you can preview our new IntelliSense engine which has more accurate auto-complete suggestions and tooltips. To use the new engine, you need to ensure that `"C_Cpp.intelliSenseEngine"` is set to `"Default"` in your settings. Since the engine is still in preview it is not on by default for everyone yet.
After selecting the IntelliSense engine that you prefer, take a look at the Problems window in VS Code to see if you need to do any further configuration for your folder. For example, the Default engine will not provide squiggles and auto-complete suggestions for a translation unit (read: a source file and its dependencies) if the include path is not configured properly. You can select any of the problems in the window to navigate to the line when the problem was detected and a lightbulb will appear in the editor with some options (code actions) to help you resolve the problem.
After selecting the IntelliSense engine that you prefer, take a look at the Problems window in VS Code to see if you need to do any further configuration for your folder. For example, the Default engine will not provide squiggles and auto-complete suggestions for a translation unit (read: a source file and its dependencies) if the include path is not configured properly. You can select any of the problems in the window to navigate to the line when the problem was detected and a lightbulb will appear in the editor with some options (code actions) to help you resolve the problem:
1. Update your includePath (and preprocessor defines)
1. Update your `includePath` (and preprocessor defines)
2. Force semantic IntelliSense
#### Update your includePath (and preprocessor defines)
#### Update your `includePath` (and preprocessor defines)
Selecting this option will open a file called c_cpp_properties.json. If you haven't created this file already, it will be created for you in the .vscode folder of your workspace.
Selecting this option will open a file called **c_cpp_properties.json**. If you haven't created this file already, it will be created for you in the **.vscode** folder of your workspace.
Add the necessary paths to your include files to the `"includePath"` array. The `${workspaceRoot}` variable is available to use to get a relative path to the folder you have opened. Also add any required symbols that need to be defined to the `"defines"` array. Both "\<var\>" and "\<var\>=\<value\>" syntax is accepted. When you edit and save this file, the IntelliSense engine will reset and reparse source your source files and headers with the new settings.
@@ -27,25 +31,40 @@ Add the necessary paths to your include files to the `"includePath"` array. The
If you want IntelliSense to operate on your files even when all #include directives do not resolve, then you can choose the `Force semantic IntelliSense` code action to always use the new IntelliSense engine. You can also set the `C_Cpp.intelliSenseEngineFallback` setting to `"Disabled"`.
## Why do I see red squiggles under Standard Library types?
The most common reason for this is missing include paths and defines. The easiest way to fix this on each platform is as follows:
**Linux/Mac**
* Set `"intelliSenseMode": "clang-x64"` or `"intelliSenseMode": "gcc-x64"` and `"compilerPath"` in **c_cpp_properties.json** to the path to your compiler.
**Windows**
* If you are using a Microsoft compiler from Visual Studio, set `"intelliSenseMode": "msvc-x64"`, but don't add the `"compilerPath"` property to **c_cpp_properties.json**.
* If you are using Clang for Windows, set `"intelliSenseMode": "msvc-x64"`, and `"compilerPath"` in **c_cpp_properties.json** to the path to your compiler.
## How do I get the new IntelliSense to work with MinGW on Windows?
Since MinGW is a relative of GCC, Microsoft mode compilation (which is the default on Windows) doesn't work very well with it. To use GCC/CLang mode, set the `"intelliSenseMode"` property in your **c_cpp_properties.json** file to `"clang-x64"`. An example **c_cpp_properties.json** [is shared here for your convenience](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md).
The page discussing configuration with MinGW is [here](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md).
## What is the difference between "includePath" and "browse.path" in c\_cpp\_properties.json?
## How do I get the new IntelliSense to work with the Windows Subsystem for Linux?
Starting with version 0.11.0 of the cpptools extension, there are now two settings in the c\_cpp\_properties.json file. They are used by the different IntelliSense engines that we support and have slightly different meanings for the components that use them.
The page discussing configuration with WSL is [here](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Windows%20Subsystem%20for%20Linux.md).
The active IntelliSense engine is controlled via the `"C_Cpp.intelliSenseEngine"` setting in your settings.json file. The valid values for this setting are:
* `"Default"`
* `"Tag Parser"`
## What is the difference between `"includePath"` and `"browse.path"` in **c_cpp_properties.json**?
**includePath**: This array of path strings is used by the new "Default" IntelliSense engine that was introduced in version 0.11.0 of the extension. This new engine provides semantic-aware IntelliSense features and will be the eventual replacement for the Tag Parser that has been powering the extension since it was first released. It currently provides tooltips and error squiggles in the editor. The remaining features (e.g. code completion, signature help, go to definition, ...) are implemented using the Tag Parser's database, so it is still important to ensure that the browse.path setting is properly set.
Starting with version 0.11.0 of the cpptools extension, there are now two settings in the **c_cpp_properties.json** file. They are used by the different IntelliSense engines that we support and have slightly different meanings for the components that use them.
The paths that you specify for this setting are the same paths that you would send to your compiler via the `-I` switch. When your source files are parsed, the IntelliSense engine will prepend these paths to the files specified by your `#include` directives while attempting to resolve them. These paths are _not searched recursively_.
The active IntelliSense engine is controlled via the `"C_Cpp.intelliSenseEngine"` setting in your **settings.json** file. The valid values for this setting are `"Default"` and `"Tag Parser"`.
**browse.path**: This array of path strings is used by the "Tag Parser" (a.k.a. "browse engine"). This engine will _recursively_ enumerate all files under the paths specified and track them as potential includes while tag parsing your project folder. To disable recursive enumeration of a path, you can append a `/*` to the path string.
* #### `"includePath"`
This array of path strings is used by the new "Default" IntelliSense engine that was introduced in version 0.11.0 of the extension. This new engine provides semantic-aware IntelliSense features and will be the eventual replacement for the Tag Parser that has been powering the extension since it was first released. It currently provides tooltips and error squiggles in the editor. The remaining features (e.g. code completion, signature help, go to definition, ...) are implemented using the Tag Parser's database, so it is still important to ensure that the browse.path setting is properly set.
When you open a workspace for the first time, the extension adds `${workspaceRoot}` to both arrays. If this is undesirable, you can open your c_cpp_properties.json file and remove it.
The paths that you specify for this setting are the same paths that you would send to your compiler via the `-I` switch. When your source files are parsed, the IntelliSense engine will prepend these paths to the files specified by your #include directives while attempting to resolve them. These paths are **not** searched recursively.
* #### `"browse.path"`
This array of path strings is used by the "Tag Parser" (a.k.a. "browse engine"). This engine will _recursively_ enumerate all files under the paths specified and track them as potential includes while tag parsing your project folder. To disable recursive enumeration of a path, you can append a `/*` to the path string.
When you open a workspace for the first time, the extension adds `${workspaceRoot}` to both arrays. If this is undesirable, you can open your **c_cpp_properties.json** file and remove it.
## How do I re-create the IntelliSense database?
@@ -0,0 +1,44 @@
# IntelliSense engines
There are two IntelliSense engines used to power the C/C++ IntelliSense experience in VS Code.
* `"Default"` - Visual Studio's IntelliSense engine, which is the default engine that provides semantic-aware IntelliSense features
* `"Tag Parser"` - the "fuzzy" IntelliSense engine that provides quick but "fuzzy" results, is used to provide the fallback experience if the default engine is unable to fully resolve include paths
Ultimately all the IntelliSense and code browsing features will be powered by the "Default" engine. The following features have been implemented so far:
* Auto-complete suggestions for class/struct/namespace members
* Parameter hints
* Quick info (hover over tooltip)
* Error squiggles
* Reference highlighting
The other IntelliSense features, such as global auto-complete, and code browsing features, such as Go to definition/declaration, are currently powered by the "Tag Parser" based engine.
### `includePath` and `browse.path`
The two IntelliSense engines use two different settings in the **c_cpp_properties.json** file for specifying include paths. This file is located in the **.vscode** directory in the opened folder. 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. Look for the following settings in the section where your current configuration is defined (by default there's one configuration per OS, such as "Win32 or "Mac").
* #### `"includePath"`
This array of path strings is used by the "Default" IntelliSense engine. The paths that you specify for this setting are the same paths that you would send to your compiler via the -I switch. When your source files are parsed, the IntelliSense engine will prepend these paths to the files specified by your #include directives while attempting to resolve them. These paths are searched **non-recursively**.
* #### `"browse.path"`
This array of path strings is used by the "Tag Parser" (a.k.a. "browse engine"). This engine will **recursively** enumerate all files under the paths specified and track them as potential includes while tag parsing your project folder. To disable recursive enumeration of a path, you can append a `/*` to the path string.
### How fallback works and how to control the behavior
The extension first tries to fully parse any opened file using the "Default" IntelliSense engine. If it discovers that it cannot find a header file or a dependency, it will fall back to the tag parser and provide the fuzzy IntelliSense behavior. The fallback affects a full translation unit (TU), not just a single open file. The Problems panel provides details about unresolved headers and dependencies. Other opened TUs will continue to use the "Default" IntelliSense engine provided that all #include dependencies are resolved.
We recognize that resolving all #includes may not be necessary for all projects and you may still want to experience the productivity benefits of using the "Default" semantic engine without customizing the default include path. For that, the “Force semantic IntelliSense” action can be chosen. When invoked, all unresolved #include squiggles will turn red and semantic member list and linting will be enabled in all files regardless of whether or not #include statements can be resolved.
### IntelliSense engine setting
We recommend using the "Default" engine for the best IntelliSense experience. However, it is possible to explicitly choose the IntelliSense engine by editing your [user or workspace settings](https://code.visualstudio.com/docs/getstarted/settings). The setting you should modify is `"C_Cpp.intelliSenseEngine"`. There are two values for this setting:
* `"Default"` - use Visual Studio's IntelliSense engine
* `"Tag Parser"` - use the "fuzzy" IntelliSense engine
### See Also
[Configuring includePath for better IntelliSense results](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Getting%20started%20with%20IntelliSense%20configuration.md)
[**c_cpp_properties.json** reference guide](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/c_cpp_properties.json.md)
+22 -67
View File
@@ -1,76 +1,31 @@
For developers using MinGW on Windows, we recommend you start with the following **c_cpp_properties.json** template. Select "C/Cpp: Edit Configurations" from the command palette to create this file if you haven't already.
# MinGW
Note that you may have to change the MinGW version number to match what you have installed. Eg. `C:/MinGW/lib/gcc/mingw32/5.3.0/` instead of `C:/MinGW/lib/gcc/mingw32/6.3.0/`.
To use MinGW on Windows, we recommend you add the following configuration to your **c_cpp_properties.json** file. Select "C/Cpp: Edit Configurations" from the command palette to create this file if you haven't already.
```
## Extension version 0.17.0 and higher:
When you set the `compilerPath` property and change `intelliSenseMode` to `clang-x64` (or `gcc-x64` in version 0.18.0 and higher), you no longer need to copy the system include path or defines to `includePath`, `browse.path`, or `defines` to enable IntelliSense to work properly. For example:
```json
{
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/mingw32",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/backward",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
"name": "MinGW",
"intelliSenseMode": "gcc-x64",
"compilerPath": "C:/mingw64/bin/gcc.exe",
"includePath": [
"${workspaceFolder}"
],
"defines": [],
"cStandard": "c11",
"cppStandard": "c++17"
}
```
The `includePath` above includes the system header paths that gcc uses in version 6.3.0 for C++ projects and matches the output of `gcc -v -E -x c++ -`. The `intelliSenseMode` should be set to **"clang-x64"** to get MinGW projects to work properly with IntelliSense. The `__GNUC__=#` define should match the major version of the toolchain in your installation (6 in this example).
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 C projects, simply remove the c++ lines:
For Cygwin, set the `compilerPath` to the appropriate Cygwin path, e.g. "C:/cygwin64/bin/g++.exe".
```
{
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
}
```
If it seems like the `compilerPath` is not getting used, you can debug the issue via [enabling logging](Enabling%20logging.md).
With these configurations, you should be all set up to use the new IntelliSense engine for linting, memberlist autocomplete, and quick info (tooltips). Add `"C_Cpp.intelliSenseEngine": "Default"` to your **settings.json** file to try out the new IntelliSense engine.
## 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.
@@ -1,139 +1,33 @@
# Windows Subsystem for Linux
> **Note:** If you are on **build 17110 of Windows or higher**, you must use extension version 0.17.0 or higher for IntelliSense to work. The Windows team turned on case-sensitive folders for the WSL environment and the C/C++ extension doesn't support case-sensitive folders until version 0.17.0.
To use the Windows Subsystem for Linux with this extension you need to add a configuration to your **c_cpp_properties.json** file which adds the necessary header paths from within the WSL filesystem to the `includePath`.
Select "C/Cpp: Edit Configurations" from the command palette to create the **c_cpp_properties.json** file if you haven't already.
## Release
## With extension version 0.17.0 and higher:
For developers using Ubuntu with the current version of WSL released with the Fall Creators Update, you can add the following configuration template to your **c_cpp_properties.json** file.
In **c_cpp_properties.json** you can directly address your WSL compiler and include paths by using *nix-style paths and we will do the conversion to Windows paths for you. If you have multiple distros installed, we disambiguate the `compilerPath` by picking the one marked as Default when you run `wslconfig.exe /l` in a CMD or PowerShell window. We continue to support Windows-style paths for these properties as outlined in the [archived instructions](Archive/Windows%20Subsystem%20for%20Linux.md) if you prefer to use those.
```json
{
"name": "WSL",
"intelliSenseMode": "clang-x64",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"includePath": [
"${workspaceRoot}",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5/backward",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include"
"${workspaceFolder}/**"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
"defines": [],
"cStandard": "c11",
"cppStandard": "c++17"
}
```
The `includePath` above includes the system header paths that gcc uses for C++ projects and matches the output of `gcc -v -E -x c++ - < /dev/null`. The intelliSenseMode should be set to **"clang-x64"** to get WSL projects to work properly with IntelliSense.
## Earlier versions of the extension:
Note that `${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/` is the path to the root of the Ubuntu filesystem. This will be different if you are using a different distro. You can discover the paths to your distro's filesystem by using this handy Powershell command:
```Powershell
PS R:\> ($(get-appxpackage).PackageFamilyName | findstr /i 'SUSE Ubuntu') -replace '^', "$`{localappdata`}/Packages/"
${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
${localappdata}/Packages/46932SUSE.openSUSELeap42.2_022rs5jcyhyac
${localappdata}/Packages/46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac
```
For C projects, simply remove the c++ lines:
```json
{
"name": "WSL",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/local/include",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
```
## Beta
For developers using Bash on Ubuntu on Windows with the beta version of WSL from before the Fall Creators Update, you can add the following configuration template to your **c_cpp_properties.json** file.
```json
{
"name": "WSL (Beta)",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"${localappdata}/lxss/rootfs/usr/include/c++/5",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/lxss/rootfs/usr/include/c++/5/backward",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/lxss/rootfs/usr/local/include",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/lxss/rootfs/usr/include"
],
"defines": [
"__linux__",
"__x86_64__"
],
"browse": {
"path": [
"${localappdata}/lxss/rootfs/usr/include/c++/5",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu/c++/5",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include",
"${localappdata}/lxss/rootfs/usr/local/include",
"${localappdata}/lxss/rootfs/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"${localappdata}/lxss/rootfs/usr/include/x86_64-linux-gnu",
"${localappdata}/lxss/rootfs/usr/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
```
The `includePath` above includes the system header paths that gcc uses for C++ projects and matches the output of `gcc -v -E -x c++ - < /dev/null`. The intelliSenseMode should be set to **"clang-x64"** to get WSL projects to work properly with IntelliSense.
Note that `${localappdata}/lxss/rootfs/` is the path to the root of the filesystem for Bash on Ubuntu on Windows.
For C projects, simply remove the c++ lines as in the previous example.
If you are on a build of Windows prior to 17110 and you have an older version of the C/C++ extension installed, use [these instructions](Archive/Windows%20Subsystem%20for%20Linux.md) instead.
---
With these configurations, you should be all set up to use the new IntelliSense engine for linting, memberlist autocomplete, and quick info (tooltips). Add `"C_Cpp.intelliSenseEngine": "Default"` to your **settings.json** file to try out the new IntelliSense engine.
And remember to [heed the warnings of the Windows team about not creating or editing Linux files from a Windows app](https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/)!
Remember to [heed the warnings of the Windows team about not creating or editing Linux files from a Windows app](https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/)!
@@ -1,52 +1,100 @@
# c_cpp_properties.json Reference Guide
# `c_cpp_properties.json` Reference Guide
### Example:
```
> See also: [Customizing Default Settings](Customizing%20Default%20Settings.md)
### Example
```json
{
"env" : {
"myDefaultIncludePath": [
"${workspaceFolder}",
"${workspaceFolder}/include"
],
"myCompilerPath": "/usr/local/bin/gcc-7"
},
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "msvc-x64",
"includePath": [ "${workspaceRoot}" ],
"name": "Mac",
"intelliSenseMode": "clang-x64",
"includePath": [ "${myDefaultIncludePath}", "/another/path" ],
"macFrameworkPath": [ "/System/Library/Frameworks" ],
"defines": [ "FOO", "BAR=100" ],
"forcedInclude": [ "${workspaceFolder}/include/config.h" ],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17",
"compileCommands": "/path/to/compile_commands.json",
"browse": {
"path": [ "${workspaceRoot}" ],
"path": [ "${workspaceFolder}" ],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 2
"version": 4
}
```
## Top-level properties
**configurations**: An array of configuration objects that provide the IntelliSense engine with information about your project and your preferences. By default, the extension creates 3 configurations for you, one each for Linux, Mac, and Windows, but it is not required to keep them all. You may also add additional configurations if necessary.
* #### `env`
An array of user-defined variables that will be available for substitution in the configurations via the standard environment variable syntax: `${<var>}` or `${env:<var>}`. Strings and arrays of strings are accepted.
**version**: We recommend you don't edit this field. It tracks the current version of the c_cpp_properties.json file so that the extension knows what properties and settings should be present and how to upgrade this file to the latest version.
* #### `configurations`
An array of configuration objects that provide the IntelliSense engine with information about your project and your preferences. By default, the extension creates a configuration for you based on your operating system. You may also add additional configurations.
* #### `version`
We recommend you don't edit this field. It tracks the current version of the **c_cpp_properties.json** file so that the extension knows what properties and settings should be present and how to upgrade this file to the latest version.
## Configuration properties
**name**: A friendly name for the configuration. "Linux", "Mac", and "Win32" are special names that instruct the extension to load that configuration by default on the associated operating system unless additional configurations have been created. The status bar in VS Code will show you which configuration is active. You can also click on the label in the status bar to change the active configuration.
* #### `name`
A friendly name for the configuration. "Linux", "Mac", and "Win32" are special names that instruct the extension to load that configuration by default on the associated operating system unless additional configurations have been created. The status bar in VS Code will show you which configuration is active. You can also click on the label in the status bar to change the active configuration.
**intelliSenseMode**: If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this property determines which mode the IntelliSense engine will run in. `"msvc-x64"` maps to Visual Studio mode with 64-bit pointer sizes. `"clang-x64"` maps to GCC/CLang mode with 64-bit pointer sizes. Windows uses `"msvc-x64"` by default and Linux/Mac use `"clang-x64"` by default.
* #### `intelliSenseMode`
If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this property determines which mode the IntelliSense engine will run in. `"msvc-x64"` maps to Visual Studio mode with 64-bit pointer sizes. `"clang-x64"` maps to CLang mode with 64-bit pointer sizes. `"gcc-x64"` maps to GCC mode with 64-bit pointer sizes. Windows uses `"msvc-x64"` by default, macOS uses `"clang-x64"` by default, and Linux uses `"gcc-x64"` by default.
**includePath**: If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this list of paths will be used by IntelliSense to search for headers included by your source files. This is basically the same as the list of paths you pass to your compiler with the `-I` switch; the IntelliSense engine will not do a recursive search in these paths for includes.
* #### `includePath`
If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this list of paths will be used by IntelliSense to search for headers included by your source files. This is basically the same as the list of paths you pass to your compiler with the `-I` switch. If a path ends with `/**` the IntelliSense engine will do a recursive search for includes starting from that directory. If on Windows with Visual Studio installed, or if a compiler is specified in the `compilerPath` setting, it is not necessary to list the system include paths in this list.
**defines**: If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this list of preprocessor symbols will be used by IntelliSense during the compilation of your source files. This is basically the same as the list of symbols you pass to your compiler with the `-D` switch.
* #### `macFrameworkPath`
If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this list of paths will be used by IntelliSense to search for framework headers included by your source files. This is basically the same as the list of paths you pass to your compiler with the `-F` switch; the IntelliSense engine will not do a recursive search in these paths for includes.
**compileCommands** (optional): If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, the includes and defines discovered in this file will be used instead of the values set for `includePath` and `defines`. If the compile commands datasbase does not contain an entry for the translation unit that corresponds to the file you opened in the editor, then a warning message will appear and the extension will use the `includePath` and `defines` settings instead.
* #### `defines`
If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, this list of preprocessor symbols will be used by IntelliSense during the compilation of your source files. This is basically the same as the list of symbols you pass to your compiler with the `-D` switch. If on Windows with Visual Studio installed, or if a compiler is specified in the `compilerPath` setting, it is not necessary to list the system include paths in this list.
*For more information about the file format, see the [Clang documentation](https://clang.llvm.org/docs/JSONCompilationDatabase.html). Some build systems, such as CMake, [simplify generating this file](https://cmake.org/cmake/help/v3.5/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html).*
* #### `forcedInclude` (optional)
A list of files that should be included before any other characters in the source file are processed. Files are included in the order listed.
**browse**: The set of properties used when `"C_Cpp.intelliSenseEngine"` is set to `"Tag Parser"` (also referred to as "fuzzy" IntelliSense, or the "browse" engine). These properties are also used by the Go To Definition/Declaration features, or when the "Default" IntelliSense engine is unable to resolve `#include`s in your source files.
* #### `compilerPath` (optional)
The absolute path to the compiler you use to build your project. The extension will query the compiler to determine the system include paths and default defines to use for IntelliSense.
Args can be added to modify the includes/defines used, e.g. `-nostdinc++`, `-m32`, `-fno-ms-extensions`, etc., but paths with spaces must be surrounded by double quotes (`"`) if args are used.
If you want to disable automatic querying of system include paths and defines, set this value to the emptry string `""`. This is generally not recommended, but there are some cases where automatic querying of system includes and defines is undesirable.
* #### `cStandard`
The C standard revision to use for IntelliSense in your project.
* #### `cppStandard`
The C++ standard revision to use for IntelliSense in your project.
* #### `compileCommands` (optional)
If `"C_Cpp.intelliSenseEngine"` is set to "Default" in your settings file, the includes and defines discovered in this file will be used instead of the values set for `includePath` and `defines`. If the compile commands database does not contain an entry for the translation unit that corresponds to the file you opened in the editor, then a warning message will appear and the extension will use the `includePath` and `defines` settings instead.
>For more information about the file format, see the [Clang documentation](https://clang.llvm.org/docs/JSONCompilationDatabase.html). Some build systems, such as CMake, [simplify generating this file](https://cmake.org/cmake/help/v3.5/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html).
* #### `browse`
The set of properties used when `"C_Cpp.intelliSenseEngine"` is set to `"Tag Parser"` (also referred to as "fuzzy" IntelliSense, or the "browse" engine). These properties are also used by the Go To Definition/Declaration features, or when the "Default" IntelliSense engine is unable to resolve the #includes in your source files.
### Browse properties
**path**: This list of paths will be used by the Tag Parser to search for headers included by your source files. The Tag Parser will automatically search all subfolders in these paths unless the path ends with a `/*` or `\*`. For example, `/usr/include` directs the Tag Parser to search the `include` folder and its subfolders for headers while `/usr/include/*` directs the Tag Parser not to look in any subfolders of `/usr/include`.
* #### `path`
This list of paths will be used by the Tag Parser to search for headers included by your source files. If omitted, `includePath` will be used as the `path`. The Tag Parser will automatically search all subfolders in these paths unless the path ends with a `/*` or `\*`. For example, `/usr/include` directs the Tag Parser to search the `include` folder and its subfolders for headers while `/usr/include/*` directs the Tag Parser not to look in any subfolders of `/usr/include`.
**limitSymbolsToIncludedHeaders**: When true, the Tag Parser will only parse code files that have been directly or indirectly included by a source file in the ${workspaceRoot}. When false, the Tag Parser will parse all code files found in the paths specified in the **path** list.
* #### `limitSymbolsToIncludedHeaders`
When true, the Tag Parser will only parse code files that have been directly or indirectly included by a source file in `${workspaceFolder}`. When false, the Tag Parser will parse all code files found in the paths specified in the **path** list.
**databaseFilename**: When set, this instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The ${workspaceRoot} variable can be used to specify a path relative to the workspace folder (e.g. $[workspaceRoot}/.vscode/browse.vc.db)
* #### `databaseFilename`
When set, this instructs the extension to save the Tag Parser's symbol database somewhere other than the workspace's default storage location. If a relative path is specified, it will be made relative to the workspace's default storage location, not the workspace folder itself. The `${workspaceFolder}` variable can be used to specify a path relative to the workspace folder (e.g. `${workspaceFolder}/.vscode/browse.vc.db`)
@@ -0,0 +1,511 @@
# VS Code C/C++ Extension - Enhanced Colorization
The VS Code C/C++ extension now supports semantic colorization, when IntelliSense is enabled. Enhanced colorization can be enabled using the enhancedColorization setting:
```
"C_Cpp.enhancedColorization": "Enabled"
```
# Theming
Colors can be associated using the existing support for theming and color customization in VS Code. Documentation on Theming in VS Code can be found [here](https://code.visualstudio.com/docs/getstarted/themes)
Colors are associated with [TextMate scopes](https://macromates.com/manual/en/language_grammars#naming_conventions).
# IntelliSense Tokens and Scopes
| Token | Scope |
| ------------- |:-------------:|
| Class Template | entity.name.class.template |
| Enumerator | variable.other.enummember |
| Event (C++/CLI) | variable.other.event |
| Function | entity.name.function |
| Function Template | entity.name.function.template |
| Generic Type (C++/CLI) | entity.name.class.generic |
| Global Variable | variable.other.global |
| Label | entity.name.label |
| Local Variable | variable.other.local |
| Macro | entity.name.function.preprocessor |
| Member Field | variable.other.member |
| Member Function | entity.name.function.member |
| Member Operator | keyword.operator.member |
| Namespace | entity.name.type.namespace |
| New / Delete | keyword.operator.new |
| Operator Function | entity.name.function.operator |
| Parameter | variable.parameter |
| Property (C++/CLI) | variable.other.property |
| Reference Type (C++/CLI) | entity.name.class.reference |
| Static Member Field | variable.other.member.static |
| Static Member Function | entity.name.function.member.static |
| Type | entity.name.type |
| User-Defined Literal - Number | entity.name.user-defined-literal.number |
| User-Defined Literal - Raw | entity.name.user-defined-literal |
| User-Defined Literal - String | entity.name.user-defined-literal.string |
| Value Type (C++/CLI) | entity.name.class.value |
Many of the tokens recognized by IntelliSense do not directly map to existing scopes in the VS Code's default C/C++ TextMate grammar, so are likely not colored by existing VS Code themes.
# Customizing Colors in Settings
Colors can also be overridden globally, in settings:
```
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "entity.name.type",
"settings": {
"foreground": "#FF0000",
"fontStyle": "italic bold underline"
}
}
]
}
```
Or, overridden on a per-theme basis:
```
"editor.tokenColorCustomizations": {
"[Visual Studio Dark]": {
"textMateRules": [
{
"scope": "entity.name.type",
"settings": {
"foreground": "#FF0000",
"fontStyle": "italic bold underline"
}
}
]
}
```
Use the following to augment the Visual Studio Dark theme to match what Visual Studio would display for C++ files.
```
"editor.tokenColorCustomizations": {
"[Visual Studio Dark]": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"foreground": "#57A64A"
}
},
{
"scope": "keyword.control",
"settings": {
"foreground": "#569CD6"
}
},
{
"scope": "keyword.control.directive",
"settings": {
"foreground": "#9B9B9B"
}
},
{
"scope": "keyword.operator",
"settings": {
"foreground": "#B4B4B4"
}
},
{
"scope": "variable",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "constant.numeric",
"settings": {
"foreground": "#B5CEA8"
}
},
{
"scope": "string.quoted",
"settings": {
"foreground": "#D69D85"
}
},
{
"scope": "comment.xml.doc",
"settings": {
"foreground": "#57A64A"
}
},
{
"scope": "comment.xml.doc.tag",
"settings": {
"foreground": "#57A64A"
}
},
{
"scope": "entity.name.function.preprocessor",
"settings": {
"foreground": "#BD63C5"
}
},
{
"scope": "variable.other.enummember",
"settings": {
"foreground": "#B8D7A3"
}
},
{
"scope": "variable.other.global",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "variable.other.local",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "variable.parameter",
"settings": {
"foreground": "#7F7F7F"
}
},
{
"scope": "entity.name.type",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"scope": "entity.name.class.reference",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"scope": "entity.name.class.value",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"scope": "entity.name.function",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "entity.name.function.member",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "variable.other.member",
"settings": {
"foreground": "#DADADA"
}
},
{
"scope": "entity.name.function.member.static",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "variable.other.member.static",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "variable.other.event",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "entity.name.class.template",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"scope": "entity.name.class.generic",
"settings": {
"foreground": "#4EC9B0"
}
},
{
"scope": "entity.name.function.template",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "entity.name.type.namespace",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "entity.name.label",
"settings": {
"foreground": "#C8C8C8"
}
},
{
"scope": "entity.name.user-defined-literal",
"settings": {
"foreground": "#DADADA"
}
},
{
"scope": "entity.name.user-defined-literal.string",
"settings": {
"foreground": "#D69D85"
}
},
{
"scope": "entity.name.user-defined-literal.number",
"settings": {
"foreground": "#B5CEA8"
}
},
{
"scope": "entity.name.function.operator",
"settings": {
"foreground": "#B4B4B4"
}
},
{
"scope": "keyword.operator.member",
"settings": {
"foreground": "#B4B4B4"
}
},
{
"scope": "keyword.operator.new",
"settings": {
"foreground": "#569CD6"
}
},
]
}
}
```
Use the following to augment the Visual Studio Light theme to match what Visual Studio would display for C++ files.
````
"editor.tokenColorCustomizations": {
"[Visual Studio Light]": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"foreground": "#008000"
}
},
{
"scope": "keyword.control",
"settings": {
"foreground": "#0000FF"
}
},
{
"scope": "keyword.control.directive",
"settings": {
"foreground": "#808080"
}
},
{
"scope": "keyword.operator",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "constant.numeric",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "string.quoted",
"settings": {
"foreground": "#A31515"
}
},
{
"scope": "comment.xml.doc",
"settings": {
"foreground": "#006400"
}
},
{
"scope": "comment.xml.doc.tag",
"settings": {
"foreground": "#A9A9A9"
}
},
{
"scope": "entity.name.function.preprocessor",
"settings": {
"foreground": "#6F0026"
}
},
{
"scope": "variable.other.enummember",
"settings": {
"foreground": "#2F4F4F"
}
},
{
"scope": "variable.other.global",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable.other.local",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable.parameter",
"settings": {
"foreground": "#808080"
}
},
{
"scope": "entity.name.type",
"settings": {
"foreground": "#2B91AF"
}
},
{
"scope": "entity.name.class.reference",
"settings": {
"foreground": "#2B91AF"
}
},
{
"scope": "entity.name.class.value",
"settings": {
"foreground": "#2B91AF"
}
},
{
"scope": "entity.name.function",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.function.member",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable.other.member",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.function.member.static",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable.other.member.static",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "variable.other.event",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.class.template",
"settings": {
"foreground": "#2B91AF"
}
},
{
"scope": "entity.name.class.generic",
"settings": {
"foreground": "#2B91AF"
}
},
{
"scope": "entity.name.function.template",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.type.namespace",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.label",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.user-defined-literal",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.user-defined-literal.string",
"settings": {
"foreground": "#A31515"
}
},
{
"scope": "entity.name.user-defined-literal.number",
"settings": {
"foreground": "#000000"
}
},
{
"scope": "entity.name.function.operator",
"settings": {
"foreground": "#008080"
}
},
{
"scope": "keyword.operator.member",
"settings": {
"foreground": "#008080"
}
},
{
"scope": "keyword.operator.new",
"settings": {
"foreground": "#0000FF"
}
},
]
}
}
````
+3
View File
@@ -0,0 +1,3 @@
*.sh text eol=lf
OpenDebugAD7 text eol=lf
link-binaries text eol=lf
+21
View File
@@ -0,0 +1,21 @@
# ignore dependency packages
node_modules
# ignore compliled typescript
out
dist
# ignore downloaded extension files and folders
server
debugAdapters
LLVM
bin/Microsoft.VSCode.CPP.*
# ignore lock files
install.lock
# ignore generated packages
*.vsix
# ignore vscode test
.vscode-test/
+60
View File
@@ -0,0 +1,60 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "Compile Dev",
},
{
"name": "Launch Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/unitTests"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "TypeScript Compile"
},
{
"name": "Node Attach",
"type": "node",
"request": "attach",
"port": 5858
},
{
"name": "Launch Integration Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/test/integrationTests/testAssets/SimpleCppProject",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/languageServer"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "Pretest"
},
]
}
+10
View File
@@ -0,0 +1,10 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}
+85
View File
@@ -0,0 +1,85 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "TypeScript Compile",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": true,
"type": "shell",
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared"
},
"command": "npm",
"args": [
"run",
"compile",
"--loglevel",
"silent"
],
"problemMatcher": "$tsc-watch"
},
{
"label": "TypeScript Lint",
"group": "build",
"isBackground": false,
"type": "shell",
"command": "npm",
"args": [
"run",
"tslint"
],
"problemMatcher": {
"fileLocation": "absolute",
"source": "tslint",
"pattern": [
{
"regexp": "(ERROR:) ([a-zA-Z/:\\-\\.]*)\\[(\\d+), (\\d+)\\]: (.*)",
"severity": 1,
"file": 2,
"line": 3,
"column": 4,
"message": 5
}
]
},
"dependsOn": [
"TypeScript Compile"
]
},
{
"label": "Compile Dev",
"group": "build",
"isBackground": false,
"type": "shell",
"command": "npm",
"args": [
"run",
"compileDev"
],
"problemMatcher": "$tsc-watch"
},
{
"label": "Pretest",
"group": "build",
"isBackground": false,
"type": "shell",
"command": "npm",
"args": [
"run",
"pretest"
],
"dependsOn": [
"TypeScript Compile"
],
"problemMatcher": "$tsc-watch"
}
]
}
+36
View File
@@ -0,0 +1,36 @@
# ignore vscode settings for extension development
.vscode/**
# ignore binaries
obj/**
# ignore source files
tools/**
notices/**
test/**
src/**
# ignore .js files that are webpacked or only used for development
out/src/**
out/tools/**
# ignore ts files in ui
ui/*.ts
# ignore Azure-Pipelines files
jobs/**
# ignore development files
tsconfig.json
test.tsconfig.json
tslint.json
webpack.config.js
tscCompileList.txt
gulpfile.js
.gitattributes
.gitignore
CMakeLists.txt
debugAdapters/install.lock*
typings/**
**/*.map
+742
View File
@@ -0,0 +1,742 @@
# C/C++ for Visual Studio Code Change Log
## Version 0.24.0: July 3, 2019
### New Features
* Semantic colorization [Documentation](https://github.com/microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/colorization.md) [#230](https://github.com/microsoft/vscode-cpptools/issues/230)
* Add `Rescan Workspace` command. [microsoft/vscode-cpptools-api#11](https://github.com/microsoft/vscode-cpptools-api/issues/11)
### Enhancements
* Configuration UI editor improvements:
* Add list of detected compiler paths. [PR #3708](https://github.com/microsoft/vscode-cpptools/pull/3708)
* Enable selecting/editing of other configurations and add "Advanced Settings" section. [PR #3732](https://github.com/microsoft/vscode-cpptools/pull/3732)
* Enable `envFile` for `cppdbg`. [PR #3723](https://github.com/microsoft/vscode-cpptools/pull/3723)
* Change the default path value of `C_Cpp.intelliSenseCachePath`. [#3347](https://github.com/microsoft/vscode-cpptools/issues/3347) [#3664](https://github.com/microsoft/vscode-cpptools/issues/3664)
* Change `C_Cpp.clang_format_path` to `machine` scope. [#3774](https://github.com/microsoft/vscode-cpptools/issues/3774)
* Add validation to the advanced configuration UI settings. [PR #3838](https://github.com/microsoft/vscode-cpptools/pull/3838)
* Add `Current Configuration` to `C/C++: Log Diagnostics`. [PR #3866](https://github.com/microsoft/vscode-cpptools/pull/3866)
### Bug Fixes
* Fix for gdb `follow-fork-mode` `child` not working. [#2738](https://github.com/microsoft/vscode-cpptools/issues/2738)
* Fix IntelliSense process crash on hover with certain arrays. [#3081](https://github.com/Microsoft/vscode-cpptools/issues/3081)
* Fix IntelliSense-based `Go to Definition` for goto labels. [#3111](https://github.com/microsoft/vscode-cpptools/issues/3111)
* Fix IntelliSense behaving incorrectly when files are opened with different casing on Windows. [#3229](https://github.com/microsoft/vscode-cpptools/issues/3229)
* Fix user defined literals crashing IntelliSense in clang/gcc mode. [#3481](https://github.com/microsoft/vscode-cpptools/issues/3481)
* Improve `sourceFileMap` to be more dynamic. [#3504](https://github.com/microsoft/vscode-cpptools/issues/3504)
* Fix IntelliSense-based hover document comments being shown for invalid declarations not used by the current translation unit. [#3596](https://github.com/microsoft/vscode-cpptools/issues/3596)
* Fix `Go to Definition` when is `void` missing in the parameter list of a function definition a .c file. [#3609](https://github.com/microsoft/vscode-cpptools/issues/3609)
* Fix configuration validation of compiler path and IntelliSense mode compatibility for `clang-cl.exe` compiler. [#3637](https://github.com/microsoft/vscode-cpptools/issues/3637)
* Fix resolving `${workspaceFolderBasename}` and add `${workspaceStorage}`. [#3642](https://github.com/microsoft/vscode-cpptools/issues/3642)
* Fix IntelliSense-based `Go to Definition` performance issue due to extra database iteration. [#3655](https://github.com/microsoft/vscode-cpptools/issues/3655)
* Fix `SourceRequest` causing debugging to stop with `NotImplementedException`. [#3662](https://github.com/microsoft/vscode-cpptools/issues/3662)
* Fix typo in `intelliSenseMode` description.
* Karsten Thoms (@kthoms) [PR #3682](https://github.com/microsoft/vscode-cpptools/pull/3682)
* Fix invalid warning with typedef enums in .c files. [#3685](https://github.com/microsoft/vscode-cpptools/issues/3685)
* Fix incorrect `keyword` completion occurring for pragma `#keyword`. [#3690](https://github.com/microsoft/vscode-cpptools/issues/3690)
* Fix problem matcher to show fatal errors from GCC [#3712](https://github.com/microsoft/vscode-cpptools/issues/3712)
* Fix multi-root folders with the same name sharing the same browse database. [PR #3715](https://github.com/microsoft/vscode-cpptools/pull/3715)
* Fix `remoteProcessPicker` on Windows. [#3758](https://github.com/microsoft/vscode-cpptools/issues/3758)
* Fix crash when tag parsing Objective-C code. [#3776](https://github.com/microsoft/vscode-cpptools/issues/3776)
* Fix duplicate slashes getting added to `c_cpp_properties.json`. [PR #3778](https://github.com/microsoft/vscode-cpptools/pull/3778)
* Fix `envFile` variable substitution. [#3836](https://github.com/microsoft/vscode-cpptools/issues/3836)
* Fix missing headers popup. [PR #3840](https://github.com/microsoft/vscode-cpptools/pull/3840)
* Fix multiple anonymous unions not showing correctly in Locals while debugging. [MIEngine#820](https://github.com/microsoft/MIEngine/issues/820)
* Fix pause not working when using `DebugServer`/`MIDebuggerServerAddress` on Linux and macOS. [MIEngine#844](https://github.com/microsoft/MIEngine/issues/844)
* Improvements to CPU and memory usage when editing.
## Version 0.23.1: May 13, 2019
### Bug Fixes
* Fix `launch.json` creation when `intelliSenseEngine` is `"Disabled"`. [#3583](https://github.com/microsoft/vscode-cpptools/issues/3583)
* Fix C/C++ commands not working if the language service isn't activated. [#3615](https://github.com/microsoft/vscode-cpptools/issues/3615)
* Fix missing extension `"Details"` page. [#3621](https://github.com/microsoft/vscode-cpptools/issues/3621)
* Fix some random crashes related to IntelliSense inactive region processing.
## Version 0.23.0: May 6, 2019
### New Features
* Add a configuration UI editor to edit IntelliSense settings defined in the underlying `c_cpp_properties.json` file. [PR #3479](https://github.com/Microsoft/vscode-cpptools/pull/3479), [PR #3487](https://github.com/Microsoft/vscode-cpptools/pull/3487), [PR #3519](https://github.com/Microsoft/vscode-cpptools/pull/3519), [#3524](https://github.com/Microsoft/vscode-cpptools/issues/3524), [PR #3563](https://github.com/Microsoft/vscode-cpptools/pull/3563), [#3526](https://github.com/Microsoft/vscode-cpptools/issues/3526)
* Add a new command `C/C++: Edit configurations (UI)` to open the UI editor.
* Replace the `C/C++: Edit configurations...` command with `C/C++: Edit configurations (JSON)` to open `c_cpp_properties.json`.
* The default whether to open the UI editor or JSON file is based on the `workbench.settings.editor` setting.
* Add command `C/C++: Log Diagnostics` to log language service diagnostics. [PR #3489](https://github.com/Microsoft/vscode-cpptools/pull/3489)
* Add support for `.env` files for `cppvsdbg`. [#3490](https://github.com/Microsoft/vscode-cpptools/issues/3490)
### Other Changes
* Enable flag `/permissive-` as an argument to `compilerPath` with `cl.exe`. [#1589](https://github.com/Microsoft/vscode-cpptools/issues/1589), [#3446](https://github.com/Microsoft/vscode-cpptools/issues/3446)
* Configuration squiggles for `c_cpp_properties.json` now validates if the setting values of `compilerPath` and `intelliSenseMode` match on Windows. [#2983](https://github.com/Microsoft/vscode-cpptools/issues/2983)
* Enable `-fms-extensions` to be used as an argument to `compilerPath` on Linux/Mac. [#3063](https://github.com/Microsoft/vscode-cpptools/issues/3063)
* Change the default value of `C_Cpp.intelliSenseEngineFallback` setting to `Disabled`. [#3165](https://github.com/Microsoft/vscode-cpptools/issues/3165)
* Add squiggle when `compilerPath` uses spaces and arguments without `"`. [#3357](https://github.com/Microsoft/vscode-cpptools/issues/3357)
* Change the `Disabled` value for `C_Cpp.errorSquiggles` to stop showing missing header squiggles. [#3361](https://github.com/Microsoft/vscode-cpptools/issues/3361)
* Add `enableConfigurationSquiggles` setting to allow squiggles to be disabled for `c_cpp_properties.json`. [#3403](https://github.com/Microsoft/vscode-cpptools/issues/3403)
* Switch to using the `installExtension` command for offline/insider vsix installing (to reduce install failures). [#3408](https://github.com/Microsoft/vscode-cpptools/issues/3408)
* Add a better example to the description of `C_Cpp.clang_format_style` and `C_Cpp.clang_format_fallback_style`. [#3419](https://github.com/Microsoft/vscode-cpptools/issues/3419)
* Add a new (default) value of `EnabledIfIncludesResolve` to `C_Cpp.errorSquiggles`, which only shows error squiggles if include headers are successfully resolved. [PR #3421](https://github.com/Microsoft/vscode-cpptools/pull/3421)
* Disable debug heap by default with cppvsdbg. [#3484](https://github.com/Microsoft/vscode-cpptools/issues/3484)
* Reported by Djoulihen (@Djoulihen)
* Enable configuration squiggles for paths delimited by semicolons. [PR #3517](https://github.com/Microsoft/vscode-cpptools/pull/3517)
* Don't show release notes if the extension has never been installed before. [#3533](https://github.com/Microsoft/vscode-cpptools/issues/3533)
* Remove IntelliSense fallback code actions.
### Bug Fixes
* Fix browsing for functions with BOOST_FOREACH. [#953](https://github.com/Microsoft/vscode-cpptools/issues/953)
* Fix code action sometimes not appearing over a squiggled identifier. [#1436](https://github.com/microsoft/vscode-cpptools/issues/1436)
* Work around issue with VS Code not treating `.C` files as C++ files [Microsoft/vscode#59369](https://github.com/Microsoft/vscode/issues/59369) -- `.C` files become associated by name in `files.associations`. [#2558](https://github.com/Microsoft/vscode-cpptools/issues/2558)
* Fix various IntelliSense parsing bugs. [#2824](https://github.com/Microsoft/vscode-cpptools/issues/2824), [#3110](https://github.com/Microsoft/vscode-cpptools/issues/3110), [#3168](https://github.com/Microsoft/vscode-cpptools/issues/3168)
* Preserve newlines in documentation comments. [#2937](https://github.com/Microsoft/vscode-cpptools/issues/2937)
* Fix documentation comments above multi-line templates (and some other issues). [#3162](https://github.com/Microsoft/vscode-cpptools/issues/3162)
* Fix "Extension causes high cpu load" due to module loading. [#3213](https://github.com/Microsoft/vscode-cpptools/issues/3213)
* Fix auto-removal of compiler-provided paths in `includePath` when they end with a directory separator on Windows. [#3245](https://github.com/Microsoft/vscode-cpptools/issues/3245)
* Fix duplicate compiler build tasks appearing when `compilerPath` has arguments. [PR #3360](https://github.com/Microsoft/vscode-cpptools/pull/3360)
* Fix environment variables not resolving with `C_Cpp.intelliSenseCachePath`. [#3367](https://github.com/Microsoft/vscode-cpptools/issues/3367)
* Fix the formatting of snippets text. [#3376](https://github.com/Microsoft/vscode-cpptools/issues/3376)
* Fix the default `AccessModifierOffset` used when formatting. [#3376](https://github.com/Microsoft/vscode-cpptools/issues/3376)
* Fix null reference during initialization when using custom configuration providers. [PR #3377](https://github.com/Microsoft/vscode-cpptools/pull/3377)
* Fix symbol parsing when `__MINGW_ATTRIB_*` is used. [#3390](https://github.com/Microsoft/vscode-cpptools/issues/3390)
* Fix `compile_commands.json` configuration prompt being disabled per user instead of per folder. [PR #3399](https://github.com/Microsoft/vscode-cpptools/pull/3399)
* Fix `.cmd` and `.bat` files not working for `compilerPath` on Windows. [#3428](https://github.com/Microsoft/vscode-cpptools/issues/3428)
* Fix `compilerPath` with arguments that are surrounded by quotes. [#3428](https://github.com/Microsoft/vscode-cpptools/issues/3428)
* Fix documentation comments interpreting special characters as markdown. [#3441](https://github.com/Microsoft/vscode-cpptools/issues/3441)
* Fix hover using the configuration of the active document instead of the hovered document. [#3452](https://github.com/Microsoft/vscode-cpptools/issues/3452)
* Fix `c_cpp_properties.json` squiggles when the configuration name has regex characters. [PR #3478](https://github.com/Microsoft/vscode-cpptools/pull/3478)
* Use the `editor.tabSize` setting instead of `2` when creating build tasks. [PR #3486](https://github.com/Microsoft/vscode-cpptools/pull/3486)
* Fix some potential crashes on hover. [#3509](https://github.com/Microsoft/vscode-cpptools/issues/3509)
* Fix for `NullReferenceException` occurring when `"args"` is not specified in `launch.json`. [#3532](https://github.com/Microsoft/vscode-cpptools/issues/3532)
* Fix `Go to Definition` giving no results when IntelliSense doesn't find the symbol. [#3549](https://github.com/Microsoft/vscode-cpptools/issues/3549)
* Fix configuration squiggles with trailing backslashes. [PR #3573](https://github.com/Microsoft/vscode-cpptools/pull/3573)
* Fix `includePath` code actions, configuration prompts, and the `C/C++: Change configuration provider...` command. [PR #3576](https://github.com/Microsoft/vscode-cpptools/pull/3576)
* Fix randomly occurring crash (that could occur when opening files while IntelliSense squiggles are pending).
* Fix crash on hover (that could occur when document comments have blank lines).
* Fix icon of parameters in completion results.
## Version 0.22.1: March 21, 2019
* Fix `tasks.json` with single-line comments being overwritten when `Build and Debug Active File` is used. [#3327](https://github.com/Microsoft/vscode-cpptools/issues/3327)
* Fix an invalid `compilerPath` property getting added to `tasks.json` after doing `Configure Task` with a C/C++ compiler.
* Add IntelliSense caching for macOS 10.13 or later (0.22.0 only supported Windows and Linux).
## Version 0.22.0: March 19, 2019
### Major Changes
* Add warning squiggles for invalid properties and paths in `c_cpp_properties.json`. [#2799](https://github.com/Microsoft/vscode-cpptools/issues/2799), [PR #3283](https://github.com/Microsoft/vscode-cpptools/pull/3283)
* Add C/C++ compiler build tasks for compiling the active source file, with support for `F5` debugging and the `Build and Debug Active File` context menu command. [PR #3118](https://github.com/Microsoft/vscode-cpptools/pull/3118), [PR #3244](https://github.com/Microsoft/vscode-cpptools/pull/3244)
* Add AutoPCH support to reduce IntelliSense parsing time, with `C_Cpp.intelliSenseCachePath` and `C_Cpp.intelliSenseCacheSize` settings. It isn't enabled for Mac yet. [PR #3184](https://github.com/Microsoft/vscode-cpptools/pull/3184)
### Minor Changes
* Fix IntelliSense not working on Windows when the username has a space in it and file `C:\Users\<firstname>` exists. [#1377](https://github.com/Microsoft/vscode-cpptools/issues/1377), [#2114](https://github.com/Microsoft/vscode-cpptools/issues/2114), [#2176](https://github.com/Microsoft/vscode-cpptools/issues/2176), [#3052](https://github.com/Microsoft/vscode-cpptools/issues/3052), [#3139](https://github.com/Microsoft/vscode-cpptools/issues/3139)
* Enable `${command:cpptools.activeConfigName}` in tasks. [#1524](https://github.com/Microsoft/vscode-cpptools/issues/1524)
* Fix bugs with squiggles and IntelliSense updating after edits. [#1779](https://github.com/Microsoft/vscode-cpptools/issues/1779), [#3124](https://github.com/Microsoft/vscode-cpptools/issues/3124), [#3260](https://github.com/Microsoft/vscode-cpptools/issues/3260)
* Fix formatting (and other non-IntelliSense operations) being blocked by IntelliSense processing. [#1928](https://github.com/Microsoft/vscode-cpptools/issues/1928)
* Fix completion when the start of an identifier matches a keyword. [#1986](https://github.com/Microsoft/vscode-cpptools/issues/1986)
* Fix auto-removal of compiler-provided paths in `includePath`. [#2177](https://github.com/Microsoft/vscode-cpptools/issues/2177)
* Fix crash on Windows when 8.3 filenames are used. [#2453](https://github.com/Microsoft/vscode-cpptools/issues/2453), [#3104](https://github.com/Microsoft/vscode-cpptools/issues/3104)
* Add support for `Scope::Member` scoped symbol searches. [#2484](https://github.com/Microsoft/vscode-cpptools/issues/2484)
* Fix signature help active parameter selection when parameter names are missing or subsets of each other. [#2952](https://github.com/Microsoft/vscode-cpptools/issues/2952)
* Fix `--enable-pretty-printing` with `gdb` when complex objects are used as keys in maps. [#3024](https://github.com/Microsoft/vscode-cpptools/issues/3024)
* Fix IntelliSense-based `Go to Definition` for `noexcept` methods. [#3060](https://github.com/Microsoft/vscode-cpptools/issues/3060)
* Render macro hover expansions as C/C++. [#3075](https://github.com/Microsoft/vscode-cpptools/issues/3075)
* Enable completion after `struct` when manually invoked. [#3080](https://github.com/Microsoft/vscode-cpptools/issues/3080)
* Add `C_Cpp.suggestSnippets` setting to disable language server snippets. [#3083](https://github.com/Microsoft/vscode-cpptools/issues/3083)
* Show a prompt for changing `C_Cpp.updateChannel` to `Insiders`. [#3089](https://github.com/Microsoft/vscode-cpptools/issues/3089)
* lh123 (@lh123) [PR #3221](https://github.com/Microsoft/vscode-cpptools/pull/3221)
* Fix `compilerPath` not getting priority over the `compile_commands.json` compiler. [#3102](https://github.com/Microsoft/vscode-cpptools/issues/3102)
* Fix Linux `compile_commands.json` compiler querying with relative paths. [#3112](https://github.com/Microsoft/vscode-cpptools/issues/3112)
* Allow `*` in `includePath` to apply to `browse.path` when `browse.path` is not specified. [#3121](https://github.com/Microsoft/vscode-cpptools/issues/3121)
* Tucker Kern (@mill1000) [PR #3122](https://github.com/Microsoft/vscode-cpptools/pull/3122)
* Disable `(` and `<` completion commit characters. [#3127](https://github.com/Microsoft/vscode-cpptools/issues/3127)
* Add Chinese translations for command titles. [PR #3128](https://github.com/Microsoft/vscode-cpptools/pull/3128)
* Fix remote process picker bug. [#2585](https://github.com/Microsoft/vscode-cpptools/issues/2585), [#3150](https://github.com/Microsoft/vscode-cpptools/issues/3150)
* Fix command not found and empty `c_cpp_properties.json` if activation is too slow. [#3160](https://github.com/Microsoft/vscode-cpptools/issues/3160), [#3176](https://github.com/Microsoft/vscode-cpptools/issues/3176)
* Fix `cppvsdbg` debugger showing `"An unspecified error has occurred."` for structured binding variables. [#3197](https://github.com/Microsoft/vscode-cpptools/issues/3197)
* Fix bugs with the Insider reload prompt appearing when it shouldn't. [#3206](https://github.com/Microsoft/vscode-cpptools/issues/3206)
* Fix variable expansion (e.g. `${env.HOME}`) not working when `${default}` is used in `c_cpp_properties.json`. [#3309](https://github.com/Microsoft/vscode-cpptools/issues/3309)
* Fix other unreported IntelliSense engine bugs.
## Version 0.21.0: January 23, 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)
* Fix the highest hitting main process crash.
* Fix IntelliSense process crash with completion.
## Version 0.20.0: October 30, 2018
* Add IntegratedTerminal support for Linux and Windows. [#35](https://github.com/microsoft/vscode-cpptools/issues/35)
* Unify Visual Studio Code debug protocol parsing by using a shared library with Visual Studio.
* Fix IntelliSense-based `Go to Definition` on overloads (in the same TU). [#1071](https://github.com/Microsoft/vscode-cpptools/issues/1071)
* Fix inactive regions not being disabled when falling back to the Tag Parser. [#2181](https://github.com/Microsoft/vscode-cpptools/issues/2181)
* Fix `#include` completion not working with `compile_commands.json` or custom configuration providers. [#2242](https://github.com/Microsoft/vscode-cpptools/issues/2242)
* Fix IntelliSense failing if recursive includes removes all paths. [#2442](https://github.com/Microsoft/vscode-cpptools/issues/2442)
* Fix incorrect IntelliSense errors with MinGW (stop using `-fms-extensions` by default). [#2443](https://github.com/Microsoft/vscode-cpptools/issues/2443), [#2623](https://github.com/Microsoft/vscode-cpptools/issues/2623)
* Fix error squiggles sometimes not updating after typing. [#2448](https://github.com/Microsoft/vscode-cpptools/issues/2448)
* Add support for Mac framework paths in `compile_commands.json`. [#2508](https://github.com/Microsoft/vscode-cpptools/issues/2508)
* Fix IntelliSense-based `Go to Definition` falling back to the Tag Parser for definitions not in the TU. [#2536](https://github.com/Microsoft/vscode-cpptools/issues/2536), [#2677](https://github.com/Microsoft/vscode-cpptools/issues/2677)
* Fix IntelliSense-based `Go to Definition` on the identifier of a definition with no declaration. [#2573](https://github.com/Microsoft/vscode-cpptools/issues/2573)
* Fix IntelliSense-based `Go to Definition` not falling back to the declaration (in certain cases). [#2574](https://github.com/Microsoft/vscode-cpptools/issues/2574)
* Fix IntelliSense-based `Go to Definition` going to the wrong location after edits are made. [#2579](https://github.com/Microsoft/vscode-cpptools/issues/2579)
* Fix `Go to Definition` when the `intelliSenseEngineFallback` is `Disabled` and `#include`s are missing. [#2583](https://github.com/Microsoft/vscode-cpptools/issues/2583)
* Fix empty `C_Cpp.default.*` settings not being used. [#2584](https://github.com/Microsoft/vscode-cpptools/issues/2584)
* Fix quoting around `ssh`'s command (for the debugger). [#2585](https://github.com/Microsoft/vscode-cpptools/issues/2585)
* Fix crash on hover (and `Go to Definition`) when using the `Tag Parser`. [#2586](https://github.com/Microsoft/vscode-cpptools/issues/2586)
* Fix errors when a workspace folder isn't open. [#2613](https://github.com/Microsoft/vscode-cpptools/issues/2613), [#2691](https://github.com/Microsoft/vscode-cpptools/issues/2691)
* Fix `-isystem` without a space after getting ignored in `compile_comamands.json`. [#2629](https://github.com/Microsoft/vscode-cpptools/issues/2629)
* Fix Insiders update channel installation bugs. [#2636](https://github.com/Microsoft/vscode-cpptools/issues/2636), [#2685](https://github.com/Microsoft/vscode-cpptools/issues/2685)
* Fix IntelliSense-based `Go to Declaration` falling back to the Tag Parser if the definition is also in the TU. [#2642](https://github.com/Microsoft/vscode-cpptools/issues/2642)
* Fix the `Disabled` `intelliSenseEngine` setting not working with custom configuration providers. [#2656](https://github.com/Microsoft/vscode-cpptools/issues/2656)
## Version 0.19.0: September 27, 2018
* Change the symbol database to update without needing to save. [#202](https://github.com/Microsoft/vscode-cpptools/issues/202)
* Enable IntelliSense-based `Go to Definition` for the current translation unit, including local variables and overloaded operators. [#255](https://github.com/Microsoft/vscode-cpptools/issues/255), [#979](https://github.com/Microsoft/vscode-cpptools/issues/979)
* Improved the `Go to Definition` performance with large workspaces and files with lots of `#include`s. [#273](https://github.com/Microsoft/vscode-cpptools/issues/273)
* Disable `Go to Definition` for invalid tokens, e.g. comments, strings, keywords, etc. [#559](https://github.com/Microsoft/vscode-cpptools/issues/559)
* Add `C_Cpp.updateChannel` setting for easier access to Insider builds of the extension. [#1526](https://github.com/Microsoft/vscode-cpptools/issues/1526)
* Add support for v2 of the configuration provider API. [#2237](https://github.com/Microsoft/vscode-cpptools/issues/2237)
* Fix bug with parsing definitions in `compile_commands.json`. [#2305](https://github.com/Microsoft/vscode-cpptools/issues/2305)
* Fix `sh` failure when attaching to a remote Linux process. [#2444](https://github.com/Microsoft/vscode-cpptools/issues/2444)
* Fix incorrect default `cl.exe` macro. [PR #2468](https://github.com/Microsoft/vscode-cpptools/issues/2468)
* Fix multiple bugs with the symbols in the Outline view not updating correctly. [#2477](https://github.com/Microsoft/vscode-cpptools/issues/2477), [#2500](https://github.com/Microsoft/vscode-cpptools/issues/2500), [#2504](https://github.com/Microsoft/vscode-cpptools/issues/2504)
* Add support for `workspaceFolderBasename` expansion. [#2491](https://github.com/Microsoft/vscode-cpptools/issues/2491)
* 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 [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)
## Version 0.18.0: August 17, 2018
### New Features
* Add the `C_Cpp.intelliSenseEngine` setting value of `Disabled` (for users who only use the debugger). [#785](https://github.com/Microsoft/vscode-cpptools/issues/785)
* Add `C_Cpp.workspaceSymbols` setting with default `Just My Code` to filter out system header symbols. [#1119](https://github.com/Microsoft/vscode-cpptools/issues/1119), [#2320](https://github.com/Microsoft/vscode-cpptools/issues/2320)
* Add `C_Cpp.inactiveRegionForegroundColor` and `C_Cpp.inactiveRegionBackgroundColor` settings. [#1620](https://github.com/Microsoft/vscode-cpptools/issues/1620), [#2212](https://github.com/Microsoft/vscode-cpptools/issues/2212)
* John Patterson (@john-patterson) [PR #2308](https://github.com/Microsoft/vscode-cpptools/pull/2308)
* Add `gcc-x64` `intelliSenseMode` and send the correct clang or gcc version to our parser, fixing various IntelliSense errors. [#2112](https://github.com/Microsoft/vscode-cpptools/issues/2112), [#2175](https://github.com/Microsoft/vscode-cpptools/issues/2175), [#2260](https://github.com/Microsoft/vscode-cpptools/issues/2260), [#2299](https://github.com/Microsoft/vscode-cpptools/issues/2299), [#2317](https://github.com/Microsoft/vscode-cpptools/issues/2317)
* Make `Go to Definition` on the definition go to the declaration instead. [#2298](https://github.com/Microsoft/vscode-cpptools/issues/2298)
* Add multi-pass environment variable resolution allowing variables defined in terms of other variables. [#2057](https://github.com/Microsoft/vscode-cpptools/issues/2057)
* John Patterson (@john-patterson) [PR #2322](https://github.com/Microsoft/vscode-cpptools/pull/2322)
* Allow users to use `~` for `${userProfile}` on Windows. [PR #2333](https://github.com/Microsoft/vscode-cpptools/pull/2333)
* Add support for compiler flags `-fms-extensions` and `-fno-ms-extensions` on Windows (the default for MinGW-based compilers). [#2363](https://github.com/Microsoft/vscode-cpptools/issues/2363)
* Make completion "show more results" (i.e. inaccessible members) when invoked a 2nd time. [#2386](https://github.com/Microsoft/vscode-cpptools/issues/2386)
### Bug Fixes
* Fix attach to process for systems without `bash` by using `sh` instead. [#569](https://github.com/Microsoft/vscode-cpptools/issues/569)
* Andy Neff (@andyneff) [PR #2340](https://github.com/Microsoft/vscode-cpptools/pull/2340)
* Fix IntelliSense crash after hover or completion with `_Complex` types. [#689](https://github.com/Microsoft/vscode-cpptools/issues/689), [#1112](https://github.com/Microsoft/vscode-cpptools/issues/1112)
* Fix `files.exclude` not working to exclude non-workspace folders from symbol parsing. [#1066](https://github.com/Microsoft/vscode-cpptools/issues/1066)
* Fix `Switch Header/Source` to give results that match the parent folder name before using just the file name. [#1085](https://github.com/Microsoft/vscode-cpptools/issues/1085)
* Fix incorrect IntelliSense errors caused by namespace lookup failure when instantiation template arguments in clang mode. [#1395](https://github.com/Microsoft/vscode-cpptools/issues/1395), [#1559](https://github.com/Microsoft/vscode-cpptools/issues/1559), [#1753](https://github.com/Microsoft/vscode-cpptools/issues/1753), [#2272](https://github.com/Microsoft/vscode-cpptools/issues/2272)
* Fix missing parameter help when using { for constructors. [#1667](https://github.com/Microsoft/vscode-cpptools/issues/1667)
* Fix Mac framework dependencies not being discovered. [#1913](https://github.com/Microsoft/vscode-cpptools/issues/1913)
* Fix `compilerPath` not working with `${workspaceFolder}`. [#1982](https://github.com/Microsoft/vscode-cpptools/issues/1982)
* Fix red flame getting stuck after modifying `c_cpp_properties.json`. [#2077](https://github.com/Microsoft/vscode-cpptools/issues/2077)
* Don't add empty `windowsSDKVersion` if none exists. [#2300](https://github.com/Microsoft/vscode-cpptools/issues/2300)
* Fix IntelliSense crash when the gcc-8 type_traits header is used. [#2323](https://github.com/Microsoft/vscode-cpptools/issues/2323), [#2328](https://github.com/Microsoft/vscode-cpptools/issues/2328)
* Limit configuration popups to one at a time. [#2324](https://github.com/Microsoft/vscode-cpptools/issues/2324)
* Don't show `includePath` code actions if compile commands or custom configuration providers are used. [#2334](https://github.com/Microsoft/vscode-cpptools/issues/2334)
* Fix `C_Cpp.clang_format_path` not accepting environment variables. [#2344](https://github.com/Microsoft/vscode-cpptools/issues/2344)
* Fix IntelliSense not working with non-ASCII characters in the WSL install path. [#2351](https://github.com/Microsoft/vscode-cpptools/issues/2351)
* Filter out buggy IntelliSense error `"= delete" can only appear on the first declaration of a function`. [#2352](https://github.com/Microsoft/vscode-cpptools/issues/2352)
* Fix IntelliSense failing with WSL if gcc is installed bug g++ isn't. [#2360](https://github.com/Microsoft/vscode-cpptools/issues/2360)
* Fix WSL paths starting with `/mnt/` failing to get symbols parsed. [#2361](https://github.com/Microsoft/vscode-cpptools/issues/2361)
* Fix IntelliSense process crash when hovering over a designated initializer list with an anonymous struct. [#2370](https://github.com/Microsoft/vscode-cpptools/issues/2370)
* Stop showing "File: " in completion details for internal compiler defines. [#2387](https://github.com/Microsoft/vscode-cpptools/issues/2387)
* Invoke `Edit Configurations...` when the `Configuration Help` button is clicked. [#2408](https://github.com/Microsoft/vscode-cpptools/issues/2408)
* Fix provider configuration prompt not showing for newly added workspace folders. [#2415](https://github.com/Microsoft/vscode-cpptools/issues/2415)
* Fix to allow SIGINT to be sent using the kill -2 command when using pipeTransport.
## Version 0.17.7: July 22, 2018
* Fix `Go to Definition` for code scoped with an aliased namespace. [#387](https://github.com/Microsoft/vscode-cpptools/issues/387)
* Fix incorrect IntelliSense errors with template template-arguments. [#1014](https://github.com/Microsoft/vscode-cpptools/issues/1014)
* Fix crash when using designated initializer lists. [#1440](https://github.com/Microsoft/vscode-cpptools/issues/1440)
* Add `windowsSdkVersion` to `c_cpp_properties.json`. [#1585](https://github.com/Microsoft/vscode-cpptools/issues/1585)
* Add `${vcpkgRoot}` variable. [#1817](https://github.com/Microsoft/vscode-cpptools/issues/1817)
* Fix dangling IntelliSense processes. [#2075](https://github.com/Microsoft/vscode-cpptools/issues/2075), [#2169](https://github.com/Microsoft/vscode-cpptools/issues/2169)
* Fix incorrect IntelliSense errors when class template argument deduction is used. [#2101](https://github.com/Microsoft/vscode-cpptools/issues/2101)
* Skip automatic parsing of source files in Mac system framework paths. [#2156](https://github.com/Microsoft/vscode-cpptools/issues/2156)
* Fix `Edit Configurations...` not working after `c_cpp_properties.json` is deleted. [#2214](https://github.com/Microsoft/vscode-cpptools/issues/2214)
* Fix indexing of the entire root drive on Windows when no is folder open. [#2216](https://github.com/Microsoft/vscode-cpptools/issues/2216)
* Disable the config provider message for headers outside the workspace and when debugging. [#2221](https://github.com/Microsoft/vscode-cpptools/issues/2221)
* Add `Change Configuration Provider...` command. [#2224](https://github.com/Microsoft/vscode-cpptools/issues/2224)
* Fix out-of-memory crash with `#include` code actions when no folder is open. [#2225](https://github.com/Microsoft/vscode-cpptools/issues/2225)
* Fix `intelliSenseMode` with custom config providers on Windows. [#2228](https://github.com/Microsoft/vscode-cpptools/issues/2228)
* Fix formatting not working on Windows if the VC++ 2015 redist isn't installed. [#2232](https://github.com/Microsoft/vscode-cpptools/issues/2232)
* 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 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 debugging async Visual C++ causing debugger to hang.
* Fix `main` snippet.
## Version 0.17.6: July 2, 2018
* Fix the database icon getting stuck with recursive includes. [#2104](https://github.com/Microsoft/vscode-cpptools/issues/2104)
* Fix the red flame appearing late with recursive includes. [#2105](https://github.com/Microsoft/vscode-cpptools/issues/2105)
* Fix source files being parsed in system directories. [#2156](https://github.com/Microsoft/vscode-cpptools/issues/2156)
* Fix internal document corruption (visible after formatting) when edits are made too soon after activation. [#2162](https://github.com/Microsoft/vscode-cpptools/issues/2162)
* Fix a crash when saving with recursive includes. [#2173](https://github.com/Microsoft/vscode-cpptools/issues/2173)
* Fix a crash when the `includePath` or `browse.path` is `"**"`. [#2174](https://github.com/Microsoft/vscode-cpptools/issues/2174)
* Fix IntelliSense for WSL without g++ installed. [#2178](https://github.com/Microsoft/vscode-cpptools/issues/2178)
* Fix random IntelliSense (completion) failures due to edits being delayed. [#2184](https://github.com/Microsoft/vscode-cpptools/issues/2184)
* Fix database deletion failure with non-ASCII file paths on Windows. [#2205](https://github.com/Microsoft/vscode-cpptools/issues/2205)
* Fix `Go to Definition` results with `var::` and `var->`, and filter out invalid constructor results. [#2207](https://github.com/Microsoft/vscode-cpptools/issues/2207)
* Fix a performance bug with recursive includes.
* Fixed a CPU usage problem on Mac related to system frameworks parsing.
* Keep the IntelliSense process around for 10 seconds after a file is closed in case it's needed again.
* Added an API so build system extensions can provide IntelliSense configurations for source files. More details at [npmjs.com](https://www.npmjs.com/package/vscode-cpptools).
* Fix automatic argument quoting when debugging with gdb/lldb to include when the argument has a '(' or ')' in it. Also escape existing '"' symbols.
* Removed `-` in `ps` call for ProcessPicker and RemoteProcessPicker. [#2183](https://github.com/Microsoft/vscode-cpptools/issues/2183)
## Version 0.17.5: June 21, 2018
* Detect `compile_commands.json` and show prompt to use it. [#1297](https://github.com/Microsoft/vscode-cpptools/issues/1297)
* Change inactive regions from gray to translucent. [#1907](https://github.com/Microsoft/vscode-cpptools/issues/1907)
* Improve performance of recursive includes paths. [#2068](https://github.com/Microsoft/vscode-cpptools/issues/2068)
* Fix IntelliSense client failure due to `No args provider`. [#1908](https://github.com/Microsoft/vscode-cpptools/issues/1908)
* Fix `#include` completion with headers in the same directory. [#2031](https://github.com/Microsoft/vscode-cpptools/issues/2031)
* Fix non-header files outside the workspace folder not being parsed (i.e. so `Go to Definition` works). [#2053](https://github.com/Microsoft/vscode-cpptools/issues/2053)
* Fix some crashes. [#2080](https://github.com/Microsoft/vscode-cpptools/issues/2080)
* Support asm clobber registers on Windows. [#2090](https://github.com/Microsoft/vscode-cpptools/issues/2090)
* Fix usage of `${config:section.setting}`. [#2165](https://github.com/Microsoft/vscode-cpptools/issues/2165)
* `browse.path` now inherits `includePath` if not set in `c_cpp_properties.json`.
* 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 -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)
* Stop using recursive includes in the default configuration.
* @Hyzeta [PR #2059](https://github.com/Microsoft/vscode-cpptools/pull/2059)
* Fix various other potential deadlocks and crashes.
* Fix `Go to Definition` on `#include` not filtering out results based on the path. [#1253](https://github.com/Microsoft/vscode-cpptools/issues/1253), [#2033](https://github.com/Microsoft/vscode-cpptools/issues/2033)
* Fix database icon getting stuck. [#1917](https://github.com/Microsoft/vscode-cpptools/issues/1917)
## Version 0.17.3: May 22, 2018
* Add support for `${workspaceFolder:folderName}`. [#1774](https://github.com/Microsoft/vscode-cpptools/issues/1774)
* Fix infinite loop during initialization on Windows. [#1960](https://github.com/Microsoft/vscode-cpptools/issues/1960)
* Fix main process IntelliSense-related crashes. [#2006](https://github.com/Microsoft/vscode-cpptools/issues/2006)
* Fix deadlock after formatting large files. [#2007](https://github.com/Microsoft/vscode-cpptools/issues/2007)
* Fix recursive includes failing to find some system includes. [#2019](https://github.com/Microsoft/vscode-cpptools/issues/2019)
## Version 0.17.1: May 17, 2018
* Fix IntelliSense update slowness when using recursive includes. [#1949](https://github.com/Microsoft/vscode-cpptools/issues/1949)
* Fix code navigation failure after switching between WSL and non-WSL configs. [#1958](https://github.com/Microsoft/vscode-cpptools/issues/1958)
* Fix extension crash when the `includePath` is a file or the root drive. [#1979](https://github.com/Microsoft/vscode-cpptools/issues/1979), [#1965](https://github.com/Microsoft/vscode-cpptools/issues/1965)
* Fix IntelliSense crash in `have_member_access_from_class_scope`. [#1763](https://github.com/Microsoft/vscode-cpptools/issues/1763)
* Fix `#include` completion bugs. [#1959](https://github.com/Microsoft/vscode-cpptools/issues/1959), [#1970](https://github.com/Microsoft/vscode-cpptools/issues/1970)
* Add `Debug` value for `loggingLevel` (previously the hidden value `"6"`).
* Fix C++17 features not being fully enabled with msvc-x64 mode. [#1990](https://github.com/Microsoft/vscode-cpptools/issues/1990)
* Fix IntelliSense interprocess deadlocks. [#1407](https://github.com/Microsoft/vscode-cpptools/issues/1407), [#1777](https://github.com/Microsoft/vscode-cpptools/issues/1777)
## Version 0.17.0: May 7, 2018
* Auto-complete for headers after typing `#include`. [#802](https://github.com/Microsoft/vscode-cpptools/issues/802)
* Add support for recursive `includePath`, e.g. `${workspaceFolder}/**`. [#897](https://github.com/Microsoft/vscode-cpptools/issues/897)
* Configuration improvements. [#1338](https://github.com/Microsoft/vscode-cpptools/issues/1338)
* Potentially addresses: [#368](https://github.com/Microsoft/vscode-cpptools/issues/368), [#410](https://github.com/Microsoft/vscode-cpptools/issues/410), [#1229](https://github.com/Microsoft/vscode-cpptools/issues/1229), [#1270](https://github.com/Microsoft/vscode-cpptools/issues/1270), [#1404](https://github.com/Microsoft/vscode-cpptools/issues/1404)
* Add support for querying system includes/defines from WSL and Cygwin compilers. [#1845](https://github.com/Microsoft/vscode-cpptools/issues/1845), [#1736](https://github.com/Microsoft/vscode-cpptools/issues/1736)
* Fix IntelliSense for WSL projects in Windows builds 17110 and greater. [#1694](https://github.com/Microsoft/vscode-cpptools/issues/1694)
* Add snippets. [PR #1823](https://github.com/Microsoft/vscode-cpptools/pull/1823)
* Add support for vcpkg. [PR #1886](https://github.com/Microsoft/vscode-cpptools/pull/1886)
* Add support for custom variables in `c_cpp_properties.json` via `env`. [#1857](https://github.com/Microsoft/vscode-cpptools/issues/1857), [#368](https://github.com/Microsoft/vscode-cpptools/issues/368)
* Stop automatically adding `/usr/include` to the `includePath`. [#1819](https://github.com/Microsoft/vscode-cpptools/issues/1819)
* Fix wrong configuration being used if there are four or more. [#1599](https://github.com/Microsoft/vscode-cpptools/issues/1599)
* Fix `c_cpp_properties.json` requiring write access. [#1790](https://github.com/Microsoft/vscode-cpptools/issues/1790)
* Change file not found in `compile_commands.json` message from an error to a warning. [#1783](https://github.com/Microsoft/vscode-cpptools/issues/1783)
* Fix an IntelliSense crash during completion requests. [#1782](https://github.com/Microsoft/vscode-cpptools/issues/1782)
* Update the installed clang-format to 6.0.
* Fix bug with `compile_commands.json` when "arguments" have both a switch and a value in the arg. [#1890](https://github.com/Microsoft/vscode-cpptools/issues/1890)
* Fix bug with garbage data appearing in tooltips on Linux/Mac. [#1577](https://github.com/Microsoft/vscode-cpptools/issues/1577)
## Version 0.16.1: March 30, 2018
* Fix random deadlock caused by logging code on Linux/Mac. [#1759](https://github.com/Microsoft/vscode-cpptools/issues/1759)
* Fix compiler from `compileCommands` not being queried for includes/defines if `compilerPath` isn't set on Windows. [#1754](https://github.com/Microsoft/vscode-cpptools/issues/1754)
* Fix OSX `UseShellExecute` I/O bug. [#1756](https://github.com/Microsoft/vscode-cpptools/issues/1756)
* Invalidate partially unzipped files from package manager. [#1757](https://github.com/Microsoft/vscode-cpptools/issues/1757)
## Version 0.16.0: March 28, 2018
* Enable autocomplete for local and global scopes. [#13](https://github.com/Microsoft/vscode-cpptools/issues/13)
* Add a setting to define multiline comment patterns: `C_Cpp.commentContinuationPatterns`. [#1100](https://github.com/Microsoft/vscode-cpptools/issues/1100), [#1539](https://github.com/Microsoft/vscode-cpptools/issues/1539)
* Add a setting to disable inactive region highlighting: `C_Cpp.dimInactiveRegions`. [#1592](https://github.com/Microsoft/vscode-cpptools/issues/1592)
* Add `forcedInclude` configuration setting. [#852](https://github.com/Microsoft/vscode-cpptools/issues/852)
* Add `compilerPath`, `cStandard`, and `cppStandard` configuration settings, and query gcc/clang-based compilers for default defines. [#1293](https://github.com/Microsoft/vscode-cpptools/issues/1293), [#1251](https://github.com/Microsoft/vscode-cpptools/issues/1251), [#1448](https://github.com/Microsoft/vscode-cpptools/issues/1448), [#1465](https://github.com/Microsoft/vscode-cpptools/issues/1465), [#1484](https://github.com/Microsoft/vscode-cpptools/issues/1484)
* Fix text being temporarily gray when an inactive region is deleted. [Microsoft/vscode#44872](https://github.com/Microsoft/vscode/issues/44872)
* Add support for `${workspaceFolder}` variable in **c_cpp_properties.json**. [#1392](https://github.com/Microsoft/vscode-cpptools/issues/1392)
* Fix IntelliSense not updating in source files after dependent header files are changed. [#1501](https://github.com/Microsoft/vscode-cpptools/issues/1501)
* Change database icon to use the `statusBar.foreground` color. [#1638](https://github.com/Microsoft/vscode-cpptools/issues/1638)
* Enable C++/CLI IntelliSense mode via adding the `/clr` arg to the `compilerPath`. [#1596](https://github.com/Microsoft/vscode-cpptools/issues/1596)
* Fix delay in language service activation caused by **cpptools.json** downloading. [#1640](https://github.com/Microsoft/vscode-cpptools/issues/1640)
* Fix debugger failure when a single quote is in the path. [#1554](https://github.com/Microsoft/vscode-cpptools/issues/1554)
* Fix terminal stdout and stderr redirection to not send to VS Code. [#1348](https://github.com/Microsoft/vscode-cpptools/issues/1348)
* Fix blank config and endless "Initializing..." if the file watcher limit is hit when using `compileCommands`. [PR #1709](https://github.com/Microsoft/vscode-cpptools/pull/1709)
* Fix error squiggles re-appearing after editing then closing a file. [#1712](https://github.com/Microsoft/vscode-cpptools/issues/1712)
* Show error output from clang-format. [#1259](https://github.com/Microsoft/vscode-cpptools/issues/1259)
* Fix `add_expression_to_index` crash (most frequent crash in 0.15.0). [#1396](https://github.com/Microsoft/vscode-cpptools/issues/1396)
* Fix incorrect error squiggle `explicitly instantiated more than once`. [#871](https://github.com/Microsoft/vscode-cpptools/issues/871)
## Version 0.15.0: February 15, 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), [#1497](https://github.com/Microsoft/vscode-cpptools/issues/1497)
* 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)
* Fix duplicate `cannot open source file` errors. [#1469](https://github.com/Microsoft/vscode-cpptools/issues/1469)
* Fix `Go to Symbol in File...` being slow for large workspaces. [#1472](https://github.com/Microsoft/vscode-cpptools/issues/1472)
* Fix stuck processes during shutdown. [#1474](https://github.com/Microsoft/vscode-cpptools/issues/1474)
* Fix error popup appearing with non-workspace files when using `compile_commands.json`. [#1475](https://github.com/Microsoft/vscode-cpptools/issues/1475)
* Fix snippet completions being blocked after `#`. [#1531](https://github.com/Microsoft/vscode-cpptools/issues/1531)
* Add more macros to `cpp.hint` (fixing missing symbols).
* Add `__CHAR_BIT__=8` to default defines on Mac. [#1510](https://github.com/Microsoft/vscode-cpptools/issues/1510)
* Added support for config variables to `c_cpp_properties.json`. [#314](https://github.com/Microsoft/vscode-cpptools/issues/314)
* Joshua Cannon (@thejcannon) [PR #1529](https://github.com/Microsoft/vscode-cpptools/pull/1529)
* Define `_UNICODE` by default on Windows platforms. [#1538](https://github.com/Microsoft/vscode-cpptools/issues/1538)
* Charles Milette (@sylveon) [PR #1540](https://github.com/Microsoft/vscode-cpptools/pull/1540)
## 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.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)
* 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
* 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)
## Version 0.14.4: December 11, 2017
* Enable the language service processes to run without glibc 2.18. [#19](https://github.com/Microsoft/vscode-cpptools/issues/19)
* Enable the language service processes to run on 32-bit Linux. [#424](https://github.com/Microsoft/vscode-cpptools/issues/424)
* Fix extension process not working on Windows with non-ASCII usernames. [#1319](https://github.com/Microsoft/vscode-cpptools/issues/1319)
* Fix IntelliSense on single processor VMs. [#1321](https://github.com/Microsoft/vscode-cpptools/issues/1321)
* Enable offline installation of the extension. [#298](https://github.com/Microsoft/vscode-cpptools/issues/298)
* Add support for `-isystem` in `compile_commands.json`. [#1156](https://github.com/Microsoft/vscode-cpptools/issues/1156)
* Remember the selected configuration across launches of VS Code. [#1273](https://github.com/Microsoft/vscode-cpptools/issues/1273)
* Fix 'Add Configuration...` entries not appearing if the extension wasn't previously activated. [#1287](https://github.com/Microsoft/vscode-cpptools/issues/1287)
* Add `(declaration)` to declarations in the navigation list. [#1311](https://github.com/Microsoft/vscode-cpptools/issues/1311)
* Fix function definition body not being visible after navigation. [#1311](https://github.com/Microsoft/vscode-cpptools/issues/1311)
* 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 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)
* Fix deadlock that can occur when switching configurations.
* Fix browse.databaseFilename changing not taking effect until a reload.
## Version 0.14.2: November 9, 2017
* Unsupported Linux clients sending excessive telemetry when the language server fails to start. [#1227](https://github.com/Microsoft/vscode-cpptools/issues/1227)
## Version 0.14.1: November 9, 2017
* Add support for multi-root workspaces. [#1070](https://github.com/Microsoft/vscode-cpptools/issues/1070)
* 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)
* Fix bug with `${workspaceRoot}` symbols not getting added if a parent folder is in the `browse.path`. [#1185](https://github.com/Microsoft/vscode-cpptools/issues/1185)
* Fix `Add configuration` C++ launch.json on Insiders. [#1191](https://github.com/Microsoft/vscode-cpptools/issues/1191)
* Fix extension restart logic so that the extension doesn't get stuck on "Initializing..." when it crashes. [#893](https://github.com/Microsoft/vscode-cpptools/issues/893)
* Remove the Reload window prompt after installation (it only appears if launch.json is active).
* Prevent browse database from being reset if shutdown takes > 1 second.
* Remove the `UnloadLanguageServer` command and the `clang_format_formatOnSave` setting.
* Fix bugs with include path suggestions.
* Fix max files to parse status number being too big, due to including non-`${workspaceRoot}` files.
* Update default `launch.json` configurations to use `${workspaceFolder}` instead of `${workspaceRoot}`.
* Update how default initial configurations for `launch.json` are being provided. [Microsoft/vscode#33794](https://github.com/Microsoft/vscode/issues/33794)
* Add support for normalizing source file locations. (Windows [#272](https://github.com/Microsoft/vscode-cpptools/issues/272)), (Mac OS X [#1095](https://github.com/Microsoft/vscode-cpptools/issues/1095))
## Version 0.14.0: October 19, 2017
* Add support for `compile_commands.json`. [#156](https://github.com/Microsoft/vscode-cpptools/issues/156)
* Fix crash with signature help. [#1076](https://github.com/Microsoft/vscode-cpptools/issues/1076)
* Skip parsing redundant browse.path directories. [#1106](https://github.com/Microsoft/vscode-cpptools/issues/1106)
* 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 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 "..".
* Fix a crash on shutdown.
## Version 0.13.1: October 5, 2017
* Delete unused symbol databases when `browse.databaseFilename` in `c_cpp_properties.json` changes. [#558](https://github.com/Microsoft/vscode-cpptools/issues/558)
* Fix infinite loop during IntelliSense parsing. [#981](https://github.com/Microsoft/vscode-cpptools/issues/981)
* Fix database resetting due to the extension process not shutting down fast enough. [#1060](https://github.com/Microsoft/vscode-cpptools/issues/1060)
* Fix crash with document highlighting [#1076](https://github.com/Microsoft/vscode-cpptools/issues/1076)
* Fix bug that could cause symbols to be missing when shutdown occurs during tag parsing.
* Fix bug that could cause included files to not be reparsed if they were modified after the initial parsing.
* Fix potential buffer overrun when logging is enabled.
* Add logging to help diagnose cause of document corruption after formatting.
## Version 0.13.0: September 25, 2017
* Reference highlighting is now provided by the extension for both IntelliSense engines.
* Parameter help is now provided by both IntelliSense engines.
* Light bulbs (code actions) for `#include` errors now suggest potential paths to add to the `includePath` based on a recursive search of the `browse.path`. [#846](https://github.com/Microsoft/vscode-cpptools/issues/846)
* Browse database now removes old symbols when `browse.path` changes. [#262](https://github.com/Microsoft/vscode-cpptools/issues/262)
* Add `*` on new lines after a multiline comment with `/**` is started. [#579](https://github.com/Microsoft/vscode-cpptools/issues/579)
* Fix `Go to Definition`, completion, and parameter hints for partially scoped members. [#635](https://github.com/Microsoft/vscode-cpptools/issues/635)
* Fix bug in `macFrameworkPath` not resolving variables.
## Version 0.12.4: September 12, 2017
* Fix a crash in IntelliSense for users with non-ASCII user names (Windows-only). [#910](https://github.com/Microsoft/vscode-cpptools/issues/910)
* Add `macFrameworkPath` to `c_cpp_properties.json`. [#970](https://github.com/Microsoft/vscode-cpptools/issues/970)
* Fix incorrect auto-complete suggestions when using template types with the scope operator `::`. [#988](https://github.com/Microsoft/vscode-cpptools/issues/988)
* Fix potential config file parsing failure. [#989](https://github.com/Microsoft/vscode-cpptools/issues/989)
* 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 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)
* Fix bug with the Tag Parser completion missing results. [#943](https://github.com/Microsoft/vscode-cpptools/issues/943)
* Add /usr/include/machine or i386 to the default Mac `includePath`. [#944](https://github.com/Microsoft/vscode-cpptools/issues/944)
* Add a command to reset the Tag Parser database. [#601](https://github.com/Microsoft/vscode-cpptools/issues/601), [#464](https://github.com/Microsoft/vscode-cpptools/issues/464)
* Fix bug with error-related code actions remaining after the errors are cleared.
* Fix bug with Tag Parser completion not working when :: preceded an identifier.
* Upgrade SQLite (for better reliability and performance).
## Version 0.12.2: August 2, 2017
* Fix bug in our build system causing Windows binaries to build against the wrong version of the Windows SDK. [#325](https://github.com/Microsoft/vscode-cpptools/issues/325)
* Added a gcc problemMatcher. [#854](https://github.com/Microsoft/vscode-cpptools/issues/854)
* Fix bug where .c/.cpp files could get added to `files.associations` as the opposite "cpp"/"c" language after `Go to Definition` on a symbol. [#884](https://github.com/Microsoft/vscode-cpptools/issues/884)
* Remove completion results after `#pragma`. [#886](https://github.com/Microsoft/vscode-cpptools/issues/886)
* Fix a possible infinite loop when viewing Boost sources. [#888](https://github.com/Microsoft/vscode-cpptools/issues/888)
* Fix `Go to Definition` not working for files in `#include_next`. [#906](https://github.com/Microsoft/vscode-cpptools/issues/906)
* Also fix incorrect preprocessor suggestions at the end of a `#include_next`.
* Skip automatically adding to `files.associations` if they already match global patterns. [Microsoft/vscode#27404](https://github.com/Microsoft/vscode/issues/27404)
* Fix a crash with the IntelliSense process (responsible for ~25% of all crashes).
## Version 0.12.1: July 18, 2017
* Fix Tag Parser features not working with some MinGW library code.
* Fix a symbol search crash.
* Fix an IntelliSense engine compiler crash.
* Fix `Go to Declaration` to return `Go to Definition` results if the declarations have no results.
* Fix formatting with non-ASCII characters in the path. [#870](https://github.com/Microsoft/vscode-cpptools/issues/870)
* Fix handling of symbolic links to files on Linux/Mac. [#872](https://github.com/Microsoft/vscode-cpptools/issues/872)
* Move red flame icon to its own section so the configuration text is always readable. [#875](https://github.com/Microsoft/vscode-cpptools/issues/875)
* Remove `addWorkspaceRootToIncludePath` setting and instead make `${workspaceRoot}` in `browse.path` explicit.
* Add `Show Release Notes` command.
* Add `Edit Configurations...` command to the `Select a Configuration...` dropdown.
* 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. [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)
* The default IntelliSense engine now reports the unresolved include files in referenced headers and falls back to the Tag Parser until headers are resolved.
* This behavior can be overridden by setting `"C_Cpp.intelliSenseEngineFallback": "Disabled"`
* Added `"intelliSenseMode"` property to `c_cpp_properties.json` to allow switching between MSVC and Clang modes. [#710](https://github.com/Microsoft/vscode-cpptools/issues/710), [#757](https://github.com/Microsoft/vscode-cpptools/issues/757)
* A crashed IntelliSense engine no longer gives the popup message, and it automatically restarts after an edit to the translation unit occurs.
* Fix the IntelliSense engine to use "c" mode if a C header is opened before the C file.
* Fix a bug which could cause the IntelliSense engine to not update results if changes are made to multiple files of a translation unit.
* Auto `files.association` registers "c" language headers when `Go to Definition` is used in a C file.
* Downloading extension dependencies will retry up to 5 times in the event of a failure. [#694](https://github.com/Microsoft/vscode-cpptools/issues/694)
* Changes to `c_cpp_properties.json` are detected even if file watchers fail.
* Update default IntelliSense options for MSVC mode to make Boost projects work better. [#775](https://github.com/Microsoft/vscode-cpptools/issues/775)
* 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 `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`.
## Version 0.11.2: May 24, 2017
* Revert the default `C_Cpp.intelliSenseEngine` setting back to "Tag Parser" for non-Insiders while we work on improving the migration experience.
## Version 0.11.1: May 19, 2017
* Add keywords to auto-complete (C, C++, or preprocessor). [#120](https://github.com/Microsoft/vscode-cpptools/issues/120)
* Fix non-recursive `browse.path` on Linux/Mac. [#546](https://github.com/Microsoft/vscode-cpptools/issues/546)
* Fix .clang-format file not being used on Linux/Mac. [#604](https://github.com/Microsoft/vscode-cpptools/issues/604)
* Stop setting the c/cpp `editor.quickSuggestions` to false. [#606](https://github.com/Microsoft/vscode-cpptools/issues/606)
* We also do a one-time clearing of that user setting, which will also copy any other c/cpp workspace settings to user settings. The workspace setting isn't cleared.
* Fix selection range off by one with `Peek Definition`. [#648](https://github.com/Microsoft/vscode-cpptools/issues/648)
* Upgrade the installed clang-format to 4.0 [#656](https://github.com/Microsoft/vscode-cpptools/issues/656)
* Make keyboard shortcuts only apply to c/cpp files. [#662](https://github.com/Microsoft/vscode-cpptools/issues/662)
* Fix autocomplete with qstring.h. [#666](https://github.com/Microsoft/vscode-cpptools/issues/666)
* Fix C files without a ".c" extension from being treated like C++ for `errorSquiggles`. [#673](https://github.com/Microsoft/vscode-cpptools/issues/673)
* Make the C IntelliSense engine use C11 instead of C89. [#685](https://github.com/Microsoft/vscode-cpptools/issues/685)
* Fix bug with clang-format not working with non-trimmed styles. [#691](https://github.com/Microsoft/vscode-cpptools/issues/691)
* Enable the C++ IntelliSense engine to use six C++17 features. [#699](https://github.com/Microsoft/vscode-cpptools/issues/699)
* Add reload prompt when a settings change requires it.
* Prevent non-existent files from being returned in `Go To Definition` results.
## Version 0.11.0: April 24, 2017
* Enabled first IntelliSense features based on the MSVC engine.
* Quick info tooltips and compiler errors are provided by the MSVC engine.
* `C_Cpp.intelliSenseEngine` property controls whether the new engine is used or not.
* `C_Cpp.errorSquiggles` property controls whether compiler errors are made visible in the editor.
* Add `Go to Declaration` and `Peek Declaration`. [#271](https://github.com/Microsoft/vscode-cpptools/issues/271)
* Fix language-specific workspace settings leaking into user settings. [Microsoft/vscode#23118](https://github.com/Microsoft/vscode/issues/23118)
* Fix `files.exclude` not being used in some cases. [#485](https://github.com/Microsoft/vscode-cpptools/issues/485)
* Fix a couple potential references to an undefined `textEditor`. [#584](https://github.com/Microsoft/vscode-cpptools/issues/584)
* Move changes from `README.md` to `CHANGELOG.md`. [#586](https://github.com/Microsoft/vscode-cpptools/issues/586)
* Fix crash on Mac/Linux when building the browse database and `nftw` fails. [#591](https://github.com/Microsoft/vscode-cpptools/issues/591)
* Add `Alt+N` keyboard shortcut for navigation. [#593](https://github.com/Microsoft/vscode-cpptools/issues/593)
* Fix autocomplete crash when the result has an invalid UTF-8 character. [#608](https://github.com/Microsoft/vscode-cpptools/issues/608)
* Fix symbol search crash with `_` symbol. [#611](https://github.com/Microsoft/vscode-cpptools/issues/611)
* Fix the `Edit Configurations` command when '#' is in the workspace root path. [#625](https://github.com/Microsoft/vscode-cpptools/issues/625)
* Fix clang-format `TabWidth` not being set when formatting with the `Visual Studio` style. [#630](https://github.com/Microsoft/vscode-cpptools/issues/630)
* Enable `clang_format_fallbackStyle` to be a custom style. [#641](https://github.com/Microsoft/vscode-cpptools/issues/641)
* Fix potential `undefined` references when attaching to a process. [#650](https://github.com/Microsoft/vscode-cpptools/issues/650)
* Fix `files.exclude` not working on Mac. [#653](https://github.com/Microsoft/vscode-cpptools/issues/653)
* Fix crashes during edit and hover with unexpected UTF-8 data. [#654](https://github.com/Microsoft/vscode-cpptools/issues/654)
## 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 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).
## Version 0.10.4: March 15, 2017
* Fix a crash in signature help. [#525](https://github.com/microsoft/vscode-cpptools/issues/525)
* Re-enable switch header/source when no workspace folder is open. [#541](https://github.com/microsoft/vscode-cpptools/issues/541)
* Fix inline `clang_format_style`. [#536](https://github.com/microsoft/vscode-cpptools/issues/536)
* Some other minor bug fixes.
## Version 0.10.3: March 7, 2017
* Database stability fixes.
* Added enums to the C_Cpp settings so the possible values are displayed in the dropdown.
* Change from `${command.*}` to `${command:*}`. [#521](https://github.com/Microsoft/vscode-cpptools/issues/521)
* Current execution row was not highlighting in debug mode when using gdb. [#526](https://github.com/microsoft/vscode-cpptools/issues/526)
## Version 0.10.2: March 1, 2017
* New `addWorkspaceRootToIncludePath` setting allows users to disable automatic parsing of all files under the workspace root. [#374](https://github.com/Microsoft/vscode-cpptools/issues/374)
* The cpp.hint file was missing from the vsix package. [#508](https://github.com/Microsoft/vscode-cpptools/issues/508)
* Switch header/source now respects `files.exclude`. [#485](https://github.com/Microsoft/vscode-cpptools/issues/485)
* Switch header/source performance improvements. [#231](https://github.com/Microsoft/vscode-cpptools/issues/231)
* Switch header/source now appears in the right-click menu.
* Improvements to signature help.
* Various other bug fixes.
## Version 0.10.1: February 9, 2017
* Bug fixes.
## Version 0.10.0: January 24, 2017
* Suppressed C++ language auto-completion inside a C++ comment or string literal. TextMate based completion is still available.
* Fixed bugs regarding the filtering of files and symbols, including:
* Find-symbol now excludes symbols found in `files.exclude` or `search.exclude` files
* Go-to-definition now excludes symbols found in `files.exclude` files (i.e. `search.exclude` paths are still included).
* Added option to disable `clang-format`-based formatting provided by this extension via `"C_Cpp.formatting" : "disabled"`
* Added new `pipeTransport` functionality within the `launch.json` to support pipe communications with `gdb/lldb` such as using `plink.exe` or `ssh`.
* Added support for `{command.pickRemoteProcess}` to allow picking of processes for remote pipe connections during `attach` scenarios. This is similar to how `{command.pickProcess}` works for local attach.
* Bug fixes.
## Version 0.9.3: December 8, 2016
* [December update](https://aka.ms/cppvscodedec) for C/C++ extension
* Ability to map source files during debugging using `sourceFileMap` property in `launch.json`.
* Enable pretty-printing by default for gdb users in `launch.json`.
* Bug fixes.
## Version 0.9.2: September 22, 2016
* Bug fixes.
## Version 0.9.1: September 7, 2016
* Bug fixes.
## Version 0.9.0: August 29, 2016
* [August update](https://blogs.msdn.microsoft.com/vcblog/2016/08/29/august-update-for-the-visual-studio-code-cc-extension/) for C/C++ extension.
* 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` 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.
## Version 0.8.1: July 27, 2016
* Bug fixes.
## Version 0.8.0: July 21, 2016
* [July update](https://blogs.msdn.microsoft.com/vcblog/2016/07/26/july-update-for-the-visual-studio-code-cc-extension/) for C/C++ extension.
* Support for debugging on OS X with LLDB 3.8.0. LLDB is now the default debugging option on OS X.
* Attach to process displays a list of available processes.
* Set variable values through Visual Studio Code's locals window.
* Bug fixes.
## Version 0.7.1: June 27, 2016
* Bug fixes.
## Version 0.7.0: June 20, 2016
* [June Update](https://blogs.msdn.microsoft.com/vcblog/2016/06/01/may-update-for-the-cc-extension-in-visual-studio-code/) for C/C++ extension.
* Bug fixes.
* Switch between header and source.
* Control which files are processed under include path.
## Version 0.6.1: June 3, 2016
* Bug fixes.
## Version 0.6.0: May 24, 2016
* [May update](https://blogs.msdn.microsoft.com/vcblog/2016/07/26/july-update-for-the-visual-studio-code-cc-extension/) for C/C++ extension.
* Support for debugging on OS X with GDB.
* Support for debugging with GDB on MinGW.
* Support for debugging with GDB on Cygwin.
* Debugging on 32-bit Linux now enabled.
* Format code using clang-format.
* Experimental fuzzy auto-completion.
* Bug fixes.
## Version 0.5.0: April 14, 2016
* Usability and correctness bug fixes.
* Simplify installation experience.
* Usability and correctness bug fixes.
+203
View File
@@ -0,0 +1,203 @@
MICROSOFT PRE-RELEASE SOFTWARE LICENSE TERMS
MICROSOFT C/C++ EXTENSION FOR VISUAL STUDIO CODE
These license terms are an agreement between Microsoft Corporation (or
based on where you live, one of its affiliates) and you. They apply to
the pre-release software named above. The terms also apply to any
Microsoft services or updates for the software, except to the extent
those have additional terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS. You may only use the C/C++ Extension
for Visual Studio Code with Visual Studio Code, Visual Studio or
Xamarin Studio software to help you develop and test your
applications.
2. TERMS FOR SPECIFIC COMPONENTS
a. Third Party Components. The software may include third party
components with separate legal notices or governed by other
agreements, as may be described in the ThirdPartyNotices file(s)
accompanying the software.
b. Package Managers. The software may include package managers, like
Nuget, that give you the option to download other Microsoft and third
party software packages to use with your application. Those packages
are under their own licenses, and not this agreement. Microsoft does
not distribute, license or provide any warranties for any of the third
party packages.
3. DATA.
a. Data Collection. The software may collect information about you and
your use of the software, and send that to Microsoft. Microsoft may
use this information to provide services and improve our products and
services. You may opt-out of many of these scenarios, but not all, as
described in the product documentation. There are also some features
in the software that may enable you and Microsoft to collect data from
users of your applications. If you use these features, you must comply
with applicable law, including providing appropriate notices to users
of your applications together with a copy of Microsofts privacy
statement. Our privacy statement is located at
https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more
about data collection and use in the help documentation and our
privacy statement. Your use of the software operates as your consent
to these practices.
b. Processing of Personal Data. To the extent Microsoft is a processor
or subprocessor of personal data in connection with the software,
Microsoft makes the commitments in the European Union General Data
Protection Regulation Terms of the Online Services Terms to all
customers effective May 25, 2018, at
http://go.microsoft.com/?linkid=9840733.
4. PRE-RELEASE SOFTWARE. This software is a pre-release version. It
may not work the way a final version of the software will. We may
change it for the final, commercial version. We also may not release a
commercial version.
5. FEEDBACK. If you give feedback about the software to Microsoft, you
give to Microsoft, without charge, the right to use, share and
commercialize your feedback in any way and for any purpose. You will
not give feedback that is subject to a license that requires Microsoft
to license its software or documentation to third parties because we
include your feedback in them. These rights survive this agreement.
6. SCOPE OF LICENSE. The software is licensed, not sold. This
agreement only gives you some rights to use the software. Microsoft
reserves all other rights. Unless applicable law gives you more rights
despite this limitation, you may use the software only as expressly
permitted in this agreement. In doing so, you must comply with any
technical limitations in the software that only allow you to use it in
certain ways. You may not
* work around any technical limitations in the software;
* reverse engineer, decompile or disassemble the software, or attempt
to derive the source code for the software, except and to the extent
required by third party licensing terms governing use of certain open
source components that may be included with the software;
* remove, minimize, block or modify any notices of Microsoft or its
suppliers in the software;
* use the software in any way that is against the law; or
* share, publish, rent, or lease the software, or provide the software
as a stand-alone hosted solution for others to use.
7. EXPORT RESTRICTIONS. You must comply with all domestic and
international export laws and regulations that apply to the software,
which include restrictions on destinations, end users and end use.
For further information on export restrictions, visit
(aka.ms/exporting).
8. SUPPORT SERVICES. Because this software is “as is,” we may not
provide support services for it.
9. ENTIRE AGREEMENT. This agreement, and the terms for supplements,
updates, Internet-based services and support services that you use,
are the entire agreement for the software and support services.
10. APPLICABLE LAW. If you acquired the software in the United
States, Washington law applies to interpretation of and claims for
breach of this agreement, and the laws of the state where you live
apply to all other claims. If you acquired the software in any other
country, its laws apply.
11. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes
certain legal rights. You may have other rights, including consumer
rights, under the laws of your state or country. Separate and apart
from your relationship with Microsoft, you may also have rights with
respect to the party from which you acquired the software. This
agreement does not change those other rights if the laws of your state
or country do not permit it to do so. For example, if you acquired the
software in one of the below regions, or mandatory country law
applies, then the following provisions apply to you:
a. Australia. You have statutory guarantees under the Australian
Consumer Law and nothing in this agreement is intended to affect those
rights.
b. Canada. If you acquired this software in Canada, you may stop
receiving updates by turning off the automatic update feature,
disconnecting your device from the Internet (if and when you re-
connect to the Internet, however, the software will resume checking
for and installing updates), or uninstalling the software. The product
documentation, if any, may also specify how to turn off updates for
your specific device or software.
c. Germany and Austria.
(i) Warranty. The properly licensed software will perform
substantially as described in any Microsoft materials that accompany
the software. However, Microsoft gives no contractual guarantee in
relation to the licensed software.
(ii) Limitation of Liability. In case of intentional conduct, gross
negligence, claims based on the Product Liability Act, as well as, in
case of death or personal or physical injury, Microsoft is liable
according to the statutory law.
Subject to the foregoing clause (ii), Microsoft will only be liable
for slight negligence if Microsoft is in breach of such material
contractual obligations, the fulfillment of which facilitate the due
performance of this agreement, the breach of which would endanger the
purpose of this agreement and the compliance with which a party may
constantly trust in (so-called "cardinal obligations"). In other cases
of slight negligence, Microsoft will not be liable for slight
negligence.
12. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU
BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES,
GUARANTEES OR CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL
LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
13. LIMITATION ON AND EXCLUSION OF DAMAGES. YOU CAN RECOVER FROM
MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST
PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to (a) anything related to the software,
services, content (including code) on third party Internet sites, or
third party applications; and (b) claims for breach of contract,
breach of warranty, guarantee or condition, strict liability,
negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the
possibility of the damages. The above limitation or exclusion may not
apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec, Canada, some
of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines
des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert
« tel quel ». Toute utilisation de ce logiciel est à votre seule
risque et péril. Microsoft naccorde aucune autre garantie
expresse. Vous pouvez bénéficier de droits additionnels en vertu du
droit local sur la protection des consommateurs, que ce contrat ne
peut modifier. La ou elles sont permises par le droit locale, les
garanties implicites de qualité marchande, dadéquation à un
usage particulier et dabsence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ
POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses
fournisseurs une indemnisation en cas de dommages directs uniquement
à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune
indemnisation pour les autres dommages, y compris les dommages
spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne:
* tout ce qui est relié au logiciel, aux services ou au contenu (y
compris le code) figurant sur des sites Internet tiers ou dans des
programmes tiers ; et
* les réclamations au titre de violation de contrat ou de garantie,
ou au titre de responsabilité stricte, de négligence ou dune
autre faute dans la limite autorisée par la loi en vigueur.
Elle sapplique également, même si Microsoft connaissait ou
devrait connaître l’éventualité dun tel dommage. Si votre pays
nautorise pas lexclusion ou la limitation de responsabilité
pour les dommages indirects, accessoires ou de quelque nature que ce
soit, il se peut que la limitation ou lexclusion ci-dessus ne
sappliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits
juridiques. Vous pourriez avoir dautres droits prévus par les lois
de votre pays. Le présent contrat ne modifie pas les droits que vous
confèrent les lois de votre pays si celles-ci ne le permettent pas.
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+39
View File
@@ -0,0 +1,39 @@
# C/C++ for Visual Studio Code
### [Repository](https://github.com/microsoft/vscode-cpptools)&nbsp;&nbsp;|&nbsp;&nbsp;[Issues](https://github.com/microsoft/vscode-cpptools/issues)&nbsp;&nbsp;|&nbsp;&nbsp;[Documentation](https://github.com/microsoft/vscode-cpptools/tree/master/Documentation)&nbsp;&nbsp;|&nbsp;&nbsp;[Code Samples](https://github.com/microsoft/vscode-cpptools/tree/master/Code%20Samples)&nbsp;&nbsp;|&nbsp;&nbsp;[Offline Installers](https://github.com/microsoft/vscode-cpptools/releases)
[![Badge](https://aka.ms/vsls-badge)](https://aka.ms/vsls)
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
* Symbol Searching
* Go to Definition/Declaration
* Peek Definition/Declaration
* Class/Method Navigation
* Signature Help
* Quick Info (Hover)
* Error Squiggles
* Debugging
* Support for debugging Windows (PDB, MinGW/Cygwin), Linux and macOS applications
* Line by line code stepping
* Breakpoints (including conditional and function breakpoints)
* Variable inspection
* Multi-threaded debugging support
* Core dump debugging support
* Executing GDB or MI commands directly when using 'C++ (GDB/LLDB)' debugging environment
* For help configuring the debugger see [Configuring launch.json for C/C++ debugging](https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md)
on our [GitHub page](https://github.com/Microsoft/vscode-cpptools).
You can find more detailed information about C/C++ support for Visual Studio Code at our [GitHub page](https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation) and our [VS Code documentation page](https://code.visualstudio.com/docs/languages/cpp).
## Installation
The extension has OS-specific binary dependencies, so installation via the Marketplace requires an Internet connection so that these additional dependencies can be downloaded. If you are working on a computer that does not have access to the Internet or is behind a strict firewall, you may need to use our OS-specific packages and install them by invoking VS Code's `"Install from VSIX..."` command. These "offline' packages are available at: https://github.com/Microsoft/vscode-cpptools/releases.
* `cpptools-linux.vsix` - for 64-bit Linux
* `cpptools-linux32.vsix` - for 32-bit Linux
* `cpptools-osx.vsix` - for macOS
* `cpptools-win32.vsix` - for 64-bit & 32-bit Windows
## Contact Us
If you run into any issues or have suggestions for us, please file [issues and suggestions on GitHub](https://github.com/Microsoft/vscode-cpptools/issues). If you havent already provided us feedback, please take this [quick survey](https://www.research.net/r/VBVV6C6) and let us know what you think!
+264
View File
@@ -0,0 +1,264 @@
<!DOCTYPE html>
<html>
<head>
<STYLE type="text/css">
body {
padding: 10px 20px;
line-height: 22px
}
img {
max-width: 100%;
max-height: 100%
}
a {
text-decoration: none
}
a:focus,
input:focus,
select:focus,
textarea:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px
}
hr {
border: 0;
height: 2px;
border-bottom: 2px solid
}
h1 {
padding-bottom: .3em;
line-height: 1.2;
border-bottom-width: 1px;
border-bottom-style: solid
}
h1,
h2,
h3 {
font-weight: 400
}
a:hover {
text-decoration: underline
}
table {
border-collapse: collapse
}
table > thead > tr > th {
text-align: left
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
padding: 5px 10px
}
blockquote {
margin: 0 7px 0 5px;
padding: 0 16px 0 10px;
border-left: 5px solid
}
code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 14px;
line-height: 19px
}
.mac code {
font-size: 12px;
line-height: 18px
}
code > div {
padding: 16px;
border-radius: 3px;
overflow: auto
}
.monaco-tokenized-source {
white-space: pre
}
/** Theming */
.vscode-light {
color: #1e1e1e
}
.vscode-dark {
color: #ddd
}
.vscode-high-contrast {
color: #fff
}
.vscode-light code {
color: #a31515
}
.vscode-dark code {
color: #d7ba7d
}
.vscode-light code > div {
background-color: rgba(220, 220, 220, .4)
}
.vscode-dark code > div {
background-color: rgba(10, 10, 10, .4)
}
.vscode-high-contrast code > div {
background-color: #000
}
.vscode-high-contrast h1 {
border-color: #000
}
.vscode-light table > thead > tr > th {
border-color: rgba(0, 0, 0, .69)
}
.vscode-dark table > thead > tr > th {
border-color: rgba(255, 255, 255, .69)
}
.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
border-color: rgba(0, 0, 0, .18)
}
.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
border-color: rgba(255, 255, 255, 0.18)
}
.vscode-light blockquote,
.vscode-dark blockquote {
background: rgba(127, 127, 127, .1);
border-color: rgba(0, 122, 204, .5)
}
.vscode-high-contrast blockquote {
background: transparent;
border-color: #fff
}
.main-content {
width: 65%;
vertical-align: top
}
.sidebar {
vertical-align: top
}
.footer {
padding: 25px;
text-align: center
}
.vscode-light table > tbody > tr > td.sidebar {
background-color: rgba(0, 0, 0, 0.1);
border-radius: 10px
}
.vscode-dark table > tbody > tr > td.sidebar {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 10px
}
.vscode-light a {
color: #4080D0
}
.vscode-dark a {
color: #a2c1e8
}
</STYLE>
</head>
<body>
<div>
<div>
<h1>Microsoft C/C++ Extension for VS Code</h1>
</div>
<table>
<tr>
<td class="main-content">
<table>
<tr>
<td>
<div>
<h2 class="caption">June 2019 Update</h2>
<div>Thank you for installing the C/C++ extension! We're excited to announce the following feature in the June update:<br/>
<h3 style="font-weight: 600">Enhanced Colorization</h3>
The extension now supports semantic colorization.
Enhanced colorization adds colors for tokens identified semantically by IntelliSense.
Colors can be configured by themes or customized in settings.
More information can be found <a href="https://github.com/microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/colorization.md">here</a>.
<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>
</td>
</tr>
</table>
</td>
<td class="sidebar">
<table>
<tr>
<td>
<div>
<h3 class="caption">Getting Started</h3>
<div><a href="https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Getting%20started%20with%20IntelliSense%20configuration.md">Configuring IntelliSense</a></div>
<div><a href="https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md">Configuring Debugging</a></div>
<div><a href="https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md">IntelliSense for MinGW projects</a></div>
<div><a href="https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Windows%20Subsystem%20for%20Linux.md">IntelliSense for Windows Subsystem for Linux projects</a></div>
</div>
</td>
</tr>
<tr>
<td>
<div>
<h3 class="caption">Blog Posts</h3>
<div><a href="https://devblogs.microsoft.com/cppblog/vscode-cpp-may-2019-update/">May 2019 Update</a></div>
<div><a href="https://devblogs.microsoft.com/cppblog/visual-studio-code-c-c-extension-march-2019-update/">March 2019 Update</a></div>
<div><a href="https://devblogs.microsoft.com/cppblog/vs-code-cpp-extension-january-2019-update/">January 2019 Update</a></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="footer">
<div>
Having trouble with the extension? -
<a href="https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation">Browse the documentation</a> -
<a href="https://www.github.com/Microsoft/vscode-cpptools/issues">Report an issue</a>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#F6F6F6"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#424242"/></svg>

After

Width:  |  Height:  |  Size: 986 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3-.795 0-1.545-.311-2.107-.868-.563-.567-.873-1.317-.873-2.111 0-1.431 1.007-2.632 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012l3.061-2.582-4.919-4.1h-1.137v2.404c-3.429.318-6.121 3.211-6.121 6.721 0 1.809.707 3.508 1.986 4.782 1.277 1.282 2.976 1.988 4.784 1.988 3.722 0 6.75-3.028 6.75-6.75 0-1.245-.349-2.468-1.007-3.536z" fill="#2D2D30"/><path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4-1.098 0-2.093-.445-2.817-1.164-.718-.724-1.163-1.718-1.163-2.815 0-2.206 1.794-4 4-4l.351.025v1.85s1.626-1.342 1.631-1.339l1.869-1.577-3.5-2.917v2.218l-.371-.03c-3.176 0-5.75 2.574-5.75 5.75 0 1.593.648 3.034 1.695 4.076 1.042 1.046 2.482 1.694 4.076 1.694 3.176 0 5.75-2.574 5.75-5.75-.001-1.106-.318-2.135-.859-3.012z" fill="#C5C5C5"/></svg>

After

Width:  |  Height:  |  Size: 986 B

+17
View File
@@ -0,0 +1,17 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1914",
"--pack_alignment",
"8",
"-D_MSC_VER=1914",
"-D_MSC_FULL_VER=191426428",
"-D_MSC_BUILD=0",
"-D_M_IX86=600",
"-D_M_IX86_FP=2"
],
"defaults_op" : "merge"
}
+7
View File
@@ -0,0 +1,7 @@
{
"defaults": [
"--pack_alignment",
"8"
],
"defaults_op" : "merge"
}
+18
View File
@@ -0,0 +1,18 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1914",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1914",
"-D_MSC_FULL_VER=191426428",
"-D_MSC_BUILD=0",
"-D_M_X64=100",
"-D_M_AMD64=100"
],
"defaults_op" : "merge"
}
+7
View File
@@ -0,0 +1,7 @@
{
"defaults": [
"--pack_alignment",
"8"
],
"defaults_op" : "merge"
}
+18
View File
@@ -0,0 +1,18 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1914",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1914",
"-D_MSC_FULL_VER=191426428",
"-D_MSC_BUILD=0",
"-D_M_X64=100",
"-D_M_AMD64=100"
],
"defaults_op" : "merge"
}
+7
View File
@@ -0,0 +1,7 @@
{
"defaults": [
"--pack_alignment",
"8"
],
"defaults_op" : "merge"
}
+18
View File
@@ -0,0 +1,18 @@
{
"defaults": [
"-D_MSC_EXTENSIONS",
"--microsoft",
"--microsoft_bugs",
"--microsoft_version",
"1914",
"--pack_alignment",
"8",
"-D_CPPUNWIND=1",
"-D_MSC_VER=1914",
"-D_MSC_FULL_VER=191426428",
"-D_MSC_BUILD=0",
"-D_M_X64=100",
"-D_M_AMD64=100"
],
"defaults_op" : "merge"
}
+33
View File
@@ -0,0 +1,33 @@
{
"defaults": [
"cpfe",
"--wchar_t_keyword",
"--no_warnings",
"--rtti",
"--edge",
"--exceptions",
"--error_limit",
"25000",
"-D_EDG_COMPILER",
"-D_USE_DECLSPECS_FOR_SAL=1"
],
"source_file_format": "-f %s",
"expressions": [
{
"match": "^/I(.*)",
"replace": "-I\n$1"
},
{
"match": "^/D(.*)",
"replace": "-D$1"
},
{
"match": "^/AI(.*)",
"replace": "--using_directory\n$1"
},
{
"match": "^/dE--header_only_fallback",
"replace": "--header_only_fallback"
}
]
}
+171
View File
@@ -0,0 +1,171 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
"configurations": {
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "Configuration identifier. Mac, Linux, and Win32 are special identifiers for configurations that will be auto-selected on those platforms, but the identifier can be anything.",
"type": "string"
},
"compilerPath": {
"description": "Full path of the compiler being used, e.g. /usr/bin/gcc, to enable more accurate IntelliSense. Args can be added to modify the includes/defines used, e.g. -nostdinc++, -m32, etc., but paths with spaces must be surrounded with \\\" if args are used.",
"type": "string"
},
"cStandard": {
"description": "Version of the C language standard to use for IntelliSense.",
"type": "string",
"enum": [
"c89",
"c99",
"c11",
"${default}"
]
},
"cppStandard": {
"description": "Version of the C++ language standard to use for IntelliSense.",
"type": "string",
"enum": [
"c++98",
"c++03",
"c++11",
"c++14",
"c++17",
"${default}"
]
},
"compileCommands": {
"description": "Full path to compile_commands.json file for the workspace.",
"type": "string"
},
"includePath": {
"description": "A list of paths for the IntelliSense engine to use while searching for included headers. Searching on these paths is not recursive.",
"type": "array",
"items": {
"type": "string"
}
},
"macFrameworkPath": {
"description": "A list of paths for the Intellisense engine to use while searching for included headers from Mac frameworks. Only supported on Mac configuration.",
"type": "array",
"items": {
"type": "string"
}
},
"windowsSdkVersion": {
"description": "Version of the Windows SDK include path to use on Windows, e.g. '10.0.17134.0'.",
"type": "string",
"pattern": "^\\d{2}\\.\\d{1}\\.\\d{5}\\.\\d{1}$|^8\\.1$"
},
"defines": {
"description": "A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, e.g. VERSION=1.",
"type": "array",
"items": {
"type": "string"
}
},
"intelliSenseMode": {
"description": "If set, it overrides the default mode used by the IntelliSense engine. Windows defaults to msvc-x64, Linux defaults to gcc-x64, and Mac defaults to clang-x64.",
"type": "string",
"enum": [
"msvc-x64",
"gcc-x64",
"clang-x64",
"${default}"
]
},
"forcedInclude": {
"description": "A list of files that should be included before any include file in a translation unit.",
"type": "array",
"items": {
"type": "string"
}
},
"configurationProvider": {
"description": "The id of a VS Code extension that can provide IntelliSense configuration information for source files.",
"type": "string"
},
"browse": {
"type": "object",
"properties": {
"limitSymbolsToIncludedHeaders": {
"description": "true to process only those files directly or indirectly included as headers, false to process all files under the specified include paths.",
"type": [
"boolean",
"string"
]
},
"databaseFilename": {
"description": "Path to the generated symbol database. If a relative path is specified, it will be made relative to the workspace's default storage location.",
"type": "string"
},
"path": {
"description": "A list of paths for the tag parser to use while searching for included headers. Searching on these paths is recursive by default. Specify '*' to indicate non-recursive search. For example: '/usr/include' will search through all subdirectories while '/usr/include/*' will not.",
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"env": {
"type": "object",
"description": "Custom variables that can be reused anywhere in this file using the ${variable} or ${env:variable} syntax.",
"patternProperties": {
"(?!^workspaceFolder$)(?!^workspaceRoot$)(?!^workspaceFolderBasename$)(?!^default$)(^.+$)": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
},
"version": {
"type": "integer",
"description": "Version of the configuration file. This property is managed by the extension. Please do not change it."
},
"enableConfigurationSquiggles": {
"type": "boolean",
"default": true,
"description": "Controls whether the extension will report errors detected in c_cpp_properties.json."
}
},
"properties": {
"configurations": {
"$ref": "#/definitions/configurations"
},
"env": {
"$ref": "#/definitions/env"
},
"version": {
"$ref": "#/definitions/version"
},
"enableConfigurationSquiggles": {
"$ref": "#/definitions/enableConfigurationSquiggles"
}
},
"required": [
"configurations",
"version"
],
"additionalProperties": false
}
+2
View File
@@ -0,0 +1,2 @@
// https://go.microsoft.com/fwlink/?linkid=865984
#pragma inject_default_hints
+6
View File
@@ -0,0 +1,6 @@
{
"engineAssemblyName": "Microsoft.MIDebugEngine",
"engineClassName": "Microsoft.MIDebugEngine.AD7Engine",
"conditionalBP": true,
"functionBP": true
}
+7
View File
@@ -0,0 +1,7 @@
{
"intelliSenseEngine_default_percentage": 100,
"defaultIntelliSenseEngine": 100,
"recursiveIncludes": 100,
"gotoDefIntelliSense": 100,
"enhancedColorization": 100
}
+75
View File
@@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const gulp = require('gulp');
const env = require('gulp-env')
const tslint = require('gulp-tslint');
const mocha = require('gulp-mocha');
const fs = require('fs');
const optionsSchemaGenerator = require('./out/tools/GenerateOptionsSchema');
gulp.task('unitTests', (done) => {
env.set({
CODE_TESTS_PATH: "./out/test/unitTests",
});
return gulp.src('./test/runVsCodeTestsWithAbsolutePaths.js', {read: false})
.pipe(mocha({ ui: "tdd" }))
.once('error', err => {
done();
process.exit(1);
})
.once('end', () => {
done();
process.exit();
});
});
/// Misc Tasks
const allTypeScript = [
'src/**/*.ts',
'!**/*.d.ts',
'!**/typings**'
];
const lintReporter = (output, file, options) => {
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function prinft
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
output.forEach(e => {
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
console.log('[tslint] ' + message);
});
};
gulp.task('tslint', () => {
return gulp.src(allTypeScript)
.pipe(tslint({
program: require('tslint').Linter.createProgram("./tsconfig.json"),
configuration: "./tslint.json"
}))
.pipe(tslint.report(lintReporter, {
summarizeFailureOutput: false,
emitError: false
}))
});
gulp.task('pr-check', (done) => {
const packageJson = JSON.parse(fs.readFileSync('./package.json').toString());
if (packageJson.activationEvents.length !== 1 && packageJson.activationEvents[0] !== '*') {
console.log('Please make sure to not check in package.json that has been rewritten by the extension activation. If you intended to have changes in package.json, please only check-in your changes. If you did not, please run `git checkout -- package.json`.');
done();
process.exit(1);
}
done();
});
gulp.task('generateOptionsSchema', (done) => {
optionsSchemaGenerator.generateOptionsSchema();
done();
});
+51
View File
@@ -0,0 +1,51 @@
parameters:
name: ''
pool: ''
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NodeTool@0
displayName: 'Use Node 8.x'
inputs:
versionSpec: 8.x
- script: npm install
displayName: "Install Dependencies"
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: npm run compile
displayName: "Compile Sources"
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: npm run pr-check
displayName: 'Validate Extension/package.json'
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: npm run tslint
displayName: 'Run Linter'
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: npm run pretest
displayName: "Compile Test Sources"
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: 'npm run unitTests'
displayName: 'Run unit tests'
workingDirectory: '$(Build.SourcesDirectory)\Extension'
- script: 'node node_modules/vscode/bin/test'
displayName: 'Run languageServer integration tests'
workingDirectory: '$(Build.SourcesDirectory)\Extension'
env:
CODE_TESTS_PATH: '$(Build.SourcesDirectory)\Extension\out\test\integrationTests\languageServer'
CODE_EXTENSIONS_PATH: '$(Build.SourcesDirectory)\Extension'
CODE_TESTS_WORKSPACE: '$(Build.SourcesDirectory)\Extension\test\integrationTests\testAssets\SimpleCppProject'
CODE_DISABLE_EXTENSIONS: 1
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
continueOnError: true
+57
View File
@@ -0,0 +1,57 @@
parameters:
name: ''
pool: ''
jobs:
- job: ${{ parameters.name }}
pool: ${{ parameters.pool }}
steps:
- task: NodeTool@0
displayName: 'Use Node 8.x'
inputs:
versionSpec: 8.x
- script: npm install
displayName: "Install Dependencies"
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: npm run compile
displayName: "Compile Sources"
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: npm run pr-check
displayName: 'Validate Extension/package.json'
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: npm run tslint
displayName: 'Run Linter'
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: |
set -e
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 &
disown -ar
displayName: 'Start xvfb'
- script: npm run pretest
displayName: "Compile Test Sources"
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: 'npm run unitTests'
displayName: 'Run unit tests'
workingDirectory: '$(Build.SourcesDirectory)/Extension'
- script: 'node node_modules/vscode/bin/test'
displayName: 'Run languageServer integration tests'
workingDirectory: '$(Build.SourcesDirectory)/Extension'
env:
DISPLAY: :10
CODE_TESTS_PATH: '$(Build.SourcesDirectory)/Extension/out/test/integrationTests/languageServer'
CODE_EXTENSIONS_PATH: '$(Build.SourcesDirectory)/Extension'
CODE_TESTS_WORKSPACE: '$(Build.SourcesDirectory)/Extension/test/integrationTests/testAssets/SimpleCppProject'
CODE_DISABLE_EXTENSIONS: 1
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
continueOnError: true
+11
View File
@@ -0,0 +1,11 @@
{
"name": "C",
"scopeName": "source.c",
"version": "0",
"information_for_contributors": [
],
"patterns": [
],
"repository": {
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"name": "C++",
"scopeName": "source.cpp",
"version": "0",
"information_for_contributors": [
],
"patterns": [
],
"repository": {
}
}
@@ -0,0 +1,216 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
This package is for the Microsoft C/C++ Extension for Visual Studio Code. This package includes components from the projects listed below. Microsoft licenses these components under the Microsoft C/C++ Extension for Visual Studio Code license terms. The original copyright notices and the licenses under which Microsoft received such components are set forth below for informational purposes. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
1. Clang (http://clang.llvm.org/)
2. LLDB (http://lldb.llvm.org/)
3. LLVM (http://llvm.org/)
%% Clang NOTICES AND INFORMATION BEGIN HERE
=========================================
LLVM Release License
University of Illinois/NCSA
Open Source License
Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.
The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.
This project may include:
/*
* Copyright 2001-2004 Unicode, Inc.
*
* Disclaimer
*
* This source code is provided as is by Unicode, Inc. No claims are
* made as to fitness for any particular purpose. No warranties of any
* kind are expressed or implied. The recipient agrees to determine
* applicability of information provided. If this file has been
* purchased on magnetic or optical media from Unicode, Inc., the
* sole remedy for any claim will be exchange of defective media
* within 90 days of receipt.
*
* Limitations on Rights to Redistribute This Code
*
* Unicode, Inc. hereby grants the right to freely use the information
* supplied in this file in the creation of products supporting the
* Unicode Standard, and to make copies of this file in any form
* for internal or external distribution as long as this notice
* remains attached.
=========================================
END OF Clang NOTICES AND INFORMATION
%% LLDB NOTICES AND INFORMATION BEGIN HERE
=========================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2010 Apple Inc.
All rights reserved.
Developed by:
LLDB Team
http://lldb.llvm.org/
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLDB Team, copyright holders, nor the names of
its contributors may be used to endorse or promote products derived from
this Software without specific prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
=========================================
END OF LLDB NOTICES AND INFORMATION
%% LLVM NOTICES AND INFORMATION BEGIN HERE
=========================================
LLVM Release License
University of Illinois/NCSA
Open Source License
Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
Copyrights and Licenses for Third Party Software Distributed with LLVM:
==============================================================================
The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.
The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.
The following pieces of software have additional or alternate copyrights,
licenses, and/or restrictions:
Program Directory
------- ---------
Autoconf llvm/autoconf
llvm/projects/ModuleMaker/autoconf
Google Test llvm/utils/unittest/googletest
OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
=========================================
END OF LLVM NOTICES AND INFORMATION
@@ -0,0 +1,170 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
This package is for the Microsoft C/C++ Extension for Visual Studio Code. This package includes components from the projects listed below. Microsoft licenses these components under the Microsoft C/C++ Extension for Visual Studio Code license terms. The original copyright notices and the licenses under which Microsoft received such components are set forth below for informational purposes. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
1. Mono (https://github.com/mono/mono)
%% Mono NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) .NET Foundation and its contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
The following code is linked with the final Mono runtime, the libmono
embeddable runtime:
* support/minizip: BSD license (modified).
* Copyright (C) 1998-2005 Gilles Vollant
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
* mono/utils/freebsd-dwarf.h.
* Copyright (c) 2007 John Birrell ([email protected])
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
*notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
*notice, this list of conditions and the following disclaimer in the
*documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* mono/utils/freebsd-elf_common.h, freebsd-elf64.h freebsd-elf32.h: BSD license.
* Copyright (c) 1998 John D. Polstra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* mono/utils/bsearch.c: BSD license.
* Taken from NetBSD with some minor modifications.
*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* mono/io-layer/wapi_glob.h, wapi_glob.c: BSD license
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Guido van Rossum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
=========================================
END OF Mono NOTICES AND INFORMATION
+6775
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"c_cpp.command.configurationSelect.title": "Scegli una configurazione...",
"c_cpp.command.configurationProviderSelect.title": "Cambia provider configurazioni...",
"c_cpp.command.configurationEditJSON.title": "Modifica configurazioni (JSON)",
"c_cpp.command.configurationEditUI.title": "Modifica configurazioni (UI)",
"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.enableErrorSquiggles.title": "Attiva sottolineamento errori",
"c_cpp.command.disableErrorSquiggles.title": "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",
"c_cpp.command.buildAndDebugActiveFile.title": "Compila ed esegui il debug del file attivo",
"c_cpp.command.logDiagnostics.title": "Registra diagnostica",
"c_cpp.command.rescanWorkspace.title": "Ripetere l'analisi dell'area di lavoro"
}
+23
View File
@@ -0,0 +1,23 @@
{
"c_cpp.command.configurationSelect.title": "Select a Configuration...",
"c_cpp.command.configurationProviderSelect.title": "Change Configuration Provider...",
"c_cpp.command.configurationEditJSON.title": "Edit Configurations (JSON)",
"c_cpp.command.configurationEditUI.title": "Edit Configurations (UI)",
"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.enableErrorSquiggles.title": "Enable Error Squiggles",
"c_cpp.command.disableErrorSquiggles.title": "Disable 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",
"c_cpp.command.buildAndDebugActiveFile.title": "Build and Debug Active File",
"c_cpp.command.logDiagnostics.title": "Log Diagnostics",
"c_cpp.command.rescanWorkspace.title": "Rescan Workspace"
}
+23
View File
@@ -0,0 +1,23 @@
{
"c_cpp.command.configurationSelect.title": "选择配置...",
"c_cpp.command.configurationProviderSelect.title": "更换配置提供程序...",
"c_cpp.command.configurationEditJSON.title": "编辑配置 (JSON)",
"c_cpp.command.configurationEditUI.title": "编辑配置 (UI)",
"c_cpp.command.goToDeclaration.title": "跳转到声明",
"c_cpp.command.peekDeclaration.title": "查看声明",
"c_cpp.command.switchHeaderSource.title": "切换头文件/源文件",
"c_cpp.command.navigate.title": "导航...",
"c_cpp.command.enableErrorSquiggles.title": "启用错误下划线",
"c_cpp.command.disableErrorSquiggles.title": "禁用错误下划线",
"c_cpp.command.toggleIncludeFallback.title": "切换IntelliSense引擎头文件包含错误回退",
"c_cpp.command.toggleDimInactiveRegions.title": "切换非活跃区域着色",
"c_cpp.command.showReleaseNotes.title": "查看版本说明",
"c_cpp.command.resetDatabase.title": "重置IntelliSense数据",
"c_cpp.command.pauseParsing.title": "暂停解析",
"c_cpp.command.resumeParsing.title": "继续解析",
"c_cpp.command.showParsingCommands.title": "查看解析命令",
"c_cpp.command.takeSurvey.title": "调查问卷",
"c_cpp.command.buildAndDebugActiveFile.title": "生成和调试当前文件",
"c_cpp.command.logDiagnostics.title": "记录诊断",
"c_cpp.command.rescanWorkspace.title": "重新扫描工作区"
}
@@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'fs';
export interface Environment {
name: string;
value: string;
}
export class ParsedEnvironmentFile {
public Env: Environment[];
public Warning: string | null;
private constructor(env: Environment[], warning: string | null) {
this.Env = env;
this.Warning = warning;
}
public static CreateFromFile(envFile: string, initialEnv: Environment[] | undefined): ParsedEnvironmentFile {
let content: string = fs.readFileSync(envFile, "utf8");
return this.CreateFromContent(content, envFile, initialEnv);
}
public static CreateFromContent(content: string, envFile: string, initialEnv: Environment[] | undefined): ParsedEnvironmentFile {
// Remove UTF-8 BOM if present
if (content.charAt(0) === '\uFEFF') {
content = content.substr(1);
}
let parseErrors: string[] = [];
let env: Map<string, any> = new Map();
if (initialEnv) {
// Convert array to map to prevent duplicate keys being created.
// If a duplicate key is found, replace it.
initialEnv.forEach((e) => {
env.set(e.name, e.value);
});
}
content.split("\n").forEach(line => {
// Split the line between key and value
const r: RegExpMatchArray = line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);
if (r !== null) {
const key: string = r[1];
let value: string = r[2] || "";
if ((value.length > 0) && (value.charAt(0) === '"') && (value.charAt(value.length - 1) === '"')) {
value = value.replace(/\\n/gm, "\n");
}
value = value.replace(/(^['"]|['"]$)/g, "");
env.set(key, value);
} else {
// Blank lines and lines starting with # are no parse errors
const comments: RegExp = new RegExp(/^\s*(#|$)/);
if (!comments.test(line)) {
parseErrors.push(line);
}
}
});
// show error message if single lines cannot get parsed
let warning: string = null;
if (parseErrors.length !== 0) {
warning = "Ignoring non-parseable lines in envFile " + envFile + ": ";
parseErrors.forEach(function (value, idx, array): void {
warning += "\"" + value + "\"" + ((idx !== array.length - 1) ? ", " : ".");
});
}
// Convert env map back to array.
const arrayEnv: Environment[] = [];
for (let key of env.keys()) {
arrayEnv.push({name: key, value: env.get(key)});
}
return new ParsedEnvironmentFile(arrayEnv, warning);
}
}
+70
View File
@@ -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<AttachItem[]>): Promise<string> {
return getAttachItems().then(processEntries => {
return new Promise<string>((resolve, reject) => {
let quickPick: vscode.QuickPick<AttachItem> = vscode.window.createQuickPick<AttachItem>();
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();
});
});
}
+181
View File
@@ -0,0 +1,181 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { execChildProcess } from '../common';
import { PsProcessParser } from './nativeAttach';
import { AttachItem, showQuickPick } from './attachQuickPick';
import * as debugUtils from './utils';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as util from '../common';
import * as vscode from 'vscode';
export interface AttachItemsProvider {
getAttachItems(): Promise<AttachItem[]>;
}
export class AttachPicker {
constructor(private attachItemsProvider: AttachItemsProvider) { }
public ShowAttachEntries(): Promise<string> {
return util.isExtensionReady().then(ready => {
if (!ready) {
util.displayExtensionNotReadyPrompt();
} else {
return showQuickPick(() => this.attachItemsProvider.getAttachItems());
}
});
}
}
export class RemoteAttachPicker {
constructor() {
this._channel = vscode.window.createOutputChannel('remote-attach');
}
private _channel: vscode.OutputChannel = null;
public ShowAttachEntries(config: any): Promise<string> {
return util.isExtensionReady().then(ready => {
if (!ready) {
util.displayExtensionNotReadyPrompt();
} else {
this._channel.clear();
let pipeTransport: any = config ? config.pipeTransport : null;
if (pipeTransport === null) {
return Promise.reject<string>(new Error("Chosen debug configuration does not contain pipeTransport"));
}
let pipeProgram: string = null;
if (os.platform() === 'win32' &&
pipeTransport.pipeProgram &&
!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);
}
// If pipeProgram does not get replaced and there is a pipeCwd, concatenate with pipeProgramStr and attempt to replace.
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);
}
}
}
if (!pipeProgram) {
pipeProgram = 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."));
});
});
}
});
}
// Creates a string to run on the host machine which will execute a shell script on the remote machine to retrieve OS and processes
private getRemoteProcessCommand(): string {
let innerQuote: string = `'`;
let outerQuote: string = `"`;
// Must use single quotes around the whole command and double quotes for the argument to `sh -c` because Linux evaluates $() inside of double quotes.
// Having double quotes for the outerQuote will have $(uname) replaced before it is sent to the remote machine.
if (os.platform() !== "win32") {
innerQuote = `"`;
outerQuote = `'`;
}
return `${outerQuote}sh -c ${innerQuote}uname && if [ $(uname) = \\\"Linux\\\" ] ; then ${PsProcessParser.psLinuxCommand} ; elif [ $(uname) = \\\"Darwin\\\" ] ; ` +
`then ${PsProcessParser.psDarwinCommand}; fi${innerQuote}${outerQuote}`;
}
private getRemoteOSAndProcesses(pipeCmd: string): Promise<AttachItem[]> {
// Do not add any quoting in execCommand.
const execCommand: string = `${pipeCmd} ${this.getRemoteProcessCommand()}`;
return execChildProcess(execCommand, null, this._channel).then(output => {
// OS will be on first line
// Processes will follow if listed
let lines: string[] = output.split(/\r?\n/);
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") {
return Promise.reject<AttachItem[]>(new Error(`Operating system "${remoteOS}" not supported.`));
}
// Only got OS from uname
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) {
return 0;
}
return 1;
}
if (b.name === undefined) {
return -1;
}
let aLower: string = a.name.toLowerCase();
let bLower: string = b.name.toLowerCase();
if (aLower === bLower) {
return 0;
}
return aLower < bLower ? -1 : 1;
})
.map(p => p.toAttachItem());
}
}
});
}
private static createArgumentList(args: string[]): string {
let argsString: string = "";
for (let arg of args) {
if (argsString) {
argsString += " ";
}
argsString += `"${arg}"`;
}
return argsString;
}
}
@@ -0,0 +1,478 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as debugUtils from './utils';
import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import { getBuildTasks, BuildTaskDefinition } from '../LanguageServer/extension';
import * as util from '../common';
import * as fs from 'fs';
import * as Telemetry from '../telemetry';
import { buildAndDebugActiveFileStr } from './extension';
import * as logger from '../logger';
import { IConfiguration, IConfigurationSnippet, DebuggerType, MIConfigurations, WindowsConfigurations, WSLConfigurations, PipeTransportConfigurations } from './configurations';
import { parse } from 'jsonc-parser';
import { PlatformInformation } from '../platform';
import { Environment, ParsedEnvironmentFile } from './ParsedEnvironmentFile';
function isDebugLaunchStr(str: string): boolean {
return str === "(gdb) Launch" || str === "(lldb) Launch" || str === "(Windows) Launch";
}
/*
* Retrieves configurations from a provider and displays them in a quickpick menu to be selected.
* Ensures that the selected configuration's preLaunchTask (if existent) is populated in the user's task.json.
* Automatically starts debugging for "Build and Debug" configurations.
*/
export class QuickPickConfigurationProvider implements vscode.DebugConfigurationProvider {
private underlyingProvider: vscode.DebugConfigurationProvider;
public constructor(provider: CppConfigurationProvider) {
this.underlyingProvider = provider;
}
async provideDebugConfigurations(folder: vscode.WorkspaceFolder | undefined, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration[]> {
const configs: vscode.DebugConfiguration[] = await this.underlyingProvider.provideDebugConfigurations(folder, token);
const defaultConfig: vscode.DebugConfiguration = configs.find(config => { return isDebugLaunchStr(config.name); });
console.assert(defaultConfig);
const editor: vscode.TextEditor = vscode.window.activeTextEditor;
if (!editor || !util.fileIsCOrCppSource(editor.document.fileName) || configs.length <= 1) {
return [defaultConfig];
}
interface MenuItem extends vscode.QuickPickItem {
configuration: vscode.DebugConfiguration;
}
const items: MenuItem[] = configs.map<MenuItem>(config => {
let menuItem: MenuItem = {label: config.name, configuration: config};
// Rename the menu item for the default configuration as its name is non-descriptive.
if (isDebugLaunchStr(menuItem.label)) {
menuItem.label = "Default Configuration";
}
return menuItem;
});
const selection: MenuItem = await vscode.window.showQuickPick(items, {placeHolder: "Select a configuration"});
if (!selection) {
throw new Error(); // User canceled it.
}
if (selection.label.startsWith("cl.exe")) {
if (!process.env.DevEnvDir || process.env.DevEnvDir.length === 0) {
vscode.window.showErrorMessage('cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.');
throw new Error();
}
}
if (selection.label.indexOf(buildAndDebugActiveFileStr()) !== -1 && selection.configuration.preLaunchTask) {
try {
await util.ensureBuildTaskExists(selection.configuration.preLaunchTask);
await vscode.debug.startDebugging(folder, selection.configuration);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "true" });
} catch (e) {
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "false" });
}
}
return [selection.configuration];
}
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
return this.underlyingProvider.resolveDebugConfiguration(folder, config, token);
}
}
class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
private type: DebuggerType;
private provider: IConfigurationAssetProvider;
public constructor(provider: IConfigurationAssetProvider, type: DebuggerType) {
this.provider = provider;
this.type = type;
}
/**
* Returns a list of initial debug configurations based on contextual information, e.g. package.json or folder.
*/
async provideDebugConfigurations(folder: vscode.WorkspaceFolder | undefined, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration[]> {
let buildTasks: vscode.Task[] = await getBuildTasks(true);
if (buildTasks.length === 0) {
return Promise.resolve(this.provider.getInitialConfigurations(this.type));
}
const defaultConfig: vscode.DebugConfiguration = this.provider.getInitialConfigurations(this.type).find(config => {
return isDebugLaunchStr(config.name);
});
console.assert(defaultConfig, "Could not find default debug configuration.");
const platformInfo: PlatformInformation = await PlatformInformation.GetPlatformInformation();
const platform: string = platformInfo.platform;
// Filter out build tasks that don't match the currently selectede debug configuration type.
buildTasks = buildTasks.filter((task: vscode.Task) => {
if (defaultConfig.name === "(Windows) Launch") {
if (task.name.startsWith("cl.exe")) {
return true;
}
} else {
if (!task.name.startsWith("cl.exe")) {
return true;
}
}
return false;
});
// Generate new configurations for each build task.
// Generating a task is async, therefore we must *await* *all* map(task => config) Promises to resolve.
let configs: vscode.DebugConfiguration[] = await Promise.all(buildTasks.map<Promise<vscode.DebugConfiguration>>(async task => {
const definition: BuildTaskDefinition = task.definition as BuildTaskDefinition;
const compilerName: string = path.basename(definition.compilerPath);
let newConfig: vscode.DebugConfiguration = Object.assign({}, defaultConfig); // Copy enumerables and properties
newConfig.name = compilerName + buildAndDebugActiveFileStr();
newConfig.preLaunchTask = task.name;
newConfig.externalConsole = false;
const exeName: string = path.join("${fileDirname}", "${fileBasenameNoExtension}");
newConfig.program = platform === "win32" ? exeName + ".exe" : exeName;
return new Promise<vscode.DebugConfiguration>(resolve => {
if (platform === "darwin") {
return resolve(newConfig);
} else {
let debuggerName: string;
if (compilerName.startsWith("clang")) {
newConfig.MIMode = "lldb";
const suffixIndex: number = compilerName.indexOf("-");
const suffix: string = suffixIndex === -1 ? "" : compilerName.substr(suffixIndex);
debuggerName = "lldb-mi" + suffix;
} else if (compilerName === "cl.exe") {
newConfig.miDebuggerPath = undefined;
newConfig.type = "cppvsdbg";
return resolve(newConfig);
} else {
debuggerName = "gdb";
}
if (platform === "win32") {
debuggerName += ".exe";
}
const compilerDirname: string = path.dirname(definition.compilerPath);
const debuggerPath: string = path.join(compilerDirname, debuggerName);
fs.stat(debuggerPath, (err, stats: fs.Stats) => {
if (!err && stats && stats.isFile) {
newConfig.miDebuggerPath = debuggerPath;
} else {
// TODO should probably resolve a missing debugger in a more graceful fashion for win32.
newConfig.miDebuggerPath = path.join("/usr", "bin", debuggerName);
}
return resolve(newConfig);
});
}
});
}));
configs.push(defaultConfig);
return configs;
}
/**
* Try to add all missing attributes to the debug configuration being launched.
*/
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
if (config) {
if (config.type === 'cppvsdbg') {
// Fail if cppvsdbg type is running on non-Windows
if (os.platform() !== 'win32') {
logger.getOutputChannelLogger().showWarningMessage("Debugger of type: 'cppvsdbg' is only available on Windows. Use type: 'cppdbg' on the current OS platform.");
return undefined;
}
// Disable debug heap by default, enable if 'enableDebugHeap' is set.
if (!config.enableDebugHeap) {
const disableDebugHeapEnvSetting : Environment = {"name" : "_NO_DEBUG_HEAP", "value" : "1"};
if (config.environment && util.isArray(config.environment)) {
config.environment.push(disableDebugHeapEnvSetting);
} else {
config.environment = [disableDebugHeapEnvSetting];
}
}
}
// Add environment variables from .env file
this.resolveEnvFile(config, folder);
this.resolveSourceFileMapVariables(config);
// Modify WSL config for OpenDebugAD7
if (os.platform() === 'win32' &&
config.pipeTransport &&
config.pipeTransport.pipeProgram) {
let replacedPipeProgram: string = null;
const pipeProgramStr: string = config.pipeTransport.pipeProgram.toLowerCase().trim();
// OpenDebugAD7 is a 32-bit process. Make sure the WSL pipe transport is using the correct program.
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(pipeProgramStr, debugUtils.ArchType.ia32);
// If pipeProgram does not get replaced and there is a pipeCwd, concatenate with pipeProgramStr and attempt to replace.
if (!replacedPipeProgram && !path.isAbsolute(pipeProgramStr) && config.pipeTransport.pipeCwd) {
const pipeCwdStr: string = config.pipeTransport.pipeCwd.toLowerCase().trim();
const newPipeProgramStr: string = path.join(pipeCwdStr, pipeProgramStr);
replacedPipeProgram = debugUtils.ArchitectureReplacer.checkAndReplaceWSLPipeProgram(newPipeProgramStr, debugUtils.ArchType.ia32);
}
if (replacedPipeProgram) {
config.pipeTransport.pipeProgram = replacedPipeProgram;
}
}
}
// if config or type is not specified, return null to trigger VS Code to open a configuration file https://github.com/Microsoft/vscode/issues/54213
return config && config.type ? config : null;
}
private resolveEnvFile(config: vscode.DebugConfiguration, folder: vscode.WorkspaceFolder): void {
if (config.envFile) {
// replace ${env:???} variables
let envFilePath: string = util.resolveVariables(config.envFile, null);
try {
if (folder && folder.uri && folder.uri.fsPath) {
// Try to replace ${workspaceFolder} or ${workspaceRoot}
envFilePath = envFilePath.replace(/(\${workspaceFolder}|\${workspaceRoot})/g, folder.uri.fsPath);
}
const parsedFile: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromFile(envFilePath, config["environment"]);
// show error message if single lines cannot get parsed
if (parsedFile.Warning) {
CppConfigurationProvider.showFileWarningAsync(parsedFile.Warning, config.envFile);
}
config.environment = parsedFile.Env;
delete config.envFile;
} catch (e) {
throw new Error(`Failed to use envFile. Reason: ${e.message}`);
}
}
}
private resolveSourceFileMapVariables(config: vscode.DebugConfiguration): void {
let messages: string[] = [];
if (config.sourceFileMap) {
for (const sourceFileMapSource of Object.keys(config.sourceFileMap)) {
let message: string = "";
const sourceFileMapTarget: string = config.sourceFileMap[sourceFileMapSource];
// TODO: pass config.environment as 'additionalEnvironment' to resolveVariables when it is { key: value } instead of { "key": key, "value": value }
const newSourceFileMapSource: string = util.resolveVariables(sourceFileMapSource, null);
const newSourceFileMapTarget: string = util.resolveVariables(sourceFileMapTarget, null);
let source: string = sourceFileMapSource;
let target: string = sourceFileMapTarget;
if (sourceFileMapSource !== newSourceFileMapSource) {
message = `\tReplacing sourcePath '${sourceFileMapSource}' with '${newSourceFileMapSource}'.`;
delete config.sourceFileMap[sourceFileMapSource];
source = newSourceFileMapSource;
}
if (sourceFileMapTarget !== newSourceFileMapTarget) {
// Add a space if source was changed, else just tab the target message.
message += (message ? ' ' : '\t');
message += `Replacing targetPath '${sourceFileMapTarget}' with '${newSourceFileMapTarget}'.`;
target = newSourceFileMapTarget;
}
if (message) {
config.sourceFileMap[source] = target;
messages.push(message);
}
}
if (messages.length > 0) {
logger.getOutputChannel().appendLine("Resolving variables in sourceFileMap...");
messages.forEach((message) => {
logger.getOutputChannel().appendLine(message);
});
logger.showOutputChannel();
}
}
}
private static async showFileWarningAsync(message: string, fileName: string) : Promise<void> {
const openItem: vscode.MessageItem = { title: 'Open envFile' };
let result: vscode.MessageItem = await vscode.window.showWarningMessage(message, openItem);
if (result && result.title === openItem.title) {
let doc: vscode.TextDocument = await vscode.workspace.openTextDocument(fileName);
if (doc) {
vscode.window.showTextDocument(doc);
}
}
}
}
export class CppVsDbgConfigurationProvider extends CppConfigurationProvider {
public constructor(provider: IConfigurationAssetProvider) {
super(provider, DebuggerType.cppvsdbg);
}
}
export class CppDbgConfigurationProvider extends CppConfigurationProvider {
public constructor(provider: IConfigurationAssetProvider) {
super(provider, DebuggerType.cppdbg);
}
}
export interface IConfigurationAssetProvider {
getInitialConfigurations(debuggerType: DebuggerType): any;
getConfigurationSnippets(): vscode.CompletionItem[];
}
export class ConfigurationAssetProviderFactory {
public static getConfigurationProvider(): IConfigurationAssetProvider {
switch (os.platform()) {
case 'win32':
return new WindowsConfigurationProvider();
case 'darwin':
return new OSXConfigurationProvider();
case 'linux':
return new LinuxConfigurationProvider();
default:
throw new Error("Unexpected OS type");
}
}
}
abstract class DefaultConfigurationProvider implements IConfigurationAssetProvider {
configurations: IConfiguration[];
public getInitialConfigurations(debuggerType: DebuggerType): any {
let configurationSnippet: IConfigurationSnippet[] = [];
// Only launch configurations are initial configurations
this.configurations.forEach(configuration => {
configurationSnippet.push(configuration.GetLaunchConfiguration());
});
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.
return initialConfigurations;
}
public getConfigurationSnippets(): vscode.CompletionItem[] {
let completionItems: vscode.CompletionItem[] = [];
this.configurations.forEach(configuration => {
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetLaunchConfiguration()));
completionItems.push(convertConfigurationSnippetToCompetionItem(configuration.GetAttachConfiguration()));
});
return completionItems;
}
}
class WindowsConfigurationProvider extends DefaultConfigurationProvider {
private executable: string = "a.exe";
private pipeProgram: string = "<full path to pipe program such as plink.exe>";
private MIMode: string = 'gdb';
private setupCommandsBlock: string = `"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]`;
constructor() {
super();
this.configurations = [
new MIConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock),
new PipeTransportConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock),
new WindowsConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock),
new WSLConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock),
];
}
}
class OSXConfigurationProvider extends DefaultConfigurationProvider {
private MIMode: string = 'lldb';
private executable: string = "a.out";
private pipeProgram: string = "/usr/bin/ssh";
constructor() {
super();
this.configurations = [
new MIConfigurations(this.MIMode, this.executable, this.pipeProgram),
];
}
}
class LinuxConfigurationProvider extends DefaultConfigurationProvider {
private MIMode: string = 'gdb';
private setupCommandsBlock: string = `"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]`;
private executable: string = "a.out";
private pipeProgram: string = "/usr/bin/ssh";
constructor() {
super();
this.configurations = [
new MIConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock),
new PipeTransportConfigurations(this.MIMode, this.executable, this.pipeProgram, this.setupCommandsBlock)
];
}
}
function convertConfigurationSnippetToCompetionItem(snippet: IConfigurationSnippet): vscode.CompletionItem {
let item: vscode.CompletionItem = new vscode.CompletionItem(snippet.label, vscode.CompletionItemKind.Snippet);
item.insertText = snippet.bodyText;
return item;
}
export class ConfigurationSnippetProvider implements vscode.CompletionItemProvider {
private provider: IConfigurationAssetProvider;
private snippets: vscode.CompletionItem[];
constructor(provider: IConfigurationAssetProvider) {
this.provider = provider;
this.snippets = this.provider.getConfigurationSnippets();
}
public resolveCompletionItem(item: vscode.CompletionItem, token: vscode.CancellationToken): Thenable<vscode.CompletionItem> {
return Promise.resolve(item);
}
// This function will only provide completion items via the Add Configuration Button
// There are two cases where the configuration array has nothing or has some items.
// 1. If it has nothing, insert a snippet the user selected.
// 2. If there are items, the Add Configuration button will append it to the start of the configuration array. This function inserts a comma at the end of the snippet.
public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext): Thenable<vscode.CompletionList> {
let items: vscode.CompletionItem[] = this.snippets;
const launch: any = parse(document.getText());
// Check to see if the array is empty, so any additional inserted snippets will need commas.
if (launch.configurations.length !== 0) {
items = [];
// Make a copy of each snippet since we are adding a comma to the end of the insertText.
this.snippets.forEach((item) => items.push(Object.assign({}, item)));
items.map((item) => {
item.insertText = item.insertText + ','; // Add comma
});
}
return Promise.resolve(new vscode.CompletionList(items, true));
}
}
+257
View File
@@ -0,0 +1,257 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as os from 'os';
export enum DebuggerType {
cppvsdbg,
cppdbg
}
export interface IConfigurationSnippet {
label: string;
description: string;
bodyText: string;
// Internal
isInitialConfiguration?: boolean;
debuggerType: DebuggerType;
}
export function indentJsonString(json: string, numTabs: number = 1): string {
return json.split('\n').map(line => '\t'.repeat(numTabs) + line).join('\n').trim();
}
function formatString(format: string, args: string[]): string {
for (let arg in args) {
format = format.replace("{" + arg + "}", args[arg]);
}
return format;
}
function createLaunchString(name: string, type: string, executable: string): string {
return `"name": "${name}",
"type": "${type}",
"request": "launch",
"program": "${"enter program name, for example " + "$\{workspaceFolder\}" + "/" + executable}",
"args": [],
"stopAtEntry": false,
"cwd": "$\{workspaceFolder\}",
"environment": [],
"externalConsole": false
`;
}
function createAttachString(name: string, type: string, executable: string): string {
return formatString(`
"name": "${name}",
"type": "${type}",
"request": "attach",{0}
"processId": "$\{command:pickProcess\}"
`, [type === "cppdbg" ? `${os.EOL}"program": "${"enter program name, for example $\{workspaceFolder\}/" + executable}",` : ""]);
}
function createRemoteAttachString(name: string, type: string, executable: string): string {
return `
"name": "${name}",
"type": "${type}",
"request": "attach",
"program": "${"enter program name, for example $\{workspaceFolder\}/" + executable}",
"processId": "$\{command:pickRemoteProcess\}"
`;
}
function createPipeTransportString(pipeProgram: string, debuggerProgram: string, pipeArgs: string[] = []): string {
return `
"pipeTransport": {
\t"debuggerPath": "/usr/bin/${debuggerProgram}",
\t"pipeProgram": "${pipeProgram}",
\t"pipeArgs": ${JSON.stringify(pipeArgs)},
\t"pipeCwd": ""
}`;
}
export interface IConfiguration {
GetLaunchConfiguration(): IConfigurationSnippet;
GetAttachConfiguration(): IConfigurationSnippet;
}
abstract class Configuration implements IConfiguration {
public snippetPrefix = "C/C++: ";
public executable: string;
public pipeProgram: string;
public MIMode: string;
public additionalProperties: string;
public miDebugger = "cppdbg";
public windowsDebugger = "cppvsdbg";
constructor(MIMode: string, executable: string, pipeProgram: string, additionalProperties: string = "") {
this.MIMode = MIMode;
this.executable = executable;
this.pipeProgram = pipeProgram;
this.additionalProperties = additionalProperties;
}
abstract GetLaunchConfiguration(): IConfigurationSnippet;
abstract GetAttachConfiguration(): IConfigurationSnippet;
}
export class MIConfigurations extends Configuration {
public GetLaunchConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Launch`;
let body: string = formatString(`{
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
\t"MIMode": "${this.MIMode}"{0}{1}
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Launch with ${this.MIMode}.`,
"bodyText": body.trim(),
"isInitialConfiguration": true,
"debuggerType": DebuggerType.cppdbg
};
}
public GetAttachConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Attach`;
let body: string = formatString(`{
\t${indentJsonString(createAttachString(name, this.miDebugger, this.executable))},
\t"MIMode": "${this.MIMode}"{0}{1}
}`, [this.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Attach with ${this.MIMode}.`,
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppdbg
};
}
}
export class PipeTransportConfigurations extends Configuration {
public GetLaunchConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Pipe Launch`;
let body: string = formatString(`
{
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
\t${indentJsonString(createPipeTransportString(this.pipeProgram, this.MIMode))},
\t"MIMode": "${this.MIMode}"{0}
}`, [this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Pipe Launch with ${this.MIMode}.`,
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppdbg
};
}
public GetAttachConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Pipe Attach`;
let body: string = formatString(`
{
\t${indentJsonString(createRemoteAttachString(name, this.miDebugger, this.executable))},
\t${indentJsonString(createPipeTransportString(this.pipeProgram, this.MIMode))},
\t"MIMode": "${this.MIMode}"{0}
}`, [this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Pipe Attach with ${this.MIMode}.`,
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppdbg
};
}
}
export class WindowsConfigurations extends Configuration {
public GetLaunchConfiguration(): IConfigurationSnippet {
let name: string = "(Windows) Launch";
let body: string = `
{
\t${indentJsonString(createLaunchString(name, this.windowsDebugger, this.executable))}
}`;
return {
"label": this.snippetPrefix + name,
"description": "Launch with the Visual Studio C/C++ debugger.",
"bodyText": body.trim(),
"isInitialConfiguration": true,
"debuggerType": DebuggerType.cppvsdbg
};
}
public GetAttachConfiguration(): IConfigurationSnippet {
let name: string = "(Windows) Attach";
let body: string = `
{
\t${indentJsonString(createAttachString(name, this.windowsDebugger, this.executable))}
}`;
return {
"label": this.snippetPrefix + name,
"description": "Attach to a process with the Visual Studio C/C++ debugger.",
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppvsdbg
};
}
}
export class WSLConfigurations extends Configuration {
// Detects if the current VSCode is 32-bit and uses the correct bash.exe
public bashPipeProgram = process.arch === 'ia32' ? "${env:windir}\\\\sysnative\\\\bash.exe" : "${env:windir}\\\\system32\\\\bash.exe";
public GetLaunchConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Bash on Windows Launch`;
let body: string = formatString(`
{
\t${indentJsonString(createLaunchString(name, this.miDebugger, this.executable))},
\t${indentJsonString(createPipeTransportString(this.bashPipeProgram, this.MIMode, ["-c"]))}{0}
}`, [this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Launch in Bash on Windows using ${this.MIMode}.`,
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppdbg
};
}
public GetAttachConfiguration(): IConfigurationSnippet {
let name: string = `(${this.MIMode}) Bash on Windows Attach`;
let body: string = formatString(`
{
\t${indentJsonString(createRemoteAttachString(name, this.miDebugger, this.executable))},
\t${indentJsonString(createPipeTransportString(this.bashPipeProgram, this.MIMode, ["-c"]))}{0}
}`, [this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
return {
"label": this.snippetPrefix + name,
"description": `Attach to a remote process running in Bash on Windows using ${this.MIMode}.`,
"bodyText": body.trim(),
"debuggerType": DebuggerType.cppdbg
};
}
}
@@ -0,0 +1,74 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from "vscode";
import * as util from '../common';
import * as path from 'path';
import * as os from 'os';
// Registers DebugAdapterDescriptorFactory for `cppdbg` and `cppvsdbg`. If it is not ready, it will prompt a wait for the download dialog.
// NOTE: This file is not automatically tested.
abstract class AbstractDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptorFactory {
protected readonly context: vscode.ExtensionContext;
// This is important for the Mock Debugger since it can not use src/common
constructor(context: vscode.ExtensionContext) {
this.context = context;
}
abstract createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): vscode.ProviderResult<vscode.DebugAdapterDescriptor>;
}
export class CppdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDescriptorFactory {
public static DEBUG_TYPE : string = "cppdbg";
constructor(context: vscode.ExtensionContext) {
super(context);
}
createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): vscode.ProviderResult<vscode.DebugAdapterDescriptor> {
return util.isExtensionReady().then(ready => {
if (ready) {
let command: string = path.join(this.context.extensionPath, './debugAdapters/OpenDebugAD7');
// Windows has the exe in debugAdapters/bin.
if (os.platform() === 'win32') {
command = path.join(this.context.extensionPath, "./debugAdapters/bin/OpenDebugAD7.exe");
}
return new vscode.DebugAdapterExecutable(command, []);
} else {
throw new Error(util.extensionNotReadyString);
}
});
}
}
export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterDescriptorFactory {
public static DEBUG_TYPE : string = "cppvsdbg";
constructor(context: vscode.ExtensionContext) {
super(context);
}
createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): vscode.ProviderResult<vscode.DebugAdapterDescriptor> {
if (os.platform() !== 'win32') {
vscode.window.showErrorMessage("Debugger type 'cppvsdbg' is not avaliable for non-Windows machines.");
return null;
} else {
return util.isExtensionReady().then(ready => {
if (ready) {
return new vscode.DebugAdapterExecutable(
path.join(this.context.extensionPath, './debugAdapters/vsdbg/bin/vsdbg.exe'),
['--interpreter=vscode']
);
} else {
throw new Error(util.extensionNotReadyString);
}
});
}
}
}
+143
View File
@@ -0,0 +1,143 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
import * as os from 'os';
import { AttachPicker, RemoteAttachPicker, AttachItemsProvider } from './attachToProcess';
import { NativeAttachItemsProviderFactory } from './nativeAttach';
import { QuickPickConfigurationProvider, ConfigurationAssetProviderFactory, CppVsDbgConfigurationProvider, CppDbgConfigurationProvider, ConfigurationSnippetProvider, IConfigurationAssetProvider } from './configurationProvider';
import { CppdbgDebugAdapterDescriptorFactory, CppvsdbgDebugAdapterDescriptorFactory } from './debugAdapterDescriptorFactory';
import * as util from '../common';
import * as Telemetry from '../telemetry';
// The extension deactivate method is asynchronous, so we handle the disposables ourselves instead of using extensonContext.subscriptions.
let disposables: vscode.Disposable[] = [];
export function buildAndDebugActiveFileStr(): string {
return " build and debug active file";
}
export function initialize(context: vscode.ExtensionContext): void {
// Activate Process Picker Commands
let attachItemsProvider: AttachItemsProvider = NativeAttachItemsProviderFactory.Get();
let attacher: AttachPicker = new AttachPicker(attachItemsProvider);
disposables.push(vscode.commands.registerCommand('extension.pickNativeProcess', () => attacher.ShowAttachEntries()));
let remoteAttacher: RemoteAttachPicker = new RemoteAttachPicker();
disposables.push(vscode.commands.registerCommand('extension.pickRemoteNativeProcess', (any) => remoteAttacher.ShowAttachEntries(any)));
// Activate ConfigurationProvider
let configurationProvider: IConfigurationAssetProvider = ConfigurationAssetProviderFactory.getConfigurationProvider();
// On non-windows platforms, the cppvsdbg debugger will not be registered for initial configurations.
// This will cause it to not show up on the dropdown list.
let vsdbgProvider: CppVsDbgConfigurationProvider = null;
if (os.platform() === 'win32') {
vsdbgProvider = new CppVsDbgConfigurationProvider(configurationProvider);
disposables.push(vscode.debug.registerDebugConfigurationProvider('cppvsdbg', new QuickPickConfigurationProvider(vsdbgProvider)));
}
const provider: CppDbgConfigurationProvider = new CppDbgConfigurationProvider(configurationProvider);
disposables.push(vscode.debug.registerDebugConfigurationProvider('cppdbg', new QuickPickConfigurationProvider(provider)));
disposables.push(vscode.commands.registerTextEditorCommand("C_Cpp.BuildAndDebugActiveFile", async (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => {
const folder: vscode.WorkspaceFolder = vscode.workspace.getWorkspaceFolder(textEditor.document.uri);
if (!folder) {
// Not enabled because we do not react to single-file mode correctly yet.
// We get an ENOENT when the user's c_cpp_properties.json is attempted to be parsed.
// The DefaultClient will also have its configuration accessed, but since it doesn't exist it errors out.
vscode.window.showErrorMessage('This command is not yet available for single-file mode.');
return Promise.resolve();
}
if (!util.fileIsCOrCppSource(textEditor.document.uri.fsPath)) {
vscode.window.showErrorMessage('Cannot build and debug because the active file is not a C or C++ source file.');
return Promise.resolve();
}
let configs: vscode.DebugConfiguration[] = (await provider.provideDebugConfigurations(folder)).filter(config => {
return config.name.indexOf(buildAndDebugActiveFileStr()) !== -1;
});
if (vsdbgProvider) {
let vsdbgConfigs: vscode.DebugConfiguration[] = (await vsdbgProvider.provideDebugConfigurations(folder)).filter(config => {
return config.name.indexOf(buildAndDebugActiveFileStr()) !== -1;
});
if (vsdbgConfigs) {
configs.push(...vsdbgConfigs);
}
}
interface MenuItem extends vscode.QuickPickItem {
configuration: vscode.DebugConfiguration;
}
const items: MenuItem[] = configs.map<MenuItem>(config => {
return {label: config.name, configuration: config};
});
vscode.window.showQuickPick(items, {placeHolder: (items.length === 0 ? "No compiler found" : "Select a compiler" )}).then(async selection => {
if (!selection) {
return; // User canceled it.
}
if (selection.label.startsWith("cl.exe")) {
if (!process.env.DevEnvDir || process.env.DevEnvDir.length === 0) {
vscode.window.showErrorMessage('cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.');
return;
}
}
if (selection.configuration.preLaunchTask) {
if (folder) {
try {
await util.ensureBuildTaskExists(selection.configuration.preLaunchTask);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "false" });
} catch (e) {
if (e && e.message === util.failedToParseTasksJson) {
vscode.window.showErrorMessage(util.failedToParseTasksJson);
}
return Promise.resolve();
}
} else {
return Promise.resolve();
// TODO uncomment this when single file mode works correctly.
// const buildTasks: vscode.Task[] = await getBuildTasks(true);
// const task: vscode.Task = buildTasks.find(task => task.name === selection.configuration.preLaunchTask);
// await vscode.tasks.executeTask(task);
// delete selection.configuration.preLaunchTask;
}
}
// Attempt to use the user's (possibly) modified configuration before using the generated one.
try {
await vscode.debug.startDebugging(folder, selection.configuration.name);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "true" });
} catch (e) {
try {
vscode.debug.startDebugging(folder, selection.configuration);
} catch (e) {
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "false" });
}
}
});
}));
configurationProvider.getConfigurationSnippets();
const launchJsonDocumentSelector: vscode.DocumentSelector = [{
scheme: 'file',
language: 'jsonc',
pattern: '**/launch.json'
}];
// ConfigurationSnippetProvider needs to be initiallized after configurationProvider calls getConfigurationSnippets.
disposables.push(vscode.languages.registerCompletionItemProvider(launchJsonDocumentSelector, new ConfigurationSnippetProvider(configurationProvider)));
// Register Debug Adapters
disposables.push(vscode.debug.registerDebugAdapterDescriptorFactory(CppvsdbgDebugAdapterDescriptorFactory.DEBUG_TYPE, new CppvsdbgDebugAdapterDescriptorFactory(context)));
disposables.push(vscode.debug.registerDebugAdapterDescriptorFactory(CppdbgDebugAdapterDescriptorFactory.DEBUG_TYPE, new CppdbgDebugAdapterDescriptorFactory(context)));
vscode.Disposable.from(...disposables);
}
export function dispose(): void {
disposables.forEach(d => d.dispose());
}
+248
View File
@@ -0,0 +1,248 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as child_process from 'child_process';
import * as os from 'os';
import { AttachItemsProvider } from './attachToProcess';
import { AttachItem } from './attachQuickPick';
class Process {
constructor(public name: string, public pid: string, public commandLine: string) { }
public toAttachItem(): AttachItem {
return {
label: this.name,
description: this.pid,
detail: this.commandLine,
id: this.pid
};
}
}
export class NativeAttachItemsProviderFactory {
static Get(): AttachItemsProvider {
if (os.platform() === 'win32') {
return new WmicAttachItemsProvider();
} else {
return new PsAttachItemsProvider();
}
}
}
abstract class NativeAttachItemsProvider implements AttachItemsProvider {
protected abstract getInternalProcessEntries(): Promise<Process[]>;
getAttachItems(): Promise<AttachItem[]> {
return this.getInternalProcessEntries().then(processEntries => {
// 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) {
return 0;
}
return 1;
}
if (b.name === undefined) {
return -1;
}
let aLower: string = a.name.toLowerCase();
let bLower: string = b.name.toLowerCase();
if (aLower === bLower) {
return 0;
}
return aLower < bLower ? -1 : 1;
});
let attachItems: AttachItem[] = processEntries.map(p => p.toAttachItem());
return attachItems;
});
}
}
export class PsAttachItemsProvider extends NativeAttachItemsProvider {
// Perf numbers:
// OS X 10.10
// | # of processes | Time (ms) |
// |----------------+-----------|
// | 272 | 52 |
// | 296 | 49 |
// | 384 | 53 |
// | 784 | 116 |
//
// Ubuntu 16.04
// | # of processes | Time (ms) |
// |----------------+-----------|
// | 232 | 26 |
// | 336 | 34 |
// | 736 | 62 |
// | 1039 | 115 |
// | 1239 | 182 |
// ps outputs as a table. With the option "ww", ps will use as much width as necessary.
// However, that only applies to the right-most column. Here we use a hack of setting
// the column header to 50 a's so that the second column will have at least that many
// characters. 50 was chosen because that's the maximum length of a "label" in the
// QuickPick UI in VSCode.
protected getInternalProcessEntries(): Promise<Process[]> {
let processCmd: string = '';
switch (os.platform()) {
case 'darwin':
processCmd = PsProcessParser.psDarwinCommand;
break;
case 'linux':
processCmd = PsProcessParser.psLinuxCommand;
break;
default:
return Promise.reject<Process[]>(new Error(`Operating system "${os.platform()}" not support.`));
}
return execChildProcess(processCmd, null).then(processes => {
return PsProcessParser.ParseProcessFromPs(processes);
});
}
}
export class PsProcessParser {
private static get secondColumnCharacters(): number { return 50; }
private static get commColumnTitle(): string { return Array(PsProcessParser.secondColumnCharacters).join("a"); }
// the BSD version of ps uses '-c' to have 'comm' only output the executable name and not
// the full path. The Linux version of ps has 'comm' to only display the name of the executable
// Note that comm on Linux systems is truncated to 16 characters:
// https://bugzilla.redhat.com/show_bug.cgi?id=429565
// Since 'args' contains the full path to the executable, even if truncated, searching will work as desired.
public static get psLinuxCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args=`; }
public static get psDarwinCommand(): string { return `ps axww -o pid=,comm=${PsProcessParser.commColumnTitle},args= -c`; }
// Only public for tests.
public static ParseProcessFromPs(processes: string): Process[] {
let lines: string[] = processes.split(os.EOL);
return PsProcessParser.ParseProcessFromPsArray(lines);
}
public static ParseProcessFromPsArray(processArray: string[]): Process[] {
let processEntries: Process[] = [];
// lines[0] is the header of the table
for (let i: number = 1; i < processArray.length; i++) {
let line: string = processArray[i];
if (!line) {
continue;
}
let processEntry: Process = PsProcessParser.parseLineFromPs(line);
processEntries.push(processEntry);
}
return processEntries;
}
private static parseLineFromPs(line: string): Process {
// Explanation of the regex:
// - any leading whitespace
// - PID
// - whitespace
// - executable name --> this is PsAttachItemsProvider.secondColumnCharacters - 1 because ps reserves one character
// for the whitespace separator
// - whitespace
// - args (might be empty)
const psEntry: RegExp = new RegExp(`^\\s*([0-9]+)\\s+(.{${PsProcessParser.secondColumnCharacters - 1}})\\s+(.*)$`);
const matches: RegExpExecArray = psEntry.exec(line);
if (matches && matches.length === 4) {
const pid: string = matches[1].trim();
const executable: string = matches[2].trim();
const cmdline: string = matches[3].trim();
return new Process(executable, pid, cmdline);
}
}
}
/**
* Originally from common.ts. Due to test code not having vscode, it was refactored to not have vscode.OutputChannel.
*/
function execChildProcess(process: string, workingDirectory: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
child_process.exec(process, { cwd: workingDirectory, maxBuffer: 500 * 1024 }, (error: Error, stdout: string, stderr: string) => {
if (error) {
reject(error);
return;
}
if (stderr && stderr.length > 0) {
reject(new Error(stderr));
return;
}
resolve(stdout);
});
});
}
export class WmicAttachItemsProvider extends NativeAttachItemsProvider {
// Perf numbers on Win10:
// | # of processes | Time (ms) |
// |----------------+-----------|
// | 309 | 413 |
// | 407 | 463 |
// | 887 | 746 |
// | 1308 | 1132 |
protected getInternalProcessEntries(): Promise<Process[]> {
const wmicCommand: string = 'wmic process get Name,ProcessId,CommandLine /FORMAT:list';
return execChildProcess(wmicCommand, null).then(processes => {
return WmicProcessParser.ParseProcessFromWmic(processes);
});
}
}
export class WmicProcessParser {
private static get wmicNameTitle(): string { return 'Name'; }
private static get wmicCommandLineTitle(): string { return 'CommandLine'; }
private static get wmicPidTitle(): string { return 'ProcessId'; }
// Only public for tests.
public static ParseProcessFromWmic(processes: string): Process[] {
let lines: string[] = processes.split(os.EOL);
let currentProcess: Process = new Process(null, null, null);
let processEntries: Process[] = [];
for (let i: number = 0; i < lines.length; i++) {
let line: string = lines[i];
if (!line) {
continue;
}
WmicProcessParser.parseLineFromWmic(line, currentProcess);
// Each entry of processes has ProcessId as the last line
if (line.lastIndexOf(WmicProcessParser.wmicPidTitle, 0) === 0) {
processEntries.push(currentProcess);
currentProcess = new Process(null, null, null);
}
}
return processEntries;
}
private static parseLineFromWmic(line: string, process: Process): void {
let splitter: number = line.indexOf('=');
if (splitter >= 0) {
let key: string = line.slice(0, line.indexOf('=')).trim();
let value: string = line.slice(line.indexOf('=') + 1).trim();
if (key === WmicProcessParser.wmicNameTitle) {
process.name = value;
} else if (key === WmicProcessParser.wmicPidTitle) {
process.pid = value;
} else if (key === WmicProcessParser.wmicCommandLineTitle) {
const extendedLengthPath: string = '\\??\\';
if (value.lastIndexOf(extendedLengthPath, 0) === 0) {
value = value.slice(extendedLengthPath.length);
}
process.commandLine = value;
}
}
}
}
+49
View File
@@ -0,0 +1,49 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
export enum ArchType {
ia32,
x64
}
export class ArchitectureReplacer {
public static checkAndReplaceWSLPipeProgram(pipeProgramStr: string, expectedArch: ArchType): string {
let replacedPipeProgram: string = null;
const winDir: string = process.env.WINDIR ? process.env.WINDIR.toLowerCase() : null;
const winDirAltDirSep: string = process.env.WINDIR ? process.env.WINDIR.replace('\\', '/').toLowerCase() : null;
const winDirEnv: string = "${env:windir}";
if (winDir && winDirAltDirSep && (pipeProgramStr.indexOf(winDir) === 0 || pipeProgramStr.indexOf(winDirAltDirSep) === 0 || pipeProgramStr.indexOf(winDirEnv) === 0)) {
if (expectedArch === ArchType.x64) {
const pathSep: string = ArchitectureReplacer.checkForFolderInPath(pipeProgramStr, "sysnative");
if (pathSep) {
// User has sysnative but we expect 64 bit. Should be using System32 since sysnative is a 32bit concept.
replacedPipeProgram = pipeProgramStr.replace(`${pathSep}sysnative${pathSep}`, `${pathSep}system32${pathSep}`);
}
} else if (expectedArch === ArchType.ia32) {
const pathSep: string = ArchitectureReplacer.checkForFolderInPath(pipeProgramStr, "system32");
if (pathSep) {
// User has System32 but we expect 32 bit. Should be using sysnative
replacedPipeProgram = pipeProgramStr.replace(`${pathSep}system32${pathSep}`, `${pathSep}sysnative${pathSep}`);
}
}
}
return replacedPipeProgram;
}
// Checks to see if the folder name is in the path using both win and unix style path seperators.
// Returns the path seperator it detected if the folder is in the path.
// Or else it returns empty string to indicate it did not find it in the path.
public static checkForFolderInPath(path: string, folder: string): string {
if (path.indexOf(`/${folder}/`) >= 0) {
return '/';
} else if (path.indexOf(`\\${folder}\\`) >= 0) {
return '\\';
}
return "";
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,214 @@
/* --------------------------------------------------------------------------------------------
* 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 util from '../common';
import * as telemetry from '../telemetry';
import * as cpptools from './client';
import * as path from 'path';
import { getCustomConfigProviders } from './customProviders';
const defaultClientKey: string = "@@default@@";
export interface ClientKey {
name: string;
key: string;
}
export class ClientCollection {
private disposables: vscode.Disposable[] = [];
private languageClients = new Map<string, cpptools.Client>();
private defaultClient: cpptools.Client;
private activeClient: cpptools.Client;
private activeDocument: vscode.TextDocument;
public get ActiveClient(): cpptools.Client { return this.activeClient; }
public get Names(): ClientKey[] {
let result: ClientKey[] = [];
this.languageClients.forEach((client, key) => {
result.push({ name: client.Name, key: key });
});
return result;
}
public get Count(): number { return this.languageClients.size; }
constructor() {
let key: string = defaultClientKey;
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
let folder: vscode.WorkspaceFolder = vscode.workspace.workspaceFolders[0];
key = util.asFolder(folder.uri);
this.activeClient = cpptools.createClient(this, folder);
} else {
this.activeClient = cpptools.createClient(this);
}
this.defaultClient = this.activeClient;
this.languageClients.set(key, this.activeClient);
this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e)));
this.disposables.push(vscode.workspace.onDidOpenTextDocument(d => this.onDidOpenTextDocument(d)));
this.disposables.push(vscode.workspace.onDidCloseTextDocument(d => this.onDidCloseTextDocument(d)));
}
public activeDocumentChanged(document: vscode.TextDocument): void {
this.activeDocument = document;
let activeClient: cpptools.Client = this.getClientFor(document.uri);
// Notify the active client that the document has changed.
activeClient.activeDocumentChanged(document);
// If the active client changed, resume the new client and tell the currently active client to deactivate.
if (activeClient !== this.activeClient) {
activeClient.activate();
this.activeClient.deactivate();
this.activeClient = activeClient;
}
}
/**
* get a handle to a language client. returns null if the client was not found.
*/
public get(key: string): cpptools.Client | null {
if (this.languageClients.has(key)) {
return this.languageClients.get(key);
}
console.assert("key not found");
return null;
}
public forEach(callback: (client: cpptools.Client) => void): void {
this.languageClients.forEach(callback);
}
public checkOwnership(client: cpptools.Client, document: vscode.TextDocument): boolean {
let owners: cpptools.Client[] = [];
this.languageClients.forEach(languageClient => {
if (document.uri.fsPath.startsWith(languageClient.RootPath + path.sep)) {
owners.push(languageClient);
}
});
if (owners.length === 0) {
owners.push(this.activeClient);
}
return (owners[0] === client); // TODO: we may want to pick the owner with the longest path?
}
/**
* creates a new client to replace one that crashed.
*/
public replace(client: cpptools.Client, transferFileOwnership: boolean): cpptools.Client {
let key: string = undefined;
for (let pair of this.languageClients) {
if (pair[1] === client) {
key = pair[0];
break;
}
}
if (key) {
this.languageClients.delete(key);
if (transferFileOwnership) {
// This will create a new Client for the workspace since we removed the old one from this.languageClients.
client.TrackedDocuments.forEach(document => this.transferOwnership(document, client));
client.TrackedDocuments.clear();
} else {
// Create an empty client that will continue to "own" files matching this workspace, but ignore all messages from VS Code.
this.languageClients.set(key, cpptools.createNullClient());
}
if (this.activeClient === client && this.activeDocument) {
this.activeClient = this.getClientFor(this.activeDocument.uri);
this.activeClient.activeDocumentChanged(this.activeDocument);
}
client.dispose();
return this.languageClients.get(key);
} else {
console.assert(key, "unable to locate language client");
return null;
}
}
/**
* Remove folders that were closed. We don't check the e.added property because we will
* add new clients on-demand as files are opened.
*/
private onDidChangeWorkspaceFolders(e?: vscode.WorkspaceFoldersChangeEvent): void {
let folderCount: number = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0;
if (folderCount > 1) {
telemetry.logLanguageServerEvent("workspaceFoldersChange", { "count": folderCount.toString() });
}
if (e !== undefined) {
e.removed.forEach(folder => {
let path: string = util.asFolder(folder.uri);
let client: cpptools.Client = this.languageClients.get(path);
if (client) {
this.languageClients.delete(path); // Do this first so that we don't iterate on it during the ownership transfer process.
// Transfer ownership of the client's documents to another client.
// (this includes calling textDocument/didOpen on the new client so that the server knows it's open too)
client.TrackedDocuments.forEach(document => this.transferOwnership(document, client));
client.TrackedDocuments.clear();
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);
// may not need this, the navigation UI should not have changed.
// this.activeClient.selectionChanged(Range.create(vscode.window.activeTextEditor.selection.start, vscode.window.activeTextEditor.selection.end);
}
client.dispose();
}
});
}
}
private transferOwnership(document: vscode.TextDocument, oldOwner: cpptools.Client): void {
let newOwner: cpptools.Client = this.getClientFor(document.uri);
console.assert(newOwner !== oldOwner, "'oldOwner' should not be in the list of clients to consider");
newOwner.takeOwnership(document);
}
private onDidOpenTextDocument(document: vscode.TextDocument): void {
if (document.languageId === "c" || document.languageId === "cpp"
|| document.languageId === "json" && document.uri.fsPath.endsWith("c_cpp_properties.json")) {
// Make sure a client exists for this document's workspace.
this.getClientFor(document.uri);
}
}
private getClientFor(uri: vscode.Uri): cpptools.Client {
let folder: vscode.WorkspaceFolder = vscode.workspace.getWorkspaceFolder(uri);
if (!folder) {
return this.defaultClient;
} else {
let key: string = util.asFolder(folder.uri);
if (!this.languageClients.has(key)) {
let newClient: cpptools.Client = cpptools.createClient(this, folder);
this.languageClients.set(key, newClient);
getCustomConfigProviders().forEach(provider => newClient.onRegisterCustomConfigurationProvider(provider));
}
return this.languageClients.get(key);
}
}
private onDidCloseTextDocument(document: vscode.TextDocument): void {
// Don't seem to need to do anything here since we clean up when the workspace is closed instead.
}
public dispose(): Thenable<void> {
let promises: Thenable<void>[] = [];
// this.defaultClient is already in this.languageClients, so do not call dispose() on it.
this.defaultClient = undefined;
this.languageClients.forEach(client => promises.push(client.dispose()));
this.languageClients.clear();
return Promise.all(promises).then(() => undefined);
}
}
@@ -0,0 +1,657 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as path from 'path';
import * as vscode from 'vscode';
import * as util from '../common';
import { CppSettings, OtherSettings, TextMateRule, TextMateRuleSettings } from './settings';
import * as jsonc from 'jsonc-parser';
import * as plist from 'plist';
export enum TokenKind {
// These need to match the token_kind enum in the server
// Semantic tokens
Macro,
Enumerator,
GlobalVariable,
LocalVariable,
Parameter,
Type,
RefType,
ValueType,
Function,
MemberFunction,
MemberField,
StaticMemberFunction,
StaticMemberField,
Property,
Event,
ClassTemplate,
GenericType,
FunctionTemplate,
Namespace,
Label,
UdlRaw,
UdlNumber,
UdlString,
OperatorFunction,
MemberOperator,
NewDelete,
Count
}
interface VersionedEdits {
editVersion: number;
changes: vscode.TextDocumentContentChangeEvent[];
}
class ThemeStyle {
foreground: string;
background: string;
fontStyle: string;
}
export class ColorizationSettings {
private uri: vscode.Uri;
private pendingTask: util.BlockingTask<any>;
private editorBackground: string;
public themeStyleCMap: ThemeStyle[] = [];
public themeStyleCppMap: ThemeStyle[] = [];
private static readonly scopeToTokenColorNameMap = new Map<string, string>([
["comment", "comments"],
["string", "strings"],
["keyword.operator", "keywords"],
["keyword.control", "keywords"],
["constant.numeric", "numbers"],
["entity.name.type", "types"],
["entity.name.class", "types"],
["entity.name.function", "functions"],
["variable", "variables"]
]);
constructor(uri: vscode.Uri) {
this.uri = uri;
this.reload();
}
// Given a TextMate rule 'settings' node, update a ThemeStyle to include any color or style information
private updateStyleFromTextMateRuleSettings(baseStyle: ThemeStyle, textMateRuleSettings: TextMateRuleSettings): void {
if (textMateRuleSettings.foreground) {
baseStyle.foreground = textMateRuleSettings.foreground;
}
if (textMateRuleSettings.background && textMateRuleSettings.background.toUpperCase() !== this.editorBackground.toUpperCase()) {
baseStyle.background = textMateRuleSettings.background;
}
// Any (even empty) string for fontStyle removes inherited value
if (textMateRuleSettings.fontStyle) {
baseStyle.fontStyle = textMateRuleSettings.fontStyle;
} else if (textMateRuleSettings.fontStyle === "") {
baseStyle.fontStyle = undefined;
}
}
// If the scope can be found in a set of TextMate rules, apply it to both C and Cpp ThemeStyle's
private findThemeStyleForScope(baseCStyle: ThemeStyle, baseCppStyle: ThemeStyle, scope: string, textMateRules: TextMateRule[]): void {
if (textMateRules) {
let match: TextMateRule = textMateRules.find(e => e.settings && (e.scope === scope || ((e.scope instanceof Array) && e.scope.indexOf(scope) > -1)));
if (match) {
if (baseCStyle) {
this.updateStyleFromTextMateRuleSettings(baseCStyle, match.settings);
}
if (baseCppStyle) {
this.updateStyleFromTextMateRuleSettings(baseCppStyle, match.settings);
}
}
match = textMateRules.find(e => e.settings && (e.scope === "source " + scope || ((e.scope instanceof Array) && e.scope.indexOf("source " + scope) > -1)));
if (match) {
if (baseCStyle) {
this.updateStyleFromTextMateRuleSettings(baseCStyle, match.settings);
}
if (baseCppStyle) {
this.updateStyleFromTextMateRuleSettings(baseCppStyle, match.settings);
}
}
if (baseCStyle) {
match = textMateRules.find(e => e.settings && (e.scope === "source.c " + scope || ((e.scope instanceof Array) && e.scope.indexOf("source.c " + scope) > -1)));
if (match) {
this.updateStyleFromTextMateRuleSettings(baseCStyle, match.settings);
}
}
if (baseCppStyle) {
match = textMateRules.find(e => e.settings && (e.scope === "source.cpp " + scope || ((e.scope instanceof Array) && e.scope.indexOf("source.cpp " + scope) > -1)));
if (match) {
this.updateStyleFromTextMateRuleSettings(baseCppStyle, match.settings);
}
}
}
}
// For a specific scope cascase all potential sources of style information to create a final ThemeStyle
private calculateThemeStyleForScope(baseCStyle: ThemeStyle, baseCppStyle: ThemeStyle, scope: string, themeName: string, themeTextMateRules: TextMateRule[][]): void {
// Search for settings with this scope in current theme
themeTextMateRules.forEach((rules) => {
this.findThemeStyleForScope(baseCStyle, baseCppStyle, scope, rules);
});
let otherSettings: OtherSettings = new OtherSettings(this.uri);
// Next in priority would be a global user override of token color of the equivilent scope
let colorTokenName: string | undefined = ColorizationSettings.scopeToTokenColorNameMap.get(scope);
if (colorTokenName) {
let settingValue: string = otherSettings.getCustomColorToken(colorTokenName);
if (settingValue) {
if (baseCStyle) {
baseCStyle.foreground = settingValue;
}
if (baseCppStyle) {
baseCppStyle.foreground = settingValue;
}
}
}
// Next in priority would be a global user override of this scope in textMateRules
this.findThemeStyleForScope(baseCStyle, baseCppStyle, scope, otherSettings.customTextMateRules);
// Next in priority would be a theme-specific user override of token color of the equivilent scope
if (colorTokenName) {
let settingValue: string = otherSettings.getCustomThemeSpecificColorToken(colorTokenName, themeName);
if (settingValue) {
if (baseCStyle) {
baseCStyle.foreground = settingValue;
}
if (baseCppStyle) {
baseCppStyle.foreground = settingValue;
}
}
}
// Next in priority would be a theme-specific user override of this scope in textMateRules
let textMateRules: TextMateRule[] = otherSettings.getCustomThemeSpecificTextMateRules(themeName);
this.findThemeStyleForScope(baseCStyle, baseCppStyle, scope, textMateRules);
}
// For each level of the scope, look of style information
private calculateStyleForToken(tokenKind: TokenKind, scope: string, themeName: string, themeTextMateRules: TextMateRule[][]): void {
// Try scopes, from most general to most specific, apply style in cascading manner
let parts: string[] = scope.split(".");
let accumulatedScope: string = "";
for (let i: number = 0; i < parts.length; i++) {
accumulatedScope += parts[i];
this.calculateThemeStyleForScope(this.themeStyleCMap[tokenKind], this.themeStyleCppMap[tokenKind], accumulatedScope, themeName, themeTextMateRules);
this.calculateThemeStyleForScope(this.themeStyleCMap[tokenKind], null, accumulatedScope + ".c", themeName, themeTextMateRules);
this.calculateThemeStyleForScope(null, this.themeStyleCppMap[tokenKind], accumulatedScope + ".cpp", themeName, themeTextMateRules);
accumulatedScope += ".";
}
}
public syncWithLoadingSettings(f: () => any): void {
this.pendingTask = new util.BlockingTask<void>(f, this.pendingTask);
}
public updateStyles(themeName: string, defaultStyle: ThemeStyle, textMateRules: TextMateRule[][]): void {
this.themeStyleCMap = new Array<ThemeStyle>(TokenKind.Count);
this.themeStyleCppMap = new Array<ThemeStyle>(TokenKind.Count);
// Populate with unique objects, as they will be individual modified in place
for (let i: number = 0; i < TokenKind.Count; i++) {
this.themeStyleCMap[i] = Object.assign({}, defaultStyle);
this.themeStyleCppMap[i] = Object.assign({}, defaultStyle);
}
this.calculateStyleForToken(TokenKind.Macro, "entity.name.function.preprocessor", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Enumerator, "variable.other.enummember", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.GlobalVariable, "variable.other.global", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.LocalVariable, "variable.other.local", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Parameter, "variable.parameter", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Type, "entity.name.type", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.RefType, "entity.name.class.reference", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.ValueType, "entity.name.class.value", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Function, "entity.name.function", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.MemberFunction, "entity.name.function.member", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.MemberField, "variable.other.member", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.StaticMemberFunction, "entity.name.function.member.static", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.StaticMemberField, "variable.other.member.static", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Property, "variable.other.property", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Event, "variable.other.event", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.ClassTemplate, "entity.name.class.template", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.GenericType, "entity.name.class.generic", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.FunctionTemplate, "entity.name.function.template", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Namespace, "entity.name.type.namespace", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.Label, "entity.name.label", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.UdlRaw, "entity.name.user-defined-literal", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.UdlNumber, "entity.name.user-defined-literal.number", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.UdlString, "entity.name.user-defined-literal.string", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.OperatorFunction, "entity.name.function.operator", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.MemberOperator, "keyword.operator.member", themeName, textMateRules);
this.calculateStyleForToken(TokenKind.NewDelete, "keyword.operator.new", themeName, textMateRules);
}
public async loadTheme(themePath: string, defaultStyle: ThemeStyle): Promise<TextMateRule[][]> {
let rules: TextMateRule[][] = [];
if (await util.checkFileExists(themePath)) {
let themeContentText: string = await util.readFileText(themePath);
let themeContent: any;
let textMateRules: TextMateRule[];
if (themePath.endsWith("tmTheme")) {
themeContent = plist.parse(themeContentText);
if (themeContent) {
textMateRules = themeContent.settings;
}
} else {
themeContent = jsonc.parse(themeContentText);
if (themeContent) {
textMateRules = themeContent.tokenColors;
if (themeContent.include) {
// parse included theme file
let includedThemePath: string = path.join(path.dirname(themePath), themeContent.include);
rules = await this.loadTheme(includedThemePath, defaultStyle);
}
if (themeContent.colors && themeContent.colors["editor.background"]) {
this.editorBackground = themeContent.colors["editor.background"];
}
}
}
if (textMateRules) {
// Convert comma delimited scopes into an array
textMateRules.forEach(e => {
if (e.scope && e.scope.includes(',')) {
e.scope = e.scope.split(',').map((s: string) => s.trim());
}
});
let scopelessSetting: any = textMateRules.find(e => e.settings && !e.scope);
if (scopelessSetting) {
if (scopelessSetting.settings.background) {
this.editorBackground = scopelessSetting.settings.background;
}
this.updateStyleFromTextMateRuleSettings(defaultStyle, scopelessSetting.settings);
}
rules.push(textMateRules);
}
}
return rules;
}
public reload(): void {
let f: () => void = async () => {
let otherSettings: OtherSettings = new OtherSettings(this.uri);
let themeName: string = otherSettings.colorTheme;
// Enumerate through all extensions, looking for this theme. (Themes are implemented as extensions - even the default ones)
// Open each package.json to check for a theme path
for (let i: number = 0; i < vscode.extensions.all.length; i++) {
let extensionPath: string = vscode.extensions.all[i].extensionPath;
let extensionPackageJsonPath: string = path.join(extensionPath, "package.json");
if (!await util.checkFileExists(extensionPackageJsonPath)) {
continue;
}
let packageJsonText: string = await util.readFileText(extensionPackageJsonPath);
let packageJson: any = jsonc.parse(packageJsonText);
if (packageJson.contributes && packageJson.contributes.themes) {
let foundTheme: any = packageJson.contributes.themes.find(e => e.id === themeName || e.label === themeName);
if (foundTheme) {
let themeRelativePath: string = foundTheme.path;
let themeFullPath: string = path.join(extensionPath, themeRelativePath);
let defaultStyle: ThemeStyle = new ThemeStyle();
let rulesSet: TextMateRule[][] = await this.loadTheme(themeFullPath, defaultStyle);
this.updateStyles(themeName, defaultStyle, rulesSet);
return;
}
}
}
};
this.syncWithLoadingSettings(f);
}
public static createDecorationFromThemeStyle(themeStyle: ThemeStyle): vscode.TextEditorDecorationType {
if (themeStyle && (themeStyle.foreground || themeStyle.background || themeStyle.fontStyle)) {
let options: vscode.DecorationRenderOptions = {};
options.rangeBehavior = vscode.DecorationRangeBehavior.OpenOpen;
if (themeStyle.foreground) {
options.color = themeStyle.foreground;
}
if (themeStyle.background) {
options.backgroundColor = themeStyle.background;
}
if (themeStyle.fontStyle) {
let parts: string[] = themeStyle.fontStyle.split(" ");
parts.forEach((part) => {
switch (part) {
case "italic":
options.fontStyle = "italic";
break;
case "bold":
options.fontWeight = "bold";
break;
case "underline":
options.textDecoration = "underline";
break;
default:
break;
}
});
}
return vscode.window.createTextEditorDecorationType(options);
}
return null;
}
}
export class ColorizationState {
private uri: vscode.Uri;
private colorizationSettings: ColorizationSettings;
private decorations: vscode.TextEditorDecorationType[] = new Array<vscode.TextEditorDecorationType>(TokenKind.Count);
private semanticRanges: vscode.Range[][] = new Array<vscode.Range[]>(TokenKind.Count);
private inactiveDecoration: vscode.TextEditorDecorationType = null;
private inactiveRanges: vscode.Range[] = [];
private versionedEdits: VersionedEdits[] = [];
private currentSemanticVersion: number = 0;
private lastReceivedSemanticVersion: number = 0;
public constructor(uri: vscode.Uri, colorizationSettings: ColorizationSettings) {
this.uri = uri;
this.colorizationSettings = colorizationSettings;
}
private createColorizationDecorations(isCpp: boolean): void {
let settings: CppSettings = new CppSettings(this.uri);
if (settings.enhancedColorization) {
// Create new decorators
// The first decorator created takes precedence, so these need to be created in reverse order
for (let i: number = TokenKind.Count; i > 0;) {
i--;
let themeStyleMap: any;
if (isCpp) {
themeStyleMap = this.colorizationSettings.themeStyleCppMap;
} else {
themeStyleMap = this.colorizationSettings.themeStyleCMap;
}
this.decorations[i] = ColorizationSettings.createDecorationFromThemeStyle(themeStyleMap[i]);
}
}
if (settings.dimInactiveRegions) {
this.inactiveDecoration = vscode.window.createTextEditorDecorationType({
opacity: settings.inactiveRegionOpacity.toString(),
backgroundColor: settings.inactiveRegionBackgroundColor,
color: settings.inactiveRegionForegroundColor,
rangeBehavior: vscode.DecorationRangeBehavior.OpenOpen
});
}
}
private disposeColorizationDecorations(): void {
// Dispose of all old decorations
if (this.inactiveDecoration) {
this.inactiveDecoration.dispose();
this.inactiveDecoration = null;
}
for (let i: number = 0; i < TokenKind.Count; i++) {
if (this.decorations[i]) {
this.decorations[i].dispose();
this.decorations[i] = null;
}
}
}
public dispose(): void {
this.disposeColorizationDecorations();
}
private refreshInner(e: vscode.TextEditor): void {
let settings: CppSettings = new CppSettings(this.uri);
if (settings.enhancedColorization) {
for (let i: number = 0; i < TokenKind.Count; i++) {
if (this.decorations[i]) {
let ranges: vscode.Range[] = this.semanticRanges[i];
if (ranges && ranges.length > 0) {
e.setDecorations(this.decorations[i], ranges);
}
}
}
}
// Normally, decorators are honored in the order in which they were created, not the
// order in which they were applied. Decorators with opacity appear to be handled
// differently, in that the opacity is applied to overlapping decorators even if
// created afterwards.
if (settings.dimInactiveRegions && this.inactiveDecoration && this.inactiveRanges) {
e.setDecorations(this.inactiveDecoration, this.inactiveRanges);
}
}
public refresh(e: vscode.TextEditor): void {
this.applyEdits();
let f: () => void = async () => {
this.refreshInner(e);
};
this.colorizationSettings.syncWithLoadingSettings(f);
}
public onSettingsChanged(uri: vscode.Uri): void {
let f: () => void = async () => {
this.applyEdits();
this.disposeColorizationDecorations();
let isCpp: boolean = util.isEditorFileCpp(uri.toString());
this.createColorizationDecorations(isCpp);
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri === uri);
for (let e of editors) {
this.refreshInner(e);
}
};
this.colorizationSettings.syncWithLoadingSettings(f);
}
// Utility function to convert a string and a start Position into a Range
private textToRange(text: string, startPosition: vscode.Position): vscode.Range {
let parts: string[] = text.split("\n");
let addedLines: number = parts.length - 1;
let newStartLine: number = startPosition.line;
let newStartCharacter: number = startPosition.character;
let newEndLine: number = newStartLine + addedLines;
let newEndCharacter: number = parts[parts.length - 1].length;
if (newStartLine === newEndLine) {
newEndCharacter += newStartCharacter;
}
return new vscode.Range(newStartLine, newStartCharacter, newEndLine, newEndCharacter);
}
// Utility function to shift a range back after removing content before it
private shiftRangeAfterRemove(range: vscode.Range, removeStartPosition: vscode.Position, removeEndPosition: vscode.Position): vscode.Range {
let lineDelta: number = removeStartPosition.line - removeEndPosition.line;
let startCharacterDelta: number = 0;
let endCharacterDelta: number = 0;
if (range.start.line === removeEndPosition.line) {
startCharacterDelta = removeStartPosition.character - removeEndPosition.character;
if (range.end.line === removeEndPosition.line) {
endCharacterDelta = startCharacterDelta;
}
}
let newStart: vscode.Position = range.start.translate(lineDelta, startCharacterDelta);
let newEnd: vscode.Position = range.end.translate(lineDelta, endCharacterDelta);
return new vscode.Range(newStart, newEnd);
}
// Utility function to shift a range forward after inserting content before it
private shiftRangeAfterInsert(range: vscode.Range, insertStartPosition: vscode.Position, insertEndPosition: vscode.Position): vscode.Range {
let addedLines: number = insertEndPosition.line - insertStartPosition.line;
let newStartLine: number = range.start.line + addedLines;
let newEndLine: number = range.end.line + addedLines;
let newStartCharacter: number = range.start.character;
let newEndCharacter: number = range.end.character;
// If starts on the same line as replacement ended
if (insertEndPosition.line === newStartLine) {
let endOffsetLength: number = insertEndPosition.character;
// If insertRange starts and ends on the same line, only offset by it's length
if (insertEndPosition.line === insertStartPosition.line) {
endOffsetLength -= insertStartPosition.character;
}
newStartCharacter += endOffsetLength;
if (insertEndPosition.line === newEndLine) {
newEndCharacter += endOffsetLength;
}
}
return new vscode.Range(newStartLine, newStartCharacter, newEndLine, newEndCharacter);
}
// Utility function to adjust a range to account for an insert and/or replace
private fixRange(range: vscode.Range, removeInsertStartPosition: vscode.Position, removeEndPosition: vscode.Position, insertEndPosition: vscode.Position): vscode.Range {
// If the replace/insert starts after this range ends, no adjustment is needed.
if (removeInsertStartPosition.isAfterOrEqual(range.end)) {
return range;
}
// Else, replace/insert range starts before this range ends.
// If replace/insert starts before/where this range starts, we don't need to extend the existing range, but need to shift it
if (removeInsertStartPosition.isBeforeOrEqual(range.start)) {
// If replace consumes the entire range, remove it
if (removeEndPosition.isAfterOrEqual(range.end)) {
return null;
}
// If replace ends within this range, we need to trim it before we shift it
let newRange: vscode.Range;
if (removeEndPosition.isAfterOrEqual(range.start)) {
newRange = new vscode.Range(removeEndPosition, range.end);
} else {
newRange = range;
}
// Else, if replace ends before this range starts, we just need to shift it.
newRange = this.shiftRangeAfterRemove(newRange, removeInsertStartPosition, removeEndPosition);
return this.shiftRangeAfterInsert(newRange, removeInsertStartPosition, insertEndPosition);
}
// Else, if replace/insert starts within (not before or after) range, extend it.
// If there replace/insert overlaps past the end of the original range, just extend existing range to the insert end position
if (removeEndPosition.isAfterOrEqual(range.end)) {
return new vscode.Range(range.start.line, range.start.character, insertEndPosition.line, insertEndPosition.character);
}
// Else, range has some left over at the end, which needs to be shifted after insertEndPosition.
// If the trailing segment is on the last line replace, we just need to extend by the remaining number of characters
if (removeEndPosition.line === range.end.line) {
return new vscode.Range(range.start.line, range.start.character, insertEndPosition.line, insertEndPosition.character + (range.end.character - removeEndPosition.character));
}
// Else, the trailing segment ends on another line, so the character position should remain the same. Just adjust based on added/removed lined.
let removedLines: number = removeEndPosition.line - removeInsertStartPosition.line;
let addedLines: number = insertEndPosition.line - removeInsertStartPosition.line;
let deltaLines: number = addedLines - removedLines;
return new vscode.Range(range.start.line, range.start.character, range.end.line + deltaLines, range.end.character);
}
private fixRanges(originalRanges: vscode.Range[], changes: vscode.TextDocumentContentChangeEvent[]): vscode.Range[] {
// outer loop needs to be the versioned edits, then changes within that edit, then ranges
let ranges: vscode.Range[] = originalRanges;
if (ranges && ranges.length > 0) {
changes.forEach((change) => {
let newRanges: vscode.Range[] = [];
let insertRange: vscode.Range = this.textToRange(change.text, change.range.start);
for (let i: number = 0; i < ranges.length; i++) {
let newRange: vscode.Range = this.fixRange(ranges[i], change.range.start, change.range.end, insertRange.end);
if (newRange !== null) {
newRanges.push(newRange);
}
}
ranges = newRanges;
});
}
return ranges;
}
// Add edits to be applied when/if cached tokens need to be reapplied.
public addEdits(changes: vscode.TextDocumentContentChangeEvent[], editVersion: number): void {
let edits: VersionedEdits = {
editVersion: editVersion,
changes: changes
};
this.versionedEdits.push(edits);
}
// Apply any pending edits to the currently cached tokens
private applyEdits() : void {
this.versionedEdits.forEach((edit) => {
if (edit.editVersion > this.currentSemanticVersion) {
for (let i: number = 0; i < TokenKind.Count; i++) {
this.semanticRanges[i] = this.fixRanges(this.semanticRanges[i], edit.changes);
}
this.inactiveRanges = this.fixRanges(this.inactiveRanges, edit.changes);
this.currentSemanticVersion = edit.editVersion;
}
});
}
// Remove any edits from the list if we will never receive tokens that old.
private purgeOldVersionedEdits(): void {
let minVersion: number = this.lastReceivedSemanticVersion;
let index: number = this.versionedEdits.findIndex((edit) => edit.editVersion > minVersion);
if (index === -1) {
this.versionedEdits = [];
} else if (index > 0) {
this.versionedEdits = this.versionedEdits.slice(index);
}
}
private updateColorizationRanges(uri: string): void {
let f: () => void = async () => {
this.applyEdits();
this.purgeOldVersionedEdits();
// The only way to un-apply decorators is to dispose them.
// If we dispose old decorators before applying new decorators, we see a flicker on Mac,
// likely due to a race with UI updates. Here we set aside the existing decorators to be
// disposed of after the new decorators have been applied, so there is not a gap
// in which decorators are not applied.
let oldInactiveDecoration: vscode.TextEditorDecorationType = this.inactiveDecoration;
let oldDecorations: vscode.TextEditorDecorationType[] = this.decorations;
this.inactiveDecoration = null;
this.decorations = new Array<vscode.TextEditorDecorationType>(TokenKind.Count);
let isCpp: boolean = util.isEditorFileCpp(uri);
this.createColorizationDecorations(isCpp);
// Apply the decorations to all *visible* text editors
let editors: vscode.TextEditor[] = vscode.window.visibleTextEditors.filter(e => e.document.uri.toString() === uri);
for (let e of editors) {
this.refreshInner(e);
}
// Dispose of the old decorators only after the new ones have been applied.
if (oldInactiveDecoration) {
oldInactiveDecoration.dispose();
}
if (oldDecorations) {
for (let i: number = 0; i < TokenKind.Count; i++) {
if (oldDecorations[i]) {
oldDecorations[i].dispose();
}
}
}
};
this.colorizationSettings.syncWithLoadingSettings(f);
}
public updateSemantic(uri: string, semanticRanges: vscode.Range[][], inactiveRanges: vscode.Range[], editVersion: number): void {
this.inactiveRanges = inactiveRanges;
for (let i: number = 0; i < TokenKind.Count; i++) {
this.semanticRanges[i] = semanticRanges[i];
}
this.currentSemanticVersion = editVersion;
this.lastReceivedSemanticVersion = editVersion;
this.updateColorizationRanges(uri);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,215 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { CustomConfigurationProvider, Version, SourceFileConfigurationItem, WorkspaceBrowseConfiguration } from 'vscode-cpptools';
import { CppSettings } from './settings';
/**
* An interface that is guaranteed to be backward compatible with version 0
*/
export interface CustomConfigurationProvider1 extends CustomConfigurationProvider {
isReady: boolean;
readonly isValid: boolean;
readonly version: Version;
}
/**
* Wraps the incoming CustomConfigurationProvider so that we can treat all of them as if they were the same version (e.g. latest)
*/
class CustomProviderWrapper implements CustomConfigurationProvider1 {
private provider: CustomConfigurationProvider;
private _isReady: boolean;
private _version: Version;
constructor(provider: CustomConfigurationProvider, version: Version) {
this._isReady = version < Version.v2;
this.provider = provider;
if (provider.extensionId && version === Version.v0) {
version = Version.v1; // provider implemented the new API but is interfacing with the extension using the old API version.
}
this._version = version;
}
public get isReady(): boolean {
return this._isReady;
}
public set isReady(ready: boolean) {
this._isReady = ready;
}
public get isValid(): boolean {
let valid: boolean = !!(this.provider.name && this.provider.canProvideConfiguration && this.provider.provideConfigurations);
if (valid && this._version > Version.v0) {
valid = !!(this.provider.extensionId && this.provider.dispose);
}
if (valid && this._version > Version.v1) {
valid = !!(this.provider.canProvideBrowseConfiguration && this.provider.provideBrowseConfiguration);
}
return valid;
}
public get version(): Version {
return this._version;
}
public get name(): string {
return this.provider.name;
}
public get extensionId(): string {
return this._version === Version.v0 ? this.provider.name : this.provider.extensionId;
}
public canProvideConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<boolean> {
return this.provider.canProvideConfiguration(uri, token);
}
public provideConfigurations(uris: vscode.Uri[], token?: vscode.CancellationToken): Thenable<SourceFileConfigurationItem[]> {
return this.provider.provideConfigurations(uris, token);
}
public canProvideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<boolean> {
return this._version < Version.v2 ? Promise.resolve(false) : this.provider.canProvideBrowseConfiguration(token);
}
public provideBrowseConfiguration(token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration> {
console.assert(this._version >= Version.v2);
return this._version < Version.v2 ? Promise.resolve({browsePath: []}) : this.provider.provideBrowseConfiguration(token);
}
public dispose(): void {
if (this._version !== Version.v0) {
this.provider.dispose();
}
}
}
export class CustomConfigurationProviderCollection {
private providers: Map<string, CustomProviderWrapper> = new Map<string, CustomProviderWrapper>();
private logProblems(provider: CustomConfigurationProvider, version: Version): void {
let missing: string[] = [];
if (!provider.name) {
missing.push("'name'");
}
if (version !== Version.v0 && !provider.extensionId) {
missing.push("'extensionId'");
}
if (!provider.canProvideConfiguration) {
missing.push("'canProvideConfiguration'");
}
if (!provider.provideConfigurations) {
missing.push("'canProvideConfiguration'");
}
if (version !== Version.v0 && !provider.dispose) {
missing.push("'dispose'");
}
if (version >= Version.v2 && !provider.canProvideBrowseConfiguration) {
missing.push("'canProvideBrowseConfiguration'");
}
if (version >= Version.v2 && !provider.provideBrowseConfiguration) {
missing.push("'provideBrowseConfiguration'");
}
console.error(`CustomConfigurationProvider was not registered. The following properties are missing from the implementation: ${missing.join(", ")}.`);
}
private getId(provider: string|CustomConfigurationProvider): string {
if (typeof provider === "string") {
return provider;
} else if (provider.extensionId) {
return provider.extensionId;
} else if (provider.name) {
return provider.name;
} else {
console.error(`invalid provider: ${provider}`);
return "";
}
}
public get size(): number {
return this.providers.size;
}
public add(provider: CustomConfigurationProvider, version: Version): boolean {
if (new CppSettings().intelliSenseEngine === "Disabled") {
console.warn("IntelliSense is disabled. Provider will not be registered.");
return false;
}
let wrapper: CustomProviderWrapper = new CustomProviderWrapper(provider, version);
if (!wrapper.isValid) {
this.logProblems(provider, version);
return false;
}
let exists: boolean = this.providers.has(wrapper.extensionId);
if (exists) {
let existing: CustomProviderWrapper = this.providers.get(wrapper.extensionId);
exists = (existing.version === Version.v0 && wrapper.version === Version.v0);
}
if (!exists) {
this.providers.set(wrapper.extensionId, wrapper);
} else {
console.error(`CustomConfigurationProvider '${wrapper.extensionId}' has already been registered.`);
}
return !exists;
}
public get(provider: string|CustomConfigurationProvider): CustomConfigurationProvider1|null {
let id: string = this.getId(provider);
if (this.providers.has(id)) {
return this.providers.get(id);
}
return null;
}
public forEach(func: (provider: CustomConfigurationProvider1) => void): void {
this.providers.forEach(provider => func(provider));
}
public remove(provider: CustomConfigurationProvider): void {
let id: string = this.getId(provider);
if (this.providers.has(id)) {
this.providers.delete(id);
} else {
console.warn(`${id} is not registered`);
}
}
public checkId(providerId?: string): string {
if (!providerId) {
return providerId;
}
let found: CustomConfigurationProvider1[] = [];
let noUpdate: boolean = false;
this.forEach(provider => {
if (provider.extensionId === providerId) {
noUpdate = true;
} else if (provider.name === providerId && provider.version !== Version.v0) {
found.push(provider);
}
});
if (noUpdate) {
return providerId;
}
if (found.length === 1) {
return found[0].extensionId;
} else if (found.length > 1) {
console.warn("duplicate provider name found. Not upgrading.");
}
return providerId;
}
}
let providerCollection: CustomConfigurationProviderCollection = new CustomConfigurationProviderCollection();
export function getCustomConfigProviders(): CustomConfigurationProviderCollection {
return providerCollection;
}
@@ -0,0 +1,47 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as vscode from 'vscode';
export class DataBinding<T> {
private value: T;
private valueChanged = new vscode.EventEmitter<T>();
private isActive: boolean = true;
constructor(value: T) {
this.value = value;
this.isActive = true;
}
public get Value(): T {
return this.value;
}
public set Value(value: T) {
if (value !== this.value) {
this.value = value;
if (this.isActive) {
this.valueChanged.fire(this.value);
}
}
}
public get ValueChanged(): vscode.Event<T> {
return this.valueChanged.event;
}
public activate(): void {
this.isActive = true;
this.valueChanged.fire(this.value);
}
public deactivate(): void {
this.isActive = false;
}
public dispose(): void {
this.deactivate();
this.valueChanged.dispose();
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,321 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { CppSettings } from './settings';
import { getOutputChannel } from '../logger';
export interface CommentPattern {
begin: string;
continue: string;
}
const escapeChars: RegExp = /[\\\^\$\*\+\?\{\}\(\)\.\!\=\|\[\]\ \/]/; // characters that should be escaped.
// Insert '\\' in front of regexp escape chars.
function escape(chars: string): string {
let result: string = "";
for (let char of chars) {
if (char.match(escapeChars)) {
result += `\\${char}`;
} else {
result += char;
}
}
return result;
}
// BEWARE: below are string representations of regular expressions, so the backslashes must all be escaped.
function getMLBeginPattern(insert: string): string | undefined {
if (insert && insert.startsWith("/*")) {
let match: string = escape(insert.substr(2)); // trim the leading '/*' and escape any troublesome characters.
return `^\\s*\\/\\*${match}(?!\\/)([^\\*]|\\*(?!\\/))*$`;
}
return undefined;
}
function getMLSplitAfterPattern(): string {
return "^\\s*\\*\\/$";
}
function getMLContinuePattern(insert: string): string | undefined {
if (insert) {
let match: string = escape(insert.trimRight());
if (match) {
let right: string = escape(insert.substr(insert.trimRight().length));
return `^\\s*${match}(${right}([^\\*]|\\*(?!\\/))*)?$`;
}
// else: if the continuation is just whitespace, vscode already does indentation preservation.
}
return undefined;
}
function getMLEndPattern(insert: string): string | undefined {
if (insert) {
let match: string = escape(insert.trimRight().trimLeft());
if (match) {
return `^\\s*${match}[^/]*\\*\\/\\s*$`;
}
// else: if the continuation is just whitespace, don't mess with indentation
// since we don't know if this is a continuation line or not.
}
return undefined;
}
function getMLEmptyEndPattern(insert: string): string | undefined {
if (insert) {
insert = insert.trimRight();
if (insert) {
if (insert.endsWith('*')) {
insert = insert.substr(0, insert.length - 1);
}
let match: string = escape(insert.trimRight());
return `^\\s*${match}\\*\\/\\s*$`;
}
// else: if the continuation is just whitespace, don't mess with indentation
// since we don't know if this is a continuation line or not.
}
return undefined;
}
function getSLBeginPattern(insert: string): string | undefined {
if (insert) {
let match: string = escape(insert.trimRight());
return `^\\s*${match}.*$`;
}
return undefined;
}
function getSLContinuePattern(insert: string): string | undefined {
if (insert) {
let match: string = escape(insert.trimRight());
return `^\\s*${match}.+$`;
}
return undefined;
}
function getSLEndPattern(insert: string): string | undefined {
if (insert) {
let match: string = escape(insert);
let trimmed: string = escape(insert.trimRight());
if (match !== trimmed) {
match = `(${match}|${trimmed})`;
}
return `^\\s*${match}$`;
}
return undefined;
}
// When Enter is pressed while the cursor is between '/**' and '*/' on the same line.
function getMLSplitRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let beforePattern: string | undefined = getMLBeginPattern(comment.begin);
if (beforePattern) {
return {
beforeText: new RegExp(beforePattern),
afterText: new RegExp(getMLSplitAfterPattern()),
action: {
indentAction: vscode.IndentAction.IndentOutdent,
appendText: comment.continue ? comment.continue : ''
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is after '/**' and there is no '*/' on the same line after the cursor
function getMLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let beforePattern: string | undefined = getMLBeginPattern(comment.begin);
if (beforePattern) {
return {
beforeText: new RegExp(beforePattern),
action: {
indentAction: vscode.IndentAction.None,
appendText: comment.continue ? comment.continue : ''
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is after the continuation pattern
function getMLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let continuePattern: string = getMLContinuePattern(comment.continue);
if (continuePattern) {
return {
beforeText: new RegExp(continuePattern),
action: {
indentAction: vscode.IndentAction.None,
appendText: comment.continue.trimLeft()
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is after '*/' (and '*/' plus leading whitespace is all that is on the line)
function getMLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let endPattern: string = getMLEndPattern(comment.continue);
if (endPattern) {
return {
beforeText: new RegExp(endPattern),
action: {
indentAction: vscode.IndentAction.None,
removeText: comment.continue.length - comment.continue.trimLeft().length
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is after the continuation pattern and '*/'
function getMLEmptyEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let endPattern: string = getMLEmptyEndPattern(comment.continue);
if (endPattern) {
return {
beforeText: new RegExp(endPattern),
action: {
indentAction: vscode.IndentAction.None,
removeText: comment.continue.length - comment.continue.trimLeft().length
}
};
}
}
return undefined;
}
// When the continue rule is different than the begin rule for single line comments
function getSLFirstLineRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let continuePattern: string = getSLBeginPattern(comment.begin);
if (continuePattern) {
return {
beforeText: new RegExp(continuePattern),
action: {
indentAction: vscode.IndentAction.None,
appendText: comment.continue.trimLeft()
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is after the continuation pattern plus at least one other character.
function getSLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let continuePattern: string = getSLContinuePattern(comment.continue);
if (continuePattern) {
return {
beforeText: new RegExp(continuePattern),
action: {
indentAction: vscode.IndentAction.None,
appendText: comment.continue.trimLeft()
}
};
}
}
return undefined;
}
// When Enter is pressed while the cursor is immediately after the continuation pattern
function getSLEndRule(comment: CommentPattern): vscode.OnEnterRule | undefined {
if (comment) {
let endPattern: string = getSLEndPattern(comment.continue);
if (endPattern) {
return {
beforeText: new RegExp(endPattern),
action: {
indentAction: vscode.IndentAction.None,
removeText: comment.continue.length - comment.continue.trimLeft().length
}
};
}
}
return undefined;
}
interface Rules {
begin: vscode.OnEnterRule[];
continue: vscode.OnEnterRule[];
end: vscode.OnEnterRule[];
}
export function getLanguageConfig(languageId: string, resource?: vscode.Uri): vscode.LanguageConfiguration {
let settings: CppSettings = new CppSettings(resource);
let patterns: (string | CommentPattern)[] = settings.commentContinuationPatterns;
return getLanguageConfigFromPatterns(languageId, patterns);
}
export function getLanguageConfigFromPatterns(languageId: string, patterns: (string | CommentPattern)[]): vscode.LanguageConfiguration {
let beginPatterns: string[] = []; // avoid duplicate rules
let continuePatterns: string[] = []; // avoid duplicate rules
let duplicates: boolean = false;
let beginRules: vscode.OnEnterRule[] = [];
let continueRules: vscode.OnEnterRule[] = [];
let endRules: vscode.OnEnterRule[] = [];
patterns.forEach(pattern => {
let c: CommentPattern = (typeof pattern === "string") ? { begin: pattern, continue: pattern.startsWith('/*') ? " * " : pattern } : <CommentPattern>pattern;
let r: Rules = constructCommentRules(c, languageId);
if (beginPatterns.indexOf(c.begin) < 0) {
if (r.begin && r.begin.length > 0) {
beginRules = beginRules.concat(r.begin);
}
beginPatterns.push(c.begin);
} else {
duplicates = true;
}
if (continuePatterns.indexOf(c.continue) < 0) {
if (r.continue && r.continue.length > 0) {
continueRules = continueRules.concat(r.continue);
}
if (r.end && r.end.length > 0) {
endRules = endRules.concat(r.end);
}
continuePatterns.push(c.continue);
}
});
if (duplicates) {
getOutputChannel().appendLine("Duplicate multiline comment patterns detected.");
}
return { onEnterRules: beginRules.concat(continueRules).concat(endRules).filter(e => (e)) }; // Remove any 'undefined' entries
}
function constructCommentRules(comment: CommentPattern, languageId: string): Rules {
if (comment && comment.begin && comment.begin.startsWith('/*') && (languageId === 'c' || languageId === 'cpp')) {
return {
begin: [
getMLSplitRule(comment),
getMLFirstLineRule(comment)
],
continue: [ getMLContinuationRule(comment) ],
end: [
getMLEmptyEndRule(comment),
getMLEndRule(comment)
]
};
} else if (comment && comment.begin && comment.begin.startsWith('//') && languageId === 'cpp') {
return {
begin: (comment.begin === comment.continue) ? [] : [ getSLFirstLineRule(comment) ],
continue: [ getSLContinuationRule(comment) ],
end: [ getSLEndRule(comment) ]
};
}
return {
begin: [],
continue: [],
end: []
};
}
@@ -0,0 +1,58 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as util from '../common';
import * as vscode from 'vscode';
import * as path from 'path';
class PersistentStateBase<T> {
private key: string;
private defaultvalue: T;
private state: vscode.Memento;
private curvalue: T;
constructor(key: string, defaultValue: T, state: vscode.Memento) {
this.key = key;
this.defaultvalue = defaultValue;
this.state = state;
this.curvalue = defaultValue;
}
public get Value(): T {
return this.state ? this.state.get<T>(this.key, this.defaultvalue) : this.curvalue;
}
public set Value(newValue: T) {
if (this.state) {
this.state.update(this.key, newValue);
}
this.curvalue = newValue;
}
public get DefaultValue(): T {
return this.defaultvalue;
}
}
// Abstraction for global state that persists across activations but is not present in a settings file
export class PersistentState<T> extends PersistentStateBase<T> {
constructor(key: string, defaultValue: T) {
super(key, defaultValue, util.extensionContext ? util.extensionContext.globalState : null);
}
}
export class PersistentWorkspaceState<T> extends PersistentStateBase<T> {
constructor(key: string, defaultValue: T) {
super(key, defaultValue, util.extensionContext ? util.extensionContext.workspaceState : null);
}
}
export class PersistentFolderState<T> extends PersistentWorkspaceState<T> {
constructor(key: string, defaultValue: T, folder: string) {
let newKey: string = key + (folder ? `-${path.basename(folder)}` : "-untitled");
super(newKey, defaultValue);
}
}
@@ -0,0 +1,94 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as path from 'path';
import { Middleware } from 'vscode-languageclient';
import { ClientCollection } from './clientCollection';
import { Client } from './client';
export function createProtocolFilter(me: Client, clients: ClientCollection): Middleware {
// Disabling lint for invoke handlers
/* tslint:disable */
let defaultHandler: (data: any, callback: (data: any) => void) => void = (data, callback: (data) => void) => { if (clients.ActiveClient === me) {me.notifyWhenReady(() => callback(data));}};
let invoke1 = (a, callback: (a) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a)); } return null; };
let invoke2 = (a, b, callback: (a, b) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a, b)); } return null; };
let invoke3 = (a, b, c, callback: (a, b, c) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a, b, c)); } return null; };
let invoke4 = (a, b, c, d, callback: (a, b, c, d) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a, b, c, d)); } return null; };
let invoke5 = (a, b, c, d, e, callback: (a, b, c, d, e) => any) => { if (clients.ActiveClient === me) { return me.requestWhenReady(() => callback(a, b, c, d, e)); } return null; };
/* tslint:enable */
return {
didOpen: (document, sendMessage) => {
if (clients.checkOwnership(me, document)) {
me.TrackedDocuments.add(document);
// Work around vscode treating ".C" as c, by adding this file name to file associations as cpp
if (document.uri.path.endsWith(".C")) {
let fileName: string = path.basename(document.uri.fsPath);
let mappingString: string = fileName + "@" + document.uri.fsPath;
me.addFileAssociations(mappingString, false);
}
me.onDidOpenTextDocument(document);
me.provideCustomConfiguration(document).then(() => {
sendMessage(document);
}, () => {
sendMessage(document);
});
}
},
didChange: (textDocumentChangeEvent, sendMessage) => {
if (clients.ActiveClient === me) {
me.onDidChangeTextDocument(textDocumentChangeEvent);
me.notifyWhenReady(() => sendMessage(textDocumentChangeEvent));
}
},
willSave: defaultHandler,
willSaveWaitUntil: (event, sendMessage) => {
if (clients.ActiveClient === me) {
return me.requestWhenReady(() => sendMessage(event));
}
return Promise.resolve([]);
},
didSave: defaultHandler,
didClose: (document, sendMessage) => {
if (clients.ActiveClient === me) {
console.assert(me.TrackedDocuments.has(document));
me.TrackedDocuments.delete(document);
me.notifyWhenReady(() => sendMessage(document));
}
},
provideCompletionItem: invoke4,
resolveCompletionItem: invoke2,
provideHover: (document, position, token, next: (document, position, token) => any) => {
if (clients.checkOwnership(me, document)) {
return me.requestWhenReady(() => next(document, position, token));
}
return null;
},
provideSignatureHelp: invoke3,
provideDefinition: invoke3,
provideReferences: invoke4,
provideDocumentHighlights: invoke3,
provideDocumentSymbols: invoke2,
provideWorkspaceSymbols: invoke2,
provideCodeActions: invoke4,
provideCodeLenses: invoke2,
resolveCodeLens: invoke2,
provideDocumentFormattingEdits: invoke3,
provideDocumentRangeFormattingEdits: invoke4,
provideOnTypeFormattingEdits: invoke5,
provideRenameEdits: invoke4,
provideDocumentLinks: invoke2,
resolveDocumentLink: invoke2,
// I believe the default handler will do the same thing.
// workspace: {
// didChangeConfiguration: (sections, sendMessage) => sendMessage(sections)
// }
};
}
+135
View File
@@ -0,0 +1,135 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { CommentPattern } from './languageConfig';
function getTarget(): vscode.ConfigurationTarget {
return (vscode.workspace.workspaceFolders) ? vscode.ConfigurationTarget.WorkspaceFolder : vscode.ConfigurationTarget.Global;
}
class Settings {
private readonly settings: vscode.WorkspaceConfiguration;
/**
* create the Settings object.
* @param resource The path to a resource to which the settings should apply, or undefined if global settings are desired
*/
constructor(section: string, resource?: vscode.Uri) {
this.settings = vscode.workspace.getConfiguration(section, resource ? resource : null);
}
protected get Section(): vscode.WorkspaceConfiguration { return this.settings; }
}
export class CppSettings extends Settings {
constructor(resource?: vscode.Uri) {
super("C_Cpp", resource);
}
public get clangFormatPath(): string { return super.Section.get<string>("clang_format_path"); }
public get clangFormatStyle(): string { return super.Section.get<string>("clang_format_style"); }
public get clangFormatFallbackStyle(): string { return super.Section.get<string>("clang_format_fallbackStyle"); }
public get clangFormatSortIncludes(): string { return super.Section.get<string>("clang_format_sortIncludes"); }
public get clangFormatOnSave(): string { return super.Section.get<string>("clang_format_formatOnSave"); }
public get formatting(): string { return super.Section.get<string>("formatting"); }
public get suggestSnippets(): boolean { return super.Section.get<boolean>("suggestSnippets"); }
public get intelliSenseEngine(): string { return super.Section.get<string>("intelliSenseEngine"); }
public get intelliSenseEngineFallback(): string { return super.Section.get<string>("intelliSenseEngineFallback"); }
public get intelliSenseCachePath(): string { return super.Section.get<string>("intelliSenseCachePath"); }
public get intelliSenseCacheSize(): number { return super.Section.get<number>("intelliSenseCacheSize"); }
public get errorSquiggles(): string { return super.Section.get<string>("errorSquiggles"); }
public get inactiveRegionOpacity(): number { return super.Section.get<number>("inactiveRegionOpacity"); }
public get inactiveRegionForegroundColor(): string { return super.Section.get<string>("inactiveRegionForegroundColor"); }
public get inactiveRegionBackgroundColor(): string { return super.Section.get<string>("inactiveRegionBackgroundColor"); }
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 autoAddFileAssociations(): boolean { return super.Section.get<boolean>("autoAddFileAssociations"); }
public get workspaceParsingPriority(): boolean { return super.Section.get<boolean>("workspaceParsingPriority"); }
public get workspaceSymbols(): string { return super.Section.get<string>("workspaceSymbols"); }
public get exclusionPolicy(): boolean { return super.Section.get<boolean>("exclusionPolicy"); }
public get commentContinuationPatterns(): (string | CommentPattern)[] { return super.Section.get<(string | CommentPattern)[]>("commentContinuationPatterns"); }
public get configurationWarnings(): string { return super.Section.get<string>("configurationWarnings"); }
public get preferredPathSeparator(): string { return super.Section.get<string>("preferredPathSeparator"); }
public get updateChannel(): string { return super.Section.get<string>("updateChannel"); }
public get defaultIncludePath(): string[] { return super.Section.get<string[]>("default.includePath"); }
public get defaultDefines(): string[] { return super.Section.get<string[]>("default.defines"); }
public get defaultMacFrameworkPath(): string[] { return super.Section.get<string[]>("default.macFrameworkPath"); }
public get defaultWindowsSdkVersion(): string { return super.Section.get<string>("default.windowsSdkVersion"); }
public get defaultCompileCommands(): string { return super.Section.get<string>("default.compileCommands"); }
public get defaultForcedInclude(): string[] { return super.Section.get<string[]>("default.forcedInclude"); }
public get defaultIntelliSenseMode(): string { return super.Section.get<string>("default.intelliSenseMode"); }
public get defaultCompilerPath(): string { return super.Section.get<string>("default.compilerPath"); }
public get defaultCStandard(): string { return super.Section.get<string>("default.cStandard"); }
public get defaultCppStandard(): string { return super.Section.get<string>("default.cppStandard"); }
public get defaultConfigurationProvider(): string { return super.Section.get<string>("default.configurationProvider"); }
public get defaultBrowsePath(): string[] { return super.Section.get<string[]>("default.browse.path"); }
public get defaultDatabaseFilename(): string { return super.Section.get<string>("default.browse.databaseFilename"); }
public get defaultLimitSymbolsToIncludedHeaders(): boolean { return super.Section.get<boolean>("default.browse.limitSymbolsToIncludedHeaders"); }
public get defaultSystemIncludePath(): string[] { return super.Section.get<string[]>("default.systemIncludePath"); }
public get defaultEnableConfigurationSquiggles(): boolean { return super.Section.get<boolean>("default.enableConfigurationSquiggles"); }
public get enhancedColorization(): boolean {
return super.Section.get<string>("enhancedColorization") === "Enabled"
&& super.Section.get<string>("intelliSenseEngine") === "Default"
&& vscode.workspace.getConfiguration("workbench").get<string>("colorTheme") !== "Default High Contrast";
}
public get dimInactiveRegions(): boolean {
return super.Section.get<boolean>("dimInactiveRegions")
&& super.Section.get<string>("intelliSenseEngine") === "Default"
&& vscode.workspace.getConfiguration("workbench").get<string>("colorTheme") !== "Default High Contrast";
}
public toggleSetting(name: string, value1: string, value2: string): void {
let value: string = super.Section.get<string>(name);
super.Section.update(name, value === value1 ? value2 : value1, getTarget());
}
public update<T>(name: string, value: T): void {
super.Section.update(name, value);
}
}
export interface TextMateRuleSettings {
foreground: string | undefined;
background: string | undefined;
fontStyle: string | undefined;
}
export interface TextMateRule {
scope: any;
settings: TextMateRuleSettings;
}
export class OtherSettings {
private resource: vscode.Uri;
constructor(resource?: vscode.Uri) {
if (!resource) {
resource = null;
}
this.resource = resource;
}
public get editorTabSize(): number { return vscode.workspace.getConfiguration("editor", this.resource).get<number>("tabSize"); }
public get filesAssociations(): any { return vscode.workspace.getConfiguration("files", null).get("associations"); }
public get filesExclude(): vscode.WorkspaceConfiguration { return vscode.workspace.getConfiguration("files", this.resource).get("exclude"); }
public get searchExclude(): vscode.WorkspaceConfiguration { return vscode.workspace.getConfiguration("search", this.resource).get("exclude"); }
public get settingsEditor(): string { return vscode.workspace.getConfiguration("workbench.settings").get<string>("editor"); }
public get colorTheme(): string { return vscode.workspace.getConfiguration("workbench").get<string>("colorTheme"); }
public getCustomColorToken(colorTokenName: string): string { return vscode.workspace.getConfiguration("editor.tokenColorCustomizations").get<string>(colorTokenName); }
public getCustomThemeSpecificColorToken(themeName: string, colorTokenName: string): string { return vscode.workspace.getConfiguration(`editor.tokenColorCustomizations.[${themeName}]`, this.resource).get<string>(colorTokenName); }
public get customTextMateRules(): TextMateRule[] { return vscode.workspace.getConfiguration("editor.tokenColorCustomizations").get<TextMateRule[]>("textMateRules"); }
public getCustomThemeSpecificTextMateRules(themeName: string): TextMateRule[] { return vscode.workspace.getConfiguration(`editor.tokenColorCustomizations.[${themeName}]`, this.resource).get<TextMateRule[]>("textMateRules"); }
public set filesAssociations(value: any) {
vscode.workspace.getConfiguration("files", null).update("associations", value, vscode.ConfigurationTarget.Workspace);
}
}
@@ -0,0 +1,376 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as path from 'path';
import * as fs from 'fs';
import * as vscode from 'vscode';
import * as util from '../common';
import * as config from './configurations';
import * as telemetry from '../telemetry';
// TODO: share ElementId between SettingsPanel and SettingsApp. Investigate why SettingsApp cannot import/export
const elementId: { [key: string]: string } = {
// Basic settings
configName: "configName",
configSelection: "configSelection",
addConfigBtn: "addConfigBtn",
addConfigOk: "addConfigOk",
addConfigCancel: "addConfigCancel",
addConfigName: "addConfigName",
compilerPath: "compilerPath",
compilerPathInvalid: "compilerPathInvalid",
knownCompilers: "knownCompilers",
intelliSenseMode: "intelliSenseMode",
intelliSenseModeInvalid: "intelliSenseModeInvalid",
includePath: "includePath",
includePathInvalid: "includePathInvalid",
defines: "defines",
cStandard: "cStandard",
cppStandard: "cppStandard",
// Advanced settings
windowsSdkVersion: "windowsSdkVersion",
macFrameworkPath: "macFrameworkPath",
compileCommands: "compileCommands",
configurationProvider: "configurationProvider",
forcedInclude: "forcedInclude",
// Browse properties
browsePath: "browsePath",
limitSymbolsToIncludedHeaders: "limitSymbolsToIncludedHeaders",
databaseFilename: "databaseFilename",
// Other
showAdvancedBtn: "showAdvancedBtn"
};
export class SettingsPanel {
private telemetry: { [key: string]: number } = {};
private disposable: vscode.Disposable = undefined;
// Events
private settingsPanelActivated = new vscode.EventEmitter<void>();
private configValuesChanged = new vscode.EventEmitter<void>();
private configSelectionChanged = new vscode.EventEmitter<void>();
private addConfigRequested = new vscode.EventEmitter<string>();
// Configuration data
private configValues: config.Configuration;
private isIntelliSenseModeDefined: boolean = false;
private configIndexSelected: number = 0;
private compilerPaths: string[] = [];
// WebviewPanel objects
private panel: vscode.WebviewPanel;
private disposablesPanel: vscode.Disposable = undefined;
private static readonly viewType: string = 'settingsPanel';
private static readonly title: string = 'C/C++ Configurations';
constructor() {
this.configValues = { name: undefined };
this.disposable = vscode.Disposable.from(
this.settingsPanelActivated,
this.configValuesChanged,
this.configSelectionChanged,
this.addConfigRequested
);
}
public createOrShow(configSelection: string[], activeConfiguration: config.Configuration, errors: config.ConfigurationErrors): void {
const column: vscode.ViewColumn = vscode.window.activeTextEditor
? vscode.window.activeTextEditor.viewColumn
: undefined;
// Show existing panel
if (this.panel) {
this.panel.reveal(column, false);
return;
}
// Create new panel
this.panel = vscode.window.createWebviewPanel(
SettingsPanel.viewType,
SettingsPanel.title,
column || vscode.ViewColumn.One,
{
enableCommandUris: true,
enableScripts: true,
// Restrict the webview to only loading content from these directories
localResourceRoots: [
vscode.Uri.file(util.extensionPath),
vscode.Uri.file(path.join(util.extensionPath, 'ui')),
vscode.Uri.file(path.join(util.extensionPath, 'out', 'ui'))]
}
);
this.panel.iconPath = vscode.Uri.file(util.getExtensionFilePath("LanguageCCPP_color_128x.png"));
this.disposablesPanel = vscode.Disposable.from(
this.panel,
this.panel.onDidDispose(this.onPanelDisposed, this),
this.panel.onDidChangeViewState(this.onViewStateChanged, this),
this.panel.webview.onDidReceiveMessage(this.onMessageReceived, this),
vscode.window.onDidChangeWindowState(this.onWindowStateChanged, this)
);
this.panel.webview.html = this.getHtml();
this.updateWebview(configSelection, activeConfiguration, errors);
}
public get SettingsPanelActivated(): vscode.Event<void> {
return this.settingsPanelActivated.event;
}
public get ConfigValuesChanged(): vscode.Event<void> {
return this.configValuesChanged.event;
}
public get ConfigSelectionChanged(): vscode.Event<void> {
return this.configSelectionChanged.event;
}
public get AddConfigRequested(): vscode.Event<string> {
return this.addConfigRequested.event;
}
public get selectedConfigIndex(): number {
return this.configIndexSelected;
}
public set selectedConfigIndex(index: number) {
this.configIndexSelected = index;
}
public getLastValuesFromConfigUI(): config.Configuration {
return this.configValues;
}
public updateConfigUI(configSelection: string[], configuration: config.Configuration, errors: config.ConfigurationErrors|null): void {
if (this.panel) {
this.updateWebview(configSelection, configuration, errors);
}
}
public setKnownCompilers(knownCompilers: config.KnownCompiler[], pathSeparator: string): void {
if (knownCompilers.length > 0) {
for (let compiler of knownCompilers) {
// Normalize path separators.
let path: string = compiler.path;
if (pathSeparator === "Forward Slash") {
path = path.replace(/\\/g, '/');
} else {
path = path.replace(/\//g, '\\');
}
// Do not add duplicate paths in case the default compilers for cpp and c are the same.
if (this.compilerPaths.indexOf(path) === -1) {
this.compilerPaths.push(path);
}
}
}
}
public updateErrors(errors: config.ConfigurationErrors): void {
if (this.panel) {
this.panel.webview.postMessage({ command: 'updateErrors', errors: errors});
}
}
public dispose(): void {
// Log any telemetry
if (Object.keys(this.telemetry).length > 0) {
telemetry.logLanguageServerEvent("ConfigUI", null, this.telemetry);
}
// Clean up resources
this.panel.dispose();
if (this.disposable) {
this.disposable.dispose();
}
if (this.disposablesPanel) {
this.disposablesPanel.dispose();
}
}
private onPanelDisposed(): void {
if (this.disposablesPanel) {
this.disposablesPanel.dispose();
this.panel = undefined;
}
}
private updateWebview(configSelection: string[], configuration: config.Configuration, errors: config.ConfigurationErrors|null): void {
this.configValues = Object.assign({}, configuration); // Copy configuration values
this.isIntelliSenseModeDefined = (this.configValues.intelliSenseMode !== undefined);
if (this.panel) {
this.panel.webview.postMessage({ command: 'setKnownCompilers', compilers: this.compilerPaths});
this.panel.webview.postMessage({ command: 'updateConfigSelection', selections: configSelection, selectedIndex: this.configIndexSelected});
this.panel.webview.postMessage({ command: 'updateConfig', config: this.configValues});
if (errors !== null) {
this.panel.webview.postMessage({ command: 'updateErrors', errors: errors});
}
}
}
private onViewStateChanged(e: vscode.WebviewPanelOnDidChangeViewStateEvent): void {
if (e.webviewPanel.active) {
this.settingsPanelActivated.fire();
}
}
private onWindowStateChanged(e: vscode.WindowState): void {
if (e.focused) {
this.settingsPanelActivated.fire();
}
}
private onMessageReceived(message: any): void {
if (message === null) {
return;
}
switch (message.command) {
case 'change':
this.updateConfig(message);
break;
case 'configSelect':
this.configSelect(message.index);
break;
case 'addConfig':
this.addConfig(message.name);
break;
case 'knownCompilerSelect':
this.knownCompilerSelect();
break;
}
}
private addConfig(name: string): void {
this.addConfigRequested.fire(name);
this.logTelemetryForElement(elementId.addConfigName);
}
private configSelect(index: number): void {
this.configIndexSelected = index;
this.configSelectionChanged.fire();
this.logTelemetryForElement(elementId.configSelection);
}
private knownCompilerSelect(): void {
this.logTelemetryForElement(elementId.knownCompilers);
// Remove one count from compilerPath because selecting a different compiler causes a change on the compiler path
if (this.telemetry[elementId.compilerPath]) {
this.telemetry[elementId.compilerPath]--;
}
}
private updateConfig(message: any): void {
let splitEntries: (input: any) => string[] = (input: any) => {
return input.split("\n").filter((e: string) => e);
};
switch (message.key) {
case elementId.configName:
this.configValues.name = message.value;
break;
case elementId.compilerPath:
this.configValues.compilerPath = message.value;
break;
case elementId.includePath:
this.configValues.includePath = splitEntries(message.value);
break;
case elementId.defines:
this.configValues.defines = splitEntries(message.value);
break;
case elementId.intelliSenseMode:
if (message.value !== "${default}" || this.isIntelliSenseModeDefined) {
this.configValues.intelliSenseMode = message.value;
} else {
this.configValues.intelliSenseMode = undefined;
}
break;
case elementId.cStandard:
this.configValues.cStandard = message.value;
break;
case elementId.cppStandard:
this.configValues.cppStandard = message.value;
break;
case elementId.windowsSdkVersion:
this.configValues.windowsSdkVersion = message.value;
break;
case elementId.macFrameworkPath:
this.configValues.macFrameworkPath = splitEntries(message.value);
break;
case elementId.compileCommands:
this.configValues.compileCommands = message.value;
break;
case elementId.configurationProvider:
this.configValues.configurationProvider = message.value;
break;
case elementId.forcedInclude:
this.configValues.forcedInclude = splitEntries(message.value);
break;
case elementId.browsePath:
this.initializeBrowseProperties();
this.configValues.browse.path = splitEntries(message.value);
break;
case elementId.limitSymbolsToIncludedHeaders:
this.initializeBrowseProperties();
this.configValues.browse.limitSymbolsToIncludedHeaders = message.value;
break;
case elementId.databaseFilename:
this.initializeBrowseProperties();
this.configValues.browse.databaseFilename = message.value;
break;
}
this.configValuesChanged.fire();
this.logTelemetryForElement(message.key);
}
private logTelemetryForElement(elementId: string): void {
if (this.telemetry[elementId] === undefined) {
this.telemetry[elementId] = 0;
}
this.telemetry[elementId]++;
}
private initializeBrowseProperties(): void {
if (this.configValues.browse === undefined) {
this.configValues.browse = {};
}
}
private getHtml(): string {
let content: string | undefined;
content = fs.readFileSync(util.getExtensionFilePath("ui/settings.html")).toString();
content = content.replace(
/{{root}}/g,
vscode.Uri.file(util.extensionPath)
.with({ scheme: 'vscode-resource' })
.toString());
content = content.replace(
/{{nonce}}/g,
this.getNonce());
return content;
}
private getNonce(): string {
let nonce: string;
const possible: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i: number = 0; i < 32; i++) {
nonce += possible.charAt(Math.floor(Math.random() * possible.length));
}
return nonce;
}
}
@@ -0,0 +1,190 @@
/* --------------------------------------------------------------------------------------------
* 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 util from '../common';
/**
* track settings changes for telemetry
*/
type FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfiguration) => boolean;
type KeyValuePair = { key: string; value: string };
const maxSettingLengthForTelemetry: number = 50;
let cache: SettingsTracker = undefined;
export class SettingsTracker {
private previousCppSettings: { [key: string]: any } = {};
private resource: vscode.Uri;
constructor(resource: vscode.Uri) {
this.resource = resource;
this.collectSettings(() => true);
}
public getUserModifiedSettings(): { [key: string]: string } {
let filter: FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfiguration) => {
return !this.areEqual(val, settings.inspect(key).defaultValue);
};
return this.collectSettings(filter);
}
public getChangedSettings(): { [key: string]: string } {
let filter: FilterFunction = (key: string, val: string) => {
return !(key in this.previousCppSettings) || !this.areEqual(val, this.previousCppSettings[key]);
};
return this.collectSettings(filter);
}
private collectSettings(filter: FilterFunction): { [key: string]: string } {
let settings: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("C_Cpp", this.resource);
let result: { [key: string]: string } = {};
for (let key in settings) {
let val: any = this.getSetting(settings, key);
if (val === undefined) {
continue;
}
if (val instanceof Object && !(val instanceof Array)) {
for (let subKey in val) {
let newKey: string = key + "." + subKey;
let subVal: any = this.getSetting(settings, newKey);
if (subVal === undefined) {
continue;
}
let entry: KeyValuePair = this.filterAndSanitize(newKey, subVal, settings, filter);
if (entry && entry.key && entry.value) {
result[entry.key] = entry.value;
}
}
continue;
}
let entry: KeyValuePair = this.filterAndSanitize(key, val, settings, filter);
if (entry && entry.key && entry.value) {
result[entry.key] = entry.value;
}
}
return result;
}
private getSetting(settings: vscode.WorkspaceConfiguration, key: string): any {
// Ignore methods and settings that don't exist
if (settings.inspect(key).defaultValue !== undefined) {
let val: any = settings.get(key);
if (val instanceof Object) {
return val; // It's a sub-section.
}
// Only return values that match the setting's type and enum (if applicable).
let curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
if (curSetting) {
let type: string = this.typeMatch(val, curSetting["type"]);
if (type) {
if (type !== "string") {
return val;
}
let curEnum: any[] = curSetting["enum"];
if (curEnum && curEnum.indexOf(val) === -1) {
return "<invalid>";
}
return val;
}
}
}
return undefined;
}
private typeMatch(value: any, type?: string | string[]): string {
if (type) {
if (type instanceof Array) {
for (let i: number = 0; i < type.length; i++) {
let t: string = type[i];
if (t) {
if (typeof value === t) {
return t;
}
if (t === "array" && value instanceof Array) {
return t;
}
if (t === "null" && value === null) {
return t;
}
}
}
} else if (typeof type === "string" && typeof value === type) {
return type;
}
}
return undefined;
}
private filterAndSanitize(key: string, val: any, settings: vscode.WorkspaceConfiguration, filter: FilterFunction): KeyValuePair {
if (filter(key, val, settings)) {
let value: string;
this.previousCppSettings[key] = val;
switch (key) {
case "clang_format_style":
case "clang_format_fallbackStyle": {
let newKey: 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": {
value = String(this.previousCppSettings[key]);
break;
}
default: {
value = "...";
break;
}
}
} else {
value = "null";
}
key = newKey;
break;
}
case "commentContinuationPatterns": {
value = this.areEqual(val, settings.inspect(key).defaultValue) ? "<default>" : "..."; // Track whether it's being used, but nothing specific about it.
break;
}
default: {
if (key === "clang_format_path" || key === "intelliSenseCachePath" || key.startsWith("default.")) {
value = this.areEqual(val, settings.inspect(key).defaultValue) ? "<default>" : "..."; // Track whether it's being used, but nothing specific about it.
} else {
value = String(this.previousCppSettings[key]);
}
}
}
if (value && value.length > maxSettingLengthForTelemetry) {
value = value.substr(0, maxSettingLengthForTelemetry) + "...";
}
return {key: key, value: value};
}
}
private areEqual(value1: any, value2: any): boolean {
if (value1 instanceof Object && value2 instanceof Object) {
return JSON.stringify(value1) === JSON.stringify(value2);
}
return value1 === value2;
}
}
export function getTracker(resource: vscode.Uri): SettingsTracker {
if (!cache) {
cache = new SettingsTracker(resource);
}
return cache;
}
+296
View File
@@ -0,0 +1,296 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { Client } from './client';
import { getCustomConfigProviders, CustomConfigurationProviderCollection } from './customProviders';
let ui: UI;
interface IndexableQuickPickItem extends vscode.QuickPickItem {
index: number;
}
interface KeyedQuickPickItem extends vscode.QuickPickItem {
key: string;
}
// Higher numbers mean greater priority.
enum ConfigurationPriority {
IncludePath = 1,
CompileCommands = 2,
CustomProvider = 3,
}
interface ConfigurationResult {
configured: boolean;
priority: ConfigurationPriority;
}
export class UI {
private navigationStatusBarItem: vscode.StatusBarItem;
private configStatusBarItem: vscode.StatusBarItem;
private browseEngineStatusBarItem: vscode.StatusBarItem;
private intelliSenseStatusBarItem: vscode.StatusBarItem;
private configurationUIPromise: Thenable<ConfigurationResult>;
constructor() {
// 1000 = priority, it needs to be high enough to be on the left of the Ln/Col.
this.navigationStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 1000);
this.navigationStatusBarItem.tooltip = "C/C++ Navigation";
this.navigationStatusBarItem.command = "C_Cpp.Navigate";
this.ShowNavigation = true;
this.configStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 2);
this.configStatusBarItem.command = "C_Cpp.ConfigurationSelect";
this.configStatusBarItem.tooltip = "C/C++ Configuration";
this.ShowConfiguration = true;
this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 1);
this.intelliSenseStatusBarItem.text = "";
this.intelliSenseStatusBarItem.tooltip = "Updating IntelliSense...";
this.intelliSenseStatusBarItem.color = "Red";
this.ShowFlameIcon = true;
this.browseEngineStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 0);
this.browseEngineStatusBarItem.text = "";
this.browseEngineStatusBarItem.tooltip = "Discovering files...";
this.browseEngineStatusBarItem.color = new vscode.ThemeColor("statusBar.foreground");
this.browseEngineStatusBarItem.command = "C_Cpp.ShowParsingCommands";
this.ShowDBIcon = true;
}
private set NavigationLocation(location: string) {
this.navigationStatusBarItem.text = location;
}
private set ActiveConfig(label: string) {
this.configStatusBarItem.text = label;
}
private set TagParseStatus(label: string) {
this.browseEngineStatusBarItem.tooltip = label;
}
private get IsTagParsing(): boolean {
return this.browseEngineStatusBarItem.text !== "";
}
private set IsTagParsing(val: boolean) {
this.browseEngineStatusBarItem.text = val ? "$(database)" : "";
this.ShowDBIcon = val;
}
private get IsUpdatingIntelliSense(): boolean {
return this.intelliSenseStatusBarItem.text !== "";
}
private set IsUpdatingIntelliSense(val: boolean) {
this.intelliSenseStatusBarItem.text = val ? "$(flame)" : "";
this.ShowFlameIcon = val;
}
private set ShowNavigation(show: boolean) {
if (show) {
this.navigationStatusBarItem.show();
} else {
this.navigationStatusBarItem.hide();
}
}
private set ShowDBIcon(show: boolean) {
if (show && this.IsTagParsing) {
this.browseEngineStatusBarItem.show();
} else {
this.browseEngineStatusBarItem.hide();
}
}
private set ShowFlameIcon(show: boolean) {
if (show && this.IsUpdatingIntelliSense) {
this.intelliSenseStatusBarItem.show();
} else {
this.intelliSenseStatusBarItem.hide();
}
}
private set ShowConfiguration(show: boolean) {
if (show) {
this.configStatusBarItem.show();
} else {
this.configStatusBarItem.hide();
}
}
public activeDocumentChanged(): void {
let activeEditor: vscode.TextEditor = vscode.window.activeTextEditor;
let isCpp: boolean = (activeEditor && (activeEditor.document.languageId === "cpp" || activeEditor.document.languageId === "c"));
// It's sometimes desirable to see the config and icons when making settings changes.
let isSettingsJson: boolean = (activeEditor && (activeEditor.document.fileName.endsWith("c_cpp_properties.json") || activeEditor.document.fileName.endsWith("settings.json")));
this.ShowConfiguration = isCpp || isSettingsJson;
this.ShowDBIcon = isCpp || isSettingsJson;
this.ShowFlameIcon = isCpp || isSettingsJson;
this.ShowNavigation = isCpp;
}
public bind(client: Client): void {
client.TagParsingChanged(value => { this.IsTagParsing = value; });
client.IntelliSenseParsingChanged(value => { this.IsUpdatingIntelliSense = value; });
client.NavigationLocationChanged(value => { this.NavigationLocation = value; });
client.TagParserStatusChanged(value => { this.TagParseStatus = value; });
client.ActiveConfigChanged(value => { this.ActiveConfig = value; });
}
public showNavigationOptions(navigationList: string): void {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select where to navigate to";
let items: IndexableQuickPickItem[] = [];
let navlist: string[] = navigationList.split(";");
for (let i: number = 0; i < navlist.length - 1; i += 2) {
items.push({ label: navlist[i], description: "", index: Number(navlist[i + 1]) });
}
vscode.window.showQuickPick(items, options)
.then(selection => {
if (!selection) {
return;
}
vscode.window.activeTextEditor.revealRange(new vscode.Range(selection.index, 0, selection.index, 0), vscode.TextEditorRevealType.InCenter);
vscode.window.activeTextEditor.selection = new vscode.Selection(new vscode.Position(selection.index, 0), new vscode.Position(selection.index, 0));
});
}
public showConfigurations(configurationNames: string[]): Thenable<number> {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select a Configuration...";
let items: IndexableQuickPickItem[] = [];
for (let i: number = 0; i < configurationNames.length; i++) {
items.push({ label: configurationNames[i], description: "", index: i });
}
items.push({ label: "Edit Configurations (UI)", description: "", index: configurationNames.length });
items.push({ label: "Edit Configurations (JSON)", description: "", index: configurationNames.length + 1 });
return vscode.window.showQuickPick(items, options)
.then(selection => (selection) ? selection.index : -1);
}
public showConfigurationProviders(currentProvider: string|null): Thenable<string|undefined> {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select a Configuration Provider...";
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
let items: KeyedQuickPickItem[] = [];
providers.forEach(provider => {
let label: string = provider.name;
if (provider.extensionId === currentProvider) {
label += " (active)";
}
items.push({ label: label, description: "", key: provider.extensionId });
});
items.push({ label: "(none)", description: "Disable the active configuration provider, if applicable.", key: "" });
return vscode.window.showQuickPick(items, options)
.then(selection => (selection) ? selection.key : undefined);
}
public showCompileCommands(paths: string[]): Thenable<number> {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select a compile_commands.json...";
let items: IndexableQuickPickItem[] = [];
for (let i: number = 0; i < paths.length; i++) {
items.push({label: paths[i], description: "", index: i});
}
return vscode.window.showQuickPick(items, options)
.then(selection => (selection) ? selection.index : -1);
}
public showWorkspaces(workspaceNames: { name: string; key: string }[]): Thenable<string> {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select a Workspace...";
let items: KeyedQuickPickItem[] = [];
workspaceNames.forEach(name => items.push({ label: name.name, description: "", key: name.key }));
return vscode.window.showQuickPick(items, options)
.then(selection => (selection) ? selection.key : "");
}
public showParsingCommands(): Thenable<number> {
let options: vscode.QuickPickOptions = {};
options.placeHolder = "Select a parsing command...";
let items: IndexableQuickPickItem[];
items = [];
if (this.browseEngineStatusBarItem.tooltip === "Parsing paused") {
items.push({ label: "Resume Parsing", description: "", index: 1 });
} else {
items.push({ label: "Pause Parsing", description: "", index: 0 });
}
return vscode.window.showQuickPick(items, options)
.then(selection => (selection) ? selection.index : -1);
}
public showConfigureIncludePathMessage(prompt: () => Thenable<boolean>, onSkip: () => void): void {
setTimeout(() => {
this.showConfigurationPrompt(ConfigurationPriority.IncludePath, prompt, onSkip);
}, 10000);
}
public showConfigureCompileCommandsMessage(prompt: () => Thenable<boolean>, onSkip: () => void): void {
setTimeout(() => {
this.showConfigurationPrompt(ConfigurationPriority.CompileCommands, prompt, onSkip);
}, 5000);
}
public showConfigureCustomProviderMessage(prompt: () => Thenable<boolean>, onSkip: () => void): void {
this.showConfigurationPrompt(ConfigurationPriority.CustomProvider, prompt, onSkip);
}
private showConfigurationPrompt(priority: ConfigurationPriority, prompt: () => Thenable<boolean>, onSkip: () => void): void {
let showPrompt: () => Thenable<ConfigurationResult> = async () => {
let configured: boolean = await prompt();
return Promise.resolve({
priority: priority,
configured: configured
});
};
if (this.configurationUIPromise) {
this.configurationUIPromise = this.configurationUIPromise.then(result => {
if (priority > result.priority) {
return showPrompt();
} else if (!result.configured) {
return showPrompt();
}
onSkip();
return Promise.resolve({
priority: result.priority,
configured: true
});
});
} else {
this.configurationUIPromise = showPrompt();
}
}
public dispose(): void {
this.configStatusBarItem.dispose();
this.browseEngineStatusBarItem.dispose();
this.intelliSenseStatusBarItem.dispose();
this.navigationStatusBarItem.dispose();
}
}
export function getUI(): UI {
if (ui === undefined) {
ui = new UI();
}
return ui;
}
+120
View File
@@ -0,0 +1,120 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved.
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as util from './common';
import * as Telemetry from './telemetry';
import { PersistentState } from './LanguageServer/persistentState';
import * as fs from 'fs';
const userBucketMax: number = 100;
const userBucketString: string = "CPP.UserBucket";
const localConfigFile: string = "cpptools.json";
interface Settings {
defaultIntelliSenseEngine?: number;
recursiveIncludes?: number;
gotoDefIntelliSense?: number;
enhancedColorization?: number;
}
export class ABTestSettings {
private settings: Settings;
private intelliSenseEngineDefault: PersistentState<number>;
private recursiveIncludesDefault: PersistentState<number>;
private gotoDefIntelliSenseDefault: PersistentState<number>;
private enhancedColorizationDefault: PersistentState<number>;
private bucket: PersistentState<number>;
constructor() {
this.intelliSenseEngineDefault = new PersistentState<number>("ABTest.1", 100);
this.recursiveIncludesDefault = new PersistentState<number>("ABTest.2", 100);
this.gotoDefIntelliSenseDefault = new PersistentState<number>("ABTest.3", 100);
this.enhancedColorizationDefault = new PersistentState<number>("ABTest.4", 100);
this.settings = {
defaultIntelliSenseEngine: this.intelliSenseEngineDefault.Value,
recursiveIncludes: this.recursiveIncludesDefault.Value,
gotoDefIntelliSense: this.gotoDefIntelliSenseDefault.Value,
enhancedColorization: this.enhancedColorizationDefault.Value
};
this.bucket = new PersistentState<number>(userBucketString, -1);
if (this.bucket.Value === -1) {
this.bucket.Value = Math.floor(Math.random() * userBucketMax) + 1; // Range is [1, userBucketMax].
}
this.updateSettings();
// Redownload cpptools.json after initialization so it's not blocked.
// It'll be used the next time the extension reloads.
this.downloadCpptoolsJsonPkgAsync();
// Redownload occasionally to prevent an extra reload during long sessions.
setInterval(() => { this.downloadCpptoolsJsonPkgAsync(); }, 30 * 60 * 1000); // 30 minutes.
}
public get UseDefaultIntelliSenseEngine(): boolean {
return util.isNumber(this.settings.defaultIntelliSenseEngine) ? this.settings.defaultIntelliSenseEngine >= this.bucket.Value : true;
}
public get UseRecursiveIncludes(): boolean {
return util.isNumber(this.settings.recursiveIncludes) ? this.settings.recursiveIncludes >= this.bucket.Value : true;
}
public get UseGoToDefIntelliSense(): boolean {
return util.isNumber(this.settings.gotoDefIntelliSense) ? this.settings.gotoDefIntelliSense >= this.bucket.Value : true;
}
public get UseEnhancedColorization(): boolean {
return util.isNumber(this.settings.enhancedColorization) ? this.settings.enhancedColorization >= this.bucket.Value : true;
}
private updateSettings(): void {
const cpptoolsJsonFile: string = util.getExtensionFilePath(localConfigFile);
try {
const exists: boolean = fs.existsSync(cpptoolsJsonFile);
if (exists) {
const fileContent: string = fs.readFileSync(cpptoolsJsonFile).toString();
let newSettings: Settings = <Settings>JSON.parse(fileContent);
this.intelliSenseEngineDefault.Value = util.isNumber(newSettings.defaultIntelliSenseEngine) ? newSettings.defaultIntelliSenseEngine : this.intelliSenseEngineDefault.DefaultValue;
this.recursiveIncludesDefault.Value = util.isNumber(newSettings.recursiveIncludes) ? newSettings.recursiveIncludes : this.recursiveIncludesDefault.DefaultValue;
this.gotoDefIntelliSenseDefault.Value = util.isNumber(newSettings.gotoDefIntelliSense) ? newSettings.gotoDefIntelliSense : this.gotoDefIntelliSenseDefault.DefaultValue;
this.enhancedColorizationDefault.Value = util.isNumber(newSettings.enhancedColorization) ? newSettings.enhancedColorization : this.enhancedColorizationDefault.DefaultValue;
this.settings = {
defaultIntelliSenseEngine: this.intelliSenseEngineDefault.Value,
recursiveIncludes: this.recursiveIncludesDefault.Value,
gotoDefIntelliSense: this.gotoDefIntelliSenseDefault.Value,
enhancedColorization: this.enhancedColorizationDefault.Value
};
}
} catch (error) {
// Ignore any cpptoolsJsonFile errors
}
}
private downloadCpptoolsJsonPkgAsync(): Promise<void> {
let hasError: boolean = false;
let telemetryProperties: { [key: string]: string } = {};
const localConfigPath: string = util.getExtensionFilePath(localConfigFile);
return util.downloadFileToDestination("https://go.microsoft.com/fwlink/?linkid=2097702", localConfigPath)
.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(() => {
this.updateSettings();
telemetryProperties['success'] = (!hasError).toString();
Telemetry.logDebuggerEvent("cpptoolsJsonDownload", telemetryProperties);
});
}
}
let settings: ABTestSettings;
export function getABTestSettings(): ABTestSettings {
if (!settings) {
settings = new ABTestSettings();
}
return settings;
}

Some files were not shown because too many files have changed in this diff Show More