Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

@@ -12,7 +12,6 @@ import { IRange } from 'vs/editor/common/core/range';
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { Schemas } from 'vs/base/common/network';
import { isUri } from 'vs/workbench/contrib/debug/common/debugUtils';
import { ITextEditor } from 'vs/workbench/common/editor';
export const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source");
@@ -26,6 +25,7 @@ export const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Sourc
* | | | |
* scheme source.path session id source.reference
*
* the arbitrary_path and the session id are encoded with 'encodeURIComponent'
*
*/
@@ -48,11 +48,7 @@ export class Source {
}
if (typeof this.raw.sourceReference === 'number' && this.raw.sourceReference > 0) {
this.uri = uri.from({
scheme: DEBUG_SCHEME,
path,
query: `session=${sessionId}&ref=${this.raw.sourceReference}`
});
this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}&ref=${this.raw.sourceReference}`);
} else {
if (isUri(path)) { // path looks like a uri
this.uri = uri.parse(path);
@@ -63,11 +59,7 @@ export class Source {
} else {
// path is relative: since VS Code cannot deal with this by itself
// create a debug url that will result in a DAP 'source' request when the url is resolved.
this.uri = uri.from({
scheme: DEBUG_SCHEME,
path,
query: `session=${sessionId}`
});
this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}`);
}
}
}
@@ -93,13 +85,14 @@ export class Source {
return this.uri.scheme === DEBUG_SCHEME;
}
openInEditor(editorService: IEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<ITextEditor | null> {
openInEditor(editorService: IEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<any> {
return !this.available ? Promise.resolve(null) : editorService.openEditor({
resource: this.uri,
description: this.origin,
options: {
preserveFocus,
selection,
revealIfVisible: true,
revealIfOpened: true,
revealInCenterIfOutsideViewport: true,
pinned: pinned || (!preserveFocus && !this.inMemory)
@@ -125,7 +118,7 @@ export class Source {
if (pair.length === 2) {
switch (pair[0]) {
case 'session':
sessionId = pair[1];
sessionId = decodeURIComponent(pair[1]);
break;
case 'ref':
sourceReference = parseInt(pair[1]);