forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HackStudio: Use the C++ semantic syntax highlighter
HackStudio::Editor will now send a request to get semantic token information to the language server whenever there's a short pause in editing. The result is used by the semantic c++ syntax highlighter to provide better highlighting information.
- Loading branch information
1 parent
10d75d7
commit aba2e03
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
* Copyright (c) 2018-2021, Andreas Kling <[email protected]> | ||
* Copyright (c) 2020-2022, Itamar S. <[email protected]> | ||
* Copyright (c) 2018-2021, the SerenityOS developers. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
|
@@ -101,6 +102,9 @@ class Editor final : public GUI::TextEditor { | |
void set_language_client_for(const CodeDocument&); | ||
void set_autocomplete_provider_for(CodeDocument const&); | ||
void handle_function_parameters_hint_request(); | ||
void on_token_info_timer_tick(); | ||
void on_tokens_info_result(Vector<GUI::AutocompleteProvider::TokenInfo> const& tokens_info); | ||
void create_tokens_info_timer(); | ||
|
||
explicit Editor(); | ||
|
||
|
@@ -115,6 +119,7 @@ class Editor final : public GUI::TextEditor { | |
bool m_autocomplete_in_focus { false }; | ||
RefPtr<GUI::Action> m_evaluate_expression_action; | ||
RefPtr<GUI::Action> m_move_execution_to_line_action; | ||
RefPtr<Core::Timer> m_tokens_info_timer; // Used for querying language server for syntax highlighting info | ||
|
||
OwnPtr<LanguageClient> m_language_client; | ||
ErrorOr<void> initialize_documentation_tooltip(); | ||
|