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

Improve selection of forms for Rust client #649

Merged
merged 1 commit into from
Feb 15, 2025
Merged

Conversation

russtoku
Copy link
Contributor

The addition of a form-node? function to the Rust client should make it more convenient to put your cursor on a line and evaluate statements or expressions.

The dev/rust/sandbox.rs has more comments to clarify how to evaluating things. I've included a link to the Evcxr common usage information document to help those not very familiar with Rust and evcxr.

@russtoku
Copy link
Contributor Author

russtoku commented Feb 14, 2025

Sorry but further comparisons of this mod with the current Rust client make me question the value of this mod. It seems like the only improvement is being able to put your cursor on the keyword, pub, and doing a <localleader>ee versus <localleader>er. Here's the statement from dev/rust/sandbox.rs:

pub struct User {
    username: String
}

In other words, the struct with the visibility modifier, pub, is treated as complete syntactic form versus when evaluating the current form as opposed to being treated as outer form and inner form requiring evaluating the root form.

I'm waffling on the mod but I think the changes to dev/rust/sandbox.rs are a keeper.

@Olical
Copy link
Owner

Olical commented Feb 15, 2025

I still think that's a valid change, evaluating pub on it's own probably doesn't make sense, so having Conjure walk the tree a little more to find something worth evaluating sounds good to me.

@Olical
Copy link
Owner

Olical commented Feb 15, 2025

I gave it a go and it works fine for me. I say we ship this and if power Rust users have Opinions on what should or should not be part of a form then we can take that into account later. This is a good start though and I think most languages (all?) benefit from having some level of filtering of the tree for forms. Just using the node under the cursor is rarely what the user actually wants.

@Olical Olical merged commit 80b3e68 into Olical:main Feb 15, 2025
3 checks passed
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.

2 participants