mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 15:02:01 -04:00
53277a65ad
- Integrate the AST into the LSP, this makes parsing and tokenizing the files much easier - Consolidate most of the symbol info tracking in `goalc` to a single map. Fixed some issues where the old map would never evict symbols when re-compiling files. There is still some more to cleanup, but this now can be used as an incrementally updated source-of-truth for the LSP - re-compile files when they are saved. Ideally this would be done everytime they are changed but that: - may be too aggressive - goalc doesn't compile incrementally yet so it likely would be a worse UX Features added, see https://github.com/open-goal/opengoal-vscode/issues/256 - Hover   - LSP Status fixed - Type Hierarchy  - Document Color  - Document Symbols  - Completions  --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "common_types.h"
|
|
|
|
namespace LSPSpec {
|
|
struct DidOpenTextDocumentParams {
|
|
TextDocumentItem m_textDocument;
|
|
};
|
|
|
|
void to_json(json& j, const DidOpenTextDocumentParams& obj);
|
|
void from_json(const json& j, DidOpenTextDocumentParams& obj);
|
|
|
|
struct TextDocumentContentChangeEvent {
|
|
std::string m_text;
|
|
};
|
|
|
|
void to_json(json& j, const TextDocumentContentChangeEvent& obj);
|
|
void from_json(const json& j, TextDocumentContentChangeEvent& obj);
|
|
|
|
struct DidChangeTextDocumentParams {
|
|
VersionedTextDocumentIdentifier m_textDocument;
|
|
std::vector<TextDocumentContentChangeEvent> m_contentChanges;
|
|
};
|
|
|
|
void to_json(json& j, const DidChangeTextDocumentParams& obj);
|
|
void from_json(const json& j, DidChangeTextDocumentParams& obj);
|
|
|
|
struct DidCloseTextDocumentParams {
|
|
TextDocumentIdentifier m_textDocument;
|
|
};
|
|
|
|
void to_json(json& j, const DidCloseTextDocumentParams& obj);
|
|
void from_json(const json& j, DidCloseTextDocumentParams& obj);
|
|
|
|
enum class TextDocumentSaveReason {
|
|
// Manually triggered, e.g. by the user pressing save, by starting debugging, or by an API call.
|
|
Manual = 1,
|
|
// Automatic after a delay.
|
|
AfterDelay = 2,
|
|
// When the editor lost focus.
|
|
FocusOut = 3,
|
|
};
|
|
|
|
// The parameters send in a will save text document notification.
|
|
struct WillSaveTextDocumentParams {
|
|
// The document that will be saved.
|
|
TextDocumentIdentifier textDocument;
|
|
// The 'TextDocumentSaveReason'.
|
|
TextDocumentSaveReason reason;
|
|
};
|
|
|
|
void to_json(json& j, const WillSaveTextDocumentParams& obj);
|
|
void from_json(const json& j, WillSaveTextDocumentParams& obj);
|
|
|
|
} // namespace LSPSpec
|