Hennamann / CC-Extension-Builder-For-Visual-Studio-Code

A Visual Studio Code Extension that lets you create HTML based extensions for Adobe Creative Cloud applications such as Photoshop, Illustrator and InDesign.
MIT License
45 stars 10 forks source link

Nothing appears to happen when creating an extension on Windows - silently disappears #1

Closed havremunken closed 6 years ago

havremunken commented 6 years ago

Hey,

I realize of course that it says "Untested on Windows" - I thought perhaps this could be the first step towards changing that. :)

So I go to a fresh directory on my PC, type "code ." to start the editor, then ctrl-shift-p and select the "Create a new CC Extension" command. I am asked for the extension ID in the "reverse domain" format (I enter com.example.test and press enter), then the extension name (I enter test, then enter) and that was the last thing to happen, apparently.

I can't find anything in the Problems / Output / Debug Console windows - they're completely empty, even if I open them before running the "Create a new CC Extension" command.

I am a user of VS Code, far from a plugin developer, but I am interested in helping with trying to figure out what goes wrong here.

Any hints on steps I could try to attempt to locate the reason for this?

Thanks!

Hennamann commented 6 years ago

Could you try running the extension in Debug mode, by choosing Start with Debugging from the Debug menu? That should output any errors to the debug console in your main VS code window. Thank you for testing on Windows, it's something I haven't gotten around to doing myself. This needs to be done using the src code itself btw, either download it as a zip or clone it, and then open the repository in VS code.

havremunken commented 6 years ago

Ok, I cloned the project, did an npm install, and opened the top level folder in VS Code. Then I ran it, another VS Code window appeared, and I was warned that it was overwriting the installed extension (which sounds like something that should happen).

I then ran the "Create a new CC Extension" command, entered the same values as before, and this time I got to see a third menu pop up, prompting me to choose a template. I believe I got four choices, I went with the Adobe one (just a random choice), and then most things disappeared from this VS Code window. Nothing in any of the consoles. However, in the Code window where I ran the extension from, there was more action.

An exception was hit on line 584 of fj.js:

Error: ENOENT: no such file or directory, open 'C:\Program Files\Microsoft VS Code\%programfiles%\Common Files\Adobe\CEP\extensions\com.example.test\CSXS\manifest.xml'
    at Object.fs.openSync (fs.js:584:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:506:29)
    at editTemplate (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:164:38)
    at editTemplate (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:160:17)
    at createExtension (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:150:17)
    at ChildProcess.vscode.commands.registerCommand.vscode.window.showQuickPick.then.cmd.on (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:141:21)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:194:7)

In the debug console, I find the following text:

C:\Program Files\Microsoft VS Code\Code.exe --debugBrkPluginHost=41483 --debugId=d2b76536-b0e6-4647-86d3-2f000f6159b6 --extensionDevelopmentPath=d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code 
The CC Extension Builder Extension has been activated.
Creating a new CC Extension at %programfiles%/Common Files/Adobe/CEP/extensions/com.example.test
stdout: C:\Users\Rune\AppData\Roaming\Adobe\CEP\extensions\com.example.test
child process exited with code 0

In the Output console, the following appeared:

ERROR: The process "123564" not found.ERROR: The process "6048" not found.ERROR: The process "10492" not found.

I am too much a newbie at this to say for sure what is going wrong, but the path 'C:\Program Files\Microsoft VS Code\%programfiles%\Common Files\Adobe\CEP\extensions\com.example.test\CSXS\manifest.xml' seems to point to a problem with path expansion - the %programfiles% thing would usually expand to something like C:\Program Files\ - which we already have at the beginning of the path. So that path reference probably couldn't work that well. :)

Let me know if you want me to do or test anything further!

Hennamann commented 6 years ago

Alright, I have changed the code to point to the correct directories, it should work now. But I can't test it. could you pull the latest changes and try again?

havremunken commented 6 years ago

Sorry for late reply, apparently one has to spend some time with the family on Sundays. ;)

I got a different exception this time.

Exception has occurred: Error
Error: ENOENT: no such file or directory, open 'C:\Users\Rune\AppData\Roaming\Adobe\CEP\extensions\com.example.test
\CSXS\manifest.xml'
    at Object.fs.openSync (fs.js:584:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:173:20)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:506:29)
    at editTemplate (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:165:38)
    at editTemplate (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:161:17)
    at createExtension (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:151:17)
    at ChildProcess.vscode.commands.registerCommand.vscode.window.showQuickPick.then.cmd.on (d:\Programmering\Adobe\CEP\CC-Extension-Builder\CC-Extension-Builder-For-Visual-Studio-Code\extension.js:142:21)
    at emitTwo (events.js:111:20)
    at ChildProcess.emit (events.js:194:7)

The funky thing here? That file actually exists at the time I get this exception...!

image

It could of course have been created in the milliseconds after the exception was thrown, for all I know.

How would we go about debugging something like this?

Hennamann commented 6 years ago

I ended up testing on Windows myself, and ran into the same issue as you and managed to fix it. But it immediately errored out when editing the .debug file as it wasn't copied over along with the rest of the template, I fixed that too, only to learn that node.js reads hidden files on Windows as read-protected. I have pushed a new fix, but I am unable to test if it works, and I won't be able to until later tomorrow.

Could you once again pull the latest changes and see if it works now?

havremunken commented 6 years ago

I am of course happy to test since I caused all this trouble in the first place! :)

This time, no error messages, and suddenly a new Code window popped up with my new panel project - so seems like it worked perfectly. Good work! :)

Hennamann commented 6 years ago

Awesome! I'll publish the latest changes to the VScode marketplace and change the readme to reflect that both Windows and Mac are tested to work with the extension.