mirror of
https://github.com/open-goal/jak-project
synced 2026-05-24 23:22:14 -04:00
01c70368e3
* 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
60 lines
2.2 KiB
C++
60 lines
2.2 KiB
C++
// TODO - convert this a proper class
|
|
|
|
#include "third-party/json.hpp"
|
|
|
|
using json = nlohmann::json;
|
|
|
|
class InitializeResult {
|
|
public:
|
|
InitializeResult(){};
|
|
json to_json() { return result; }
|
|
|
|
private:
|
|
json text_document_sync{
|
|
{"openClose", true},
|
|
{"change", 1}, // Full sync
|
|
{"willSave", false},
|
|
{"willSaveWaitUntil", false},
|
|
{"save", {{"includeText", false}}},
|
|
};
|
|
|
|
json completion_provider{
|
|
{"resolveProvider", false},
|
|
{"triggerCharacters", {}},
|
|
};
|
|
json signature_help_provider{{"triggerCharacters", ""}};
|
|
json code_lens_provider{{"resolveProvider", false}};
|
|
json document_on_type_formatting_provider{
|
|
{"firstTriggerCharacter", ""},
|
|
{"moreTriggerCharacter", ""},
|
|
};
|
|
json document_link_provider{{"resolveProvider", false}};
|
|
json execute_command_provider{{"commands", {}}};
|
|
|
|
json document_symbol_provder{{"label", "OpenGOAL"}};
|
|
|
|
json result{{"capabilities",
|
|
{
|
|
{"textDocumentSync", text_document_sync},
|
|
{"hoverProvider", true},
|
|
{"completionProvider", completion_provider},
|
|
{"signatureHelpProvider", signature_help_provider},
|
|
{"definitionProvider", true},
|
|
{"referencesProvider", false},
|
|
{"documentHighlightProvider", false},
|
|
{"documentSymbolProvider",
|
|
document_symbol_provder}, // TODO - there is another selectionRangeProvider i
|
|
// think i need, or word boundaries need to change!
|
|
{"workspaceSymbolProvider", false},
|
|
{"codeActionProvider", false},
|
|
{"codeLensProvider", code_lens_provider},
|
|
{"documentFormattingProvider", false},
|
|
{"documentRangeFormattingProvider", false},
|
|
{"documentOnTypeFormattingProvider", document_on_type_formatting_provider},
|
|
{"renameProvider", false},
|
|
{"documentLinkProvider", document_link_provider},
|
|
{"executeCommandProvider", execute_command_provider},
|
|
{"experimental", {}},
|
|
}}};
|
|
};
|