nushell/crates/nu-cli/tests
zc he 938fa6ee55
fix(completion): prefix_str should be trimmed to element_expression (#15171)
# Description
Hot fix of  a newly introduced bug by #15086.
Forgot to trim the line str according to the expression span, which will
disable external command completions in many cases.

Also adds the suggestion kind to external commands, for lsp
visualization.

# User-Facing Changes

Before:
<img width="246" alt="image"
src="https://github.com/user-attachments/assets/c62904f6-0dd7-4368-8f0b-aacd6fe590f0"
/>

After:
<img width="291" alt="image"
src="https://github.com/user-attachments/assets/76316649-956f-4828-94cb-41f79d5f94f7"
/>

I find it better to visually distinguish externals from internals, so
`function` for internals and `interface` for externals.
But it's arguably not the best option.

# Tests + Formatting

test case adjusted

# After Submitting
2025-02-25 11:47:10 +01:00
..
commands Consolidate uses of test-case to rstest (#14250) 2024-11-04 19:07:59 +01:00
completions fix(completion): prefix_str should be trimmed to element_expression (#15171) 2025-02-25 11:47:10 +01:00
main.rs Fix syntax highlighting for not (#12815) 2024-05-10 07:09:44 +08:00