Question
Editing or developing a Tuist project in a third party code editors that utilises the SourceKit-LSP
Expectation
I expect the SourceKit-LSP to pick up the dependencies and so forth, like it does for a normal SPM project.
However, the only way I get the autocompletion or other LS Goodies in the manifest
files, or the source files, is when I use tuist edit
and tuist generate
, (which is superb and very nice!). However if I open the file in other code editors, I get all these issues popping up, and sourcekit struggling to resolve the dependencies etc
Context
- Tuist version: latest
- Bare bone, blank Tuist project with one dependency
- third party editors, Nova with Icarus, and Helix
Reproduction (mandatory for problems)
- create a project by
init
, with ONE dependency - Open in third party editors
- The manifest files will have issues due to dependency issues.
import ProjectDescription // for example
- Add
Alamofire
as a dependency - Run
tuist install
- Include it in the main source code, and you will see issues regarding dependency resolution
My Current Hacky work around
- I remove the
Package.swift
fromTuist/Package.swift
and place it at the root./
- And also add the
target
,platform
,dependency
andproduct
- run
tuist install
- run
swift build
and everything seem to work fine in my third party editor
// ** Sample Package.swift at the root directory **\\
// swift-tools-version: 6.0
import PackageDescription
#if TUIST
import struct ProjectDescription.PackageSettings
let packageSettings = PackageSettings(
// Customize the product types for specific package product
// Default is .staticFramework
productTypes: ["Alamofire": .framework]
// productTypes: [:]
)
#endif
let package = Package(
name: "Playground",
platforms: [.macOS(.v11)],
products: [.library(name: "Playground", targets: ["PlaygroundApp"])],
dependencies: [
// Add your own dependencies here:
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.0.0"),
// You can read more about dependencies here: https://docs.tuist.io/documentation/tuist/dependencies
],
targets: [
.target(name: "PlaygroundApp", dependencies: ["Alamofire"], path: "Playground/Sources/"),
]
)
Thanks!