Commit Graph

33 Commits

Author SHA1 Message Date
David Schulz
7e10d6d7b5 LanguageClient: remove unused function
Change-Id: If931e1e6d2e28eddb599faefda2590324ff0801b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-16 05:29:34 +00:00
David Schulz
b0d4414dfc LanguageClient: pass id as a const ref when handling client messages
Change-Id: I7ab6a7517d4dd0fe66f601661e7b3f6a7afb338b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-19 15:56:31 +00:00
David Schulz
116fb0895d LSP: move diagnostic handling from client in a separate class
Change-Id: Id70a7b82137d3a4591de521380199e546e8685f4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-15 10:45:49 +00:00
David Schulz
dba4bff703 TextEditor: use Utils::FilePath as file member in AssistInterface
Change-Id: I3bf9b013b9350411f918efdb9d1a36a2c22bf972
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-04 10:14:21 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
David Schulz
e323529b3c LSP: Compress document change notifications
Change-Id: Iaf6cb99784f4e1ed1291ace1f4cc18cf6af88672
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-22 04:23:06 +00:00
David Schulz
4121eccf1e LSP: add symbol support class
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>
2020-05-19 10:10:12 +00:00
David Schulz
cdeac76df3 LSP: react on file list changed signal from project
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>
2020-05-13 10:58:25 +00:00
David Schulz
8bde432dfe CodeAssist: Fix leaking asynchronous processors
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>
2020-05-12 08:24:41 +00:00
Alexis Murzeau
3268e5f0bc LSP: Add setting to provide initializationOptions to the language server
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>
2020-05-11 22:33:45 +00:00
David Schulz
55a10b0e7a LanguageClient: add lsp based auto formatter
Change-Id: I2a7347961b4633868aa3b033c351a1e709c3597e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-22 08:42:32 +00:00
David Schulz
bfc65cee98 LanguageClient: create TextMarks only for active clients
Fixes that marks from all running clients are shown after splitting the
editor.

Change-Id: Ia76a084e5b133d5f7205ac79f9584b211d73b501
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-17 08:04:47 +00:00
David Schulz
f7453adda2 LanguageClient: export manager, client and settings
Change-Id: I8827fb1c36a41ab76b9509cdbf008e9f2309fd6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-19 08:54:06 +00:00
David Schulz
59c4d92186 LanguageClient: Fix typo
Change-Id: If565199b92b45c2c2fe7069180613e61d25e7738
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-19 08:53:55 +00:00
David Schulz
468f604900 LanguageClient: have one active client per open document
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>
2019-09-19 08:53:47 +00:00
David Schulz
567a20843f LanguageClient: remember opened documents by TextEditor::TextDocument
... instead of Utils::FilePath

Change-Id: I4ca38ca127fbb1a503a0cb9b5228cab325519550
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-16 07:31:49 +00:00
David Schulz
d3c94edd93 LanguageClient: only send contents of TextDocuments to the server
Change-Id: Ifdcd6ba161336814744c51f15e35a756960cb199
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-12 10:53:57 +00:00
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
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
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
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
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
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
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
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
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
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