Skip to content

Commit

Permalink
revert: use workspace.name for single folder projects
Browse files Browse the repository at this point in the history
  • Loading branch information
lfurzewaddock committed Jan 25, 2019
1 parent 7abfdd8 commit a99d9a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "vscode-wsl-workspacefolder",
"displayName": "WSL workspaceFolder",
"description": "Translates `workspaceFolder` path into WSL path format.\n\nUse this where WSL format workspaceFolder path is required, e.g. 'remoteRoot' property in launch config for debug, etc.",
"version": "1.1.1",
"description": "Translates `workspaceFolder` path into WSL path format.\n\nUseful where WSL format workspaceFolder path is required, e.g. for debug 'remoteRoot' property in launch config, etc.",
"version": "1.1.2",
"publisher": "lfurzewaddock",
"icon": "public/assets/images/vscode-wsl-workspacefolder.png",
"galleryBanner": {
Expand Down
3 changes: 2 additions & 1 deletion src/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export function getWorkspaceFolderByName(workspaceFolders, workspaceFolderName)
debug("vscode-wsl-workspacefolder:directory")(
`getWorkspaceFolderByName workspaceFolderName: ${workspaceFolderName}`,
);
return workspaceFolders.find(f => f.name.toLowerCase() === workspaceFolderName).uri.fsPath;
return workspaceFolders.find(f => f.name.toLowerCase() === workspaceFolderName.toLowerCase()).uri
.fsPath;
}
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,18 @@ function activate(context) {
debug("vscode-wsl-workspacefolder:index")(`env.isWin: ${vars.isWin}`);
debug("vscode-wsl-workspacefolder:index")(`env.isWsl: ${vars.isWsl}`);
debug("vscode-wsl-workspacefolder:index")(`env.isExtensionDebug: ${vars.isExtensionDebug}`);
window.showInformationMessage(`env.isLinux: ${vars.isLinux}`);
window.showInformationMessage(`env.isWin: ${vars.isWin}`);
window.showInformationMessage(`env.isWsl: ${vars.isWsl}`);
window.showInformationMessage(`env.isExtensionDebug: ${vars.isExtensionDebug}`);
// window.showInformationMessage(`env.isLinux: ${vars.isLinux}`);
// window.showInformationMessage(`env.isWin: ${vars.isWin}`);
// window.showInformationMessage(`env.isWsl: ${vars.isWsl}`);
// window.showInformationMessage(`env.isExtensionDebug: ${vars.isExtensionDebug}`);

const { workspaceFolders } = workspace;
let workspaceName = args[0].name.toLowerCase();
let workspaceName = (Array.isArray(workspaceFolders) && workspaceFolders.length > 1)
? args[0].name
: workspace.name;

if (
typeof workspaceFolders.find(x => x.name.toLowerCase() === workspaceName) === "undefined"
typeof workspaceFolders.find(x => x.name.toLowerCase() === workspaceName.toLowerCase()) === "undefined"
) {
try {
workspaceName = await getWorkspaceFolderName();
Expand Down

0 comments on commit a99d9a5

Please sign in to comment.