If a restart for a client has been staged for restart the
shutdown of QC may coincide with the start of the client which
leads to a crash on exit. Correctly track clients that never
successfully started to clean them up on manager destruction.
Change-Id: I639a76318d1665653fbcd37841fcaf407f3d3a83
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
If the server settings specify that a server is to be started "per
project".
This fixes e.g. running the haskell-language-server
Fixes: QTCREATORBUG-26115
Change-Id: If10af71d60786826a9218b4b98818df8d9710adf
Reviewed-by: David Schulz <david.schulz@qt.io>
The client will be either freshly created or if it was restarted
disconnected in LanguageClientManager::clientFinished
Change-Id: I647d0aaa918419c328013b2dc978d345f7e09c32
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Allows to reassign the documents to another server before the old server
is completely shutdown.
Change-Id: I20538c317a7664523f55073736eb22d96def8df8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.
Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
If a server is setup to start per project we want to open files of a
project in the matching server by default.
Change-Id: Ie266fd858420acd75b7a1fd45be7bee2b06460aa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The capabilities are not changeable for the user, but only there to
check whether a server is capable of a specific task. This will also
allow us to have more specialized settings widgets for specific servers
like for the java language server without the need to add the
capabilities to each of those special widgets.
Also add the dynamic capabilities to the widget so users have a complete
overview of the capabilities.
Change-Id: I9f2ed6ed11b458f0d4c67be3df632fd810023286
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Starting a client does not need to be done via
LanguageClientManager::startClient anymore but can be done via
Client::start()
Change-Id: I571e96b6ad7d64786a345edf5dbb38208b9a1d12
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... to be able to add more features to this dialog.
Change-Id: If8692bee484e25c1ba5e4ea629a77d14ff5d92ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It does not make sense to check the not applied settings of the
settings page when a document gets opened.
Change-Id: I6fda0cf6c524e79e17cc25b54c41527971179f8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Do not open the server for every open document that belongs to that
server and assign the documents to the correct servers.
Change-Id: I88a743489e7e4b396a112ad772926e90b22626f3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The temporary containers are needed in some places because the content of the containers change
while iterating over them.
partially reverts: cf010911f7
Change-Id: I4d6df987b9e5382b6b18fa659b1174ca6919a02e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
General messages pane should only be opened on direct user interaction.
Task-number: QTCREATORBUG-24430
Change-Id: I526659110fc67c627cb60fe56e1f709f064667c2
Reviewed-by: David Schulz <david.schulz@qt.io>
Amends cdeac76df3.
During the execution of updateProject() triggered by a fileListChanged()
emission new connections to the fileListChanged() were added, effectively
making the emit never return and gobbling up all available memory.
Change-Id: I18a1ab9b32c2e797e990449385a5353782211560
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>