Commit Graph

214 Commits

Author SHA1 Message Date
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00
hjk
26dd8aef2a Python: Convert to Tr::tr
Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-21 08:25:04 +00:00
Jarek Kobus
5b3927869c Drop Qt5: ProjectExplorer: Get rid of QOverload
Change-Id: Id8b28efa7b31a92a5e24485803322c586a23802d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-20 13:13:11 +00:00
hjk
d842862944 Utils: More porting.h related changes
Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-14 12:04:25 +00:00
Eike Ziller
f950a5d86c Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/libs/utils/terminalprocess.cpp
	tests/auto/qml/qmldesigner/coretests/CMakeLists.txt

Change-Id: Ifc5b37dadd46af752f0771a2685da1ac9a6260bd
2022-07-07 13:47:12 +02:00
David Schulz
b47b6cddc7 Python: Prepend pyside6-project path to PATH env variable
Otherwise pyside6-project cannot find uic or rcc or might use those
tools from another pyside installation.

Change-Id: I34eff2fc2627b07a18a705e5d658bd7cf8ce9350
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-07 09:10:01 +00:00
Jarek Kobus
96c5a8a789 PipSupport: Connect to watcher before setting a future
In order to avoid runtime warning:
"QFutureWatcher::connect: connecting after calling
setFuture() is likely to produce race".

Change-Id: I921396628e5615e7c2d87045d2e787388dbddcc6
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-07-05 11:47:17 +00:00
Eike Ziller
6c98721efc Merge remote-tracking branch 'origin/8.0'
Change-Id: I552d201d09d62d21655176467088c6e48b8a2fe2
2022-06-29 15:29:49 +02:00
Leena Miettinen
b1f7172077 Python Language Client: Fix typo in translatable text
Change-Id: I11a0161b76661fd876b47dc5aa23ce2449258ae0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-29 08:24:54 +00:00
Leena Miettinen
14965f5792 UI text: Fix grammar errors and capitalization issues
Change-Id: Iefb1075cc0b14eb8c0e99b6c96c31a91c2b079f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-28 13:54:10 +00:00
Eike Ziller
f95a1eca34 Merge remote-tracking branch 'origin/8.0'
Change-Id: Icef5e28557701243e686d35cf885412eb341e75a
2022-06-28 11:35:16 +02:00
hjk
9e363c6421 Add plugintr.h files to all plugins
Except FakeVim, which had it before.

for i in [a-eg-z]*/*.json ; do
    upper=${i##*/}
    upper=${upper/.json/}
    lower=${i%/*}
    trfile=$lower/${lower}tr.h

    cat << EOT > $lower/${lower}tr.h
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

namespace $upper {

struct Tr
{
    Q_DECLARE_TR_FUNCTIONS($upper)
};

} // namespace $upper
EOT

    git add $trfile

    perl -pi -e "s/(${lower}_global.h)/\1\n    ${lower}tr.h/"  $lower/CMakeLists.txt

    perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/"  $lower/$lower.qbs

done

Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-27 13:34:57 +00:00
David Schulz
1956fa0365 Python: prevent setting local env to remote pyls
Change-Id: Id0eea5420c897687e6931bf640e3a37ba2638b8f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-27 11:23:54 +00:00
Eike Ziller
92c74abbf1 Fix lupdate issues
Change-Id: I7256c8aff5eb77b264b76ba24e79c26ab2924e84
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-27 07:05:22 +00:00
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
David Schulz
e3cfbc0a7b Python: improve initializing python run configuration
Sets main.py as the default script. If we cannot find a main.py we
create a runconfig for every py file in the project.

Change-Id: I93f4c9a5c9e2825a592eee3707439e69a8aea566
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 11:24:18 +00:00
David Schulz
6c8605ced2 Python: automatically disable outdated pyls settings
Change-Id: I301c6df3fdd9cf634a1abff20c6f24b9bc5fc23b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 11:23:52 +00:00
David Schulz
e4d692a689 Python: only add python files as targets
Change-Id: I21f0ca6035aed6306d6cbe55a6c6df0838e49f45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 09:53:52 +00:00
Jarek Kobus
a613caa234 PipInstallTask: Connect to done() signal instead of finished()
Change-Id: I7a712791a440668c7efb8282d7f035a120c7d719
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-21 08:14:16 +00:00
David Schulz
591fc12ffa Python: remove static cast of client interface in client constructor
Change-Id: I475a2b79438b8392085f1d9bf2cdb8b7369efa68
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:11:31 +00:00
David Schulz
e74999cced Python: check for pyside tools after installation
Change-Id: Icf9ae0ec08a78efc51216daa3304e76f8e812d5f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:11:07 +00:00
David Schulz
ca47064020 Python: Fix scripts path to global/venv pyside installations
... when checking for pyside tools.

Change-Id: I1aaac9dd9da76f08ada031cc88761dba36c4e3b6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:10:56 +00:00
David Schulz
3b8b247f88 Python: ignore windows store redirectors
Change-Id: Ife5c13549d73156550a7ce4b5436f1e5a19503fa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 06:16:08 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
hjk
152b14207c Replace QtcProcess::stopProcess() by stop() plus waitForFinished
... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 08:26:10 +00:00
David Schulz
a750961f4d Python: make sure working dir is on python device
Task-number: QTCREATORBUG-27536
Change-Id: If9c8f88f2a871ec71b200020689a4ae9df1e8a6a
Reviewed-by: hjk <hjk@qt.io>
2022-06-15 12:11:36 +00:00
David Schulz
2b428d5de0 Python: prefer python from path when detecting python for document
Change-Id: I794a741fa7257833f0b4efbc25dfae43b8748427
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-15 05:44:46 +00:00
David Schulz
02bfd03c22 Python: simplify detect python for document path
Change-Id: I49b943e8b89db32c11b12ee66c0ad3add9a695af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-15 05:44:42 +00:00
David Schulz
99acc9a153 Python: Fix python detection for non project files
Do not return an empty file path if we cannot find a python venv for a
file path, but also consider the configured interpreters.

Change-Id: I5a7f06e394fb925f9a00143fc5f0797e8754534b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:47:29 +00:00
David Schulz
4c20a880e6 Python: remove python specific language client settings
Change-Id: Ic993d525f29c1925f7e64dfc6f5e053234fb4904
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:47:23 +00:00
David Schulz
ed22ef7854 Python: globalize Python language server settings
Change-Id: I84fcee6462064f0c788492fcfa12a77379af2bd7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:40:43 +00:00
David Schulz
2029fe8c99 LanguageClient: fix todo
Change-Id: Ia6b3b5fe6e595c32a8b8a13b869f3178afb37ed8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-07 06:29:42 +00:00
David Schulz
ff8495b0a2 Python: fix pyside tool detection
pip might return an incomplete list of files on Windows for
installations. So we need to manually check the Scripts
folder for the tools we are looking for.

Change-Id: I40778607fd2f2015059744f17a539ca381b85560
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-03 07:35:13 +00:00
David Schulz
b9034e8426 Python: support python 3 mime type in language client
Change-Id: I9319442aecc61e854aaeb0778b959086a70d431b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-02 13:29:17 +00:00
David Schulz
b9627ddba7 Python: add pyside uic extra compiler
To be able to autocomplete code from .ui forms we need to feed the
python language server the compiled form. The uic extra compiler
generates a temporary ui_name.py file for uncompiled or unsaved ui
files. These files are inside a folder that gets appended to the python
path environment variable for the python language server.

Change-Id: I9f48d2012162f33986639315189c41e0a7e0dad2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-02 09:09:22 +00:00
David Schulz
3ad82a66f9 Python: move pyside detection to runconfig
Change-Id: I781c4d005ced0c884081616696eae7f738f38c6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-31 05:59:45 +00:00
hjk
2837f4d777 ProjectExplorer: Pass macroexpander (again) to WorkingDirectoryAspect
Broke with 8dacb123e0.

Probably calls for a more centralized approach again. Later.

Change-Id: Ibf52487d68d7938d4b5dfb38f1f0a5b0e1a97bc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-30 14:45:47 +00:00
Jarek Kobus
ef2ddeb00b Utils: More forward declarations / drop unused headers [A-C]
Round 1 - focus on headers.
For classes with initial in range [A-C].
Try to keep the same separators between different kind of headers.

Change-Id: Ieab893d644af035c42590401c90728719394221f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-24 10:32:53 +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
hjk
d41fc4b329 Remove or replace a few unnecessary #includes
Change-Id: I0545533baab57a4383fda5fd680603fdc6459a01
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-20 16:57:26 +00:00
hjk
8dacb123e0 Utils: Pass MacroExpander to ArgumentsAspect constructor
In the past we wanted to keep the aspect constructor simple but
it turned out that exceptions were needed and accumulating, so those
are likely here to stay.

By passing also the MacroExpander to the ArgumentsAspect constructor
allows other single-purpose warts like the ProjectConfiguration::doPostInit()
machinery can be removed.

Change-Id: I148b0ca1ab0740270eecd0d3134620de65a86d4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-20 07:06:10 +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
Jarek Kobus
6cd736fe6c Remove algorithm.h from buildtargetinfo.h
Change-Id: I777212fb94d46c1c71f017288b7e38dd5db62a91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-18 08:38:05 +00:00
hjk
6008d05b71 Python: Split complex call
Change-Id: I6f301342a1841d2734f0598edfcd7b3327a943c9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-09 05:56:06 +00:00
David Schulz
fbefd45b94 Python: add pyside build configuration
Task-number: QTCREATORBUG-27219
Change-Id: I19340c57789933c7104ec5d6fec628ed810c5f3e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-03 08:55:11 +00:00
hjk
0da130c4ef Python: Apply 'static' pattern for singleton members
Plus some cosmetics.

Change-Id: Ia2c8f425f0491fbe6a0bbf2e508857a5550e4d38
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-27 08:55:02 +00:00
hjk
28cfdf388a Promote previously python-specific InterpreterAspect
... and drop PythonRunConfiguration, which is a plain RunConfiguration now.

Change-Id: I540cb738180fc1424f730d6d1998886915ce527b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-27 08:54:22 +00:00
Jarek Kobus
74b1623acd PythonUtils: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: I02fefe01cfc4be6ef996c7c8b98b36137217504e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-27 06:26:45 +00:00
hjk
5da8695dca ProjectExplorer: Pass envAspect directly to WorkingDirectory constructor
This trades a now necessary order of setup for the now removed
"acquaintSiblings" facility.

Change-Id: I85058578b792e210f24573e2ab4e3a40a8813a11
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-22 11:53:59 +00:00
David Schulz
24b4a7be74 Python: add pip package information
Change-Id: Iea55d1491b49156d8bef32c5d4045efde4bc92fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-12 08:24:40 +00:00