Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unneeded URI conversion #13415

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading