Skip to content

Commit ec235df

Browse files
authored
Merge pull request #1755 from ahoppen/shorter-diags-debounce-duration
Reduce the debounce duration to publish diagnostics to 1s
2 parents 213b62f + 38ac399 commit ec235df

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Documentation/Configuration File.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ The structure of the file is currently not guaranteed to be stable. Options may
4747
- `backgroundPreparationMode: "build"|"noLazy"|"enabled"`: Determines how background indexing should prepare a target. Possible values are: `build`: Build a target to prepare it, `noLazy`: Prepare a target without generating object files but do not do lazy type checking and function body skipping, `enabled`: Prepare a target without generating object files and the like
4848
- `cancelTextDocumentRequestsOnEditAndClose: bool`: Whether sending a `textDocument/didChange` or `textDocument/didClose` notification for a document should cancel all pending requests for that document.
4949
- `experimentalFeatures: string[]`: Experimental features to enable
50-
- `swiftPublishDiagnosticsDebounce`: The time that `SwiftLanguageService` should wait after an edit before starting to compute diagnostics and sending a `PublishDiagnosticsNotification`.
50+
- `swiftPublishDiagnosticsDebounce: double`: The time that `SwiftLanguageService` should wait after an edit before starting to compute diagnostics and sending a `PublishDiagnosticsNotification`.

Sources/SKOptions/SourceKitLSPOptions.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,13 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
297297

298298
/// The time that `SwiftLanguageService` should wait after an edit before starting to compute diagnostics and
299299
/// sending a `PublishDiagnosticsNotification`.
300-
///
301-
/// This is mostly intended for testing purposes so we don't need to wait the debouncing time to get a diagnostics
302-
/// notification when running unit tests.
303300
public var swiftPublishDiagnosticsDebounceDuration: Double? = nil
304301

305302
public var swiftPublishDiagnosticsDebounceDurationOrDefault: Duration {
306303
if let swiftPublishDiagnosticsDebounceDuration {
307304
return .seconds(swiftPublishDiagnosticsDebounceDuration)
308305
}
309-
return .seconds(2)
306+
return .seconds(1)
310307
}
311308

312309
/// When a task is started that should be displayed to the client as a work done progress, how many milliseconds to

0 commit comments

Comments
 (0)