Skip to content

Commit e8530f9

Browse files
committed
Do not send file changed events for .cs files
Similar to the rename and codeAction change, this can cause incremental updates to break if the file is updated on disk (not by a vscode edit).
1 parent 0201fb5 commit e8530f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/features/changeForwarding.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable {
4949
return;
5050
}
5151

52+
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
56+
return;
57+
}
58+
5259
let req = { FileName: uri.fsPath, changeType };
5360

5461
serverUtils.filesChanged(server, [req]).catch(err => {

0 commit comments

Comments
 (0)