Skip to content

Commit 29f3d09

Browse files
committed
修改语言服务,使用3.17版本的诊断消息,添加词典
1 parent 4ab9c5d commit 29f3d09

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CodeFormatServer/src/LanguageClient.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,13 @@ void LanguageClient::SendRequest(std::string_view method, std::shared_ptr<vscode
8787
json["jsonrpc"] = "2.0";
8888
json["method"] = method;
8989
json["id"] = GetRequestId();
90-
json["params"] = param->Serialize();
91-
90+
if (param) {
91+
json["params"] = param->Serialize();
92+
}
93+
else
94+
{
95+
json["params"] = nullptr;
96+
}
9297
if (_session)
9398
{
9499
auto dumpResult = json.dump();
@@ -365,7 +370,7 @@ void LanguageClient::RemoveCodeStyleOptions(std::string_view workspaceUri)
365370

366371
void LanguageClient::RefreshDiagnostic()
367372
{
368-
SendNotification("workspace/diagnostic/refresh", nullptr);
373+
SendRequest("workspace/diagnostic/refresh", nullptr);
369374
}
370375

371376
void LanguageClient::UpdateModuleInfo()

resources/lua_dict.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,6 @@ vscode
196196
github
197197
udp
198198
tcp
199+
ast
200+
ctor
201+
init

0 commit comments

Comments
 (0)