refactor: tree-sitter-nu friendly alternative expressions (#15301)

# Description

Choose more tree-sitter-nu-friendly (if not better) expressions in nu
scripts.
The changes made in this PR all come from known issues of
`tree-sitter-nu`.

1. nested single/double quotes:
https://github.com/nushell/tree-sitter-nu/issues/125
2. module path of `use` command:
https://github.com/nushell/tree-sitter-nu/issues/165
3. where predicates of boolean column:
https://github.com/nushell/tree-sitter-nu/issues/177
4. `error make` keyword:
https://github.com/nushell/tree-sitter-nu/issues/179

Those issues are either hard to fix or "not planned" for syntactical
precision considerations ATM.

# User-Facing Changes

Should be none

# Tests + Formatting

# After Submitting
This commit is contained in:
zc he
2025-03-12 21:48:19 +08:00
committed by GitHub
parent a17ffdfe56
commit 44b7cfd696
5 changed files with 11 additions and 11 deletions

View File

@ -109,7 +109,7 @@ def "nu-complete main-help" [] {
}
def "nu-complete list-externs" [] {
scope commands | where is_extern | select name description | rename value description
scope commands | where is_extern == true | select name description | rename value description
}
def build-help-header [
@ -397,7 +397,7 @@ export def externs [
] {
let externs = (
scope commands
| where is_extern
| where is_extern == true
| select name module_name description
| sort-by name
| str trim
@ -761,7 +761,7 @@ Here are some tips to help you get started.
* ('help <name>' | pretty-cmd) - display help about a particular command, alias, or module
* ('help --find <text to search>' | pretty-cmd) - search through all help commands table
Nushell works on the idea of a "(ansi default_italic)pipeline(ansi reset)". Pipelines are commands connected with the '|' character.
Nushell works on the idea of a '(ansi default_italic)pipeline(ansi reset)'. Pipelines are commands connected with the '|' character.
Each stage in the pipeline works together to load, parse, and display information to you.
(ansi green)Examples(ansi reset):