netbeans
netbeans copied to clipboard
[Rust] Rust workspaces support.
- Embedded toml-java library to parse Cargo.toml files.
- We open complex Rust projects with nested projects (workspaces).
- Dropping the previous workspace node.
- Some other refactoring and cleanups.
Screenshot of an open project:
- Opened https://github.com/apache/arrow-rs project (a virtual workspace).
- The "arrow" member (another rust project) can be seen as a nested "arrow-rs" subproject and as a top level project.
Let's see how our build pipelines work on this PR.
I'm afraid this is quite a big PR, but it requires changes in two modules (both cargo-support and cargo-projects), so I thought it could be sent for review before it gets bigger.
toml-java uses a highter "antlr4" runtime version, we could either upgrade NetBeans' or downgrade toml-java's.
This is ready for review now!
toml-java uses a highter "antlr4" runtime version, we could either upgrade NetBeans' or downgrade toml-java's.
fyi: I started with the update when I saw this in the antlr readme: "minor version updates may include minor breaking changes, the policy is to regenerate parsers with every release (4.11 -> 4.12)".
This was also discussed on the last update PR https://github.com/apache/netbeans/pull/4845, So I am going to put the update on hold since regenerating parsers across NB is not something I want to do right now :) (but if anyone wants to take over, feel free to start with the linked commit)
I think I'll take a look to the ANTLRv4 upgrade during early 2024. Thanks for the commit!
Hey, I was thinking I could downgrade toml-java to java 8 / antlr 4.11.1 for the time being. Let's do that.
@vieiro or: you bundle antl runtime just for rust using the version you need, until the rest of NB catches up and we can deduplicate again. Its just two jars I think.
edit: analog to maven-indexer which uses latest lucene while many editor modules still use older versions due to public api issues.
Modified toml-java to support Antlr 4.11.1. Cargo.toml
files have now their own file-type with syntax highlighting and their own navigator, so we get rid of libs.tomlj
misbehaviour on arrays with commas.
Well, I think your toml-java
workcould go into the ide cluster and eventually replace the libs.tomlj
.
That would be actually a preferred way to, so we could upgrade the ANTLR4 runtime.
Well, I think your
toml-java
workcould go into the ide cluster and eventually replace thelibs.tomlj
.That would be actually a preferred way to, so we could upgrade the ANTLR4 runtime.
Ok. So let's drop libs.tomlj
(the author has fixed my main concerns, but there's no new version in Maven Central) and let's upgrade antlr4
everywhere to newest versions. Meanwhile let's make this PR go to sleep.
i caused a little conflict but the section was rewritten here so it is likely easy to resolve - sorry about that.
i caused a little conflict but the section was rewritten here so it is likely easy to resolve - sorry about that.
Don't understand that! Wrong PR perhaps?
I'll try to move forward with the tomlj replacement as time permits, but time doesn't permit lately! :-/
Don't understand that! Wrong PR perhaps?
right PR - but its was not important ;)
I think it's better to close this one, after all we'll have to refactor it with the new Antlr/TOML runtimes.
Also we'll need to consider:
- If we want to open workspace members as nested projects (as in this PR, expanding the member nodes) or with different projects (similar to what we do with Maven modules, this PR also supports that in some way).
- Let's redo the Cargo.toml API. Cargo.toml files have many capabilities. We will need some sort of "Query API" for Cargo.toml files that makes it easier to add additional queries in the future more easily (queries such as is this a "lib" Cargo.toml? is it a workspace Cargo.toml? If so, how many members does it have? Does it have tests? What are the build dependencies?, etc., etc.).
Suggestions are welcome!