The rust-analyzer extension requires functions that are not yet implemented by Theia
Download rust-analyzer.vsix from https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-04-13
Copy it to the plugins folder in theia's git tree
Also download the rust-analyzer-linux binary and name it rust-analyzer and make sure it's in Theia's server process PATH variable
run: $ yarn start:browser
Open http://localhost:3000 in your browser
Open a rust project, e.g. cargo init in a folder
Or clone some Rust project such as: https://github.com/yewstack/yew
OS and Theia version:
a187f0141015f3e00e0844bec10dd9c97414b7ec
Fedora on ppc64le (architecture not relevant to the bug, don't worry)
Diagnostics:
An error message appears on the bottom right:
"Activating extension rust-analyzer failed: vscode.languages.registerDocumentSemanticTokensProvider is not a function."
That's a new API: vscode.languages.registerDocumentSemanticTokensProvider. I'm not sure whether our Monaco version supports it. If not we should migrate to latest Monaco first.
For time being please use version of rustlant which does not make use of this API.
@akosyakov Okay! Thanks.
Well rust-analyzer is still an experimental project and they always only support very latest VS Code and its APIs. Currently I am using the older RLS, but the IDE experience is much better with rust-analyzer even though it's experimental.
I will see if it's possible to use latest rust-analyzer with slightly older extension.
Is it possible to know what version of VS Code extension API does Theia support?
@leo-lb Try this one: https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-03-30
I've checked new APIs for semantic highlighting were exposed in Monaco 0.20: https://github.com/microsoft/monaco-editor/commit/fce1d2eed86e3b18ad98101d726faa007adb5981#diff-57466b60666bb1ad21692625580200e1R4872-R4881
We should migrate again. cc @marcdumais-work @svenefftinge @RomanNikitenko
@leo-lb Try this one: https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-03-30
@akosyakov it tells me that for some weird reason..
Activating extension rust-analyzer failed: Text Content Document Provider for scheme 'rust-analyzer' is already registered.
But it seems to work anyways, maybe it tries to register it twice.
ok, we will investigate later, thank you for reporting!
@akosyakov hey, there's another issue with it:
root ERROR [hosted-plugin: 176924] matklad.rust-analyzer - Code actions of kind 'quickfix' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.
root ERROR Command with id 'rust-analyzer.applySourceChange' is not registered.
It's when you use this for example:

@akosyakov Maybe it's due to this: https://github.com/rust-analyzer/rust-analyzer/issues/2833
@akosyakov
I'm sorry, I missed your comment here.
Do you have the definite time-frame for the upgrade?
I'm not sure if I can help with upgrade Monaco this time - I have scheduled issues for the nearest sprint...
@scela @azatsarynnyy
I'm not sure if I can help with upgrade Monaco this time - I have scheduled issues for the nearest sprint...
@RomanNikitenko No, we don't. I am just brining attention that some stuff does not work without latest Monaco. Personally I'm preparing to work on https://github.com/eclipse-theia/theia/issues/7100 But I am not sure when it happens, so if in the meantime someone wants to make the upgrade old way it is fine.
I would like to test for theia, something like
if (!theia) {
register for semantic tokens;
}
Is this possible? Thanks, Mark.
hi there, fwiw, I'm new to theia and gitpod, but just gave it a try in GitPod and got the following error:
Activating extension rust-analyzer failed: Object.fromEntries is not a function.
has anyone had any luck with a previous version of rust-analyzer? as @leo-lb mentions, even though it is an experimental project, the development experience is much better with it :)
Update: I missed the comment about https://github.com/rust-analyzer/rust-analyzer/releases/tag/2020-03-30, that one seems to work :)
Activating extension rust-analyzer failed: Object.fromEntries is not a function.
Gitpod needs to use Node.js 12 to run this extension.
Since Monaco migration was merged and Theia was switched to Node.js 12, It should be possible to add missing support of semantic highlighting APIs to the plugin system.
Most helpful comment
@RomanNikitenko No, we don't. I am just brining attention that some stuff does not work without latest Monaco. Personally I'm preparing to work on https://github.com/eclipse-theia/theia/issues/7100 But I am not sure when it happens, so if in the meantime someone wants to make the upgrade old way it is fine.