eclipse-corrosion / corrosion Goto Github PK
View Code? Open in Web Editor NEWEclipse Corrosion - Rust edition in Eclipse IDE
License: Eclipse Public License 2.0
Eclipse Corrosion - Rust edition in Eclipse IDE
License: Eclipse Public License 2.0
I'm trying to reproduce #57.
From a new Eclipse for Rust developers package, with a new workspace, I create a new Rust project. So far, so good. Then, at the end of the newly opened file, I paste the following code let mut x: Vec = Vec::new();
. I see the code isn't pasted, IDE freeze then crashes.
Support running Rust/Cargo projects within Eclipse
The p2 site (https://lucasbullen.github.io/corrosion/site/) does not work for installing the plugin, as documented in documentation/Installation.md
.
Syntax highlighting of a valid Rust code is incorrectly done. Here is a sample:
fn main() {
println!("Hello, world!");
}
lazy_static!{
pub static ref bar : Vec<&'static str> =
vec!["a", "b", "c", "d", "e"];
pub static ref t: i32 = 0;
}
fn foo() {
}
Here is the incorrect syntax highlighting performed by redOx:
Here is the correct syntax highlighting performed by RustDT:
Using EPP package from https://ci.eclipse.org/packaging/job/photon.epp-tycho-build/lastSuccessfulBuild/artifact/org.eclipse.epp.packages/archive/
Ctrl+Space doesn't work as it doesn't trigger content-assist. Looking in Quick-Access/Ctrl+3, I don't even see the generic content assist command available. I believe the package misses a handler for this command.
This is a suggestion. The completion assist is shown even inside of the comment sections.
Reproduce steps:
Expected result:
Actual result:
To be sustainable and welcoming of new contributors, Corrosion should set up a CI system and also make the snapshots of latest build constantly available for testing.
I suggest Corrosion can mimic how aCute is setup: https://ci.eclipse.org/acute/ It uses the Jenkins pipeline plugin and Jenkinsfile and so far, it works great.
Currently the base gdb
command is being used instead of the correct rust-gdb
causing pretty print not being applied and in turn complex variables are unreadable.
Eclipse version: Oxygen.2 (4.7.2)
RedOx version: 0.1.0.201801181621
Enhanced Class Decompiler version: 3.0.0.201709092115
Every time I open a decompiled (Java) ".class" file using the "Enhanced Class Decompiler" the following popup shows up:
An error has occurred. See error log for more details.
org.eclipse.jdt.internal.ui.javaeditor.InternalClassFileEditorInput cannot be cast to org.eclipse.ui.part.FileEditorInput
Strangely enough, this error occurs when neither the Rust-perspective is selected, nor any RedOx-specific view is open and can easily be reproduced. It disappears after uninstalling RedOx.
As this is a new project, it'd be better to initiate it under EPLv2 and to update headers before it becomes too tedious.
Wizard interface for the cargo new/init
command.
Support for the tags:
--vcs VCS
- Setting up the project with a certain version control system (git, hg, pijul, fossil)
--bin
/--lib
- Using a binary or library template
--name NAME
- Setting the name of the project
lsp4e uses the system defaults for formatting parameters, this includes the tabs/spaces option. However, Rust formatting guide says that spaces should be used instead of tabs. In VS Code, no matter the workspace settings formatting is done with spaces.
Options for fixing:
Hi!
Thank you for cool project! I can't wait to play with it!
I got following error message then try to install the plugin. I tried to install it in Eclipse Neon3 CDT using p2 repository:
Cannot complete the install because one or more required items could not be found.
Software being installed: Corrosion: Rust edition in Eclipse IDE 0.1.0.201802061310 (org.eclipse.corrosion.feature.feature.group 0.1.0.201802061310)
Missing requirement: Rust edition in Eclipse IDE 0.1.0.201802061310 (org.eclipse.corrosion 0.1.0.201802061310) requires 'bundle org.eclipse.ui.genericeditor 1.0.1' but it could not be found
Cannot satisfy dependency:
From: Corrosion: Rust edition in Eclipse IDE 0.1.0.201802061310 (org.eclipse.corrosion.feature.feature.group 0.1.0.201802061310)
To: org.eclipse.corrosion [0.1.0.201802061310]
Eclipse Oxigen 2 CDT:
Cannot complete the install because one or more required items could not be found.
Software being installed: Corrosion: Rust edition in Eclipse IDE 0.1.0.201802061310 (org.eclipse.corrosion.feature.feature.group 0.1.0.201802061310)
Missing requirement: Language Server Protocol client for Eclipse IDE (Incubation) 0.6.0.201801160955 (org.eclipse.lsp4e 0.6.0.201801160955) requires 'bundle org.eclipse.jface.text 3.13.0' but it could not be found
Cannot satisfy dependency:
From: Corrosion: Rust edition in Eclipse IDE 0.1.0.201802061310 (org.eclipse.corrosion.feature.feature.group 0.1.0.201802061310)
To: org.eclipse.lsp4e [0.6.0.201801160955]
No mater via Marketplace or using p2 repository - the result is same.
The link https://github.com/LucasBullen/redox.github.io
does not work. Eclipse says this is not a valid update site.
The link that works is this: https://raw.githubusercontent.com/LucasBullen/redox.github.io/master/
.
Several Launch Config classes are extremely similar. The code should be better factorized instead of duplicated.
Performing the install found at https://rustup.rs/ from an action accessible in the preferences page would allow new users to setup their system without ever having to go into the command line.
To help debug issues, having the communications between the language server and the client recorded and easily accessible would greatly assist in diagnostics and reporting of issues.
When running
mvn clean verify
for the first time after importing it in eclipse, you get the error
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:1.0.0:build-qualifier (default-build-qualifier) on project org.eclipse.corrosion: Working tree is dirty.
[ERROR] git status org.eclipse.corrosion:
[ERROR]
[ERROR] Changes not staged for commit:
[ERROR] modified: org.eclipse.corrosion/.gitignore
[ERROR]
[ERROR] Untracked files:
[ERROR] org.eclipse.corrosion/.settings/org.eclipse.m2e.core.prefs
[ERROR]
[ERROR] You are trying to use tycho-buildtimestamp-jgit on a directory that has uncommitted changes (see details above).
[ERROR] Either commit all changes/add files to .gitignore, or enable fallback to default timestamp provider by configuring
[ERROR] jgit.dirtyWorkingTree=warning for tycho-packaging-plugin
[ERROR] -> [Help 1]
because of the generated dotfiles for eclipse.
Adding those files to .gitignore would help for this. Also this files are generated when importing the project as maven project.
Having a one click download and use version of Corrosion will increase usability and user adoption along with making it lighter weight for users.
Now i can only open an rust project over the
Open Projects from Filesystem ...
But i can not import an rust project like other projects in eclipse as example maven,gradle etc.
It would help, if there were an import option for rust projects into the workspace.
A test suite to confirm the functionality of getting/setting the default toolchain and UI of the preferences page
To ease testing of Corrosion without having to run multiple Eclipse instances, is there a way to generate a local update site or an archive that can be provided to Eclipse in order to install a locally built version of Corrosion?
These are all sent from the RLS to an LSP client and are only used to improve
the user experience by showing progress indicators.
rustDocument/beginBuild
: notification, no arguments. Sent before arustDocument/diagnosticsBegin
: notification, no arguments. Sent beforerustDocument/diagnosticsEnd
: notification, no arguments. Sent when a buildThe following request is to support Rust specific features.
rustDocument/implementations
: request
params: [TextDocumentPositionParams]
result: [Location] []
List all implementation blocks for a trait, struct, or enum denoted by the
given text document position.
Open any rust file. Try to autocomplete any macro like println or write just to find they are not in the list at all.
When attempting to install the plugin in Eclipse Oxygen 2, I get the following exception:
java.lang.IllegalArgumentException: No such member: attributes
at org.eclipse.equinox.internal.p2.metadata.ProvidedCapability.getMember(ProvidedCapability.java:85)
at org.eclipse.equinox.internal.p2.metadata.expression.Member$DynamicMember.invoke(Member.java:47)
at org.eclipse.equinox.internal.p2.metadata.expression.Member$DynamicMember.evaluate(Member.java:42)
at org.eclipse.equinox.internal.p2.metadata.expression.Matches.evaluate(Matches.java:36)
at org.eclipse.equinox.internal.p2.metadata.expression.And.evaluate(And.java:26)
at org.eclipse.equinox.internal.p2.metadata.expression.Unary.evaluate(Unary.java:42)
at org.eclipse.equinox.internal.p2.metadata.expression.Exists.evaluate(Exists.java:29)
at org.eclipse.equinox.internal.p2.metadata.expression.CollectionFilter.evaluate(CollectionFilter.java:58)
at org.eclipse.equinox.internal.p2.metadata.expression.MatchExpression.evaluate(MatchExpression.java:44)
at org.eclipse.equinox.p2.query.ExpressionMatchQuery.isMatch(ExpressionMatchQuery.java:86)
at org.eclipse.equinox.p2.query.ExpressionMatchQuery.perform(ExpressionMatchQuery.java:73)
at org.eclipse.equinox.p2.query.ExpressionMatchQuery.perform(ExpressionMatchQuery.java:63)
at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query(IndexProvider.java:23)
at org.eclipse.equinox.internal.p2.metadata.index.IndexProvider.query(IndexProvider.java:32)
at org.eclipse.equinox.internal.p2.director.Slicer.expandRequirement(Slicer.java:183)
at org.eclipse.equinox.internal.p2.director.Slicer.processIU(Slicer.java:146)
at org.eclipse.equinox.internal.p2.director.Slicer.slice(Slicer.java:65)
at org.eclipse.equinox.internal.p2.director.SimplePlanner.getSolutionFor(SimplePlanner.java:331)
at org.eclipse.equinox.internal.p2.director.SimplePlanner.getProvisioningPlan(SimplePlanner.java:387)
at org.eclipse.equinox.internal.p2.operations.PlannerResolutionJob.runModal(PlannerResolutionJob.java:76)
at org.eclipse.equinox.p2.operations.ProfileChangeOperation.resolveModal(ProfileChangeOperation.java:115)
at org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard$2.run(ProvisioningOperationWizard.java:295)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
with session data:
eclipse.buildId=4.7.2.M20171130-0510
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.cpp.product
Command-line arguments: -data file:<home_dir>/eclipse-workspace/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product
This might be related to Bug 528387.
By the way, installing Eclipse Photon 4.8 (still in beta stage as of now) solves the issue. Still, can you please provide a workaround for people using the stable version of Eclipse?
Today I installed corrosion plugin via the eclipse market place.
When I first open up eclipse with a trivial rust project, content assist appears to work..
ie I have the following ..
let mut x: Vec = Vec::new();
then
x. gives me a list of vector functions.. ( tho' not all of them .. I never see iter() for example)
then when I use this feature a couple of times the list goes away
.. restart eclipse and it seems to work again.
Is there a way for me to debug this?
Eclipse corrosion plugin: Corrosion: Rust edition in Eclipse IDE 0.1.0.201804131828 org.eclipse.corrosion.feature.feature.group Red Hat Inc.
Platform : ubuntu 14.4
eclipse oxygen Apr-2018
rustc --version
rustc 1.25.0 (84203cac6 2018-03-25)
rust language server appears to be running ..
ps -ef | grep rls
david 22008 21937 0 21:52 ? 00:00:03 /home/david/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rls
Add support to the Generic Editor for Cargo.toml files: http://doc.crates.io/manifest.html
While the Redox name is nice for a project in Rust, it is already used by another great project in Rust : the Redox OS project. Since the Redox project is currently pretty active, another unrelated project with a really similar name is really confusing.
The project is still young, having a name change now would not be too harmful.
When selecting an dependencie in the .toml file it could redirect the user to the crates.io site of it. Kinda like intellij is doing it. This would open the browser with the following url https://crates.io/crates/dependency_name/version .
Dont know what the best approach would be. An icon on the left side of the editor or with an submenu in rightklick.
No autocomplete for function, No code format , No build
When create cargo project, alert " Cargo command not found. Fix path in the Rust Preferences Page.", but do set cargo path (rust stable 32bit on windows).
This error appears in the workspace logs when I try to debug a simple main function:
!ENTRY org.eclipse.core.jobs 4 2 2018-05-15 01:14:08.044
!MESSAGE An internal error occurred during: "Launching New_configuration".
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at org.eclipse.core.runtime.Path.initialize(Path.java:641)
at org.eclipse.core.runtime.Path.<init>(Path.java:238)
at org.eclipse.core.runtime.Path.<init>(Path.java:186)
at org.eclipse.core.runtime.Path.fromOSString(Path.java:92)
at org.eclipse.corrosion.RustGDBLaunchWrapper.getGDBLocation(RustGDBLaunchWrapper.java:75)
at org.eclipse.corrosion.RustGDBLaunchWrapper.getLaunchEnvironment(RustGDBLaunchWrapper.java:56)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.getGDBVersion(GdbLaunch.java:524)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:142)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:101)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:90)
at org.eclipse.corrosion.debug.RustDebugDelegate.launch(RustDebugDelegate.java:95)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Steps to reproduce:
Create a new cargo project from the eclipse UI
Set a breakpoing in the only available line println!("Hello, world!");
Create a new debug configuration for target "run".
It gives that error as result
Add a run configuration for testing rust projects.
"Export > Rust Crate Package" should be in a "Rust" category, currently in Others
Trying to launch rust project ends up in "Unable to find project". Reverting to two days old commit makes it work again.
With 0c68cee, snippets have been added to completion assist. Users should be able to turn on/off snippet completion and add their own within a Rust preferences sub menu.
To ensure passing of test suite with each PR, Travis CI should be integrated into this repo
It should be very similar for support of Go, and much less work, then in previous work of @GoClipse and @RustDT by @bruno-medeiros
The project contents are not shown. You only see the project name/folder, and you can't expand it right after you create it. I also tried creating the project manually. It still doesn't work.
I had to manually switch to the Rust perspective, but the project explorer still shows an empty project.
I tried a brand new installation getting an Eclipse package, and through the Eclipse installer too. Both times I went to the marketplace, installed Corrosion, restarted Eclipse, and created a new project. The bug is still present.
Config:
LUbuntu 18.04LTS x64
OpenJDK 10.0.1 2018-04-17
Clicking "Install" on the preference page to get rustup turns the button inot "Installing", but nothing much happens before that. Clicking it should enable some project report or at least an eye-candy while installation is processing.
When built, the feature.xml files locks to a specific version of each dependency. In most cases, this is not desired as it can make updates of other extensions failing. For example, the dependency on mylyn.wilkitext on the feature here could prevent from updating mylyn because Corrosion locks it to a specific version on the feature.
The rule is generally to "include only what you build" in the feature.
Other dependencies can be added as extra to the p2 repo so they can be resolved at best during installation. See for example how aCute does that:
This will quickly become a blocker for people who want to try Corrosion, or even if we want to make progress with integration in SimRel and packaging as an EPP product.
To ease configuration of GDB, Corrosion should ship a "Rust/Debug" preference page pointing to GDB pref page
With the code:
fn main() {
let mut a = "first";
println!("Hello, world!");
println!("The value of x is: {}", a);
}
println!("Hello, world!");
linesecond
Prints The value of x is: second
Prints The value of x is: first
See https://github.com/rust-lang-nursery/rustfmt for details about it.
When editing .rs file in Generic Editor and LS working, the cursor is blinking a lot (too much). This is probably a bad smell that some processing is happening for no reason.
If a toolchain is missing (e.g. beta) and one clicks Apply and right after that(fast enough so download hasn't completed) Apply and Close button there is error printed. Depending on what was already downloaded one can get error messages like toolchain can not be installed, toolchain doesn't contain RLS and probably others.
A check whether installation of the given toolchain is ongoing should be done and second installation of the same toolchain should not be started.
Please add support for debugging.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.