I'd like to develop a VS Code extension that consumes a COM type library (interop) of a third-party application?
Ideally, I'd like to write the extension in F# (Fsharp) using Fable to compile it to JS, but that's not totally essential. In any case, I can reference and use the COM library from F#, C# and VB.NET and provide a .NET library as a wrapper if needed.
Context: I'm new to VS Code extension development. I managed to compile a hello world extension in JavaScript and in F#+Fable. What I probably don't understand is how to use the package.json file and the npm package manager to reference the library.
Edit: I tried the node.js library winax, but without success. Is there an alternative?
A colleague managed to get Winax (Node.js addon) working within the VS Code extension. It's important to recompile winax against the same version of Node.js and Electron that are used in the current version VS Code. (At the time of writing, VS Code 1.16.0 uses Node.js 7.4.0 and Electron 1.7.3.)
In the command line (in your extension project folder) do
The Electron version may need updating in
--target=1.7.3
.Now use Winax in the VS Code extension for instance like this
Works like a charm for me =)