view span & view files commands#7989
Merged
fdncred merged 4 commits intonushell:mainfrom Feb 9, 2023
fdncred:view_commands
Merged
view span & view files commands#7989fdncred merged 4 commits intonushell:mainfrom fdncred:view_commands
fdncred merged 4 commits intonushell:mainfrom
fdncred:view_commands
Conversation
Member
|
Love your push for debugging tools! |
Contributor
|
It would be great if it could accept a span as a record, similar to what you get from the |
Contributor
Author
|
Let's go with this for now. We can adjust as needed. I'm also thinking now that |
Contributor
|
Yeah, good idea. I was saying it because my |
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
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.
Description
This PR does the following:
view span- which shows what is at the location of the span parametersview- which just lists all theviewcommands.view-sourcetoview source.view files- which shows you what files are loaded into nushell's EngineState memory.Category::Debugand put these commands (and others) into it. (inspectneeds to be added to it, but it's not landed yet)Spans are important to nushell. One of their uses is to show where errors are. For instance, in this example, the leader lines pointing to parts of the command line are able to point to
10,/, and"bob"because each of those items have a span.Examples
view span
Example:
To view the last span:
view files
entry #xwill be each command you type in the repl (i think). so, it may be good to filter those out sometimes.User-Facing Changes
I renamed
view-sourcetoview sourcejust to make a group of commands. No functionality has changed inview source.Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.