Skip to content

Commit

Permalink
Prevent failure of DocumentContentSynchronizer.<init> (#841)
Browse files Browse the repository at this point in the history
Prevent failure of DocumentContentSynchronizer.<init> if the document
does not have an URI registered in EFS and it is not a file uri.

Also improve the existing log to include the URI that we are failing to
deal with.
  • Loading branch information
rubenporras committed Oct 9, 2023
1 parent 51e5806 commit 0e73a30
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ public DocumentContentSynchronizer(@NonNull LanguageServerWrapper languageServer
IFileStore store = EFS.getStore(fileUri);
this.openSaveStamp = store.fetchInfo().getLastModified();
} catch (CoreException e) {
LanguageServerPlugin.logError(e);
this.openSaveStamp = new File(fileUri).lastModified();
try {
this.openSaveStamp = new File(fileUri).lastModified();
} catch (IllegalArgumentException iae) {
this.openSaveStamp = 0L;
}
}
this.syncKind = syncKind != null ? syncKind : TextDocumentSyncKind.Full;

Expand Down

0 comments on commit 0e73a30

Please sign in to comment.