Skip to content

Commit b7f6fde

Browse files
committed
Default-initialise structs to prevent malformed doc symbols
1 parent 4388479 commit b7f6fde

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- Fixed document symbols crashing due to internal malformed data
12+
913
## [1.16.3] - 2023-02-09
1014

1115
### Fixed

src/include/Protocol/LanguageFeatures.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ enum struct SymbolTag
110110
struct DocumentSymbol
111111
{
112112
std::string name;
113-
std::optional<std::string> detail;
113+
std::optional<std::string> detail = std::nullopt;
114114
SymbolKind kind = SymbolKind::Array;
115-
std::vector<SymbolTag> tags;
115+
std::vector<SymbolTag> tags{};
116116
bool deprecated = false;
117117
Range range;
118118
Range selectionRange;
119-
std::vector<DocumentSymbol> children;
119+
std::vector<DocumentSymbol> children{};
120120
};
121121
NLOHMANN_DEFINE_OPTIONAL(DocumentSymbol, name, detail, kind, tags, deprecated, range, selectionRange, children);
122122

0 commit comments

Comments
 (0)