Skip to content

Commit

Permalink
Support Bake RText Service, multi-root workspaces (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanilov committed Jan 27, 2020
1 parent 9543a5d commit b30c1ec
Show file tree
Hide file tree
Showing 42 changed files with 3,612 additions and 2,319 deletions.
38 changes: 34 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,56 @@
"version": "0.1.0",
"configurations": [
{
"name": "Extension",
"name": "Attach to Language Server (LS) 6009",
"type": "node",
"request": "attach",
"address": "localhost",
"protocol": "inspector",
"port": 6009,
"sourceMaps": true,
"skipFiles": [
"<node_internals>/**"
]
},
{
"name": "Attach to Language Server (LS) 6010",
"type": "node",
"request": "attach",
"address": "localhost",
"protocol": "inspector",
"port": 6010,
"sourceMaps": true,
"skipFiles": [
"<node_internals>/**"
]
},
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/**/*.js" ],
"preLaunchTask": "npm: watch"
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"name": "Launch Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm: watch"
"preLaunchTask": "${defaultBuildTask}"
}
],
"compounds": [
{
"name": "Launch Extension/Attach to LS",
"configurations": ["Launch Extension", "Attach to Language Server (LS) 6009"]
}
]
}
8 changes: 8 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "compile",
"problemMatcher": [
"$tsc"
],
"group": "build"
}
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- "Use RText Server" settings option (default: enabled). When it is enabled the `bake-rtext-service` is used to get the diagnostic information (can be found in Problems tab). Bake version 2.56.0 or higher is required.
- Initial support of multi-root workspace

## [0.8.0] - 2019-12-23
### Added
Expand Down
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ Bake is a build tool for C++ projects supporting:
- Import C/C++ Include paths and Defines into VS Code
- Create new .h and .cpp files based on templates (from explorer's context menu)
- Search for and execute targets from bake files (from Tasks: Run Task command)
- Show Hovers
- Show Code Completion Proposals
- Document Formatting (`bake-format` tool is used)
- Support Bake RText Service

The following features are provided by the Bake Language Server if `useRTextServer` is enabled:
- Provide Diagnostics

## Requirements

- bake installation >= 2.42.1 ([bake installation instructions](https://esrlabs.github.io/bake/install/install_bake.html#how-to-install-bake))
- Linux (Windows and Mac OS X might work too)
- an existing `.vscode/c_cpp_properties.json` file ([how to create](https://code.visualstudio.com/docs/languages/cpp#_intellisense))
- RText Server functionality requries bake-toolkit >= 2.56.0

## Usage

Expand All @@ -41,12 +49,31 @@ There are two ways on how to select a project/config combination.

1) Optional: there are pre-defined combinations at your `.vscode/settings.json`. These
combinations are called *build variants*. They may include an optional `--adapt`
parameter, too. If a build variant is marked as `default=true` is is automatically imported during opening of the workspace.
parameter, too. If a build variant is marked as `default=true` is is automatically imported during opening of the workspace.

2) Let VS Code search for `Project.meta` files in your workspace. Then you can select the project and the build-config afterwards.

![](build-variant-selection.png)


#### Task definition

If `config` property is not set, then the Bake project default configuration will be used. The `name` property is used only in the VS Code UI to identify your task in the Tasks list.

```json
{
"name": "MyTask",
"type": "bake",
"project": "project_name",
"config": "config_name",
"problemMatcher": [
"$gcc"
],
"group": "build",
"args": "argument_list"
}
```

#### Create new .h/.cpp files

The bake extension can assist you in creating new `.h` or `*.cpp` files. The files are then pre-filled with copyright informations, namespace definitions (derived from the folder name) and an empty class definition.
Expand Down Expand Up @@ -97,7 +124,7 @@ This extension contributes the following settings:
"config": "target",
}
```

* `bake.useRTextServer` : Enable Bake RText service. Requires bake-toolkit version 2.56.0 or greater.

Deprecated (the following settings are now ignored):
* `bake.mainProject`: override the path to the main project (bake's -m flag). Default is `Main`
Expand All @@ -109,7 +136,7 @@ None

## Debugging

If anything behaves unexpected check the bake tab in the output window.
If anything behaves unexpected check the `Bake` and `Bake Language Server` tab in the output window.

## Authors

Expand Down
Loading

0 comments on commit b30c1ec

Please sign in to comment.