diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index c419713c90a..b7c67664cb7 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -101,7 +101,9 @@ declare module 'vscode' { readonly fileName: string; /** - * Is this document representing an untitled file. + * Is this document representing an untitled file which has never been saved yet. *Note* that + * this does not mean the document will be saved to disk, use [`uri.scheme`](#Uri.scheme) + * to figure out where a document will be [saved](#FileSystemProvider), e.g. `file`, `ftp` etc. */ readonly isUntitled: boolean; diff --git a/src/vs/workbench/api/node/extHostDocumentData.ts b/src/vs/workbench/api/node/extHostDocumentData.ts index d42afcf7ba0..2eeef2a7d5f 100644 --- a/src/vs/workbench/api/node/extHostDocumentData.ts +++ b/src/vs/workbench/api/node/extHostDocumentData.ts @@ -13,6 +13,7 @@ import * as vscode from 'vscode'; import { getWordAtText, ensureValidWordDefinition } from 'vs/editor/common/model/wordHelper'; import { MainThreadDocumentsShape } from './extHost.protocol'; import { TPromise } from 'vs/base/common/winjs.base'; +import { Schemas } from 'vs/base/common/network'; const _modeId2WordDefinition = new Map(); export function setWordDefinitionFor(modeId: string, wordDefinition: RegExp): void { @@ -68,8 +69,7 @@ export class ExtHostDocumentData extends MirrorTextModel { this._document = { get uri() { return data._uri; }, get fileName() { return data._uri.fsPath; }, - // todo@remote -> https://github.com/Microsoft/vscode/issues/48269 - get isUntitled() { return data._uri.scheme !== 'file'; }, + get isUntitled() { return data._uri.scheme === Schemas.untitled; }, get languageId() { return data._languageId; }, get version() { return data._versionId; }, get isClosed() { return data._isDisposed; },