Skip to content

Commit

Permalink
Fix unneeded URI conversion (#13415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Taran authored Mar 4, 2024
1 parent 8b00354 commit a9fb309
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/browser/decorations-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DecorationProviderWrapper {
this.data.clear();
} else {
for (const uri of uris) {
this.fetchData(new URI(uri.toString()));
this.fetchData(uri);
const decoration = await provider.provideDecorations(uri, CancellationToken.None);
if (decoration) {
this.decorations.set(uri.toString(), decoration);
Expand Down Expand Up @@ -131,14 +131,14 @@ class DecorationProviderWrapper {
private fetchData(uri: URI): Decoration | undefined {

// check for pending request and cancel it
const pendingRequest = this.data.get(new URI(uri.toString()));
const pendingRequest = this.data.get(uri);
if (pendingRequest instanceof DecorationDataRequest) {
pendingRequest.source.cancel();
this.data.delete(uri);
}

const source = new CancellationTokenSource();
const dataOrThenable = this.provider.provideDecorations(new URI(uri.toString()), source.token);
const dataOrThenable = this.provider.provideDecorations(uri, source.token);
if (!isThenable<Decoration | Promise<Decoration | undefined> | undefined>(dataOrThenable)) {
// sync -> we have a result now
return this.keepItem(uri, dataOrThenable);
Expand Down Expand Up @@ -197,7 +197,7 @@ export class DecorationsServiceImpl implements DecorationsService {
const data: Decoration[] = [];
let containsChildren: boolean = false;
for (const wrapper of this.data) {
wrapper.getOrRetrieve(new URI(uri.toString()), includeChildren, (deco, isChild) => {
wrapper.getOrRetrieve(uri, includeChildren, (deco, isChild) => {
if (!isChild || deco.bubble) {
data.push(deco);
containsChildren = isChild || containsChildren;
Expand Down

0 comments on commit a9fb309

Please sign in to comment.