mirror of
https://github.com/open-goal/jak-project
synced 2026-05-28 00:16:20 -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
2.2 KiB
C++
56 lines
2.2 KiB
C++
#include "initialize.h"
|
|
|
|
namespace lsp_handlers {
|
|
std::optional<json> initialize(Workspace& workspace, int id, json params) {
|
|
json text_document_sync{
|
|
{"openClose", true},
|
|
{"change", 1}, // Full sync
|
|
{"willSave", true},
|
|
{"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},
|
|
{"colorProvider", 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", true},
|
|
{"documentRangeFormattingProvider", false},
|
|
{"documentOnTypeFormattingProvider", document_on_type_formatting_provider},
|
|
{"renameProvider", false},
|
|
{"documentLinkProvider", document_link_provider},
|
|
{"executeCommandProvider", execute_command_provider},
|
|
{"typeHierarchyProvider", true},
|
|
{"experimental", {}},
|
|
}}};
|
|
return result;
|
|
}
|
|
} // namespace lsp_handlers
|