Still can't get sourcekit-lsp to work in VSCode

I am using:
Xcode Version 12.0.1 (12A7300)
Command Line Tools installed

VSCode settings:
Path to executable:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp

Toolchain path: blank

  1. Cleaned project
  2. swift build
  3. Closed folder and re-opened

Modules are still not found. Also modules that are found have no hovering, code completion etc,

Is it time to start over with sourcekit-lsp?????

You need to build and install the SourceKit-LSP extension for VSCode.

Are you able to share a project that shows the issues you are seeing?

Attachment available until Nov 20, 2020

Was there supposed to be an attachment somewhere? I'm not seeing one.

I tried to send through mail drop. However, I couldn’t do that because I haven’t set up an iCloud email account. I couldn’t do that because I couldn’t turn it on via my iCloud account because very time I tried to see up the account it just kept asking me to create the account and then I would and then it just repeated the prompt over and over and over again. So I have no clue why I cannot use mail drop. Any suggestions for a third party service for a 94mb file?

Attachment available until Nov 20, 2020

Hi Ben,

Did you get my attachment?

Bruce

No, sorry. If you are trying to do it via email, it is probably not supported by discourse. Is there a download link? If you have an apple developer account, another option would be to file a bug to feedbackassisant.apple.com.

Try this.

https://www.icloud.com/iclouddrive/0vBRHSLCG_0_rNgI3cu2CWVYw#TestKituraCLI

That worked, thanks!

SourceKit-LSP supports Swift Packages, but does not support getting compiler arguments from Xcode projects. Looking at the attached project, it contains both a Package.swift and an Xcode project. However, they are not setup to build from the same source files. So when you open one of the files that is part of the Xcode project, but not part of the package, it will not find modules correctly.

Package.swift:

        .target(
            name: "TestKituraCLI",
            dependencies: [ ... ]),

This target is using the following source code, which only contains a single print statement.

Sources/
  TestKituraCLI/
    main.swift

Whereas the Xcode project has a target named TestKituraCLI that uses the following sources (which look like the "real" source code):

TestKituraCLI/
  main.swift
  Sources/
    Scaffolder.swift
    Utilities.swift

If I rearrange the code like this to match what SwiftPM expects, it works with sourcekit-lsp.

Sources/
  TestKituraCLI/
    main.swift
    Scaffolder.swift
    Utilities.swift

If you go that route, I suggest changing it from within Xcode so that both the package and xcodeproj stay in sync about the directories.

OK… I will give that a try. I am trying to use VSCode for all of my coding. I am hoping the tooling keeps getting better and better for Swift.
BTW, I just got an email from Kite.com. I was wondering if it would be a possibility of working with them to support the Swift language.

https://www.kite.com/blog/product/announcing-11-new-programming-languages-and-kite-team-server/

Thanks for you help

Bruce