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

@@ -0,0 +1,66 @@
#pragma once
#include <Void/LanguageServer/Protocol/Json.hpp>
#include <cstdint>
#include <expected>
#include <filesystem>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
namespace vls::gcc {
class ReplayRecording;
}
namespace vls::debug {
namespace Protocol = Void::LanguageServer::Protocol;
using Json = Protocol::Json;
// DAP and the versioned inspection requests share the same cursor and generation.
class ReplaySession {
public:
static std::expected<ReplaySession, std::string> open(const std::filesystem::path &path);
ReplaySession(const ReplaySession &) = delete;
ReplaySession &operator=(const ReplaySession &) = delete;
ReplaySession(ReplaySession &&) noexcept = default;
ReplaySession &operator=(ReplaySession &&) = delete;
[[nodiscard]] Json::Object identity() const;
[[nodiscard]] Json::Object describe() const;
[[nodiscard]] bool matches(const Json::Object &arguments) const;
[[nodiscard]] std::expected<Json::Object, std::string> timeline(std::size_t start,
std::size_t count) const;
[[nodiscard]] std::expected<Json::Object, std::string> frames(std::size_t start,
std::size_t count) const;
// A false result represents the boundary in the requested direction. It preserves the cursor.
[[nodiscard]] std::expected<bool, std::string> initial_position();
[[nodiscard]] std::expected<bool, std::string> move_to_value(bool forward);
[[nodiscard]] std::expected<void, std::string> seek(std::uint32_t sequence);
void finish();
[[nodiscard]] bool paused() const { return sequence_.has_value(); }
[[nodiscard]] std::string_view pause_kind() const { return pause_kind_; }
[[nodiscard]] bool source_available() const { return source_available_; }
[[nodiscard]] std::string_view source_bytes() const;
[[nodiscard]] std::size_t frame_count() const;
[[nodiscard]] const Json &frame(std::size_t top_first_index) const;
[[nodiscard]] std::int64_t frame_handle(std::size_t index) const;
[[nodiscard]] std::int64_t scope_handle(std::size_t index) const;
[[nodiscard]] std::optional<std::size_t> handle_index(std::int64_t handle, bool scope) const;
private:
ReplaySession(std::shared_ptr<const gcc::ReplayRecording> recording, std::string id);
std::shared_ptr<const gcc::ReplayRecording> recording_;
std::string id_;
bool source_available_;
bool finished_{};
std::int64_t generation_{};
std::int64_t next_handle_{1};
std::int64_t frame_base_{1};
std::optional<std::uint32_t> sequence_;
std::string_view pause_kind_{"none"};
Json cursor_{nullptr};
};
} // namespace vls::debug
+66
View File
@@ -0,0 +1,66 @@
#pragma once
#include <Void/LanguageServer/Protocol/Json.hpp>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <expected>
#include <filesystem>
#include <memory>
#include <optional>
#include <string>
namespace vls::debug::live {
enum class State { idle, running, stopped, completed, failed, cancelled };
struct Stop {
std::uint64_t generation{};
std::uint32_t sequence{};
};
struct Options {
std::filesystem::path worker; // vls_gcc_probe
std::filesystem::path compiler;
std::string compiler_sha256;
std::filesystem::path source;
std::filesystem::path trace;
bool stepping{true};
std::chrono::milliseconds deadline{60000};
std::size_t max_notice_bytes{64 * 1024};
};
// One live private-compiler session speaking the supervisor notice protocol.
// Control actions are serialized; an inspection snapshot belongs to the stop
// generation that requested it and is not reused after the session moves.
class LiveSession {
public:
explicit LiveSession(Options);
~LiveSession();
LiveSession(const LiveSession &) = delete;
LiveSession &operator=(const LiveSession &) = delete;
LiveSession(LiveSession &&) = delete;
LiveSession &operator=(LiveSession &&) = delete;
// Spawns the worker and waits for the first stop.
[[nodiscard]] std::expected<Stop, std::string> start();
// At a stop: single-step. Returns the next stop or nullopt when finished.
[[nodiscard]] std::expected<std::optional<Stop>, std::string> step();
[[nodiscard]] std::expected<std::optional<Stop>, std::string> continue_run();
// Requests cancellation and reaps the worker.
[[nodiscard]] std::expected<void, std::string> cancel();
// Read-only bounded snapshot at the current stop.
[[nodiscard]] std::expected<Void::LanguageServer::Protocol::Json, std::string> inspect();
[[nodiscard]] State state() const;
[[nodiscard]] std::optional<Stop> stop() const;
[[nodiscard]] std::string outcome() const;
[[nodiscard]] std::string reason() const;
private:
struct State_;
std::unique_ptr<State_> state_;
};
} // namespace vls::debug::live