How Do I debug in server side code? - visual-studio-code

I have download & install vscode on my ubuntu 14.04 lts box, and It's working fine. I have created one app in node.js, and want to debug it. When I put debug point in my app.js file, and hit f5 (run), and seems it's working. But How to debug server side and client side code? Do you have any video tutorial in detail, so new user can understand it.
Thanks

VSCode only supports node and mono (on linux and mac) debugging atm.
Client side debugging is not currently supported, you can vote for it here: https://visualstudio.uservoice.com/forums/293070-visual-studio-code?filter=hot&page=1
We might produce video tutorials for new users soon.
In the meantime you can look at the docs
https://code.visualstudio.com/Docs/debugging

The VSCode debugger does not support to debug clients (browsers) because browsers already have built-in debuggers (and other dev tools) that are much better integrated than VSCode can ever be.
So please use VSCode for debugging your node server and for debugging the client at the same time open the development tools of your browser.

Related

How to prevent VSCode scan installed applications?

VSCode shows the following message every time I start it:
You have Docker installed on your system. Do you want to install the recommended extensions for it?
The message appears even if Docker is not running at the time when I start VSCode. So I think VSCode scanned the file system to look for what applications I have installed.
Is there any way to opt out from this? This feels like an invasion of my privacy, I do not want Microsoft know what apps I installed. Turning off telemetry does not help, the message still appears.

Developing Flutter with VSCode and WSL2

Since I mostly develop Web, using nginx, PHP and MySQL, I have ported my WebDev-environment entirely to WSL2.
Since performance is very important, all my web-related projects reside on the WSL2-vhdx file /home/user/Projects/Web. In WSL2 I've installed all my necessary tools for a nice and neat Linux-like experience, Docker, GIT, etc.. This combined with VSCode remote integration works very well.
Now, I'm digging into building Flutter-Apps, and my Flutter-environment is installed on the Windows side. My Flutter-related projects reside on D:\Projects\Flutter which is a partition, and NOT USED in WSL2 in any way. Building Flutter-apps with flutter-windows-sdk and VSCode works neatly.
But, the problem is: Now I've my project files scattered all across my computer. Web-stuff in a WSL2-vhdx-file and Flutter-stuff on the D-partition.
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I tried creating a test Flutter-project on the \\wsl$ network mount, which didn't work.
Moving my web-related project files to the D:\ partition of Windows is no option, since the I/O mounts in WSL2 are extremely slow.
I got it working, reliably with adb connect 192.168.xxx
For anyone interested, see my full blog post here: https://dnmc.in/2021/01/25/setting-up-flutter-natively-with-wsl2-vs-code-hot-reload/
Is there a way to build flutter-apps with Flutter, while having the project-files stored on a WSL2-vhdx-file, in combination with VSCode-remote and an Android-emulator?
I'm assuming (based on the mention of VS Code Remoting) that you want to run the extension in WSL. I haven't tried that specifically, but I have run Flutter inside WSL and also connected a VS Code Remoting session to an Android emulator in the cloud, so I would expect this to work.
You'll need to make sure you set up the Flutter SDK inside WSL (so you can run flutter commands inside WSL - it should be the Linux version of the Flutter SDK and not the Windows one if you're using the zip).
To have your emulator show up in flutter devices from inside WSL, you will likely need to run adb tcpip 5555 from the Windows side (this means you need an Android SDK in Windows) - this will tell your phone to listen on TCP port 5555. Then you'll need to run adb connect [phone ip]:5555 from inside WSL (this means you'll need an Android SDK in Linux). If all goes well, the phone should then show up in adb devices and also be picked up by the device selector in VS Code.
I tried creating a test Flutter-project on the \wsl$ network mount, which didn't work.
It's not clear what went wrong here, though my first guess would be that maybe the UNC path isn't supported - if you map a drive letter to it does it make a difference?
While this isn't an officially supported setup, feel free to raise issues in the Dart-Code repository on GitHub with any issues you have. It's not a priority, but I would like for VS Code Remoting (including WSL and Docker) to generally work for Dart and Flutter dev.
Anytime you're crossing/sharing the file-system boundary from windows to wsl you're paying a massive cost in speed/time.
With the setup you've described I'd consider trying to self-host the browser based VSCode.dev inside wsl - checkout details instructions here: https://medium.com/geekculture/3-steps-to-code-from-anywhere-45401247f479
Personally I've settled on running VSCode and docker inside a Linux VM on Windows, and have a 96% time saving in things like running up a server and watching code for changes making this setup my preferred way now.
The standardisation of devcontainer.json and being able to use github codespaces if you're away from your normal dev machine make this whole setup a pleasure to use.
see https://stackoverflow.com/a/72787362/183005 for detailed timing comparison and setup details

Can I develop with VS Code on the new Samsung Chromebook Pro?

Thinking more about leaving my MBP at home and instead taking the new Samsung Chromebook PRO to Starbucks for the day.
Is this fantasy or will VS Code run properly on this new machine? I see options for the Arm chip based PLUS model but nothing for the PRO.
Is a port available and if so how has development been, good?
UPDATE
I guess this is a hard question to answer? Essentially, I just want to leave my heavy MBP that always needs a power outlet at home. Just want to head out with a light weight machine and work on it anywhere.
The PRO does run Linux but I have not verified clearly that VS Code can run in this environment. Being in Canada I have no access to the PRO yet, can only order it from USA at this point, which I might do once I know the verdict to my question.
My team and I have been experimenting heavily with the Samsung Chromebook Pro and have been actively switching our development environments completely over to the Chromebook ecosystem (away from Mac). Personally I run a combination of Atom and NeoVim with a complete development environment for Node.js, Postgres, and Redis on my Chromebook Pro.
For any desktop IDE you'll need to run Crouton which means you'll have to put your Chromebook into developer mode which is less secure. If you don't want to do that your only options are either use something like Caret (which will only do basic text editing) or to use some sort of cloud-based IDE; ones I know of: Cloud9, Codenvy, Shiftedit, and Eclipse Che (an open source one that just recently caught my eye).
The good news is Crouton can run effectively anything that Linux can (especially since the Pro has an x86 processor), and from what I can tell VSCode supports Ubuntu, the default Linux distribution for Crouton. You can even set up the Crouton Extension to put your GUI programs into Chrome tabs or windows within ChromeOS using Xiwi.
Anything with a GUI running in Crouton is going to hurt performance and battery life on Chromebook since ChromeOS is finely tuned for running specifically the Chrome Browser. I don't expect you run out and learn a terminal-based editor today if you haven't already, but I highly recommend at least getting comfortable using the terminal for quick editing, using git, and running simple shell commands. That will save you that sweet Chromebook battery life and a bit of frustration dealing with a somewhat-quirky Xiwi and Crouton Extension.
If you're willing to work out a few kinks the Chromebook Pro development experience is pretty great. It's truly a quality piece of hardware and ChromeOS is fantastic with the addition of the ability to run Android apps.
UPDATE (9/19/17):
There is another option now for at least getting server environments running on ChromeOS without using developer mode. It's called Termux, an Android app, which can bind to a local port and can be interfaced with via SSH. You can read more on the blog post we came across here: https://blog.lessonslearned.org/building-a-more-secure-development-chromebook/ You will, however, have to use a terminal-based text editor like VIM or a native ChromeOS one like Caret, so it will not run GUI editors like VSCode or Atom.
Check out https://coder.com
It's basically VS Code running on a remote server, accessible through a browser.
I've just started playing around with it and looks like a perfect fit for a Chromebook. And it's open source too :)
You can now (with the Linux-beta for chromeOS) quite easily run vscode locally on a chromebook, see this step-by-step guide: https://blogs.sap.com/2018/10/16/set-up-vs-code-on-chrome-os-for-local-application-programming-model-development/

slow eclipse remote debugging connection

I'm running linux mint 14, java 1.7.0_06-b24, eclipse 4.2. I'm building and deploying a large web app to a local WebLogic instance. When I try to connect a remote debugging session to this app for Eclipse debugging purposes, it takes quite a while ~1min to connect. Once connected, performance seems fine. Any thoughts would be greatly appreciated. Everything seemed to be working fine when I was running ubuntu and eclipse 3.8.
Did you set a big amount of breakpoints in your code?
Attaching to the JVM takes longer as more breakpoints are there.
If the experimental debugging feature Show debug values inline on text editors is enabled, it takes ~1min to connect the remote debugger.
This was introduced in version 2022-03 (4.23.0).
Solution: disable the setting.
You can find it in Window / Preferences / Run/Debug

Regarding eclipse galileo

I'm using eclipse galileo for developing some web application. But I want to get the eclipse installed on the server(assume some other pc or server machine) and I want to access it as a client and work as I was working before. Please suggest me what type of server I should configure and which Operating System supports it.
A little bit weird to put the IDE on the server but you can use whatever OS you want, put the Eclipse there and connect to it using VNC or Remote Desktop.