mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LanguageServers/Cpp: Support jumping to declaration of preprocessor
.. definitions.
This commit is contained in:
parent
7bf6eca9d8
commit
8688259ed9
8 changed files with 43 additions and 10 deletions
|
@ -54,6 +54,7 @@ Parser::Parser(const StringView& program, const String& filename, Preprocessor::
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Parser::initialize_program_tokens(const StringView& program)
|
||||
{
|
||||
Lexer lexer(program);
|
||||
|
@ -63,6 +64,7 @@ void Parser::initialize_program_tokens(const StringView& program)
|
|||
if (token.type() == Token::Type::Identifier) {
|
||||
if (auto defined_value = m_definitions.find(text_of_token(token)); defined_value != m_definitions.end()) {
|
||||
add_tokens_for_preprocessor(token, defined_value->value);
|
||||
m_replaced_preprocessor_tokens.append({ token, defined_value->value });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue