aboutsummaryrefslogtreecommitdiffstats
path: root/qt-lib/src/core-api.ts
Commit message (Collapse)AuthorAgeFilesLines
* Enhance logging for coreAPI notifications and config initializationOrkun Tokdemir2024-12-131-0/+10
| | | | | | | | * Improve logging for coreAPI notifications * Introduce `toString()` method for `QtWorkspaceConfigMessage` Change-Id: I7e82196ca641a93ea2a960230203fe21a38c8b4e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Refactor communication between core and extensionsOrkun Tokdemir2024-12-121-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add missing qtpaths featuresOrkun Tokdemir2024-11-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add vcpkg supportOrkun Tokdemir2024-10-231-1/+3
| | | | | | | | | | * 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-lib: Simplify variable names in `QtInfo`Orkun Tokdemir2024-10-071-9/+8
| | | | | Change-Id: I1085256995872ac0698f6427c8279cf417004503 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-core: Add the `name` property to `additionalQtPaths`Orkun Tokdemir2024-10-071-3/+27
| | | | | | | | | | | | | | | | | Problem: Sometimes kits with the same name can be generated according to the query results from either `qtpaths` or `qmake`. This can cause the user to select the wrong kit. To avoid this, we need to add a new `name` property to `additionalQtPaths`. This will allow users to specilaize their kits with different names. Otherwise, the name will be the same as the `qtpaths` or `qmake` query result. * Add new type for `additionalQtPaths` * Convert the old string parameter to the new type to have uniformity Change-Id: I9c734c0c69cc19313e66808dad49ac72316f4243 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-core: Add reset function to coreAPIOrkun Tokdemir2024-10-021-0/+1
| | | | | | | * Clear cache on reset Change-Id: Id9d117b6ee2a325e8b40183e9acb1707bc411092 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qt-core: Add qt-core.additionalQtPathsJoerg Bornemann2024-09-271-6/+32
| | | | | | | | | | | | | | This new configuration value can be used to specify Qt installations that were not provided by the Qt installer. The values are absolute paths to the qtpaths or qmake executables of a Qt installation. For values in qt-core.additionalQtPaths we now generated CMake kits like it was already the case for qt-core.qtInstallationRoot. Fixes: VSCODEEXT-86 Change-Id: Id8eefe92c930546ede2639e18792fc78ba6558dd Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
* Style: Use the same naming convention for coreApi across all extensionsOrkun Tokdemir2024-08-281-5/+5
| | | | | Change-Id: I1e526a649de31f992d0652ccee8fb973e0ec7133 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* qt-lib: qt-core: Use constants instead of stringsOrkun Tokdemir2024-08-271-3/+9
| | | | | Change-Id: I3c8b892733da988d570df413ab416ca9d544f2fd Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Move `qtFolder` to `qt-core` & change name to `qtInstallationRoot`Orkun Tokdemir2024-08-211-3/+10
| | | | | | | | | | | | | | | * Change `qtFolder` name to `qtInstallationRoot` * Change all related variables from `qtFolder` to `qtInstallationRoot` * Move the `registerQt` command from `qt-official` to `qt-core` * Move all `qtInstallationRoot` logic to `qt-core` * Add `ProjectManager` and `StateManager` to `qt-core` * Move `BaseStateManager` to `qt-lib` * Update the documentation about the new config name * Add common constants to `qt-lib` * Fix typo Change-Id: I785e2e4aa51f64b91d8fec7d2c264b42d80c9a16 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Divide the monolithic extension into modular extensionsOrkun Tokdemir2024-07-181-0/+46
The below Extensions are created with this commit: * qt-core * qt-official * qt-ui qt-core This extension is the core extension for the Qt extensions. It provides the basic functionalities for the other extensions to work. * It handles the communication between the other extensions. * It provides the basic functionalities and common features for the other extensions. * The all other extensions depend on this extension. qt-ui This extension provides the UI functionalities. * It communicates with the `qt-core` extension to get information about the Qt Widget Designer. * It provides syntax highlighting for `.ui` files. qt-official This extension has the rest of the previous monolithic extension functionalities. It should be divided into more extensions in the future. This commit implements: * Common functionalities are moved from `qt-official` to `qt-core`. * `qt-lib` is implemented as a npm module to gather the common code. * Static analysis tools for every extension are added. * Updated all `package.json` files to reflect the changes. * `ci-scripts` is implemented to run the static analysis tools and tests. * The `common` is created to gather the common code for tools. * Extension packs are updated. * The `ThirdPartyNotices.txt` files are generated for every extension. * The `README.md` files are updated to reflect the changes. * `.vscode/launch.json`, `.vscode/extensions.json`, and `.vscode/tasks.json` are updated. Change-Id: Iac9b7e071275e92cdfbb3a47fba24d3ba8e41c89 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>