News for hackers. Stuff that matters.
Re:The Era of Visual Studio Code by jiripospisil on Tuesday September 22, 2020 @04:12PM (#24559275)
I completely switched to VS Code once I discovered the remote development feature [0]. It allows you to run VS Code locally but work on a project in a different environment (via SSH, Docker, WSL). The integration is seamless - search, debugger, terminal, extensions - everything looks and behaves as if it was running locally but is delegated to the configured remote. You can even have different remotes opened at the same time.

I use this setup primarily to have at least some sort of a barrier between my system and the gigabytes of NPM packages that get downloaded as dependencies. Moving between systems easy as well - I just copy the VM images. It also makes it easy to experiment a little bit. If I want to e.g. upgrade an important package and something goes wrong, I just revert the VM and I'm back in business. Having Arch as the distro is a nice bonus.

There's a chance that IntelliJ IDEs will get the same remote functionality as well but the timeline is unclear [1].

[0] https://code.visualstudio.com/docs/remote/remote-overview

[1] https://youtrack.jetbrains.com/issue/IDEA-226455

Re:The Era of Visual Studio Code by stefan_ on Tuesday September 22, 2020 @05:51PM (#24560371)
This is such a hugely undervalued feature, and no other editors seem to provide anything remotely close. I found it particularly useful for the COVID work from home - I yeeted my work laptop into a corner and just SSH into it to continue working with the ergonomics of my home desktop machine.
Re:The Era of Visual Studio Code by necubi on Tuesday September 22, 2020 @05:54PM (#24560403)
Not to be that guy, but emacs has had this for years via tramp.
Re:The Era of Visual Studio Code by xxpor on Tuesday September 22, 2020 @06:09PM (#24560565)
As someone who used tramp and switched to VS Code, it's absolutely not the same thing. The difference is plugins work on the remote side of the connection without having to be aware they're in a remote connection. VS Code makes this work by having an agent running on the remote host. For the first time I actually got autocomplete and code jumping working without a horrendous amount of effort.
Re:The Era of Visual Studio Code by catern on Tuesday September 22, 2020 @06:50PM (#24560928)
This is also true with TRAMP. Anything in core Emacs, and any package outside it that isn't aggressively poorly written, works transparently with TRAMP. The core utilities for interacting with the OS such as start-file-process are all TRAMP-aware. (Or more specifically, TRAMP provides file handlers which customize start-file-process)
Re:The Era of Visual Studio Code by anlsh on Tuesday September 22, 2020 @09:17PM (#24561943)
One area I have found where TRAMP really suffers is when you have a relatively high-latency connection. I'm living on the east coast right now and connect to a dev box in Washington to work, and tramp is basically unusable. Every time you enter a folder in a project, emacs will stall for 1-2 seconds (unless the folder has been entered and cached before: unfortunately every time you restart emacs you'll have to go through it all again). If you've forgotten to disable autocomplete in a remote shell buffer, the first character you type will cause emacs itself to hang forever. There's unacceptable lag when opening and even navigating files. Good luck ever running grep or magit.

With VSCode on the other hand, I have no issues at all: couldn't even tell the project was remote.

I still use emacs (emacs -nw via ssh), but it's nowhere near VSCode's responsiveness and now I cant use GUI emacs. It's definitely a source of frustration :/

Re:The Era of Visual Studio Code by dima55 on Tuesday September 22, 2020 @07:34PM (#24561281)
Yeah. TRAMP is magical, and everything just works. And has for years and years.
Re:The Era of Visual Studio Code by oblio on Wednesday September 23, 2020 @05:57AM (#24565082)
There is a comment right above yours that contradicts you: https://news.ycombinator.com/item?id=24561943
Re:The Era of Visual Studio Code by diffeomorphism on Wednesday September 23, 2020 @07:27AM (#24565677)
That comment doesn't contradict the post at all. If anything it supports that statement and then goes on to mentions that high latency connections are problematic.
Re:The Era of Visual Studio Code by oblio on Wednesday September 23, 2020 @04:23PM (#24571541)
High latency connections are a fact of life. If Emacs Tramp, for which development was started in 1998, when high latency connection were a lot more common, still has issues with high latency connections, that's not a glowing reference for its architecture.

Especially since it seems VSCode manages those connections better.

It's ok to admit your favorite tech has flaws, everything has them.

Re:The Era of Visual Studio Code by diffeomorphism on Thursday September 24, 2020 @04:02AM (#24576404)
Not disagreeing with that. I am just saying that the previous post was that plugins don't have to be modified with Tramp and work transparently. The post referenced above does not disagree with that. Instead it says that tramp does not deal well with high latency connections. I think is important to be clear where the issue lies if one wants to get it fixed.
Re:The Era of Visual Studio Code by bsder on Tuesday September 22, 2020 @08:37PM (#24561662)
> The difference is plugins work on the remote side of the connection without having to be aware they're in a remote connection.

This is cool when the machine you are connecting to is more powerful than the one you are sitting on. This is far less cool when the machine you are connecting too is less powerful than your desktop (RPi or Beaglebone, for example).

Re:The Era of Visual Studio Code by shaklee3 on Wednesday September 23, 2020 @12:57AM (#24563141)
In that case, why would you try to develop/compile remotely? Just target a different architecture.
Re:The Era of Visual Studio Code by xxpor on Wednesday September 23, 2020 @12:22AM (#24562947)
In that situation, why not cross compile?
Re:The Era of Visual Studio Code by guytv on Wednesday September 23, 2020 @05:34AM (#24564916)
... and now he's the president. that shows ya!
Re:The Era of Visual Studio Code by fmakunbound on Tuesday September 22, 2020 @09:51PM (#24562121)
That's cool, but you can just "screen emacs" since it's not implemented inside a giant web browser.
Re:The Era of Visual Studio Code by TylerE on Tuesday September 22, 2020 @07:46PM (#24561377)
jEdit has this 15 years ago.
Re:The Era of Visual Studio Code by 5d749d7da7d5 on Tuesday September 22, 2020 @07:36PM (#24561293)
Remote has been a game changer for my development as well. Work forces me on a Windows machine with the full suite of corporate spyware. Said spyware loses its mind when compiling, debugging, language server inspection, git actions on large repo, etc. Performance loss is somewhere in the region 2-10x.

With remote, I am able to do all coding on a non-infested Linux server with almost seamless usability.

Re:The Era of Visual Studio Code by easton on Tuesday September 22, 2020 @09:55PM (#24562150)
Your company is equally cool with you just having all of your code/IP on a unsecured (i.e. not running crazy large antimalware, not actually insecure) Linux box?
Re:The Era of Visual Studio Code by tda on Wednesday September 23, 2020 @02:14AM (#24563557)
sounds like my company: any windows machine is infested with a dozen or so McAffee things that make it unworkably slow. But none of the drones that role out McAffee has ever touched linux or osx, they prefer to leave that alone. So even though I actually prefer windows as a desktop OS, I mostly worked on a MacBook (until the pandemic, now I WFH on a my personal windows machine). But since WSL2 is finally backported to whichever outdated windows my corporate laptop runs, it is actually quite usable with VSCOde/remote containers + docker
Re:The Era of Visual Studio Code by ezluckyfree on Tuesday September 22, 2020 @05:59PM (#24560461)
Note that this feature doesn't work in open source builds of VSCode, it's an MS only thing.
Re:The Era of Visual Studio Code by avremel on Wednesday September 23, 2020 @09:00AM (#24566478)
I use this feature in VSCode (free version), with this Microsoft extension: https://marketplace.visualstudio.com/items?itemName=ms-vscod...
Re:The Era of Visual Studio Code by laqq3 on Tuesday September 22, 2020 @06:04PM (#24560514)
I read about this fact elsewhere also. Could you expand on this a bit? My impression was that VSCode and its associated extensions are open source, so I'm curious how Microsoft could make certain parts exclusive to its own build of VSCode.
Re:The Era of Visual Studio Code by bostonvaulter2 on Tuesday September 22, 2020 @07:35PM (#24561289)
> I'm curious how Microsoft could make certain parts exclusive to its own build of VSCode.

By packaging it as an extension that isn't licensed like the rest of VSCode.

Also on a related note, if you're using an open source build of VSCode (such as VSCodium) then you cannot use marketplace.visualstudio.com/

https://github.com/VSCodium/vscodium#extensions-and-the-mark...

Re:The Era of Visual Studio Code by nnt38 on Wednesday September 23, 2020 @06:17AM (#24565206)
You absolutely CAN use marketplace.visualstudio.com, you just have to break ToS.
Re:The Era of Visual Studio Code by cercatrova on Tuesday September 22, 2020 @08:54PM (#24561793)
Because VSCode is under a permissive license (MIT) rather than a copyleft license (GPL), Microsoft can add any proprietary extensions it wants. "Permissive" licenses are only permissive for the creator and other developers (only sometimes), not for the end user.
Re:The Era of Visual Studio Code by nl on Wednesday September 23, 2020 @01:53AM (#24563422)
Since MS is the author, they could put it under GPL and still do this. They own the copyright.
Re:The Era of Visual Studio Code by z3t4 on Wednesday September 23, 2020 @02:28AM (#24563648)
In order to contribute you have to sign away your rights, so it's only permissive to MS. It's a pervasive view on open source, cheered by sockpuppets, making people believe MS is now a open source company.
Re:The Era of Visual Studio Code by toupeira on Tuesday September 22, 2020 @07:04PM (#24561042)
The situation is similar to Google Chrome/Chromium: Most of it is open-source, but the release binaries contain some proprietary bits for telemetry, marketplace access, etc.

A FOSS build is available at https://vscodium.com/

Re:The Era of Visual Studio Code by zelphirkalt on Wednesday September 23, 2020 @01:57AM (#24563453)
I am no VS Code user, but if this is true, we are at phase 2 of EEE. What will be next?
Re:The Era of Visual Studio Code by chipsa on Wednesday September 23, 2020 @08:46AM (#24566329)
Can't be at phase 2, because VS Code was written by MS.
Re:The Era of Visual Studio Code by zelphirkalt on Wednesday September 23, 2020 @09:42AM (#24566943)
Concepts can be embraced. The concept is not limited to a single product.
Re:The Era of Visual Studio Code by srikz on Wednesday September 23, 2020 @04:46AM (#24564601)
Eclipse foundation has a new project, Theia[1], which forks VSCode and one of the reasons they state is that the extension ecosystem is not opensource.

They want Theia to be a tool to build your own editor and it can be built as a hosted solution (like code-server) or a standalone editor

Edit: I see that the article also mentions Theia but this point about Theia vs VSCode is not mentioned.

[1]: https://theia-ide.org/

Re:The Era of Visual Studio Code by MikusR on Wednesday September 23, 2020 @05:48AM (#24565021)
The beauty of open source. Take code written by others rename and call it an alternative to the original product.
Re:The Era of Visual Studio Code by sebmellen on Tuesday September 22, 2020 @06:12PM (#24560597)
I was very disappointed to find that VSCodium wasn't able to do this. It makes me consider switching back to VSCode.
Re:The Era of Visual Studio Code by nnt38 on Wednesday September 23, 2020 @06:18AM (#24565219)
VSCodium is able to do this, it is just more work.

https://github.com/VSCodium/vscodium/blob/master/DOCS.md#pro...

Re:The Era of Visual Studio Code by vixit on Tuesday September 22, 2020 @05:56PM (#24560424)
Ooh, if IntelliJ gets remote functionality I'll be very happy.
Re:The Era of Visual Studio Code by rckoepke on Tuesday September 22, 2020 @07:58PM (#24561454)
I use JetBrain's remote python interpreter functionality[0] with great success and convenience. For anyone whose development environment is appropriate for its use, I honestly cannot recommend it highly enough. It's only available under the full "Professional" license version, however.

This uses SSH and SCP to automatically deploy the code to the remote environment and run it with the interpreter on that machine, rather than your own local laptop/desktop. One advantage is that it does not require any special software to be installed on the remote server. I believe VS Code's solution requires a pretty hefty installation consisting of basically an entire copy of VSCode onto the remote server.

The downside of JetBrain's approach... I believe that it requires a local copy of the files in order to perform the "LSP"-like syntax error highlighting / suggestion functionality that JetBrains software is so lauded for. This could be difficult/inconvenient if your codebase is particularly enormous, or if you aren't allowed to mirror it locally.

However, given the amount of support that JetBrains has for this kind of setup, I wouldn't be shocked to see an additional option for something more in the style of "VS Code Remote Development"

0: https://www.jetbrains.com/help/pycharm/configuring-remote-in...

Re:The Era of Visual Studio Code by kamhh94 on Tuesday September 22, 2020 @06:50PM (#24560926)
I spoke to the team in KubeCon last year and they said “our research team is looking into it” with a hand wave. I doubt IntelliJ will actually implement this anytime soon, sadly.
Re:The Era of Visual Studio Code by enjoylife on Tuesday September 22, 2020 @09:37PM (#24562036)
I agree and not saying they would get to it, but considering that was pre-COVID, I would imagine/hope they might reprioritize.
Re:The Era of Visual Studio Code by FridgeSeal on Wednesday September 23, 2020 @12:14AM (#24562908)
Remote and Docker based Python environments have worked for a while in PyCharm.
Re:The Era of Visual Studio Code by tda on Wednesday September 23, 2020 @02:27AM (#24563635)
It is also great for string all dependencies for development together in a docker-compose file. On any machine you just have to git clone and open vscode in the container and you are good to go. Even if you require a particular version of postgresql, some compiler version or a complete Kafka cluster; everything can be configured in a Dockerfile/docker-compose file and stored with the code. No more pages long readme's of how to get all dependencies set up just right. Especially when often switching between projects and machines this is a godsend. And for onboarding it is so easy to get someone a fully configured working environment.
Re:The Era of Visual Studio Code by scoutt on Wednesday September 23, 2020 @03:19AM (#24563982)
Absolutely. I build Android images (AOSP/kernel/lk customization) and at the beginning I was using Eclipse over a shared network folder (I have dedicated remote hardware to host and build these monstrous images), but everything was a chore. Then I switched to VSCode + Remote Development over SSH.

Imagine placing the workspace at the root directory of the entire Android source tree, pressing ctrl + shift + F and finding anything in less than a couple of seconds. For C/C++ code, press F12 just ANYWHERE on the code to go to the definition, no matter if it's the entire kernel code, or vendor or AOSP code: it just finds the definition at lightspeed.

For building I use the integrated console. If there is an error or a warning anywhere, you can just click on the console an it takes you to the file with the error/warning. Also it integrates perfectly with Git and has extensions to parse DeviceTree files.

And everything was just much more appreciated while working at home during pandemic.

It sounds like a testimonial advertising, but it's the way it is.

Re:The Era of Visual Studio Code by lima on Tuesday September 22, 2020 @07:15PM (#24561139)
> I use this setup primarily to have at least some sort of a barrier between my system and the gigabytes of NPM packages that get downloaded as dependencies.

You can do something similar with IntelliJ by running npm inside a Docker container with your working directory mounted into it. IntelliJ will happily index the resulting node_modules folder without executing any code on the host.

Re:The Era of Visual Studio Code by Vinnl on Wednesday September 23, 2020 @03:06AM (#24563887)
The only thing that's been preventing me from fully adopting this is that I don't have my local shell environment (autocomplete, syntax highlighting, etc.) anymore. Maybe I'll have to look at getting that setup in a container sometime, and then copy that over to every container I use.
Re:The Era of Visual Studio Code by sebastos on Sunday September 27, 2020 @05:24PM (#24610247)
You can add "-v" flags in the .devcontainer/ json file that map host stuff in so that you get all of that stuff!
Re:The Era of Visual Studio Code by halayli on Tuesday September 22, 2020 @09:56PM (#24562164)
I use clion by jetbrains and been using remote development feature for almost a year now.
Re:The Era of Visual Studio Code by sebastos on Wednesday September 23, 2020 @12:18AM (#24562932)
Maybe it works for literal remote development, but the jetbrains support for remote dev in a docker container is a complete afterthought. There's tons of critical, relevant feature requests that have been stuck in the pipeline for years. In vscode, it is well thought out and polished. My team desperately wanted development out of containers to ease on-boarding and standardization of development environments. Trying to make it work with CLion was a nightmare that was practically dead before it started, and we thought we'd never get it. Then we found vscode's support and have never looked back. I sometimes laugh looking back at what we were having to do to get it to even slightly work, and think about all the troubles we would have had ahead.
Re:The Era of Visual Studio Code by nka on Wednesday September 23, 2020 @02:07AM (#24563520)
I have built and used this[1] for some time now, ie. i run vim inside my devcontainer, and i'm happy with it.

[1] https://github.com/nikaro/devc

Re:The Era of Visual Studio Code by ravenstine on Tuesday September 22, 2020 @07:48PM (#24561387)
It's been pretty useful for developing on my Raspberry Pi. I wouldn't say the SSH feature is 100% polished, but it's pretty dang good.