aboutsummaryrefslogtreecommitdiffstats
path: root/qt-cpp
Commit message (Collapse)AuthorAgeFilesLines
* qt-cpp: Initialize kits with common settings & add QML debug definitionsHEADdevOrkun Tokdemir2024-12-181-22/+18
| | | | | | | | | * Add `-DQT_QML_DEBUG` and `-DQT_DECLARATIVE_DEBUG` to `CMAKE_CXX_FLAGS_DEBUG_INIT` and `CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT` Task-number: VSCODEEXT-14 Change-Id: I9bb941b2fbfad737185def9726868bc2d9133cde Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* README: Add `doc-snapshots.qt.io` as pre-release version documentationOrkun Tokdemir2024-12-161-0/+3
| | | | | | | Pick-to: 1.1.0 Change-Id: I7b818025dd1684620f855dbd14b21d4c50481e23 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Enhance logging for coreAPI notifications and config initializationOrkun Tokdemir2024-12-131-2/+16
| | | | | | | | * Improve logging for coreAPI notifications * Introduce `toString()` method for `QtWorkspaceConfigMessage` Change-Id: I7e82196ca641a93ea2a960230203fe21a38c8b4e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Introduce `FileWriter`Orkun Tokdemir2024-12-131-3/+26
| | | | | | | | | | | | When both `addtionalQtPaths` and `installationRoot` are set or updated, KitManager tries to write the new configuration to the `cmake-kits.json` . This might cause both handler to write the same file at the same time. To prevent this, `FileWriter` queues the write requests and writes the file one by one. Change-Id: Ic41aae5139fc04644a48b7a14ae14b8fd41536a4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Refactor communication between core and extensionsOrkun Tokdemir2024-12-123-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous implementation, the extensions were using only one way to communicate with each other, which was getting a notification when a config value was set or changed. This was problematic on startup because there was no order in which the extensions were activated and when messages were handled. b5bf26ac084823758be18453bb61579fefceb57c partially fixed this issue by adding a way to wait for `qt-cpp` to be ready, but it was still not enough. The extension should read config values when they are ready, not when messages are sent from other extensions. Remove the `lazy` initialization parameter in `Project` classes. Instead of using that parameter, we remove the firing event from `addProject()` and only fire when the project is added after startup. This way, we don't need the `lazy` parameter anymore. Since `processMessage()` is not used during startup, this commit also fixes QTBUG-131702 on the extension side. qt-lib: This commit changes `QtWorkspaceConfigMessage` and removes values in it. `QtWorkspaceConfigMessage` is now used only to notify that a value or values were set. The value `CoreApi` can be accessed by `getValue` and `setValue`. * Update the `CoreApi` interface * Add `setValue` * Rename `update` to `notify` * Remove `get<T>()` from `QtWorkspaceConfigMessage` qt-core: * Remove the internal checking mechanism to understand if a value was set or changed. Instead, just store values. qt-cpp: * Update `processMessage()` for the new usage. * Initialize config values explicitly during startup. qt-qml: * Update `processMessage()` for the new usage. * Separate starting `qmlls` from the constructor. It should be started when the conditions are met. * Get config values and update parameters inside `onProjectAdded()` Task-number: QTBUG-131702 Change-Id: If9831ea1257d123f777e6ae2afb92f33942dd3da Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Bump version to 1.3.0Orkun Tokdemir2024-12-092-4/+4
| | | | | Change-Id: Iab1c9f545d8b10ad13127a3a77545a3f4f475597 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Remove dependency on `qt-ui`Orkun Tokdemir2024-12-091-1/+0
| | | | | | | `qt-cpp` doesn't need to depend on `qt-ui`, so remove it. Change-Id: I653c15ee046671b2c606778d70396cc8d6897c25 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qt-cpp: Fix race condition while writing to `cmake-kits.json`qt-ui/1.1.0qt-qml/1.1.0qt-cpp/1.1.0qt-core/1.1.0Orkun Tokdemir2024-12-062-4/+6
| | | | | | | | | | | | | `kitManager.checkForAllQtInstallations()`, `KitManager.addProject` and `this.onProjectAdded()` try to write to `cmake-kits.json` at the same time. This generates a race condition that can lead to the file being corrupted. To fix this, we add projects to both `KitManager` and `ProjectManager` lazyly during startup. Change-Id: I5fc5199a33bb2d072eb52f8adc41df89e38722d8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Remove sending action from qt-cpp's reset()Orkun Tokdemir2024-12-051-2/+0
| | | | | | | | | | Since qt-core's reset() is already sending the action and it also executes qt-cpp's reset(), there is no need to send the action from qt-cpp's reset(). Task-number: VSCODEEXT-90 Change-Id: Ie33e29cf4e68d9571c731ecd96426ad5b4249b61 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qt-cpp: Update CHANGELOG.mdOrkun Tokdemir2024-12-051-0/+25
| | | | | | Change-Id: Iec129871093d07973247eee5ae644388e5f4ff7d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* qt-cpp: Remove redundant `export`Orkun Tokdemir2024-12-031-1/+1
| | | | | | Change-Id: I11d6963f122642f91e4b436fe8fc2bd4b5ce2151 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Ben Cho <ben.cho@qt.io>
* qt-cpp: Analyze selected kit & send telemetry dataOrkun Tokdemir2024-12-024-21/+86
| | | | | | | | | * Analyze the selected kit toolchain and the Qt version and send telemetry data to the server. * Introduce `QtVersionFromKit()` to reduce code duplication. Change-Id: Ia92f03f0c1bb18d3c69db5c7b0b485a6d8cd9099 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Make writing `cmake-kits.json` synchronousOrkun Tokdemir2024-12-022-8/+8
| | | | | | | | | Since `onQtInstallationRootChanged()` and `onQtPathsChanged()` might write to `cmake-kits.json`, we need to make sure that the writing is synchronous. Otherwise, the file might be corrupted. Change-Id: I1bfa84621386e3aa94c725179e50bbb18d5dd152 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Increase the severity of 'Project not found'Orkun Tokdemir2024-12-021-1/+1
| | | | | Change-Id: Iedf682dbbcafdacff4408baa7ad71afc66f17d2b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Do not show `No CMake kit selected` popup when on startupOrkun Tokdemir2024-11-292-3/+8
| | | | | | Fixes: VSCODEEXT-109 Change-Id: Ib565e7bbf13d4f44d94f0d67f14cdea3bc3214d5 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Dispose event handlers and language client when the project is closedOrkun Tokdemir2024-11-281-30/+43
| | | | | | | | | | | Since event handlers are not disposed properly, they are still active when the project is closed. This can cause those handlers to be called after the project is closed, which can lead to errors. * Dispose project managers inside `Deactivate()` Change-Id: Idd7b8548f7c16c41c0e4fd7052fa7ae988678bc4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qt-cpp: Remove redundant codeOrkun Tokdemir2024-11-281-9/+0
| | | | | Change-Id: I03e8844ec496966836abbc2f8ca3c75294a42d00 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Fix CI failureOrkun Tokdemir2024-11-281-1/+1
| | | | | | | https://github.com/qt-labs/vscodeext/actions/runs/12064539246/job/33641547880 Change-Id: Id613337ad217b575cb76bfee26760eb27dc62abf Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Make Ninja the default CMake generatorJoerg Bornemann2024-11-281-13/+3
| | | | | | | | | | | | Many projects are not prepared for multi-config generators. Use the single-config Ninja generator as default to avoid nasty surprises. This also enables us to remove code where we set the preferred generator to Ninja for certain target platforms. Fixes: VSCODEEXT-108 Change-Id: I969b4b40752530efff2aa564402f9079f5647dc8 Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
* Don't set platform/toolset on any Ninja generatorJoerg Bornemann2024-11-281-2/+2
| | | | | | | | We didn't set platform/toolset on the Ninja Multi-Config generator. Do that also for the single-config Ninja generator. Change-Id: I55cc0abd059b0137599d58272201e539e74041dc Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: qt-qml: Add build directoryOrkun Tokdemir2024-11-252-2/+26
| | | | | | | | * Pass the build directory to qmlls with `-b` * Detect the build directory change from the CMake extension Change-Id: I8279b444036e174762f9d469fd8b4abdaba66e83 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Fix wrong value evaluation for `processMessage()`Orkun Tokdemir2024-11-221-9/+12
| | | | | | | | | | When only the value is checked whether it is undefined or not, it doesn't give us the correct result because the value either can be set to undefined or not set at all. We get undefined in both cases. We should check the key is set in the message first instead. Change-Id: Ic4c17e96c3975adcbc49eb82e7b1999d3dcec851 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Speed up compilation by using the `--incremental` flagOrkun Tokdemir2024-11-212-0/+2
| | | | | | | https: //www.typescriptlang.org/tsconfig/#incremental Change-Id: I750398a09178e02c3b3c73bf8e8fc7654dab03d4 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* vscodeignore: Add `.eslintcache`Orkun Tokdemir2024-11-211-0/+1
| | | | | | | | | | `.eslintcache` is added to .vsix files, so it should be added to the `.vscodeignore` files to discard them. Amends: 8570300bf7eb20e13f397319dd506ae1a5600a82 Change-Id: I36102382ec29d9e9d1f0060f32c23df6364761ed Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Package: Fix high severity vulnerabilitiesOrkun Tokdemir2024-11-201-3/+4
| | | | | | | * Run `npm audit fix` to fix them. Change-Id: Iab3b1fd524e70bae930c03025ae10683fac07046 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Set `cmake.cmakePath` with cmake exe inside Qt installation rootOrkun Tokdemir2024-11-134-2/+96
| | | | | | | | | * Update package.json * Add `qt-cpp.doNotAskForCMakePath` Fixes: VSCODEEXT-102 Change-Id: Ia31715e40a4e0abc0aa42c9ef3d76033786fcbea Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: qt-core: Remove reduntdant `watchProjects()` callsOrkun Tokdemir2024-11-121-2/+0
| | | | | | | | | When `watchProjects()` is called in both `ProjectManager`s and derived classes constructors, `onDidChangeWorkspaceFolders()` is called twice for the same event. This causes a project to be added twice. Change-Id: I9c026ea3865afb556e372dfc672d84caad1371f0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Filter out non-qtpaths values from kits `PATH` env variableOrkun Tokdemir2024-11-111-1/+6
| | | | | | | | | | When we don't filter out non-built-in values from kit `PATH` environment variable, we copy some unnecessary values like `ARCH`, `MSVC_MAJOR_VERSION`. So, we need to filter out non-qtpaths values from kit `PATH` environment variable. Change-Id: I99e4c3d6a76f7a9f3de973c0bab579ad7eab615c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Add telemetryOrkun Tokdemir2024-11-088-5/+342
| | | | | | | | | | * Send events when commands are executed * Add https://www.npmjs.com/package/@vscode/extension-telemetry * Update ThirdPartyNotices.txt Task-number: VSCODEEXT-62 Change-Id: I7c88b0db55fa14da6d66025e7fa4458726f5ce6b Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Rename qpaPlatformPluginPath to QT_QPA_PLATFORM_PLUGIN_PATHOrkun Tokdemir2024-11-072-4/+4
| | | | | | | | | Since `qpaPlatformPluginPath` is a environment variable, it should be renamed to `QT_QPA_PLATFORM_PLUGIN_PATH` to match other environment variables. Change-Id: Iff9e6ad003874a3ad64b56aa635eb2fed6dcb06e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Keep VSCODE_QT_FOLDER for backward compatibilityOrkun Tokdemir2024-11-075-25/+41
| | | | | | | | | | | * Use `getQtInsRoot()` instead of `VSCODE_QT_INSTALLATION` everywhere to also include `VSCODE_QT_FOLDER` for backward compatibility. * Use `IsQtKit()` instead of checking environment variables directly. Change-Id: I14cc01915c7682190130b5cf0c14b96c6fe70a36 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qt-cpp: Add `qt-cpp.QML_IMPORT_PATH`Orkun Tokdemir2024-11-073-1/+56
| | | | | | | | | | When a qml project built with vcpkg is debugged, we get a missing qml module errors like `module "QtQuick.Layouts" is not installed`. So we should set the `QML_IMPORT_PATH` environment variable explicitly. Fixes: VSCODEEXT-107 Change-Id: I3f717a9b8b94e9948f2cf3c4d62383e4d84e4477 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Package: Update dependencies & third party licensesOrkun Tokdemir2024-11-063-418/+1093
| | | | | Change-Id: I14aaf1beb358e3efc5b81c362e8fbae4126c39d3 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Fix typoOrkun Tokdemir2024-11-063-7/+7
| | | | | Change-Id: I448a084f9100ec0ff39dadd9f552f65f0849dc56 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ci-scripts: Remove qt-lib license from ThirdPartyNotices.txtOrkun Tokdemir2024-11-061-185/+0
| | | | | | | | | We already put the dependencies of qt-lib in the ThirdPartyNotices.txt. So we don't need to put the license of qt-lib in the ThirdPartyNotices.txt. Change-Id: I1cb24acd46ed3f0852be6d15667f2d01361fb179 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Bump version to 1.1.0Orkun Tokdemir2024-11-052-4/+4
| | | | | Change-Id: I5b32ad2e96a63f43ed54c8cb6e30fd800159cc01 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Add missing qtpaths featuresOrkun Tokdemir2024-11-018-92/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove `getSelectedQtInstallationPath()` use `getSelectedKit()` instead Since we support both root installation kits and qtpaths, we cannot just return the installation path of the selected kit. We need to return the all kit information. * Use only qtpaths exe paths to cache information Since we store only qtpaths exe paths in `cmake-kits.json`, we don't need to hash it with other values like name or isVCPKG. And also, we can improving the performance by caching different kits but with the same qtpaths. * Implement `qt-cpp.qtDir` for debug templates on Windows We have to return possible dll paths for qtpaths kits. * Deprecate `qt-cpp.kitDirectory` and use `qt-cpp.qtDir` instead We support both root installation kits and qtpaths. So we cannot just rely on `qt-cpp.kitDirectory\bin` in debug templates. For qtpaths, we need to return multiple paths. * Remove `kit-directory.ts` and move content to `launch-variables.ts` * Add `qt-cpp.qpaPlatfromPluginPath` When we debug with Qt from vcpkg. We get the `could not find or load the Qt platform plugin "windows" in "",` error if we don't set the `QT_QPA_PLATFORM_PLUGIN_PATH` environment variable. That's why we need to set `qt-cpp.qpaPlatfromPluginPath` according to `cmake.buildType` either `debug` or `release` path. * Locate Designer via qtpaths To support using Designer from qtpaths, we need to locate the Designer inside paths like `QT_HOST_BINS`, `QT_HOST_LIBEXECS`, `QT_INSTALL_LIBEXECS` * Remove error messages when a qtpaths kit selected In the previous implementation, we showed an error message when a qtpaths kit selected instead of root installation kits. * Add Qt version detection from qtpaths * Add selectedQtPaths to coreAPI When a qtpaths kit is selected, we set `selectedQtPaths` to inform other extensions. * Move `queryHostBinDirPath` to `qt-ui/util.ts` Since it is only used in `qt-ui`, we move it to `qt-ui/util.ts` * Shorten `locateQtDesignerExePath()` to `locateDesigner()` * Use `set designerClient()` and detach inside it It is better encapsulation. Task-number: VSCODEEXT-86 Task-number: VSCODEEXT-93 Task-number: VSCODEEXT-92 Change-Id: I0aadd4dd5e2f9508576dda70d24eb14de7796a86 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Rename VSCODE_QT_INSTALLATION_ROOTOrkun Tokdemir2024-10-282-6/+5
| | | | | | | | | | In the current kit generation, `VSCODE_QT_INSTALLATION_ROOT` doesn't address the acutal Qt installation root. It addresses a subdirectory inside it. That's why it can be misleading. This commit renames it to `VSCODE_QT_INSTALLATION` to make it more clear. Change-Id: I40ea80786c7d73b9279efa9eb6160f8e9a52af20 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Package: Add `--cache` option for PrettierOrkun Tokdemir2024-10-251-1/+1
| | | | | Change-Id: I3672e4fb4e2f4c034b20783333ccb19473b614bc Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ci-scripts: Improve local license file validationOrkun Tokdemir2024-10-251-1/+1
| | | | | | | | * If a local license name includes `license` somehow, consider it as a license file. Change-Id: Ib5f999c81905d7618155fdd2ebb5a562a7a0d739 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Add vcpkg supportOrkun Tokdemir2024-10-231-8/+13
| | | | | | | | | | * Update package.json & add `command-exists` * Add kit generation for vcpkg Task-number: VSCODEEXT-93 Change-Id: Iaae7c5b1cf1afc07a74544ad1840b13e3dba0350 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Do not check for toolchain file in `Qt5` and `Qt`Orkun Tokdemir2024-10-231-10/+8
| | | | | | | | Since the generation of `qt.toolchain.cmake` is added with `Qt6`, we don't need to check for the file in `Qt5` and `Qt`. Change-Id: I03a79eb6e9b6a027bb6ea96c5a13d635ed4b8248 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Linter: Improve checksOrkun Tokdemir2024-10-232-1/+2
| | | | | | | | * Fix linting errors Change-Id: I933d8070b470a56db33451db7638d0d74744015e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Ben Cho <ben.cho@qt.io>
* qt-cpp: Add msvc kits support for qtPathsOrkun Tokdemir2024-10-231-12/+79
| | | | | Change-Id: I91e5d87b4bd70b97f980d0737845cf3b888ac094 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ci-scripts: Add caching for eslintOrkun Tokdemir2024-10-221-1/+1
| | | | | | | | * Add caching for eslint * Gather commands together in package.json Change-Id: I3169cff2974a29a2ddd7daa97d3e8560420b1e06 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Do not generate MSVC kits which have incompatible architectureOrkun Tokdemir2024-10-211-3/+7
| | | | | | | | | | | When generating msvc kit, using either platform info or `visualStudioArchitecture` is not enough to generate correct msvc kits. We should generate kits when both the platform info and `visualStudioArchitecture` match. Otherwise, msvc kits may cause incompatible architecture errors. Change-Id: I58f6dd46a9dc713b58cd24d24c1f05a155dfe026 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Refactor `processMessage` functionOrkun Tokdemir2024-10-211-20/+13
| | | | | | | | * Handle the workspace type in the beginning of the function * Use the same code for both workspace types Change-Id: Ifa7a5a1f5e7bc90e41688815e7ffc8181be80351 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Add progress bar for generating qtpaths kitsOrkun Tokdemir2024-10-212-2/+16
| | | | | | | | This patch shows a progress bar when `qt-core.additionalQtPaths` is changed, and the kits are being generated. Change-Id: I2b2f804fa6b0abce9fcc4df2d732a61781492a8d Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Refactor msvc kit generationOrkun Tokdemir2024-10-211-40/+30
| | | | | | | | * Removed unused code * Add new parameters to generalize usage of `generateMsvcKits` Change-Id: Ic709da8603e735f686ccd95cfcbd9f0fef22de71 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-cpp: Fix incorrect capitalizationBen Cho2024-10-211-7/+7
| | | | | | Change-Id: I7396a10de2cee83f897785045c740a941b41fa04 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>