VS Code for SFOS app development

More of a curiosity thing than an actual plan to develop anything (since i cant) but here goes.

Can you use VS code to develop SFOS apps and if yes how you set up something like that. What extensions you need etc.

1 Like

VS as in Visual Studio?

Yes; but it is based on Atom which they got with the GitHub purchase, and actually pretty good.

Visual Studio Code is not based on Atom and VSCode vastly predates Microsoft’s GitHub purchase by 8 years.

1 Like

Hmm, seems i was mistaken. I guess that explains why a few problems fixed in Atom are still in VS Code. The look-and-feel is really similar though.

But i must correct you back; it’s 3 years (2015 vs 2018).

1 Like

You’re right about the acquisition. Microsoft News hub shows 2023 (which did seem way too recent but I didn’t question it :smiley: )

1 Like

Visual Studio code, at least running on linux, is so painfully slow. I think it’s one of those, ‘works well on gaming boxes’ development tools. Like eclipse. It’s not really my style anyway but some people do swear by it. It could certainly be setup, but I think that’s a major project in and of itself.

Why do you ask?

You can, but it will not be the same experience as in Qt Creator.

For basic Qt/qml support you can use the experimental extension from Qt, at the time I was installing it was not available in the extension stores and I built it from sources. It will require qml language server which is not available in Sailfish IDE, but you can use one from official Qt SDK or PySide/PyQt. This language server will not work with Sailfish-specefic qml objects/modules, but it can be partially fixed by copying files from a SDK target to PySide/PyQt/official Qt SDK directory.

For C++ you can probably use official MS extensions. I don’t develop C++ apps right now and haven’t tested this. I believe the same approach with copying files like with Qml might work.

Not really related to Sailfish development, but for Pyotherside-based apps where Python language support is needed, in VSCodium/code-oss (VSCode without Microsoft telemetry) official MS pylance extension will not fully work. As an alternative I can recommend BasedPyright.

For building, deploying, etc. you can use Sailfish official sdk cli.

Wanted to share my own experience and setup. I develop my Pyotherside-based apps with a combination of Qt Creator and VSCodium (same as VSCode but without Microsoft telemetry). For Python I use VSCodium and BasedPyright extension. For qt and qml I use Qt Creator. I tried to setup everything to work with VSCodium, and I listed everything I did above, but at the end I sticked to using Qt Creator for this. For trantranslating, spec files I use VScode.

1 Like

I am using VS Code for professional and hoby C++ coding, Python coding, Markdown documents, bash scripting, CSV files manipulation, etc, except for Qt/Qml projects, where Qt Creator is more helpful IDE. Also, I use full Visual Studio if I want to create Windows msi packages. VS Code is excelent IDE, there exist an extension for everything, probably also for Qt and msi packaging, but I did not discover it. VS code is especially suitable if you have Win computer and using Linux through WSL2.

2 Likes

VSCode is absolutely not slow in itself. There are many extensions that make it slow, but vscode itself will notify you of these when it is the case.
It might be that your experience is with a specific language / extension that isn’t well developed (like java). I use it constantly for work with C#, nodejs & react, and in most cases it is faster than any development tool I’ve tried (visual studio, jetbrains tools, netbeans, etc). This is on Windows and Ubuntu, with direct development and remote development via ssh (you can develop with vscode via ssh on a remote machine).
That said, I have tried to develop some Qt in vscode some years ago, and it didn’t really work for sailfish. To enable it, someone has to develop some extensions which handle the build system, better code completion etc etc, which is a lot of work. When done correctly, it would probably be quite the improvement on QtCreator.

1 Like

Ok, I had just installed VScode for platformIO experiments and wasn’t impressed. I just tried it again, and it’s about as slow as QTcreator opening small size projects. But, it’s probably half aesthetics and half impatience, it’s not like I’m ‘impressed’ by creator either :slight_smile: My fully loaded (c++, pipico projects currently) emacs loads in 1/3 the time.

I could see that it might be of real advantage for C# stuff?

So it might be those platform IO extensions that slow it down?

What would you use for Java? I use bluej for teaching at the moment

If I understand emacs correctly, comparing it to vscode does not seem right to me. One is an extended text editor, the other a fully fledged development environment. Emacs isn’t meant for handling a full stack of projects, with code-completion and full debugging etc. It is mainly created to have an extended text editor. But I could be wrong, I never used emacs (after a short try), and was stuck with vi / vim after unlearning nano.
I don’t know about PlatformIO. After reading a bit on their website, it seems to me that they have quite a few tools included to ‘easily enable’ embedded development. It shouldn’t be slow opening any projects (the folder tree should be loaded almost instantly in all kinds of projects), but starting some extensions for the specific project(s) can be slow.

For Java I currently use Jetbrains Idea, which, sadly, isn’t free. Netbeans was great until some 10 years ago, but did not stay ahead. It might be ok now, haven’t tried it for some time.

Sure it is. I have completion (lsp-mode and lsp servers) and interactive debugger support for a number of different scenarios. C++, erlang (talking directly to beam and otherwise), scheme, nodejs and so on. It takes a bit of setup, but it’s no mere text editor. Considering it has a built in lisp interpreter, I don’t see where you have the idea that it’s a text editor. Now, I’m not sure about how language completion is supported in VSCode, but lsp is a common solution.

I use the evil mode for vim keybindings since that’s my style, but otherwise, emacs. I also use neovim with lsp in a similar manner and sometimes prefer that though I seem to break my setup more often. For QT stuff, I just use creator.

Just to get to see a PlatformIO project takes from startup to complete folder rendering over 6 seconds. That’s slow. But, maybe it’s my machine. I must admit, I just went back to a stable neovim setup for my arduino /pi pico stuff (or the arduino ide, which sucks).

I used netbeans a long time ago since it wasn’t as suck as eclipse, but I simply don’t do java anymore.

I think @tomin is one of those pure vim guys and @Thaodan an emacs user. Maybe they have some insights on the setups they use?

EDIT: and I feel like I hijacked this thread. I will try to see how that Qt Extension for VS Code works just to get a feeling for it.