@@ -55,7 +55,7 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable {
5555 }
5656
5757 if ( changeType === FileChangeType . Change ) {
58- const docs = workspace . textDocuments . filter ( doc => doc . uri . fsPath === uri . fsPath ) ;
58+ const docs = workspace . textDocuments . filter ( doc => doc . uri . fsPath === uri . fsPath && isCSharpCodeFile ( doc . uri ) ) ;
5959 if ( Array . isArray ( docs ) && docs . some ( doc => ! doc . isClosed ) ) {
6060 // When a file changes on disk a FileSystemEvent is generated as well as a
6161 // DidChangeTextDocumentEvent.The ordering of these is:
@@ -69,6 +69,8 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable {
6969 // being that the file is now in an inconsistent state.
7070 // If the document is closed, however, it will no longer be synchronized, so the text change will
7171 // not be triggered and we should tell the server to reread from the disk.
72+ // This applies to C# code files only, not other files significant for OmniSharp
73+ // e.g. csproj or editorconfig files
7274 return ;
7375 }
7476 }
@@ -82,6 +84,11 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable {
8284 } ;
8385 }
8486
87+ function isCSharpCodeFile ( uri : Uri ) : Boolean {
88+ const normalized = uri . path . toLocaleLowerCase ( ) ;
89+ return normalized . endsWith ( ".cs" ) || normalized . endsWith ( ".csx" ) || normalized . endsWith ( ".cake" ) ;
90+ }
91+
8592 function onFolderEvent ( changeType : FileChangeType ) : ( uri : Uri ) => void {
8693 return async function ( uri : Uri ) {
8794 if ( ! server . isRunning ( ) ) {
0 commit comments