From 32bd7fd3eed5dfdc41c2dd34cd0799a9eb6d906f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 17 Mar 2016 10:43:28 +0100 Subject: [PATCH] setup uri properly and also make the doc more clear, fixes #4315 --- extensions/typescript/src/utils/projectStatus.ts | 4 ++-- src/vs/vscode.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/typescript/src/utils/projectStatus.ts b/extensions/typescript/src/utils/projectStatus.ts index cbca9fdec49..41edf0dd7db 100644 --- a/extensions/typescript/src/utils/projectStatus.ts +++ b/extensions/typescript/src/utils/projectStatus.ts @@ -8,7 +8,7 @@ import * as vscode from 'vscode'; import {ITypescriptServiceClient} from '../typescriptService'; import {loadMessageBundle} from 'vscode-nls'; -import {dirname} from 'path'; +import {dirname, join} from 'path'; const localize = loadMessageBundle(); const selector = ['javascript', 'javascriptreact']; @@ -88,7 +88,7 @@ export function create(client: ITypescriptServiceClient, memento: vscode.Memento projectHinted[configFileName] = true; item.hide(); - return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled://' + vscode.workspace.rootPath + '/jsconfig.json')) + return vscode.workspace.openTextDocument(vscode.Uri.parse('untitled:' + join(vscode.workspace.rootPath, 'jsconfig.json'))) .then(vscode.window.showTextDocument) .then(editor => editor.edit(builder => builder.insert(new vscode.Position(0, 0), defaultConfig))); } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index d36a74ab188..8f3f883a06c 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -3213,8 +3213,8 @@ declare namespace vscode { * [open document](#workspace.onDidOpenTextDocument)-event fires. * The document to open is denoted by the [uri](#Uri). Two schemes are supported: * - * file: A file on disk, will be rejected if the file does not exist or cannot be loaded, e.g. 'file:///Users/frodo/r.ini'. - * untitled: A new file that should be saved on disk, e.g. 'untitled:/Users/frodo/new.js'. The language will be derived from the file name. + * file: A file on disk, will be rejected if the file does not exist or cannot be loaded, e.g. `file:///Users/frodo/r.ini`. + * untitled: A new file that should be saved on disk, e.g. `untitled:c:\frodo\new.js`. The language will be derived from the file name. * * Uris with other schemes will make this method return a rejected promise. *