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

Add Rust analyzer support #868

Merged
merged 8 commits into from
Feb 12, 2024
Merged

Add Rust analyzer support #868

merged 8 commits into from
Feb 12, 2024

Conversation

sonnyp
Copy link
Contributor

@sonnyp sonnyp commented Jan 19, 2024

Fixes #520

Only supports syntax diagnostics for now. I made a follow up for types #881

How to test

  • Open Workbench
  • From the Library, open a demo in Rust
  • Make a syntax error in Rust code
  • Wait a minute or so (rust-analyzer takes a while to initialize)

Diagnostics will appear for syntax errors.

image

src/common.js Outdated Show resolved Hide resolved
@Hofer-Julian
Copy link
Contributor

Considering that there's soon a release, I wonder if we should merge this PR (after a small clean up).

Showing syntax errors is already quite useful, and we could look into diagnostics in a follow-up PR.

@sonnyp
Copy link
Contributor Author

sonnyp commented Feb 10, 2024

Agree - I'll do that and make a follow up for you 😸

src/workbench Outdated
@@ -2,6 +2,7 @@

export WEBKIT_DISABLE_DMABUF_RENDERER=1
# export G_MESSAGES_DEBUG=@app_id@
GSK_RENDERER=gl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having issues. It's going to be the default soon anyway

https://gitlab.gnome.org/GNOME/gtk/-/issues/6411

@sonnyp sonnyp requested a review from Hofer-Julian February 11, 2024 17:41
@sonnyp sonnyp marked this pull request as ready for review February 11, 2024 17:41
@sonnyp sonnyp requested a review from lw64 as a code owner February 11, 2024 17:41
@@ -64,6 +65,7 @@ export function createSessionFromDemo(demo) {

const { file, settings } = session;
copyDirectory(demo_dir, file);
copyDirectory(rust_template_dir, file);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will copy Rust template files such as Cargo.toml and workbench.rs when creating a new session from a demo.

We already do this on compile but if we want diagnostics to work before pressing "Run" we need this here too.

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected 🦀
Great work @sonnyp!

@sonnyp sonnyp merged commit 2514485 into main Feb 12, 2024
1 check passed
@sonnyp sonnyp deleted the rust-language-server branch February 12, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Rust Language Server
3 participants