1
#include "simodo/inout/token/Tokenizer.h"
2
#include "simodo/inout/log/Logger.h"
3
#include "DocumentOperationFactory.h"
4
#include "fuze/FuzeDocumentOperation.h"
5
#include "script/ScriptSemanticTokenLegend.h"
9
int main(int argc, char *argv[])
11
std::string semantics_dir;
12
std::string modules_dir;
13
std::string grammar_dir;
14
inout::Logger::SeverityLevel log_level = inout::Logger::SeverityLevel::Info;
15
bool save_mode = false;
16
std::unique_ptr<std::ostream> log_stream;
17
std::unique_ptr<std::istream> in;
20
semantics_dir = argv[1];
23
modules_dir = argv[2];
26
grammar_dir = argv[3];
29
log_stream = std::make_unique<std::ofstream>(argv[4]);
33
if (std::string(argv[5]) == "Debug")
34
log_level = inout::Logger::SeverityLevel::Debug;
35
else if (std::string(argv[5]) == "Info")
36
log_level = inout::Logger::SeverityLevel::Info;
37
else if (std::string(argv[5]) == "Warning")
38
log_level = inout::Logger::SeverityLevel::Warning;
39
else if (std::string(argv[5]) == "Error")
40
log_level = inout::Logger::SeverityLevel::Error;
41
else if (std::string(argv[5]) == "Critical")
42
log_level = inout::Logger::SeverityLevel::Critical;
46
save_mode = std::string(argv[6]) == "save";
50
in = std::make_unique<std::ifstream>(simodo::inout::fromUtf8CharToWChar(argv[7]).c_str());
52
in = std::make_unique<std::ifstream>(argv[7]);
54
inout::Logger log(log_stream ? *log_stream : std::cerr,
58
lsp::ServerCapabilities server_capabilities;
60
server_capabilities.hoverProvider = true;
61
server_capabilities.documentSymbolProvider = true;
62
server_capabilities.declarationProvider = true;
63
server_capabilities.definitionProvider = true;
64
server_capabilities.completionProvider.triggerCharacters = {u"."};
65
server_capabilities.completionProvider.resolveProvider = false;
66
server_capabilities.completionProvider.completionItem.labelDetailsSupport = false;
67
server_capabilities.semanticTokensProvider.legend = SCRIPT_SEMANTIC_TOKENS_LEGEND;
69
lsp::SimodoCapabilities simodo_capabilities;
71
simodo_capabilities.runnerProvider = true;
72
simodo_capabilities.runnerOptions = {
73
{u"fuze", SLR_method_report},
74
{u"fuze", LR1_method_report},
75
{u"simodo-script", execution_report},
76
// {u"teragraph", execution_report},
79
DocumentOperationFactory factory(semantics_dir, modules_dir, grammar_dir);
81
lsp::ServerContext server(u"SIMODO",