mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
LSP: initial LSP implementation for IR files to assist with decompilation (#1647)
* lsp: json-rpc example is working, a decent place to start... * lsp: vendor library * lsp: cleanup and time to get started * lsp: commit what i got so far * lsp: example `initialize` payload * lsp: switch to `stdio` * stash * modularize the lsp implementation * lsp: implement first actual LSP feature - function names in outline * lsp: produce document diagnostics * lsp: remove unused third-party lib * lsp: support hovering MIPS instructions in IR files * lsp: basic go-to all-types definition * stash * lsp: cleanup code, just need to add it to the release artifacts * fix some project configuration * fix linux build * lsp: add lsp to PR artifacts and release assets * lsp: address feedback
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include "hover.h"
|
||||
|
||||
void LSPSpec::to_json(json& j, const MarkupContent& obj) {
|
||||
j = json{{"kind", obj.m_kind}, {"value", obj.m_value}};
|
||||
}
|
||||
|
||||
void LSPSpec::from_json(const json& j, MarkupContent& obj) {
|
||||
j.at("kind").get_to(obj.m_kind);
|
||||
j.at("value").get_to(obj.m_value);
|
||||
}
|
||||
|
||||
void LSPSpec::to_json(json& j, const Hover& obj) {
|
||||
j = json{{"contents", obj.m_contents}};
|
||||
if (obj.m_range) {
|
||||
j["range"] = obj.m_range.value();
|
||||
}
|
||||
}
|
||||
|
||||
void LSPSpec::from_json(const json& j, Hover& obj) {
|
||||
j.at("contents").get_to(obj.m_contents);
|
||||
if (j.contains("range")) {
|
||||
obj.m_range = std::make_optional(j.at("range").get<Range>());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user