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
9d01bae0
Commit
9d01bae0
authored
Jun 14, 2021
by
Mark Nauwelaerts
Browse files
lspclient: use proxied servermanager signals to catch early emitted
parent
77402547
Changes
1
Show whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientpluginview.cpp
View file @
9d01bae0
...
...
@@ -499,6 +499,8 @@ public:
connect
(
m_mainWindow
,
&
KTextEditor
::
MainWindow
::
unhandledShortcutOverride
,
this
,
&
self_type
::
handleEsc
);
connect
(
m_serverManager
.
data
(),
&
LSPClientServerManager
::
serverChanged
,
this
,
&
self_type
::
updateState
);
connect
(
m_serverManager
.
data
(),
&
LSPClientServerManager
::
showMessage
,
this
,
&
self_type
::
onShowMessage
);
connect
(
m_serverManager
.
data
(),
&
LSPClientServerManager
::
serverShowMessage
,
this
,
&
self_type
::
onMessage
);
connect
(
m_serverManager
.
data
(),
&
LSPClientServerManager
::
serverLogMessage
,
this
,
&
self_type
::
onMessage
);
m_findDef
=
actionCollection
()
->
addAction
(
QStringLiteral
(
"lspclient_find_definition"
),
this
,
&
self_type
::
goToDefinition
);
m_findDef
->
setText
(
i18n
(
"Go to Definition"
));
...
...
@@ -2226,10 +2228,9 @@ public:
}
// params type is same for show or log and is treated the same way
void
onMessage
(
const
LSPLogMessageParams
&
params
)
void
onMessage
(
LSPClientServer
*
server
,
const
LSPLogMessageParams
&
params
)
{
// determine server description
auto
server
=
dynamic_cast
<
LSPClientServer
*>
(
sender
());
auto
message
=
params
.
message
;
if
(
server
)
{
message
=
QStringLiteral
(
"%1
\n
%2"
).
arg
(
LSPClientServerManager
::
serverDescription
(
server
),
message
);
...
...
@@ -2337,8 +2338,6 @@ public:
codeActionEnabled
=
caps
.
codeActionProvider
;
connect
(
server
.
data
(),
&
LSPClientServer
::
publishDiagnostics
,
this
,
&
self_type
::
onDiagnostics
,
Qt
::
UniqueConnection
);
connect
(
server
.
data
(),
&
LSPClientServer
::
showMessage
,
this
,
&
self_type
::
onMessage
,
Qt
::
UniqueConnection
);
connect
(
server
.
data
(),
&
LSPClientServer
::
logMessage
,
this
,
&
self_type
::
onMessage
,
Qt
::
UniqueConnection
);
connect
(
server
.
data
(),
&
LSPClientServer
::
applyEdit
,
this
,
&
self_type
::
onApplyEdit
,
Qt
::
UniqueConnection
);
// update format trigger characters
...
...
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