-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Rust-Analyzer Plugin #9136
Comments
I tried to use I also receive that error message, but do not get any functionality; however, my method of installing it is different. For this particular version of the plugin I'm asked to download the following Language server: The terminal output is:
Newest version with the same error:The latest version of the plugin that doesn't give the double notification is Otherwise After that version it looks like |
Starting to compare the VSCode registerTextDocumentContentProvider and the Theia registerTextDocumentContentProvider though I don't have any TypeScript experience nor do I know how the plugin system works under the hood for Theia. From the main.js in the extension starting at line 17546:
Registering the "dumb" onEnter seems to be causing the triple? register where the second notification "Cannot activate rust-analyzer: Text Content Document Provider for scheme 'rust-analyzer' already registered" is displayed. |
For a currently unknown reason, when I use However, neither of those buttons work. The same two error notifications occur as shown in the initial issue. Status output from the
After the 'run' button is clicked, the terminal outputs:
When starting Theia, further up from the registering error in the terminal output is the following error output:
I also tried the latest non-nightly release straight from the rust-analyzer github repo. I used With the terminal output:
Note: This open-vsx package is not searchable in the "Extensions: OPEN VSX REGISTRY" search
|
@RodogInfinite just to mention, the oldest version on open-vsx (which is the open-source marketplace the extensions-view uses) for |
@vince-fugnitto what would be the latest |
@RodogInfinite the latest api version supported at the moment is
Anything targeting a range higher than |
@vince-fugnitto I have the same issue highlighted in the original comment ( Is it a know issue that is being worked on? |
@jeluard feel free to pick up the issue 👍 |
@RodogInfinite @jeluard the documentation states the following, do you perhaps have both installed at the same time:
|
@vince-fugnitto I do not, no. Also note that I can see the following log twice when starting theia, not sure if expected: root INFO [hosted-plugin: 24611] PLUGIN_HOST(24611): PluginManagerExtImpl/init()
root INFO [hosted-plugin: 24611] PLUGIN_HOST(24611): initializing(rust-analyzer@0.2.497 with /Users/julien/Documents/Projects/jeluard/theia/packages/plugin-ext-vscode/lib/node/plugin-vscode-init.js)
... |
@vince-fugnitto I also do not have the official Rust extension installed simultaneously with Rust-Analyzer. I can successfully get it running in VSCode with no issues |
Also note that I can see this error, unsure if relevant: root ERROR [ad35fa06-5576-40ac-b57a-3ee6f24ac816][matklad.rust-analyzer]: Failed to load 'configuration' contribution. TypeError: Cannot create property 'scope' on boolean 'false'
at Object.fromPreferenceSchemaProperty (http://localhost:3000/bundle.js:144722:31)
at PreferenceSchemaProvider.../../packages/core/lib/browser/preferences/preference-contribution.js.PreferenceSchemaProvider.doSetSchema (http://localhost:3000/bundle.js:120041:82)
at PreferenceSchemaProvider.../../packages/core/lib/browser/preferences/preference-contribution.js.PreferenceSchemaProvider.setSchema (http://localhost:3000/bundle.js:120122:28)
at http://localhost:3000/56.bundle.js:7781:103
at pushContribution (http://localhost:3000/56.bundle.js:7772:32)
at _loop_1 (http://localhost:3000/56.bundle.js:7781:17)
at PluginContributionHandler.push.../../packages/plugin-ext/lib/main/browser/plugin-contribution-handler.js.PluginContributionHandler.handleContributions (http://localhost:3000/56.bundle.js:7786:21)
at _loop_2 (http://localhost:3000/56.bundle.js:969:63)
at HostedPluginSupport.push.../../packages/plugin-ext/lib/hosted/browser/hosted-plugin.js.HostedPluginSupport.loadContributions (http://localhost:3000/56.bundle.js:990:17)
at HostedPluginSupport.<anonymous> (http://localhost:3000/56.bundle.js:836:52) |
I am playing with Theia locally to see if it fits for a Rust project and i also do not have any other Rust extensions installed. I was not able to get However, there is this line in
Is that the official extension? do i need to remove it? |
@statictype that extension is the official rust builtin extension packaged with vscode, it related to the following: It mainly contributes syntax-highlighting and snippets for the rust programming language. |
Despite the initial error, I do see that It may help narrow down your issues and investigations. I'm using the following version (which is API compatible): |
i'm not a rust developer myself, will have to check back with the team to see if it works entirely or partially. |
@vince-fugnitto Indeed this version looks better, although there is still the original issue. The other issue I encountered disappeared, it might be the one preventing the plugin to work at all. |
@jeluard the log is also present in vscode when investigating their devtools console: For other versions of the extension I also get errors in vscode:
Perhaps the extension itself has issues, and newer versions are not supported. |
@vince-fugnitto Nice find! I will follow up with the Somehow it's working ok for me on regular VSCode (on OSX). It might be more resilient to those issues? |
@statictype & @jeluard |
@RodogInfinite Nice catch too! No it doesn't, and I get the following error: ERROR Error: Command with id 'rust-analyzer.runSingle' is not registered. |
I'm unable to look at this deeply at the moment, but one thing to look for is which version first implemented the "run" and "debug" buttons. It may have appeared after the |
I meant that the buttons are there, but broken. |
So the official Rust plugin is tracking to merge with rust-analyzer (rust-lang/vscode-rust#812, rust-lang/rust-analyzer#4224) and when "rust-lang" is installed, rust-analyzer can be selected as the server from the settings; however, I don't get syntax highlighting nor the |
With latest theia 1.12.0 and latest root ERROR [hosted-plugin: 11849] Activating extension 'rust-analyzer' failed: TypeError: Class extends value undefined is not a constructor or null
at /Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:12905:63
at createCommonjsModule (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:66:9)
at Object.<anonymous> (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:11119:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.module._load (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/node_modules/@theia/plugin-ext-vscode/lib/node/plugin-vscode-init.js:67:33)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
root ERROR [hosted-plugin: 11849] Activating extension 'Git (built-in)' failed: TypeError: n.window.registerFileDecorationProvider is not a function
at new c (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/vscode-builtin-git/extension/dist/main.js:10:472547)
at new t.GitDecorations (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/vscode-builtin-git/extension/dist/main.js:10:474947)
at _ (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/vscode-builtin-git/extension/dist/main.js:1:79118)
at async T (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/vscode-builtin-git/extension/dist/main.js:1:80865)
at async t.activate (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/vscode-builtin-git/extension/dist/main.js:1:81734) @vince-fugnitto maybe this rings a bell? |
FWIW the line triggering the error is: class LSPCancellationError extends vscode__default['default'].CancellationError { |
More context: this has been introduced in VSCode It looks like recent vscode-languageserver-node depend on it. |
Moving back to an older version, root ERROR [hosted-plugin: 62023] Activating extension 'rust-analyzer' failed: Error: Text Content Document Provider for scheme 'rust-analyzer' is already registered
at WorkspaceExtImpl.registerTextDocumentContentProvider (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/node_modules/@theia/plugin-ext/lib/plugin/workspace.js:285:19)
at Object.registerTextDocumentContentProvider (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/node_modules/@theia/plugin-ext/lib/plugin/plugin-context.js:497:37)
at viewHir (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:18678:58)
at Ctx.registerCommand (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:19264:21)
at tryActivate (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:21340:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async activate (/Users/julien/Documents/Projects/paritytech/substrate-playground/templates/theia-playground/plugins/rust-analyzer/extension/out/src/main.js:21268:5) Not sure how to debug that. |
When adding some traces, I can see that
Not clear why. If I remove the check so that this function doesn't fail anymore, I then hit another error: root ERROR [hosted-plugin: 74313] Promise rejection not handled in one second: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered , reason: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered
root ERROR [hosted-plugin: 74313] With stack trace: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered
at TextContentResourceResolver.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.TextContentResourceResolver.registerContentProvider (http://localhost:3000/48.bundle.js:19659:19)
at WorkspaceMainImpl.<anonymous> (http://localhost:3000/48.bundle.js:19606:39)
at step (http://localhost:3000/48.bundle.js:19302:23)
at Object.next (http://localhost:3000/48.bundle.js:19283:53)
at http://localhost:3000/48.bundle.js:19277:71
at new Promise (<anonymous>)
at push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.__awaiter (http://localhost:3000/48.bundle.js:19273:12)
at WorkspaceMainImpl.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.WorkspaceMainImpl.$registerTextDocumentContentProvider (http://localhost:3000/48.bundle.js:19603:16)
at RPCProtocolImpl.push.../node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js.RPCProtocolImpl.doInvokeHandler (http://localhost:3000/39.bundle.js:1373:23)
at RPCProtocolImpl.push.../node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js.RPCProtocolImpl.invokeHandler (http://localhost:3000/39.bundle.js:1358:41)
Promise rejection not handled in one second: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered , reason: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered
With stack trace: Error: Text Content Resource Provider for scheme 'rust-analyzer' is already registered
at TextContentResourceResolver.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.TextContentResourceResolver.registerContentProvider (http://localhost:3000/48.bundle.js:19659:19)
at WorkspaceMainImpl.<anonymous> (http://localhost:3000/48.bundle.js:19606:39)
at step (http://localhost:3000/48.bundle.js:19302:23)
at Object.next (http://localhost:3000/48.bundle.js:19283:53)
at http://localhost:3000/48.bundle.js:19277:71
at new Promise (<anonymous>)
at push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.__awaiter (http://localhost:3000/48.bundle.js:19273:12)
at WorkspaceMainImpl.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.WorkspaceMainImpl.$registerTextDocumentContentProvider (http://localhost:3000/48.bundle.js:19603:16)
at RPCProtocolImpl.push.../node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js.RPCProtocolImpl.doInvokeHandler (http://localhost:3000/39.bundle.js:1373:23)
at RPCProtocolImpl.push.../node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js.RPCProtocolImpl.invokeHandler (http://localhost:3000/39.bundle.js:1358:41) Also the following error happens sometimes: root ERROR Error: Text Content Resource Provider for scheme 'rust-analyzer' has not been registered
at TextContentResourceResolver.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.TextContentResourceResolver.unregisterContentProvider (http://localhost:3000/48.bundle.js:19680:19)
at Object.<anonymous> (http://localhost:3000/48.bundle.js:19607:112)
at Object.disposable.dispose (http://localhost:3000/bundle.js:61019:13)
at DisposableCollection.../node_modules/@theia/core/lib/common/disposable.js.DisposableCollection.dispose (http://localhost:3000/bundle.js:60996:40)
at WorkspaceMainImpl.push.../node_modules/@theia/plugin-ext/lib/main/browser/workspace-main.js.WorkspaceMainImpl.dispose (http://localhost:3000/48.bundle.js:19376:24)
at WorkspaceMainImpl.disposable.dispose (http://localhost:3000/bundle.js:61019:13)
at DisposableCollection.../node_modules/@theia/core/lib/common/disposable.js.DisposableCollection.dispose (http://localhost:3000/bundle.js:60996:40)
at RPCProtocolImpl.push.../node_modules/@theia/plugin-ext/lib/common/rpc-protocol.js.RPCProtocolImpl.dispose (http://localhost:3000/39.bundle.js:1211:24)
at RPCProtocolImpl.disposable.dispose (http://localhost:3000/bundle.js:61019:13)
at DisposableCollection.../node_modules/@theia/core/lib/common/disposable.js.DisposableCollection.dispose (http://localhost:3000/bundle.js:60996:40) This implies |
@vince-fugnitto Where should I look if I want to add CancellationError ? A bit lost here :) |
@jeluard I haven't investigated the issue further or verified what changes might be necessary in the framework for it to work correctly. The The API will need to be defined in |
Some current issues here:
|
As far as I can tell, both |
Bug Description:
No rust-analyzer functionality. Appears in settings and commands, but doesn't work.
Terminal output:
Notifications:
![image](https://user-images.githubusercontent.com/22568404/109397284-02477680-7904-11eb-9f2b-bc28c9dcadf0.png)
Steps to Reproduce:
"rust-analyzer":"https://github.com/rust-analyzer/rust-analyzer/releases/download/2020-11-16/rust-analyzer.vsix"
Additional Information
The text was updated successfully, but these errors were encountered: