Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
bb551a06
Commit
bb551a06
authored
Oct 11, 2022
by
Mark Nauwelaerts
Browse files
lspclient: handle server request with string id
BUG: 459960
parent
c257b7ec
Pipeline
#246174
canceled with stage
in 7 minutes and 14 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientserver.cpp
View file @
bb551a06
...
...
@@ -1034,7 +1034,7 @@ class LSPClientServer::LSPClientServerPrivate
QHash
<
int
,
std
::
pair
<
GenericReplyHandler
,
GenericReplyHandler
>>
m_handlers
;
// pending request responses
static
constexpr
int
MAX_REQUESTS
=
5
;
QVector
<
int
>
m_requests
{
MAX_REQUESTS
+
1
};
QVector
<
QJsonValue
>
m_requests
{
MAX_REQUESTS
+
1
};
// currently accumulated stderr output, used to output to the message view on line level
QString
m_currentStderrOutput
;
...
...
@@ -1107,7 +1107,7 @@ private:
}
}
RequestHandle
write
(
const
QJsonObject
&
msg
,
const
GenericReplyHandler
&
h
=
nullptr
,
const
GenericReplyHandler
&
eh
=
nullptr
,
const
int
*
id
=
nullptr
)
RequestHandle
write
(
const
QJsonObject
&
msg
,
const
GenericReplyHandler
&
h
=
nullptr
,
const
GenericReplyHandler
&
eh
=
nullptr
,
const
QJsonValue
*
id
=
nullptr
)
{
RequestHandle
ret
;
ret
.
m_server
=
q
;
...
...
@@ -1633,7 +1633,7 @@ public:
}
}
GenericReplyHandler
prepareResponse
(
int
msgid
)
GenericReplyHandler
prepareResponse
(
QJsonValue
msgid
)
{
// allow limited number of outstanding requests
auto
ctx
=
QPointer
<
LSPClientServer
>
(
q
);
...
...
@@ -1669,7 +1669,8 @@ public:
void
processRequest
(
const
QJsonObject
&
msg
)
{
auto
method
=
msg
[
MEMBER_METHOD
].
toString
();
auto
msgid
=
msg
[
MEMBER_ID
].
toInt
();
// could be number or string, let's retain as-is
auto
msgid
=
msg
[
MEMBER_ID
];
auto
params
=
msg
[
MEMBER_PARAMS
];
bool
handled
=
false
;
if
(
method
==
QLatin1String
(
"workspace/applyEdit"
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment