Get intellisense in editor from compiled code in docker containers - node.js

I've been looking a while for this but don't seem to be able to find a decent solution without creating extra mess in my workspace.
Is it possible to use an editor, such as VSCode, and make its intellisense use compiled code that resides inside a docker container (or multiple)?
One way to perhaps accomplish is this by creating shared volumes that link the node_modules and the compiled folder.
In my workspace i'm using NodeJS, Npm modules and my editor of choice is, visual studio code. The workspace setup is launched using docker-compose
Any suggestion is welcome

The VS Code Team recently announced Remote Development Extension Pack, which contains The Remote - Containers extension
The Visual Studio Code Remote - Containers extension lets you use a Docker container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of VS Code's full feature set.
This lets VS Code provide a local-quality development experience — including full IntelliSense (completions), code navigation, and debugging — regardless of where your tools (or code) is located.
source
Note that for now it requires the VS Code Insiders build

Related

Does Visual Studio 2022 have the same ability to open a javascript/nodejs project folder in a WSL2 Linux as VS Code is able to do?

If I'm in my WSL2 Ubuntu filesystem I can simply navigate to a javascript/nodejs folder and type code . to open that project folder and thanks to VS Code's Remote extensions, I'm essentially remoting into the Linux environment and ready to code.
Now Visual Studio 2022 has been released, I was wondering if it too supports the same level of cross-platform IDE capability as VS Code?
How, for instance, when in my WSL2 Ubuntu project in Windows Terminal, can I open my javascript/nodejs project in the Linux filesystem using VS2022, or is this not supported because VS Code is the only cross-platform IDE that can do this?
So its not really possible to do how your thinking. The problem here is that you your not understanding the difference between a "Code Editor", and an "Integrated Development Environment (IDE)", which is totally understandable, as the line that separates the two has become blurred in recent years, and also a topic of debate. There was a far more explicit distinction between the 2 10-15 years ago, however, Microsoft has done a good job at separating the two, where JetBrains will release a piece of software that can be used as an IDE, but is more often than not, used as an editor, but will still call it an IDE, even though its not an IDE in a pure sense.
How is all this related to your question?
When you open your Node.js project in VSCode via the code . command, you are opening it in an editor that implements Intelli-code, as well as a wealth of other tools, but essentially, the editor, and all the tools extract the names & file extensions of your documents, parse them (usually turning much of the info into an AST, where many extensions will make use of that info to offer the various tooling capabilities/features. The point is at the end of the day, the editor just parses all of your code, gives you info, and you make any changes as needed to your code. And again, this is what your doing with code .
With Visual Studio 2022, you can't open a project with it, unless its a project type the IDE supports, and enables the IDE, to embed its-self into your project. This includes things like built in environment, built in cache, built in build system, the files needed to bootstrap its-self. With an IDE, the IDE is part of the project.
So then why does Visual Stdio 2022 work with Node?
It works with node, to create Node.js applications within a windows environment, and it offers the ability to access different Windows SDK features via Node. These are things you could never do using server-side Linux builds with Node. When you build a Cpp application for windows, you package the entire thing in a .sin file, I haven't built a windows app in node, but I know that Node also uses the .sin file build system, which requires Visual Studio & Windows SDK to do, and parts of Visual Studio/Windows to be embedded into the project, for the project to be able to work in a Windows OS, and take advantage of MS Windows features.
Long story short, V.S. Code is the right tool for what your doing, why would Microsoft invest in two identical tools any way? If you ever want to build something for Windows, or for MS mobile device using Node, you will probably want to change your environment, to VS2022.

How to use makeappx to create msixbundle files that can be uploaded to the store according to the appxmanifest file?

For some reason(about the digital signature of the desktop bridge app, see here), I can't use visual studio to package my project. Makeappx seems to be able to do this, but those commands are too complex for me. Is there an easier way to achieve this?
Or to put it another way, how can I directly refer to the EXE file (which I can sign) rather than just the project in the application package project?
If Visual Studio is too complicated I recommend you get the free Express edition from Advanced Installer.
In the link include you can find a video that shows how to build an MSIX package (for bundle just change the radio button option from Builds page).
Additional info -
Publishing an MSIX package in the MS store.
Disclaimer: I work on the team building Advanced Installer.

How do I transfer a Azure Function script to Visual Studio?

If I create an Azure Function in the Azure portal, how do I grab the script and edit it in Visual Studio? I know I can copy the C# code from the script window but that's only part of the Function. How do I grab everything - the code, triggers, outputs, etc. - and take that into Visual Studio?
There's a button right in the Function App blade in Azure that allows you to download the contents of the function app:
You can even choose to download the Content and the Visual Studio project so you can directly import it into VS. However, as Travis mentioned you should really be doing this the other way around and keeping your development in VS and then using one of the various deployment options to push your functions to Azure.
You can use FTP or Kudu(.scm.azurewebsites.net) to download the app contents.
Generally speaking though if you want to work in Visual Studio it's better to do your work there and then deploy to the app with one of the several deployment options.
Once your migrate the files (as noted in the other answers), you'll also note that Visual Studio encourages a different programming model than the portal:
Precompile *.cs instead of .csx
Instead of Function.json, you use the attributes (ala WebJobs SDK).
So to fully work in VS and leverage the VS build system (and unit tests, and other VS features), you'll need to migrate your code.
See https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/ for more detail on webjobs.

Setup project Cross-Platform with Monogame

I've been trying to figure out on how to setup a Cross-Platform project for MonoGame. Whats the conventional way of doing so ?
Is that done through a Shared Project and can I keep all my content in 1 project ?
Also I am not sure if this information is correct do I need a Mac to build my project for Mac how does that work ? If so how what's the best way of setting that up.
Targeted Platforms : WINDOWS, LINUX, MAC
The best way to setup a cross platform MonoGame project IMO would be to use a Shared project. Shared projects can also include .mgcb file so you won't need to duplicate your content either. How to do:
Use "Xamarin Studio/MonoDevelop" and create a "MonoGame Shared Project" with the name of your game
If you are going to use using "Visual Studio", close the "Xamarin Studio/MonoDevelop" after this, and open up the created project vith it
you are gonna have to include the generated "Content\Content.mgcb" file with build action "None" so it will be visible in Project View area
Add a MonoGame Project for the platform you wish to launch the game from, ie. create a "MonoGame Crossplatform Project" and name it "(gamename).DesktopGL"
Delete "Game1.cs" and "Content Folder" from the Platform project
Add a reference for your Shared project
For your platform project, in options set the Output Assembly Name to be the same as your shared project
this step might not seem important, but if you are using a custom importer/processor this will allow you to not have to compile the content separately for each platform.
There you go, you should be able to run your project now.
Also I am not sure if this information is correct do I need a Mac to build my project for Mac how does that work ? If so how what's the best way of setting that up.
The created executable from DesktopGL project is runnable on Mac even when compiled from Windows, the Mac user just has to launch it using Mono. In case you want you can package your game using MonoKickstart so that your Linux and Mac users don't have to have mono installed: https://github.com/MonoGame/MonoKickstart what's more, it also includes other needed native libraries. Description on how to use it are in the link.
Since you're just targeting Windows, Linux and Mac, you can use Xamarin/MonoDevlop which runs on all three of your target platforms.
Once it's installed, then add the Monogame through the Addin manager. The addin on version 5 of Xaramin and MonoDevlop.
You can then use the same Solution project file between all three platforms assuming you use the OpenGL Template. I use this method for developing between Windows and Linux.
The only time you'll need to use a shared project or something similar would be if you started developing for Mobile (iOS/Android) or for Windows on DirectX instead of OpenGL.

Building on Windows XP, when development is on VS2012?

We're planning moving from Visual Studio 2005 to Visual Studio 2012 (Visual-C++-11).
(We would very much like to skip 2010 if we can help it, since the newer version is already there and offers a better C++ experience.)
But we've hit a little roadblock:
Our build servers still run Windows 2003r2 (all inside dedicated virtual machines), and due to messy tool support/issues, we're in no position to upgrade the build servers to a newer OS.
Developers mostly have switched to Windows7 by now, so moving the remaining Windows XP developer boxes shouldn't pose a problem.
Since VS2012 only runs on Win7 we are wondering whether we can leverage it's tools (C++ compiler, C#) and still do a full equivalent build on the W2k3 build server - after all, we don't really need a VS GUI there, just build C++ and C# projects from VS2012.
What are our options?
Will the SDK (7.1? 8?) compilers + msbuild command line get me anywhere?
In Project Property Pages, there an option "Platform Toolset" that allow you to choose compatibility of your project. So, you can work in VS2012, but built it with "VS2008 compiler"
Here is what we do:
Use CMake
CMake allows you to create build systems for your operating system. Thus we are able to use the same code within VS2005, VS2010 and Eclipse, XCode etc.
You could do something similar: Install VS2005 on your old machines and let CMake create the projects for you from the sources. On your newer machines you can use CMake to generate VS2012 Solutions (I don't know if they have 2012 support yet, because we don't use 2012 yet too).
A big pro here is: If you plan to migrate to any other IDE or even Linux you just can re-run CMake and get your source code within these environment easily compilable.
A big con: You have to start reading about CMake and create CMakeLists.txt for all your projects (might be a lot of work depending on the amount of projects, amount of source code files within each project, specific compiler options, linker options etc.)
Our build servers still run Windows 2003r2 (all inside dedicated
virtual machines), and due to messy tool support/issues, we're in no
position to upgrade the build servers to a newer OS.
Well. Not much came out of this question. We recently re-evaluated this issue, and I see two options (I haven't tried any yet):
Just do a full VS installation on a supported OS (Win7), zip up the whole VS+WinSDK directories (as well as the neccesary runtme DLLs that live somewhere under %WINDR%), and try if you can get that thing working on an XP based OS. Might work. Not a great idea if you ask me.
Split up the build process to distribute the build across several OS, so that we can work with tools that are only supported on one of them. -- This actually sounds more complicated than it'll be. We already run our build spread over several Jenkins jobs, so I should be able to get that to work. (And all build nodes are already VMs anyway, so adding more VMs isn't that much of an issue.)

Resources