It ought to work if you build. We recently fixed an issue like this on master, so if you were using an older toolchain please try updating. If that doesn’t help, please file a bug on bugs.swift.org and mention which toolchain you’re using.
in my case I'm moving classes and structs to new location (new file) for example Class Foo is moved from Foo.swift to Zoo.swift
in this case after swift build, I'll still get use of unresolved identifier
Swift version:
Swift version 5.1 (swift-5.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Got it. This is about updating our compiler arguments we get from swiftpm for the live ASTs, not about the index updating. There has been some recent work to setup the APIs needed to update the settings inside SourceKit-LSP. SwiftPM itself doesn't currently expose an API to watch for all the relevant changes. There is support for file watching (FSWatch) that is used by the workspace for watching for Package.resolved changes. We want to do something similar, but watching for new/removed files in the target source directories as well as watching for modifications to the Package.swift file itself.
We're not subscribing for those notifications right now, and I'm not sure what (if anything) we should use it for. There's no guarantee that the client will provide it, so we need a solution on our side anyway, and there is no way to watch files outside the workspace. I don't think we could rely on it to watch files in the build directory, for example.
I have used the vscode fileWatcher on Package.swift to invalidate all the Task promices.
we can add fileWatcher on Sources in vscode extension and send didChangeWatchedFiles notification ?
I'm using it for the vscode task to run list which is kind of client-side feature of vs. also the Package.swift watcher is only for to flush out tasks.