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>
67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
#include "progress_report.h"
|
|
|
|
void LSPSpec::to_json(json& j, const WorkDoneProgressCreateParams& obj) {
|
|
json_serialize(token);
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, WorkDoneProgressCreateParams& obj) {
|
|
json_deserialize_if_exists(token);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const WorkDoneProgressBegin& obj) {
|
|
json_serialize(kind);
|
|
json_serialize(title);
|
|
json_serialize(cancellable);
|
|
json_serialize_optional(message);
|
|
json_serialize_optional(percentage);
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, WorkDoneProgressBegin& obj) {
|
|
json_deserialize_if_exists(kind);
|
|
json_deserialize_if_exists(title);
|
|
json_deserialize_if_exists(cancellable);
|
|
json_deserialize_optional_if_exists(message);
|
|
json_deserialize_optional_if_exists(percentage);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const WorkDoneProgressReport& obj) {
|
|
json_serialize(kind);
|
|
json_serialize(cancellable);
|
|
json_serialize_optional(message);
|
|
json_serialize_optional(percentage);
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, WorkDoneProgressReport& obj) {
|
|
json_deserialize_if_exists(kind);
|
|
json_deserialize_if_exists(cancellable);
|
|
json_deserialize_optional_if_exists(message);
|
|
json_deserialize_optional_if_exists(percentage);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const WorkDoneProgressEnd& obj) {
|
|
json_serialize(kind);
|
|
json_serialize_optional(message);
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, WorkDoneProgressEnd& obj) {
|
|
json_deserialize_if_exists(kind);
|
|
json_deserialize_optional_if_exists(message);
|
|
}
|
|
|
|
void LSPSpec::to_json(json& j, const ProgressNotificationPayload& obj) {
|
|
json_serialize(token);
|
|
if (obj.beginValue) {
|
|
j["value"] = obj.beginValue.value();
|
|
} else if (obj.reportValue) {
|
|
j["value"] = obj.reportValue.value();
|
|
} else {
|
|
j["value"] = obj.endValue.value();
|
|
}
|
|
}
|
|
|
|
void LSPSpec::from_json(const json& j, ProgressNotificationPayload& obj) {
|
|
json_deserialize_if_exists(token);
|
|
// TODO - not needed, but if so -- deserialize 'value', it's possible to figure out which is the
|
|
// right one
|
|
}
|