Skip to content

Commit 14f30f4

Browse files
authored
fix(remoteFileSystemProvider): robust project name parsing for special characters (#284)
1 parent 464c78e commit 14f30f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/projectManagerProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class ProjectManagerProvider implements vscode.TreeDataProvider<DataItem>
128128
// get project items
129129
const normalProjects = [], trashedProjects = [], archivedProjects = [];
130130
for (const project of projects) {
131-
const uri = `${ROOT_NAME}://${element.name}/${project.name}?user=${project.userId}&project=${project.id}`;
131+
const uri = `${ROOT_NAME}://${element.name}/${encodeURIComponent(project.name)}?user=${project.userId}&project=${project.id}`;
132132
const status = project.archived ? 'archived' : project.trashed ? 'trashed' : 'normal';
133133
const item = new ProjectItem(element.api, uri, element, project.id, project.name, status);
134134
switch (status) {

src/core/remoteFileSystemProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function parseUri(uri: vscode.Uri) {
100100
const [userId, projectId] = [query.user, query.project];
101101
const _pathParts = uri.path.split('/');
102102
const serverName = uri.authority;
103-
const projectName = _pathParts[1];
103+
const projectName = decodeURIComponent(_pathParts[1]);
104104
const pathParts = _pathParts.splice(2);
105105
const identifier = `${userId}/${projectId}/${projectName}`;
106106
return {userId, projectId, serverName, projectName, identifier, pathParts};

0 commit comments

Comments
 (0)