Skip to content

Swift scripts in VSC update errors and warnings only after running #2356

@F1248

Description

@F1248

I was asked to move swiftlang/vscode-swift#1908 here.

Swift version

swiftlang-6.2.3.3.2

Platform

macOS Tahoe 26.1 (25B78)

Editor

Visual Studio Code 1.106.0 with Swift extension 2.12.0

Description

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.

Steps 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions