Declutter the client and client manager by moving find usage and follow
symbol into this helper. This functionality was "temporary" put into the
client manager, but is more an implementation detail that shouldn't be
handled in that central place. Rename symbol will also go into this
helper class.
Task-number: QTCREATORBUG-21578
Change-Id: I56680f6ccbb8d244066561167178af7b341b8822
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Use Client::openDocument if you just want to open a document and
activate it if it is not already used in another client.
Use LanguageClientManager::openDocumentWithClient if you want to make
sure a document is opened _and_ activated for a specific client.
Change-Id: I6b790f15e17335ce2dc8981a04d2cd571b22b66b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Fixes opening projects that lazy load their file lists. For example
CMake projects open without a file list. This list will be generated
after a successful configuration of the project.
When a session is loaded that contains an open document from a project
the document and project open signal is triggered when there is still no
connection between these two. So recheck the project for documents after
the file list got updated.
Also add documents that are already opened before they are assigned to a
project.
Change-Id: I6f2bde0edf88a505116b05efe5564318f2cfb892
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
When a document is opened that uses a language server, it would not gain
the completion assitance from the language server in some cases.
Instead, the default completion assist provider is used, which in case of
the TextEditor, will only provide basic autocompletion.
The reason is that Client::activateDocument is not called if the document
is not in LanguageClientManager::m_clientForDocument when
Client::openDocument is called. The check is at the end of that function.
When the issue happens, openDocument is called indirectly from
LanguageClientManager::documentOpened.
The fix is to change the order of instructions in
LanguageClientManager::documentOpened so m_clientForDocument is updated
before calling openDocumentWithClient.
This way, the language server's completion assist is really used as it
should.
Change-Id: I0d2b3b8573e97c0c0c4bd517775668d41a4a797b
Reviewed-by: David Schulz <david.schulz@qt.io>
Do not clear open documents but disconnect and deactivate them,
so they can be correctly reopened once the server is restarted.
Change-Id: I0f61a5461c020865e61d9808e8c645ea842f64ad
Fixes: QTCREATORBUG-23648
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Return a link to the word under cursor when the target should not
get resolved. This results in a highlight of the text the mouse cursor
is positioned on when pressing ctrl to follow a link.
Change-Id: Iaf1ba289644ed3e3fc062b418dd2fa3bfa8da6ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Instead of sending the link request to all reachable server send it only
to the server that is currently used to handle this document.
Change-Id: I27a8d0e4573f734baa2931a0af771e60665a4532
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
By always removing them from the list of opened documents also for
uninitialized clients. Fixes crash when closing creator before the
initialize response of a language server was handled.
Change-Id: I81fb15d8d9d7bf47300a6eac373ef9db04387bd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Show an editor info bar entry displaying that the language server for
the current python is disabled and a button to quickly enable the pyls.
Change-Id: I3adb2e7cbfb1a32e35413b0b06dfbe66a0b214af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This adds the possibility to configure language servers
from other plugins.
Change-Id: I33c7d637ddd73dcfc0d02c366b8b9749ac1c2b98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
After settings are applied in the manager make sure to assign all
open documents to the newly created clients if the document filter
accepts them.
Change-Id: I30e06e37bc4fde0bc7bab34a2de564a7df043edf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
open a document in all clients supporting the document, but have just
one client that provide functionality like highlights, completions, and
find usages.
Change-Id: I6bd72eb022005ed643fefd1da139d482f4dd5279
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Also show a menu when triggering the language client toolbar button that
allows you to manage and switch between different language clients. The
default language server used to open a specific file type is determined
by the order of the servers inside the settings.
Change-Id: Ib1b21dd2c04d4559f538705e6ba229af043e02ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Some server like rust or haskell require a project at server startup.
Add option that postpones the server start until we can assign a project
to an open file.
Change-Id: Iaa475289e833b27a730a90ea228f5d85ecc30338
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
In preparation to have relationship between clients, settings and
project to one another in the manager.
Change-Id: I00ae15abe03c54b4a58e429d67d6ff939662cce6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The server can request the list of opened projects via the
"workspace/workspaceFolders" request. Add a creator response for
this request.
Change-Id: Ieadf604aeb920da28f085b8441e6f9af1f540fd3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Until now all servers where startet on creator startup. Change this
default to start server when first file that matches the configured
filter is opened. Additionally add an option that restores the old
behavior of always on servers.
Change-Id: I595e0ede1cf136cc803181377155bcd58ca1a83c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... and not just the first one returned by
BaseTextEditor::textEditorForDocument
Change-Id: I39e9271b3a2b6c0f131a5ce77959a8d57e462397
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... not just the first returned by BaseTextEditor::textEditorForDocument
Change-Id: I262cd68e6dea59aa23be718fb85d2ae68c40ef39
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Makes sure that the same document is not twice reported as opened to the
language server.
Change-Id: I348b0f4d8f9162e6ba73a4e3292abce146935eca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If a shutdown is in progress we need an immediately delete
of the client to avoid accessing an already deleted
TextMarkRegistry instance when deleteLater() is triggered
too late.
Change-Id: I274f40532cec0bfc026322a633441a1856cb848c
Reviewed-by: David Schulz <david.schulz@qt.io>
Diagnostics are “owned” by the server so it is the server’s
responsibility to clear them if necessary. So do not delete the
corresponding text mark after a file was closed, because the server does
not have to resend the diagnostics when the file is reopened. Only
delete text marks when they are replaced or when the client is deleted
or reset.
Change-Id: Ief821c7ec401f4c52ee30d99f8dec47dcd6f1c98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Since BaseClient isn't part of an inheritance hirarchie any more the
Base doesn't make sense now.
Change-Id: I69200b19a22e5a04079e5289a02234af4f56a1bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>