mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
LanguageServers/Cpp: Complete Preprocessor definitions
Preprocessor definitions now appear in the AutoComplete suggestions box as well as in the Locator.
This commit is contained in:
parent
5b22f6f45a
commit
7bf6eca9d8
6 changed files with 26 additions and 2 deletions
|
@ -105,10 +105,14 @@ void Preprocessor::handle_preprocessor_line(const StringView& line)
|
|||
if (m_state == State::Normal) {
|
||||
auto key = lexer.consume_until(' ');
|
||||
consume_whitespace();
|
||||
|
||||
DefinedValue value;
|
||||
value.line = m_line_index;
|
||||
|
||||
auto string_value = lexer.consume_all();
|
||||
if (!string_value.is_empty())
|
||||
value.value = string_value;
|
||||
|
||||
m_definitions.set(key, value);
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
|
||||
struct DefinedValue {
|
||||
Optional<StringView> value;
|
||||
size_t line {0};
|
||||
size_t column {0};
|
||||
};
|
||||
using Definitions = HashMap<StringView, DefinedValue>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue