Skip to content

Commit b44bd87

Browse files
333fredJoeRobich
andauthored
Update src/features/changeForwarding.ts
Co-authored-by: Joey Robichaud <[email protected]>
1 parent e8530f9 commit b44bd87

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/features/changeForwarding.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable {
5050
}
5151

5252
if (changeType === FileChangeType.Change && uri.fsPath.endsWith(".cs")) {
53-
// The server watches for file system events from .cs files, if we send
54-
// a file changed event as well it will cause a double-apply and potentially
55-
// invalidate the file state
53+
// When a file changes on disk a FileSystemEvent is generated as well as
54+
// a DidChangeTextDocumentEvent. The OmniSharp server listens for Change events
55+
// for ".cs" files and reloads their text from disk. This creates a situation where the server
56+
// may have updated the document to reflect disk and also recieves a set of TextChanges
57+
// to apply to the document. In order to avoid that situation, we will not send Change events
58+
// for ".cs" files and instead allow them to be updated via the DidChangeTextDocumentEvent.
5659
return;
5760
}
5861

0 commit comments

Comments
 (0)