How do I tell VS code what toolchain I want to use? - rust

After installing extensions for Rust, I get this error:
To properly function, the extension needs to know what toolchain you
want to use.

Press Close to select toolchain :)

The extension will provide a prompt after you close that prompt, which allows you to select the toolchain you want. You can see the toolchain that you selected in your preferences file.

As the message says, you must choose a toolchain (documentation here):
$ rustup default stable
for the stable Rust, or
$ rustup default nightly
for the newest development version.
If you only want to play with Rust, I advise you to use nightly Rust because there are more new things in it.

Add this to your configuration with toolchain you want to use to enforce it in VS Code:
"rust.rustup": {
"toolchain": "stable-x86_64-apple-darwin"
}

Related

How to downgrade Kotlin version

I've build a complete empty Project and I got this error:
e: This version (1.0.0-alpha13) of the Compose Compiler requires Kotlin version 1.4.30 but you appear to be using Kotlin version 1.4.32 which is not known to be compatible. Please fix your configuration (or suppressKotlinVersionCompatibilityCheck but don't say I didn't warn you!).
What can I do? (Sorry for this dumb question, but I'm complete new to Kotlin)
Thanks, Boothosh
You can go to Plugins in the IDE settings and uninstall the Kotlin one there, and do Install From Disk (under the gear icon) and use one of these: https://plugins.jetbrains.com/plugin/6954-kotlin/versions - you'd probably need to update your gradle files too (I haven't done any of this before so I can't tell you if it works or if you'll run into problems)
Why not just use a newer version of Compose though? They're up to beta 6 now - I can't even see an alpha 13 listed! Seems like a better idea all round, unless there's a really specific reason you need that version you're using?

Use nightly rustfmt with stable compiler in CLion

I am running into an unexpected issue when it comes to toolchains in CLion. I want to use the stable channel for the compiler while using the nightly for rustfmt. The reason is that I want to use rustfmt features that are not available in the stable version. Unfortunately CLion only picks up the currently selected toolchain without any way to override or customize this and thus has not option to select the nightly of rustfmt for formatting. Is there any workaround or option I did not notice when looking for it?
In the comment there was the suggestion that cargo +nightly fmt might be what I am looking for. Even though it allows to used the nightly of rustfmt it is not integrated into the flow of CLion which seems to use the currently enabled version of the entire toolchain.
Under Clion | Preferences...:
search for formatter
select Rustfmt on the left column
add +nightly to the Additional arguments: box
check Use rustfmt instead of the built-in formatter
click Ok
Now Code | Reformat File with rustfmt should respect rustfmt nightly settings. (CLion 2022.2.4)

How to enable atom-racer documentation in popup list?

The popup list works, but doesn't display the documentation of the selected item.
In package settings the "Show Documentation" and "Include Signature in Documentation" options are enabled.
How to make it look like this?
I'm using:
autocomplete-racer 0.1.3
Racer 2.0.6
Atom 1.13.1
Rust 1.16.0
Gentoo x86_64
If you still haven't figured this out, simply try disabling or uninstalling the racer package.
The autocomplete-racer package implements its own autocomplete provider which includes the documentation you're after. Based on what you're reporting, the racer package is probably taking precedence and as such you'd be limited to its autocomplete provider. Use one or the other, not both.

Eclipse with powerpc-linux-gcc possible?

I program a embedded Linux on a separate target. For that I use Eclipse as a editor and the powerpc-linux-gcc.
That's a bit uncomfortable.
Is it possible to use a powerpc-linux-gcc in Eclipse?
Yes, but you want to install (via Help -> install new software -> from all available sources -> Mobile and device development) C/C++ cross compiler support and possibly C/C++ GDB hardware debugging.
When you start new project, selecet C or C++ project, then Executable, then "empty project" (or something else) and then make sure, in to selecet "Cross gcc" in right listbox. Press Next button until the page with cross compiler prefix and path shows. There you need to enter prefix (powerpc-linux- in your case) and you can also select your compiler's directory (if you have not added it to path).
When you have project set up this way, selected toolchain is used to build. You can alse set up "GDB hardware debugging" session to debug your application remotely.

How can a Linux source package be opened as a project in an IDE?

I am makeing a small mod to SMPlayer; the Linux version...
The make, sudo make install from the command line works, but I would like to have the project in an IDE.
I want to use CodeBlocks IDE, only because I've used it before, but if some other IDE is required, I can use that instead... (I use Codeblocks because it is simple, and that suits my current ability to handle an IDE)..
Is there some way to use SMPlayer's Makefile, or some such thing?
This depends on the IDE and has little to nothing to do with Linux.
Does your program come with something like cmake or another setup tool? That normally makes it much easier. For example in KDevelop you can import straight from CMakeLists.txt and Makefiles.
If all else fails it might be quite easy to do something like this (not knowing your specific IDE):
Add new Project
Set build directory and other necessary settings (like compiler and compiler flags)
Add the already existing files to it.
Press "Compile"-button.
This is obviously depending on the project structure, setup and size.
Code::Blocks has builtin support for Makefile projects. See the FAQ.
Also you could just use vim or emacs ;)

Resources