mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
debt - remove obsolete URI casts
This commit is contained in:
parent
e96a35fa05
commit
12439dfbb6
|
@ -243,7 +243,7 @@ export class MainThreadEditors implements MainThreadEditorsShape {
|
|||
const edit = edits[j];
|
||||
|
||||
resourceEdits.push({
|
||||
resource: <URI>uri,
|
||||
resource: uri,
|
||||
newText: edit.newText,
|
||||
newEol: edit.newEol,
|
||||
range: edit.range
|
||||
|
|
|
@ -453,7 +453,7 @@ export function createApiFactory(
|
|||
if (typeof uriOrFileNameOrOptions === 'string') {
|
||||
uriPromise = TPromise.as(URI.file(uriOrFileNameOrOptions));
|
||||
} else if (uriOrFileNameOrOptions instanceof URI) {
|
||||
uriPromise = TPromise.as(<URI>uriOrFileNameOrOptions);
|
||||
uriPromise = TPromise.as(uriOrFileNameOrOptions);
|
||||
} else if (!options || typeof options === 'object') {
|
||||
uriPromise = extHostDocuments.createDocumentData(options);
|
||||
} else {
|
||||
|
@ -486,7 +486,7 @@ export function createApiFactory(
|
|||
return extHostConfiguration.onDidChangeConfiguration(listener, thisArgs, disposables);
|
||||
},
|
||||
getConfiguration: (section?: string, resource?: vscode.Uri): vscode.WorkspaceConfiguration => {
|
||||
return extHostConfiguration.getConfiguration(section, <URI>resource);
|
||||
return extHostConfiguration.getConfiguration(section, resource);
|
||||
},
|
||||
registerTextDocumentContentProvider(scheme: string, provider: vscode.TextDocumentContentProvider) {
|
||||
return extHostDocumentContentProviders.registerTextDocumentContentProvider(scheme, provider);
|
||||
|
|
|
@ -95,11 +95,11 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
|
|||
}
|
||||
|
||||
public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> {
|
||||
return this._debugServiceProxy.$startDebugging(folder ? <URI>folder.uri : undefined, nameOrConfig);
|
||||
return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig);
|
||||
}
|
||||
|
||||
public startDebugSession(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration): TPromise<vscode.DebugSession> {
|
||||
return this._debugServiceProxy.$startDebugSession(folder ? <URI>folder.uri : undefined, config).then((id: DebugSessionUUID) => {
|
||||
return this._debugServiceProxy.$startDebugSession(folder ? folder.uri : undefined, config).then((id: DebugSessionUUID) => {
|
||||
const debugSession = new ExtHostDebugSession(this._debugServiceProxy, id, config.type, config.name);
|
||||
this._debugSessions.set(id, debugSession);
|
||||
return debugSession;
|
||||
|
|
|
@ -133,7 +133,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
|||
}
|
||||
}
|
||||
|
||||
entries.push([<URI>uri, marker]);
|
||||
entries.push([uri, marker]);
|
||||
}
|
||||
|
||||
this._proxy.$changeMany(this.name, entries);
|
||||
|
@ -142,7 +142,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
|||
delete(uri: vscode.Uri): void {
|
||||
this._checkDisposed();
|
||||
this._data.delete(uri.toString());
|
||||
this._proxy.$changeMany(this.name, [[<URI>uri, undefined]]);
|
||||
this._proxy.$changeMany(this.name, [[uri, undefined]]);
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
|
|
|
@ -47,7 +47,7 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
|
|||
if (typeof provider.onDidChange === 'function') {
|
||||
subscription = provider.onDidChange(uri => {
|
||||
if (this._documentsAndEditors.getDocument(uri.toString())) {
|
||||
this.$provideTextDocumentContent(handle, <URI>uri).then(value => {
|
||||
this.$provideTextDocumentContent(handle, uri).then(value => {
|
||||
|
||||
const document = this._documentsAndEditors.getDocument(uri.toString());
|
||||
if (!document) {
|
||||
|
@ -60,7 +60,7 @@ export class ExtHostDocumentContentProvider implements ExtHostDocumentContentPro
|
|||
|
||||
// broadcast event when content changed
|
||||
if (!document.equalLines(textSource)) {
|
||||
return this._proxy.$onVirtualDocumentChange(<URI>uri, textSource);
|
||||
return this._proxy.$onVirtualDocumentChange(uri, textSource);
|
||||
}
|
||||
|
||||
}, onUnexpectedError);
|
||||
|
|
|
@ -129,7 +129,7 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
|
|||
}).then(values => {
|
||||
|
||||
let workspaceResourceEdit: IWorkspaceResourceEdit = {
|
||||
resource: <URI>document.uri,
|
||||
resource: document.uri,
|
||||
edits: []
|
||||
};
|
||||
|
||||
|
|
|
@ -437,7 +437,7 @@ class RenameAdapter {
|
|||
let [uri, textEdits] = entry;
|
||||
for (let textEdit of textEdits) {
|
||||
result.edits.push({
|
||||
resource: <URI>uri,
|
||||
resource: uri,
|
||||
newText: textEdit.newText,
|
||||
range: TypeConverters.fromRange(textEdit.range)
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { toThenable } from 'vs/base/common/async';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
@ -77,7 +76,7 @@ export class ExtHostEditors implements ExtHostEditorsShape {
|
|||
};
|
||||
}
|
||||
|
||||
return this._proxy.$tryShowTextDocument(<URI>document.uri, options).then(id => {
|
||||
return this._proxy.$tryShowTextDocument(document.uri, options).then(id => {
|
||||
let editor = this._extHostDocumentsAndEditors.getEditor(id);
|
||||
if (editor) {
|
||||
return editor;
|
||||
|
@ -106,7 +105,7 @@ export class ExtHostEditors implements ExtHostEditorsShape {
|
|||
}
|
||||
|
||||
let workspaceResourceEdit: IWorkspaceResourceEdit = {
|
||||
resource: <URI>uri,
|
||||
resource: uri,
|
||||
modelVersionId: docVersion,
|
||||
edits: []
|
||||
};
|
||||
|
|
|
@ -284,7 +284,7 @@ export const location = {
|
|||
from(value: vscode.Location): modes.Location {
|
||||
return {
|
||||
range: value.range && fromRange(value.range),
|
||||
uri: <URI>value.uri
|
||||
uri: value.uri
|
||||
};
|
||||
},
|
||||
to(value: modes.Location): types.Location {
|
||||
|
|
|
@ -794,7 +794,7 @@ export class SymbolInformation {
|
|||
if (locationOrUri instanceof Location) {
|
||||
this.location = locationOrUri;
|
||||
} else if (rangeOrContainer instanceof Range) {
|
||||
this.location = new Location(<URI>locationOrUri, rangeOrContainer);
|
||||
this.location = new Location(locationOrUri, rangeOrContainer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue