MAKE integration in Visual Studio Code
Перейти к файлу
Andreea Isac 1930012b00 Add sha to vsix version 2021-11-16 10:16:12 -08:00
.github/workflows Add sha to vsix version 2021-11-16 10:16:12 -08:00
.vscode Small set of regression tests (win, linux) (#187) 2021-06-30 16:14:13 -07:00
docs Add new makeDirectory setting, improve makefile detection logic and fix words in docs. (#161) 2021-05-05 13:10:41 -07:00
res Compliance work (#77) 2020-12-03 13:19:38 -08:00
src Small 0.3 bug fixes (c/c++ standard defaults and output channel) (#227) 2021-11-15 10:23:38 -08:00
.gitignore update string used for telemetry (#137) 2021-03-02 08:12:37 -08:00
.vscodeignore update string used for telemetry (#137) 2021-03-02 08:12:37 -08:00
CHANGELOG.md Dev/andris/makefile tools/release0.2.2 (#172) 2021-05-12 13:41:36 -07:00
CONTRIBUTING.md Compliance work (#77) 2020-12-03 13:19:38 -08:00
LICENSE.txt Compliance work (#77) 2020-12-03 13:19:38 -08:00
NOTICE.txt Add 3rd party notices (#78) 2020-12-03 11:03:46 -08:00
PRIVACY.txt Compliance work (#77) 2020-12-03 13:19:38 -08:00
README.md Add new makeDirectory setting, improve makefile detection logic and fix words in docs. (#161) 2021-05-05 13:10:41 -07:00
package.json Fix version typo 2021-11-15 11:42:50 -08:00
tsconfig.json Address more linting warnings, fix few bugs caused by latest changes, implemented more code review feedback. There was time only for brief testing, not with the large code bases used for the previous commits (no vim, nodejs nor linux kernel). 2019-08-28 02:43:12 -07:00
tslint.json Fix path inconsistencies for MinGW. Fix backtick parser bug related to source file paths. (#86) 2021-02-03 04:32:11 -08:00
yarn.lock Bump path-parse from 1.0.6 to 1.0.7 (#200) 2021-09-23 13:48:08 -07:00

README.md

VS Code Makefile Tools

This extension provides IntelliSense configurations to the VS Code C/C++ Extension for Makefile projects. It also provides convenient commands to build, debug, and run your targets.

Getting Started

Activating the extension

The extension will activate when it finds a Makefile in your ${workspaceFolder}. If your Makefile does not reside in the root of your folder, use the makefile.makefilePath (which generates the make switch -f) or makefile.makeDirectory (which generates thet make swich -C) settings to instruct the extension where to find it.

Note: the extension will not activate automatically if your Makefile is not in the root of your workspace folder. If this is the case, you will need to manually activate it by running one of the Makefile: commands from VS Code's command palette.

Pre-configuring your project

If you need any environment variables to be set or any terminal operations to be run before configure/build (like the usual ./autogen.sh, ./configure or vcvarsall.bat), you need to launch VSCode from a terminal that is already set up according to your project requirements OR you can point the makefile.preConfigureSript setting to a batch script file and invoke it at any time via the command makefile.preconfigure in the pallette. By seting makefile.alwaysPreConfigure to true, you don't need to run the pre-configure command separately. The extension is going to invoke the script before every configure operation.

Configuring your project

By default, the extension will attempt to use a make program that resides within your $PATH to configure the project. If you use a different flavor of the make tool or if it is not in your $PATH, use the makefile.makePath setting to instruct the extension where to find it.

The extension can also avoid running the make program when it configures your project, if you point the makefile.buildLog setting to the output of a build.

Now, you are ready to configure your project. If you normally just run make in the terminal to configure/build your project, you shouldn't need to do anything else at this point besides accept the prompt from cpptools to allow this extension to configure IntelliSense:

image

If you don't see that message, or you accidentally dismissed it, you can grant Makefile Tools permission to configure IntelliSense by running the C/C++: Change Configuration Provider... command and selecting Makefile Tools from the list.

If you regularly pass additional arguments to make, you should use the makefile.configurations setting to create a configuration object and specify the arguments to pass to make with the makeArgs property. There are other options you can configure in this object as well. If you configure make in multiple different ways, you can create multiple configuration objects with different arguments. Just make sure to give your configurations a unique name so that you can tell them apart.

Building targets

To build a target, run the Makefile: Set the target to be built by make command (default target is "all") and then run the Makefile: Build the current target. There are also convenience commands to build ALL, build clean, etc. without having to change your active build target.

Debugging and running targets

To Debug or run a target, run the Makefile: Set the make launch configuration command and select the target you want to debug or run. If a configuration for that target has not already been added to the makefile.launchConfigurations setting, then one will be added for you at this time. Then run the Makefile: Debug the selected binary target or Makefile: Run the selected binary target in the terminal command to start debugging or running the target without a debugger attached.

If you need to pass additional arguments to your targets, update the makefile.launchConfigurations by adding the binaryArgs property to the configuration.

Troubleshooting

We documented the settings and configurations needed for a select number of repositories that we have tested. The document can be found here: docs/repositories.md. Contributions to this document (e.g. for additional repositories that we have not tested) are welcome.

A more in-depth troubleshooting guide can be found here: docs/troubleshooting.md

Feedback and Suggestions

We'd love to hear what you think! If you are having trouble with the extension, please open an issue.

You can also leave us a rating on the VS Code Marketplace and let us know what you like about the extension or would like to see improved.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct 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 to learn more.