Clean query paramters from ext name

This commit is contained in:
Logan Ramos 2021-07-14 09:31:29 -04:00
parent 549404bbee
commit 66f8cd1f65
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183
2 changed files with 9 additions and 2 deletions

View file

@ -607,7 +607,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
const resource = EditorResourceAccessor.getOriginalUri(editor);
const path = resource ? resource.scheme === Schemas.file ? resource.fsPath : resource.path : undefined;
if (resource && path) {
descriptor['resource'] = { mimeType: guessMimeTypes(resource).join(', '), scheme: resource.scheme, ext: extname(resource), path: hash(path) };
let resourceExt = extname(resource);
// Remove query paramaters from the resource extension
const queryStringLocation = resourceExt.indexOf('?');
resourceExt = queryStringLocation !== -1 ? resourceExt.substr(0, queryStringLocation) : resourceExt;
descriptor['resource'] = { mimeType: guessMimeTypes(resource).join(', '), scheme: resource.scheme, ext: resourceExt, path: hash(path) };
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {

View file

@ -194,7 +194,10 @@ export class TelemetryContribution extends Disposable implements IWorkbenchContr
}
private getTelemetryData(resource: URI, reason?: number): TelemetryData {
const ext = extname(resource);
let ext = extname(resource);
// Remove query paramaters from the resource extension
const queryStringLocation = ext.indexOf('?');
ext = queryStringLocation !== -1 ? ext.substr(0, queryStringLocation) : ext;
const fileName = basename(resource);
const path = resource.scheme === Schemas.file ? resource.fsPath : resource.path;
const telemetryData = {