swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
713 stars 47 forks source link

Warning complaining about compiler arguments not found keep popping up #719

Closed chawyehsu closed 4 months ago

chawyehsu commented 4 months ago

Describe the bug

image Text: Failed to get compiler arguments for Package.swift. Ensure the source file is part of a Swift package or has compiler arguments in compile_commands.json. Functionality will be limited.

To Reproduce Steps to reproduce the behavior:

  1. Open a project and the warning will pop up

I tested with boilerplate project by swift package init --type executable, the warning is still there so I believe it's not something wrong with my working codebase.

Expected behavior

No warning

Environment

Additional context

I found everytime I break the sourcekit-lsp, it restarts and the warning will pop up again a time for every .swift file I open, which is so annoying. :-[

chawyehsu commented 4 months ago

Perhaps this should be reported to the sourcekit-lsp repo: https://github.com/apple/sourcekit-lsp/blob/f7f2cea7c51f5e9ac4468fe9f3aacc306bb254de/Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift#L366-L374

adam-fowler commented 4 months ago

This is a sourcekit-lsp issue. Please add a bug there