Skip to content

Swift scripts update errors and warnings only after running #1908

@F1248

Description

@F1248

Describe the bug

Starting with version 2.4.0, warnings and errors in Swift scripts (standalone files) only update after running the Swift: Run Swift Script command but not after the file is modified or saved. In version 2.2.0, they update immediately when the file is modified.

To Reproduce

  1. Create a new file Test.swift
  2. Write some Swift code to the file that produces an error or warning, then save the file
let x: Int = "" // expected error: `Cannot convert value of type 'String' to specified type 'Int'`
  1. The error only appears after running Swift: Run Swift Script
  2. Replace "" with 0, then save the file again
  3. The error only disappears after running Swift: Run Swift Script again

Environment

  • OS: macOS Tahoe 26.0.1 (25A362)
  • Swift version: swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
  • Visual Studio Code version: 1.105.1
  • vscode-swift version: 2.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Unscreened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions