Skip to content

Commit 04f2a74

Browse files
fix #104698 Make query element of uri survive conflict resolution massaging (#104699)
* fix #104698 Make query element of uri survive conflict resolution massaging * Incorporate PR feedback * Simplify * Event simpler, and with comments * Variant preferred by @bpasero
1 parent 6344d2f commit 04f2a74

File tree

1 file changed

+3
-2
lines changed
  • src/vs/workbench/contrib/files/common

1 file changed

+3
-2
lines changed

src/vs/workbench/contrib/files/common/files.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ export class TextFileContentProvider extends Disposable implements ITextModelCon
164164
}
165165

166166
private static resourceToTextFile(scheme: string, resource: URI): URI {
167-
return resource.with({ scheme, query: JSON.stringify({ scheme: resource.scheme }) });
167+
return resource.with({ scheme, query: JSON.stringify({ scheme: resource.scheme, query: resource.query }) });
168168
}
169169

170170
private static textFileToResource(resource: URI): URI {
171-
return resource.with({ scheme: JSON.parse(resource.query)['scheme'], query: null });
171+
const { scheme, query } = JSON.parse(resource.query);
172+
return resource.with({ scheme, query });
172173
}
173174

174175
async provideTextContent(resource: URI): Promise<ITextModel> {

0 commit comments

Comments
 (0)