mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-16 22:15:01 +03:00
ecode: Improve LSP code action implementation, now typescript-language-server will be able to recommend adding imports. Fixed a bug introduced in the previous commit, scrollTo for Y axis now moves correctly. Started implementing LSP Code Lens but I'll keep it for the moment since it's support in LSP implementations is very limited.
This commit is contained in:
@@ -33,6 +33,7 @@ LSPDocumentClient::~LSPDocumentClient() {
|
||||
|
||||
void LSPDocumentClient::onDocumentLoaded( TextDocument* ) {
|
||||
requestSemanticHighlightingDelayed();
|
||||
// requestCodeLens();
|
||||
}
|
||||
|
||||
void LSPDocumentClient::onDocumentTextChanged( const DocumentContentChange& change ) {
|
||||
@@ -104,6 +105,7 @@ int LSPDocumentClient::getVersion() const {
|
||||
void LSPDocumentClient::onServerInitialized() {
|
||||
requestSymbols();
|
||||
requestSemanticHighlighting();
|
||||
// requestCodeLens();
|
||||
}
|
||||
|
||||
void LSPDocumentClient::refreshTag() {
|
||||
@@ -178,6 +180,21 @@ bool LSPDocumentClient::isWaitingSemanticTokensResponse() const {
|
||||
return mWaitingSemanticTokensResponse;
|
||||
}
|
||||
|
||||
void LSPDocumentClient::requestCodeLens() {
|
||||
if ( !mServer || !mServer->getCapabilities().codeLensProvider.supported )
|
||||
return;
|
||||
|
||||
URI uri = mDoc->getURI();
|
||||
LSPClientServer* server = mServer;
|
||||
LSPDocumentClient* docClient = this;
|
||||
mServer->documentCodeLens(
|
||||
uri, [uri, server, docClient]( const auto&, const std::vector<LSPCodeLens>& codeLens ) {
|
||||
if ( server->hasDocument( uri ) ) {
|
||||
docClient->mCodeLens = codeLens;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
UISceneNode* LSPDocumentClient::getUISceneNode() {
|
||||
LSPClientServer* server = mServer;
|
||||
if ( !server || !server->getManager() || !server->getManager()->getPluginManager() ||
|
||||
|
||||
Reference in New Issue
Block a user