Let's say you move the mouse left and right on the keyword, we shouldn't
flicker showing the same tooltip to the new position.
Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Check that the function operating upon is "include" and then match the
word under cursor with a file from the project.
Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The CMake snippets do have comments with the origin of the snippet and
this patchset allows navigation to the url in question.
Change-Id: I6eb2565e8f7b9100a1cc19dbf8ccda430c698613
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
For example find_package(ZLIB QUEIT) will result in the package
variables ZLIB_LIBRARY ZLIB_INCLUDE_DIR.
The variables are available for both code completion and navigation.
Change-Id: I4ea6090f44a980dc91632fcabbda16987b0f0285
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reuse it in CMakeEditor and CMakeFileCompletionAssistProvider.
Amends d04585b519
Change-Id: I8dbd59c815e017404ff215ca1ff68740d6653e91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Drop a call to currentProject(), as currentBuildSystem()
already implies currentProject() isn't nullptr.
Amends a998269d7e
Change-Id: Ibf902dc78af5c59c6475366f52d0b3489e989789
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This will allow opening CMake files via F2 when using include statements
like: include(${CMAKE_SOURCE_DIR}/cmake/api.cmake)
CMAKE_BINARY_DIR and CMAKE_CURRENT_BINARY_DIR are also supported.
Fixes: QTCREATORBUG-29467
Change-Id: I9adb417d98e8a8fccf6cd3e5038562db02cb28c2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Removes the last usage of Utils::Text::Replacement with a more commonly used pattern.
Change-Id: I0912bf61388a58ddaba424380ec139f9aa15fc4c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
To avoid additional dependencies, let the QtSupport plugin register a
function for filtering help URLs, and add information about the
originating file path to the help items created by the context help
handlers. The filter hook then finds out the corresponding project,
active target, and corresponding Qt version, and filters the help URLs
accordingly.
With the default setting in "Kits > Qt Versions > Register
documentation", only the highest versioned documentation set within a
major Qt version is registered, so context help now shows the highest
versioned help from Qt 5 or Qt 6 depending on active target. If that is
changed to "All", context help now shows documentation from exactly the
version that is currently used by the project.
Fixes: QTCREATORBUG-10331
Change-Id: I7d87793737cc5ab7d228ee4bfe568d7e8343ee7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
Fixes "Jump to File" from the context menu and the ctrl+click navigation
for files that contain special characters.
Fixes: QTCREATORBUG-25572
Change-Id: I7c26c6d517ced26f803c2224f0c09397f373b3b5
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Keep internals internal, remove some unnecessary includes, add
some that should have been there.
This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.
This patch also moves some code around that ended up being
in the wrong file.
Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Rename some constants to get a bit more consistency into the
naming scheme. I am so tiered of missing a constant due to it
not having _ in the expected places!
Change-Id: Ibb5e82ea4e25ccb559352839b96c8a64394f3085
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Like we do for the BaseTextEditor.
This allows users to get context help also for items that are not
"commands", like various variables that have a meaning for CMake.
Change-Id: Ie1af61bdffdeecb406b1dc7e6127000c17ea5a8e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Support CMAKE_CURRENT_LIST_DIR and CMAKE_CURRENT_SOURCE_DIR as
variables in filenames when handling links in the CMake editor.
Having a way to find out variable values in CMake would be nice,
till that arrives, we have to live with hacks to make the most
common variables work:-/
Task-number: QTCREATORBUG-21065
Change-Id: Iffaaae8665e0662226d08b88de37b66d5a5fc4d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
No need for code duplication.
Change-Id: I3d2c795d072b8de5818e1844b8126e526339c0da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
It no longer takes an ID but a HelpItem.
Change-Id: I0aa738549fea4fcfd0151adc2dfd642c63f0f60d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Context help would first query the database with potential IDs, and
afterwards the help plugin would look up the links for the resulting ID
again.
Pass the HelpItem (which potentially contains the cached links) directly
to context help.
Change-Id: I73bddcd3cd4eacaea412b98d53c5e5354a31f3d5
Reviewed-by: David Schulz <david.schulz@qt.io>
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.
First simple unit-test proofs it builds and runs.
Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
convertPosition change was introduced in 931ec39f64.
It changed 0-based column to 1-based which is how it
naturally is in Qt Creator.
This fixed some usages but broke many more. This is an
attempt to fix the remaining use cases.
Fixes CppEditor auto-tests.
Change-Id: Ia8d14da0ebb035cd2fdd6da4ff6ec89c1c5121a8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>