chore: the editor reads the selected preset's database, and the config states no history

clangd's database is the one CMake Tools copies from the selected preset,
as in libavr, rather than one chip's tree. .gitattributes drops two Studio
patterns nothing here matches, .clangd is ASCII, and the comments in it,
check.sh and .gitattributes state the reason without the account of how it
was found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BlackMarkandClaude Opus 5.5 committed 2026-10-23 21:55:47 +02:00
1 parent f9bc2cd8e2
commit f50cc749e7
4 files changed
+21 -22

No files matched your search

+3 -3
View File
@@ -1,13 +1,13 @@
# Editor accommodations for the second frontend. No compilation database is # Editor accommodations for the second frontend. No compilation database is
# named here: this driver is made to be vendored, and this file travels with # named here: this driver is made to be vendored, and this file travels with
# it — a consumer's own database then covers these headers, at the consumer's # it - a consumer's own database then covers these headers, at the consumer's
# chip. The checkout that is opened as a folder names its build tree in # chip. The checkout that is opened as a folder names its build tree in
# .vscode/settings.json instead. # .vscode/settings.json instead.
CompileFlags: CompileFlags:
Add: Add:
# clang has no 24-bit integer and GCC's are keywords, not macros, so the # clang has no 24-bit integer and GCC's are keywords, not macros, so the
# editor needs a stand-in for avr::uint24_t. The next width up is the only # editor needs a stand-in for avr::uint24_t. The next width up is the only
# one available — clang rejects _BitInt(24) on this target. # one available - clang rejects _BitInt(24) on this target.
- -D__uint24=unsigned long - -D__uint24=unsigned long
- -D__int24=long - -D__int24=long
# clangd forwards the driver's system includes but not its own header # clangd forwards the driver's system includes but not its own header
@@ -16,7 +16,7 @@ CompileFlags:
- -D__STDC_LIMIT_MACROS - -D__STDC_LIMIT_MACROS
- -D__STDC_CONSTANT_MACROS - -D__STDC_CONSTANT_MACROS
# isr::emit spells a vector number into [[gnu::signal(N)]], which clang # isr::emit spells a vector number into [[gnu::signal(N)]], which clang
# rejects rather than ignores — enough of them in one TU to reach the # rejects rather than ignores - enough of them in one TU to reach the
# default limit of 19 inside the headers and truncate the parse. # default limit of 19 inside the headers and truncate the parse.
- -ferror-limit=0 - -ferror-limit=0
Remove: Remove:
+3 -7
View File
@@ -1,12 +1,8 @@
# Line endings are the repository's, not the editing machine's: this checkout # Line endings are the repository's, not the editing tool's (libavr guidance
# is reached from two hosts, and a file rewritten by a Windows tool comes back # rule 50): a file rewritten by a Windows tool must not come back with every
# with every line changed unless something says otherwise. Naming the source # line changed.
# extensions left Markdown, Python, shell and CMake to whatever the writing
# tool defaulted to, which is CRLF on one of the two.
* text=auto eol=lf * text=auto eol=lf
# Atmel Studio writes these and expects them back. # Atmel Studio writes these and expects them back.
*.vcxproj* eol=crlf
*.cppproj eol=crlf *.cppproj eol=crlf
*.sln eol=crlf
*.atsln eol=crlf *.atsln eol=crlf
+10 -7
View File
@@ -7,25 +7,28 @@
// --query-driver lets clangd ask the cross compiler for its own system // --query-driver lets clangd ask the cross compiler for its own system
// includes and target. The database is named here rather than in .clangd // includes and target. The database is named here rather than in .clangd
// because that file travels with the driver into a consumer's submodule, // because that file travels with the driver into a consumer's submodule,
// where a build tree of this repo's own need not exist. // where a build tree of this repo's own need not exist. It sits one level
// above the trees, and CMake Tools copies the selected preset's into it on
// every configure: the database carries `-mmcu`, so a fixed tree would
// check the driver against one chip.
"clangd.arguments": [ "clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build/atmega328p-generated", "--compile-commands-dir=${workspaceFolder}/build",
"--query-driver=**avr-g++*", "--query-driver=**avr-g++*",
"--header-insertion=never" "--header-insertion=never"
], ],
"cmake.copyCompileCommands": "${workspaceFolder}/build/compile_commands.json",
// The presets are the build interface, and the toolchain file inside the // The presets are the build interface, and the toolchain file inside the
// libavr submodule is the one place the compiler is chosen. **No prefix is // libavr submodule is the one place the compiler is chosen. No prefix is
// named here**: a committed file may not name a path that is true of one // named here: the gitignored local/machine.cmake at this repository's root
// machine (libavr guidance rule 50), so the gitignored local/machine.cmake // is where a checkout says where its toolchain is (libavr guidance rule 50).
// at this repository's root is where a checkout says where its toolchain
// is - one file, and it answers for both hosts.
"cmake.useCMakePresets": "always", "cmake.useCMakePresets": "always",
"cmake.configureOnOpen": true, "cmake.configureOnOpen": true,
"cmake.options.statusBarVisibility": "compact", "cmake.options.statusBarVisibility": "compact",
"files.watcherExclude": { "files.watcherExclude": {
"**/build/**": true, "**/build/**": true,
"**/local/**": true,
"**/libavr/**": true "**/libavr/**": true
}, },
+5 -5
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# The task gate: every configure preset built, and only then every one tested. # The task gate: every configure preset built, and only then every one tested.
# #
# The loop itself is libavr's (tools/check-presets.sh) because the order in it # The loop itself is libavr's (tools/check-presets.sh): the mode-identity
# is subtle and was got wrong by hand more than once - the mode-identity checks # checks read the sibling mode's tree, so a build-then-test-per-preset run
# read the sibling mode's tree, so a build-then-test-per-preset run compares a # would compare a fresh image against a stale sibling. Anything this repository
# fresh image against a stale sibling. Anything this repository needs beyond # needs beyond the presets is written after the call, where every tree is built
# the presets is written after the call, where every tree is built and tested. # and tested.
set -euo pipefail set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.." cd "$(dirname "${BASH_SOURCE[0]}")/.."
"${LIBAVR_ROOT:-libavr}/tools/check-presets.sh" "$@" "${LIBAVR_ROOT:-libavr}/tools/check-presets.sh" "$@"