Implement the VLS roadmap on the native VBS build

Native VBS and CMake builds of the server and every registered suite:
protocol and document sync, VBS/compdb providers, stock GCC diagnostics
(including in-process default profile preparation), the stock occurrence
observer and hover/definition, the bounded Scheduler, C++ module graph,
scan and artifact cache with real CMI production, the context-aware
symbol index with schema-2 snapshot migration, navigation and guarded
rename, reflection provenance with splice-origin extraction, index-backed
completion and signature help, live GCC worker control with a registered
DAP suite, and the Neovim and VS Code clients.

VoidLibrary follows main. The private GCC 16.2.0 frontend is reproduced
from the versioned patches and verified stepping reflection/template code
with projected values 17/34 and 41/82.
This commit is contained in:
faumaray committed 2026-12-05 14:06:50 +03:00
1 parent ca04975d54
commit da8003f6d4
310 files changed
+47552 -480

No files matched your search

+45 -8
View File
@@ -1,3 +1,4 @@
#include "TestExecutable.hpp"
#include "TestSupport.hpp"
#include <Void/System/Process.hpp>
@@ -6,14 +7,14 @@
// These are upstream integration requirements, deliberately ordinary failing
// tests until a verified StrictJson revision implements the complete grammar.
Void::Testing::Test decimal_and_exponent_json_values() {
VOID_TEST(JsonCapabilities, decimal_and_exponent_json_values) {
for (const auto number : {"0.0", "-0.5", "1.25", "1e3", "1E+3", "-2.5e-2", "0e0"}) {
const auto parsed = vls::parse_json(std::string{"{\"ignored\":"} + number + "}");
Void::Testing::expect(parsed.has_value());
}
}
Void::Testing::Test decimal_initialization_options_and_unknown_fields() {
VOID_TEST(JsonCapabilities, decimal_initialization_options_and_unknown_fields) {
for (const auto number : {"1.5", "-2.5e-2", "1E+3"}) {
vls::Server server;
const auto reply = test::response(
@@ -28,7 +29,7 @@ Void::Testing::Test decimal_initialization_options_and_unknown_fields() {
}
}
Void::Testing::Test fractional_and_out_of_range_numeric_ids_are_invalid_requests() {
VOID_TEST(JsonCapabilities, fractional_and_out_of_range_numeric_ids_are_invalid_requests) {
for (const auto id : {"1.5", "1e-1", "2147483648.0", "-2147483649.0", "1e50"}) {
vls::Server server;
const auto reply = test::response(server, std::string{"{\"jsonrpc\":\"2.0\",\"id\":"} + id +
@@ -39,7 +40,7 @@ Void::Testing::Test fractional_and_out_of_range_numeric_ids_are_invalid_requests
}
}
Void::Testing::Test integer_valued_number_ids_preserve_value() {
VOID_TEST(JsonCapabilities, integer_valued_number_ids_preserve_value) {
const std::pair<std::string_view, std::int64_t> cases[] = {{"1.0", 1},
{"1e0", 1},
{"-0.0", 0},
@@ -57,7 +58,7 @@ Void::Testing::Test integer_valued_number_ids_preserve_value() {
}
}
Void::Testing::Test numeric_ids_through_executable() {
VOID_TEST(JsonCapabilities, numeric_ids_through_executable) {
using namespace std::chrono_literals;
const auto input =
test::frame(R"({"jsonrpc":"2.0","id":1e0,"method":"initialize","params":{}})") +
@@ -66,7 +67,7 @@ Void::Testing::Test numeric_ids_through_executable() {
test::frame(R"({"jsonrpc":"2.0","id":1.5,"method":"unknown"})") +
test::frame(R"({"jsonrpc":"2.0","id":2.147483647e9,"method":"shutdown"})") +
test::frame(test::exit);
const auto output = Void::Process::run(VLS_EXECUTABLE, {"--stdio"}, input, 2s);
const auto output = Void::Process::run(test::server_executable(), {"--stdio"}, input, 2s);
Void::Testing::require(output.has_value());
Void::Testing::expect_eq(output->exit_code, 0);
Void::Testing::expect(output->err.empty());
@@ -90,13 +91,13 @@ Void::Testing::Test numeric_ids_through_executable() {
std::holds_alternative<std::nullptr_t>(test::field(replies[4], "result").value));
}
Void::Testing::Test decimal_initialization_through_executable() {
VOID_TEST(JsonCapabilities, decimal_initialization_through_executable) {
using namespace std::chrono_literals;
const auto input =
test::frame(
R"({"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{},"initializationOptions":{"scale":1.5,"exponent":-2.5e-2},"unknown":1E+3}})") +
test::frame(test::initialized) + test::frame(test::shutdown) + test::frame(test::exit);
const auto output = Void::Process::run(VLS_EXECUTABLE, {"--stdio"}, input, 2s);
const auto output = Void::Process::run(test::server_executable(), {"--stdio"}, input, 2s);
Void::Testing::require(output.has_value());
Void::Testing::expect_eq(output->exit_code, 0);
Void::Testing::expect(output->err.empty());
@@ -107,3 +108,39 @@ Void::Testing::Test decimal_initialization_through_executable() {
Void::Testing::expect(object->contains("result"));
Void::Testing::expect(!object->contains("error"));
}
VOID_TEST(JsonCapabilities, rounded_fractional_id_cannot_change_lifecycle) {
using namespace std::chrono_literals;
const auto input =
test::frame(test::initialize_request) +
test::frame(R"({"jsonrpc":"2.0","id":1.0000000000000001,"method":"shutdown"})") +
test::frame(R"({"jsonrpc":"2.0","id":1,"method":"shutdown"})") + test::frame(test::exit);
const auto child = Void::Process::run(test::server_executable(), {"--stdio"}, input, 2s);
Void::Testing::require(child.has_value());
Void::Testing::expect_eq(child->exit_code, 0);
Void::Testing::expect(child->err.empty());
const auto replies = test::responses(child->out);
Void::Testing::require_eq(replies.size(), std::size_t{3});
Void::Testing::expect_eq(test::error_code(replies[1]), std::int64_t{-32600});
Void::Testing::expect(
std::holds_alternative<std::nullptr_t>(test::field(replies[1], "id").value));
Void::Testing::expect_eq(std::get<std::int64_t>(test::field(replies[2], "id").value),
std::int64_t{1});
Void::Testing::expect(
std::holds_alternative<std::nullptr_t>(test::field(replies[2], "result").value));
}
VOID_TEST(JsonCapabilities, valid_number_outside_machine_range_is_still_json) {
vls::Server server;
test::expect_error(server, R"({"jsonrpc":"2.0","id":9223372036854775808,"method":"unknown"})",
-32600);
test::expect_error(server, R"({"jsonrpc":"2.0","id":1e,"method":"initialize","params":{}})",
-32700);
const auto initialized = test::response(
server,
R"({"jsonrpc":"2.0","id":7,"method":"initialize","params":{"initializationOptions":{"n":1e-400}}})");
Void::Testing::expect(std::get<vls::Json::Object>(initialized.value).contains("result"));
const auto *id = std::get_if<std::int64_t>(&test::field(initialized, "id").value);
Void::Testing::require(id != nullptr);
Void::Testing::expect_eq(*id, std::int64_t{7});
}