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

Project manager can't create projects.json file on the default path #178

Closed
Kurolox opened this issue Apr 20, 2018 · 8 comments
Closed

Project manager can't create projects.json file on the default path #178

Kurolox opened this issue Apr 20, 2018 · 8 comments
Labels
enhancement need more info OSS VS Code version built from source

Comments

@Kurolox
Copy link
Contributor

Kurolox commented Apr 20, 2018

Basically, this extension has been unable to create the json file on it's own, probably due to a lack of permissions or an incorrect default path. Changing projectManager.projectsLocation to a valid path where the user has read and write permissions solves the issue on my system, but it would be nice if it worked out of the box. Otherwise, the extension won't work since it's unable to save projects.

Some info about the system.

  • VSCode version:
Commit 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9
Date 2018-04-16T09:43:25.785Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
  • Project manager version: 0.25.0
  • Operating System: Arch Linux
  • uname -a output: Linux Horus 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64 GNU/Linux
@alefragnani
Copy link
Owner

Hi @Kurolox ,

The extension saves the projects in User's AppData folder. This is the same place where VS Code store its settings and keybindings files.

In the early days, it was using /usr/local/Code/User, which caused permission issues. Then, in #16 a user pointed me out to /home/username/.config/Code/User, I made the fix and no related issue has been recorded since then.

Could you give me more information about your scenario? Does Arch Linux store user's files in different places, or is something else about permissions? Could you check where VS Code store its settings and keybindings files?

Thanks in advance

@Kurolox
Copy link
Contributor Author

Kurolox commented Apr 23, 2018

I think I see the issue here.

So, in Arch Linux we have two Code packages in our user-contributed repositories. The one I've installed, code-git, fetches the source and compiles it on my machine. It seems like it's storing all the data in /home/username/.config/Code - OSS, so when the extension tries to create it's files, it fails because the folder Code doesn't exist on .config.

I can't confirm if the other package has the same issue and stores it on a different location. However, I'll try to get in contact with the package maintainer and see if they can change the folder path on their side, since I believe it's their issue for using a different path.

@Kurolox
Copy link
Contributor Author

Kurolox commented Apr 23, 2018

It seems like both versions of the package are maintained by the same guy, so I assume that both are using the same non-default path. I've sent him a message asking if he could change the path to the default one, and I'm awaiting a response.

@alefragnani
Copy link
Owner

Well, maybe I could help with it.

To decide the correct folder to store the files, I check for vscode.env.appName attribute, with this naïve piece of code:

    function getChannelPath(): string {
        if (vscode.env.appName.indexOf("Insiders") > 0) {
            return "Code - Insiders";
        } else {
            return "Code";
        }
    }

Maybe, it is already ready for your distribution. Please, check with the original maintainer if this vscode.env.appName returns Visual Studio Code - OSS. If yes, it will be easy to fix, because I just have to remove Visual Studio from its value, and it will be the desired folder.

Hope this helps

@Kurolox
Copy link
Contributor Author

Kurolox commented Apr 23, 2018

I've took the chance to learn how to "make" an VSCode extension, and it seems that the value of vscode.env.appName returns Code - OSS. I could upload the code I've used if you want, but it's literally the hello world from here, but instead of printing hello world it prints the value of vscode.env.appName.

@Kurolox
Copy link
Contributor Author

Kurolox commented Apr 23, 2018

Since it looks like an easy fix, I've forked the repository and I'm working on it. I'll make a pull request later today.

@Kurolox
Copy link
Contributor Author

Kurolox commented Apr 23, 2018

Made a pull request already.

#179

@alefragnani
Copy link
Owner

I will update the extension later today. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement need more info OSS VS Code version built from source
Projects
None yet
Development

No branches or pull requests

2 participants