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

"Unable to open '': Invalid file resource #2

Closed
evandrocoan opened this issue Jul 21, 2017 · 9 comments
Closed

"Unable to open '': Invalid file resource #2

evandrocoan opened this issue Jul 21, 2017 · 9 comments
Assignees

Comments

@evandrocoan
Copy link

I am running Code from the source code and using external settings with:

start /B /min .\source\scripts\code.bat --user-data-dir "%~dp0settings" --extensions-dir "%~dp0settings\extensions" %*

When I try to open the settings with the command Projects: Edit Configuration I got this error on the command line output:

[13144:0721/122332.210:INFO:CONSOLE(85)] "Unable to open '': Invalid file resource (file://c:\users\professional\vscode_projects.json).: Error: Unable to open '': Invalid file resource (file://c:\users\professional\vscode_projects.json).
    at EditorPart.doHandleSetInputError (file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:397:92)
    at file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:381:44
    at _Base.Class.derive._creator.ErrorPromise_then [as then] (file:///F:/CodeStudio/source/out/vs/base/common/winjs.base.raw.js:1436:50)
    at EditorPart.doSetInput (file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:361:52)
    at file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:265:30
    at CompletePromise_ctor.CompletePromise_then [as then] (file:///F:/CodeStudio/source/out/vs/base/common/winjs.base.raw.js:1566:49)
    at EditorPart.doOpenEditor (file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:260:89)
    at EditorPart.openEditor (file:///F:/CodeStudio/source/out/vs/workbench/browser/parts/editor/editorPart.js:231:25)
    at WorkbenchEditorService.doOpenEditor (file:///F:/CodeStudio/source/out/vs/workbench/services/editor/browser/editorService.js:99:36)
    at WorkbenchEditorService.openEditor (file:///F:/CodeStudio/source/out/vs/workbench/services/editor/browser/editorService.js:84:29)", source: file:///F:/CodeStudio/source/out/vs/workbench/services/message/browser/messageService.js (85)

image

@fabiospampinato fabiospampinato self-assigned this Jul 21, 2017
@fabiospampinato
Copy link
Owner

I've pushed a new version (1.2.2) that might fix this. Unfortunately at the moment I don't have a Windows machine available for testing it, can you try it for me?

@evandrocoan
Copy link
Author

evandrocoan commented Jul 21, 2017

Sure, but right now I'm going out to eat.

@fabiospampinato
Copy link
Owner

No problem.

Are you using double backslashes in your configPath setting?

@evandrocoan
Copy link
Author

evandrocoan commented Jul 21, 2017

I do not have set anything for the settings. I supposed the package will use my settings folder as default.

Can you push this new change to the GitHub? I am not using the marketplace to install extensions, I manually install then from GitHub.

First make sure you do not have the extension installed in ~/.vscode/extensions and that you have
TypeScript installed:

npm install -g typescript

Then clone the repo somewhere else on your machine, run npm install && tsc -p .
and open a development instance of Code.

cd F:\vscode\extensions
git clone https://github.com/fabiospampinato/vscode-projects-plus
cd vscode-projects-plus
npm install
tsc -p .
  1. https://github.com/dbankier/vscode-instant-markdown#install-manual
  2. https://github.com/Microsoft/vscode-go/pull/33/files

So when I run vscode I set the my own settings and extensions folder with:

code --user-data-dir "F:\vscode\settings" --extensions-dir "F:\vscode\extensions"

So it works like a portable version.

@fabiospampinato
Copy link
Owner

I supposed the package will use my settings folder as default.

It does put a default file under your home directory.

I've just pushed the changes to GitHub, or you can install it from here if you prefer.

@evandrocoan
Copy link
Author

evandrocoan commented Jul 21, 2017

Thanks! It worked, I could open the vscode_projects.json on my user folder with the command on the command palette.

Now I cannot open the project I just saved:

image

Steps to reproduce the error:

  1. Open one folder
  2. Run the command Project: Save, press Enter, Enter, Enter.
  3. Run the command Project: Open, and open the project you just saved.

@fabiospampinato
Copy link
Owner

I've just pushed a commit that might fix this. Let me know if it works for you.

@evandrocoan
Copy link
Author

Thanks! It is fixed. Could you place a warning when you open the current project?

When I reopen the same project, it does nothing. So when I am not paying attention and do that and nothing happens, I could think something is broken.

@fabiospampinato
Copy link
Owner

Could you place a warning when you open the current project?

Done. I thought about adding a similar message for group switching, but at the end of the day they are two different cases, when opening a project you might expect to get a new window or something, when switching group you just see a different projects list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants