Skip to content
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

rustlang: datatype helper? #1200

Closed
Kreyren opened this issue Feb 7, 2020 · 12 comments
Closed

rustlang: datatype helper? #1200

Kreyren opened this issue Feb 7, 2020 · 12 comments
Labels

Comments

@Kreyren
Copy link

Kreyren commented Feb 7, 2020

Apparently jetbrains products have a helper that outputs datatypes of rustlang in the editor:
image

Is there a way to get this in gitpod? I believe that it would help a lot with a development especially for new developers to understand the language better.

Relevant plugin: https://plugins.jetbrains.com/plugin/8182-rust

@Kreyren
Copy link
Author

Kreyren commented Feb 7, 2020

Relevant rust-lang/vscode-rust#374

@svenefftinge
Copy link
Member

It should be implemented in the rust vs code extension.

@Kreyren
Copy link
Author

Kreyren commented Feb 8, 2020

@svenefftinge can't confirm on my end

@svenefftinge svenefftinge added the type: feature request New feature or request label Feb 9, 2020
@Kreyren
Copy link
Author

Kreyren commented Feb 13, 2020

PSA As referrenced on rust-lang/vscode-rust#374 (comment) this is apparently implemented in rust-analyzer extension (https://github.com/rust-analyzer/rust-analyzer) which requires compilation to be imported on the vscode which results in following on gitpod:

gitpod /workspace/rustlang-fibonacci/rust-analyzer $ cargo xtask install
    Finished dev [unoptimized] target(s) in 0.06s
     Running `target/debug/xtask install`

will run: cargo --version
cargo 1.41.0 (626f0f40e 2019-12-03)

will run: cargo install --path crates/ra_lsp_server --locked --force
  Installing ra_lsp_server v0.1.0 (/workspace/rustlang-fibonacci/rust-analyzer/crates/ra_lsp_server)
    Updating crates.io index
    Finished release [optimized] target(s) in 0.62s
   Replacing /workspace/.cargo/bin/ra_lsp_server
    Replaced package `ra_lsp_server v0.1.0 (/workspace/rustlang-fibonacci/rust-analyzer/crates/ra_lsp_server)` with `ra_lsp_server v0.1.0 (/workspace/rustlang-fibonacci/rust-analyzer/crates/ra_lsp_server)` (executable `ra_lsp_server`)

will run: npm --version
6.13.7

will run: npm install
audited 199 packages in 2.902s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


will run: npm run package --scripts-prepend-node-path

> [email protected] package /workspace/rustlang-fibonacci/rust-analyzer/editors/code
> vsce package

Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish /workspace/rustlang-fibonacci/rust-analyzer/editors/code
> tsc && rollup -c


out/main.js → ./out/main.js...
(!) Mixing named and default exports
https://rollupjs.org/guide/en/#output-exports
The following entry modules are using named and default exports together:
out/main.js

Consumers of your bundle will have to use chunk['default'] to access their default export, which may not be what you want. Use `output.exports: 'named'` to disable this warning
created ./out/main.js in 2.7s
 DONE  Packaged: /workspace/rustlang-fibonacci/rust-analyzer/editors/code/rust-analyzer-0.1.0.vsix (6 files, 139.01KB)
 INFO  
The latest version of vsce is 1.73.0 and you have 1.71.0.
Update it now: npm install -g vsce

will run: code --version

will run: code-insiders --version

will run: codium --version

will run: code-oss --version
Error: install client

Caused by:
    Can't execute `code --version`. Perhaps it is not in $PATH?

@Kreyren
Copy link
Author

Kreyren commented Feb 13, 2020

WIP contribution to rls-vscode also have this issue on gitpod

gitpod /workspace/rls-vscode $ npm run installDevExtension

> [email protected] installDevExtension /workspace/rls-vscode
> npm install && ./node_modules/.bin/vsce package -o ./out/rls-vscode-dev.vsix && code --install-extension ./out/rls-vscode-dev.vsix

up to date in 11.565s
Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish /workspace/rls-vscode
> npm run check:version && npm run lint && npm run compile


> [email protected] check:version /workspace/rls-vscode
> node cmd/check-version.js


> [email protected] lint /workspace/rls-vscode
> tslint --config ./tslint.json './src/**/*.ts'


> [email protected] compile /workspace/rls-vscode
> tsc -p ./

 DONE  Packaged: /workspace/rls-vscode/out/rls-vscode-dev.vsix (85 files, 157.23KB)
 WARNING  
The latest version of vsce is 1.73.0 and you have 1.64.0.
Update it now: npm install -g vsce
sh: 1: code: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] installDevExtension: `npm install && ./node_modules/.bin/vsce package -o ./out/rls-vscode-dev.vsix && code --install-extension ./out/rls-vscode-dev.vsix`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] installDevExtension script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitpod/.npm/_logs/2020-02-13T16_12_36_710Z-debug.log

@Kreyren
Copy link
Author

Kreyren commented Feb 13, 2020

Setting executable code that returns exit 0 fixes the issue on vscode-rls

@Kreyren
Copy link
Author

Kreyren commented Feb 13, 2020

FWIW the rust-analyzer also fails with what i assume is interference from built-in extension

image

@Kreyren
Copy link
Author

Kreyren commented Feb 22, 2020

FWIW: Rust analyzer is now available as official vscode extension

Tried to implement it with required datatype helper on https://github.com/RXT0112/Zernit/tree/6ceaff2979918b85654a9397072b8e97408cdab6

which results in:

[Error - 9:46:02 PM] Notify file events failed.
TypeError: vscode.languages.registerSelectionRangeProvider is not a function
    at SelectionRangeFeature.registerLanguageProvider (/tmp/vscode-extensions/[email protected]/extension/out/main.js:11669:34)
    at SelectionRangeFeature.register (/tmp/vscode-extensions/[email protected]/extension/out/main.js:9261:33)
    at SelectionRangeFeature.initialize (/tmp/vscode-extensions/[email protected]/extension/out/main.js:11647:14)
    at LanguageClient.initializeFeatures (/tmp/vscode-extensions/[email protected]/extension/out/main.js:11014:21)
    at connection.initialize.then (/tmp/vscode-extensions/[email protected]/extension/out/main.js:10699:18)

I assume this being theia bug?

@Kreyren
Copy link
Author

Kreyren commented Feb 22, 2020

ping @JesterOrNot Can you take a look at this and approve for transfer if this is a theia bug so that i am not flooding their bug tracker with something that might be a gitpod bug? ^-^

@svenefftinge
Copy link
Member

Yes, seems like we need to implement that API in Theia. Could you open a ticket there?

@llebout
Copy link

llebout commented Apr 19, 2020

eclipse-theia/theia#6623 was solved.
Another API missing: eclipse-theia/theia#7608

@Kreyren
Copy link
Author

Kreyren commented Jun 28, 2020

It seems to be implemented now ^-^

Assuming solved

@Kreyren Kreyren closed this as completed Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants