Problems installing from sources (outdated documentation?)
Hey! 👋
I'm trying to follow this page to build the extension from sources: https://github.com/vshaxe/vshaxe/wiki/Installation
I'm using an M1 Mac and the repo is checked out at ~/.vscode/extensions/vshaxe and the build tool is located at ~/.vscode/extensions/vshaxe-build as instructed.
I'm wondering if the flow changed and maybe the documentation is outdated because I can't manage to build the project properly, so I could use some help :)
Here's what I did:
Followed every step until 6). This step seems to work successfully but with a warning:
WARNING src/vshaxe/tasks/TaskConfiguration.hx:173: characters 75-93
173 | final file = PathHelper.absolutize(problemMatcher.matched(2).or(""), workspace.rootPath.or(""));
| ^^^^^^^^^^^^^^^^^^
| (WDeprecated) Use `workspace.workspaceFolders` instead.
As I understand, the extension should now show up in my extensions after restarting vscode, but it does not. Instead, vscode keeps telling my that I need to install the official Haxe extension. :/
Next I have tried to build the project from within vscode, but the IDE fails to find the reference to vshaxe-build.
I still managed to build the extension by finding that there is a Install.hx file in the project root, so I simply built that (targeting php) and ran it to find that it creates a .vsix file that I could use to install the extension. I realise this is a hacky workaround but at least it seems to work. 😓
The documentation that I followed never mentions a vsix file so I am wondering if the flow changed.
Maybe the documentation needs to be updated, or maybe I'm doing something very wrong? If this is outdated, what is the proper flow to build from sources?
Looking forwarding to finding out what's wrong here. 🙏
I always do this from within vscode, and that works sometimes:
the steps described on that page should work (at least I don't see a reason why they wouldn't). however they are showing how you need to set up vshaxe development on a Windows system, so that you can compile+reload and see changes you made, because you are working directly in the extension folder. as far as I know that is the only solution for Windows to have that kind of workflow. it comes with the downside of sometimes losing your vshaxe dev folder because a vscode auto-update of vshaxe plugin wiped it.
on a unix system I recommend you use symlinks to link bin/index.js and server/bin/server.js to versions in your development folder (outside of ~/.vscode/extensions), so that you can compile+reload without risking to loose any sources.
alternatively you can run vsce package on CLI (after installing vscode's extension manager package) and then you need to manually install the resulting .vsix via vscode command Extensions: Install from VSIX… - that would be the way to go, when you want to test your extension on a different system.
I've never used vshaxe-build: build and install but I assume it does the same thing (building a .vsix and also installing it for you), which means it's safe to use on any system and from "any" dev folder location while still allowing compile+reload to test your changes.
Awesome, thanks for getting back so quickly! I still can't build from VS Code following the steps from the guide - but now I know that there's an alternative to build it directly from the command line and that works just as well for me, so I will just do that. Thanks!
I would suggest to add this flow to Installation.md in the wiki as an additional step in case anybody else can't make it work on a unix system.
I'd do it myself but contributing to GitHub wikis is a bit hard, so here's a suggestion:
9. Alternatively, you can install [Visual Studio Code Extensions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) and run this from the `vshaxe` folder:
```
vsce package
```
`vsce` is a command-line tool for packaging VS Code extensions. Running this command will create a `.vsix` file that you can use to install the extension.
To do so, navigate to your Extensions tab in VS Code, click on the `...` button and select `Install from VSIX`.
This approach can be helpful especially when you want to test the extension on a different system.
I've updated the wiki page to include a VSIX workflow
Thank you!