Commit Graph

39 Commits

Author SHA1 Message Date
David Schulz
45cd20c4a0 LanguageClient: remove unused function
Change-Id: I2177d6d4a11bdaf9666a1e529b3231c291aa4123
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-12 08:13:15 +00:00
David Schulz
704de8d676 LanguageClient: set assist provider trigger characters just once
Instead of setting the completion characters every time after a document
was opened only set it when the server capabilities are set.

Change-Id: Ia37dc426a98aca1a4884752ac5da2659bfda53ec
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-12 07:26:51 +00:00
David Schulz
bf6fd00163 LanguageClient: remove unsigned cast for HighlightingResult
Change-Id: Iefcc316a4a471e39f52cd8c7709a9feb967263aa
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 12:01:22 +00:00
David Schulz
f0a3779513 LanguageClient: reset all assist providers
Instead of just unsetting the function assist provider and quick fix
assist provider reset it to the previous provider.

Change-Id: I46c5c2f14234e3da08480dd103e4634859447d57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-11 07:37:17 +00:00
David Schulz
332031d677 LanguageClient: open a document in just one client
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>
2019-09-09 13:29:33 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Eike Ziller
4ce34fd90f Merge remote-tracking branch 'origin/4.10'
Change-Id: I88a6704fb8d723a3cbdfb1a2d9c84741f30d4da6
2019-07-22 09:34:47 +02:00
David Schulz
18e6962fca LanguageClient: reverse error list for initialize errors
like it's done in Client::handleMethod.

Change-Id: I78c8c43f93ebde20b662fa3d1b6032d83ccac0fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-19 07:33:22 +00:00
David Schulz
c65e480cbd LanguageClient: include the range length in document updates
The did change notification parameter has an arguable redundant range
length field, but it seems that there are language server out there
which rely on the presence of this field.

Change-Id: Id29132fb6586a2886b8ba6d9a13df52a64f31161
Fixes: QTCREATORBUG-22694
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-19 06:00:58 +00:00
David Schulz
3fbb5ddba8 LanguageClient: Show outline after server start
If the server was started by opening a document the outline factory and
client was not properly initialized in the time the outline was
requested. Update the outline after the client is fully initialized.

Fixes: QTCREATORBUG-22695
Change-Id: I84dc56eead9774d80ed6baf7792daff930a7cb8e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-18 08:34:18 +00:00
David Schulz
307f1d8e6e LanguageClient: add support for proposed semantic highlight
implements the current proposal for the semantic highlighting
via the language server protocol.
https://github.com/microsoft/vscode-languageserver-node/pull/367

Change-Id: I857d606fcf5c782e0ea8e18e5d098edd26286aed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-06-21 08:37:11 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
David Schulz
b0039f1ec8 LanguageClient: add signature help provider
Change-Id: Ia89c28b574c92802bbfda280115a50f5955f0854
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-21 05:46:37 +00:00
David Schulz
c874f07d53 LanguageClient: add hover handler
Change-Id: Iddf30828ef26a157ab935d0abe708087ab123dd6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-17 09:18:41 +00:00
David Schulz
e04339b1e8 LanguageClient: only replace the default completion provider
Change-Id: I36977132ac8094fd31d7bc255a1666ba807810bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-17 09:18:32 +00:00
David Schulz
10611f2af9 LanguageClient: always set client capabilities
Not just if a project is currently set.

Change-Id: I07b19695464025a9d039364ff1611aa39e8e1a9b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-17 09:01:29 +00:00
David Schulz
763f114c83 LanguageClient: send partial document in update notification
Reduce the amount of transferred data between client and server by
sending events which just contain the changed part of the document
instead of the full content if the server supports those events.

Change-Id: I596930c405bd7a71e4219e328b449fca67664750
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-13 10:14:24 +00:00
David Schulz
d28a452053 LanguageClient: enable commit characters for completion items
While a completion is currently active a commit character can
automatically apply the current item and close the current completion
widget.

Change-Id: Ia962eed69684f8f13f54b88934c63700532103e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-07 07:57:41 +00:00
David Schulz
5b46b17b08 LanguageClient: explicitly disable snippets in completion items
Change-Id: I706f26a2efe090265c36b367e9cd3858dbef9d06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-06 09:01:27 +00:00
David Schulz
69e880c050 LanguageClient: add current document locator filter
Change-Id: I20442a254e4e016088b2da845d87af6e9f836731
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-30 05:19:31 +00:00
David Schulz
0ea840c2bd LanguageClient: add option to start client per project
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>
2019-04-29 09:52:02 +00:00
David Schulz
b79eabd4d2 LanguageClient: add cache for document symbols
Change-Id: Ia4c4061258c74d839edbd472c2087be74ac30113
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-25 10:54:23 +00:00
David Schulz
4832a22b6b LSP: set completion trigger characters to assist provider
Change-Id: I39bd9aca77d824b6533ea8e4c3aa704b9112be45
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-04-24 10:48:17 +00:00
David Schulz
dac8262aeb LanguageClient: show icon with assigned server names in toolbar
Change-Id: I44ceeb184812a4c48f042a19197c7f0ffd4299f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-03 07:09:59 +00:00
David Schulz
73fbaea036 LanguageClient: support dynamic registration for more functions
Change-Id: Iaa49c96195b04ebf72f54698bc070fa0bcaa6311
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-02 08:49:52 +00:00
David Schulz
ffcf226a78 LSP: generate capabilities in a central place
Also remove the creator default capabilities from the default
constructor of the general client capabilities in Utils.

Change-Id: Ifdaaf1bfb5047197e37ba84773552648132df3e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-02 07:57:23 +00:00
David Schulz
35baa3e89d LanguageClient: send project folder on server request
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>
2019-04-02 07:57:16 +00:00
David Schulz
6d0d227974 LSP: Require an id for a response
The id is the essential part of a response.
Make the protocol implementation more stable by requiring this
id in the Response constructor.

Change-Id: I18908c8441be1ddd890058f3dd09fc8cda3b868c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-26 08:13:19 +00:00
David Schulz
a6f0e564d4 LanguageClient: Add option to start server when needed
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>
2019-03-15 11:31:53 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
David Schulz
89335266ba LanguageClient: move match function to language filter
Change-Id: I9081d441fa2f48e5a1c5273e2de2620e0b88c4e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-13 12:24:18 +00:00
David Schulz
6b59d711a8 TextEditor: return all BaseTextEditor for a document
Change-Id: Iab483528357fdba1b7107130c19370974c03979c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-13 05:38:00 +00:00
David Schulz
bbbf727272 LanguageClient: fix restart check for stdio clients
Change-Id: I4acb61b48b7ac18423b2e106f1f9ea9b3f7ccb70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-12 13:07:11 +00:00
David Schulz
b41b5a0714 move text document for file path convenience function
Move it from language client utils to a static function inside
the text document.

Change-Id: I91bc72d0e978c1d843082e12bb8a0fa60a1bbc5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-14 13:19:19 +00:00
David Schulz
c6415e2652 LSP: collect and execute quick fixes via shortcut
Fixes: QTCREATORBUG-21802
Change-Id: I611fac1c3fc5b094816441e36492ed57706c98b8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-12 12:57:31 +00:00
Eike Ziller
66226453a1 Merge remote-tracking branch 'origin/4.9'
Change-Id: I873266bc23680ea02aaff6387790f2a834335113
2019-02-05 09:02:01 +01:00
David Schulz
fa1862c782 LSP: move text marks from the manager to the individual clients
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>
2019-02-04 11:22:59 +00:00
Eike Ziller
7dba3f083c Merge remote-tracking branch 'origin/master' into 4.9
Change-Id: I8497d47cd19c30e2338d9f3143a4fd98267e560a
2019-02-04 11:47:01 +01:00
David Schulz
93ea656821 LSP: rename BaseClient -> Client
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>
2019-02-04 09:43:22 +00:00