-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
projects.json is not created in a code-insiders only environment #22
Comments
Just idea.
Windows and Linux is also not possible to confirm whether the same behavior. But I believe that's the same. diff --git a/extension.ts b/extension.ts
index 38faa42..04d06d1 100644
--- a/extension.ts
+++ b/extension.ts
@@ -12,17 +12,23 @@ export function activate() {
// Use the console to output diagnostic information (console.log) and errors (console.error)
// This line of code will only be executed once when your extension is activated
console.log('Congratulations, your extension "project-manager" is now active!');
-
- //
- let projectFile: string;
- let appdata = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : '/var/local');
- projectFile = path.join(appdata, "Code/User/projects.json");
-
- // in linux, it may not work with /var/local, then try to use /home/myuser/.config
- if ((process.platform == 'linux') && (!fs.existsSync(projectFile))) {
- let os = require('os');
- projectFile = path.join(os.homedir(), '.config/Code/User/projects.json');
- }
+
+ //
+ let projectFile: string;
+ let appdata = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : '/var/local');
+ // ProjectFil path
+ let useInsiders = vscode.workspace.getConfiguration('projectManager').get('useInsiders', false);
+ if (useInsiders == false) {
+ projectFile = path.join(appdata, "Code/User/projects.json");
+ } else {
+ projectFile = path.join(appdata, "Code - Insiders/User/projects.json");
+ }
+
+ // in linux, it may not work with /var/local, then try to use /home/myuser/.config
+ if ((process.platform == 'linux') && (!fs.existsSync(projectFile))) {
+ let os = require('os');
+ projectFile = path.join(os.homedir(), '.config/Code/User/projects.json');
+ }
// Save the Projects
vscode.commands.registerCommand('projectManager.saveProject', () => {
diff --git a/package.json b/package.json
index 4ec044a..e65caa0 100644
--- a/package.json
+++ b/package.json
@@ -69,6 +69,11 @@
"type": "boolean",
"default": false,
"description": "Should use the alternative approach in Mac OS X?"
+ },
+ "projectManager.useInsiders": {
+ "type": "boolean",
+ "default": false,
+ "description": "Should use the alternative approach in Code - Insiders?"
}
}
}, |
Hi @satokaz I noted that last week when running on a machine that only had the Insider version installed. I will try to find a way to detect the release kind, otherwise I could use your idea 👍 Thanks |
Same here on Win 10 (of course). Changing |
Yep, it has the same issue no matter the platform. I created this issue microsoft/vscode#5297 and will be using the proposed solution, until a native API is available. I hope an update to be available in a couple of days |
Tracked in microsoft/vscode#2741. |
@alefragnani until the proposed fix in vscode lands, can the solution proposed here be implemented? It's really irritating that I can't use PM until vscode team implements that API (which I think is still some way off in the future). Right now, I'm manually changing the extension.js file to fix it, but after every update it breaks. I'd also be happy to re-submit a PR if it's ok with you. |
All I had to do was create the non Insiders directory to work around. |
I was expecting the new API to be released back in April, but since then, they evolved the idea and postponed the final release. I agree with you that's irritating to be forced to patch the extension, or create the non Insiders folder 👍 . But don't worry. I will release a workaround until the weekend and fix this. The idea is to create a new user setting called Maybe, just maybe 😄 , also use the Hope this finally solves this issue 👍 |
Better yet, The new user setting will be the full folder path (not _subfolder) where If you don't config anything, it will detect which channel you are and use the appropriate folder. So, for those of you that patched the extension, you don't have to do anything. And those of you that created the Stay tunned |
@texastoland not everyone is going to create the missing folders - especially when it serves no other purpose apart from being a hack to get this plugin to work. Hacks are prone to breaking, and only people who have actually taken time to read into the source-code of this plugin would even know that. Most people might thing that "eh, it doesn't work, its broken" and never use the plugin again. |
I misread his proposal. |
That's right. There will be no need to manually create folders. Each VSCode channel (Stable and Insider) has its own So, with the new release, each VSCode channel will have it's own And with the new setting, if you want to share the projects between Stable and Insider versions, just choose the path. Is that ok? |
Sounds good. My misunderstanding wasn't about creating a folder but it |
Great 👍 |
WFM 👏 |
Thanks! 🎉 |
Sweet! |
Great! Glad to see it worked for all of you 👍 Thanks for your patience |
projects.json
is dependent on the PATH of the vscode stable.vscode stable:
$HOME/Library/Application Support/Code/User/
vscode-insiders
$HOME/Library/Application Support/Code - Insiders/
projectFile
is hardcoded to "Code/User/projects.json"."$HOME/Library/Application Support/Code/"
directory is not create to be to launch the vscode-stable.need to support to insiders build.
https://github.com/alefragnani/vscode-project-manager/blob/master/extension.ts#L18-L19
It does not come to mind a little good idea...
Mac OS X 10.11.3
The text was updated successfully, but these errors were encountered: