478
479
override toJSON(): UriComponents {
480
>
// eslint-disable-next-line local/code-no-dangerous-type-assertions
uri.ts
481
>
const res = <UriState>{
482
>
$mid: MarshalledId.Uri
483
>
};
484
>
// cached state
485
>
if (this._fsPath) {
486
res.fsPath = this._fsPath;
487
res._sep = _pathSepMarker;
488
}
489
>
if (this._formatted) {
uri.ts
490
res.external = this._formatted;
491
}
492
>
//--- uri components
uri.ts
493
>
if (this.path) {
494
>
res.path = this.path;
495
>
}
496
>
// TODO
497
>
// this isn't correct and can violate the UriComponents contract but
498
>
// this is part of the vscode.Uri API and we shouldn't change how that
499
>
// works anymore
500
>
if (this.scheme) {
501
>
res.scheme = this.scheme;
502
>
}
503
>
if (this.authority) {
504
res.authority = this.authority;
505
}
506
>
if (this.query) {
uri.ts
507
res.query = this.query;
508
}
509
>
if (this.fragment) {
uri.ts
510
res.fragment = this.fragment;
511
}
513
>
}
514
}
515