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>
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
#include "document_synchronization.h"
|
|
|
|
void LSPSpec::to_json(json& j, const DidOpenTextDocumentParams& obj) {
|
|
j = json{{"textDocument", obj.m_textDocument}};
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, DidOpenTextDocumentParams& obj) {
|
|
j.at("textDocument").get_to(obj.m_textDocument);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const TextDocumentContentChangeEvent& obj) {
|
|
j = json{{"text", obj.m_text}};
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, TextDocumentContentChangeEvent& obj) {
|
|
j.at("text").get_to(obj.m_text);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const DidChangeTextDocumentParams& obj) {
|
|
j = json{{"textDocument", obj.m_textDocument}, {"contentChanges", obj.m_contentChanges}};
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, DidChangeTextDocumentParams& obj) {
|
|
j.at("textDocument").get_to(obj.m_textDocument);
|
|
j.at("contentChanges").get_to(obj.m_contentChanges);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const DidCloseTextDocumentParams& obj) {
|
|
j = json{{"textDocument", obj.m_textDocument}};
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, DidCloseTextDocumentParams& obj) {
|
|
j.at("textDocument").get_to(obj.m_textDocument);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const WillSaveTextDocumentParams& obj) {
|
|
json_serialize(textDocument);
|
|
json_serialize(reason);
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, WillSaveTextDocumentParams& obj) {
|
|
json_deserialize_if_exists(textDocument);
|
|
json_deserialize_if_exists(reason);
|
|
}
|