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>
All files that match the language filter are opened in the server
currently, no matter whether they belong to the project or not. We want
to track changes to files outside the project, because the project might
depend on those files.
Change-Id: If78142489ad22899f8bd899ae3a7ce3f58618fa3
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>
Do not remove items of a container while iterating over it
instead revert to old behavior of allocating a temporary.
Broke with cf010911f7.
Change-Id: Ie76974f1e74469f80ee28fb2011d66690dd9e917
Reviewed-by: David Schulz <david.schulz@qt.io>
These options indicate whether a server provides extra messages to track
the status of specific requests.
Change-Id: I3fb78f7fa7144a5a9418b32cb5b33d55b668c484
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The formatting functionality was moved into languageclientformatter.cpp
Change-Id: Ieeafd49c297a854e478a11d4fcb81062b9cfcf19
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The commands provided with the capabilities are not the only allowed
commands, but the ones that can always be executed.
Change-Id: Ie005fafe2e64c334f67809c00623dec2901972c6
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>
Instead of working on a Client member IContent now returns an optional
response handler that consists of an id, a name and a callback.
Change-Id: I5ca7dd4eaa7ae37f333f99c9fe60339db03ebf2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Unconditionally reset the assist provider even to a null pointer
Change-Id: Ie8f87802ab26b4a686704b792adc726a50f98bab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@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>
That function should really be static, it is not meant to be used
elsewhere.
Also, replace duplicate "uri.toFilePath()" with just set filePath
variable.
Change-Id: I11e6cd2133d8999b34ed24b774ab13036f2b9fc8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Currently the ownership of the processor is unknown to the codeassist
when running an async operation. Move the ownership of the processor to
the assist and delete the processor after the proposal was completed.
Change-Id: I6a2e023c47cbc876669dba866bee12b481447cb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
When the language server is initialized, the Initialize request can contain
user provided data in initializationOptions field.
Allow the user to set data inside. This can be required to let the
language server have some context.
Change-Id: Ib057fdb940c21b3fd032853fb84253d42ad1e321
Reviewed-by: David Schulz <david.schulz@qt.io>
When the default assist provider is not DocumentContentCompletionProvider
because of some plugin that also provide an assist provider, this would
fail.
If the user has configured a language server, assume is prefer that and
always propose the server's assist providers when available.
This the case for CMake files but probably C/C++ files too if the CppEditor
plugin is configured to handle them.
Change-Id: I641d73466c8b520beb494dae8e6b274debd2881f
Reviewed-by: David Schulz <david.schulz@qt.io>
The proposal of SemanticHighlighting uses a versioned text document
identifier, but there is a suggestion to be more coherent with other
existing requests and use text document identifier instead (non versionned).
See here: https://github.com/microsoft/vscode-languageserver-node/pull/367/files#r225879268
The clangd language server implements the non versioned version.
Existing code was returning errors with clangd because
SemanticHighlightingParams::isValid would return false because of the
missing version field.
Change-Id: I1c36151342437adad2405118ca6b303db0936e41
Reviewed-by: David Schulz <david.schulz@qt.io>
When the language server reports diagnostics, it also reports to which
part of the code the diagnostic applies.
That part of the code wasn't emphasized before, there is only an icon
next to the line and part of the diagnostic message in the text editor,
but no exact clue of which word is targeted by the diagnostic.
This commit add information about the affected code by diagnostics using
extra selection of type CodeWarningsSelection as other plugins do (like
the clang code model).
If a diagnostic has no severity or is not Error, Warning is used (the word
will be underlined in yellow).
Diagnostics can be either Error, Warning, Information or Hint.
For example, clangd uses Hint for remarks and Information for notes.
Notes can be related to a warning or an error, for example
when a function call has an incorrect number of argument, the call site
will have an error diagnostic with red color and the called function
declaration will have a Hint diagnostic with a yellow color.
Change-Id: Ifa433553be95a4913541d5570a2758ac213e7075
Reviewed-by: David Schulz <david.schulz@qt.io>