mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
HackStudio: Support searching symbol declarations in the Locator
The Locator now keeps a cache of the declared symbol in a document. The language client updates that cache whenever it gets an update from the language server about declared symbols. This allows searching for symbol declarations in the Locator, in addition to file names. Closes #5478
This commit is contained in:
parent
a94b5376bc
commit
54bc9114b3
16 changed files with 140 additions and 30 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "CodeDocument.h"
|
||||
#include "Debugger/BreakpointCallback.h"
|
||||
#include "LanguageClient.h"
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
|
@ -66,6 +67,13 @@ public:
|
|||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
|
||||
LanguageClient& language_client()
|
||||
{
|
||||
VERIFY(m_language_client);
|
||||
return *m_language_client;
|
||||
}
|
||||
virtual void set_cursor(const GUI::TextPosition& a_position) override;
|
||||
|
||||
private:
|
||||
virtual void focusin_event(GUI::FocusEvent&) override;
|
||||
virtual void focusout_event(GUI::FocusEvent&) override;
|
||||
|
@ -79,7 +87,6 @@ private:
|
|||
void navigate_to_include_if_available(String);
|
||||
void on_navigatable_link_click(const GUI::TextDocumentSpan&);
|
||||
void on_identifier_click(const GUI::TextDocumentSpan&);
|
||||
void open_and_set_cursor(const String& file, size_t line, size_t column);
|
||||
|
||||
Gfx::IntRect breakpoint_icon_rect(size_t line_number) const;
|
||||
static const Gfx::Bitmap& breakpoint_icon_bitmap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue