Commit Graph

17 Commits

Author SHA1 Message Date
mattmc3
9eee1b4499 fish_indent: Cleanup all *.fish files not in tests 2024-09-17 19:11:42 +02:00
Mahmoud Al-Qudsi
4868166f86 completions/rustc: preserve trailing = in -Z values 2024-05-26 21:44:02 -05:00
Mahmoud Al-Qudsi
84d057e7b7 Finish refactoring rustc completions
* Properly handle a lot more -Z completion formats as suggested by `rustc -Z
  help`
* Don't run any `rustc` commands when sourcing `rustc.fish`; these invocations
  are instead deferred until the user attempts to complete the specific switch.
* Support CSV -A/F/D/W values
2024-05-26 21:33:48 -05:00
Mahmoud Al-Qudsi
ef614ba2d9 Speed up rustc completions, filter out deprecated options
Don't unconditionally execute the plumbing to get `rustc -C` completions (use it
only when trying to complete `rustc -C`), filter out deprecated options, and use
fewer calls to the `string` builtin to optimize further.

Need to do the same thing for the `-Z` completions next, those hang the shell
for a good 1.5+ seconds.
2024-05-18 12:37:18 -05:00
Mahmoud Al-Qudsi
9ab1ec2a9e Tweak newly added rustc completion descriptions
Addendum to https://github.com/fish-shell/fish-shell/pull/10491
2024-05-17 12:33:59 -05:00
tesuji
d3758d3751
completion: add more arguments for rustc --print (#10491)
Based off of rustc 1.80.0-nightly
2024-05-17 12:32:41 -05:00
Fabian Boehm
0ff1e50a33 rustc: Protect against lines starting with -
Fixes #10379
2024-03-19 16:49:46 +01:00
Fabian Homborg
10785ba814 completions/rustc: SILENCE
Otherwise this might print

> error: no override and no default toolchain set
2022-04-21 17:35:00 +02:00
Weihang Lo
4116aaeb5f Update rustc.fish
- [`-L`: add a directory to the library search path][1]
- [`--crate-type`: a list of types of crates for the compiler to emit][2]
- [`--emit`: specifies the types of output files to generate][3]

[1]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#-l-add-a-directory-to-the-library-search-path
[2]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit
[3]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--emit-specifies-the-types-of-output-files-to-generate
2021-01-03 18:09:50 +01:00
Johannes Altmanninger
49c5f96470 Use set -l to force use of a local variable
Bare set overwrites a global/universal variable if it exists.
2020-05-15 08:25:07 +02:00
Jason Nader
7fb3880b96 completions: remove unnecessary use of --erase 2020-03-10 18:10:49 +01:00
Jason Nader
0b7bbb5654 cleanup completions: localise/erase vars where possible
[skip-ci]
2020-02-23 11:10:32 +01:00
Mahmoud Al-Qudsi
deb6d477d4 Escape parameters in rustc completions
Closes #5057.
2018-09-20 18:59:57 -05:00
Mahmoud Al-Qudsi
e1c90cac88 Prevent error output on invocation of rustc completions
fish was indiscriminately calling `rustc -Z help` in the autocompletion
script for `rustc`, but `-Z` (and its `-Z help` output completions) is
only available when using the nightly compiler.

Note that this isn't a perfect fix since if you try to use those command
line options now added to the autocompletions list without using the
nightly toolchain, `rustc` will still throw an error. But at least this
way we don't cause random errors about `-Z` not being available to
appear any time someone tries to use `rustc` from the fish command prompt.
2017-10-18 11:49:40 -05:00
mathbunnyru
7a80610300 Delete trailing spaces 2017-01-15 14:57:21 -08:00
Aaron Gyes
36691df6fe Stringify many completions and functions, with --invert stringification.
I believe apm must have been buggy - example output that I found online
showed `tr` was mangling paths with spaces in it. Should be fixed.

Also, use dscl on OS X in __fish_complete_users.fish like
__fish_print_users.fish already does.
2016-04-08 10:49:29 +08:00
Bheesham Persaud
46fbfaaa83 Add cargo and rustc completion.
rustc.fish makes heavy use of the `string` commands.
2015-10-26 21:39:16 -04:00