Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Open a Terminal, and - for example - type `bazel build ...` to execute the defau
After you have build the code, create [compilation databases](https://clang.llvm.org/docs/JSONCompilationDatabase.html) via Visual Studio Code [Task](https://code.visualstudio.com/docs/debugtest/tasks):

- C++: <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> -> `Tasks: Run Task` -> `Update compile_commands.json`
- Rust: <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> -> `Tasks: Run Task` -> `Generate rust-project.json`
- Rust: <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>p</kbd> -> `Tasks: Run Task` -> `Update rust-project.json`

These databases are used by Visual Studio Code to support code navigation and auto-completion with the help of [language servers](https://microsoft.github.io/language-server-protocol/).

Expand Down
36 changes: 22 additions & 14 deletions src/s-core-devcontainer/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
// from the GitHub release page of buildtools
// It is generated by running 'sha256sum buildifier-linux-amd64'
"BUILDIFIER_SHA256": "6ceb7b0ab7cf66fceccc56a027d21d9cc557a7f34af37d2101edb56b92fcfa1a",
"STARPLS_VERSION": "0.1.21",
// The following sha256sum is for the binary starpls-linux-amd64
// from the GitHub release page of starpls
// It is generated by running 'sha256sum starpls-linux-amd64'
"STARPLS_SHA256": "45692ecb9d94a19a15b1e7b240acdff5702f78cd22188dac41e1879cb8bdcdcf",
"BAZEL_COMPILE_COMMANDS_VERSION": "0.17.2",
// The following sha256sums are for the deb package bazel-compile-commands_<version>-<codename>_amd64.deb
// where <codename> is the Ubuntu codename (e.g., jammy, focal, noble)
Expand All @@ -56,14 +61,18 @@
"customizations": {
"vscode": {
"extensions": [
"usernamehw.errorlens",
"lextudio.restructuredtext",
"ms-python.python",
"charliermarsh.ruff",
"mads-hartmann.bash-ide-vscode",
"bazelbuild.vscode-bazel",
"bazelbuild.vscode-bazel", // Bazel support for Visual Studio Code; see also bazel.lsp.command below
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"ms-vscode.live-server", // for live preview of HTML files
"ms-vscode.live-server", // live preview of HTML files
"llvm-vs-code-extensions.vscode-clangd",
"jebbs.plantuml", //to preview PlantUML diagrams
"hediet.vscode-drawio", //for drawio integration
"jebbs.plantuml", // preview PlantUML diagrams
"hediet.vscode-drawio", // Draw.IO integration
"swyddfa.esbonio", // for Sphinx documentation support
"rust-lang.rust-analyzer" // Rust language support for Visual Studio Code; see also tasks below
],
Expand All @@ -79,6 +88,13 @@
"--pretty",
"--background-index"
],
"bazel.lsp.command": "/usr/local/bin/starpls", // use the Starlark Language Server for Bazel projects
"bazel.lsp.args": [
"server", // see https://github.com/withered-magic/starpls/issues/400#issuecomment-3095469671 - this is "what developers expect"
"--experimental_infer_ctx_attributes",
"--experimental_use_code_flow_analysis",
"--experimental_enable_label_completions"
],
"C_Cpp.intelliSenseEngine": "disabled",
"tasks": {
"version": "2.0.0",
Expand All @@ -103,7 +119,7 @@
}
},
{ // see https://bazelbuild.github.io/rules_rust/rust_analyzer.html#vscode
"label": "Generate rust-project.json",
"label": "Update rust-project.json",
"command": "bazel",
"args": [
"run",
Expand All @@ -112,15 +128,7 @@
"options": {
"cwd": "${workspaceFolder}"
},
"group": "build",
"problemMatcher": [],
"presentation": {
"reveal": "never",
"panel": "dedicated"
},
"runOptions": {
"runOn": "folderOpen"
}
"group": "build"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ curl -L "https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIE
echo "${BUILDIFIER_SHA256} /usr/local/bin/buildifier" | sha256sum -c - || exit -1
chmod +x /usr/local/bin/buildifier

# Starlark Language Server, directly from GitHub (apparently no APT repository available)
curl -L "https://github.com/withered-magic/starpls/releases/download/v${STARPLS_VERSION}/starpls-linux-amd64" -o /usr/local/bin/starpls
echo "${STARPLS_SHA256} /usr/local/bin/starpls" | sha256sum -c - || exit -1
chmod +x /usr/local/bin/starpls

# Code completion for C++ code of Bazel projects
# (see https://github.com/kiron1/bazel-compile-commands)
# The version is pinned to a specific release, and the SHA256 checksum is provided by the devcontainer-features.json file.
Expand Down