uri - remove strict mode, use file when scheme is missing

This commit is contained in:
Johannes Rieken
2019-10-18 12:37:25 +02:00
parent 259b7bfb8a
commit 2c1c691b06
5 changed files with 24 additions and 49 deletions

View File

@@ -255,12 +255,12 @@ export namespace MarkdownString {
}
// extract uris into a separate object
const resUris: { [href: string]: UriComponents } = Object.create(null);
const resUris: { [href: string]: UriComponents; } = Object.create(null);
res.uris = resUris;
const collectUri = (href: string): string => {
try {
let uri = URI.parse(href, true);
let uri = URI.parse(href);
uri = uri.with({ query: _uriMassage(uri.query, resUris) });
resUris[href] = uri;
} catch (e) {
@@ -277,7 +277,7 @@ export namespace MarkdownString {
return res;
}
function _uriMassage(part: string, bucket: { [n: string]: UriComponents }): string {
function _uriMassage(part: string, bucket: { [n: string]: UriComponents; }): string {
if (!part) {
return part;
}
@@ -513,7 +513,7 @@ export namespace WorkspaceEdit {
export namespace SymbolKind {
const _fromMapping: { [kind: number]: modes.SymbolKind } = Object.create(null);
const _fromMapping: { [kind: number]: modes.SymbolKind; } = Object.create(null);
_fromMapping[types.SymbolKind.File] = modes.SymbolKind.File;
_fromMapping[types.SymbolKind.Module] = modes.SymbolKind.Module;
_fromMapping[types.SymbolKind.Namespace] = modes.SymbolKind.Namespace;
@@ -903,7 +903,7 @@ export namespace DocumentLink {
let target: URI | undefined = undefined;
if (link.url) {
try {
target = typeof link.url === 'string' ? URI.parse(link.url, true) : URI.revive(link.url);
target = typeof link.url === 'string' ? URI.parse(link.url) : URI.revive(link.url);
} catch (err) {
// ignore
}