Skip to content

Commit 1044ed5

Browse files
committed
Address vscode-only settings in the settings-doc test
1 parent 98ec0ee commit 1044ed5

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

source/ada/lsp-ada_configurations.adb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,19 @@ package body LSP.Ada_Configurations is
364364

365365
elsif Name = "showNotificationsOnErrors"
366366
then
367-
-- This is a VS Code only setting, treated at the VS Code extension's level
367+
-- This is a VS Code only setting, treated at the VS Code
368+
-- extension's level. We still include it here to mark it as
369+
-- recognized and to support the settings-doc test that checks
370+
-- that each setting is documented.
368371
null;
372+
373+
elsif Name = "trace"
374+
then
375+
-- Same as above. Do not merge this branch with the previous one.
376+
-- The settings-doc test relies on the fact that each setting has
377+
-- a dedicated if-branch.
378+
null;
379+
369380
end if;
370381

371382
Skip_Value (JSON, Index);

testsuite/settings-doc/test.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ python3 get-schema-properties.py <"$1/integration/vscode/ada/schemas/als-setting
1616
grep 'if Name = "[^"]\+"' "$1/source/ada/lsp-ada_configurations.adb" | sed -e 's/.*"\([^"]\+\)"/\1/' >impl.txt
1717
# Remove the following settings from the implementation list because they are
1818
# either hidden, or nested
19-
exclude="onTypeFormatting indentOnly"
19+
exclude="onTypeFormatting indentOnly trace"
2020
for exc in $exclude; do
2121
echo "$(grep -v "$exc" <impl.txt)" >impl.txt
2222
done
2323
# Add the following properties because they are nested
24-
add="onTypeFormatting.indentOnly"
24+
add="onTypeFormatting.indentOnly trace.server"
2525
for a in $add; do
2626
echo "$a" >>impl.txt
2727
done
@@ -31,17 +31,18 @@ echo "$(sort <impl.txt)" >impl.txt
3131
# Check that all VS Code settings are documented
3232
diff -u pkg.txt doc.txt
3333

34-
# The ada.trace.server setting exists only in VS Code and not in .als.json
35-
# files. So remove it before the comparison.
36-
#
37-
# We need to use a subshell because it's not allowed to read and write the same
38-
# file in one pipeline
39-
# echo "$(grep -v trace.server <doc.txt)" >doc.txt
40-
echo "$(grep -v trace.server <doc.txt)" >doc.txt
41-
4234
# Check that all implemented settings are documented
4335
diff -u impl.txt doc.txt
4436

37+
# Before comparing with the schema, we need to filter out VSCode-only settings
38+
# which are not defined in the schema and shouldn't be because we don't want to
39+
# allow such values in .als.json files.
40+
vscode_only="trace.server showNotificationsOnErrors"
41+
for s in $vscode_only; do
42+
echo "$(grep -v "$s" impl.txt)" >impl.txt
43+
echo "$(grep -v "$s" doc.txt)" >doc.txt
44+
done
45+
4546
# Check that all implemented settings are defined in the JSON Schema
4647
diff -u impl.txt schema.txt
4748

0 commit comments

Comments
 (0)