Commit Graph

26 Commits

Author SHA1 Message Date
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marco Bubke
84c1d6572b Utils: Remove variant.h
Since we are now requiring macOS 10.14 we can remove our local copy of
std::variant and use for macOS std::variant too.

Change-Id: I589d03b35fc56878b7392ffa7047a439e588fe43
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-23 09:51:43 +00:00
David Schulz
9dc1fb3381 LanguageClient: allow aborting hover handler on unreachable clients
Change-Id: I1163144de7d37d3e270e31f2bf523ba812a937a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-04 07:17:41 +00:00
David Schulz
7c86d1a195 LanguageClient: pimpl Client and cleanup includes
Change-Id: I653861e29baeaddcbcd21a5e738be6bd85514617
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-23 11:58:09 +00:00
David Schulz
94e2fa7df0 LanguageClient: Add option to always send hover requests
Even if we already have a diangostic visible at this location. This is
used in the coco server to display additional information inside the
coverage browser.

Change-Id: I0d75f2e9f469ebdf6df7d6948a8e3e6b0cc58969
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-23 07:59:02 +00:00
David Schulz
a493970e05 LanguageServerProtocol: remove IContent
Do not pretend to support multiple message types, while no other
messages are actually implemented by us or even known to exist in the
wild.

Change-Id: I49ee2118b2e10f265ac641c195df8a9e5c97951c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-20 06:35:47 +00:00
David Schulz
52770b746e LSP: fix hover request result
According to the protocol a hover request can also return a Null as a
result. Reflect this in the protocol implementation and adapt usages.

Change-Id: I14ce71639c64b6de00e9c1198617083c1a3de9eb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-16 12:36:44 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
David Schulz
4452f71201 LanguageClient: avoid optional::value
Potentially throws std::bad_optional_access. Use operator* and
operator-> instead.

Change-Id: Idefa137da53f3663ea88961f1105b93402ec4777
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-24 12:04:38 +00:00
Christian Kandeler
673d596c84 ClangCodeModel: Provide tooltips via clangd
Note that we temporarily lose the ability to hover over an include and
get the full path of the header file. This is a valuable feature that we
need to restore, preferably by fixing clangd itself.
Fixing the remaining few test failures would likely require more
complicated code as well as additional LSP round-trips, and as of now
I'm not convinced it is worth the effort.

Change-Id: I08c72c4bd1268bbd67baeb57bbfd29d9b11303a5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 08:49:24 +00:00
David Schulz
64434b9fb4 LanguageClient: correctly track current hover request
Change-Id: I6c5b90aa8c3fd7611e48c0cd676dc1c1f9b9e562
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-07 05:32:01 +00:00
Eike Ziller
2800f3b51f Merge remote-tracking branch 'origin/4.15'
Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
2021-04-09 12:42:03 +02:00
David Schulz
ccdd0d666d LanguageClient: Do not send hover requests to unreachable server
Change-Id: Icb4d3516a12b9475967de5ff5dcbf45cf5986195
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-07 05:18:32 +00:00
David Schulz
d17277b546 LSP: reduce error handling complexity
Instead of checking recursively every possible object just check the
required keys for an object and validate it on construction or
assignment from json.

This will reduce the implementation effort for protocol extensions and
also reduce the false positives we might get if the protocol gets
updated.

Change-Id: I3df24e62430d2c7575d26c1581e6a9606e7da4c1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-02 12:51:47 +00:00
David Schulz
7521334261 LSP: support WorkDoneProgressOptions in server capabilities
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>
2021-02-15 13:19:56 +00:00
David Schulz
e6d0ed3160 LanguageClient: support versioned diagnostics
Change-Id: Id182431f371201c7266fe0683e78fe56a8a9735b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-12 12:40:07 +00:00
David Schulz
90746d8623 LanguageClient: fix dynamic registered hover provider
Change-Id: I48580b84c310c69ff72fba743260806bd236752f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-25 07:13:51 +00:00
David Schulz
11ea89d936 LSP: Explicify API
Change-Id: Id208a420fd3e1e23d3279c4f1f19bdbed994a8d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-15 08:31:30 +00:00
David Schulz
d097330b40 LSP: remove qt version check for markdown
Change-Id: I54da2acf5e3542355064b916582f3507b6bc5356
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-10 06:13:36 +00:00
David Schulz
c16665b9f3 LSP: show tooltips for diagnostics
Change-Id: I9625c77f87c31d3287ab17de42a507a8b068e118
Reviewed-by: Alexis Murzeau <amubtdx@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-04 06:37:46 +00:00
Eike Ziller
9f21f59e68 LanguageClient: Support markdown tool tips with Qt 5.14
Use Qt::MarkdownText if language server returns markdown and it was
built against Qt 5.14.

Change-Id: I75787cfcb32480cb37bc0dadc4be12d005005099
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-11-19 12:26:04 +00:00
Eike Ziller
3476dbd560 LanguageClient: Show markdown tool tips as plain text
We tell the language server that we do not support markdown, but some
(haskell-ide-engine) ignore that.
Show the text as plain text.

Change-Id: I1a61346b497cc04dce6c0da4221e949a16c61acf
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-25 11:56:53 +00:00
Eike Ziller
80a3c7248e LanguageClient: Remove unnecessary function re-implementation
Change-Id: I44862986a5ecc808b834d7c6d76191cbd9fd07a6
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-25 11:09:46 +00:00
David Schulz
f0ad5813b9 LanguageClient: more FileName to FilePath renaming
Change-Id: I803211d462b442b6881a02e870d2cd816675e0d9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-17 08:15:40 +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