mainActor isolation in sourcekit-lsp

I’ve been trying to do some SwiftUI development with Visual Studio Code and it has been a surprisingly pleasant experience. It was all going well until I upped the target to Swift 6.0 in my project. Although my project builds and runs fine, the LSP seems to be stuck on a default of defaultActorIsolation of mainActor, which is creating lots of spurious errors. I can’t for the life of me make the LSP understand that it should use nonisolated. Is it even possible to change this setting? I tried

```
"swift.sourcekit-lsp.serverArguments": [

"-Xswiftc",

"-default-isolation",

"-Xswiftc",

"nonisolated"]
```

in settings.json, no effect. Similar story in buildServer.json. Nothing seems to help. Any ideas?

Where are you setting nonisolated in the project and what kind of project is this? If BSP is being used (which I assume is the case from buildServer.json), then the expectation is that it would now be passing the correct arguments (ie. -default-isolation nonisolated) through to sourcekit-lsp and if it isn’t, that’s likely an issue with the BSP.

If you could take a sourcekit-lsp diagnose (preferably with extended logging enabled) and file an issue on sourcekit-lsp, we can look into it further.

Unfortunately I couldn’t reproduce it consistently. The one thing I did notice, or rather Claude did was that the compilation db was not being built consistently, which explained some strange errors I was getting from SourceKit such as it not being able to find the GRDB package even though the app itself built fine. In the end, although I was convinced you couldn’t use SwiftPM for some reason to build a SwiftUI app, it’s actually fine and everything works (at least on MacOS) as expected and is a lot less fiddly than going through Build Server.,