Merge for 0.25.0 release.
This commit is contained in:
@@ -6,9 +6,14 @@ about: Issues pertaining to debugging such as call stack, breakpoints, watch win
|
||||
---
|
||||
|
||||
Type: Debugger
|
||||
**Input information below**
|
||||
<!----- 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.**
|
||||
<!--
|
||||
**Prior to filing an issue, please review:**
|
||||
- Existing issues at https://github.com/Microsoft/vscode-cpptools/issues
|
||||
- Our documentation at https://code.visualstudio.com/docs/languages/cpp
|
||||
- FAQs at https://code.visualstudio.com/docs/cpp/faq-cpp
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
- OS and Version:
|
||||
|
||||
@@ -5,9 +5,14 @@ about: Issues pertaining to downloading, installing, or building the extension.
|
||||
---
|
||||
|
||||
Type: General
|
||||
**Input information below**
|
||||
<!----- 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.**
|
||||
<!--
|
||||
**Prior to filing an issue, please review:**
|
||||
- Existing issues at https://github.com/Microsoft/vscode-cpptools/issues
|
||||
- Our documentation at https://code.visualstudio.com/docs/languages/cpp
|
||||
- FAQs at https://code.visualstudio.com/docs/cpp/faq-cpp
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
- OS and Version:
|
||||
|
||||
@@ -8,7 +8,10 @@ about: 'Issues pertaining to IntelliSense, autocomplete, code editing, etc. '
|
||||
<!----- 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.**
|
||||
**Prior to filing an issue, please review:**
|
||||
- Existing issues at https://github.com/Microsoft/vscode-cpptools/issues
|
||||
- Our documentation at https://code.visualstudio.com/docs/languages/cpp
|
||||
- FAQs at https://code.visualstudio.com/docs/cpp/faq-cpp
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
@@ -1,54 +1 @@
|
||||
# Pipe Transport
|
||||
|
||||
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:
|
||||
```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:
|
||||
```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, **launch.json** will include:
|
||||
|
||||
```json
|
||||
"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/).
|
||||
The documentation for pipe transport has moved to https://code.visualstudio.com/docs/cpp/pipe-transport.
|
||||
@@ -1,91 +1 @@
|
||||
# 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)](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 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.
|
||||
|
||||
**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.
|
||||
|
||||
```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 <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.
|
||||
|
||||
```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:\\"
|
||||
}
|
||||
}
|
||||
```
|
||||
The documentation for GCC on Windows Subsystem for Linux (WSL) has moved to https://code.visualstudio.com/docs/cpp/config-wsl.
|
||||
@@ -1,15 +1 @@
|
||||
# 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).
|
||||
The documentation for Natvis has moved to https://code.visualstudio.com/docs/cpp/natvis.
|
||||
+1
-102
@@ -1,102 +1 @@
|
||||
# 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.
|
||||
The FAQs for the C/C++ extension has moved to https://code.visualstudio.com/docs/cpp/faq-cpp.
|
||||
@@ -1,56 +1,3 @@
|
||||
This file is deprecated.
|
||||
|
||||
# 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.
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
|
||||

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

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

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

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

|
||||
|
||||
## Verify the include paths are correctly resolved
|
||||
|
||||
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)
|
||||
Please find documentation for the C/C++ extension at https://code.visualstudio.com/docs/languages/cpp.
|
||||
@@ -1,99 +1 @@
|
||||
# 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.
|
||||
The documentation for customizing default settings has moved to https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp.
|
||||
@@ -1,12 +1 @@
|
||||
# How to enable logging in the extension
|
||||
|
||||
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"` or `"C_Cpp.loggingLevel": "Debug"` to your **settings.json**.
|
||||
|
||||

|
||||
|
||||
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:
|
||||
|
||||

|
||||
|
||||
The documentation for logging has moved to https://code.visualstudio.com/docs/cpp/enable-logging-cpp.
|
||||
@@ -1,71 +1 @@
|
||||
# Frequently asked questions
|
||||
|
||||
* [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)
|
||||
|
||||
## Why are my files corrupted on format?
|
||||
|
||||
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:
|
||||
|
||||
1. Update your `includePath` (and preprocessor defines)
|
||||
2. Force semantic IntelliSense
|
||||
|
||||
#### 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.
|
||||
|
||||
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.
|
||||
|
||||
#### Force semantic IntelliSense
|
||||
|
||||
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?
|
||||
|
||||
The page discussing configuration with MinGW is [here](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md).
|
||||
|
||||
## How do I get the new IntelliSense to work with the Windows Subsystem for Linux?
|
||||
|
||||
The page discussing configuration with WSL is [here](https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Windows%20Subsystem%20for%20Linux.md).
|
||||
|
||||
## What is the difference between `"includePath"` and `"browse.path"` in **c_cpp_properties.json**?
|
||||
|
||||
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 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"`.
|
||||
|
||||
* #### `"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.
|
||||
|
||||
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?
|
||||
|
||||
Starting in version 0.12.3 of the extension, we added a command that will reset your IntelliSense database. Open the command palette and choose the "C/Cpp: Reset IntelliSense Database" command.
|
||||
The FAQs for the C/C++ extension has moved to https://code.visualstudio.com/docs/cpp/faq-cpp.
|
||||
@@ -1,44 +0,0 @@
|
||||
# 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)
|
||||
@@ -1,31 +1,2 @@
|
||||
# MinGW
|
||||
|
||||
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
|
||||
{
|
||||
"name": "MinGW",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"compilerPath": "C:/mingw64/bin/gcc.exe",
|
||||
"includePath": [
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"defines": [],
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++17"
|
||||
}
|
||||
```
|
||||
|
||||
Replace "gcc.exe" with whatever compiler you're using, e.g. "g++.exe", "clang-5.0.exe", etc. -- just make sure the file is a valid Windows executable (not a 0 size symlink).
|
||||
|
||||
For Cygwin, set the `compilerPath` to the appropriate Cygwin path, e.g. "C:/cygwin64/bin/g++.exe".
|
||||
|
||||
If it seems like the `compilerPath` is not getting used, you can debug the issue via [enabling logging](Enabling%20logging.md).
|
||||
|
||||
## Extension version 0.16.1 and earlier:
|
||||
|
||||
If you have an older version of the C/C++ extension installed, use [these instructions](Archive/MinGW.md) instead.
|
||||
The documentation for Mingw-w64 has moved to https://code.visualstudio.com/docs/cpp/config-mingw.
|
||||
@@ -1,33 +1 @@
|
||||
# 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.
|
||||
|
||||
## With extension version 0.17.0 and higher:
|
||||
|
||||
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": "gcc-x64",
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": [],
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++17"
|
||||
}
|
||||
```
|
||||
|
||||
## Earlier versions of the extension:
|
||||
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
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/)!
|
||||
The documentation for GCC on Windows Subsystem for Linux (WSL) has moved to https://code.visualstudio.com/docs/cpp/config-wsl.
|
||||
@@ -1,100 +1 @@
|
||||
# `c_cpp_properties.json` Reference Guide
|
||||
|
||||
> See also: [Customizing Default Settings](Customizing%20Default%20Settings.md)
|
||||
|
||||
### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"env" : {
|
||||
"myDefaultIncludePath": [
|
||||
"${workspaceFolder}",
|
||||
"${workspaceFolder}/include"
|
||||
],
|
||||
"myCompilerPath": "/usr/local/bin/gcc-7"
|
||||
},
|
||||
"configurations": [
|
||||
{
|
||||
"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": [ "${workspaceFolder}" ],
|
||||
"limitSymbolsToIncludedHeaders": true,
|
||||
"databaseFilename": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
```
|
||||
|
||||
## Top-level properties
|
||||
|
||||
* #### `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.
|
||||
|
||||
* #### `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.
|
||||
|
||||
* #### `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. 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.
|
||||
|
||||
* #### `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.
|
||||
|
||||
* #### `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.
|
||||
|
||||
* #### `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.
|
||||
|
||||
* #### `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. 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 `${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 `${workspaceFolder}` variable can be used to specify a path relative to the workspace folder (e.g. `${workspaceFolder}/.vscode/browse.vc.db`)
|
||||
The documentation for c_cpp_properties.json has moved to https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference.
|
||||
@@ -1,511 +1 @@
|
||||
|
||||
# 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.type.class.templated |
|
||||
| Enumerator | variable.other.enummember |
|
||||
| Event (C++/CLI) | variable.other.event |
|
||||
| Function | entity.name.function |
|
||||
| Function Template | entity.name.function.templated |
|
||||
| Generic Type (C++/CLI) | entity.name.type.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.property |
|
||||
| Member Function | entity.name.function.member |
|
||||
| Namespace | entity.name.namespace |
|
||||
| New / Delete | keyword.operator.new |
|
||||
| Operator Overload Function | entity.name.function.operator |
|
||||
| Operator Overload Member | entity.name.function.operator.member |
|
||||
| Parameter | variable.parameter |
|
||||
| Property (C++/CLI) | variable.other.property.cli |
|
||||
| Reference Type (C++/CLI) | entity.name.type.class.reference |
|
||||
| Static Member Field | variable.other.property.static |
|
||||
| Static Member Function | entity.name.function.member.static |
|
||||
| Type | entity.name.type.class |
|
||||
| User-Defined Literal - Number | entity.name.operator.custom-literal.number |
|
||||
| User-Defined Literal - Raw | entity.name.operator.custom-literal |
|
||||
| User-Defined Literal - String | entity.name.operator.custom-literal.string |
|
||||
| Value Type (C++/CLI) | entity.name.type.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.class",
|
||||
"settings": {
|
||||
"foreground": "#FF0000",
|
||||
"fontStyle": "italic bold underline"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Or, overridden on a per-theme basis:
|
||||
```
|
||||
"editor.tokenColorCustomizations": {
|
||||
"[Visual Studio Dark]": {
|
||||
"textMateRules": [
|
||||
{
|
||||
"scope": "entity.name.type.class",
|
||||
"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.class",
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.reference",
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.value",
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.member",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.property",
|
||||
"settings": {
|
||||
"foreground": "#DADADA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.member.static",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.property.static",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.event",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.templated",
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.generic",
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.templated",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.namespace",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal",
|
||||
"settings": {
|
||||
"foreground": "#DADADA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal.string",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-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.class",
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.reference",
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.value",
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.member",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.property",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.member.static",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.property.static",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.event",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.templated",
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.class.generic",
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.templated",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.type.namespace",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal.string",
|
||||
"settings": {
|
||||
"foreground": "#A31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-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"
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
````
|
||||
The documentation for enhanced colorization has moved to https://code.visualstudio.com/docs/cpp/colorization-cpp.
|
||||
+42
-1
@@ -1,5 +1,46 @@
|
||||
# C/C++ for Visual Studio Code Change Log
|
||||
|
||||
## Version 0.25.0: August 21, 2019
|
||||
### New Features
|
||||
* Add `Find All References`. [#15](https://github.com/microsoft/vscode-cpptools/issues/15)
|
||||
* Add `-x86` options for `intelliSenseMode`. [#2275](https://github.com/microsoft/vscode-cpptools/issues/2275), [#2312](https://github.com/microsoft/vscode-cpptools/issues/2312)
|
||||
* Add `c++20` option to `cppStandard`. [#3448](https://github.com/microsoft/vscode-cpptools/issues/3448)
|
||||
* Add a code action for resolving missing includes via the `vcpkg` dependency manager. [PR #3791](https://github.com/microsoft/vscode-cpptools/pull/3791)
|
||||
|
||||
### Enhancements
|
||||
* Added support for compile commands:
|
||||
* `-iquote`. [#2088](https://github.com/microsoft/vscode-cpptools/issues/2088)
|
||||
* `-imacros`. [#2417](https://github.com/microsoft/vscode-cpptools/issues/2417)
|
||||
* `-idirafter`(`--include-directory-after` & `--include-directory-after=`). [#3713](https://github.com/microsoft/vscode-cpptools/issues/3713)
|
||||
* `-imsvc`. [#4032](https://github.com/microsoft/vscode-cpptools/issues/4032)
|
||||
* Switch to using VS Code's `Go to Declaration`. [#2959](https://github.com/microsoft/vscode-cpptools/issues/2959)
|
||||
* Added `compilerArgs` property setting. [PR #3950](https://github.com/microsoft/vscode-cpptools/pull/3950)
|
||||
* Added support for V3 API. [#3987](https://github.com/microsoft/vscode-cpptools/pull/3987)
|
||||
* Add `not supported` messages for ARM and Alpine containers. [PR #4027](https://github.com/microsoft/vscode-cpptools/pull/4027)
|
||||
* Add validation for paths from `env` variables. [#3912](https://github.com/microsoft/vscode-cpptools/issues/3912)
|
||||
|
||||
### Bug Fixes
|
||||
* Fix wrong type of `this` pointer. [#2303](https://github.com/microsoft/vscode-cpptools/issues/2303)
|
||||
* Fix previous cache path not deleted when new cache path is specified. Note that the VS Code bug [Microsoft/vscode#59391](https://github.com/microsoft/vscode/issues/59391) still occurs on the settings UI, but this fix should delete any incomplete path names as the extension receives changes from the cache path setting. [#3644](https://github.com/microsoft/vscode-cpptools/issues/3644).
|
||||
* Fix broken shell script when launch/attaching as root. [#3711](https://github.com/microsoft/vscode-cpptools/issues/3711)
|
||||
* Christian A. Jacobsen (@ChristianJacobsen) [PR MIEngine#906](https://github.com/microsoft/MIEngine/pull/906)
|
||||
* Fix ".H" files not appearing in include completion results on Linux/macOS. [#3744](https://github.com/microsoft/vscode-cpptools/issues/3744)
|
||||
* Fix `compile_commands.json` file changes not updated. [#3864](https://github.com/microsoft/vscode-cpptools/issues/3864).
|
||||
* Fix `Failed to parse` error message in the open file scenario. [#3888](https://github.com/microsoft/vscode-cpptools/issues/3888)
|
||||
* Fix loading the wrong symbols when creating or copying a file. [#3897](https://github.com/microsoft/vscode-cpptools/issues/3897)
|
||||
* Fix IntelliSense process crash in clang mode. [#3898](https://github.com/microsoft/vscode-cpptools/issues/3898)
|
||||
* Fix IntelliSense-based `Go to Definition` failing with `using namespace`. [#3902](https://github.com/microsoft/vscode-cpptools/issues/3902), [#4018](https://github.com/microsoft/vscode-cpptools/issues/4018)
|
||||
* Fix completion not showing results for smart pointers. [#3926](https://github.com/microsoft/vscode-cpptools/issues/3926), [#3930](https://github.com/microsoft/vscode-cpptools/issues/3930)
|
||||
* Fix `clang_format_path` cannot be set in workspace settings. [#3937](https://github.com/microsoft/vscode-cpptools/issues/3937)
|
||||
* Fix typos and grammar in documentation.
|
||||
* @pi1024e [PR #4014](https://github.com/microsoft/vscode-cpptools/pull/4014)
|
||||
* Fix NullReferenceException when unable to launch and an unresolved parameter exists in the string. This was causing a useless error message. [#4024](https://github.com/microsoft/vscode-cpptools/issues/4024), [#4090](https://github.com/microsoft/vscode-cpptools/issues/4090)
|
||||
* Fix debugger can't debug file whose folder path includes a parenthesis. [#4030](https://github.com/microsoft/vscode-cpptools/issues/4030)
|
||||
* Fix duplicate content appearing after formatting of a new file. [#4091](https://github.com/microsoft/vscode-cpptools/issues/4091)
|
||||
* Fix `files.exclude` bug on Windows. [#4095](https://github.com/microsoft/vscode-cpptools/issues/4095)
|
||||
* Fix NullReferenceException when `cwd` is null. [MIEngine#911](https://github.com/microsoft/MIEngine/issues/911)
|
||||
* Fix wrong IntelliSense for C++ types after editing within a function and after a lambda.
|
||||
|
||||
## Version 0.24.1: July 22, 2019
|
||||
### Bug Fixes
|
||||
* Fix an issue with the Outline not being populated when a file is opened. [#3877](https://github.com/microsoft/vscode-cpptools/issues/3877)
|
||||
@@ -11,7 +52,7 @@
|
||||
* Add `Rescan Workspace` command. [microsoft/vscode-cpptools-api#11](https://github.com/microsoft/vscode-cpptools-api/issues/11)
|
||||
|
||||
### Enhancements
|
||||
* Configuration UI editor improvements:
|
||||
* 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)
|
||||
|
||||
+58
-31
@@ -1,39 +1,66 @@
|
||||
# C/C++ for Visual Studio Code
|
||||
|
||||
### [Repository](https://github.com/microsoft/vscode-cpptools) | [Issues](https://github.com/microsoft/vscode-cpptools/issues) | [Documentation](https://github.com/microsoft/vscode-cpptools/tree/master/Documentation) | [Code Samples](https://github.com/microsoft/vscode-cpptools/tree/master/Code%20Samples) | [Offline Installers](https://github.com/microsoft/vscode-cpptools/releases)
|
||||
#### [Repository](https://github.com/microsoft/vscode-cpptools) | [Issues](https://github.com/microsoft/vscode-cpptools/issues) | [Documentation](https://code.visualstudio.com/docs/languages/cpp) | [Code Samples](https://github.com/microsoft/vscode-cpptools/tree/master/Code%20Samples) | [Offline Installers](https://github.com/microsoft/vscode-cpptools/releases)
|
||||
|
||||
[](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).
|
||||
This preview release of the C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging.
|
||||
|
||||
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).
|
||||
## Overview and getting started
|
||||
* [C/C++ extension overview](https://code.visualstudio.com/docs/languages/cpp)
|
||||
* [Get Started with C++ and Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/cpp/config-wsl)
|
||||
* [Get Started with C++ and Mingw-w64](https://code.visualstudio.com/docs/cpp/config-mingw)
|
||||
* [Get Started with C++ and Clang/LLVM on macOS](https://code.visualstudio.com/docs/cpp/config-clang-mac)
|
||||
* [Get Started with C++ and Microsoft C++ compiler (MSVC)](https://code.visualstudio.com/docs/cpp/config-msvc)
|
||||
|
||||
## 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
|
||||
## Quick links
|
||||
* [Editing features (IntelliSense)](https://code.visualstudio.com/docs/cpp/cpp-ide)
|
||||
* [IntelliSense configuration](https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp)
|
||||
* [Enhanced colorization](https://code.visualstudio.com/docs/cpp/colorization-cpp)
|
||||
* [Debugging](https://code.visualstudio.com/docs/cpp/cpp-debug)
|
||||
* [Debug configuration](https://code.visualstudio.com/docs/cpp/launch-json-reference)
|
||||
* [Enable logging for IntelliSense or debugging](https://code.visualstudio.com/docs/cpp/enable-logging-cpp)
|
||||
|
||||
## 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 haven’t already provided us feedback, please take this [quick survey](https://www.research.net/r/VBVV6C6) and let us know what you think!
|
||||
## Questions and feedback
|
||||
|
||||
**[FAQs](https://code.visualstudio.com/docs/cpp/faq-cpp)**
|
||||
<br>
|
||||
Check out the FAQs before filing a question.
|
||||
<br>
|
||||
|
||||
**[Provide feedback](https://github.com/microsoft/vscode-cpptools/issues/new/choose)**
|
||||
<br>
|
||||
File questions, issues, or feature requests for the extension.
|
||||
<br>
|
||||
|
||||
**[Known issues](https://github.com/Microsoft/vscode-cpptools/issues)**
|
||||
<br>
|
||||
If someone has already filed an issue that encompasses your feedback, please leave a 👍 or 👎 reaction on the issue to upvote or downvote it to help us prioritize the issue.
|
||||
<br>
|
||||
|
||||
**[Quick survey](https://www.research.net/r/VBVV6C6)**
|
||||
<br>
|
||||
Let us know what you think of the extension by taking the quick survey.
|
||||
|
||||
## Offline installation
|
||||
|
||||
The extension has platform-specific binary dependencies, therefore installation via the Marketplace requires an Internet connection in order to download additional dependencies. 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 platform-specific packages and install them by running VS Code's `"Install from VSIX..."` command. These "offline' packages are available at: https://github.com/Microsoft/vscode-cpptools/releases.
|
||||
|
||||
Package | Platform
|
||||
:--- | :---
|
||||
`cpptools-linux.vsix` | Linux 64-bit
|
||||
`cpptools-linux32.vsix` | Linux 32-bit
|
||||
`cpptools-osx.vsix` | macOS
|
||||
`cpptools-win32.vsix` | Windows 64-bit & 32-bit
|
||||
|
||||
## Contribution
|
||||
|
||||
Contributions are always welcome. Please see our [contributing guide](CONTRIBUTING.md) for more details.
|
||||
|
||||
## 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.
|
||||
|
||||
## Data and telemetry
|
||||
|
||||
This extension collects usage data and sends it to Microsoft to help improve our products and services. Collection of telemetry is controlled via the same setting provided by Visual Studio Code: `"telemetry.enableTelemetry"`. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
|
||||
@@ -1,264 +0,0 @@
|
||||
<!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>
|
||||
+1715
-40
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"defaults": [
|
||||
"-D_MSC_EXTENSIONS",
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_IX86=600",
|
||||
"-D_M_IX86_FP=2"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -4,11 +4,11 @@
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1914",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_MSC_VER=1914",
|
||||
"-D_MSC_FULL_VER=191426428",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_IX86=600",
|
||||
"-D_M_IX86_FP=2"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaults": [
|
||||
"--pack_alignment",
|
||||
"8"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"defaults": [
|
||||
"-D_MSC_EXTENSIONS",
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_IX86=600",
|
||||
"-D_M_IX86_FP=2"
|
||||
],
|
||||
"defaults_op" : "merge"
|
||||
}
|
||||
@@ -4,12 +4,12 @@
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1914",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_CPPUNWIND=1",
|
||||
"-D_MSC_VER=1914",
|
||||
"-D_MSC_FULL_VER=191426428",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_X64=100",
|
||||
"-D_M_AMD64=100"
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1914",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_CPPUNWIND=1",
|
||||
"-D_MSC_VER=1914",
|
||||
"-D_MSC_FULL_VER=191426428",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_X64=100",
|
||||
"-D_M_AMD64=100"
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
"--microsoft",
|
||||
"--microsoft_bugs",
|
||||
"--microsoft_version",
|
||||
"1914",
|
||||
"1923",
|
||||
"--pack_alignment",
|
||||
"8",
|
||||
"-D_CPPUNWIND=1",
|
||||
"-D_MSC_VER=1914",
|
||||
"-D_MSC_FULL_VER=191426428",
|
||||
"-D_MSC_VER=1923",
|
||||
"-D_MSC_FULL_VER=192327820",
|
||||
"-D_MSC_BUILD=0",
|
||||
"-D_M_X64=100",
|
||||
"-D_M_AMD64=100"
|
||||
|
||||
@@ -15,9 +15,16 @@
|
||||
"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.",
|
||||
"description": "Full path of the compiler being used, e.g. /usr/bin/gcc, to enable more accurate IntelliSense.",
|
||||
"type": "string"
|
||||
},
|
||||
"compilerArgs": {
|
||||
"description": "Compiler arguments to modify the includes or defines used, e.g. -nostdinc++, -m32, etc.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"cStandard": {
|
||||
"description": "Version of the C language standard to use for IntelliSense.",
|
||||
"type": "string",
|
||||
@@ -37,6 +44,7 @@
|
||||
"c++11",
|
||||
"c++14",
|
||||
"c++17",
|
||||
"c++20",
|
||||
"${default}"
|
||||
]
|
||||
},
|
||||
@@ -71,12 +79,15 @@
|
||||
}
|
||||
},
|
||||
"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.",
|
||||
"description": "The IntelliSense mode to use that maps to an architecture-specific variant of MSVC, gcc, or Clang. If not set or if set to ${default}, the extension will choose the default for that platform. Windows defaults to msvc-x64, Linux defaults to gcc-x64, and macOS defaults to clang-x64.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"msvc-x64",
|
||||
"gcc-x64",
|
||||
"clang-x64",
|
||||
"msvc-x86",
|
||||
"gcc-x86",
|
||||
"clang-x86",
|
||||
"${default}"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "C",
|
||||
"scopeName": "source.c",
|
||||
"version": "0",
|
||||
"information_for_contributors": [
|
||||
],
|
||||
"patterns": [
|
||||
],
|
||||
"repository": {
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "C++",
|
||||
"scopeName": "source.cpp",
|
||||
"version": "0",
|
||||
"information_for_contributors": [
|
||||
],
|
||||
"patterns": [
|
||||
],
|
||||
"repository": {
|
||||
}
|
||||
}
|
||||
Generated
+282
-175
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cpptools",
|
||||
"version": "0.24.0",
|
||||
"version": "0.25.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -24,6 +24,12 @@
|
||||
"js-tokens": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"@types/anymatch": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz",
|
||||
"integrity": "sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/fancy-log": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/fancy-log/-/fancy-log-1.3.0.tgz",
|
||||
@@ -36,6 +42,15 @@
|
||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/mkdirp": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz",
|
||||
"integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/mocha": {
|
||||
"version": "5.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
|
||||
@@ -43,11 +58,72 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz",
|
||||
"integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==",
|
||||
"version": "12.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.1.tgz",
|
||||
"integrity": "sha512-aK9jxMypeSrhiYofWWBf/T7O+KwaiAHzM4sveCdWPn71lzUSMimRnKzhXDKfKwV1kWoBo2P1aGgaIYGLf9/ljw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/plist": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/plist/-/plist-3.0.2.tgz",
|
||||
"integrity": "sha512-ULqvZNGMv0zRFvqn8/4LSPtnmN4MfhlPNtJCTpKuIIxGVGZ2rYWzFXrvEBoh9CVyqSE7D6YFRJ1hydLHI6kbWw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"xmlbuilder": ">=11.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"xmlbuilder": {
|
||||
"version": "13.0.2",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",
|
||||
"integrity": "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/tapable": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.4.tgz",
|
||||
"integrity": "sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/tmp": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.1.0.tgz",
|
||||
"integrity": "sha512-6IwZ9HzWbCq6XoQWhxLpDjuADodH/MKXRUIDFudvgjcVdjFknvmR+DNsoUeer4XPrEnrZs04Jj+kfV9pFsrhmA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/uglify-js": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.0.4.tgz",
|
||||
"integrity": "sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"@types/webpack": {
|
||||
"version": "4.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.32.1.tgz",
|
||||
"integrity": "sha512-9n38CBx9uga1FEAdTipnt0EkbKpsCJFh7xJb1LE65FFb/A6OOLFX022vYsGC1IyVCZ/GroNg9u/RMmlDxGcLIw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/anymatch": "*",
|
||||
"@types/node": "*",
|
||||
"@types/tapable": "*",
|
||||
"@types/uglify-js": "*",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"@types/yauzl": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz",
|
||||
"integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@webassemblyjs/ast": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
|
||||
@@ -237,15 +313,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
|
||||
"integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-dynamic-import": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz",
|
||||
"integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==",
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz",
|
||||
"integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==",
|
||||
"dev": true
|
||||
},
|
||||
"agent-base": {
|
||||
@@ -275,9 +345,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz",
|
||||
"integrity": "sha512-aUjdRFISbuFOl0EIZc+9e4FfZp0bDZgAdOOf30bJmw8VM9v84SHyVyxDfbWxpGYbdZD/9XoKxfHVNmxPkhwyGw==",
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz",
|
||||
"integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-colors": {
|
||||
@@ -339,13 +409,14 @@
|
||||
}
|
||||
},
|
||||
"applicationinsights": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.0.8.tgz",
|
||||
"integrity": "sha512-KzOOGdphOS/lXWMFZe5440LUdFbrLpMvh2SaRxn7BmiI550KAoSb2gIhiq6kJZ9Ir3AxRRztjhzif+e5P5IXIg==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-1.4.0.tgz",
|
||||
"integrity": "sha512-TV8MYb0Kw9uE2cdu4V/UvTKdOABkX2+Fga9iDz0zqV7FLrNXfmAugWZmmdTx4JoynYkln3d5CUHY3oVSUEbfFw==",
|
||||
"requires": {
|
||||
"cls-hooked": "^4.2.2",
|
||||
"continuation-local-storage": "^3.2.1",
|
||||
"diagnostic-channel": "0.2.0",
|
||||
"diagnostic-channel-publishers": "0.2.1",
|
||||
"zone.js": "0.7.6"
|
||||
"diagnostic-channel-publishers": "^0.3.2"
|
||||
}
|
||||
},
|
||||
"aproba": {
|
||||
@@ -555,6 +626,23 @@
|
||||
"integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
|
||||
"dev": true
|
||||
},
|
||||
"async-hook-jl": {
|
||||
"version": "1.7.6",
|
||||
"resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz",
|
||||
"integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==",
|
||||
"requires": {
|
||||
"stack-chain": "^1.3.7"
|
||||
}
|
||||
},
|
||||
"async-listener": {
|
||||
"version": "0.6.10",
|
||||
"resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
|
||||
"integrity": "sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw==",
|
||||
"requires": {
|
||||
"semver": "^5.3.0",
|
||||
"shimmer": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"async-settle": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz",
|
||||
@@ -653,9 +741,9 @@
|
||||
}
|
||||
},
|
||||
"base64-js": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
|
||||
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
|
||||
"dev": true
|
||||
},
|
||||
"bcrypt-pbkdf": {
|
||||
@@ -768,9 +856,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -856,9 +944,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"cacache": {
|
||||
"version": "11.3.3",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
|
||||
"integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
|
||||
"version": "12.0.2",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.2.tgz",
|
||||
"integrity": "sha512-ifKgxH2CKhJEg6tNdAwziu6Q33EvuG26tYcda6PT3WKisZcYDXsnEdnRv67Po3yCzFfaSoMjGZzJyD2c3DT1dg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bluebird": "^3.5.5",
|
||||
@@ -866,6 +954,7 @@
|
||||
"figgy-pudding": "^3.5.1",
|
||||
"glob": "^7.1.4",
|
||||
"graceful-fs": "^4.1.15",
|
||||
"infer-owner": "^1.0.3",
|
||||
"lru-cache": "^5.1.1",
|
||||
"mississippi": "^3.0.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
@@ -985,9 +1074,9 @@
|
||||
}
|
||||
},
|
||||
"chownr": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
|
||||
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz",
|
||||
"integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==",
|
||||
"dev": true
|
||||
},
|
||||
"chrome-trace-event": {
|
||||
@@ -1129,6 +1218,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"cls-hooked": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz",
|
||||
"integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==",
|
||||
"requires": {
|
||||
"async-hook-jl": "^1.7.6",
|
||||
"emitter-listener": "^1.0.1",
|
||||
"semver": "^5.4.1"
|
||||
}
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
@@ -1236,6 +1335,15 @@
|
||||
"integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
|
||||
"dev": true
|
||||
},
|
||||
"continuation-local-storage": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz",
|
||||
"integrity": "sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA==",
|
||||
"requires": {
|
||||
"async-listener": "^0.6.0",
|
||||
"emitter-listener": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"convert-source-map": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
|
||||
@@ -1486,9 +1594,9 @@
|
||||
}
|
||||
},
|
||||
"diagnostic-channel-publishers": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz",
|
||||
"integrity": "sha1-ji1geottef6IC1SLxYzGvrKIxPM="
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.3.2.tgz",
|
||||
"integrity": "sha512-2hBlg1BtBT+nd04MGGGZinDv5gOTRQOCzdgk+KRQZ20XJ/uepC0B0rwWLQtz6Tk6InXymWqsk1sMC975cPEReA=="
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.5.0",
|
||||
@@ -1560,6 +1668,14 @@
|
||||
"minimalistic-crypto-utils": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"emitter-listener": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz",
|
||||
"integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==",
|
||||
"requires": {
|
||||
"shimmer": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"emoji-regex": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||
@@ -2978,14 +3094,22 @@
|
||||
"dev": true
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
|
||||
"integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
|
||||
"integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
|
||||
"requires": {
|
||||
"agent-base": "^4.1.0",
|
||||
"agent-base": "^4.3.0",
|
||||
"debug": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"agent-base": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
|
||||
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
|
||||
"requires": {
|
||||
"es6-promisify": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
@@ -2995,9 +3119,9 @@
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3029,6 +3153,12 @@
|
||||
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
|
||||
"dev": true
|
||||
},
|
||||
"infer-owner": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
|
||||
"integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==",
|
||||
"dev": true
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
@@ -3537,9 +3667,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -3635,9 +3765,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -3878,9 +4008,9 @@
|
||||
}
|
||||
},
|
||||
"mixin-deep": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
|
||||
"integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
|
||||
"integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"for-in": "^1.0.2",
|
||||
@@ -4646,9 +4776,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.1.33",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.33.tgz",
|
||||
"integrity": "sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz",
|
||||
"integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==",
|
||||
"dev": true
|
||||
},
|
||||
"public-encrypt": {
|
||||
@@ -4666,9 +4796,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -4921,9 +5051,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -5102,26 +5232,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"set-value": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
|
||||
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
|
||||
"integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"extend-shallow": "^2.0.1",
|
||||
"is-extendable": "^0.1.1",
|
||||
"is-plain-object": "^2.0.3",
|
||||
"split-string": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"extend-shallow": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
|
||||
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-extendable": "^0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"setimmediate": {
|
||||
@@ -5155,6 +5274,11 @@
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||
"dev": true
|
||||
},
|
||||
"shimmer": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz",
|
||||
"integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw=="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
@@ -5403,6 +5527,11 @@
|
||||
"figgy-pudding": "^3.5.1"
|
||||
}
|
||||
},
|
||||
"stack-chain": {
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.7.tgz",
|
||||
"integrity": "sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU="
|
||||
},
|
||||
"stack-trace": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
|
||||
@@ -5596,14 +5725,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"terser": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.0.2.tgz",
|
||||
"integrity": "sha512-IWLuJqTvx97KP3uTYkFVn93cXO+EtlzJu8TdJylq+H0VBDlPMIfQA9MBS5Vc5t3xTEUG1q0hIfHMpAP2R+gWTw==",
|
||||
"version": "4.1.4",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-4.1.4.tgz",
|
||||
"integrity": "sha512-+ZwXJvdSwbd60jG0Illav0F06GDJF0R4ydZ21Q3wGAFKoBGyJGo34F63vzJHgvYxc1ukOtIjvwEvl9MkjzM6Pg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^2.19.0",
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.6.1",
|
||||
"source-map-support": "~0.5.10"
|
||||
"source-map-support": "~0.5.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
@@ -5615,20 +5744,19 @@
|
||||
}
|
||||
},
|
||||
"terser-webpack-plugin": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz",
|
||||
"integrity": "sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg==",
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz",
|
||||
"integrity": "sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cacache": "^11.3.2",
|
||||
"find-cache-dir": "^2.0.0",
|
||||
"cacache": "^12.0.2",
|
||||
"find-cache-dir": "^2.1.0",
|
||||
"is-wsl": "^1.1.0",
|
||||
"loader-utils": "^1.2.3",
|
||||
"schema-utils": "^1.0.0",
|
||||
"serialize-javascript": "^1.7.0",
|
||||
"source-map": "^0.6.1",
|
||||
"terser": "^4.0.0",
|
||||
"webpack-sources": "^1.3.0",
|
||||
"terser": "^4.1.2",
|
||||
"webpack-sources": "^1.4.0",
|
||||
"worker-farm": "^1.7.0"
|
||||
}
|
||||
},
|
||||
@@ -5665,9 +5793,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"timers-browserify": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz",
|
||||
"integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==",
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz",
|
||||
"integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"setimmediate": "^1.0.4"
|
||||
@@ -5955,9 +6083,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz",
|
||||
"integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==",
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz",
|
||||
"integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==",
|
||||
"dev": true
|
||||
},
|
||||
"unc-path-regex": {
|
||||
@@ -5990,44 +6118,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"union-value": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
|
||||
"integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=",
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
|
||||
"integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arr-union": "^3.1.0",
|
||||
"get-value": "^2.0.6",
|
||||
"is-extendable": "^0.1.1",
|
||||
"set-value": "^0.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"arr-union": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
|
||||
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
|
||||
"dev": true
|
||||
},
|
||||
"extend-shallow": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
|
||||
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-extendable": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"set-value": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
|
||||
"integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"extend-shallow": "^2.0.1",
|
||||
"is-extendable": "^0.1.1",
|
||||
"is-plain-object": "^2.0.1",
|
||||
"to-object-path": "^0.3.0"
|
||||
}
|
||||
}
|
||||
"set-value": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"unique-filename": {
|
||||
@@ -6283,9 +6382,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"vscode": {
|
||||
"version": "1.1.35",
|
||||
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.35.tgz",
|
||||
"integrity": "sha512-xPnxzQU40LOS2yPyzWW+WKpTV6qA3z16TcgpZ9O38UWLA157Zz4GxUx5H7Gd07pxzw0GqvusbF4D+5GBgNxvEQ==",
|
||||
"version": "1.1.36",
|
||||
"resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.36.tgz",
|
||||
"integrity": "sha512-cGFh9jmGLcTapCpPCKvn8aG/j9zVQ+0x5hzYJq5h5YyUXVGa1iamOaB2M2PZXoumQPES4qeAP1FwkI0b6tL4bQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"glob": "^7.1.2",
|
||||
@@ -6298,30 +6397,30 @@
|
||||
}
|
||||
},
|
||||
"vscode-cpptools": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-cpptools/-/vscode-cpptools-2.1.2.tgz",
|
||||
"integrity": "sha512-oMx/wsLQM6NggnmWn4t8lIrt1K7Zpl5G34zxNu+J6KHGnCxBzc+NHnxXS1Vu1hLxGWwANAvdxr3mEcA2LMe7hQ=="
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-cpptools/-/vscode-cpptools-3.0.1.tgz",
|
||||
"integrity": "sha512-KAbwWhG36Ahnug9frcCOvWI3dUb3mzWeTqB6NQjIkzAazRTJWT/PiZ7gxpY/+jQIUylbbiU9ezWmzIIm8nP+TQ=="
|
||||
},
|
||||
"vscode-debugadapter": {
|
||||
"version": "1.34.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.34.0.tgz",
|
||||
"integrity": "sha512-ye11QX9K4QA4TOuJHVusJenTuqh7GrCsLZJ7Gs86spOJ4WTTPd8wFLJBjL5ivkCUln/Tyo4HMkxlLBlTBtHdog==",
|
||||
"version": "1.35.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.35.0.tgz",
|
||||
"integrity": "sha512-Au90Iowj6TuD5uDMaTnxOjl/9hQN0Yoky1TV1Cjjr7jPdxTQpALBRW09Y2LzkIXUVICXlAqxWL9zL8BpzI30jg==",
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"vscode-debugprotocol": "1.34.0"
|
||||
"vscode-debugprotocol": "1.35.0"
|
||||
}
|
||||
},
|
||||
"vscode-debugprotocol": {
|
||||
"version": "1.34.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.34.0.tgz",
|
||||
"integrity": "sha512-tcMThtgk9TUtE8zzAIwPvHZfgnEYnVa7cI3YaQk/o54Q9cme+TLd/ao60a6ycj5rCrI/B5r/mAfeK5EKSItm7g=="
|
||||
"version": "1.35.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.35.0.tgz",
|
||||
"integrity": "sha512-+OMm11R1bGYbpIJ5eQIkwoDGFF4GvBz3Ztl6/VM+/RNNb2Gjk2c0Ku+oMmfhlTmTlPCpgHBsH4JqVCbUYhu5bA=="
|
||||
},
|
||||
"vscode-extension-telemetry": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.1.tgz",
|
||||
"integrity": "sha512-TkKKG/B/J94DP5qf6xWB4YaqlhWDg6zbbqVx7Bz//stLQNnfE9XS1xm3f6fl24c5+bnEK0/wHgMgZYKIKxPeUA==",
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.2.tgz",
|
||||
"integrity": "sha512-FSbaZKlIH3VKvBJsKw7v5bESWHXzltji2rtjaJeJglpQH4tfClzwHMzlMXUZGiblV++djEzb1gW8mb5E+wxFsg==",
|
||||
"requires": {
|
||||
"applicationinsights": "1.0.8"
|
||||
"applicationinsights": "1.4.0"
|
||||
}
|
||||
},
|
||||
"vscode-jsonrpc": {
|
||||
@@ -6381,41 +6480,54 @@
|
||||
}
|
||||
},
|
||||
"webpack": {
|
||||
"version": "4.35.2",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.35.2.tgz",
|
||||
"integrity": "sha512-TZAmorNymV4q66gAM/h90cEjG+N3627Q2MnkSgKlX/z3DlNVKUtqy57lz1WmZU2+FUZwzM+qm7cGaO95PyrX5A==",
|
||||
"version": "4.39.1",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.39.1.tgz",
|
||||
"integrity": "sha512-/LAb2TJ2z+eVwisldp3dqTEoNhzp/TLCZlmZm3GGGAlnfIWDgOEE758j/9atklNLfRyhKbZTCOIoPqLJXeBLbQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@webassemblyjs/ast": "1.8.5",
|
||||
"@webassemblyjs/helper-module-context": "1.8.5",
|
||||
"@webassemblyjs/wasm-edit": "1.8.5",
|
||||
"@webassemblyjs/wasm-parser": "1.8.5",
|
||||
"acorn": "^6.0.5",
|
||||
"acorn-dynamic-import": "^4.0.0",
|
||||
"ajv": "^6.1.0",
|
||||
"ajv-keywords": "^3.1.0",
|
||||
"chrome-trace-event": "^1.0.0",
|
||||
"acorn": "^6.2.1",
|
||||
"ajv": "^6.10.2",
|
||||
"ajv-keywords": "^3.4.1",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^4.1.0",
|
||||
"eslint-scope": "^4.0.0",
|
||||
"eslint-scope": "^4.0.3",
|
||||
"json-parse-better-errors": "^1.0.2",
|
||||
"loader-runner": "^2.3.0",
|
||||
"loader-utils": "^1.1.0",
|
||||
"memory-fs": "~0.4.1",
|
||||
"micromatch": "^3.1.8",
|
||||
"mkdirp": "~0.5.0",
|
||||
"neo-async": "^2.5.0",
|
||||
"node-libs-browser": "^2.0.0",
|
||||
"loader-runner": "^2.4.0",
|
||||
"loader-utils": "^1.2.3",
|
||||
"memory-fs": "^0.4.1",
|
||||
"micromatch": "^3.1.10",
|
||||
"mkdirp": "^0.5.1",
|
||||
"neo-async": "^2.6.1",
|
||||
"node-libs-browser": "^2.2.1",
|
||||
"schema-utils": "^1.0.0",
|
||||
"tapable": "^1.1.0",
|
||||
"terser-webpack-plugin": "^1.1.0",
|
||||
"watchpack": "^1.5.0",
|
||||
"webpack-sources": "^1.3.0"
|
||||
"tapable": "^1.1.3",
|
||||
"terser-webpack-plugin": "^1.4.1",
|
||||
"watchpack": "^1.6.0",
|
||||
"webpack-sources": "^1.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
|
||||
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"uri-js": "^4.2.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.5.tgz",
|
||||
"integrity": "sha512-w0j/s42c5UhchwTmV/45MLQnTVwRoaUTu9fM5LuyOd/8lFoCNCELDogFoecx5NzRUndO0yD/gF2b02XKMnmAWQ==",
|
||||
"version": "3.3.6",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.6.tgz",
|
||||
"integrity": "sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "2.4.2",
|
||||
@@ -6651,9 +6763,9 @@
|
||||
}
|
||||
},
|
||||
"webpack-sources": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz",
|
||||
"integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==",
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",
|
||||
"integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-list-map": "^2.0.0",
|
||||
@@ -6765,11 +6877,6 @@
|
||||
"buffer-crc32": "~0.2.3",
|
||||
"fd-slicer": "~1.1.0"
|
||||
}
|
||||
},
|
||||
"zone.js": {
|
||||
"version": "0.7.6",
|
||||
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.7.6.tgz",
|
||||
"integrity": "sha1-+7w50+AmHQmG8boGMG6zrrDSIAk="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+69
-89
@@ -2,7 +2,7 @@
|
||||
"name": "cpptools",
|
||||
"displayName": "C/C++",
|
||||
"description": "C/C++ IntelliSense, debugging, and code browsing.",
|
||||
"version": "0.24.1",
|
||||
"version": "0.25.0",
|
||||
"publisher": "ms-vscode",
|
||||
"preview": true,
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
@@ -73,7 +73,7 @@
|
||||
],
|
||||
"default": null,
|
||||
"description": "The full path of the clang-format executable.",
|
||||
"scope": "machine"
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.clang_format_style": {
|
||||
"type": "string",
|
||||
@@ -379,7 +379,10 @@
|
||||
"enum": [
|
||||
"msvc-x64",
|
||||
"gcc-x64",
|
||||
"clang-x64"
|
||||
"clang-x64",
|
||||
"msvc-x86",
|
||||
"gcc-x86",
|
||||
"clang-x86"
|
||||
],
|
||||
"default": null,
|
||||
"description": "The value to use in a configuration if \"intelliSenseMode\" is either not specified or set to \"${default}\".",
|
||||
@@ -394,6 +397,18 @@
|
||||
"description": "The value to use in a configuration if \"compilerPath\" is either not specified or set to \"${default}\".",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.default.compilerArgs": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": null,
|
||||
"description": "The value to use in configuration if \"compilerArgs\" is either not specified or set to \"${default}\".",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.default.cStandard": {
|
||||
"type": [
|
||||
"string",
|
||||
@@ -418,7 +433,8 @@
|
||||
"c++03",
|
||||
"c++11",
|
||||
"c++14",
|
||||
"c++17"
|
||||
"c++17",
|
||||
"c++20"
|
||||
],
|
||||
"default": null,
|
||||
"description": "The value to use in a configuration if \"cppStandard\" is either not specified or set to \"${default}\".",
|
||||
@@ -491,6 +507,16 @@
|
||||
"description": "Set to \"Insiders\" to automatically download and install the latest Insiders builds of the extension, which include upcoming features and bug fixes.",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.experimentalFeatures": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Enabled",
|
||||
"Disabled"
|
||||
],
|
||||
"default": "Disabled",
|
||||
"description": "Controls whether \"experimental\" features are usable.",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.suggestSnippets": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
@@ -506,6 +532,12 @@
|
||||
"default": "Enabled",
|
||||
"description": "If enabled, code is colorized based on IntelliSense. This setting has no effect if IntelliSense is disabled or if using the Default High Contrast theme.",
|
||||
"scope": "resource"
|
||||
},
|
||||
"C_Cpp.vcpkg.enabled": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"markdownDescription": "Enable integration services for the [vcpkg dependency manager](https://aka.ms/vcpkg/).",
|
||||
"scope": "resource"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -530,16 +562,6 @@
|
||||
"title": "%c_cpp.command.configurationEditUI.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.GoToDeclaration",
|
||||
"title": "%c_cpp.command.goToDeclaration.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.PeekDeclaration",
|
||||
"title": "%c_cpp.command.peekDeclaration.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.SwitchHeaderSource",
|
||||
"title": "%c_cpp.command.switchHeaderSource.title%",
|
||||
@@ -570,31 +592,11 @@
|
||||
"title": "%c_cpp.command.toggleDimInactiveRegions.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.ShowReleaseNotes",
|
||||
"title": "%c_cpp.command.showReleaseNotes.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.ResetDatabase",
|
||||
"title": "%c_cpp.command.resetDatabase.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.PauseParsing",
|
||||
"title": "%c_cpp.command.pauseParsing.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.ResumeParsing",
|
||||
"title": "%c_cpp.command.resumeParsing.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.ShowParsingCommands",
|
||||
"title": "%c_cpp.command.showParsingCommands.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.TakeSurvey",
|
||||
"title": "%c_cpp.command.takeSurvey.title%",
|
||||
@@ -614,29 +616,19 @@
|
||||
"command": "C_Cpp.RescanWorkspace",
|
||||
"title": "%c_cpp.command.rescanWorkspace.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.VcpkgClipboardInstallSuggested",
|
||||
"title": "%c_cpp.command.vcpkgClipboardInstallSuggested.title%",
|
||||
"category": "C/C++"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.VcpkgOnlineHelpSuggested",
|
||||
"title": "%c_cpp.command.vcpkgOnlineHelpSuggested.title%",
|
||||
"category": "C/C++"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "C_Cpp.GoToDeclaration",
|
||||
"key": "Ctrl+F12",
|
||||
"when": "editorTextFocus && editorLangId == 'cpp'"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.GoToDeclaration",
|
||||
"key": "Ctrl+F12",
|
||||
"when": "editorTextFocus && editorLangId == 'c'"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.PeekDeclaration",
|
||||
"key": "Ctrl+Alt+F12",
|
||||
"when": "editorTextFocus && editorLangId == 'cpp'"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.PeekDeclaration",
|
||||
"key": "Ctrl+Alt+F12",
|
||||
"when": "editorTextFocus && editorLangId == 'c'"
|
||||
},
|
||||
{
|
||||
"command": "C_Cpp.SwitchHeaderSource",
|
||||
"key": "Alt+O",
|
||||
@@ -1376,26 +1368,6 @@
|
||||
],
|
||||
"menus": {
|
||||
"editor/context": [
|
||||
{
|
||||
"when": "editorLangId == c",
|
||||
"command": "C_Cpp.GoToDeclaration",
|
||||
"group": "navigation@2"
|
||||
},
|
||||
{
|
||||
"when": "editorLangId == cpp",
|
||||
"command": "C_Cpp.GoToDeclaration",
|
||||
"group": "navigation@2"
|
||||
},
|
||||
{
|
||||
"when": "editorLangId == c",
|
||||
"command": "C_Cpp.PeekDeclaration",
|
||||
"group": "navigation@3"
|
||||
},
|
||||
{
|
||||
"when": "editorLangId == cpp",
|
||||
"command": "C_Cpp.PeekDeclaration",
|
||||
"group": "navigation@3"
|
||||
},
|
||||
{
|
||||
"when": "editorLangId == c",
|
||||
"command": "C_Cpp.SwitchHeaderSource",
|
||||
@@ -1454,6 +1426,9 @@
|
||||
},
|
||||
"[c]": {
|
||||
"editor.wordBasedSuggestions": false
|
||||
},
|
||||
"[Log]": {
|
||||
"editor.wordWrap": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1472,8 +1447,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@types/mkdirp": "^0.5.2",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "^12.0.10",
|
||||
"@types/node": "^12.7.1",
|
||||
"@types/plist": "^3.0.2",
|
||||
"@types/tmp": "^0.1.0",
|
||||
"@types/webpack": "^4.32.1",
|
||||
"@types/yauzl": "^2.9.1",
|
||||
"async-child-process": "^1.1.1",
|
||||
"await-notify": "^1.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
@@ -1484,32 +1464,32 @@
|
||||
"tslint": "^5.18.0",
|
||||
"tslint-microsoft-contrib": "^6.2.0",
|
||||
"tslint-no-unused-expression-chai": "^0.1.4",
|
||||
"typescript": "^3.5.2",
|
||||
"typescript": "^3.5.3",
|
||||
"vrsource-tslint-rules": "^6.0.0",
|
||||
"vscode": "^1.1.35",
|
||||
"webpack": "^4.35.2",
|
||||
"webpack-cli": "^3.3.5"
|
||||
"vscode": "^1.1.36",
|
||||
"webpack": "^4.39.1",
|
||||
"webpack-cli": "^3.3.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "^2.0.0",
|
||||
"http-proxy-agent": "^2.1.0",
|
||||
"https-proxy-agent": "^2.2.1",
|
||||
"https-proxy-agent": "^2.2.2",
|
||||
"jsonc-parser": "^2.1.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"plist": "^2.0.1",
|
||||
"tmp": "^0.1.0",
|
||||
"vscode-cpptools": "^2.1.2",
|
||||
"vscode-debugadapter": "^1.34.0",
|
||||
"vscode-debugprotocol": "^1.34.0",
|
||||
"vscode-extension-telemetry": "^0.1.1",
|
||||
"vscode-cpptools": "^3.0.1",
|
||||
"vscode-debugadapter": "^1.35.0",
|
||||
"vscode-debugprotocol": "^1.35.0",
|
||||
"vscode-extension-telemetry": "^0.1.2",
|
||||
"vscode-languageclient": "^5.2.1",
|
||||
"yauzl": "^2.10.0"
|
||||
},
|
||||
"runtimeDependencies": [
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86_64)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2092533",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2098277",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1523,7 +1503,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Linux / x86)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2092603",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2098276",
|
||||
"platforms": [
|
||||
"linux"
|
||||
],
|
||||
@@ -1539,7 +1519,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (OS X)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2092602",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2098195",
|
||||
"platforms": [
|
||||
"darwin"
|
||||
],
|
||||
@@ -1550,7 +1530,7 @@
|
||||
},
|
||||
{
|
||||
"description": "C/C++ language components (Windows)",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2092532",
|
||||
"url": "https://go.microsoft.com/fwlink/?linkid=2098194",
|
||||
"platforms": [
|
||||
"win32"
|
||||
],
|
||||
@@ -1671,4 +1651,4 @@
|
||||
"binaries": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,21 +3,17 @@
|
||||
"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"
|
||||
"c_cpp.command.rescanWorkspace.title": "Ripetere l'analisi dell'area di lavoro",
|
||||
"c_cpp.command.vcpkgClipboardInstallSuggested.title": "Copia il comando di installazione di vcpkg negli appunti",
|
||||
"c_cpp.command.vcpkgOnlineHelpSuggested.title": "Visita la pagina di aiuto di vcpkg"
|
||||
}
|
||||
@@ -3,21 +3,17 @@
|
||||
"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"
|
||||
"c_cpp.command.rescanWorkspace.title": "Rescan Workspace",
|
||||
"c_cpp.command.vcpkgClipboardInstallSuggested.title": "Copy vcpkg install command to clipboard",
|
||||
"c_cpp.command.vcpkgOnlineHelpSuggested.title": "Visit the vcpkg help page"
|
||||
}
|
||||
@@ -3,21 +3,17 @@
|
||||
"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": "重新扫描工作区"
|
||||
"c_cpp.command.rescanWorkspace.title": "重新扫描工作区",
|
||||
"c_cpp.command.vcpkgClipboardInstallSuggested.title": "将vcpkg install命令复制到剪贴板",
|
||||
"c_cpp.command.vcpkgOnlineHelpSuggested.title": "访问vcpkg帮助页面"
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
|
||||
export interface Environment {
|
||||
export interface Environment {
|
||||
name: string;
|
||||
value: string;
|
||||
}
|
||||
@@ -82,4 +82,4 @@ export class ParsedEnvironmentFile {
|
||||
|
||||
return new ParsedEnvironmentFile(arrayEnv, warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
import { execChildProcess } from '../common';
|
||||
import { PsProcessParser } from './nativeAttach';
|
||||
import { AttachItem, showQuickPick } from './attachQuickPick';
|
||||
|
||||
@@ -123,7 +122,7 @@ export class RemoteAttachPicker {
|
||||
// Do not add any quoting in execCommand.
|
||||
const execCommand: string = `${pipeCmd} ${this.getRemoteProcessCommand()}`;
|
||||
|
||||
return execChildProcess(execCommand, null, this._channel).then(output => {
|
||||
return util.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/);
|
||||
|
||||
@@ -37,7 +37,7 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration
|
||||
|
||||
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); });
|
||||
const defaultConfig: vscode.DebugConfiguration = configs.find(config => isDebugLaunchStr(config.name));
|
||||
console.assert(defaultConfig);
|
||||
const editor: vscode.TextEditor = vscode.window.activeTextEditor;
|
||||
if (!editor || !util.fileIsCOrCppSource(editor.document.fileName) || configs.length <= 1) {
|
||||
@@ -96,7 +96,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
* 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);
|
||||
let buildTasks: vscode.Task[] = await getBuildTasks(true);
|
||||
if (buildTasks.length === 0) {
|
||||
return Promise.resolve(this.provider.getInitialConfigurations(this.type));
|
||||
}
|
||||
@@ -128,7 +128,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
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
|
||||
let newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties
|
||||
|
||||
newConfig.name = compilerName + buildAndDebugActiveFileStr();
|
||||
newConfig.preLaunchTask = task.name;
|
||||
@@ -153,11 +153,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
} 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) => {
|
||||
@@ -228,7 +228,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -251,11 +251,11 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
|
||||
}
|
||||
|
||||
config.environment = parsedFile.Env;
|
||||
|
||||
|
||||
delete config.envFile;
|
||||
} catch (e) {
|
||||
throw new Error(`Failed to use envFile. Reason: ${e.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,10 +466,10 @@ export class ConfigurationSnippetProvider implements vscode.CompletionItemProvid
|
||||
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)));
|
||||
this.snippets.forEach((item) => items.push({...item}));
|
||||
|
||||
items.map((item) => {
|
||||
item.insertText = item.insertText + ','; // Add comma
|
||||
item.insertText = item.insertText + ','; // Add comma
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ export class MIConfigurations extends Configuration {
|
||||
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.miDebugger === "cppdbg" && os.platform() === "win32" ? `,${os.EOL}\t"miDebuggerPath": "/path/to/gdb"` : "",
|
||||
this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalProperties)}` : ""]);
|
||||
|
||||
return {
|
||||
@@ -123,7 +123,7 @@ this.additionalProperties ? `,${os.EOL}\t${indentJsonString(this.additionalPrope
|
||||
public GetAttachConfiguration(): IConfigurationSnippet {
|
||||
let name: string = `(${this.MIMode}) Attach`;
|
||||
|
||||
let body: string = formatString(`{
|
||||
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"` : "",
|
||||
|
||||
@@ -71,4 +71,4 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export function initialize(context: vscode.ExtensionContext): void {
|
||||
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;
|
||||
});
|
||||
@@ -75,7 +75,7 @@ export function initialize(context: vscode.ExtensionContext): void {
|
||||
return {label: config.name, configuration: config};
|
||||
});
|
||||
|
||||
vscode.window.showQuickPick(items, {placeHolder: (items.length === 0 ? "No compiler found" : "Select a compiler" )}).then(async selection => {
|
||||
vscode.window.showQuickPick(items, {placeHolder: (items.length === 0 ? "No compiler found" : "Select a compiler")}).then(async selection => {
|
||||
if (!selection) {
|
||||
return; // User canceled it.
|
||||
}
|
||||
@@ -140,4 +140,4 @@ export function initialize(context: vscode.ExtensionContext): void {
|
||||
|
||||
export function dispose(): void {
|
||||
disposables.forEach(d => d.dispose());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as os from 'os';
|
||||
import { AttachItemsProvider } from './attachToProcess';
|
||||
import { AttachItem } from './attachQuickPick';
|
||||
|
||||
class Process {
|
||||
export class Process {
|
||||
constructor(public name: string, public pid: string, public commandLine: string) { }
|
||||
|
||||
public toAttachItem(): AttachItem {
|
||||
|
||||
@@ -34,8 +34,8 @@ export class ArchitectureReplacer {
|
||||
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.
|
||||
// Checks to see if the folder name is in the path using both win and unix style path separators.
|
||||
// Returns the path separator 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) {
|
||||
@@ -46,4 +46,4 @@ export class ArchitectureReplacer {
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import { DataBinding } from './dataBinding';
|
||||
import minimatch = require("minimatch");
|
||||
import * as logger from '../logger';
|
||||
import { updateLanguageConfigurations, registerCommands } from './extension';
|
||||
import { CancellationTokenSource } from 'vscode';
|
||||
import { SettingsTracker, getTracker } from './settingsTracker';
|
||||
import { getTestHook, TestHook } from '../testHook';
|
||||
import { getCustomConfigProviders, CustomConfigurationProviderCollection, CustomConfigurationProvider1 } from '../LanguageServer/customProviders';
|
||||
@@ -161,9 +160,73 @@ interface ColorThemeChangedParams {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export enum ReferencesCommandMode {
|
||||
None,
|
||||
Find,
|
||||
Peek
|
||||
}
|
||||
|
||||
export function referencesCommandModeToString(referencesCommandMode: ReferencesCommandMode): string {
|
||||
switch (referencesCommandMode) {
|
||||
case ReferencesCommandMode.Find:
|
||||
return "Find All References";
|
||||
case ReferencesCommandMode.Peek:
|
||||
return "Peek References";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
enum ReferenceType {
|
||||
Confirmed, // Only sent if VS Code sends a $/cancelRequest (e.g. Peek window is closed).
|
||||
ConfirmationInProgress,
|
||||
Comment,
|
||||
String,
|
||||
Inactive,
|
||||
CannotConfirm,
|
||||
NotAReference
|
||||
}
|
||||
|
||||
interface ReferenceInfo {
|
||||
file: string;
|
||||
position: vscode.Position;
|
||||
text: string;
|
||||
type: ReferenceType;
|
||||
}
|
||||
|
||||
interface ReferencesResult {
|
||||
referenceInfos: ReferenceInfo[];
|
||||
}
|
||||
|
||||
interface ReferencesResultMessage {
|
||||
referencesResult: ReferencesResult;
|
||||
}
|
||||
|
||||
enum ReferencesProgress {
|
||||
Started,
|
||||
ProcessingSource,
|
||||
ProcessingTargets,
|
||||
FinalResultsAvailable,
|
||||
Finished
|
||||
}
|
||||
|
||||
enum TargetReferencesProgress {
|
||||
WaitingToLex,
|
||||
Lexing,
|
||||
WaitingToParse,
|
||||
Parsing,
|
||||
ConfirmingReferences,
|
||||
FinishedWithoutConfirming,
|
||||
FinishedConfirming
|
||||
}
|
||||
|
||||
interface ReportReferencesProgressNotification {
|
||||
referencesProgress: ReferencesProgress;
|
||||
targetReferencesProgress: TargetReferencesProgress[];
|
||||
}
|
||||
|
||||
// Requests
|
||||
const NavigationListRequest: RequestType<TextDocumentIdentifier, string, void, void> = new RequestType<TextDocumentIdentifier, string, void, void>('cpptools/requestNavigationList');
|
||||
const GoToDeclarationRequest: RequestType<void, void, void, void> = new RequestType<void, void, void, void>('cpptools/goToDeclaration');
|
||||
const QueryCompilerDefaultsRequest: RequestType<QueryCompilerDefaultsParams, configs.CompilerDefaults, void, void> = new RequestType<QueryCompilerDefaultsParams, configs.CompilerDefaults, void, void>('cpptools/queryCompilerDefaults');
|
||||
const QueryTranslationUnitSourceRequest: RequestType<QueryTranslationUnitSourceParams, QueryTranslationUnitSourceResult, void, void> = new RequestType<QueryTranslationUnitSourceParams, QueryTranslationUnitSourceResult, void, void>('cpptools/queryTranslationUnitSource');
|
||||
const SwitchHeaderSourceRequest: RequestType<SwitchHeaderSourceParams, string, void, void> = new RequestType<SwitchHeaderSourceParams, string, void, void>('cpptools/didSwitchHeaderSource');
|
||||
@@ -189,6 +252,9 @@ const RescanFolderNotification: NotificationType<void, void> = new NotificationT
|
||||
const DidChangeVisibleRangesNotification: NotificationType<DidChangeVisibleRangesParams, void> = new NotificationType<DidChangeVisibleRangesParams, void>('cpptools/didChangeVisibleRanges');
|
||||
const SemanticColorizationRegionsReceiptNotification: NotificationType<SemanticColorizationRegionsReceiptParams, void> = new NotificationType<SemanticColorizationRegionsReceiptParams, void>('cpptools/semanticColorizationRegionsReceipt');
|
||||
const ColorThemeChangedNotification: NotificationType<ColorThemeChangedParams, void> = new NotificationType<ColorThemeChangedParams, void>('cpptools/colorThemeChanged');
|
||||
const RequestReferencesNotification: NotificationType<void, void> = new NotificationType<void, void>('cpptools/requestReferences');
|
||||
const CancelReferencesNotification: NotificationType<void, void> = new NotificationType<void, void>('cpptools/cancelReferences');
|
||||
const FinishedRequestCustomConfig: NotificationType<string, void> = new NotificationType<string, void>('cpptools/finishedRequestCustomConfig');
|
||||
|
||||
// Notifications from the server
|
||||
const ReloadWindowNotification: NotificationType<void, void> = new NotificationType<void, void>('cpptools/reloadWindow');
|
||||
@@ -202,12 +268,16 @@ const SemanticColorizationRegionsNotification: NotificationType<SemanticColoriz
|
||||
const CompileCommandsPathsNotification: NotificationType<CompileCommandsPaths, void> = new NotificationType<CompileCommandsPaths, void>('cpptools/compileCommandsPaths');
|
||||
const UpdateClangFormatPathNotification: NotificationType<string, void> = new NotificationType<string, void>('cpptools/updateClangFormatPath');
|
||||
const UpdateIntelliSenseCachePathNotification: NotificationType<string, void> = new NotificationType<string, void>('cpptools/updateIntelliSenseCachePath');
|
||||
const ReferencesNotification: NotificationType<ReferencesResultMessage, void> = new NotificationType<ReferencesResultMessage, void>('cpptools/references');
|
||||
const ReportReferencesProgressNotification: NotificationType<ReportReferencesProgressNotification, void> = new NotificationType<ReportReferencesProgressNotification, void>('cpptools/reportReferencesProgress');
|
||||
const RequestCustomConfig: NotificationType<string, void> = new NotificationType<string, void>('cpptools/requestCustomConfig');
|
||||
|
||||
let failureMessageShown: boolean = false;
|
||||
|
||||
interface ClientModel {
|
||||
isTagParsing: DataBinding<boolean>;
|
||||
isUpdatingIntelliSense: DataBinding<boolean>;
|
||||
referencesCommandMode: DataBinding<ReferencesCommandMode>;
|
||||
navigationLocation: DataBinding<string>;
|
||||
tagParserStatus: DataBinding<string>;
|
||||
activeConfigName: DataBinding<string>;
|
||||
@@ -216,6 +286,7 @@ interface ClientModel {
|
||||
export interface Client {
|
||||
TagParsingChanged: vscode.Event<boolean>;
|
||||
IntelliSenseParsingChanged: vscode.Event<boolean>;
|
||||
ReferencesCommandModeChanged: vscode.Event<ReferencesCommandMode>;
|
||||
NavigationLocationChanged: vscode.Event<string>;
|
||||
TagParserStatusChanged: vscode.Event<string>;
|
||||
ActiveConfigChanged: vscode.Event<string>;
|
||||
@@ -231,17 +302,18 @@ export interface Client {
|
||||
onRegisterCustomConfigurationProvider(provider: CustomConfigurationProvider1): Thenable<void>;
|
||||
updateCustomConfigurations(requestingProvider?: CustomConfigurationProvider1): Thenable<void>;
|
||||
updateCustomBrowseConfiguration(requestingProvider?: CustomConfigurationProvider1): Thenable<void>;
|
||||
provideCustomConfiguration(document: vscode.TextDocument): Promise<void>;
|
||||
provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string): Promise<void>;
|
||||
logDiagnostics(): Promise<void>;
|
||||
rescanFolder(): Promise<void>;
|
||||
getCurrentConfigName(): Thenable<string>;
|
||||
getCompilerPath(): Thenable<string>;
|
||||
getVcpkgInstalled(): Thenable<boolean>;
|
||||
getVcpkgEnabled(): Thenable<boolean>;
|
||||
getCurrentCompilerPathAndArgs(): Thenable<util.CompilerPathAndArgs>;
|
||||
getKnownCompilers(): Thenable<configs.KnownCompiler[]>;
|
||||
takeOwnership(document: vscode.TextDocument): void;
|
||||
queueTask<T>(task: () => Thenable<T>): Thenable<T>;
|
||||
requestWhenReady(request: () => Thenable<any>): Thenable<any>;
|
||||
notifyWhenReady(notify: () => void): void;
|
||||
requestGoToDeclaration(): Thenable<void>;
|
||||
requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable<string>;
|
||||
requestNavigationList(document: vscode.TextDocument): Thenable<string>;
|
||||
activeDocumentChanged(document: vscode.TextDocument): void;
|
||||
@@ -254,6 +326,7 @@ export interface Client {
|
||||
handleConfigurationSelectCommand(): void;
|
||||
handleConfigurationProviderSelectCommand(): void;
|
||||
handleShowParsingCommands(): void;
|
||||
handleReferencesIcon(): void;
|
||||
handleConfigurationEditCommand(): void;
|
||||
handleConfigurationEditJSONCommand(): void;
|
||||
handleConfigurationEditUICommand(): void;
|
||||
@@ -282,6 +355,7 @@ class DefaultClient implements Client {
|
||||
private outputChannel: vscode.OutputChannel;
|
||||
private debugChannel: vscode.OutputChannel;
|
||||
private diagnosticsChannel: vscode.OutputChannel;
|
||||
private referencesChannel: vscode.OutputChannel;
|
||||
private crashTimes: number[] = [];
|
||||
private isSupported: boolean = true;
|
||||
private colorizationSettings: ColorizationSettings;
|
||||
@@ -294,6 +368,7 @@ class DefaultClient implements Client {
|
||||
private model: ClientModel = {
|
||||
isTagParsing: new DataBinding<boolean>(false),
|
||||
isUpdatingIntelliSense: new DataBinding<boolean>(false),
|
||||
referencesCommandMode: new DataBinding<ReferencesCommandMode>(ReferencesCommandMode.None),
|
||||
navigationLocation: new DataBinding<string>(""),
|
||||
tagParserStatus: new DataBinding<string>(""),
|
||||
activeConfigName: new DataBinding<string>("")
|
||||
@@ -301,6 +376,7 @@ class DefaultClient implements Client {
|
||||
|
||||
public get TagParsingChanged(): vscode.Event<boolean> { return this.model.isTagParsing.ValueChanged; }
|
||||
public get IntelliSenseParsingChanged(): vscode.Event<boolean> { return this.model.isUpdatingIntelliSense.ValueChanged; }
|
||||
public get ReferencesCommandModeChanged(): vscode.Event<ReferencesCommandMode> { return this.model.referencesCommandMode.ValueChanged; }
|
||||
public get NavigationLocationChanged(): vscode.Event<string> { return this.model.navigationLocation.ValueChanged; }
|
||||
public get TagParserStatusChanged(): vscode.Event<string> { return this.model.tagParserStatus.ValueChanged; }
|
||||
public get ActiveConfigChanged(): vscode.Event<string> { return this.model.activeConfigName.ValueChanged; }
|
||||
@@ -388,7 +464,7 @@ class DefaultClient implements Client {
|
||||
// The event handlers must be set before this happens.
|
||||
return languageClient.sendRequest(QueryCompilerDefaultsRequest, {}).then((compilerDefaults: configs.CompilerDefaults) => {
|
||||
this.configuration.CompilerDefaults = compilerDefaults;
|
||||
|
||||
|
||||
// Only register the real commands after the extension has finished initializing,
|
||||
// e.g. prevents empty c_cpp_properties.json from generation.
|
||||
registerCommands();
|
||||
@@ -433,7 +509,7 @@ class DefaultClient implements Client {
|
||||
let settings: CppSettings = new CppSettings(this.rootFolder ? this.rootFolder.uri : null);
|
||||
let other: OtherSettings = new OtherSettings(this.rootFolder ? this.rootFolder.uri : null);
|
||||
let abTestSettings: ABTestSettings = getABTestSettings();
|
||||
|
||||
|
||||
let intelliSenseCacheDisabled: boolean = false;
|
||||
if (os.platform() === "darwin") {
|
||||
const releaseParts: string[] = os.release().split(".");
|
||||
@@ -483,7 +559,8 @@ class DefaultClient implements Client {
|
||||
systemIncludePath: settings.defaultSystemIncludePath
|
||||
},
|
||||
vcpkg_root: util.getVcpkgRoot(),
|
||||
gotoDefIntelliSense: abTestSettings.UseGoToDefIntelliSense
|
||||
gotoDefIntelliSense: abTestSettings.UseGoToDefIntelliSense,
|
||||
experimentalFeatures: settings.experimentalFeatures
|
||||
},
|
||||
middleware: createProtocolFilter(this, allClients), // Only send messages directed at this client.
|
||||
errorHandler: {
|
||||
@@ -533,7 +610,7 @@ class DefaultClient implements Client {
|
||||
let colorThemeChanged: boolean = event.affectsConfiguration("workbench.colorTheme", this.RootUri);
|
||||
if (colorThemeChanged) {
|
||||
let otherSettings: OtherSettings = new OtherSettings(this.RootUri);
|
||||
this.languageClient.sendNotification(ColorThemeChangedNotification, { name: otherSettings.colorTheme } );
|
||||
this.languageClient.sendNotification(ColorThemeChangedNotification, { name: otherSettings.colorTheme });
|
||||
}
|
||||
|
||||
if (colorizationNeedsReload) {
|
||||
@@ -651,8 +728,25 @@ class DefaultClient implements Client {
|
||||
}
|
||||
}
|
||||
|
||||
// Used to determine if Find or Peek References is used.
|
||||
// TODO: Investigate using onDidExecuteCommand instead.
|
||||
private prevVisibleRangesLength: number = 0;
|
||||
private visibleRangesDecreased: boolean = false;
|
||||
private visibleRangesDecreasedTicks: number = 0;
|
||||
private readonly ticksForDetectingPeek: number = 1000; // TODO: Might need tweeking?
|
||||
|
||||
public onDidChangeTextEditorVisibleRanges(textEditorVisibleRangesChangeEvent: vscode.TextEditorVisibleRangesChangeEvent): void {
|
||||
if (textEditorVisibleRangesChangeEvent.textEditor.document.uri.scheme === "file") {
|
||||
if (vscode.window.activeTextEditor === textEditorVisibleRangesChangeEvent.textEditor) {
|
||||
if (textEditorVisibleRangesChangeEvent.visibleRanges.length === 1) {
|
||||
let visibleRangesLength: number = textEditorVisibleRangesChangeEvent.visibleRanges[0].end.line - textEditorVisibleRangesChangeEvent.visibleRanges[0].start.line;
|
||||
this.visibleRangesDecreased = visibleRangesLength < this.prevVisibleRangesLength;
|
||||
if (this.visibleRangesDecreased) {
|
||||
this.visibleRangesDecreasedTicks = Date.now();
|
||||
}
|
||||
this.prevVisibleRangesLength = visibleRangesLength;
|
||||
}
|
||||
}
|
||||
this.sendVisibleRanges(textEditorVisibleRangesChangeEvent.textEditor.document.uri);
|
||||
}
|
||||
}
|
||||
@@ -723,7 +817,7 @@ class DefaultClient implements Client {
|
||||
return;
|
||||
}
|
||||
|
||||
let tokenSource: CancellationTokenSource = new CancellationTokenSource();
|
||||
let tokenSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
let documentUris: vscode.Uri[] = [];
|
||||
this.trackedDocuments.forEach(document => documentUris.push(document.uri));
|
||||
|
||||
@@ -745,20 +839,25 @@ class DefaultClient implements Client {
|
||||
return;
|
||||
}
|
||||
|
||||
let tokenSource: CancellationTokenSource = new CancellationTokenSource();
|
||||
let tokenSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
let task: () => Thenable<WorkspaceBrowseConfiguration> = async () => {
|
||||
if (this.RootUri && await currentProvider.canProvideBrowseConfigurationsPerFolder(tokenSource.token)) {
|
||||
return (currentProvider.provideFolderBrowseConfiguration(this.RootUri, tokenSource.token));
|
||||
}
|
||||
if (await currentProvider.canProvideBrowseConfiguration(tokenSource.token)) {
|
||||
return currentProvider.provideBrowseConfiguration(tokenSource.token);
|
||||
}
|
||||
if (currentProvider.version >= Version.v2) {
|
||||
console.warn("failed to provide browse configuration");
|
||||
}
|
||||
return Promise.reject("");
|
||||
return null;
|
||||
};
|
||||
this.queueTaskWithTimeout(task, configProviderTimeout, tokenSource).then(
|
||||
async config => {
|
||||
await this.sendCustomBrowseConfiguration(config);
|
||||
this.resumeParsing();
|
||||
if (currentProvider.version >= Version.v2) {
|
||||
this.resumeParsing();
|
||||
}
|
||||
},
|
||||
() => {});
|
||||
});
|
||||
@@ -785,25 +884,33 @@ class DefaultClient implements Client {
|
||||
await this.notifyWhenReady(() => this.languageClient.sendNotification(RescanFolderNotification));
|
||||
}
|
||||
|
||||
public async provideCustomConfiguration(document: vscode.TextDocument): Promise<void> {
|
||||
public async provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string): Promise<void> {
|
||||
let onFinished: () => void = () => {
|
||||
if (requestFile) {
|
||||
this.languageClient.sendNotification(FinishedRequestCustomConfig, requestFile);
|
||||
}
|
||||
};
|
||||
return this.queueBlockingTask(async () => {
|
||||
let tokenSource: CancellationTokenSource = new CancellationTokenSource();
|
||||
let tokenSource: vscode.CancellationTokenSource = new vscode.CancellationTokenSource();
|
||||
let providers: CustomConfigurationProviderCollection = getCustomConfigProviders();
|
||||
if (providers.size === 0) {
|
||||
onFinished();
|
||||
return Promise.resolve();
|
||||
}
|
||||
console.log("provideCustomConfiguration");
|
||||
let providerId: string|undefined = this.configuration.CurrentConfigurationProvider;
|
||||
if (!providerId) {
|
||||
onFinished();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let providerName: string = providerId;
|
||||
let params: QueryTranslationUnitSourceParams = {
|
||||
uri: document.uri.toString()
|
||||
uri: docUri.toString()
|
||||
};
|
||||
let response: QueryTranslationUnitSourceResult = await this.languageClient.sendRequest(QueryTranslationUnitSourceRequest, params);
|
||||
if (response.configDisposition === QueryTranslationUnitSourceConfigDisposition.ConfigNotNeeded) {
|
||||
onFinished();
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -836,20 +943,25 @@ class DefaultClient implements Client {
|
||||
this.sendCustomConfigurations(configs, false);
|
||||
if (response.configDisposition === QueryTranslationUnitSourceConfigDisposition.AncestorConfigNeeded) {
|
||||
// replacing uri with original uri
|
||||
let newConfig: SourceFileConfigurationItem = { uri: document.uri, configuration: configs[0].configuration };
|
||||
let newConfig: SourceFileConfigurationItem = { uri: docUri, configuration: configs[0].configuration };
|
||||
this.sendCustomConfigurations([newConfig], false);
|
||||
}
|
||||
}
|
||||
onFinished();
|
||||
},
|
||||
(err) => {
|
||||
if (requestFile) {
|
||||
onFinished();
|
||||
return;
|
||||
}
|
||||
if (err === notReadyMessage) {
|
||||
return;
|
||||
}
|
||||
let settings: CppSettings = new CppSettings(this.RootUri);
|
||||
if (settings.configurationWarnings === "Enabled" && !this.isExternalHeader(document.uri) && !vscode.debug.activeDebugSession) {
|
||||
if (settings.configurationWarnings === "Enabled" && !this.isExternalHeader(docUri) && !vscode.debug.activeDebugSession) {
|
||||
const dismiss: string = "Dismiss";
|
||||
const disable: string = "Disable Warnings";
|
||||
let message: string = `'${providerName}' is unable to provide IntelliSense configuration information for '${document.uri.fsPath}'. ` +
|
||||
let message: string = `'${providerName}' is unable to provide IntelliSense configuration information for '${docUri.fsPath}'. ` +
|
||||
`Settings from the '${configName}' configuration will be used instead.`;
|
||||
if (err) {
|
||||
message += ` (${err})`;
|
||||
@@ -868,6 +980,10 @@ class DefaultClient implements Client {
|
||||
});
|
||||
}
|
||||
|
||||
private async handleRequestCustomConfig(requestFile: string): Promise<void> {
|
||||
await this.provideCustomConfiguration(vscode.Uri.file(requestFile), requestFile);
|
||||
}
|
||||
|
||||
private isExternalHeader(uri: vscode.Uri): boolean {
|
||||
return util.isHeader(uri) && !uri.toString().startsWith(this.RootUri.toString());
|
||||
}
|
||||
@@ -876,8 +992,21 @@ class DefaultClient implements Client {
|
||||
return this.queueTask(() => Promise.resolve(this.configuration.CurrentConfiguration.name));
|
||||
}
|
||||
|
||||
public getCompilerPath(): Thenable<string> {
|
||||
return this.queueTask(() => Promise.resolve(this.configuration.CompilerPath));
|
||||
public getCurrentCompilerPathAndArgs(): Thenable<util.CompilerPathAndArgs> {
|
||||
return this.queueTask(() => Promise.resolve(
|
||||
util.extractCompilerPathAndArgs(
|
||||
this.configuration.CurrentConfiguration.compilerPath,
|
||||
this.configuration.CurrentConfiguration.compilerArgs)
|
||||
));
|
||||
}
|
||||
|
||||
public getVcpkgInstalled(): Thenable<boolean> {
|
||||
return this.queueTask(() => Promise.resolve(this.configuration.VcpkgInstalled));
|
||||
}
|
||||
|
||||
public getVcpkgEnabled(): Thenable<boolean> {
|
||||
const cppSettings: CppSettings = new CppSettings(this.RootUri);
|
||||
return Promise.resolve(cppSettings.vcpkgEnabled);
|
||||
}
|
||||
|
||||
public getKnownCompilers(): Thenable<configs.KnownCompiler[]> {
|
||||
@@ -918,7 +1047,7 @@ class DefaultClient implements Client {
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (this.pendingTask && !this.pendingTask.Done) {
|
||||
// We don't want the queue to stall because of a rejected promise.
|
||||
return this.pendingTask.getPromise().then(nextTask, nextTask);
|
||||
@@ -945,7 +1074,7 @@ class DefaultClient implements Client {
|
||||
}
|
||||
}
|
||||
|
||||
private queueTaskWithTimeout(task: () => Thenable<any>, ms: number, cancelToken?: CancellationTokenSource): Thenable<any> {
|
||||
private queueTaskWithTimeout(task: () => Thenable<any>, ms: number, cancelToken?: vscode.CancellationTokenSource): Thenable<any> {
|
||||
let timer: NodeJS.Timer;
|
||||
// Create a promise that rejects in <ms> milliseconds
|
||||
let timeout: () => Promise<any> = () => new Promise((resolve, reject) => {
|
||||
@@ -972,7 +1101,7 @@ class DefaultClient implements Client {
|
||||
});
|
||||
}
|
||||
|
||||
private callTaskWithTimeout(task: () => Thenable<any>, ms: number, cancelToken?: CancellationTokenSource): Thenable<any> {
|
||||
private callTaskWithTimeout(task: () => Thenable<any>, ms: number, cancelToken?: vscode.CancellationTokenSource): Thenable<any> {
|
||||
let timer: NodeJS.Timer;
|
||||
// Create a promise that rejects in <ms> milliseconds
|
||||
let timeout: () => Promise<any> = () => new Promise((resolve, reject) => {
|
||||
@@ -1026,6 +1155,9 @@ class DefaultClient implements Client {
|
||||
this.languageClient.onNotification(ReportTagParseStatusNotification, (e) => this.updateTagParseStatus(e));
|
||||
this.languageClient.onNotification(SemanticColorizationRegionsNotification, (e) => this.updateSemanticColorizationRegions(e));
|
||||
this.languageClient.onNotification(CompileCommandsPathsNotification, (e) => this.promptCompileCommands(e));
|
||||
this.languageClient.onNotification(ReferencesNotification, (e) => this.processReferencesResult(e.referencesResult));
|
||||
this.languageClient.onNotification(ReportReferencesProgressNotification, (e) => this.handleReferencesProgress(e));
|
||||
this.languageClient.onNotification(RequestCustomConfig, (e) => this.handleRequestCustomConfig(e));
|
||||
this.setupOutputHandlers();
|
||||
}
|
||||
|
||||
@@ -1256,7 +1388,7 @@ class DefaultClient implements Client {
|
||||
});
|
||||
let colorizationState: ColorizationState = this.getColorizationState(params.uri);
|
||||
colorizationState.updateSemantic(params.uri, semanticRanges, inactiveRanges, params.editVersion);
|
||||
this.languageClient.sendNotification(SemanticColorizationRegionsReceiptNotification, { uri: params.uri } );
|
||||
this.languageClient.sendNotification(SemanticColorizationRegionsReceiptNotification, { uri: params.uri });
|
||||
}
|
||||
|
||||
private promptCompileCommands(params: CompileCommandsPaths) : void {
|
||||
@@ -1306,10 +1438,6 @@ class DefaultClient implements Client {
|
||||
* requests to the language server
|
||||
*********************************************/
|
||||
|
||||
public requestGoToDeclaration(): Thenable<void> {
|
||||
return this.requestWhenReady(() => this.languageClient.sendRequest(GoToDeclarationRequest, null));
|
||||
}
|
||||
|
||||
public requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable<string> {
|
||||
let params: SwitchHeaderSourceParams = {
|
||||
rootPath: rootPath,
|
||||
@@ -1347,7 +1475,9 @@ class DefaultClient implements Client {
|
||||
}
|
||||
|
||||
public selectionChanged(selection: Range): void {
|
||||
this.notifyWhenReady(() => this.languageClient.sendNotification(TextEditorSelectionChangeNotification, selection));
|
||||
this.notifyWhenReady(() => {
|
||||
this.languageClient.sendNotification(TextEditorSelectionChangeNotification, selection);
|
||||
});
|
||||
}
|
||||
|
||||
public resetDatabase(): void {
|
||||
@@ -1379,6 +1509,13 @@ class DefaultClient implements Client {
|
||||
configurations: configurations,
|
||||
currentConfiguration: this.configuration.CurrentConfigurationIndex
|
||||
};
|
||||
// Separate compiler path and args before sending to language client
|
||||
params.configurations.forEach((c: configs.Configuration) => {
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs =
|
||||
util.extractCompilerPathAndArgs(c.compilerPath, c.compilerArgs);
|
||||
c.compilerPath = compilerPathAndArgs.compilerPath;
|
||||
c.compilerArgs = compilerPathAndArgs.additionalArgs;
|
||||
});
|
||||
this.notifyWhenReady(() => {
|
||||
this.languageClient.sendNotification(ChangeFolderSettingsNotification, params);
|
||||
this.model.activeConfigName.Value = configurations[params.currentConfiguration].name;
|
||||
@@ -1414,8 +1551,13 @@ class DefaultClient implements Client {
|
||||
|
||||
private isSourceFileConfigurationItem(input: any): input is SourceFileConfigurationItem {
|
||||
return (input && (util.isString(input.uri) || util.isUri(input.uri)) &&
|
||||
input.configuration && util.isArrayOfString(input.configuration.includePath) && util.isArrayOfString(input.configuration.defines) &&
|
||||
util.isString(input.configuration.intelliSenseMode) && util.isString(input.configuration.standard) && util.isOptionalString(input.configuration.compilerPath) &&
|
||||
input.configuration &&
|
||||
util.isArrayOfString(input.configuration.includePath) &&
|
||||
util.isArrayOfString(input.configuration.defines) &&
|
||||
util.isString(input.configuration.intelliSenseMode) &&
|
||||
util.isString(input.configuration.standard) &&
|
||||
util.isOptionalString(input.configuration.compilerPath) &&
|
||||
util.isOptionalArrayOfString(input.configuration.compilerArgs) &&
|
||||
util.isOptionalArrayOfString(input.configuration.forcedInclude));
|
||||
}
|
||||
|
||||
@@ -1434,10 +1576,6 @@ class DefaultClient implements Client {
|
||||
let sanitized: SourceFileConfigurationItemAdapter[] = [];
|
||||
configs.forEach(item => {
|
||||
if (this.isSourceFileConfigurationItem(item)) {
|
||||
sanitized.push({
|
||||
uri: item.uri.toString(),
|
||||
configuration: item.configuration
|
||||
});
|
||||
if (settings.loggingLevel === "Debug") {
|
||||
out.appendLine(` uri: ${item.uri.toString()}`);
|
||||
out.appendLine(` config: ${JSON.stringify(item.configuration, null, 2)}`);
|
||||
@@ -1445,6 +1583,19 @@ class DefaultClient implements Client {
|
||||
if (item.configuration.includePath.some(path => path.endsWith('**'))) {
|
||||
console.warn("custom include paths should not use recursive includes ('**')");
|
||||
}
|
||||
// Separate compiler path and args before sending to language client
|
||||
let itemConfig: util.Mutable<SourceFileConfiguration> = {...item.configuration};
|
||||
if (util.isString(itemConfig.compilerPath)) {
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(
|
||||
itemConfig.compilerPath,
|
||||
util.isArrayOfString(itemConfig.compilerArgs) ? itemConfig.compilerArgs : undefined);
|
||||
itemConfig.compilerPath = compilerPathAndArgs.compilerPath;
|
||||
itemConfig.compilerArgs = compilerPathAndArgs.additionalArgs;
|
||||
}
|
||||
sanitized.push({
|
||||
uri: item.uri.toString(),
|
||||
configuration: itemConfig
|
||||
});
|
||||
} else {
|
||||
console.warn("discarding invalid SourceFileConfigurationItem: " + item);
|
||||
}
|
||||
@@ -1457,7 +1608,14 @@ class DefaultClient implements Client {
|
||||
let params: CustomConfigurationParams = {
|
||||
configurationItems: sanitized
|
||||
};
|
||||
this.notifyWhenReady(() => this.languageClient.sendNotification(CustomConfigurationNotification, params), blockingTask);
|
||||
|
||||
if (blockingTask) {
|
||||
this.notifyWhenReady(() => {
|
||||
this.languageClient.sendNotification(CustomConfigurationNotification, params);
|
||||
} , blockingTask);
|
||||
} else {
|
||||
this.languageClient.sendNotification(CustomConfigurationNotification, params);
|
||||
}
|
||||
}
|
||||
|
||||
private sendCustomBrowseConfiguration(config: any): Thenable<void> {
|
||||
@@ -1466,9 +1624,13 @@ class DefaultClient implements Client {
|
||||
console.warn("discarding invalid WorkspaceBrowseConfiguration: " + config);
|
||||
return Promise.resolve();
|
||||
}
|
||||
let sanitized: WorkspaceBrowseConfiguration = <WorkspaceBrowseConfiguration>config;
|
||||
if (!util.isArrayOfString(sanitized.browsePath) || !util.isOptionalString(sanitized.compilerPath) ||
|
||||
!util.isOptionalString(sanitized.standard) || !util.isOptionalString(sanitized.windowsSdkVersion)) {
|
||||
|
||||
let sanitized: util.Mutable<WorkspaceBrowseConfiguration> = {...<WorkspaceBrowseConfiguration>config};
|
||||
if (!util.isArrayOfString(sanitized.browsePath) ||
|
||||
!util.isOptionalString(sanitized.compilerPath) ||
|
||||
!util.isOptionalArrayOfString(sanitized.compilerArgs) ||
|
||||
!util.isOptionalString(sanitized.standard) ||
|
||||
!util.isOptionalString(sanitized.windowsSdkVersion)) {
|
||||
console.warn("discarding invalid WorkspaceBrowseConfiguration: " + config);
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -1479,6 +1641,15 @@ class DefaultClient implements Client {
|
||||
out.appendLine(`Custom browse configuration received: ${JSON.stringify(sanitized, null, 2)}`);
|
||||
}
|
||||
|
||||
// Separate compiler path and args before sending to language client
|
||||
if (util.isString(sanitized.compilerPath)) {
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(
|
||||
sanitized.compilerPath,
|
||||
util.isArrayOfString(sanitized.compilerArgs) ? sanitized.compilerArgs : undefined);
|
||||
sanitized.compilerPath = compilerPathAndArgs.compilerPath;
|
||||
sanitized.compilerArgs = compilerPathAndArgs.additionalArgs;
|
||||
}
|
||||
|
||||
let params: CustomBrowseConfigurationParams = {
|
||||
browseConfiguration: sanitized
|
||||
};
|
||||
@@ -1583,6 +1754,225 @@ class DefaultClient implements Client {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Find All References data.
|
||||
private referencesCurrentProgress: ReportReferencesProgressNotification;
|
||||
private referencesPrevProgressIncrement: number;
|
||||
private referencesPrevProgressMessage: string;
|
||||
private referencesRequestHasOccurred: boolean;
|
||||
private referencesViewFindPending: boolean = false;
|
||||
private referencesDelayProgress: NodeJS.Timeout;
|
||||
private referencesProgressOptions: vscode.ProgressOptions;
|
||||
private referencesCanceled: boolean;
|
||||
private referencesStartedWhileTagParsing: boolean;
|
||||
private referencesProgressMethod: (progress: vscode.Progress<{
|
||||
message?: string;
|
||||
increment?: number;
|
||||
}>, token: vscode.CancellationToken) => Thenable<unknown>;
|
||||
private referencePreviousProgressUICounter: number;
|
||||
private referencesCurrentProgressUICounter: number;
|
||||
private readonly referencesProgressUpdateInterval: number = 1000;
|
||||
private readonly referencesProgressDelayInterval: number = 2000;
|
||||
|
||||
private reportReferencesProgress(progress: vscode.Progress<{message?: string; increment?: number }>, forceUpdate: boolean): void {
|
||||
const helpMessage: string = this.model.referencesCommandMode.Value === ReferencesCommandMode.Peek ? "" : " To preview results, click the search icon in the status bar.";
|
||||
switch (this.referencesCurrentProgress.referencesProgress) {
|
||||
case ReferencesProgress.Started:
|
||||
progress.report({ message: 'Started.', increment: 0 });
|
||||
break;
|
||||
case ReferencesProgress.ProcessingSource:
|
||||
progress.report({ message: 'Processing source.', increment: 0 });
|
||||
break;
|
||||
case ReferencesProgress.ProcessingTargets:
|
||||
let numWaitingToLex: number = 0;
|
||||
let numLexing: number = 0;
|
||||
let numParsing: number = 0;
|
||||
let numConfirmingReferences: number = 0;
|
||||
let numFinishedWithoutConfirming: number = 0;
|
||||
let numFinishedConfirming: number = 0;
|
||||
for (let targetLocationProgress of this.referencesCurrentProgress.targetReferencesProgress) {
|
||||
switch (targetLocationProgress) {
|
||||
case TargetReferencesProgress.WaitingToLex:
|
||||
++numWaitingToLex;
|
||||
break;
|
||||
case TargetReferencesProgress.Lexing:
|
||||
++numLexing;
|
||||
break;
|
||||
case TargetReferencesProgress.WaitingToParse:
|
||||
// The count is derived.
|
||||
break;
|
||||
case TargetReferencesProgress.Parsing:
|
||||
++numParsing;
|
||||
break;
|
||||
case TargetReferencesProgress.ConfirmingReferences:
|
||||
++numConfirmingReferences;
|
||||
break;
|
||||
case TargetReferencesProgress.FinishedWithoutConfirming:
|
||||
++numFinishedWithoutConfirming;
|
||||
break;
|
||||
case TargetReferencesProgress.FinishedConfirming:
|
||||
++numFinishedConfirming;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let currentMessage: string;
|
||||
const numTotalToLex: number = this.referencesCurrentProgress.targetReferencesProgress.length;
|
||||
const numFinishedLexing: number = numTotalToLex - numWaitingToLex - numLexing;
|
||||
const numTotalToParse: number = this.referencesCurrentProgress.targetReferencesProgress.length - numFinishedWithoutConfirming;
|
||||
if (numLexing >= numParsing && numFinishedConfirming === 0) {
|
||||
if (numTotalToLex === 0) {
|
||||
currentMessage = "Searching files."; // TODO: Prevent this from happening.
|
||||
} else {
|
||||
currentMessage = `${numFinishedLexing}/${numTotalToLex} files searched.${helpMessage}`;
|
||||
}
|
||||
} else {
|
||||
currentMessage = `${numFinishedConfirming}/${numTotalToParse} files confirmed.${helpMessage}`;
|
||||
}
|
||||
const currentLexProgress: number = numFinishedLexing / numTotalToLex;
|
||||
const confirmingWeight: number = 0.5; // Count confirming as 50% of parsing time (even though it's a lot less) so that the progress bar change is more noticeable.
|
||||
const currentParseProgress: number = (numConfirmingReferences * confirmingWeight + numFinishedConfirming) / numTotalToParse;
|
||||
const averageLexingPercent: number = 25;
|
||||
const currentIncrement: number = currentLexProgress * averageLexingPercent + currentParseProgress * (100 - averageLexingPercent);
|
||||
if (forceUpdate || currentIncrement > this.referencesPrevProgressIncrement || currentMessage !== this.referencesPrevProgressMessage) {
|
||||
progress.report({ message: currentMessage, increment: currentIncrement - this.referencesPrevProgressIncrement });
|
||||
this.referencesPrevProgressIncrement = currentIncrement;
|
||||
this.referencesPrevProgressMessage = currentMessage;
|
||||
}
|
||||
break;
|
||||
case ReferencesProgress.FinalResultsAvailable:
|
||||
progress.report({ message: 'Finished.', increment: 100 });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public handleReferencesIcon(): void {
|
||||
this.notifyWhenReady(() => {
|
||||
if (this.model.referencesCommandMode.Value !== ReferencesCommandMode.None) {
|
||||
++this.referencesCurrentProgressUICounter;
|
||||
}
|
||||
if (this.model.referencesCommandMode.Value !== ReferencesCommandMode.Peek) {
|
||||
this.sendRequestReferences();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private sendRequestReferences(): void {
|
||||
if (this.model.referencesCommandMode.Value !== ReferencesCommandMode.None) {
|
||||
if (this.referencesRequestHasOccurred) {
|
||||
// References are not usable if a references request is pending,
|
||||
// So after the initial request, we don't send a 2nd references request until the next request occurs.
|
||||
if (!this.referencesViewFindPending) {
|
||||
this.referencesViewFindPending = true;
|
||||
vscode.commands.executeCommand("references-view.refresh");
|
||||
}
|
||||
} else {
|
||||
this.languageClient.sendNotification(RequestReferencesNotification);
|
||||
this.referencesRequestHasOccurred = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private handleReferencesProgress(notificationBody: ReportReferencesProgressNotification): void {
|
||||
switch (notificationBody.referencesProgress) {
|
||||
case ReferencesProgress.Started:
|
||||
this.referencesStartedWhileTagParsing = this.model.isTagParsing.Value;
|
||||
this.model.referencesCommandMode.Value = this.visibleRangesDecreased && (Date.now() - this.visibleRangesDecreasedTicks < this.ticksForDetectingPeek) ?
|
||||
ReferencesCommandMode.Peek : ReferencesCommandMode.Find;
|
||||
if (this.model.referencesCommandMode.Value === ReferencesCommandMode.Peek) {
|
||||
telemetry.logLanguageServerEvent("peekReferences");
|
||||
}
|
||||
this.referencesRequestHasOccurred = false;
|
||||
this.referencesCanceled = false;
|
||||
this.referencesPrevProgressIncrement = 0;
|
||||
this.referencesPrevProgressMessage = "";
|
||||
this.referencePreviousProgressUICounter = 0;
|
||||
this.referencesCurrentProgressUICounter = 0;
|
||||
if (!this.referencesChannel) {
|
||||
this.referencesChannel = vscode.window.createOutputChannel("C/C++ References");
|
||||
this.disposables.push(this.referencesChannel);
|
||||
} else {
|
||||
this.referencesChannel.clear();
|
||||
}
|
||||
this.referencesDelayProgress = setInterval(() => {
|
||||
this.referencesProgressOptions = { location: vscode.ProgressLocation.Notification, title: referencesCommandModeToString(this.model.referencesCommandMode.Value), cancellable: true };
|
||||
this.referencesProgressMethod = (progress: vscode.Progress<{message?: string; increment?: number }>, token: vscode.CancellationToken) =>
|
||||
// tslint:disable-next-line: promise-must-complete
|
||||
new Promise((resolve) => {
|
||||
this.reportReferencesProgress(progress, true);
|
||||
let currentUpdateProgressTimer: NodeJS.Timeout = setInterval(() => {
|
||||
if (token.isCancellationRequested && !this.referencesCanceled) {
|
||||
this.languageClient.sendNotification(CancelReferencesNotification);
|
||||
this.sendRequestReferences();
|
||||
this.referencesCanceled = true;
|
||||
}
|
||||
if (this.referencesCurrentProgress.referencesProgress === ReferencesProgress.Finished || this.referencesCurrentProgressUICounter !== this.referencePreviousProgressUICounter) {
|
||||
clearInterval(currentUpdateProgressTimer);
|
||||
if (this.referencesCurrentProgressUICounter !== this.referencePreviousProgressUICounter) {
|
||||
this.referencePreviousProgressUICounter = this.referencesCurrentProgressUICounter;
|
||||
this.referencesPrevProgressIncrement = 0; // Causes update bar to not reset.
|
||||
vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
|
||||
}
|
||||
resolve();
|
||||
} else {
|
||||
this.reportReferencesProgress(progress, false);
|
||||
}
|
||||
}, this.referencesProgressUpdateInterval);
|
||||
});
|
||||
vscode.window.withProgress(this.referencesProgressOptions, this.referencesProgressMethod);
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
}, this.referencesProgressDelayInterval);
|
||||
break;
|
||||
case ReferencesProgress.FinalResultsAvailable:
|
||||
this.referencesCurrentProgress = notificationBody;
|
||||
this.sendRequestReferences();
|
||||
break;
|
||||
case ReferencesProgress.Finished:
|
||||
this.referencesCurrentProgress = notificationBody;
|
||||
this.model.referencesCommandMode.Value = ReferencesCommandMode.None;
|
||||
clearInterval(this.referencesDelayProgress);
|
||||
break;
|
||||
default:
|
||||
this.referencesCurrentProgress = notificationBody;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private convertReferenceTypeToString(referenceType: ReferenceType): string {
|
||||
switch (referenceType) {
|
||||
case ReferenceType.Confirmed: return "Confirmed reference";
|
||||
case ReferenceType.ConfirmationInProgress: return this.referencesCanceled ? "Confirmation canceled" : "Confirmation in progress";
|
||||
case ReferenceType.Comment: return "Comment reference";
|
||||
case ReferenceType.String: return "String reference";
|
||||
case ReferenceType.Inactive: return "Inactive reference";
|
||||
case ReferenceType.CannotConfirm: return "Cannot confirm reference";
|
||||
case ReferenceType.NotAReference: return "Not a reference";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private processReferencesResult(referencesResult: ReferencesResult): void {
|
||||
this.referencesViewFindPending = false;
|
||||
this.referencesChannel.clear();
|
||||
|
||||
if (this.referencesStartedWhileTagParsing) {
|
||||
this.referencesChannel.appendLine("[Warning] Some references may be missing, because workspace parsing was incomplete when " +
|
||||
referencesCommandModeToString(this.model.referencesCommandMode.Value) + " was started.");
|
||||
this.referencesChannel.appendLine("");
|
||||
}
|
||||
|
||||
for (let reference of referencesResult.referenceInfos) {
|
||||
let isFileReference: boolean = reference.position.line === 0 && reference.position.character === 0;
|
||||
this.referencesChannel.appendLine("[" + this.convertReferenceTypeToString(reference.type) + "] " +
|
||||
reference.file + (!isFileReference ? ":" + (reference.position.line + 1) + ":" + (reference.position.character + 1) : "") + " " + reference.text);
|
||||
}
|
||||
|
||||
if (this.referencesStartedWhileTagParsing || referencesResult.referenceInfos.length !== 0) {
|
||||
this.referencesChannel.show(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getLanguageServerFileName(): string {
|
||||
@@ -1603,9 +1993,11 @@ function getLanguageServerFileName(): string {
|
||||
class NullClient implements Client {
|
||||
private booleanEvent = new vscode.EventEmitter<boolean>();
|
||||
private stringEvent = new vscode.EventEmitter<string>();
|
||||
private referencesCommandModeEvent = new vscode.EventEmitter<ReferencesCommandMode>();
|
||||
|
||||
public get TagParsingChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
|
||||
public get IntelliSenseParsingChanged(): vscode.Event<boolean> { return this.booleanEvent.event; }
|
||||
public get ReferencesCommandModeChanged(): vscode.Event<ReferencesCommandMode> { return this.referencesCommandModeEvent.event; }
|
||||
public get NavigationLocationChanged(): vscode.Event<string> { return this.stringEvent.event; }
|
||||
public get TagParserStatusChanged(): vscode.Event<string> { return this.stringEvent.event; }
|
||||
public get ActiveConfigChanged(): vscode.Event<string> { return this.stringEvent.event; }
|
||||
@@ -1621,17 +2013,18 @@ class NullClient implements Client {
|
||||
onRegisterCustomConfigurationProvider(provider: CustomConfigurationProvider1): Thenable<void> { return Promise.resolve(); }
|
||||
updateCustomConfigurations(requestingProvider?: CustomConfigurationProvider1): Thenable<void> { return Promise.resolve(); }
|
||||
updateCustomBrowseConfiguration(requestingProvider?: CustomConfigurationProvider1): Thenable<void> { return Promise.resolve(); }
|
||||
provideCustomConfiguration(document: vscode.TextDocument): Promise<void> { return Promise.resolve(); }
|
||||
provideCustomConfiguration(docUri: vscode.Uri, requestFile?: string): Promise<void> { return Promise.resolve(); }
|
||||
logDiagnostics(): Promise<void> { return Promise.resolve(); }
|
||||
rescanFolder(): Promise<void> { return Promise.resolve(); }
|
||||
getCurrentConfigName(): Thenable<string> { return Promise.resolve(""); }
|
||||
getCompilerPath(): Thenable<string> { return Promise.resolve(""); }
|
||||
getVcpkgInstalled(): Thenable<boolean> { return Promise.resolve(false); }
|
||||
getVcpkgEnabled(): Thenable<boolean> { return Promise.resolve(false); }
|
||||
getCurrentCompilerPathAndArgs(): Thenable<util.CompilerPathAndArgs> { return Promise.resolve(undefined); }
|
||||
getKnownCompilers(): Thenable<configs.KnownCompiler[]> { return Promise.resolve([]); }
|
||||
takeOwnership(document: vscode.TextDocument): void {}
|
||||
queueTask<T>(task: () => Thenable<T>): Thenable<T> { return task(); }
|
||||
requestWhenReady(request: () => Thenable<any>): Thenable<any> { return; }
|
||||
notifyWhenReady(notify: () => void): void {}
|
||||
requestGoToDeclaration(): Thenable<void> { return Promise.resolve(); }
|
||||
requestSwitchHeaderSource(rootPath: string, fileName: string): Thenable<string> { return Promise.resolve(""); }
|
||||
requestNavigationList(document: vscode.TextDocument): Thenable<string> { return Promise.resolve(""); }
|
||||
activeDocumentChanged(document: vscode.TextDocument): void {}
|
||||
@@ -1644,6 +2037,7 @@ class NullClient implements Client {
|
||||
handleConfigurationSelectCommand(): void {}
|
||||
handleConfigurationProviderSelectCommand(): void {}
|
||||
handleShowParsingCommands(): void {}
|
||||
handleReferencesIcon(): void {}
|
||||
handleConfigurationEditCommand(): void {}
|
||||
handleConfigurationEditJSONCommand(): void {}
|
||||
handleConfigurationEditUICommand(): void {}
|
||||
|
||||
@@ -99,7 +99,7 @@ export class ClientCollection {
|
||||
* creates a new client to replace one that crashed.
|
||||
*/
|
||||
public replace(client: cpptools.Client, transferFileOwnership: boolean): cpptools.Client {
|
||||
let key: string = undefined;
|
||||
let key: string;
|
||||
for (let pair of this.languageClients) {
|
||||
if (pair[1] === client) {
|
||||
key = pair[0];
|
||||
@@ -211,4 +211,4 @@ export class ClientCollection {
|
||||
this.languageClients.clear();
|
||||
return Promise.all(promises).then(() => undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export enum TokenKind {
|
||||
|
||||
interface VersionedEdits {
|
||||
editVersion: number;
|
||||
changes: vscode.TextDocumentContentChangeEvent[];
|
||||
changes: readonly vscode.TextDocumentContentChangeEvent[];
|
||||
}
|
||||
|
||||
class ThemeStyle {
|
||||
@@ -204,8 +204,8 @@ export class ColorizationSettings {
|
||||
|
||||
// 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.themeStyleCMap[i] = {...defaultStyle};
|
||||
this.themeStyleCppMap[i] = {...defaultStyle};
|
||||
}
|
||||
|
||||
this.calculateStyleForToken(TokenKind.Macro, "entity.name.function.preprocessor", themeName, textMateRules);
|
||||
@@ -424,7 +424,7 @@ export class ColorizationState {
|
||||
}
|
||||
}
|
||||
|
||||
// Normally, decorators are honored in the order in which they were created, not the
|
||||
// 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.
|
||||
@@ -554,7 +554,7 @@ export class ColorizationState {
|
||||
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[] {
|
||||
private fixRanges(originalRanges: vscode.Range[], changes: readonly 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) {
|
||||
@@ -574,7 +574,7 @@ export class ColorizationState {
|
||||
}
|
||||
|
||||
// Add edits to be applied when/if cached tokens need to be reapplied.
|
||||
public addEdits(changes: vscode.TextDocumentContentChangeEvent[], editVersion: number): void {
|
||||
public addEdits(changes: readonly vscode.TextDocumentContentChangeEvent[], editVersion: number): void {
|
||||
let edits: VersionedEdits = {
|
||||
editVersion: editVersion,
|
||||
changes: changes
|
||||
|
||||
@@ -50,6 +50,7 @@ export interface ConfigurationJson {
|
||||
export interface Configuration {
|
||||
name: string;
|
||||
compilerPath?: string;
|
||||
compilerArgs?: string[];
|
||||
knownCompilers?: KnownCompiler[];
|
||||
cStandard?: string;
|
||||
cppStandard?: string;
|
||||
@@ -88,6 +89,7 @@ export interface KnownCompiler {
|
||||
|
||||
export interface CompilerDefaults {
|
||||
compilerPath: string;
|
||||
compilerArgs: string[];
|
||||
knownCompilers: KnownCompiler[];
|
||||
cStandard: string;
|
||||
cppStandard: string;
|
||||
@@ -148,7 +150,6 @@ export class CppProperties {
|
||||
public get Configurations(): Configuration[] { return this.configurationJson ? this.configurationJson.configurations : null; }
|
||||
public get CurrentConfigurationIndex(): number { return this.currentConfigurationIndex.Value; }
|
||||
public get CurrentConfiguration(): Configuration { return this.Configurations ? this.Configurations[this.CurrentConfigurationIndex] : null; }
|
||||
public get CompilerPath(): string { return this.CurrentConfiguration ? this.CurrentConfiguration.compilerPath : null; }
|
||||
public get KnownCompiler(): KnownCompiler[] { return this.knownCompilers; }
|
||||
|
||||
public get CurrentConfigurationProvider(): string|null {
|
||||
@@ -178,12 +179,12 @@ export class CppProperties {
|
||||
// defaultPaths is only used when there isn't a c_cpp_properties.json, but we don't send the configuration changed event
|
||||
// to the language server until the default include paths and frameworks have been sent.
|
||||
let configFilePath: string = path.join(this.configFolder, "c_cpp_properties.json");
|
||||
if (fs.existsSync(configFilePath)) {
|
||||
if (this.rootUri !== null && fs.existsSync(configFilePath)) {
|
||||
this.propertiesFile = vscode.Uri.file(configFilePath);
|
||||
} else {
|
||||
this.propertiesFile = null;
|
||||
}
|
||||
|
||||
|
||||
let settingsPath: string = path.join(this.configFolder, this.configurationGlobPattern);
|
||||
this.configFileWatcher = vscode.workspace.createFileSystemWatcher(settingsPath);
|
||||
this.disposables.push(this.configFileWatcher);
|
||||
@@ -403,7 +404,7 @@ export class CppProperties {
|
||||
return true;
|
||||
}
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(configuration.compilerPath);
|
||||
return (compilerPathAndArgs.compilerName === "cl.exe") === (configuration.intelliSenseMode === "msvc-x64");
|
||||
return (compilerPathAndArgs.compilerName === "cl.exe") === (configuration.intelliSenseMode === "msvc-x64" || configuration.intelliSenseMode === "msvc-x86");
|
||||
}
|
||||
|
||||
public addToIncludePathCommand(path: string): void {
|
||||
@@ -544,6 +545,7 @@ export class CppProperties {
|
||||
configuration.forcedInclude = this.updateConfiguration(configuration.forcedInclude, settings.defaultForcedInclude, env);
|
||||
configuration.compileCommands = this.updateConfiguration(configuration.compileCommands, settings.defaultCompileCommands, env);
|
||||
configuration.compilerPath = this.updateConfiguration(configuration.compilerPath, settings.defaultCompilerPath, env);
|
||||
configuration.compilerArgs = this.updateConfiguration(configuration.compilerArgs, settings.defaultCompilerArgs, env);
|
||||
configuration.cStandard = this.updateConfiguration(configuration.cStandard, settings.defaultCStandard, env);
|
||||
configuration.cppStandard = this.updateConfiguration(configuration.cppStandard, settings.defaultCppStandard, env);
|
||||
configuration.intelliSenseMode = this.updateConfiguration(configuration.intelliSenseMode, settings.defaultIntelliSenseMode, env);
|
||||
@@ -559,9 +561,9 @@ export class CppProperties {
|
||||
} else if (configuration.includePath) {
|
||||
// If the user doesn't set browse.path, copy the includePath over. Make sure ${workspaceFolder} is in there though...
|
||||
configuration.browse.path = configuration.includePath.slice(0);
|
||||
if (-1 === configuration.includePath.findIndex((value: string, index: number) => {
|
||||
return !!value.match(/^\$\{(workspaceRoot|workspaceFolder)\}(\\\*{0,2}|\/\*{0,2})?$/g);
|
||||
})) {
|
||||
if (configuration.includePath.findIndex((value: string, index: number) =>
|
||||
!!value.match(/^\$\{(workspaceRoot|workspaceFolder)\}(\\\*{0,2}|\/\*{0,2})?$/g)) === -1
|
||||
) {
|
||||
configuration.browse.path.push("${workspaceFolder}");
|
||||
}
|
||||
}
|
||||
@@ -579,6 +581,9 @@ export class CppProperties {
|
||||
}
|
||||
}
|
||||
|
||||
private compileCommandsFileWatcherTimer: NodeJS.Timer;
|
||||
private compileCommandsFileWatcherFiles: Set<string> = new Set<string>();
|
||||
|
||||
// Dispose existing and loop through cpp and populate with each file (exists or not) as you go.
|
||||
// paths are expected to have variables resolved already
|
||||
public updateCompileCommandsFileWatchers(): void {
|
||||
@@ -586,16 +591,32 @@ export class CppProperties {
|
||||
this.compileCommandFileWatchers = []; //reset it
|
||||
let filePaths: Set<string> = new Set<string>();
|
||||
this.configurationJson.configurations.forEach(c => {
|
||||
if (c.compileCommands !== undefined && fs.existsSync(c.compileCommands)) {
|
||||
filePaths.add(c.compileCommands);
|
||||
if (c.compileCommands !== undefined) {
|
||||
let fileSystemCompileCommandsPath : string = this.resolvePath(c.compileCommands, os.platform() === "win32");
|
||||
if (fs.existsSync(fileSystemCompileCommandsPath)) {
|
||||
filePaths.add(fileSystemCompileCommandsPath);
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
filePaths.forEach((path: string) => {
|
||||
this.compileCommandFileWatchers.push(fs.watch(path, (event: string, filename: string) => {
|
||||
if (event !== "rename") {
|
||||
this.onCompileCommandsChanged(path);
|
||||
if (event === "rename") {
|
||||
return;
|
||||
}
|
||||
// Wait 1 second after a change to allow time for the write to finish.
|
||||
if (this.compileCommandsFileWatcherTimer) {
|
||||
clearInterval(this.compileCommandsFileWatcherTimer);
|
||||
}
|
||||
this.compileCommandsFileWatcherFiles.add(path);
|
||||
this.compileCommandsFileWatcherTimer = setTimeout(() => {
|
||||
this.compileCommandsFileWatcherFiles.forEach((path: string) => {
|
||||
this.onCompileCommandsChanged(path);
|
||||
});
|
||||
clearInterval(this.compileCommandsFileWatcherTimer);
|
||||
this.compileCommandsFileWatcherFiles.clear();
|
||||
this.compileCommandsFileWatcherTimer = null;
|
||||
}, 1000);
|
||||
}));
|
||||
});
|
||||
} catch (e) {
|
||||
@@ -928,7 +949,7 @@ export class CppProperties {
|
||||
compilerPathAndArgs.additionalArgs &&
|
||||
!resolvedCompilerPath.startsWith('"') &&
|
||||
compilerPathAndArgs.compilerPath.includes(" ");
|
||||
|
||||
|
||||
let compilerPathErrors: string[] = [];
|
||||
if (compilerPathNeedsQuotes) {
|
||||
compilerPathErrors.push(`Compiler path with spaces and arguments is missing double quotes " around the path.`);
|
||||
@@ -999,7 +1020,7 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let errorMsg: string = undefined;
|
||||
let errorMsg: string;
|
||||
let errors: string[] = [];
|
||||
let paths: string[] = [];
|
||||
|
||||
@@ -1009,6 +1030,9 @@ export class CppProperties {
|
||||
paths = input;
|
||||
}
|
||||
|
||||
// Resolve and split any environment variables
|
||||
paths = this.resolveAndSplit(paths, undefined, this.ExtendedEnvironment);
|
||||
|
||||
for (let p of paths) {
|
||||
let pathExists: boolean = true;
|
||||
let resolvedPath: string = this.resolvePath(p, isWindows);
|
||||
@@ -1055,13 +1079,13 @@ export class CppProperties {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.configurationJson.enableConfigurationSquiggles === false) {
|
||||
if (!this.configurationJson.enableConfigurationSquiggles) {
|
||||
this.diagnosticCollection.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
const settings: CppSettings = new CppSettings(this.rootUri);
|
||||
if (settings.defaultEnableConfigurationSquiggles === false) {
|
||||
if (!settings.defaultEnableConfigurationSquiggles) {
|
||||
this.diagnosticCollection.clear();
|
||||
return;
|
||||
}
|
||||
@@ -1082,6 +1106,15 @@ export class CppProperties {
|
||||
if (!currentConfiguration.name) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get env text
|
||||
let envText: string;
|
||||
const envStart: number = curText.search(/\"env\"\s*:\s*\{/);
|
||||
const envEnd: number = envStart === -1 ? -1 : curText.indexOf("},", envStart);
|
||||
envText = curText.substr(envStart, envEnd);
|
||||
const envTextStartOffSet: number = envStart + 1;
|
||||
|
||||
// Get current config text
|
||||
const configStart: number = curText.search(new RegExp(`{\\s*"name"\\s*:\\s*"${escapeStringRegExp(currentConfiguration.name)}"`));
|
||||
if (configStart === -1) {
|
||||
telemetry.logLanguageServerEvent("ConfigSquiggles", { "error": "config name not first" });
|
||||
@@ -1131,24 +1164,27 @@ export class CppProperties {
|
||||
}
|
||||
|
||||
// Check for path-related squiggles.
|
||||
let paths: Set<string> = new Set<string>();
|
||||
let paths: string[] = [];
|
||||
for (let pathArray of [ (currentConfiguration.browse ? currentConfiguration.browse.path : undefined),
|
||||
currentConfiguration.includePath, currentConfiguration.macFrameworkPath, currentConfiguration.forcedInclude ] ) {
|
||||
currentConfiguration.includePath, currentConfiguration.macFrameworkPath, currentConfiguration.forcedInclude ]) {
|
||||
if (pathArray) {
|
||||
for (let curPath of pathArray) {
|
||||
paths.add(`${curPath}`);
|
||||
paths.push(`${curPath}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (currentConfiguration.compileCommands) {
|
||||
paths.add(`${currentConfiguration.compileCommands}`);
|
||||
paths.push(`${currentConfiguration.compileCommands}`);
|
||||
}
|
||||
|
||||
if (currentConfiguration.compilerPath) {
|
||||
// Unlike other cases, compilerPath may not start or end with " due to trimming of whitespace and the possibility of compiler args.
|
||||
paths.add(`${currentConfiguration.compilerPath}`);
|
||||
paths.push(`${currentConfiguration.compilerPath}`);
|
||||
}
|
||||
|
||||
// Resolve and split any environment variables
|
||||
paths = this.resolveAndSplit(paths, undefined, this.ExtendedEnvironment);
|
||||
|
||||
// Get the start/end for properties that are file-only.
|
||||
const forcedIncludeStart: number = curText.search(/\s*\"forcedInclude\"\s*:\s*\[/);
|
||||
const forcedeIncludeEnd: number = forcedIncludeStart === -1 ? -1 : curText.indexOf("]", forcedIncludeStart);
|
||||
@@ -1157,6 +1193,7 @@ export class CppProperties {
|
||||
const compilerPathStart: number = curText.search(/\s*\"compilerPath\"\s*:\s*\"/);
|
||||
const compilerPathEnd: number = compilerPathStart === -1 ? -1 : curText.indexOf('"', curText.indexOf('"', curText.indexOf(":", compilerPathStart)) + 1) + 1;
|
||||
|
||||
// Validate paths
|
||||
for (let curPath of paths) {
|
||||
const isCompilerPath: boolean = curPath === currentConfiguration.compilerPath;
|
||||
// Resolve special path cases.
|
||||
@@ -1170,8 +1207,6 @@ export class CppProperties {
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: Invalid paths created from environment variables are not detected.
|
||||
|
||||
let compilerPathNeedsQuotes: boolean = false;
|
||||
if (isCompilerPath) {
|
||||
resolvedPath = resolvedPath.trim();
|
||||
@@ -1224,11 +1259,11 @@ export class CppProperties {
|
||||
// Create a pattern to search for the path with either a quote or semicolon immediately before and after,
|
||||
// and extend that pattern to the next quote before and next quote after it.
|
||||
let pattern: RegExp = new RegExp(`"[^"]*?(?<="|;)${escapedPath}(?="|;).*?"`, "g");
|
||||
let matches: string[] = curText.match(pattern);
|
||||
if (matches) {
|
||||
let configMatches: string[] = curText.match(pattern);
|
||||
if (configMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (let curMatch of matches) {
|
||||
for (let curMatch of configMatches) {
|
||||
curOffset = curText.substr(endOffset).search(pattern) + endOffset;
|
||||
endOffset = curOffset + curMatch.length;
|
||||
let message: string;
|
||||
@@ -1260,12 +1295,39 @@ export class CppProperties {
|
||||
}
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(curTextStartOffset + curOffset),
|
||||
document.positionAt(curTextStartOffset + endOffset)),
|
||||
document.positionAt(curTextStartOffset + endOffset)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
diagnostics.push(diagnostic);
|
||||
}
|
||||
} else if (envText) {
|
||||
let envMatches: string[] = envText.match(pattern);
|
||||
if (envMatches) {
|
||||
let curOffset: number = 0;
|
||||
let endOffset: number = 0;
|
||||
for (let curMatch of envMatches) {
|
||||
curOffset = envText.substr(endOffset).search(pattern) + endOffset;
|
||||
endOffset = curOffset + curMatch.length;
|
||||
let message: string;
|
||||
if (!pathExists) {
|
||||
message = `Cannot find "${resolvedPath}".`;
|
||||
newSquiggleMetrics.PathNonExistent++;
|
||||
} else {
|
||||
if (util.checkDirectoryExistsSync(resolvedPath)) {
|
||||
continue;
|
||||
}
|
||||
message = `Path is not a directory: "${resolvedPath}".`;
|
||||
newSquiggleMetrics.PathNotADirectory++;
|
||||
}
|
||||
let diagnostic: vscode.Diagnostic = new vscode.Diagnostic(
|
||||
new vscode.Range(document.positionAt(envTextStartOffSet + curOffset),
|
||||
document.positionAt(envTextStartOffSet + endOffset)),
|
||||
message, vscode.DiagnosticSeverity.Warning);
|
||||
diagnostics.push(diagnostic);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (diagnostics.length !== 0) {
|
||||
this.diagnosticCollection.set(document.uri, diagnostics);
|
||||
} else {
|
||||
|
||||
@@ -50,6 +50,9 @@ class CustomProviderWrapper implements CustomConfigurationProvider1 {
|
||||
if (valid && this._version > Version.v1) {
|
||||
valid = !!(this.provider.canProvideBrowseConfiguration && this.provider.provideBrowseConfiguration);
|
||||
}
|
||||
if (valid && this._version > Version.v2) {
|
||||
valid = !!(this.provider.canProvideBrowseConfigurationsPerFolder && this.provider.provideFolderBrowseConfiguration);
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
@@ -82,6 +85,15 @@ class CustomProviderWrapper implements CustomConfigurationProvider1 {
|
||||
return this._version < Version.v2 ? Promise.resolve({browsePath: []}) : this.provider.provideBrowseConfiguration(token);
|
||||
}
|
||||
|
||||
public canProvideBrowseConfigurationsPerFolder(token?: vscode.CancellationToken): Thenable<boolean> {
|
||||
return this._version < Version.v3 ? Promise.resolve(false) : this.provider.canProvideBrowseConfigurationsPerFolder(token);
|
||||
}
|
||||
|
||||
public provideFolderBrowseConfiguration(uri: vscode.Uri, token?: vscode.CancellationToken): Thenable<WorkspaceBrowseConfiguration> {
|
||||
console.assert(this._version >= Version.v3);
|
||||
return this._version < Version.v3 ? Promise.resolve({browsePath: []}) : this.provider.provideFolderBrowseConfiguration(uri, token);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
if (this._version !== Version.v0) {
|
||||
this.provider.dispose();
|
||||
@@ -115,6 +127,12 @@ export class CustomConfigurationProviderCollection {
|
||||
if (version >= Version.v2 && !provider.provideBrowseConfiguration) {
|
||||
missing.push("'provideBrowseConfiguration'");
|
||||
}
|
||||
if (version >= Version.v3 && !provider.canProvideBrowseConfigurationsPerFolder) {
|
||||
missing.push("'canProvideBrowseConfigurationsPerFolder'");
|
||||
}
|
||||
if (version >= Version.v3 && !provider.provideFolderBrowseConfiguration) {
|
||||
missing.push("'provideFolderBrowseConfiguration'");
|
||||
}
|
||||
console.error(`CustomConfigurationProvider was not registered. The following properties are missing from the implementation: ${missing.join(", ")}.`);
|
||||
}
|
||||
|
||||
@@ -171,7 +189,7 @@ export class CustomConfigurationProviderCollection {
|
||||
}
|
||||
|
||||
public forEach(func: (provider: CustomConfigurationProvider1) => void): void {
|
||||
this.providers.forEach(provider => func(provider));
|
||||
this.providers.forEach(func);
|
||||
}
|
||||
|
||||
public remove(provider: CustomConfigurationProvider): void {
|
||||
@@ -212,4 +230,4 @@ let providerCollection: CustomConfigurationProviderCollection = new CustomConfig
|
||||
|
||||
export function getCustomConfigProviders(): CustomConfigurationProviderCollection {
|
||||
return providerCollection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,4 @@ export class DataBinding<T> {
|
||||
this.deactivate();
|
||||
this.valueChanged.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ import { getTargetBuildInfo, BuildInfo } from '../githubAPI';
|
||||
import * as configs from './configurations';
|
||||
import { PackageVersion } from '../packageVersion';
|
||||
import { getTemporaryCommandRegistrarInstance } from '../commands';
|
||||
import * as rd from 'readline';
|
||||
import * as yauzl from 'yauzl';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
let prevCrashFile: string;
|
||||
let clients: ClientCollection;
|
||||
@@ -42,8 +45,98 @@ let buildInfoCache: BuildInfo | null = null;
|
||||
const taskSourceStr: string = "C/C++";
|
||||
const cppInstallVsixStr: string = 'C/C++: Install vsix -- ';
|
||||
let taskProvider: vscode.Disposable;
|
||||
let codeActionProvider: vscode.Disposable;
|
||||
const intelliSenseDisabledError: string = "Do not activate the extension when IntelliSense is disabled.";
|
||||
|
||||
type vcpkgDatabase = { [key: string]: string[] }; // Stored as <header file entry> -> [<port name>]
|
||||
let vcpkgDbPromise: Promise<vcpkgDatabase>;
|
||||
function initVcpkgDatabase(): Promise<vcpkgDatabase> {
|
||||
return new Promise((resolve, reject) => {
|
||||
yauzl.open(util.getExtensionFilePath('VCPkgHeadersDatabase.zip'), { lazyEntries: true }, (err? : Error, zipfile?: yauzl.ZipFile) => {
|
||||
if (err) {
|
||||
resolve({});
|
||||
return;
|
||||
}
|
||||
zipfile.readEntry();
|
||||
let dbFound: boolean = false;
|
||||
zipfile.on('entry', entry => {
|
||||
if (entry.fileName !== 'VCPkgHeadersDatabase.txt') {
|
||||
return;
|
||||
}
|
||||
dbFound = true;
|
||||
zipfile.openReadStream(entry, (err?: Error, stream?: Readable) => {
|
||||
if (err) {
|
||||
resolve({});
|
||||
return;
|
||||
}
|
||||
let database: vcpkgDatabase = {};
|
||||
let reader: rd.ReadLine = rd.createInterface(stream);
|
||||
reader.on('line', (lineText: string) => {
|
||||
let portFilePair: string[] = lineText.split(':');
|
||||
if (portFilePair.length !== 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const portName: string = portFilePair[0];
|
||||
const relativeHeader: string = portFilePair[1];
|
||||
|
||||
if (!database[relativeHeader]) {
|
||||
database[relativeHeader] = [];
|
||||
}
|
||||
|
||||
database[relativeHeader].push(portName);
|
||||
});
|
||||
reader.on('close', () => {
|
||||
resolve(database);
|
||||
});
|
||||
});
|
||||
});
|
||||
zipfile.on('end', () => {
|
||||
if (!dbFound) {
|
||||
resolve({});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getVcpkgHelpAction(): vscode.CodeAction {
|
||||
const dummy: any[] = [{}]; // To distinguish between entry from CodeActions and the command palette
|
||||
return {
|
||||
command: { title: 'vcpkgOnlineHelpSuggested', command: 'C_Cpp.VcpkgOnlineHelpSuggested', arguments: dummy },
|
||||
title: "Learn how to install a library for this header with vcpkg",
|
||||
kind: vscode.CodeActionKind.QuickFix
|
||||
};
|
||||
}
|
||||
|
||||
function getVcpkgClipboardInstallAction(port: string): vscode.CodeAction {
|
||||
return {
|
||||
command: { title: 'vcpkgClipboardInstallSuggested', command: 'C_Cpp.VcpkgClipboardInstallSuggested', arguments: [[port]] },
|
||||
title: `Copy vcpkg command to install '${port}' to the clipboard`,
|
||||
kind: vscode.CodeActionKind.QuickFix
|
||||
};
|
||||
}
|
||||
|
||||
async function lookupIncludeInVcpkg(document: vscode.TextDocument, line: number): Promise<string[]> {
|
||||
const matches : RegExpMatchArray = document.lineAt(line).text.match(/#include\s*[<"](?<includeFile>[^>"]*)[>"]/);
|
||||
if (!matches.length) {
|
||||
return [];
|
||||
}
|
||||
const missingHeader: string = matches.groups['includeFile'].replace('/', '\\');
|
||||
|
||||
let portsWithHeader: string[];
|
||||
const vcpkgDb: vcpkgDatabase = await vcpkgDbPromise;
|
||||
if (vcpkgDb) {
|
||||
portsWithHeader = vcpkgDb[missingHeader];
|
||||
}
|
||||
return portsWithHeader ? portsWithHeader : [];
|
||||
}
|
||||
|
||||
function isMissingIncludeDiagnostic(diagnostic: vscode.Diagnostic): boolean {
|
||||
const missingIncludeCode: number = 1696;
|
||||
return diagnostic.code && diagnostic.code === missingIncludeCode && diagnostic.source && diagnostic.source === 'C/C++';
|
||||
}
|
||||
|
||||
/**
|
||||
* activate: set up the extension for language services
|
||||
*/
|
||||
@@ -61,7 +154,7 @@ export function activate(activationEventOccurred: boolean): void {
|
||||
}
|
||||
|
||||
if (tempCommands.length === 0) { // Only needs to be added once.
|
||||
tempCommands.push(vscode.workspace.onDidOpenTextDocument(d => onDidOpenTextDocument(d)));
|
||||
tempCommands.push(vscode.workspace.onDidOpenTextDocument(onDidOpenTextDocument));
|
||||
}
|
||||
|
||||
// Check if an activation event has already occurred.
|
||||
@@ -85,6 +178,33 @@ export function activate(activationEventOccurred: boolean): void {
|
||||
}
|
||||
});
|
||||
|
||||
const selector: vscode.DocumentSelector = [
|
||||
{ scheme: 'file', language: 'cpp' },
|
||||
{ scheme: 'file', language: 'c' }
|
||||
];
|
||||
codeActionProvider = vscode.languages.registerCodeActionsProvider(selector, {
|
||||
provideCodeActions: async (document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext, token: vscode.CancellationToken): Promise<vscode.CodeAction[]> => {
|
||||
if (!await clients.ActiveClient.getVcpkgEnabled()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Generate vcpkg install/help commands if the incoming doc/range is a missing include error
|
||||
if (!context.diagnostics.some(isMissingIncludeDiagnostic)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
telemetry.logLanguageServerEvent('codeActionsProvided', { "source": "vcpkg" });
|
||||
|
||||
if (!await clients.ActiveClient.getVcpkgInstalled()) {
|
||||
return [getVcpkgHelpAction()];
|
||||
}
|
||||
|
||||
const ports: string[] = await lookupIncludeInVcpkg(document, range.start.line);
|
||||
const actions: vscode.CodeAction[] = ports.map<vscode.CodeAction>(getVcpkgClipboardInstallAction);
|
||||
return actions;
|
||||
}
|
||||
});
|
||||
|
||||
// handle "workspaceContains:/.vscode/c_cpp_properties.json" activation event.
|
||||
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
|
||||
for (let i: number = 0; i < vscode.workspace.workspaceFolders.length; ++i) {
|
||||
@@ -115,7 +235,7 @@ export interface BuildTaskDefinition extends vscode.TaskDefinition {
|
||||
/**
|
||||
* Generate tasks to build the current file based on the user's detected compilers, the user's compilerPath setting, and the current file's extension.
|
||||
*/
|
||||
export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.Task[]> {
|
||||
export async function getBuildTasks(returnCompilerPath: boolean): Promise<vscode.Task[]> {
|
||||
const editor: vscode.TextEditor = vscode.window.activeTextEditor;
|
||||
if (!editor) {
|
||||
return [];
|
||||
@@ -123,7 +243,7 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
|
||||
|
||||
const fileExt: string = path.extname(editor.document.fileName);
|
||||
if (!fileExt) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
// Don't offer tasks for header files.
|
||||
@@ -147,9 +267,7 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
|
||||
return [];
|
||||
}
|
||||
|
||||
// Get a list of compilers found from the C++ side, then filter them based on the file type to get a reduced list appropriate
|
||||
// for the active file, remove duplicate compiler names, then finally add the user's compilerPath setting.
|
||||
let compilerPaths: string[];
|
||||
// Get compiler paths.
|
||||
const isWindows: boolean = os.platform() === 'win32';
|
||||
let activeClient: Client;
|
||||
try {
|
||||
@@ -160,8 +278,11 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
|
||||
}
|
||||
return []; // Language service features may be disabled.
|
||||
}
|
||||
let userCompilerPath: string = await activeClient.getCompilerPath();
|
||||
if (userCompilerPath) {
|
||||
|
||||
// Get user compiler path.
|
||||
const userCompilerPathAndArgs: util.CompilerPathAndArgs = await activeClient.getCurrentCompilerPathAndArgs();
|
||||
let userCompilerPath: string = userCompilerPathAndArgs.compilerPath;
|
||||
if (userCompilerPath && userCompilerPathAndArgs.compilerName) {
|
||||
userCompilerPath = userCompilerPath.trim();
|
||||
if (isWindows && userCompilerPath.startsWith("/")) { // TODO: Add WSL compiler support.
|
||||
userCompilerPath = null;
|
||||
@@ -170,38 +291,20 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
|
||||
}
|
||||
}
|
||||
|
||||
// Get known compiler paths. Do not include the known compiler path that is the same as user compiler path.
|
||||
// Filter them based on the file type to get a reduced list appropriate for the active file.
|
||||
let knownCompilerPaths: string[];
|
||||
let knownCompilers: configs.KnownCompiler[] = await activeClient.getKnownCompilers();
|
||||
if (knownCompilers) {
|
||||
knownCompilers = knownCompilers.filter(info => {
|
||||
return ((fileIsCpp && !info.isC) || (fileIsC && info.isC)) &&
|
||||
(path.basename(info.path) !== userCompilerPathAndArgs.compilerName) &&
|
||||
(!isWindows || !info.path.startsWith("/")); // TODO: Add WSL compiler support.
|
||||
});
|
||||
compilerPaths = knownCompilers.map<string>(info => { return info.path; });
|
||||
|
||||
let map: Map<string, string> = new Map<string, string>();
|
||||
const insertOrAssignEntry: (compilerPath: string) => void = (compilerPath: string): void => {
|
||||
let basename: string = compilerPath;
|
||||
if (compilerPath === userCompilerPath) {
|
||||
// Make sure the compiler args are not part of the basename.
|
||||
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(compilerPath);
|
||||
basename = compilerPathAndArgs.compilerPath;
|
||||
}
|
||||
basename = path.basename(basename);
|
||||
map.set(basename, compilerPath);
|
||||
};
|
||||
compilerPaths.forEach(insertOrAssignEntry);
|
||||
|
||||
// Ensure that the user's compilerPath setting is used by inserting/assigning last.
|
||||
if (userCompilerPath) {
|
||||
insertOrAssignEntry(userCompilerPath);
|
||||
}
|
||||
|
||||
compilerPaths = [...map.values()];
|
||||
} else if (userCompilerPath) {
|
||||
compilerPaths = [userCompilerPath];
|
||||
knownCompilerPaths = knownCompilers.map<string>(info => info.path);
|
||||
}
|
||||
|
||||
if (!compilerPaths) {
|
||||
if (!knownCompilerPaths || !userCompilerPath) {
|
||||
// Don't prompt a message yet until we can make a data-based decision.
|
||||
telemetry.logLanguageServerEvent('noCompilerFound');
|
||||
// Display a message prompting the user to install compilers if none were found.
|
||||
@@ -228,41 +331,56 @@ export async function getBuildTasks(returnComplerPath: boolean): Promise<vscode.
|
||||
return [];
|
||||
}
|
||||
|
||||
// Generate tasks.
|
||||
return compilerPaths.map<vscode.Task>(compilerPath => {
|
||||
// Handle compiler args in compilerPath.
|
||||
let compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(compilerPath);
|
||||
compilerPath = compilerPathAndArgs.compilerPath;
|
||||
let createTask: (compilerPath: string, compilerArgs?: string []) => vscode.Task = (compilerPath: string, compilerArgs?: string []) => {
|
||||
const filePath: string = path.join('${fileDirname}', '${fileBasenameNoExtension}');
|
||||
const compilerPathBase: string = path.basename(compilerPath);
|
||||
const taskName: string = compilerPathBase + " build active file";
|
||||
const isCl: boolean = taskName.startsWith("cl.exe");
|
||||
let args: string[] = isCl ? [ '/Zi', '/EHsc', '/Fe:', filePath + '.exe', '${file}' ] : ['-g', '${file}', '-o', filePath + (isWindows ? '.exe' : '')];
|
||||
if (compilerPathAndArgs.additionalArgs) {
|
||||
args = args.concat(compilerPathAndArgs.additionalArgs);
|
||||
}
|
||||
const isCl: boolean = compilerPathBase === "cl.exe";
|
||||
const cwd: string = isCl ? "" : path.dirname(compilerPath);
|
||||
const kind: BuildTaskDefinition = {
|
||||
let args: string[] = isCl ? ['/Zi', '/EHsc', '/Fe:', filePath + '.exe', '${file}'] : ['-g', '${file}', '-o', filePath + (isWindows ? '.exe' : '')];
|
||||
if (compilerArgs && compilerArgs.length > 0) {
|
||||
args = args.concat(compilerArgs);
|
||||
}
|
||||
|
||||
let kind: vscode.TaskDefinition = {
|
||||
type: 'shell',
|
||||
label: taskName,
|
||||
command: isCl ? compilerPathBase : compilerPath,
|
||||
args: args,
|
||||
options: isCl ? undefined : {"cwd": cwd},
|
||||
compilerPath: isCl ? compilerPathBase : compilerPath
|
||||
};
|
||||
|
||||
if (returnCompilerPath) {
|
||||
kind = kind as BuildTaskDefinition;
|
||||
kind.compilerPath = isCl ? compilerPathBase : compilerPath;
|
||||
}
|
||||
|
||||
const command: vscode.ShellExecution = new vscode.ShellExecution(compilerPath, [...args], { cwd: cwd });
|
||||
const target: vscode.WorkspaceFolder = vscode.workspace.getWorkspaceFolder(clients.ActiveClient.RootUri);
|
||||
let task: vscode.Task = new vscode.Task(kind, target, taskName, taskSourceStr, command, '$gcc');
|
||||
task.definition = kind; // The constructor for vscode.Task will eat the definition. Reset it by reassigning.
|
||||
task.definition = kind; // The constructor for vscode.Task will consume the definition. Reset it by reassigning.
|
||||
task.group = vscode.TaskGroup.Build;
|
||||
|
||||
if (!returnComplerPath) {
|
||||
delete task.definition.compilerPath;
|
||||
}
|
||||
|
||||
return task;
|
||||
});
|
||||
};
|
||||
|
||||
// Create a build task per compiler path
|
||||
let buildTasks: vscode.Task[] = [];
|
||||
|
||||
// Tasks for known compiler paths
|
||||
if (knownCompilerPaths) {
|
||||
buildTasks = knownCompilerPaths.map<vscode.Task>(compilerPath => {
|
||||
return createTask(compilerPath);
|
||||
});
|
||||
}
|
||||
|
||||
// Task for user compiler path setting
|
||||
if (userCompilerPath) {
|
||||
let task: vscode.Task = createTask(userCompilerPath, userCompilerPathAndArgs.additionalArgs);
|
||||
buildTasks.push(task);
|
||||
}
|
||||
|
||||
return buildTasks;
|
||||
}
|
||||
|
||||
function onDidOpenTextDocument(document: vscode.TextDocument): void {
|
||||
@@ -331,9 +449,11 @@ function realActivation(): void {
|
||||
updateLanguageConfigurations();
|
||||
|
||||
reportMacCrashes();
|
||||
|
||||
|
||||
const settings: CppSettings = new CppSettings(clients.ActiveClient.RootUri);
|
||||
|
||||
|
||||
vcpkgDbPromise = initVcpkgDatabase();
|
||||
|
||||
if (settings.updateChannel === 'Default') {
|
||||
suggestInsidersChannel();
|
||||
} else if (settings.updateChannel === 'Insiders') {
|
||||
@@ -372,7 +492,7 @@ function onDidChangeSettings(event: vscode.ConfigurationChangeEvent): void {
|
||||
} else if (newUpdateChannel === 'Insiders') {
|
||||
insiderUpdateTimer = setInterval(checkAndApplyUpdate, insiderUpdateTimerInterval);
|
||||
}
|
||||
|
||||
|
||||
checkAndApplyUpdate(newUpdateChannel);
|
||||
}
|
||||
}
|
||||
@@ -615,7 +735,7 @@ function applyUpdate(buildInfo: BuildInfo): Promise<void> {
|
||||
reject(new Error('Failed to create vsix file'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Place in try/catch as the .catch call catches a rejection in downloadFileToDestination
|
||||
// then the .catch call will return a resolved promise
|
||||
// Thusly, the .catch call must also throw, as a return would simply return an unused promise
|
||||
@@ -677,7 +797,7 @@ async function checkAndApplyUpdate(updateChannel: string): Promise<void> {
|
||||
let buildInfo: BuildInfo | null = buildInfoCache;
|
||||
// clear buildInfo cache.
|
||||
buildInfoCache = null;
|
||||
|
||||
|
||||
if (!buildInfo) {
|
||||
try {
|
||||
buildInfo = await getTargetBuildInfo(updateChannel);
|
||||
@@ -700,11 +820,10 @@ export function registerCommands(): void {
|
||||
if (commandsRegistered) {
|
||||
return;
|
||||
}
|
||||
|
||||
commandsRegistered = true;
|
||||
getTemporaryCommandRegistrarInstance().clearTempCommands();
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.Navigate', onNavigate));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.GoToDeclaration', onGoToDeclaration));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.PeekDeclaration', onPeekDeclaration));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.SwitchHeaderSource', onSwitchHeaderSource));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ResetDatabase', onResetDatabase));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ConfigurationSelect', onSelectConfiguration));
|
||||
@@ -717,13 +836,15 @@ export function registerCommands(): void {
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.DisableErrorSquiggles', onDisableSquiggles));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleIncludeFallback', onToggleIncludeFallback));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ToggleDimInactiveRegions', onToggleDimInactiveRegions));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReleaseNotes', onShowReleaseNotes));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.PauseParsing', onPauseParsing));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ResumeParsing', onResumeParsing));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ShowParsingCommands', onShowParsingCommands));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.ShowReferencesProgress', onShowReferencesProgress));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.TakeSurvey', onTakeSurvey));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.LogDiagnostics', onLogDiagnostics));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.RescanWorkspace', onRescanWorkspace));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgClipboardInstallSuggested', onVcpkgClipboardInstallSuggested));
|
||||
disposables.push(vscode.commands.registerCommand('C_Cpp.VcpkgOnlineHelpSuggested', onVcpkgOnlineHelpSuggested));
|
||||
disposables.push(vscode.commands.registerCommand('cpptools.activeConfigName', onGetActiveConfigName));
|
||||
getTemporaryCommandRegistrarInstance().executeDelayedCommands();
|
||||
}
|
||||
@@ -740,16 +861,6 @@ function onNavigate(): void {
|
||||
});
|
||||
}
|
||||
|
||||
function onGoToDeclaration(): void {
|
||||
onActivationEvent();
|
||||
clients.ActiveClient.requestGoToDeclaration().then(() => vscode.commands.executeCommand("editor.action.goToDeclaration"));
|
||||
}
|
||||
|
||||
function onPeekDeclaration(): void {
|
||||
onActivationEvent();
|
||||
clients.ActiveClient.requestGoToDeclaration().then(() => vscode.commands.executeCommand("editor.action.previewDeclaration"));
|
||||
}
|
||||
|
||||
function onSwitchHeaderSource(): void {
|
||||
onActivationEvent();
|
||||
let activeEditor: vscode.TextEditor = vscode.window.activeTextEditor;
|
||||
@@ -906,11 +1017,6 @@ function onToggleDimInactiveRegions(): void {
|
||||
settings.update<boolean>("dimInactiveRegions", !settings.dimInactiveRegions);
|
||||
}
|
||||
|
||||
function onShowReleaseNotes(): void {
|
||||
onActivationEvent();
|
||||
util.showReleaseNotes();
|
||||
}
|
||||
|
||||
function onPauseParsing(): void {
|
||||
onActivationEvent();
|
||||
selectClient().then(client => client.pauseParsing(), rejected => {});
|
||||
@@ -926,6 +1032,11 @@ function onShowParsingCommands(): void {
|
||||
selectClient().then(client => client.handleShowParsingCommands(), rejected => {});
|
||||
}
|
||||
|
||||
function onShowReferencesProgress(): void {
|
||||
onActivationEvent();
|
||||
selectClient().then(client => client.handleReferencesIcon(), rejected => {});
|
||||
}
|
||||
|
||||
function onTakeSurvey(): void {
|
||||
onActivationEvent();
|
||||
telemetry.logLanguageServerEvent("onTakeSurvey");
|
||||
@@ -933,6 +1044,67 @@ function onTakeSurvey(): void {
|
||||
vscode.commands.executeCommand('vscode.open', uri);
|
||||
}
|
||||
|
||||
function onVcpkgOnlineHelpSuggested(dummy?: any): void {
|
||||
telemetry.logLanguageServerEvent('vcpkgAction', { 'source': dummy ? 'CodeAction' : 'CommandPalette', 'action': 'vcpkgOnlineHelpSuggested' });
|
||||
const uri: vscode.Uri = vscode.Uri.parse(`https://aka.ms/vcpkg`);
|
||||
vscode.commands.executeCommand('vscode.open', uri);
|
||||
}
|
||||
|
||||
async function onVcpkgClipboardInstallSuggested(ports?: string[]): Promise<void> {
|
||||
onActivationEvent();
|
||||
let source: string;
|
||||
if (ports && ports.length) {
|
||||
source = 'CodeAction';
|
||||
} else {
|
||||
source = 'CommandPalette';
|
||||
// Glob up all existing diagnostics for missing includes and look them up in the vcpkg database
|
||||
const missingIncludeLocations: [vscode.TextDocument, number[]][] = [];
|
||||
vscode.languages.getDiagnostics().forEach(uriAndDiagnostics => {
|
||||
// Extract textDocument
|
||||
const textDocument: vscode.TextDocument = vscode.workspace.textDocuments.find(doc => doc.uri.fsPath === uriAndDiagnostics[0].fsPath);
|
||||
if (!textDocument) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Extract lines numbers for missing include diagnostics
|
||||
let lines: number[] = uriAndDiagnostics[1].filter(isMissingIncludeDiagnostic).map<number>(d => d.range.start.line);
|
||||
if (!lines.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Filter duplicate lines
|
||||
lines = lines.filter((line: number, index: number) => {
|
||||
const foundIndex: number = lines.indexOf(line);
|
||||
return foundIndex === index;
|
||||
});
|
||||
|
||||
missingIncludeLocations.push([textDocument, lines]);
|
||||
});
|
||||
if (!missingIncludeLocations.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Queue look ups in the vcpkg database for missing ports; filter out duplicate results
|
||||
let portsPromises: Promise<string[]>[] = [];
|
||||
missingIncludeLocations.forEach(docAndLineNumbers => {
|
||||
docAndLineNumbers[1].forEach(async line => {
|
||||
portsPromises.push(lookupIncludeInVcpkg(docAndLineNumbers[0], line));
|
||||
});
|
||||
});
|
||||
ports = [].concat(...(await Promise.all(portsPromises)));
|
||||
if (!ports.length) {
|
||||
return;
|
||||
}
|
||||
ports = ports.filter((port: string, index: number) => ports.indexOf(port) === index);
|
||||
}
|
||||
|
||||
let installCommand: string = 'vcpkg install';
|
||||
ports.forEach(port => installCommand += ` ${port}`);
|
||||
telemetry.logLanguageServerEvent('vcpkgAction', { 'source': source, 'action': 'vcpkgClipboardInstallSuggested', 'ports': ports.toString() });
|
||||
|
||||
await vscode.env.clipboard.writeText(installCommand);
|
||||
}
|
||||
|
||||
function onGetActiveConfigName(): Thenable<string> {
|
||||
return clients.ActiveClient.getCurrentConfigName();
|
||||
}
|
||||
@@ -1009,7 +1181,7 @@ function handleCrashFileRead(err: NodeJS.ErrnoException, data: string): void {
|
||||
let startVersion: number = data.indexOf("Version:");
|
||||
if (startVersion >= 0) {
|
||||
data = data.substr(startVersion);
|
||||
const binaryVersionMatches: string[] = data.match(/^Version:\s*(\d|\d*\.\d*\.\d*\.\d*)/);
|
||||
const binaryVersionMatches: string[] = data.match(/^Version:\s*(\d*\.\d*\.\d*\.\d*|\d)/);
|
||||
binaryVersion = binaryVersionMatches && binaryVersionMatches.length > 1 ? binaryVersionMatches[1] : "";
|
||||
}
|
||||
|
||||
@@ -1028,7 +1200,7 @@ function handleCrashFileRead(err: NodeJS.ErrnoException, data: string): void {
|
||||
return logCrashTelemetry("No crash end");
|
||||
}
|
||||
data = data.substr(startCrash, endCrash - startCrash);
|
||||
|
||||
|
||||
// Get rid of the memory addresses (which breaks being able get a hit count for each crash call stack).
|
||||
data = data.replace(/0x................ /g, "");
|
||||
data = data.replace(/0x1........ \+ 0/g, "");
|
||||
@@ -1076,6 +1248,9 @@ export function deactivate(): Thenable<void> {
|
||||
if (taskProvider) {
|
||||
taskProvider.dispose();
|
||||
}
|
||||
if (codeActionProvider) {
|
||||
codeActionProvider.dispose();
|
||||
}
|
||||
return clients.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ function getMLContinuationRule(comment: CommentPattern): vscode.OnEnterRule | un
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// When Enter is pressed while the cursor is after '*/' (and '*/' plus leading whitespace is all that is on the line)
|
||||
// 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);
|
||||
@@ -318,4 +318,4 @@ function constructCommentRules(comment: CommentPattern, languageId: string): Rul
|
||||
continue: [],
|
||||
end: []
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import { TextDocument } from 'vscode';
|
||||
import { Middleware } from 'vscode-languageclient';
|
||||
import { ClientCollection } from './clientCollection';
|
||||
import { Client } from './client';
|
||||
@@ -13,7 +14,7 @@ export function createProtocolFilter(me: Client, clients: ClientCollection): Mid
|
||||
// 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 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; };
|
||||
@@ -33,8 +34,14 @@ export function createProtocolFilter(me: Client, clients: ClientCollection): Mid
|
||||
}
|
||||
|
||||
me.onDidOpenTextDocument(document);
|
||||
me.provideCustomConfiguration(document);
|
||||
me.notifyWhenReady(() => sendMessage(document));
|
||||
|
||||
// 'document' is a reference to the live TextDocument. Because the document can change while we wait for
|
||||
// custom configurations, we must clone the current state of the object before yielding the thread.
|
||||
// Theoretically, we should do this everywhere, but there are no other callbacks that read the document
|
||||
// state directly (just the Uri) so there doesn't appear to be a need to do it.
|
||||
const documentCopy: TextDocument = {...document};
|
||||
me.provideCustomConfiguration(document.uri, null);
|
||||
me.notifyWhenReady(() => sendMessage(documentCopy));
|
||||
}
|
||||
},
|
||||
didChange: (textDocumentChangeEvent, sendMessage) => {
|
||||
@@ -82,6 +89,7 @@ export function createProtocolFilter(me: Client, clients: ClientCollection): Mid
|
||||
provideRenameEdits: invoke4,
|
||||
provideDocumentLinks: invoke2,
|
||||
resolveDocumentLink: invoke2,
|
||||
provideDeclaration: invoke3
|
||||
|
||||
// I believe the default handler will do the same thing.
|
||||
// workspace: {
|
||||
|
||||
@@ -29,13 +29,14 @@ 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 experimentalFeatures(): string { return super.Section.get<string>("experimentalFeatures"); }
|
||||
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"); }
|
||||
@@ -56,6 +57,7 @@ export class CppSettings extends Settings {
|
||||
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 vcpkgEnabled(): boolean { return super.Section.get<boolean>("vcpkg.enabled"); }
|
||||
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"); }
|
||||
@@ -64,6 +66,7 @@ export class CppSettings extends Settings {
|
||||
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 defaultCompilerArgs(): string[] { return super.Section.get<string[]>("default.compilerArgs"); }
|
||||
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"); }
|
||||
@@ -117,6 +120,9 @@ export class OtherSettings {
|
||||
|
||||
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 set filesAssociations(value: any) {
|
||||
vscode.workspace.getConfiguration("files", null).update("associations", value, vscode.ConfigurationTarget.Workspace);
|
||||
}
|
||||
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"); }
|
||||
@@ -128,8 +134,4 @@ export class OtherSettings {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ const elementId: { [key: string]: string } = {
|
||||
compilerPath: "compilerPath",
|
||||
compilerPathInvalid: "compilerPathInvalid",
|
||||
knownCompilers: "knownCompilers",
|
||||
compilerArgs: "compilerArgs",
|
||||
|
||||
intelliSenseMode: "intelliSenseMode",
|
||||
intelliSenseModeInvalid: "intelliSenseModeInvalid",
|
||||
@@ -103,8 +104,8 @@ export class SettingsPanel {
|
||||
|
||||
// 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(util.extensionPath),
|
||||
vscode.Uri.file(path.join(util.extensionPath, 'ui')),
|
||||
vscode.Uri.file(path.join(util.extensionPath, 'out', 'ui'))]
|
||||
}
|
||||
);
|
||||
@@ -124,11 +125,11 @@ export class SettingsPanel {
|
||||
this.updateWebview(configSelection, activeConfiguration, errors);
|
||||
}
|
||||
|
||||
public get SettingsPanelActivated(): vscode.Event<void> {
|
||||
public get SettingsPanelActivated(): vscode.Event<void> {
|
||||
return this.settingsPanelActivated.event;
|
||||
}
|
||||
|
||||
public get ConfigValuesChanged(): vscode.Event<void> {
|
||||
public get ConfigValuesChanged(): vscode.Event<void> {
|
||||
return this.configValuesChanged.event;
|
||||
}
|
||||
|
||||
@@ -159,7 +160,7 @@ export class SettingsPanel {
|
||||
}
|
||||
|
||||
public setKnownCompilers(knownCompilers: config.KnownCompiler[], pathSeparator: string): void {
|
||||
if (knownCompilers.length > 0) {
|
||||
if (knownCompilers && knownCompilers.length) {
|
||||
for (let compiler of knownCompilers) {
|
||||
// Normalize path separators.
|
||||
let path: string = compiler.path;
|
||||
@@ -184,7 +185,7 @@ export class SettingsPanel {
|
||||
|
||||
public dispose(): void {
|
||||
// Log any telemetry
|
||||
if (Object.keys(this.telemetry).length > 0) {
|
||||
if (Object.keys(this.telemetry).length) {
|
||||
telemetry.logLanguageServerEvent("ConfigUI", null, this.telemetry);
|
||||
}
|
||||
|
||||
@@ -195,27 +196,27 @@ export class SettingsPanel {
|
||||
this.disposable.dispose();
|
||||
}
|
||||
|
||||
if (this.disposablesPanel) {
|
||||
this.disposablesPanel.dispose();
|
||||
if (this.disposablesPanel) {
|
||||
this.disposablesPanel.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private onPanelDisposed(): void {
|
||||
if (this.disposablesPanel) {
|
||||
this.disposablesPanel.dispose();
|
||||
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.configValues = {...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});
|
||||
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});
|
||||
this.panel.webview.postMessage({ command: 'updateErrors', errors: errors });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,6 +284,9 @@ export class SettingsPanel {
|
||||
case elementId.compilerPath:
|
||||
this.configValues.compilerPath = message.value;
|
||||
break;
|
||||
case elementId.compilerArgs:
|
||||
this.configValues.compilerArgs = splitEntries(message.value);
|
||||
break;
|
||||
case elementId.includePath:
|
||||
this.configValues.includePath = splitEntries(message.value);
|
||||
break;
|
||||
@@ -353,13 +357,13 @@ export class SettingsPanel {
|
||||
content = fs.readFileSync(util.getExtensionFilePath("ui/settings.html")).toString();
|
||||
|
||||
content = content.replace(
|
||||
/{{root}}/g,
|
||||
/{{root}}/g,
|
||||
vscode.Uri.file(util.extensionPath)
|
||||
.with({ scheme: 'vscode-resource' })
|
||||
.toString());
|
||||
|
||||
content = content.replace(
|
||||
/{{nonce}}/g,
|
||||
/{{nonce}}/g,
|
||||
this.getNonce());
|
||||
|
||||
return content;
|
||||
|
||||
@@ -14,7 +14,7 @@ type FilterFunction = (key: string, val: string, settings: vscode.WorkspaceConfi
|
||||
type KeyValuePair = { key: string; value: string };
|
||||
|
||||
const maxSettingLengthForTelemetry: number = 50;
|
||||
let cache: SettingsTracker = undefined;
|
||||
let cache: SettingsTracker;
|
||||
|
||||
export class SettingsTracker {
|
||||
private previousCppSettings: { [key: string]: any } = {};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { Client } from './client';
|
||||
import { Client, ReferencesCommandMode, referencesCommandModeToString } from './client';
|
||||
import { getCustomConfigProviders, CustomConfigurationProviderCollection } from './customProviders';
|
||||
|
||||
let ui: UI;
|
||||
@@ -34,7 +34,9 @@ export class UI {
|
||||
private configStatusBarItem: vscode.StatusBarItem;
|
||||
private browseEngineStatusBarItem: vscode.StatusBarItem;
|
||||
private intelliSenseStatusBarItem: vscode.StatusBarItem;
|
||||
private referencesStatusBarItem: vscode.StatusBarItem;
|
||||
private configurationUIPromise: Thenable<ConfigurationResult>;
|
||||
private readonly referencesPreviewTooltip: string = " (click to preview results)";
|
||||
|
||||
constructor() {
|
||||
// 1000 = priority, it needs to be high enough to be on the left of the Ln/Col.
|
||||
@@ -43,11 +45,18 @@ export class UI {
|
||||
this.navigationStatusBarItem.command = "C_Cpp.Navigate";
|
||||
this.ShowNavigation = true;
|
||||
|
||||
this.configStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 2);
|
||||
this.configStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 3);
|
||||
this.configStatusBarItem.command = "C_Cpp.ConfigurationSelect";
|
||||
this.configStatusBarItem.tooltip = "C/C++ Configuration";
|
||||
this.ShowConfiguration = true;
|
||||
|
||||
this.referencesStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 2);
|
||||
this.referencesStatusBarItem.text = "";
|
||||
this.referencesStatusBarItem.tooltip = "";
|
||||
this.referencesStatusBarItem.color = new vscode.ThemeColor("statusBar.foreground");
|
||||
this.referencesStatusBarItem.command = "C_Cpp.ShowReferencesProgress";
|
||||
this.ShowReferencesIcon = true;
|
||||
|
||||
this.intelliSenseStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 1);
|
||||
this.intelliSenseStatusBarItem.text = "";
|
||||
this.intelliSenseStatusBarItem.tooltip = "Updating IntelliSense...";
|
||||
@@ -85,11 +94,28 @@ export class UI {
|
||||
private get IsUpdatingIntelliSense(): boolean {
|
||||
return this.intelliSenseStatusBarItem.text !== "";
|
||||
}
|
||||
|
||||
private set IsUpdatingIntelliSense(val: boolean) {
|
||||
this.intelliSenseStatusBarItem.text = val ? "$(flame)" : "";
|
||||
this.ShowFlameIcon = val;
|
||||
}
|
||||
|
||||
private get ReferencesCommand(): ReferencesCommandMode {
|
||||
return this.referencesStatusBarItem.tooltip === "" ? ReferencesCommandMode.None :
|
||||
(this.referencesStatusBarItem.tooltip === referencesCommandModeToString(ReferencesCommandMode.Peek) ? ReferencesCommandMode.Peek : ReferencesCommandMode.Find);
|
||||
}
|
||||
|
||||
private set ReferencesCommand(val: ReferencesCommandMode) {
|
||||
if (val === ReferencesCommandMode.None) {
|
||||
this.referencesStatusBarItem.text = "";
|
||||
this.ShowReferencesIcon = false;
|
||||
} else {
|
||||
this.referencesStatusBarItem.text = "$(search)";
|
||||
this.referencesStatusBarItem.tooltip = referencesCommandModeToString(val) + (val === ReferencesCommandMode.Find ? this.referencesPreviewTooltip : "");
|
||||
this.ShowReferencesIcon = true;
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowNavigation(show: boolean) {
|
||||
if (show) {
|
||||
this.navigationStatusBarItem.show();
|
||||
@@ -114,6 +140,14 @@ export class UI {
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowReferencesIcon(show: boolean) {
|
||||
if (show && this.ReferencesCommand !== ReferencesCommandMode.None) {
|
||||
this.referencesStatusBarItem.show();
|
||||
} else {
|
||||
this.referencesStatusBarItem.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private set ShowConfiguration(show: boolean) {
|
||||
if (show) {
|
||||
this.configStatusBarItem.show();
|
||||
@@ -130,14 +164,13 @@ export class UI {
|
||||
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.ReferencesCommandModeChanged(value => { this.ReferencesCommand = value; });
|
||||
client.NavigationLocationChanged(value => { this.NavigationLocation = value; });
|
||||
client.TagParserStatusChanged(value => { this.TagParseStatus = value; });
|
||||
client.ActiveConfigChanged(value => { this.ActiveConfig = value; });
|
||||
@@ -232,7 +265,7 @@ export class UI {
|
||||
} else {
|
||||
items.push({ label: "Pause Parsing", description: "", index: 0 });
|
||||
}
|
||||
|
||||
|
||||
return vscode.window.showQuickPick(items, options)
|
||||
.then(selection => (selection) ? selection.index : -1);
|
||||
}
|
||||
@@ -284,6 +317,7 @@ export class UI {
|
||||
this.configStatusBarItem.dispose();
|
||||
this.browseEngineStatusBarItem.dispose();
|
||||
this.intelliSenseStatusBarItem.dispose();
|
||||
this.referencesStatusBarItem.dispose();
|
||||
this.navigationStatusBarItem.dispose();
|
||||
}
|
||||
}
|
||||
@@ -293,4 +327,4 @@ export function getUI(): UI {
|
||||
ui = new UI();
|
||||
}
|
||||
return ui;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,20 +22,16 @@ class TemporaryCommandRegistrar {
|
||||
"C_Cpp.ConfigurationProviderSelect",
|
||||
"C_Cpp.SwitchHeaderSource",
|
||||
"C_Cpp.Navigate",
|
||||
"C_Cpp.GoToDeclaration",
|
||||
"C_Cpp.PeekDeclaration",
|
||||
"C_Cpp.EnableErrorSquiggles",
|
||||
"C_Cpp.DisableErrorSquiggles",
|
||||
"C_Cpp.ToggleIncludeFallback",
|
||||
"C_Cpp.ToggleDimInactiveRegions",
|
||||
"C_Cpp.ShowReleaseNotes",
|
||||
"C_Cpp.ResetDatabase",
|
||||
"C_Cpp.PauseParsing",
|
||||
"C_Cpp.ResumeParsing",
|
||||
"C_Cpp.ShowParsingCommands",
|
||||
"C_Cpp.TakeSurvey",
|
||||
"C_Cpp.LogDiagnostics",
|
||||
"C_Cpp.RescanWorkspace",
|
||||
"C_Cpp.VcpkgClipboardInstallSuggested",
|
||||
"C_Cpp.VcpkgOnlineHelpSuggested"
|
||||
];
|
||||
|
||||
constructor() {
|
||||
@@ -53,7 +49,7 @@ class TemporaryCommandRegistrar {
|
||||
public registerTempCommand(command: string): void {
|
||||
this.tempCommands.push(vscode.commands.registerCommand(command, () => {
|
||||
if (this.isLanguageServerDisabled) {
|
||||
vscode.window.showInformationMessage("The command is disabled because \"C_Cpp.intelliSenseEngine\" is set to \"Disabled\".");
|
||||
vscode.window.showInformationMessage("This command is disabled because \"C_Cpp.intelliSenseEngine\" is set to \"Disabled\".");
|
||||
return;
|
||||
}
|
||||
this.delayedCommandsToExecute.add(command);
|
||||
@@ -72,7 +68,7 @@ class TemporaryCommandRegistrar {
|
||||
LanguageServer.activate(this.delayedCommandsToExecute.size > 0);
|
||||
this.isActivationReady = true;
|
||||
}
|
||||
|
||||
|
||||
public clearTempCommands(): void {
|
||||
this.tempCommands.forEach((command) => {
|
||||
command.dispose();
|
||||
@@ -96,4 +92,4 @@ export function initializeTemporaryCommandRegistrar(): void {
|
||||
|
||||
export function getTemporaryCommandRegistrarInstance(): TemporaryCommandRegistrar {
|
||||
return tempCommandRegistrar;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-23
@@ -19,6 +19,10 @@ import { ClientRequest, OutgoingHttpHeaders } from 'http';
|
||||
import { getBuildTasks } from './LanguageServer/extension';
|
||||
import { OtherSettings } from './LanguageServer/settings';
|
||||
|
||||
export type Mutable<T> = {
|
||||
-readonly [P in keyof T]: T[P] extends ReadonlyArray<infer U> ? Mutable<U>[] : Mutable<T[P]>
|
||||
};
|
||||
|
||||
export let extensionPath: string;
|
||||
export let extensionContext: vscode.ExtensionContext;
|
||||
export function setExtensionContext(context: vscode.ExtensionContext): void {
|
||||
@@ -59,7 +63,7 @@ export function getRawTasksJson(): Promise<any> {
|
||||
fileContents = fileContents.replace(/^\s*\/\/.*$/gm, ""); // Remove start of line // comments.
|
||||
let rawTasks: any = {};
|
||||
try {
|
||||
rawTasks = JSON.parse(fileContents);
|
||||
rawTasks = JSON.parse(fileContents);
|
||||
} catch (error) {
|
||||
return reject(new Error(failedToParseTasksJson));
|
||||
}
|
||||
@@ -89,10 +93,10 @@ export async function ensureBuildTaskExists(taskName: string): Promise<void> {
|
||||
|
||||
rawTasksJson.version = "2.0.0";
|
||||
|
||||
if (!rawTasksJson.tasks.find(task => { return task.label === selectedTask.definition.label; })) {
|
||||
if (!rawTasksJson.tasks.find(task => task.label === selectedTask.definition.label)) {
|
||||
rawTasksJson.tasks.push(selectedTask.definition);
|
||||
}
|
||||
|
||||
|
||||
// TODO: It's dangerous to overwrite this file. We could be wiping out comments.
|
||||
let settings: OtherSettings = new OtherSettings();
|
||||
await writeFileText(getTasksJsonPath(), JSON.stringify(rawTasksJson, null, settings.editorTabSize));
|
||||
@@ -248,18 +252,6 @@ export function getProgressExecutableSuccess(): number { return progressExecutab
|
||||
export function getProgressParseRootSuccess(): number { return progressParseRootSuccess; } // Parse root was successful (i.e. not blocked by processing taking too long).
|
||||
export function getProgressIntelliSenseNoSquiggles(): number { return progressIntelliSenseNoSquiggles; } // IntelliSense was successful and the user got no squiggles.
|
||||
|
||||
let releaseNotesPanel: vscode.WebviewPanel = undefined;
|
||||
|
||||
export async function showReleaseNotes(): Promise<void> {
|
||||
if (releaseNotesPanel) {
|
||||
releaseNotesPanel.reveal();
|
||||
} else {
|
||||
releaseNotesPanel = vscode.window.createWebviewPanel('releaseNotes', "C/C++ Extension Release Notes", vscode.ViewColumn.One);
|
||||
releaseNotesPanel.webview.html = await readFileText(getExtensionFilePath("ReleaseNotes.html"));
|
||||
releaseNotesPanel.onDidDispose(() => releaseNotesPanel = undefined, null, extensionContext.subscriptions);
|
||||
}
|
||||
}
|
||||
|
||||
export function isUri(input: any): input is vscode.Uri {
|
||||
return input && input instanceof vscode.Uri;
|
||||
}
|
||||
@@ -285,7 +277,7 @@ export function isOptionalString(input: any): input is string|undefined {
|
||||
}
|
||||
|
||||
export function isArrayOfString(input: any): input is string[] {
|
||||
return isArray(input) && input.every(item => isString(item));
|
||||
return isArray(input) && input.every(isString);
|
||||
}
|
||||
|
||||
export function isOptionalArrayOfString(input: any): input is string[]|undefined {
|
||||
@@ -788,24 +780,24 @@ export interface CompilerPathAndArgs {
|
||||
additionalArgs: string[];
|
||||
}
|
||||
|
||||
export function extractCompilerPathAndArgs(inputCompilerPath: string): CompilerPathAndArgs {
|
||||
export function extractCompilerPathAndArgs(inputCompilerPath: string, inputCompilerArgs?: string[]): CompilerPathAndArgs {
|
||||
let compilerPath: string = inputCompilerPath;
|
||||
let compilerName: string = "";
|
||||
let additionalArgs: string[];
|
||||
let additionalArgs: string[] = [];
|
||||
let isWindows: boolean = os.platform() === 'win32';
|
||||
if (compilerPath) {
|
||||
if (compilerPath === "cl.exe") {
|
||||
// Input is only compiler name, this is only for cl.exe
|
||||
compilerName = compilerPath;
|
||||
|
||||
|
||||
} else if (compilerPath.startsWith("\"")) {
|
||||
// Input has quotes around compiler path
|
||||
let endQuote: number = compilerPath.substr(1).search("\"") + 1;
|
||||
if (endQuote !== -1) {
|
||||
additionalArgs = compilerPath.substr(endQuote + 1).split(" ");
|
||||
additionalArgs = additionalArgs.filter((arg: string) => { return arg.trim().length !== 0; }); // Remove empty args.
|
||||
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
|
||||
compilerPath = compilerPath.substr(1, endQuote - 1);
|
||||
compilerName = compilerPath.replace(/^.*(\\|\/|\:)/, '');
|
||||
compilerName = path.basename(compilerPath);
|
||||
}
|
||||
} else {
|
||||
// Input has no quotes but can have a compiler path with spaces and args.
|
||||
@@ -825,16 +817,23 @@ export function extractCompilerPathAndArgs(inputCompilerPath: string): CompilerP
|
||||
if (compilerPath !== potentialCompilerPath) {
|
||||
// Found a valid compilerPath and args.
|
||||
additionalArgs = compilerPath.substr(spaceStart + 1).split(" ");
|
||||
additionalArgs = additionalArgs.filter((arg: string) => { return arg.trim().length !== 0; }); // Remove empty args.
|
||||
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
|
||||
compilerPath = potentialCompilerPath;
|
||||
}
|
||||
}
|
||||
// Get compiler name if there are no args but path is valid or a valid path was found with args.
|
||||
if (compilerPath === "cl.exe" || checkFileExistsSync(compilerPath)) {
|
||||
compilerName = compilerPath.replace(/^.*(\\|\/|\:)/, '');
|
||||
compilerName = path.basename(compilerPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Combine args from inputCompilerPath and inputCompilerArgs and remove duplicates
|
||||
if (inputCompilerArgs && inputCompilerArgs.length) {
|
||||
additionalArgs = inputCompilerArgs.concat(additionalArgs.filter(
|
||||
function (item: string): boolean {
|
||||
return inputCompilerArgs.indexOf(item) < 0;
|
||||
}));
|
||||
}
|
||||
return { compilerPath, compilerName, additionalArgs };
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export class CppTools implements CppToolsTestApi {
|
||||
client.updateCustomBrowseConfiguration(p);
|
||||
});
|
||||
} else if (this.failedRegistrations.find(p => p === provider)) {
|
||||
console.warn("provider not successfully registered, 'notifyReady' ignored");
|
||||
console.warn("provider not successfully registered; 'notifyReady' ignored");
|
||||
} else {
|
||||
console.warn("provider should be registered before signaling it's ready to provide configurations");
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
|
||||
import { CustomConfigurationProvider, Version, CppToolsApi } from 'vscode-cpptools';
|
||||
import { CustomConfigurationProvider, Version, CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
|
||||
import { CppToolsTestApi, CppToolsTestHook, CppToolsTestExtension } from 'vscode-cpptools/out/testApi';
|
||||
import { CppTools } from './cppTools';
|
||||
|
||||
@@ -63,3 +63,35 @@ export class CppTools1 implements CppToolsTestApi, CppToolsTestExtension {
|
||||
return this.BackupApi.getTestHook();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an empty implementation of the API. Used when the extension is activated on
|
||||
* an unsupported platform.
|
||||
*/
|
||||
export class NullCppTools implements CppToolsApi, CppToolsExtension {
|
||||
private version: Version;
|
||||
|
||||
getApi(version: Version): CppToolsApi {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
getVersion(): Version {
|
||||
return this.version;
|
||||
}
|
||||
|
||||
registerCustomConfigurationProvider(provider: CustomConfigurationProvider): void {
|
||||
}
|
||||
|
||||
notifyReady(provider: CustomConfigurationProvider): void {
|
||||
}
|
||||
|
||||
didChangeCustomConfiguration(provider: CustomConfigurationProvider): void {
|
||||
}
|
||||
|
||||
didChangeCustomBrowseConfiguration(provider: CustomConfigurationProvider): void {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ function isBuild(input: any): input is Build {
|
||||
* @return Whether input is of type Asset[].
|
||||
*/
|
||||
function isArrayOfAssets(input: any): input is Asset[] {
|
||||
return input instanceof Array && input.every(item => isAsset(item));
|
||||
return input instanceof Array && input.every(isAsset);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,17 +174,17 @@ function getTargetBuild(builds: Build[], userVersion: PackageVersion, updateChan
|
||||
let needsUpdate: (installed: PackageVersion, target: PackageVersion) => boolean;
|
||||
let useBuild: (build: Build) => boolean;
|
||||
if (updateChannel === 'Insiders') {
|
||||
needsUpdate = (installed: PackageVersion, target: PackageVersion) => { return testingInsidersVsixInstall || target.isGreaterThan(installed); };
|
||||
useBuild = (build: Build): boolean => { return true; };
|
||||
needsUpdate = (installed: PackageVersion, target: PackageVersion) => testingInsidersVsixInstall || target.isGreaterThan(installed);
|
||||
useBuild = (build: Build): boolean => true;
|
||||
} else if (updateChannel === 'Default') {
|
||||
needsUpdate = function(installed: PackageVersion, target: PackageVersion): boolean { return installed.isGreaterThan(target); };
|
||||
useBuild = (build: Build): boolean => { return build.name.indexOf('-') === -1; };
|
||||
useBuild = (build: Build): boolean => build.name.indexOf('-') === -1;
|
||||
} else {
|
||||
throw new Error('Incorrect updateChannel setting provided');
|
||||
}
|
||||
|
||||
// Get the build to install
|
||||
const targetBuild: Build = builds.find((build) => useBuild(build));
|
||||
const targetBuild: Build = builds.find(useBuild);
|
||||
if (!targetBuild) {
|
||||
throw new Error('Failed to determine installation candidate');
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ export function setInstallationStage(stage: string): void {
|
||||
|
||||
export function setInstallationType(type: InstallationType): void {
|
||||
getInstallationInformation().type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ export class Logger {
|
||||
|
||||
public showInformationMessage(message: string, items?: string[]): Thenable<string> {
|
||||
this.appendLine(message);
|
||||
|
||||
|
||||
return vscode.window.showInformationMessage(message, ...items);
|
||||
}
|
||||
|
||||
public showWarningMessage(message: string, items?: string[]): Thenable<string> {
|
||||
this.appendLine(message);
|
||||
|
||||
|
||||
return vscode.window.showWarningMessage(message, ...items);
|
||||
}
|
||||
|
||||
@@ -73,4 +73,4 @@ export function getOutputChannelLogger(): Logger {
|
||||
outputChannelLogger = new Logger(message => getOutputChannel().append(message));
|
||||
}
|
||||
return outputChannelLogger;
|
||||
}
|
||||
}
|
||||
|
||||
+20
-22
@@ -17,18 +17,27 @@ import { CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
|
||||
import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistrar } from './commands';
|
||||
import { PlatformInformation } from './platform';
|
||||
import { PackageManager, PackageManagerError, IPackage } from './packageManager';
|
||||
import { PersistentState } from './LanguageServer/persistentState';
|
||||
import { getInstallationInformation, InstallationInformation, setInstallationStage, setInstallationType, InstallationType } from './installationInformation';
|
||||
import { Logger, getOutputChannelLogger, showOutputChannel } from './logger';
|
||||
import { CppTools1 } from './cppTools1';
|
||||
import { CppTools1, NullCppTools } from './cppTools1';
|
||||
|
||||
const releaseNotesVersion: number = 5;
|
||||
const cppTools: CppTools1 = new CppTools1();
|
||||
let languageServiceDisabled: boolean = false;
|
||||
let reloadMessageShown: boolean = false;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<CppToolsApi & CppToolsExtension> {
|
||||
let errMsg: string = "";
|
||||
if (process.arch !== 'ia32' && process.arch !== 'x64') {
|
||||
errMsg = "Architecture " + String(process.arch) + " is not supported. ";
|
||||
} else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
|
||||
errMsg = "Alpine containers are not supported. ";
|
||||
}
|
||||
if (errMsg) {
|
||||
vscode.window.showErrorMessage(errMsg);
|
||||
return new NullCppTools();
|
||||
}
|
||||
|
||||
util.setExtensionContext(context);
|
||||
initializeTemporaryCommandRegistrar();
|
||||
Telemetry.activate();
|
||||
@@ -68,17 +77,17 @@ async function processRuntimeDependencies(): Promise<void> {
|
||||
// Send the failure telemetry since postInstall will not be called.
|
||||
sendTelemetry(await PlatformInformation.GetPlatformInformation());
|
||||
}
|
||||
// The extension have been installed and activated before.
|
||||
} else {
|
||||
// The extension has been installed and activated before.
|
||||
await finalizeExtensionActivation();
|
||||
}
|
||||
// No lock file, need to download and install dependencies.
|
||||
} else {
|
||||
// No lock file, need to download and install dependencies.
|
||||
try {
|
||||
await onlineInstallation();
|
||||
} catch (error) {
|
||||
handleError(error);
|
||||
|
||||
|
||||
// Send the failure telemetry since postInstall will not be called.
|
||||
sendTelemetry(await PlatformInformation.GetPlatformInformation());
|
||||
}
|
||||
@@ -245,13 +254,6 @@ function sendTelemetry(info: PlatformInformation): boolean {
|
||||
|
||||
if (success) {
|
||||
util.setProgress(util.getProgressInstallSuccess());
|
||||
let versionShown: PersistentState<number> = new PersistentState<number>("CPP.ReleaseNotesVersion", -1);
|
||||
if (versionShown.Value < releaseNotesVersion) {
|
||||
if (versionShown.Value !== versionShown.DefaultValue) {
|
||||
util.showReleaseNotes();
|
||||
}
|
||||
versionShown.Value = releaseNotesVersion;
|
||||
}
|
||||
}
|
||||
|
||||
installBlob.telemetryProperties['osArchitecture'] = info.architecture;
|
||||
@@ -273,7 +275,7 @@ async function postInstall(info: PlatformInformation): Promise<void> {
|
||||
if (!installSuccess) {
|
||||
return Promise.reject<void>("");
|
||||
} else {
|
||||
// Notify user's if debugging may not be supported on their OS.
|
||||
// Notify users if debugging may not be supported on their OS.
|
||||
util.checkDistro(info);
|
||||
|
||||
return finalizeExtensionActivation();
|
||||
@@ -302,7 +304,7 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
|
||||
// Update default for C_Cpp.intelliSenseEngine based on A/B testing settings.
|
||||
// (this may result in rewriting the package.json file)
|
||||
|
||||
|
||||
let abTestSettings: cpptoolsJsonUtils.ABTestSettings = cpptoolsJsonUtils.getABTestSettings();
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
let writePackageJson: boolean = false;
|
||||
@@ -342,7 +344,7 @@ async function finalizeExtensionActivation(): Promise<void> {
|
||||
function rewriteManifest(): Promise<void> {
|
||||
// Replace activationEvents with the events that the extension should be activated for subsequent sessions.
|
||||
let packageJson: any = util.getRawPackageJson();
|
||||
|
||||
|
||||
packageJson.activationEvents = [
|
||||
"onLanguage:cpp",
|
||||
"onLanguage:c",
|
||||
@@ -355,20 +357,16 @@ function rewriteManifest(): Promise<void> {
|
||||
"onCommand:C_Cpp.ConfigurationProviderSelect",
|
||||
"onCommand:C_Cpp.SwitchHeaderSource",
|
||||
"onCommand:C_Cpp.Navigate",
|
||||
"onCommand:C_Cpp.GoToDeclaration",
|
||||
"onCommand:C_Cpp.PeekDeclaration",
|
||||
"onCommand:C_Cpp.EnableErrorSquiggles",
|
||||
"onCommand:C_Cpp.DisableErrorSquiggles",
|
||||
"onCommand:C_Cpp.ToggleIncludeFallback",
|
||||
"onCommand:C_Cpp.ToggleDimInactiveRegions",
|
||||
"onCommand:C_Cpp.ShowReleaseNotes",
|
||||
"onCommand:C_Cpp.ResetDatabase",
|
||||
"onCommand:C_Cpp.PauseParsing",
|
||||
"onCommand:C_Cpp.ResumeParsing",
|
||||
"onCommand:C_Cpp.ShowParsingCommands",
|
||||
"onCommand:C_Cpp.TakeSurvey",
|
||||
"onCommand:C_Cpp.LogDiagnostics",
|
||||
"onCommand:C_Cpp.RescanWorkspace",
|
||||
"onCommand:C_Cpp.VcpkgClipboardInstallSuggested",
|
||||
"onCommand:C_Cpp.VcpkgClipboardOnlineHelpSuggested",
|
||||
"onDebug",
|
||||
"workspaceContains:/.vscode/c_cpp_properties.json"
|
||||
];
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface IPackage {
|
||||
binaries: string[];
|
||||
|
||||
// Internal location to which the package was downloaded
|
||||
tmpFile: tmp.SyncResult;
|
||||
tmpFile: tmp.FileResult;
|
||||
}
|
||||
|
||||
export class PackageManagerError extends Error {
|
||||
@@ -151,23 +151,23 @@ export class PackageManager {
|
||||
|
||||
progress.report({message: `Downloading ${progressCount}: ${pkg.description}`});
|
||||
|
||||
const tmpResult: tmp.SyncResult = await this.CreateTempFile(pkg);
|
||||
const tmpResult: tmp.FileResult = await this.CreateTempFile(pkg);
|
||||
await this.DownloadPackageWithRetries(pkg, tmpResult, progress);
|
||||
}
|
||||
|
||||
private async CreateTempFile(pkg: IPackage): Promise<tmp.SyncResult> {
|
||||
return new Promise<tmp.SyncResult>((resolve, reject) => {
|
||||
private async CreateTempFile(pkg: IPackage): Promise<tmp.FileResult> {
|
||||
return new Promise<tmp.FileResult>((resolve, reject) => {
|
||||
tmp.file({ prefix: "package-" }, (err, path, fd, cleanupCallback) => {
|
||||
if (err) {
|
||||
return reject(new PackageManagerError('Error from temp.file', 'DownloadPackage', pkg, err));
|
||||
}
|
||||
|
||||
return resolve(<tmp.SyncResult>{ name: path, fd: fd, removeCallback: cleanupCallback });
|
||||
return resolve(<tmp.FileResult>{ name: path, fd: fd, removeCallback: cleanupCallback });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private async DownloadPackageWithRetries(pkg: IPackage, tmpResult: tmp.SyncResult, progress: vscode.Progress<{message?: string; increment?: number}>): Promise<void> {
|
||||
private async DownloadPackageWithRetries(pkg: IPackage, tmpResult: tmp.FileResult, progress: vscode.Progress<{message?: string; increment?: number}>): Promise<void> {
|
||||
pkg.tmpFile = tmpResult;
|
||||
|
||||
let success: boolean = false;
|
||||
@@ -333,7 +333,7 @@ export class PackageManager {
|
||||
|
||||
if (entry.fileName.endsWith("/")) {
|
||||
// Directory - create it
|
||||
mkdirp.mkdirp(absoluteEntryPath, { mode: 0o775 }, (err) => {
|
||||
mkdirp(absoluteEntryPath, { mode: 0o775 }, (err) => {
|
||||
if (err) {
|
||||
return reject(new PackageManagerError('Error creating directory', 'InstallPackage', pkg, err, err.code));
|
||||
}
|
||||
@@ -353,12 +353,12 @@ export class PackageManager {
|
||||
return reject(new PackageManagerError('Error in readStream', 'InstallPackage', pkg, err));
|
||||
});
|
||||
|
||||
mkdirp.mkdirp(path.dirname(absoluteEntryPath), { mode: 0o775 }, async (err) => {
|
||||
mkdirp(path.dirname(absoluteEntryPath), { mode: 0o775 }, async (err) => {
|
||||
if (err) {
|
||||
return reject(new PackageManagerError('Error creating directory', 'InstallPackage', pkg, err, err.code));
|
||||
}
|
||||
|
||||
// Create as a .tmp file to avoid partially unzipped files
|
||||
// Create as a .tmp file to avoid partially unzipped files
|
||||
// counting as completed files.
|
||||
let absoluteEntryTempFile: string = absoluteEntryPath + ".tmp";
|
||||
if (fs.existsSync(absoluteEntryTempFile)) {
|
||||
@@ -420,4 +420,4 @@ export class PackageManager {
|
||||
this.outputChannel.appendLine(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,14 +48,20 @@ export class PackageVersion {
|
||||
let diff: number = this.major - other.major;
|
||||
if (diff) {
|
||||
return diff > 0;
|
||||
} else if (diff = this.minor - other.minor) {
|
||||
return diff > 0;
|
||||
} else if (diff = this.patch - other.patch) {
|
||||
return diff > 0;
|
||||
} else if (this.suffix) {
|
||||
return (other.suffix && this.suffixVersion > other.suffixVersion);
|
||||
} else {
|
||||
return other.suffix ? true : false;
|
||||
diff = this.minor - other.minor;
|
||||
if (diff) {
|
||||
return diff > 0;
|
||||
} else {
|
||||
diff = this.patch - other.patch;
|
||||
if (diff) {
|
||||
return diff > 0;
|
||||
} else if (this.suffix) {
|
||||
return (other.suffix && this.suffixVersion > other.suffixVersion);
|
||||
} else {
|
||||
return other.suffix ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ export function getTestHook(): TestHook {
|
||||
testHook = new TestHook();
|
||||
}
|
||||
return testHook;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,4 +44,4 @@ export class CppvsdbgDebugAdapterDescriptorFactory extends AbstractDebugAdapterD
|
||||
|
||||
return new vscode.DebugAdapterExecutable('node', [path.join(this.context.extensionPath, './out/test/integrationTests/MockDebugger/mockDebug.js')]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
import { MockDebugSession } from './mockDebugSession';
|
||||
|
||||
MockDebugSession.run(MockDebugSession);
|
||||
MockDebugSession.run(MockDebugSession);
|
||||
|
||||
@@ -8,60 +8,58 @@ import { DebugProtocol } from 'vscode-debugprotocol';
|
||||
import { Subject } from 'await-notify';
|
||||
|
||||
interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments {
|
||||
/** An absolute path to the "program" to debug. */
|
||||
/** An absolute path to the "program" to debug. */
|
||||
program: string;
|
||||
|
||||
/** enable logging the Debug Adapter Protocol */
|
||||
/** enable logging the Debug Adapter Protocol */
|
||||
logPath?: string;
|
||||
}
|
||||
|
||||
export class MockDebugSession extends LoggingDebugSession
|
||||
{
|
||||
private _configurationDone = new Subject();
|
||||
export class MockDebugSession extends LoggingDebugSession {
|
||||
private _configurationDone = new Subject();
|
||||
|
||||
public constructor() {
|
||||
super("mock-debug.txt");
|
||||
}
|
||||
|
||||
protected initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
|
||||
// build and return the capabilities of this debug adapter:
|
||||
response.body = response.body || {};
|
||||
|
||||
// the adapter implements the configurationDoneRequest.
|
||||
// build and return the capabilities of this debug adapter:
|
||||
response.body = response.body || {};
|
||||
|
||||
response.body.supportsConfigurationDoneRequest = true;
|
||||
|
||||
this.sendResponse(response);
|
||||
// since this debug adapter can accept configuration requests like 'setBreakpoint' at any time,
|
||||
// we request them early by sending an 'initializeRequest' to the frontend.
|
||||
// The frontend will end the configuration sequence by calling 'configurationDone' request.
|
||||
this.sendEvent(new InitializedEvent());
|
||||
// the adapter implements the configurationDoneRequest.
|
||||
|
||||
}
|
||||
response.body.supportsConfigurationDoneRequest = true;
|
||||
|
||||
protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
|
||||
this.sendResponse(response);
|
||||
// since this debug adapter can accept configuration requests like 'setBreakpoint' at any time,
|
||||
// we request them early by sending an 'initializeRequest' to the frontend.
|
||||
// The frontend will end the configuration sequence by calling 'configurationDone' request.
|
||||
this.sendEvent(new InitializedEvent());
|
||||
|
||||
super.configurationDoneRequest(response, args);
|
||||
// notify the launchRequest that configuration has finished
|
||||
this._configurationDone.notify();
|
||||
}
|
||||
|
||||
}
|
||||
protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
|
||||
|
||||
protected async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments) {
|
||||
// make sure to 'Stop' the buffered logging if 'trace' is not set
|
||||
logger.setup(Logger.LogLevel.Verbose, args.logPath);
|
||||
|
||||
// wait until configuration has finished (and configurationDoneRequest has been called)
|
||||
await this._configurationDone.wait(1000);
|
||||
super.configurationDoneRequest(response, args);
|
||||
// notify the launchRequest that configuration has finished
|
||||
this._configurationDone.notify();
|
||||
|
||||
this.sendResponse(response);
|
||||
}
|
||||
|
||||
// Terminate after launch.
|
||||
this.sendEvent(new TerminatedEvent());
|
||||
}
|
||||
protected async launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): Promise<void> {
|
||||
// make sure to 'Stop' the buffered logging if 'trace' is not set
|
||||
logger.setup(Logger.LogLevel.Verbose, args.logPath);
|
||||
|
||||
protected async disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments)
|
||||
{
|
||||
this.sendResponse(response);
|
||||
}
|
||||
}
|
||||
// wait until configuration has finished (and configurationDoneRequest has been called)
|
||||
await this._configurationDone.wait(1000);
|
||||
|
||||
this.sendResponse(response);
|
||||
|
||||
// Terminate after launch.
|
||||
this.sendEvent(new TerminatedEvent());
|
||||
}
|
||||
|
||||
protected async disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments): Promise<void> {
|
||||
this.sendResponse(response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,13 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
import * as fs from "fs";
|
||||
import * as path from 'path';
|
||||
|
||||
import { subscribeToAllLoggers } from "../../../src/logger";
|
||||
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// This file is providing the test runner to use when running extension tests.
|
||||
// By default the test runner in use is Mocha based.
|
||||
@@ -22,23 +21,23 @@ import { subscribeToAllLoggers } from "../../../src/logger";
|
||||
// to report the results back to the caller. When the tests are finished, return
|
||||
// a possible error to the callback or null if none.
|
||||
|
||||
var testRunner = require('vscode/lib/testrunner');
|
||||
import testRunner = require('vscode/lib/testrunner');
|
||||
|
||||
// You can directly control Mocha options by uncommenting the following lines
|
||||
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
||||
testRunner.configure({
|
||||
ui: 'tdd', // the TDD UI is being used in *.test.ts (suite, test, etc.)
|
||||
useColors: true, // colored output from test results
|
||||
fullTrace: true,
|
||||
fullStackTrace: true,
|
||||
timeout: 60000
|
||||
});
|
||||
|
||||
const logFolder = path.join( __dirname, ".logs")
|
||||
const logFolder: string = path.join(__dirname, ".logs");
|
||||
|
||||
if (!fs.existsSync(logFolder)) {
|
||||
fs.mkdirSync(logFolder);
|
||||
}
|
||||
const logFilePath = path.join(logFolder, "integrationTests.log");
|
||||
const logFilePath: string = path.join(logFolder, "integrationTests.log");
|
||||
subscribeToAllLoggers(message => fs.appendFileSync(logFilePath, message));
|
||||
|
||||
module.exports = testRunner;
|
||||
module.exports = testRunner;
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as assert from 'assert';
|
||||
|
||||
|
||||
suite(`Debug Integration Test: `, function(): void {
|
||||
let origFactoryFile: string;
|
||||
let tempFactoryFile: string;
|
||||
let hijackedFactoryFile: string;
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
await extension.activate();
|
||||
}
|
||||
});
|
||||
|
||||
test("Starting (gdb) Launch from the workspace root should create an Active Debug Session", async () => {
|
||||
|
||||
test("Starting (gdb) Launch from the workspace root should create an Active Debug Session", async () => {
|
||||
// If it is failing on startDebugging. Investigate the SimpleCppProject's tasks.json or launch.json.
|
||||
await vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], "(gdb) Launch");
|
||||
|
||||
@@ -34,4 +34,4 @@ suite(`Debug Integration Test: `, function(): void {
|
||||
|
||||
await debugSessionTerminated;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,12 +8,12 @@ import * as path from 'path';
|
||||
|
||||
import { subscribeToAllLoggers } from "../../../src/logger";
|
||||
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// This file is providing the test runner to use when running extension tests.
|
||||
// By default the test runner in use is Mocha based.
|
||||
//
|
||||
//
|
||||
// You can provide your own test runner if you want to override it by exporting
|
||||
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
|
||||
// host can call to run the tests. The test runner is expected to use console.log
|
||||
@@ -31,7 +31,7 @@ testRunner.configure({
|
||||
timeout: 60000
|
||||
});
|
||||
|
||||
const logFolder: string = path.join( __dirname, ".logs");
|
||||
const logFolder: string = path.join(__dirname, ".logs");
|
||||
|
||||
if (!fs.existsSync(logFolder)) {
|
||||
fs.mkdirSync(logFolder);
|
||||
@@ -39,4 +39,4 @@ if (!fs.existsSync(logFolder)) {
|
||||
const logFilePath: string = path.join(logFolder, "integrationTests.log");
|
||||
subscribeToAllLoggers(message => fs.appendFileSync(logFilePath, message));
|
||||
|
||||
module.exports = testRunner;
|
||||
module.exports = testRunner;
|
||||
|
||||
+115
-12
@@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
@@ -16,12 +16,12 @@ import { initializeTemporaryCommandRegistrar } from '../../../src/commands';
|
||||
const defaultTimeout: number = 60000;
|
||||
|
||||
suite("multiline comment setting tests", function(): void {
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
util.setExtensionPath(extension.extensionPath);
|
||||
initializeTemporaryCommandRegistrar();
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -111,6 +111,109 @@ async function changeCppProperties(cppProperties: config.ConfigurationJson, disp
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
suite("extensibility tests v3", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
let defaultConfig: api.SourceFileConfiguration = {
|
||||
includePath: [ "${workspaceFolder}", "/v3/folder" ],
|
||||
defines: [ "${workspaceFolder}" ],
|
||||
intelliSenseMode: "msvc-x64",
|
||||
standard: "c++17"
|
||||
};
|
||||
let lastBrowseResult: api.WorkspaceBrowseConfiguration;
|
||||
let defaultBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
let defaultFolderBrowseConfig: api.WorkspaceBrowseConfiguration = {
|
||||
browsePath: [ "/v3/folder-1" ],
|
||||
compilerPath: "",
|
||||
standard: "c++14",
|
||||
windowsSdkVersion: "8.1"
|
||||
};
|
||||
|
||||
let provider: api.CustomConfigurationProvider = {
|
||||
name: "cpptoolsTest-v3",
|
||||
extensionId: "ms-vscode.cpptools-test3",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideConfigurations(uris: vscode.Uri[]): Thenable<api.SourceFileConfigurationItem[]> {
|
||||
let result: api.SourceFileConfigurationItem[] = [];
|
||||
uris.forEach(uri => {
|
||||
result.push({
|
||||
uri: uri.toString(),
|
||||
configuration: defaultConfig
|
||||
});
|
||||
});
|
||||
lastResult = result;
|
||||
return Promise.resolve(result);
|
||||
},
|
||||
canProvideBrowseConfiguration(): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideBrowseConfiguration(): Thenable<api.WorkspaceBrowseConfiguration> {
|
||||
lastBrowseResult = defaultBrowseConfig;
|
||||
return Promise.resolve(defaultBrowseConfig);
|
||||
},
|
||||
canProvideBrowseConfigurationsPerFolder(): Thenable<boolean> {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
provideFolderBrowseConfiguration(uri: vscode.Uri): Thenable<api.WorkspaceBrowseConfiguration> {
|
||||
lastBrowseResult = defaultFolderBrowseConfig;
|
||||
return Promise.resolve(defaultFolderBrowseConfig);
|
||||
},
|
||||
dispose(): void {
|
||||
console.log(" disposed");
|
||||
}
|
||||
};
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
|
||||
suiteSetup(async function(): Promise<void> {
|
||||
cpptools = await apit.getCppToolsTestApi(api.Version.v3);
|
||||
cpptools.registerCustomConfigurationProvider(provider);
|
||||
cpptools.notifyReady(provider);
|
||||
disposables.push(cpptools);
|
||||
|
||||
await changeCppProperties({
|
||||
configurations: [ {name: "test3", configurationProvider: provider.extensionId} ],
|
||||
version: 4
|
||||
},
|
||||
disposables);
|
||||
});
|
||||
|
||||
suiteTeardown(function(): void {
|
||||
disposables.forEach(d => d.dispose());
|
||||
});
|
||||
|
||||
test("Check provider", async () => {
|
||||
// Open a c++ file to start the language server.
|
||||
let path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/main3.cpp";
|
||||
let uri: vscode.Uri = vscode.Uri.file(path);
|
||||
|
||||
let testHook: apit.CppToolsTestHook = cpptools.getTestHook();
|
||||
let testResult: any = new Promise<void>((resolve, reject) => {
|
||||
disposables.push(testHook.StatusChanged(status => {
|
||||
if (status === apit.Status.IntelliSenseReady) {
|
||||
let expected: api.SourceFileConfigurationItem[] = [ {uri: uri.toString(), configuration: defaultConfig} ];
|
||||
assert.deepEqual(lastResult, expected);
|
||||
assert.deepEqual(lastBrowseResult, defaultFolderBrowseConfig);
|
||||
resolve();
|
||||
}
|
||||
}));
|
||||
setTimeout(() => { reject(new Error("timeout")); }, defaultTimeout);
|
||||
});
|
||||
disposables.push(testHook);
|
||||
|
||||
await vscode.workspace.openTextDocument(path);
|
||||
await testResult;
|
||||
});
|
||||
});
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
suite("extensibility tests v2", function(): void {
|
||||
let cpptools: apit.CppToolsTestApi;
|
||||
let lastResult: api.SourceFileConfigurationItem[];
|
||||
@@ -129,7 +232,7 @@ suite("extensibility tests v2", function(): void {
|
||||
};
|
||||
|
||||
// Has to be 'any' instead of api.CustomConfigurationProvider because of missing interface members.
|
||||
let provider: api.CustomConfigurationProvider = {
|
||||
let provider: any = {
|
||||
name: "cpptoolsTest-v2",
|
||||
extensionId: "ms-vscode.cpptools-test2",
|
||||
canProvideConfiguration(document: vscode.Uri): Thenable<boolean> {
|
||||
@@ -349,10 +452,10 @@ suite("extensibility tests v0", function(): void {
|
||||
|
||||
/*
|
||||
suite("configuration tests", function() {
|
||||
suiteSetup(async function() {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
suiteSetup(async function() {
|
||||
let extension: vscode.Extension<any> = vscode.extensions.getExtension("ms-vscode.cpptools");
|
||||
if (!extension.isActive) {
|
||||
await extension.activate();
|
||||
}
|
||||
// Open a c++ file to start the language server.
|
||||
await vscode.workspace.openTextDocument({ language: "cpp", content: "int main() { return 0; }"});
|
||||
@@ -395,4 +498,4 @@ suite("configuration tests", function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
int main(int argc, char* arv[]) {
|
||||
return 0;
|
||||
}
|
||||
@@ -3,68 +3,66 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Environment, ParsedEnvironmentFile } from '../../src/Debugger/ParsedEnvironmentFile'
|
||||
import { Environment, ParsedEnvironmentFile } from '../../src/Debugger/ParsedEnvironmentFile';
|
||||
import * as assert from 'assert';
|
||||
|
||||
// Because the environment variable is set as an array, the index does not matter.
|
||||
function AssertEnvironmentEqual(env: Environment[], name: string, value: string) {
|
||||
function assertEnvironmentEqual(env: Environment[], name: string, value: string): void {
|
||||
let found: boolean = false;
|
||||
for (let e of env)
|
||||
{
|
||||
if (e.name == name)
|
||||
{
|
||||
assert(e.value == value, `Checking if ${e.value} == ${value}`);
|
||||
for (let e of env) {
|
||||
if (e.name === name) {
|
||||
assert(e.value === value, `Checking if ${e.value} == ${value}`);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(found, `${name} was not found in env.`)
|
||||
assert(found, `${name} was not found in env.`);
|
||||
}
|
||||
|
||||
suite("ParsedEnvironmentFile", () => {
|
||||
test("Add single variable", () => {
|
||||
const content = `MyName=VALUE`;
|
||||
const content: string = `MyName=VALUE`;
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
});
|
||||
|
||||
test("Handle quoted values", () => {
|
||||
const content = `MyName="VALUE"`;
|
||||
const content: string = `MyName="VALUE"`;
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
});
|
||||
|
||||
test("Handle BOM", () => {
|
||||
const content = "\uFEFFMyName=VALUE";
|
||||
const content: string = "\uFEFFMyName=VALUE";
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName", "VALUE");
|
||||
});
|
||||
|
||||
test("Add multiple variables", () => {
|
||||
const content = `
|
||||
const content: string = `
|
||||
MyName1=Value1
|
||||
MyName2=Value2
|
||||
|
||||
`;
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
AssertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
assertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
});
|
||||
|
||||
test("Update variable", () => {
|
||||
const content = `
|
||||
const content: string = `
|
||||
MyName1=Value1
|
||||
MyName2=Value2
|
||||
|
||||
@@ -72,41 +70,41 @@ MyName2=Value2
|
||||
const initialEnv : Environment[] = [];
|
||||
initialEnv.push({name : "MyName1", value: "Value7"});
|
||||
initialEnv.push({name : "ThisShouldNotChange", value : "StillHere"});
|
||||
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", initialEnv);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
AssertEnvironmentEqual(result.Env, "ThisShouldNotChange", "StillHere");
|
||||
AssertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", initialEnv);
|
||||
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
assertEnvironmentEqual(result.Env, "ThisShouldNotChange", "StillHere");
|
||||
assertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
});
|
||||
|
||||
test("Handle comments", () => {
|
||||
const content = `# This is an environment file
|
||||
const content: string = `# This is an environment file
|
||||
MyName1=Value1
|
||||
# This is a comment in the middle of the file
|
||||
MyName2=Value2
|
||||
`;
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning == null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
AssertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
AssertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
assert(result.Warning === null, `Failed to assert that Warning was empty: ${result.Warning}`);
|
||||
assertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
assertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
});
|
||||
|
||||
|
||||
test("Handle invalid lines", () => {
|
||||
const content = `
|
||||
const content: string = `
|
||||
This_Line_Is_Wrong
|
||||
MyName1=Value1
|
||||
MyName2=Value2
|
||||
|
||||
`;
|
||||
const fakeConfig : Environment[] = [];
|
||||
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
const result: ParsedEnvironmentFile = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
|
||||
|
||||
assert(result.Warning.startsWith("Ignoring non-parseable lines in envFile TestEnvFileName"), 'Checking if warning exists');
|
||||
AssertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
AssertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
assertEnvironmentEqual(result.Env, "MyName1", "Value1");
|
||||
assertEnvironmentEqual(result.Env, "MyName2", "Value2");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -219,10 +219,10 @@ suite("Common Utility validation", () => {
|
||||
|
||||
interface ResolveTestFlowEnvironment {
|
||||
withEnvironment(additionalEnvironment: {[key: string]: string | string[]}): ResolveTestFlowAssert;
|
||||
shouldLookupSymbol: (key: string) => void;
|
||||
shouldLookupSymbol(key: string): void;
|
||||
}
|
||||
interface ResolveTestFlowAssert {
|
||||
shouldResolveTo: (x: string) => void;
|
||||
shouldResolveTo(x: string): void;
|
||||
}
|
||||
|
||||
function resolveVariablesWithInput(input: string): ResolveTestFlowEnvironment {
|
||||
@@ -249,4 +249,4 @@ suite("Common Utility validation", () => {
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
import * as assert from 'assert';
|
||||
import * as os from 'os';
|
||||
import { LinuxDistribution } from '../../src/linuxDistribution';
|
||||
import { WmicProcessParser, PsProcessParser } from '../../src/Debugger/nativeAttach';
|
||||
import { Process, WmicProcessParser, PsProcessParser } from '../../src/Debugger/nativeAttach';
|
||||
|
||||
suite("LinuxDistro Tests", () => {
|
||||
test("Parse valid os-release file", () => {
|
||||
const dataUbuntu1404 = 'NAME="Ubuntu"' + os.EOL +
|
||||
const dataUbuntu1404: string = 'NAME="Ubuntu"' + os.EOL +
|
||||
'VERSION="14.04.4 LTS, Trusty Tahr"' + os.EOL +
|
||||
'ID=ubuntu' + os.EOL +
|
||||
'ID_LIKE=debian' + os.EOL +
|
||||
@@ -20,7 +20,7 @@ suite("LinuxDistro Tests", () => {
|
||||
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
|
||||
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
|
||||
|
||||
const dataUbuntu1510 = 'NAME="Ubuntu"' + os.EOL +
|
||||
const dataUbuntu1510: string = 'NAME="Ubuntu"' + os.EOL +
|
||||
'VERSION="15.10 (Wily Werewolf)"' + os.EOL +
|
||||
'ID=ubuntu' + os.EOL +
|
||||
'ID_LIKE=debian' + os.EOL +
|
||||
@@ -30,7 +30,7 @@ suite("LinuxDistro Tests", () => {
|
||||
'SUPPORT_URL="http://help.ubuntu.com/"' + os.EOL +
|
||||
'BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"';
|
||||
|
||||
const dataCentos73 = 'NAME="CentOS Linux"' + os.EOL +
|
||||
const dataCentos73: string = 'NAME="CentOS Linux"' + os.EOL +
|
||||
'VERSION="7 (Core)"' + os.EOL +
|
||||
'ID="centos"' + os.EOL +
|
||||
'ID_LIKE="rhel fedora"' + os.EOL +
|
||||
@@ -46,9 +46,9 @@ suite("LinuxDistro Tests", () => {
|
||||
'REDHAT_SUPPORT_PRODUCT="centos"' + os.EOL +
|
||||
'REDHAT_SUPPORT_PRODUCT_VERSION="7"';
|
||||
|
||||
let ubuntu1404 = LinuxDistribution.getDistroInformation(dataUbuntu1404);
|
||||
let ubuntu1510 = LinuxDistribution.getDistroInformation(dataUbuntu1510);
|
||||
let centos73 = LinuxDistribution.getDistroInformation(dataCentos73);
|
||||
let ubuntu1404: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1404);
|
||||
let ubuntu1510: LinuxDistribution = LinuxDistribution.getDistroInformation(dataUbuntu1510);
|
||||
let centos73: LinuxDistribution = LinuxDistribution.getDistroInformation(dataCentos73);
|
||||
|
||||
assert.equal(ubuntu1404.name, 'ubuntu');
|
||||
assert.equal(ubuntu1404.version, '"14.04"');
|
||||
@@ -61,9 +61,9 @@ suite("LinuxDistro Tests", () => {
|
||||
});
|
||||
|
||||
test("Parse invalid os-release file", () => {
|
||||
const data = 'garbage"';
|
||||
const data: string = 'garbage"';
|
||||
|
||||
let unknown = LinuxDistribution.getDistroInformation(data);
|
||||
let unknown: LinuxDistribution = LinuxDistribution.getDistroInformation(data);
|
||||
assert.equal(unknown.name, 'unknown');
|
||||
assert.equal(unknown.version, 'unknown');
|
||||
});
|
||||
@@ -72,7 +72,7 @@ suite("LinuxDistro Tests", () => {
|
||||
suite("Pick Process Tests", () => {
|
||||
test("Parse valid wmic output", () => {
|
||||
// output from the command used in WmicAttachItemsProvider
|
||||
const wmicOutput = 'CommandLine=' + os.EOL +
|
||||
const wmicOutput: string = 'CommandLine=' + os.EOL +
|
||||
'Name=System Idle Process' + os.EOL +
|
||||
'ProcessId=0' + os.EOL +
|
||||
'' + os.EOL +
|
||||
@@ -86,11 +86,11 @@ suite("Pick Process Tests", () => {
|
||||
'Name=conhost.exe' + os.EOL +
|
||||
'ProcessId=59148' + os.EOL;
|
||||
|
||||
let parsedOutput = WmicProcessParser.ParseProcessFromWmic(wmicOutput);
|
||||
let parsedOutput: Process[] = WmicProcessParser.ParseProcessFromWmic(wmicOutput);
|
||||
|
||||
let process1 = parsedOutput[0];
|
||||
let process2 = parsedOutput[1];
|
||||
let process3 = parsedOutput[2];
|
||||
let process1: Process = parsedOutput[0];
|
||||
let process2: Process = parsedOutput[1];
|
||||
let process3: Process = parsedOutput[2];
|
||||
|
||||
assert.equal(process1.commandLine, '');
|
||||
assert.equal(process1.name, 'System Idle Process');
|
||||
@@ -107,15 +107,15 @@ suite("Pick Process Tests", () => {
|
||||
|
||||
test("Parse valid ps output", () => {
|
||||
// output from the command used in PsAttachItemsProvider
|
||||
const psOutput = ' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + os.EOL +
|
||||
const psOutput: string = ' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + os.EOL +
|
||||
'15470 ScopedBookmarkAgent ScopedBookmarkAgent' + os.EOL +
|
||||
'15220 mdworker mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared' + os.EOL;
|
||||
|
||||
let parsedOutput = PsProcessParser.ParseProcessFromPs(psOutput);
|
||||
let parsedOutput: Process[] = PsProcessParser.ParseProcessFromPs(psOutput);
|
||||
|
||||
let process1 = parsedOutput[0];
|
||||
let process2 = parsedOutput[1];
|
||||
let process3 = parsedOutput[2];
|
||||
let process1: Process = parsedOutput[0];
|
||||
let process2: Process = parsedOutput[1];
|
||||
let process3: Process = parsedOutput[2];
|
||||
|
||||
assert.equal(process1.commandLine, 'ScopedBookmarkAgent');
|
||||
assert.equal(process1.name, 'ScopedBookmarkAgent');
|
||||
|
||||
@@ -3,25 +3,25 @@
|
||||
* See 'LICENSE' in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
//
|
||||
// This file is providing the test runner to use when running extension tests.
|
||||
// By default the test runner in use is Mocha based.
|
||||
//
|
||||
//
|
||||
// You can provide your own test runner if you want to override it by exporting
|
||||
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
|
||||
// host can call to run the tests. The test runner is expected to use console.log
|
||||
// to report the results back to the caller. When the tests are finished, return
|
||||
// a possible error to the callback or null if none.
|
||||
|
||||
var testRunner = require('vscode/lib/testrunner');
|
||||
import testRunner = require('vscode/lib/testrunner');
|
||||
|
||||
// You can directly control Mocha options by uncommenting the following lines
|
||||
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
||||
testRunner.configure({
|
||||
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
|
||||
useColors: true // colored output from test results
|
||||
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
|
||||
useColors: true // colored output from test results
|
||||
});
|
||||
|
||||
module.exports = testRunner;
|
||||
module.exports = testRunner;
|
||||
|
||||
@@ -10,7 +10,7 @@ function appendFieldsToObject(reference: any, obj: any): any {
|
||||
// Make sure it is an object type
|
||||
if (typeof obj === 'object') {
|
||||
for (let referenceKey in reference) {
|
||||
// If key exists in original object and is an object.
|
||||
// If key exists in original object and is an object.
|
||||
if (obj.hasOwnProperty(referenceKey)) {
|
||||
obj[referenceKey] = appendFieldsToObject(reference[referenceKey], obj[referenceKey]);
|
||||
} else {
|
||||
@@ -23,7 +23,7 @@ function appendFieldsToObject(reference: any, obj: any): any {
|
||||
return obj;
|
||||
}
|
||||
|
||||
// Combines two object's fields, giving the parentDefault a higher precedence.
|
||||
// Combines two object's fields, giving the parentDefault a higher precedence.
|
||||
function mergeDefaults(parentDefault: any, childDefault: any): any {
|
||||
let newDefault: any = {};
|
||||
|
||||
@@ -80,7 +80,7 @@ function replaceReferences(definitions: any, objects: any): any {
|
||||
objects[key] = refReplace(definitions, objects[key]);
|
||||
}
|
||||
|
||||
// Recursively replace references if this object has properties.
|
||||
// Recursively replace references if this object has properties.
|
||||
if (objects[key].hasOwnProperty('type') && objects[key].type === 'object' && objects[key].properties !== null) {
|
||||
objects[key].properties = replaceReferences(definitions, objects[key].properties);
|
||||
objects[key].properties = updateDefaults(objects[key].properties, objects[key].default);
|
||||
@@ -114,7 +114,7 @@ export function generateOptionsSchema(): void {
|
||||
if (os.platform() === 'win32') {
|
||||
content = content.replace(/\n/gm, "\r\n");
|
||||
}
|
||||
|
||||
|
||||
// We use '\u200b' (unicode zero-length space character) to break VS Code's URL detection regex for URLs that are examples. This process will
|
||||
// convert that from the readable espace sequence, to just an invisible character. Convert it back to the visible espace sequence.
|
||||
content = content.replace(/\u200b/gm, "\\u200b");
|
||||
@@ -122,4 +122,4 @@ export function generateOptionsSchema(): void {
|
||||
fs.writeFileSync('package.json', content);
|
||||
}
|
||||
|
||||
generateOptionsSchema();
|
||||
generateOptionsSchema();
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"sourceMap": true,
|
||||
"rootDir": ".",
|
||||
"removeComments": true,
|
||||
"noImplicitUseStrict": true
|
||||
"noImplicitUseStrict": true,
|
||||
"noUnusedLocals": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
|
||||
+99
-9
@@ -1,31 +1,121 @@
|
||||
{
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": true,
|
||||
"align": true,
|
||||
"array-type": [true, "array"],
|
||||
"arrow-return-shorthand": true,
|
||||
"ban-comma-operator": true,
|
||||
"binary-expression-operand-order": true,
|
||||
"callable-types": true,
|
||||
"class-name": true,
|
||||
"comment-format": true,
|
||||
"curly": true,
|
||||
"encoding": true,
|
||||
"eofline": true,
|
||||
"ext-variable-name": [
|
||||
true,
|
||||
["class", "pascal"],
|
||||
["function", "camel"]
|
||||
[
|
||||
"class",
|
||||
"pascal"
|
||||
],
|
||||
[
|
||||
"function",
|
||||
"camel"
|
||||
]
|
||||
],
|
||||
"file-header": [true, ".*"],
|
||||
"indent": [true, "spaces", 4],
|
||||
"file-header": [
|
||||
true,
|
||||
".*"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces",
|
||||
4
|
||||
],
|
||||
"label-position": true,
|
||||
"match-default-export-name": true,
|
||||
"member-ordering": true,
|
||||
"new-parens": true,
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
"no-boolean-literal-compare": true,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-construct": true,
|
||||
"no-debugger": true,
|
||||
"no-default-export": true,
|
||||
"no-duplicate-imports": true,
|
||||
"no-duplicate-super": true,
|
||||
"no-duplicate-switch-case": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-unused-expression-chai": true,
|
||||
"no-eval": true,
|
||||
"no-import-side-effect": true,
|
||||
"no-internal-module": true,
|
||||
"no-invalid-this": true,
|
||||
"no-irregular-whitespace": true,
|
||||
"no-mergeable-namespace": true,
|
||||
"no-misused-new": true,
|
||||
"no-namespace": true,
|
||||
"no-non-null-assertion": true,
|
||||
"no-redundant-jsdoc": true,
|
||||
"no-reference": true,
|
||||
"no-reference-import": true,
|
||||
"no-return-await": true,
|
||||
"no-sparse-arrays": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-this-assignment": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unnecessary-callback-wrapper": true,
|
||||
"no-unnecessary-initializer": true,
|
||||
"no-unnecessary-qualifier": true,
|
||||
"no-unsafe-finally": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-var-keyword": true,
|
||||
"one-line": [true, "check-catch", "check-finally", "check-else", "check-open-brace", "check-whitespace"],
|
||||
"no-var-requires": true,
|
||||
"number-literal-format": true,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-catch",
|
||||
"check-finally",
|
||||
"check-else",
|
||||
"check-open-brace",
|
||||
"check-whitespace"
|
||||
],
|
||||
"one-variable-per-declaration": true,
|
||||
"prefer-method-signature": true,
|
||||
"prefer-object-spread": true,
|
||||
"prefer-while": true,
|
||||
"promise-must-complete": true,
|
||||
"semicolon": true,
|
||||
"space-within-parens": true,
|
||||
"trailing-comma": true,
|
||||
"triple-equals": true,
|
||||
"type-literal-delimiter": true,
|
||||
"typedef": [true, "variable-declaration", "call-signature"],
|
||||
"whitespace": [true, "check-branch", "check-operator", "check-separator", "check-preblock", "check-type"]
|
||||
"typedef": [
|
||||
true,
|
||||
"variable-declaration",
|
||||
"call-signature"
|
||||
],
|
||||
"typedef-whitespace": true,
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"use-default-type-parameter": true,
|
||||
"use-isnan": true,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-preblock",
|
||||
"check-type"
|
||||
]
|
||||
},
|
||||
"rulesDirectory": [
|
||||
"node_modules/tslint-microsoft-contrib",
|
||||
"node_modules/tslint-microsoft-contrib",
|
||||
"node_modules/tslint-no-unused-expression-chai/rules",
|
||||
"node_modules/vrsource-tslint-rules/rules"
|
||||
]
|
||||
}
|
||||
}
|
||||
+44
-17
@@ -434,7 +434,7 @@
|
||||
<div style=" height: 90px; display: inline-block;">
|
||||
<div class="main-title">IntelliSense Configurations</div>
|
||||
<div style="color: var(--vscode-foreground);">
|
||||
Use this editor to edit basic IntelliSense settings defined in the underlying <a href="command:C_Cpp.ConfigurationEditJSON" title="Edit configurations in JSON file">c_cpp_properties.json</a> file.
|
||||
Use this editor to edit IntelliSense settings defined in the underlying <a href="command:C_Cpp.ConfigurationEditJSON" title="Edit configurations in JSON file">c_cpp_properties.json</a> file.
|
||||
Changes made in this editor only apply to the selected configuration.
|
||||
To edit multiple configurations at once go to <a href="command:C_Cpp.ConfigurationEditJSON" title="Edit configurations in JSON file">c_cpp_properties.json</a>.
|
||||
</div>
|
||||
@@ -447,7 +447,8 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Configuration name</div>
|
||||
<div class="section-text">
|
||||
A friendly name that identifies a configuration. <code>Mac</code>, <code>Linux</code>, and <code>Win32</code> are special identifiers for configurations that will be auto-selected on those platforms, but the name of the identifier can be anything.
|
||||
A friendly name that identifies a configuration. <code>Linux</code>, <code>Mac</code>, and <code>Win32</code> are special identifiers
|
||||
for configurations that will be auto-selected on those platforms.
|
||||
</div>
|
||||
<div>
|
||||
<div class="section-note">Select a configuration set to edit.</div>
|
||||
@@ -479,8 +480,8 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Compiler path</div>
|
||||
<div class="section-text">
|
||||
The full path of the compiler being used to build, e.g. <code>/usr/bin/gcc</code>, to enable more accurate IntelliSense.
|
||||
Arguments can be added to modify the includes/defines used, e.g. <code>-nostdinc++</code>, <code>-m32</code>, etc., but paths with spaces must be surrounded by double quotes <code>"</code> if arguments are used.
|
||||
The full path to the compiler you use to build your project, e.g. <code>/usr/bin/gcc</code>, to enable more accurate IntelliSense.
|
||||
The extension will query the compiler to determine the system include paths and default defines to use for IntelliSense.
|
||||
</div>
|
||||
<!-- input compilerPath -->
|
||||
<div class="section-note">Specify a compiler path or select a detected compiler path from the drop-down list.</div>
|
||||
@@ -492,19 +493,34 @@
|
||||
<!-- input compilerPath end -->
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">Compiler arguments</div>
|
||||
<div class="section-text">
|
||||
Compiler arguments to modify the includes or defines used, e.g. <code>-nostdinc++</code>, <code>-m32</code>, etc.
|
||||
</div>
|
||||
<div>
|
||||
<div class="section-note">One argument per line.</div>
|
||||
<textarea name="inputValue" id="compilerArgs" rows="4" cols="93" style="width: 800px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">IntelliSense mode</div>
|
||||
<div class="section-text">
|
||||
The IntelliSense mode used by the IntelliSense engine. The <code>${default}</code> mode will choose the default for that platform.
|
||||
Windows defaults to <code>msvc-x64</code>, Linux defaults to <code>gcc-x64</code>, and Mac defaults to <code>clang-x64</code>.
|
||||
The IntelliSense mode to use that maps to an architecture-specific variant of MSVC, gcc, or Clang.
|
||||
If not set or if set to <code>${default}</code>, the extension will choose the default for that platform.
|
||||
Windows defaults to <code>msvc-x64</code>, Linux defaults to <code>gcc-x64</code>, and macOS defaults to <code>clang-x64</code>.
|
||||
Select a specific IntelliSense mode to override the <code>${default}</code> mode.
|
||||
</div>
|
||||
<div>
|
||||
<select name="inputValue" id="intelliSenseMode" class="select-default">
|
||||
<option value="${default}">${default}</option>
|
||||
<option value="msvc-x64">msvc-x64</option>
|
||||
<option value="gcc-x64">gcc-x64</option>
|
||||
<option value="clang-x86">clang-x86</option>
|
||||
<option value="clang-x64">clang-x64</option>
|
||||
<option value="gcc-x86">gcc-x86</option>
|
||||
<option value="gcc-x64">gcc-x64</option>
|
||||
<option value="msvc-x86">msvc-x86</option>
|
||||
<option value="msvc-x64">msvc-x64</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="intelliSenseModeInvalid" class="error" style="width: 290px"></div>
|
||||
@@ -515,7 +531,9 @@
|
||||
<div class="section-text">
|
||||
An include path is a folder that contains header files (such as <code>#include "myHeaderFile.h"</code>) that are included in a source file.
|
||||
Specify a list paths for the IntelliSense engine to use while searching for included header files.
|
||||
If a path ends with <code>/**</code> the IntelliSense engine will do a recursive search for header files starting from that directory.
|
||||
If a path ends with <code>/**</code> the IntelliSense engine will do a recursive search for header files starting from that directory.
|
||||
If on Windows with Visual Studio installed, or if a compiler is specified in the <code>compilerPath</code> setting,
|
||||
it is not necessary to list the system include paths in this list.
|
||||
</div>
|
||||
<div>
|
||||
<div class="section-note">One include path per line.</div>
|
||||
@@ -552,6 +570,7 @@
|
||||
<div class="section-text">The version of the C++ language standard to use for IntelliSense.</div>
|
||||
<div>
|
||||
<select name="inputValue" id="cppStandard" class="select-default">
|
||||
<option value="c++20">c++20</option>
|
||||
<option value="c++17">c++17</option>
|
||||
<option value="c++14">c++14</option>
|
||||
<option value="c++11">c++11</option>
|
||||
@@ -572,7 +591,8 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Configuration provider</div>
|
||||
<div class="section-text">
|
||||
The ID of a VS Code extension that can provide IntelliSense configuration information for source files.
|
||||
The ID of a VS Code extension that can provide IntelliSense configuration information for source files. For example, use the VS Code extension ID
|
||||
<code>vector-of-bool.cmake-tools</code> to provide configuration information from the CMake Tools extension.
|
||||
</div>
|
||||
<div>
|
||||
<input name="inputValue" id="configurationProvider" style="width: 290px"></input>
|
||||
@@ -582,7 +602,7 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Windows SDK version</div>
|
||||
<div class="section-text">
|
||||
Version of the Windows SDK include path to use on Windows, e.g. <code>10.0.17134.0</code>.
|
||||
The version of the Windows SDK include path to use on Windows, e.g. <code>10.0.17134.0</code>.
|
||||
</div>
|
||||
<div>
|
||||
<input name="inputValue" id="windowsSdkVersion" style="width: 290px"></input>
|
||||
@@ -592,7 +612,7 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Mac framework path</div>
|
||||
<div class="section-text">
|
||||
A list of paths for the Intellisense engine to use while searching for included headers from Mac frameworks. Only supported on Mac configuration.
|
||||
A list of paths for the Intellisense engine to use while searching for included headers from Mac frameworks. Only supported on configurations for macOS.
|
||||
</div>
|
||||
<div>
|
||||
<div class="section-note">One path per line.</div>
|
||||
@@ -616,7 +636,10 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Compile commands</div>
|
||||
<div class="section-text">
|
||||
Full path to <code>compile_commands.json</code> file for the workspace.
|
||||
The full path to the <code>compile_commands.json</code> file for the workspace. The include paths and defines discovered in this file will
|
||||
be used instead of the values set for <code>includePath</code> and <code>defines</code> settings. 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 <code>includePath</code> and <code>defines</code> settings instead.
|
||||
</div>
|
||||
<div>
|
||||
<input name="inputValue" id="compileCommands" style="width: 798px"></input>
|
||||
@@ -627,7 +650,7 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Browse: path</div>
|
||||
<div class="section-text">
|
||||
A list of paths for the tag parser to use while searching for included headers.
|
||||
A list of paths for the Tag Parser to search for headers included by your source files. If omitted, <code>includePath</code> will be used as the <code>path</code>.
|
||||
Searching on these paths is recursive by default. Specify <code>*</code> to indicate non-recursive search.
|
||||
For example: <code>/usr/include</code> will search through all subdirectories while <code>/usr/include/*</code> will not.
|
||||
</div>
|
||||
@@ -642,7 +665,9 @@
|
||||
<div class="section-title">Browse: limit symbols to included headers</div>
|
||||
<div>
|
||||
<input type="checkbox" id="limitSymbolsToIncludedHeaders" style="vertical-align: middle; transform: scale(1.5)">
|
||||
Process only those files directly or indirectly included as headers. If not set, process all files under the specified include paths.
|
||||
When true (or checked), the Tag Parser will only parse code files that have been directly or indirectly included by a source file
|
||||
in <code>${workspaceFolder}</code>. When false (or not checked), the Tag Parser will parse all code files found in the paths specified
|
||||
in the <code>Browse: path</code> list.
|
||||
</input>
|
||||
</div>
|
||||
</div>
|
||||
@@ -650,8 +675,10 @@
|
||||
<div class="section">
|
||||
<div class="section-title">Browse: database filename</div>
|
||||
<div class="section-text">
|
||||
Path to the generated symbol database. If a relative path is specified,
|
||||
it will be made relative to the workspace's default storage location.
|
||||
The path to the generated symbol database. 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 <code>${workspaceFolder}</code> variable can be used to specify a path relative to the workspace folder
|
||||
(e.g. <code>${workspaceFolder}/.vscode/browse.vc.db</code>)
|
||||
</div>
|
||||
<div>
|
||||
<input name="inputValue" id="databaseFilename" style="width: 798px"></input>
|
||||
|
||||
+21
-25
@@ -18,6 +18,7 @@ const elementId: { [key: string]: string } = {
|
||||
compilerPath: "compilerPath",
|
||||
compilerPathInvalid: "compilerPathInvalid",
|
||||
knownCompilers: "knownCompilers",
|
||||
compilerArgs: "compilerArgs",
|
||||
|
||||
intelliSenseMode: "intelliSenseMode",
|
||||
intelliSenseModeInvalid: "intelliSenseModeInvalid",
|
||||
@@ -150,7 +151,7 @@ class SettingsApp {
|
||||
|
||||
private onConfigNameChanged(): void {
|
||||
if (this.updating) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
const configName: HTMLInputElement = <HTMLInputElement>document.getElementById(elementId.configName);
|
||||
@@ -170,7 +171,7 @@ class SettingsApp {
|
||||
|
||||
private onConfigSelect(): void {
|
||||
if (this.updating) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
const el: HTMLSelectElement = <HTMLSelectElement>document.getElementById(elementId.configSelection);
|
||||
@@ -184,7 +185,7 @@ class SettingsApp {
|
||||
|
||||
private onKnownCompilerSelect(): void {
|
||||
if (this.updating) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
const el: HTMLInputElement = <HTMLInputElement>document.getElementById(elementId.knownCompilers);
|
||||
(<HTMLInputElement>document.getElementById(elementId.compilerPath)).value = el.value;
|
||||
@@ -200,7 +201,7 @@ class SettingsApp {
|
||||
}
|
||||
private onChangedCheckbox(id: string): void {
|
||||
if (this.updating) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
const el: HTMLInputElement = <HTMLInputElement>document.getElementById(id);
|
||||
@@ -213,7 +214,7 @@ class SettingsApp {
|
||||
|
||||
private onChanged(id: string): void {
|
||||
if (this.updating) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
const el: HTMLInputElement = <HTMLInputElement>document.getElementById(id);
|
||||
@@ -245,36 +246,31 @@ class SettingsApp {
|
||||
private updateConfig(config: any): void {
|
||||
this.updating = true;
|
||||
try {
|
||||
let joinEntries: (input: any) => string = (input: string[]) => {
|
||||
return (input && input.length) ? input.join("\n") : "";
|
||||
};
|
||||
|
||||
// Basic settings
|
||||
(<HTMLInputElement>document.getElementById(elementId.configName)).value = config.name;
|
||||
(<HTMLInputElement>document.getElementById(elementId.compilerPath)).value = config.compilerPath ? config.compilerPath : "";
|
||||
(<HTMLInputElement>document.getElementById(elementId.compilerArgs)).value = joinEntries(config.compilerArgs);
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.intelliSenseMode)).value = config.intelliSenseMode ? config.intelliSenseMode : "${default}";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.includePath)).value =
|
||||
(config.includePath && config.includePath.length > 0) ? config.includePath.join("\n") : "";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.defines)).value =
|
||||
(config.defines && config.defines.length > 0 ) ? config.defines.join("\n") : "";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.includePath)).value = joinEntries(config.includePath);
|
||||
(<HTMLInputElement>document.getElementById(elementId.defines)).value = joinEntries(config.defines);
|
||||
(<HTMLInputElement>document.getElementById(elementId.cStandard)).value = config.cStandard;
|
||||
(<HTMLInputElement>document.getElementById(elementId.cppStandard)).value = config.cppStandard;
|
||||
|
||||
// Advanced settings
|
||||
(<HTMLInputElement>document.getElementById(elementId.windowsSdkVersion)).value = config.windowsSdkVersion ? config.windowsSdkVersion : "";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.macFrameworkPath)).value =
|
||||
(config.macFrameworkPath && config.macFrameworkPath.length > 0) ? config.macFrameworkPath.join("\n") : "";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.macFrameworkPath)).value = joinEntries(config.macFrameworkPath);
|
||||
(<HTMLInputElement>document.getElementById(elementId.compileCommands)).value = config.compileCommands ? config.compileCommands : "";
|
||||
(<HTMLInputElement>document.getElementById(elementId.configurationProvider)).value = config.configurationProvider ? config.configurationProvider : "";
|
||||
|
||||
(<HTMLInputElement>document.getElementById(elementId.forcedInclude)).value =
|
||||
(config.forcedInclude && config.forcedInclude.length > 0) ? config.forcedInclude.join("\n") : "";
|
||||
(<HTMLInputElement>document.getElementById(elementId.forcedInclude)).value = joinEntries(config.forcedInclude);
|
||||
|
||||
if (config.browse) {
|
||||
(<HTMLInputElement>document.getElementById(elementId.browsePath)).value =
|
||||
(config.browse.path && config.browse.path.length > 0) ? config.browse.path.join("\n") : "";
|
||||
(<HTMLInputElement>document.getElementById(elementId.limitSymbolsToIncludedHeaders)).checked =
|
||||
(<HTMLInputElement>document.getElementById(elementId.browsePath)).value = joinEntries(config.browse.path);
|
||||
(<HTMLInputElement>document.getElementById(elementId.limitSymbolsToIncludedHeaders)).checked =
|
||||
(config.browse.limitSymbolsToIncludedHeaders && config.browse.limitSymbolsToIncludedHeaders);
|
||||
(<HTMLInputElement>document.getElementById(elementId.databaseFilename)).value = config.browse.databaseFilename ? config.browse.databaseFilename : "";
|
||||
} else {
|
||||
@@ -338,9 +334,9 @@ class SettingsApp {
|
||||
// No need to add items unless webview is reloaded, in which case it will not have any elements.
|
||||
// Otherwise, add items again.
|
||||
if (list.firstChild) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (compilers.length === 0) {
|
||||
const noCompilers: string = "(No compiler paths detected)";
|
||||
let option: HTMLOptionElement = document.createElement("option");
|
||||
@@ -352,7 +348,7 @@ class SettingsApp {
|
||||
list.value = noCompilers;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (let path of compilers) {
|
||||
let option: HTMLOptionElement = document.createElement("option");
|
||||
option.text = path;
|
||||
|
||||
@@ -38,6 +38,9 @@ const config = {
|
||||
},
|
||||
optimization: {
|
||||
minimize: false
|
||||
},
|
||||
stats: {
|
||||
warnings: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +1,66 @@
|
||||
# vscode-cpptools
|
||||
# C/C++ for Visual Studio Code
|
||||
|
||||
This is the official repository for the [Microsoft C/C++ extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).
|
||||
#### [Repository](https://github.com/microsoft/vscode-cpptools) | [Issues](https://github.com/microsoft/vscode-cpptools/issues) | [Documentation](https://code.visualstudio.com/docs/languages/cpp) | [Code Samples](https://github.com/microsoft/vscode-cpptools/tree/master/Code%20Samples) | [Offline Installers](https://github.com/microsoft/vscode-cpptools/releases)
|
||||
|
||||
The `vscode-cpptools` repository is where we do development and there are many ways you can support the extension, for example:
|
||||
[](https://aka.ms/vsls)
|
||||
|
||||
* [Report issues or request features](https://github.com/Microsoft/vscode-cpptools/issues)
|
||||
- If someone has filed a similar issue, please provide any additional information that can help us resolve it on the issue
|
||||
- If someone has filed a similar feature request, please leave a thumbs up reaction on the issue
|
||||
- [List of popular feature requests](https://github.com/Microsoft/vscode-cpptools/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A%22Feature+Request%22)
|
||||
* [Contribute to the extension](Extension)
|
||||
This preview release of the C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging.
|
||||
|
||||
## Getting Started
|
||||
## Overview and getting started
|
||||
* [C/C++ extension overview](https://code.visualstudio.com/docs/languages/cpp)
|
||||
* [Get Started with C++ and Windows Subsystem for Linux (WSL)](https://code.visualstudio.com/docs/cpp/config-wsl)
|
||||
* [Get Started with C++ and Mingw-w64](https://code.visualstudio.com/docs/cpp/config-mingw)
|
||||
* [Get Started with C++ and Clang/LLVM on macOS](https://code.visualstudio.com/docs/cpp/config-clang-mac)
|
||||
* [Get Started with C++ and Microsoft C++ compiler (MSVC)](https://code.visualstudio.com/docs/cpp/config-msvc)
|
||||
|
||||
You can learn how to use the extension at [VS Code for C/C++](https://code.visualstudio.com/docs/languages/cpp).
|
||||
## Quick links
|
||||
* [Editing features (IntelliSense)](https://code.visualstudio.com/docs/cpp/cpp-ide)
|
||||
* [IntelliSense configuration](https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp)
|
||||
* [Enhanced colorization](https://code.visualstudio.com/docs/cpp/colorization-cpp)
|
||||
* [Debugging](https://code.visualstudio.com/docs/cpp/cpp-debug)
|
||||
* [Debug configuration](https://code.visualstudio.com/docs/cpp/launch-json-reference)
|
||||
* [Enable logging for IntelliSense or debugging](https://code.visualstudio.com/docs/cpp/enable-logging-cpp)
|
||||
|
||||
If you clone this repository, you can also try out our [Code Samples](Code%20Samples).
|
||||
## Questions and feedback
|
||||
|
||||
If you have any questions, check out our [**Documentation**](Documentation) folder. If you do not find your answer there, feel free to ask it in our [issues page](https://github.com/Microsoft/vscode-cpptools/issues).
|
||||
**[FAQs](https://code.visualstudio.com/docs/cpp/faq-cpp)**
|
||||
<br>
|
||||
Check out the FAQs before filing a question.
|
||||
<br>
|
||||
|
||||
### Contribution
|
||||
**[Provide feedback](https://github.com/microsoft/vscode-cpptools/issues/new/choose)**
|
||||
<br>
|
||||
File questions, issues, or feature requests for the extension.
|
||||
<br>
|
||||
|
||||
**[Known issues](https://github.com/Microsoft/vscode-cpptools/issues)**
|
||||
<br>
|
||||
If someone has already filed an issue that encompasses your feedback, please leave a 👍 or 👎 reaction on the issue to upvote or downvote it to help us prioritize the issue.
|
||||
<br>
|
||||
|
||||
**[Quick survey](https://www.research.net/r/VBVV6C6)**
|
||||
<br>
|
||||
Let us know what you think of the extension by taking the quick survey.
|
||||
|
||||
## Offline installation
|
||||
|
||||
The extension has platform-specific binary dependencies, therefore installation via the Marketplace requires an Internet connection in order to download additional dependencies. 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 platform-specific packages and install them by running VS Code's `"Install from VSIX..."` command. These "offline' packages are available at: https://github.com/Microsoft/vscode-cpptools/releases.
|
||||
|
||||
Package | Platform
|
||||
:--- | :---
|
||||
`cpptools-linux.vsix` | Linux 64-bit
|
||||
`cpptools-linux32.vsix` | Linux 32-bit
|
||||
`cpptools-osx.vsix` | macOS
|
||||
`cpptools-win32.vsix` | Windows 64-bit & 32-bit
|
||||
|
||||
## Contribution
|
||||
|
||||
Contributions are always welcome. Please see our [contributing guide](CONTRIBUTING.md) for more details.
|
||||
|
||||
### Microsoft Open Source Code of Conduct
|
||||
## 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.
|
||||
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.
|
||||
|
||||
### Data/Telemetry
|
||||
|
||||
This extension collects usage data and sends it to Microsoft to help improve our products and services. Collection of telemetry is controlled via the same setting provided by Visual Studio Code: `"telemetry.enableTelemetry"`. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
|
||||
## Data and telemetry
|
||||
|
||||
This extension collects usage data and sends it to Microsoft to help improve our products and services. Collection of telemetry is controlled via the same setting provided by Visual Studio Code: `"telemetry.enableTelemetry"`. Read our [privacy statement](https://privacy.microsoft.com/en-us/privacystatement) to learn more.
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// 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}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/themes/*.json"
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -0,0 +1,470 @@
|
||||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Visual Studio Dark (C/C++)",
|
||||
"colors": {
|
||||
"editor.background": "#1E1E1E",
|
||||
"editor.foreground": "#D4D4D4",
|
||||
"editor.inactiveSelectionBackground": "#3A3D41",
|
||||
"editorIndentGuide.background": "#404040",
|
||||
"editorIndentGuide.activeBackground": "#707070",
|
||||
"editor.selectionHighlightBackground": "#ADD6FF26",
|
||||
"editorWhitespace.foreground": "#204852",
|
||||
"list.dropBackground": "#383B3D",
|
||||
"activityBarBadge.background": "#007ACC",
|
||||
"sideBarTitle.foreground": "#BBBBBB",
|
||||
"input.placeholderForeground": "#A6A6A6",
|
||||
"settings.textInputBackground": "#292929",
|
||||
"settings.numberInputBackground": "#292929",
|
||||
"menu.background": "#252526",
|
||||
"menu.foreground": "#CCCCCC",
|
||||
"statusBarItem.remoteForeground": "#FFF",
|
||||
"statusBarItem.remoteBackground": "#16825D"
|
||||
},
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": [
|
||||
"meta.embedded",
|
||||
"source.groovy.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#D4D4D4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "header",
|
||||
"settings": {
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#57A64A"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#646695"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.tag.css",
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"entity.other.attribute-name.class.mixin.css",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.pseudo-class.css",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.attribute.scss",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d7ba7d"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#f44747"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "punctuation.definition.quote.begin.markdown",
|
||||
"settings": {
|
||||
"foreground": "#6A9955"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "punctuation.definition.list.begin.markdown",
|
||||
"settings": {
|
||||
"foreground": "#6796e6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inline.raw",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brackets of XML/HTML tags",
|
||||
"scope": "punctuation.definition.tag",
|
||||
"settings": {
|
||||
"foreground": "#808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.modifier",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.tag",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.value",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#d16969"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "String interpolation",
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Reset JavaScript string interpolation expression",
|
||||
"scope": [
|
||||
"meta.template.expression"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"variable.css",
|
||||
"variable.scss",
|
||||
"variable.other.less",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#B4B4B4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.instanceof",
|
||||
"keyword.operator.logical.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.section.embedded.begin.php",
|
||||
"punctuation.section.embedded.end.php"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#9cdcfe"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#b5cea8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the Java import and package identifiers",
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#d4d4d4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "this.self",
|
||||
"scope": "variable.language",
|
||||
"settings": {
|
||||
"foreground": "#569cd6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name",
|
||||
"settings": {
|
||||
"foreground": "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control.directive",
|
||||
"settings": {
|
||||
"foreground": "#9B9B9B"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.operator",
|
||||
"settings": {
|
||||
"foreground": "#B4B4B4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.preprocessor",
|
||||
"settings": {
|
||||
"foreground": "#BD63C5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.label",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.namespace",
|
||||
"settings": {
|
||||
"foreground": "#C8C8C8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.name.type",
|
||||
"entity.name.class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#4EC9B0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal",
|
||||
"settings": {
|
||||
"foreground": "#DADADA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal.number",
|
||||
"settings": {
|
||||
"foreground": "#B5CEA8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal.string",
|
||||
"settings": {
|
||||
"foreground": "#D69D85"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.delete"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.enummember",
|
||||
"settings": {
|
||||
"foreground": "#B8D7A3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.property",
|
||||
"settings": {
|
||||
"foreground": "#DADADA"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.parameter",
|
||||
"settings": {
|
||||
"foreground": "#7F7F7F"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,459 @@
|
||||
{
|
||||
"$schema": "vscode://schemas/color-theme",
|
||||
"name": "Visual Studio Light (C/C++)",
|
||||
"colors": {
|
||||
"editor.background": "#FFFFFF",
|
||||
"editor.foreground": "#000000",
|
||||
"editor.inactiveSelectionBackground": "#E5EBF1",
|
||||
"editorIndentGuide.background": "#D3D3D3",
|
||||
"editorIndentGuide.activeBackground": "#939393",
|
||||
"editor.selectionHighlightBackground": "#ADD6FF80",
|
||||
"editorSuggestWidget.background": "#F3F3F3",
|
||||
"editorWhitespace.foreground": "#2B91AF",
|
||||
"activityBarBadge.background": "#007ACC",
|
||||
"sideBarTitle.foreground": "#6F6F6F",
|
||||
"list.hoverBackground": "#E8E8E8",
|
||||
"input.placeholderForeground": "#767676",
|
||||
"settings.textInputBorder": "#CECECE",
|
||||
"settings.numberInputBorder": "#CECECE",
|
||||
"statusBarItem.remoteForeground": "#FFF",
|
||||
"statusBarItem.remoteBackground": "#16825D"
|
||||
},
|
||||
"tokenColors": [
|
||||
{
|
||||
"scope": ["meta.embedded", "source.groovy.embedded"],
|
||||
"settings": {
|
||||
"foreground": "#000000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "emphasis",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "strong",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.diff.header",
|
||||
"settings": {
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "comment",
|
||||
"settings": {
|
||||
"foreground": "#008000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.language",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"constant.numeric"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811f3f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "css tags in selectors, xml tags",
|
||||
"scope": "entity.name.tag",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.selector",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.other.attribute-name",
|
||||
"settings": {
|
||||
"foreground": "#ff0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.other.attribute-name.class.css",
|
||||
"entity.other.attribute-name.class.mixin.css",
|
||||
"entity.other.attribute-name.id.css",
|
||||
"entity.other.attribute-name.parent-selector.css",
|
||||
"entity.other.attribute-name.pseudo-class.css",
|
||||
"entity.other.attribute-name.pseudo-element.css",
|
||||
"source.css.less entity.other.attribute-name.id",
|
||||
"entity.other.attribute-name.attribute.scss",
|
||||
"entity.other.attribute-name.scss"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "invalid",
|
||||
"settings": {
|
||||
"foreground": "#cd3131"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.underline",
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.bold",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#000080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.heading",
|
||||
"settings": {
|
||||
"fontStyle": "bold",
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.italic",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inserted",
|
||||
"settings": {
|
||||
"foreground": "#09885a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.deleted",
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.changed",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.definition.quote.begin.markdown",
|
||||
"punctuation.definition.list.begin.markdown"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "markup.inline.raw",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brackets of XML/HTML tags",
|
||||
"scope": "punctuation.definition.tag",
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.string",
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.preprocessor.numeric",
|
||||
"settings": {
|
||||
"foreground": "#09885a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "meta.structure.dictionary.key.python",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.type",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "storage.modifier",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string",
|
||||
"settings": {
|
||||
"foreground": "#a31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"string.comment.buffered.block.pug",
|
||||
"string.quoted.pug",
|
||||
"string.interpolated.pug",
|
||||
"string.unquoted.plain.in.yaml",
|
||||
"string.unquoted.plain.out.yaml",
|
||||
"string.unquoted.block.yaml",
|
||||
"string.quoted.single.yaml",
|
||||
"string.quoted.double.xml",
|
||||
"string.quoted.single.xml",
|
||||
"string.unquoted.cdata.xml",
|
||||
"string.quoted.double.html",
|
||||
"string.quoted.single.html",
|
||||
"string.unquoted.html",
|
||||
"string.quoted.single.handlebars",
|
||||
"string.quoted.double.handlebars"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "string.regexp",
|
||||
"settings": {
|
||||
"foreground": "#811f3f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "String interpolation",
|
||||
"scope": [
|
||||
"punctuation.definition.template-expression.begin",
|
||||
"punctuation.definition.template-expression.end",
|
||||
"punctuation.section.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Reset JavaScript string interpolation expression",
|
||||
"scope": [
|
||||
"meta.template.expression"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.constant.property-value",
|
||||
"support.constant.font-name",
|
||||
"support.constant.media-type",
|
||||
"support.constant.media",
|
||||
"constant.other.color.rgb-value",
|
||||
"constant.other.rgb-value",
|
||||
"support.constant.color"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.vendored.property-name",
|
||||
"support.type.property-name",
|
||||
"variable.css",
|
||||
"variable.scss",
|
||||
"variable.other.less",
|
||||
"source.coffee.embedded"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#ff0000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"support.type.property-name.json"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.operator",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.expression",
|
||||
"keyword.operator.cast",
|
||||
"keyword.operator.sizeof",
|
||||
"keyword.operator.instanceof",
|
||||
"keyword.operator.logical.python"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.other.unit",
|
||||
"settings": {
|
||||
"foreground": "#09885a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"punctuation.section.embedded.begin.php",
|
||||
"punctuation.section.embedded.end.php"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#800000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "support.function.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#0451a5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "constant.sha.git-rebase",
|
||||
"settings": {
|
||||
"foreground": "#09885a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "coloring of the Java import and package identifiers",
|
||||
"scope": [
|
||||
"storage.modifier.import.java",
|
||||
"variable.language.wildcard.java",
|
||||
"storage.modifier.package.java"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "this.self",
|
||||
"scope": "variable.language",
|
||||
"settings": {
|
||||
"foreground": "#0000ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "keyword.control.directive",
|
||||
"settings": {
|
||||
"foreground": "#808080"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.function.operator",
|
||||
"settings": {
|
||||
"foreground": "#008080"
|
||||
}
|
||||
}, {
|
||||
"scope": "entity.name.function.preprocessor",
|
||||
"settings": {
|
||||
"foreground": "#BD63C5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.namespace",
|
||||
"settings": {
|
||||
"foreground": "#000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"entity.name.type",
|
||||
"entity.name.class"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#2B91AF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "entity.name.operator.custom-literal.string",
|
||||
"settings": {
|
||||
"foreground": "#A31515"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"keyword.operator.new",
|
||||
"keyword.operator.delete"
|
||||
],
|
||||
"settings": {
|
||||
"foreground": "#0000FF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.other.enummember",
|
||||
"settings": {
|
||||
"foreground": "#2F4F4F"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "variable.parameter",
|
||||
"settings": {
|
||||
"foreground": "#808080"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Generated
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "cpptools-themes",
|
||||
"version": "0.24.0-master",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "cpptools-themes",
|
||||
"displayName": "C/C++ Themes",
|
||||
"description": "UI Themes for C/C++ extension.",
|
||||
"version": "1.0.0",
|
||||
"publisher": "ms-vscode",
|
||||
"preview": false,
|
||||
"icon": "LanguageCCPP_color_128x.png",
|
||||
"readme": "README.md",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"engines": {
|
||||
"vscode": "^1.30.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Microsoft/vscode-cpptools/issues",
|
||||
"email": "[email protected]"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/vscode-cpptools.git"
|
||||
},
|
||||
"homepage": "https://github.com/Microsoft/vscode-cpptools",
|
||||
"qna": "https://github.com/Microsoft/vscode-cpptools/issues",
|
||||
"keywords": [
|
||||
"C",
|
||||
"C++",
|
||||
"Microsoft",
|
||||
"Theme",
|
||||
"Themes"
|
||||
],
|
||||
"categories": [
|
||||
"Themes"
|
||||
],
|
||||
"contributes": {
|
||||
"themes": [
|
||||
{
|
||||
"id": "Visual Studio Dark - C++",
|
||||
"label": "Dark (Visual Studio - C/C++)",
|
||||
"uiTheme": "vs-dark",
|
||||
"path": "./cpptools_dark_vs.json"
|
||||
},
|
||||
{
|
||||
"id": "Visual Studio Light - C++",
|
||||
"label": "Light (Visual Studio - C/C++)",
|
||||
"uiTheme": "vs",
|
||||
"path": "./cpptools_light_vs.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,216 +1 @@
|
||||
# Configuring `launch.json` for C/C++ debugging
|
||||
|
||||
The **launch.json** file is used to configure the debugger in Visual Studio Code.
|
||||
|
||||
Visual Studio Code generates a **launch.json** with almost all of the required information. To get started
|
||||
debugging you need to fill in the `program` field with the path to the executable you plan to debug. This must be specified for
|
||||
both the launch and attach (if you plan to attach to a running instance at any point) configurations.
|
||||
|
||||
The generated file contains two sections. One that configures debugging for launch and a second that configures debugging for attach.
|
||||
|
||||
# Configure VS Code's debugging behavior
|
||||
|
||||
Set or change the following options to control VS Code's behavior during debugging:
|
||||
|
||||
* #### `program` (required)
|
||||
Specifies the full path to executable the debugger will launch or attach to.
|
||||
|
||||
* #### `symbolSearchPath`
|
||||
Tells the _Visual Studio Windows Debugger_ what paths to search for symbol (.pdb) files. Separate multiple paths with a semicolon. Example `"C:\\Symbols;C:\\SymbolDir2"`.
|
||||
|
||||
* #### `additionalSOLibSearchPath`
|
||||
Tells _GDB or LLDB_ what paths to search for .so files. Separate multiple paths with a semicolon. Example: `"/Users/user/dir1;/Users/user/dir2"`.
|
||||
|
||||
* #### `externalConsole`
|
||||
Windows: When set to true, it will spawn an external console. When set to false, it will use VS Code's integratedTerminal.
|
||||
Linux: When set to true, it will notify VS Code to spawn an external console. When set to false, it will use VS Code's integratedTerminal.
|
||||
macOS: When set to true, it will spawn an external console through `lldb-mi`. When set to false, the output can be seen in VS Code's debugConsole. Due to limitations within `lldb-mi`, integratedTerminal support is not available.
|
||||
|
||||
* #### `avoidWindowsConsoleRedirection`
|
||||
In order to support VSCode's Integrated terminal with gdb on Windows, the extension adds console redirection commands to the debuggee's arguments to have console input and output show up in the integrated terminal. Setting this option to `true` will disable it.
|
||||
|
||||
* #### `logging`
|
||||
Optional flags to determine what types of messages should be logged to the Debug Console.
|
||||
* ##### `exceptions`
|
||||
Optional flag to determine whether exception messages should be logged to the Debug Console. Defaults to true.
|
||||
* ##### `moduleLoad`
|
||||
Optional flag to determine whether module load events should be logged to the Debug Console. Defaults to true.
|
||||
* ##### `programOutput`
|
||||
Optional flag to determine whether program output should be logged to the Debug Console. Defaults to true.
|
||||
* ##### `engineLogging`
|
||||
Optional flag to determine whether diagnostic engine logs should be logged to the Debug Console. Defaults to false.
|
||||
* ##### `trace`
|
||||
Optional flag to determine whether diagnostic adapter command tracing should be logged to the Debug Console. Defaults to false.
|
||||
* ##### `traceResponse`
|
||||
Optional flag to determine whether diagnostic adapter command and response tracing should be logged to the Debug Console. Defaults to false.
|
||||
|
||||
* #### `visualizerFile`
|
||||
.natvis file to be used when debugging. See [Natvis syntax reference](http://aka.ms/natvis#Anchor_8) for information on how to create Natvis files.
|
||||
|
||||
* #### `showDisplayString`
|
||||
When a visualizerFile is specified, showDisplayString will enable the display string. Turning this option on can cause slower performance during debugging.
|
||||
|
||||
**Example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "C++ Launch (Windows)",
|
||||
"type": "cppvsdbg",
|
||||
"request": "launch",
|
||||
"program": "C:\\app1\\Debug\\app1.exe",
|
||||
"symbolSearchPath": "C:\\Symbols;C:\\SymbolDir2",
|
||||
"externalConsole": true,
|
||||
"logging": {
|
||||
"moduleLoad": false,
|
||||
"trace": true
|
||||
},
|
||||
"visualizerFile": "${workspaceRoot}/my.natvis",
|
||||
"showDisplayString": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
# Configure the target application
|
||||
|
||||
The following options enable you to modify the state of the target application when it is launched:
|
||||
|
||||
* #### `args`
|
||||
JSON array of command line arguments to pass to the program when it is launched. Example `["arg1", "arg2"]`. If you are escaping characters you will need to double escape them. For example `["{\\\"arg\\\": true}]` will send `{"arg1": true}` to your application.
|
||||
|
||||
* #### `cwd`
|
||||
Sets the working directory of the application launched by the debugger.
|
||||
|
||||
* #### `environment`
|
||||
Environment variables to add to the environment for the program. Example: `[ { "name": "squid", "value": "clam" } ]`.
|
||||
|
||||
**Example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "C++ Launch",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/a.out",
|
||||
"args": ["arg1", "arg2"],
|
||||
"environment": [{"name": "squid", "value": "clam"}],
|
||||
"cwd": "${workspaceRoot}"
|
||||
}
|
||||
```
|
||||
|
||||
## Customizing GDB or LLDB
|
||||
|
||||
You can change the behavior of GDB or LLDB by setting the following options:
|
||||
|
||||
* #### `MIMode`
|
||||
Indicates the debugger that VS Code will connect to. Must be set to `gdb` or `lldb`. This is pre-configured on a per-operating system basis and can be changed as needed.
|
||||
|
||||
* #### `miDebuggerPath`
|
||||
The path to the debugger (such as gdb). When only the executable is specified, it will search the operating system's PATH variable for a debugger (GDB on Linux and Windows, LLDB on OS X).
|
||||
|
||||
* #### `miDebuggerArgs`
|
||||
Additional arguments to pass to the debugger (such as gdb).
|
||||
|
||||
* #### `stopAtEntry`
|
||||
If set to true, the debugger should stop at the entry-point of the target (ignored on attach). Default value is `false`.
|
||||
|
||||
* #### `setupCommands`
|
||||
JSON array of commands to execute in order to setup the GDB or LLDB. Example: `"setupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false }]`.
|
||||
|
||||
* #### `customLaunchSetupCommands`
|
||||
If provided, this replaces the default commands used to launch a target with some other commands. For example, this can be "-target-attach" in order to attach to a target process. An empty command list replaces the launch commands with nothing, which can be useful if the debugger is being provided launch options as command line options. Example: `"customLaunchSetupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false }]`.
|
||||
|
||||
* #### `launchCompleteCommand`
|
||||
The command to execute after the debugger is fully setup in order to cause the target process to run. Allowed values are "exec-run", "exec-continue", "None". The default value is "exec-run".
|
||||
|
||||
**Example:**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "C++ Launch",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/a.out",
|
||||
"stopAtEntry": false,
|
||||
"customLaunchSetupCommands": [
|
||||
{ "text": "target-run", "description": "run target", "ignoreFailures": false }
|
||||
],
|
||||
"launchCompleteCommand": "exec-run",
|
||||
"linux": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "/usr/bin/gdb"
|
||||
},
|
||||
"osx": {
|
||||
"MIMode": "lldb"
|
||||
},
|
||||
"windows": {
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Debugging dump files
|
||||
|
||||
The C/C++ extension enables debugging dump files on Windows and core dump files Linux and OS X.
|
||||
|
||||
* #### `dumpPath`
|
||||
If you want to debug a Windows dump file, set this to the path to the dump file to start debugging in the `launch` configuration.
|
||||
|
||||
* #### `coreDumpPath`
|
||||
Full path to a core dump file to debug for the specified program. Set this to the path to the core dump file to start debugging in the `launch` configuration.
|
||||
_Note: core dump debugging is not supported with MinGw._
|
||||
|
||||
## Remote debugging or debugging with a local debugger server
|
||||
|
||||
* #### `miDebuggerServerAddress`
|
||||
Network address of the debugger server (e.g. gdbserver) to connect to for remote debugging (example: `localhost:1234`).
|
||||
|
||||
* #### `debugServerPath`
|
||||
Full path to debug server to launch.
|
||||
|
||||
* #### `debugServerArgs`
|
||||
Arguments for the debugger server.
|
||||
|
||||
* #### `serverStarted`
|
||||
Server-started pattern to look for in the debug server output.
|
||||
|
||||
* #### `serverLaunchTimeout`
|
||||
Time in milliseconds, for the debugger to wait for the debugServer to start up. Default is 10000.
|
||||
|
||||
## Additional properties
|
||||
|
||||
* #### `processId`
|
||||
Defaults to `${command.pickProcess}` which will display a list of available processes the debugger can attach to. It is recommended to leave this default, but the property can be explicitly set to a specific process ID for the debugger to attach to.
|
||||
|
||||
* #### `request`
|
||||
Indicates whether the configuration section is intended to `launch` the program or `attach` to an already running instance.
|
||||
|
||||
* #### `targetArchitecture`
|
||||
`Deprecated` This option is no longer needed as the target architecture is automatically detected.
|
||||
|
||||
* #### `type`
|
||||
Indicates the underlying debugger being used. Must be `cppvsdbg` when using the Visual Studio Windows debugger, and `cppdbg` when using GDB or LLDB. This is automatically set to the correct value when the
|
||||
**launch.json** file is created.
|
||||
|
||||
* #### `sourceFileMap`
|
||||
This allows mapping of the compile time paths for source to local source locations. It is an object of key/value pairs and will resolve the first string-matched path. (example: `"sourceFileMap": { "/mnt/c": "c:\\" }` will map any path returned by the debugger that begins with `/mnt/c` and convert it to `c:\\`. You can have multiple mappings in the object but they will be handled in the order provided.)
|
||||
|
||||
## Environment variable definitions file
|
||||
|
||||
An environment variable definitions file is a simple text file containing key-value pairs in the form of `environment_variable=value`, with `#` used for comments. Multiline values are not supported.
|
||||
|
||||
The `cppvsdbg` debugger configuration also contains an `envFile` property that allows you to easily set variables for debugging purposes.
|
||||
|
||||
For example:
|
||||
|
||||
**project.env file**
|
||||
|
||||
```bash
|
||||
# project.env
|
||||
|
||||
# Example environment with key as 'MYENVRIONMENTPATH' and value as C:\\Users\\USERNAME\\Project
|
||||
MYENVRIONMENTPATH=C:\\Users\\USERNAME\\Project
|
||||
|
||||
# Variables with spaces
|
||||
SPACED_OUT_PATH="C:\\This Has Spaces\\Project"
|
||||
```
|
||||
The documentation for debug configuration has moved to https://code.visualstudio.com/docs/cpp/launch-json-reference.
|
||||
Reference in New Issue
Block a user