I have just installed the latest 5.01 toolchain release on Ubuntu 18.04 and I'm trying to setup a development environment in Visual Studio Code. I successfully built sourcekit-lsp and the visual studio code extension. I then created a Hello World package using swift package init
to create a blank library and made no changes to it. However, when I open a file in VSCode, all imported modules are in red squiggles saying "no such module". This includes PackageDescription
in my package.swift. However, the package builds just fine. Here is the output log:
2019-06-13 21:28:02.607 sourcekit-lsp[68996:c8c92700] manifest parse error(s):
<unknown>:0: error: unknown argument: '-package-description-version'
manifest parse error(s):
<unknown>:0: error: unknown argument: '-package-description-version'
2019-06-13 21:28:02.619 sourcekit-lsp[68996:c8c92700] failed to create SwiftPMWorkspace: the package does not contain a buildable target
failed to create SwiftPMWorkspace: the package does not contain a buildable target
2019-06-13 21:28:02.628 sourcekit-lsp[68996:c8c92700] could not open compilation database for /home/alex/swift-projects/HelloWorld/Package.swift
could not open compilation database for /home/alex/swift-projects/HelloWorld/Package.swift
2019-06-13 21:28:02.678 sourcekit-lsp[68996:c8c92700] could not open compilation database for /home/alex/swift-projects/HelloWorld/Package.swift
could not open compilation database for /home/alex/swift-projects/HelloWorld/Package.swift
Why does it complain that there's no buildable target even though the package builds just fine? And what about the other errors in the log? Please let me know if anyone has advice or is able to reproduce this issue!