Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Made YAML version of vscode workspace to avoid redundancy #55322

Merged
merged 9 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 143 additions & 17 deletions engine.code-workspace
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Don't edit directly, see //tools/vscode_workspace for a script
// that can refresh this from yaml.
{
"folders": [
{
Expand Down Expand Up @@ -126,7 +128,7 @@
"C_Cpp.default.includePath": [
"${default}",
"${workspaceFolder}/..",
"${workspaceFolder}",
"${workspaceFolder}"
],
"dotnet.defaultSolution": "disable",
"dart.showTodos": false,
Expand All @@ -144,6 +146,32 @@
"--enable_playground"
]
}
},
{
"name": "display_list_unittests_arm64",
"pattern": "../out/host_debug_unopt_arm64/display_list_unittests",
"runTask": {
"before": [
"display_list_unittests_arm64"
]
}
},
{
"name": "impeller_golden_tests_arm64",
"pattern": "../out/host_debug_unopt_arm64/impeller_golden_tests",
"runTask": {
"before": [
"impeller_golden_tests_arm64"
]
},
"gtest": {
"prependTestRunningArgs": [
"--working_dir=~/Desktop"
],
"prependTestListingArgs": [
"--working_dir=~/Desktop"
]
}
}
],
"testMate.cpp.debug.configTemplate": {
Expand All @@ -161,7 +189,7 @@
"text": "settings set target.source-map \"flutter/\" \"${workspaceFolder}\"",
"ignoreFailures": false
}
],
]
},
"win32": {
"type": "cppvsdbg"
Expand All @@ -171,7 +199,7 @@
"cwd": "${cwd}",
"env": "${envObj}",
"environment": "${envObjArray}",
"sourceFileMap": "${sourceFileMapObj}",
"sourceFileMap": "${sourceFileMapObj}"
}
},
"tasks": {
Expand All @@ -195,44 +223,137 @@
],
"presentation": {
"echo": true,
"reveal": "always",
"reveal": "silent",
"focus": false,
"panel": "shared",
"clear": true
},
"group": {
"kind": "build",
"kind": "build"
}
},
{
"type": "shell",
"command": "./flutter/bin/et",
"options": {
"cwd": "${workspaceFolder}/.."
},
"problemMatcher": [
"$gcc"
],
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"clear": true
},
"group": {
"kind": "build"
},
"label": "display_list_unittests_arm64",
"args": [
"build",
"-c",
"host_debug_unopt_arm64",
"//flutter/display_list:display_list_unittests"
]
},
{
"type": "shell",
"command": "./flutter/bin/et",
"options": {
"cwd": "${workspaceFolder}/.."
},
"problemMatcher": [
"$gcc"
],
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"clear": true
},
"group": {
"kind": "build"
},
"label": "impeller_golden_tests_arm64",
"args": [
"build",
"-c",
"host_debug_unopt_arm64",
"//flutter/impeller/golden_tests:impeller_golden_tests"
]
}
]
},
"extensions": {
"recommendations": [
// C++ TestMate
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments live in the yaml file now.

"matepek.vscode-catch2-test-adapter",
// Uses github-styled markdown preview, which supports more features than the default markdown preview.
"bierner.github-markdown-preview",
// Flutter and Dart extensions.
"Dart-Code.dart-code",
// Supports C/C++ in the engine.
// See https://github.com/flutter/engine/blob/main/docs/contributing/Setting-up-the-Engine-development-environment.md#vscode-with-cc-intellisense-cc
"llvm-vs-code-extensions.vscode-clangd",
// Auto-formats C/C++ code.
// https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#cc
"xaver.clang-format",
"xaver.clang-format"
]
},
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "impeller_unittests_arm64",
"name": "display_list_unittests_arm64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/../out/host_debug_unopt_arm64/display_list_unittests",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/../out/host_debug_unopt_arm64",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for lldb",
"text": "settings set target.pretty-printing true",
"ignoreFailures": true
},
{
"description": "Source map",
"text": "settings set target.source-map \"flutter/\" \"${workspaceFolder}\"",
"ignoreFailures": false
}
],
"preLaunchTask": "display_list_unittests_arm64"
},
{
"type": "cppdbg",
"request": "launch",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/../out/host_debug_unopt_arm64",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for lldb",
"text": "settings set target.pretty-printing true",
"ignoreFailures": true
},
{
"description": "Source map",
"text": "settings set target.source-map \"flutter/\" \"${workspaceFolder}\"",
"ignoreFailures": false
}
],
"name": "impeller_unittests_arm64",
"program": "${workspaceFolder}/../out/host_debug_unopt_arm64/impeller_unittests",
"args": [
"--enable_playground",
"--enable_playground"
],
"preLaunchTask": "impeller_unittests_arm64"
},
{
"type": "cppdbg",
"request": "launch",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/../out/host_debug_unopt_arm64",
"environment": [],
Expand All @@ -250,9 +371,14 @@
"ignoreFailures": false
}
],
"preLaunchTask": "impeller_unittests_arm64",
"name": "impeller_golden_tests_arm64",
"program": "${workspaceFolder}/../out/host_debug_unopt_arm64/impeller_golden_tests",
"args": [
"--working_dir=~/Desktop"
],
"preLaunchTask": "impeller_golden_tests_arm64"
}
],
"compounds": []
}
}
}
37 changes: 37 additions & 0 deletions tools/vscode_workspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# VSCode Workspace

This is the tools and the template used for updating //engine.code-workspace.

VSCode uses a custom version of JSONC for their config files, those config files
don't provide any mechanism for reducing redundancy. Since the engine has a lot
of test targets, without that mechanism it can get very unwieldy. YAML does
however support ways to reduce redundancy, namely anchors.

## Updating //engine.code-workspace

```sh
./refresh.sh
```

## Backporting //engine.code-workspace

If something is accidentally introduced into //engine.code-workspace without editing
the YAML file here there are tools that can be used to more easily fix that.

```sh
./merge.sh
```

Since JSON doesn't support anchors some work may be needed to resolve any
conflicts that happen when merging. These aren't necessary to use the VSCode
workspace, just to edit them.

## Requirements

The `refresh.sh` and `merge.sh` tools require certain tools to be present on
your PATH. They can be installed on macos with homebrew.

- `json5` - A variant of JSON that is a superset of the JSON variant that VSCode
uses. It's used to strip away comments and trailing commas.
- `yq` - This is a tool for manipulating yaml files. It can convert back and
forth from YAML to YAML and merge YAML files.
Loading