From aba2e03b711363f6ab85be1041d7e5f77dc4804f Mon Sep 17 00:00:00 2001 From: Itamar Date: Mon, 7 Feb 2022 08:08:34 +0200 Subject: 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. --- Userland/DevTools/HackStudio/Editor.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Userland/DevTools/HackStudio/Editor.h') diff --git a/Userland/DevTools/HackStudio/Editor.h b/Userland/DevTools/HackStudio/Editor.h index b0b2d1b65c..1076b15615 100644 --- a/Userland/DevTools/HackStudio/Editor.h +++ b/Userland/DevTools/HackStudio/Editor.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling + * Copyright (c) 2020-2022, Itamar S. * Copyright (c) 2018-2021, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause @@ -101,6 +102,9 @@ private: 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 const& tokens_info); + void create_tokens_info_timer(); explicit Editor(); @@ -115,6 +119,7 @@ private: bool m_autocomplete_in_focus { false }; RefPtr m_evaluate_expression_action; RefPtr m_move_execution_to_line_action; + RefPtr m_tokens_info_timer; // Used for querying language server for syntax highlighting info OwnPtr m_language_client; ErrorOr initialize_documentation_tooltip(); -- cgit v1.2.3