-
Notifications
You must be signed in to change notification settings - Fork 65
Add per-problem Cargo.toml and subdir structure for Rust LSP support #203
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
Open
Antonio-Bennett
wants to merge
10
commits into
clearloop:master
from
Antonio-Bennett:rust-lsp-support
Open
Add per-problem Cargo.toml and subdir structure for Rust LSP support #203
Antonio-Bennett
wants to merge
10
commits into
clearloop:master
from
Antonio-Bennett:rust-lsp-support
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• For lang='rust', generate code at code/{fid}-{slug}/src/lib.rs and tests.dat. • Create Cargo.toml with basic config on first edit. • Preserves flat structure for other languages. • Enables rust-analyzer integration without breaking API submissions.
- Cleans up compilation warning from file module.
- Lowercase slugs and prefix with 'prob-' (e.g., 'prob-1_two_sum'). - Prevents Cargo.toml errors; applied to paths and package names. - Ensures cross-file consistency.
- Includes examples for common LeetCode crates (itertools, regex). - Allows easy extension without editing boilerplate.
- Detects old flat paths and suggests migration without auto-moving. - Helps users with pre-existing problems.
- Allows importing suffix in cmds/edit.rs for flat path calculation.
- Add [code] enable_rust_crates = true (default) in config. - Allows opting out of subdir structure for Rust. - Updates paths and creation logic accordingly. - Fix serde attribute for the new field.
- Focus on Rust LSP support with subdir/Cargo.toml details, config option, and usage. - Positions Rust first; extensible for other languages.
- Ensures missing field in old leetcode.toml defaults to true without error. - Improves backward compatibility.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Summary
lang = 'rust'
, generates subdir crates (e.g.,code/1-two_sum/src/lib.rs
,Cargo.toml
withprob-1-two_sum
package,tests.dat
).[code] enable_rust_crates = true
(default; set false for flat files).Changes
helper.rs
(conditional subdirs).cmds/edit.rs
.config/code.rs
.Testing
leetcode edit 1
creates structure;test 1
/exec 1
work.enable_rust_crates = false
and edit another problem.Closes #204 . Ready for review!