mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
allow empty string as valid document content, fixes #6526
This commit is contained in:
@@ -631,7 +631,7 @@ export class MainThreadDocuments {
|
||||
this._resourceContentProvider[handle] = ResourceEditorInput.registerResourceContentProvider(scheme, {
|
||||
provideTextContent: (uri: URI): TPromise<EditorCommon.IModel> => {
|
||||
return this._proxy.$provideTextDocumentContent(handle, uri).then(value => {
|
||||
if (value) {
|
||||
if (typeof value === 'string') {
|
||||
this._virtualDocumentSet[uri.toString()] = true;
|
||||
const firstLineText = value.substr(0, 1 + value.search(/\r?\n/));
|
||||
const mode = this._modeService.getOrCreateModeByFilenameOrFirstLine(uri.fsPath, firstLineText);
|
||||
|
||||
Reference in New Issue
Block a user