Serve selection and folding ranges over LSP
A bounded snapshot-only core (vls/features/TextStructure.hpp) builds nested selection chains (identifier, line, enclosing blocks, document) and foldable regions (brace blocks, comments, preprocessor pairs, include groups) while ignoring literals. The server advertises and serves textDocument/selectionRange with bounded positions and textDocument/foldingRange through EditorDiagnostics; registered vls_feature_tests cases cover both.
This commit is contained in:
1 parent
8ca3dcbf74
commit
624c24d028
12 files changed
+601
-8
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include <vls/semantic/StockCompiler.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <span>
|
||||
|
||||
namespace vls::semantic {
|
||||
|
||||
@@ -42,6 +43,11 @@ class EditorDiagnostics {
|
||||
// Same-binding uses within the document, or an empty list.
|
||||
[[nodiscard]] Void::LanguageServer::Protocol::Json
|
||||
document_highlights(std::string_view uri, Documents::Position position) const;
|
||||
// Nested selection chains (token, line, blocks, document) per position.
|
||||
[[nodiscard]] Void::LanguageServer::Protocol::Json
|
||||
selection_ranges(std::string_view uri, std::span<const Documents::Position>) const;
|
||||
// Foldable brace blocks, comments, regions and include groups.
|
||||
[[nodiscard]] Void::LanguageServer::Protocol::Json folding_ranges(std::string_view uri) const;
|
||||
|
||||
struct NavigationReply {
|
||||
Void::LanguageServer::Protocol::Json result;
|
||||
|
||||
Reference in new issue
Block a user