Skip to content
GitLab
Menu
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
fca423c5
Commit
fca423c5
authored
Apr 25, 2021
by
Mark Nauwelaerts
Browse files
lspclient: add server support for document/typeDefinition
parent
43d53009
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientprotocol.h
View file @
fca423c5
...
...
@@ -78,6 +78,7 @@ struct LSPServerCapabilities {
bool
definitionProvider
=
false
;
// official extension as of 3.14.0
bool
declarationProvider
=
false
;
bool
typeDefinitionProvider
=
false
;
bool
referencesProvider
=
false
;
bool
implementationProvider
=
false
;
bool
documentSymbolProvider
=
false
;
...
...
addons/lspclient/lspclientserver.cpp
View file @
fca423c5
...
...
@@ -296,6 +296,7 @@ static void from_json(LSPServerCapabilities &caps, const QJsonObject &json)
from_json
(
caps
.
signatureHelpProvider
,
json
.
value
(
QStringLiteral
(
"signatureHelpProvider"
)));
caps
.
definitionProvider
=
json
.
value
(
QStringLiteral
(
"definitionProvider"
)).
toBool
();
caps
.
declarationProvider
=
json
.
value
(
QStringLiteral
(
"declarationProvider"
)).
toBool
();
caps
.
typeDefinitionProvider
=
json
.
value
(
QStringLiteral
(
"typeDefinitionProvider"
)).
toBool
();
caps
.
referencesProvider
=
json
.
value
(
QStringLiteral
(
"referencesProvider"
)).
toBool
();
caps
.
implementationProvider
=
json
.
value
(
QStringLiteral
(
"implementationProvider"
)).
toBool
();
caps
.
documentSymbolProvider
=
json
.
value
(
QStringLiteral
(
"documentSymbolProvider"
)).
toBool
();
...
...
@@ -1152,6 +1153,12 @@ public:
return
send
(
init_request
(
QStringLiteral
(
"textDocument/declaration"
),
params
),
h
);
}
RequestHandle
documentTypeDefinition
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
GenericReplyHandler
&
h
)
{
auto
params
=
textDocumentPositionParams
(
document
,
pos
);
return
send
(
init_request
(
QStringLiteral
(
"textDocument/typeDefinition"
),
params
),
h
);
}
RequestHandle
documentImplementation
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
GenericReplyHandler
&
h
)
{
auto
params
=
textDocumentPositionParams
(
document
,
pos
);
...
...
@@ -1425,6 +1432,12 @@ LSPClientServer::documentDeclaration(const QUrl &document, const LSPPosition &po
return
d
->
documentDeclaration
(
document
,
pos
,
make_handler
(
h
,
context
,
parseDocumentLocation
));
}
LSPClientServer
::
RequestHandle
LSPClientServer
::
documentTypeDefinition
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentDefinitionReplyHandler
&
h
)
{
return
d
->
documentTypeDefinition
(
document
,
pos
,
make_handler
(
h
,
context
,
parseDocumentLocation
));
}
LSPClientServer
::
RequestHandle
LSPClientServer
::
documentHover
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentHoverReplyHandler
&
h
)
{
...
...
addons/lspclient/lspclientserver.h
View file @
fca423c5
...
...
@@ -115,6 +115,7 @@ public:
RequestHandle
documentSymbols
(
const
QUrl
&
document
,
const
QObject
*
context
,
const
DocumentSymbolsReplyHandler
&
h
,
const
ErrorReplyHandler
&
eh
=
nullptr
);
RequestHandle
documentDefinition
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentDefinitionReplyHandler
&
h
);
RequestHandle
documentDeclaration
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentDefinitionReplyHandler
&
h
);
RequestHandle
documentTypeDefinition
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentDefinitionReplyHandler
&
h
);
RequestHandle
documentImplementation
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentDefinitionReplyHandler
&
h
);
RequestHandle
documentHighlight
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentHighlightReplyHandler
&
h
);
RequestHandle
documentHover
(
const
QUrl
&
document
,
const
LSPPosition
&
pos
,
const
QObject
*
context
,
const
DocumentHoverReplyHandler
&
h
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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