aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/complete.cpp
Commit message (Collapse)AuthorAge
* Style fixes.Gravatar Aaron Gyes2016-06-23
|
* Make IWYU output in lint.cpp less messyGravatar Aaron Gyes2016-06-23
| | | | And re-run IWYU, adjust #includes.
* Repair various invalid HeaderDoc comments.Gravatar Aaron Gyes2016-06-05
| | | | | Enable build setting to allow Xcode to complain about invalid comments.
* fix lint error in wgettext()Gravatar Kurtis Rader2016-06-01
| | | | | | | | | | | | | | | | Cppcheck was complaining about the `return val.c_str()` at the end of the `wgettext()` function. That would normally a bug since the lifetime of `val` ends when the function returns. In this particular case that's not true because the string is interned in a cache. Nonetheless, rather than suppress the lint warning I decided to modify the API to be more idiomatic. In the process of fixing the aforementioned lint warning I fixed several other lint errors in that module. This required making our copy of `wgetopt()` compatible with the rest of the fish code. Specifically, by removing its local definitions of the "_" macro so it uses the same macro used everywhere else in the fish code. The sooner we kill the use of wide chars the better.
* fix random lint issuesGravatar Kurtis Rader2016-05-29
| | | | | | | | This only eliminates errors reported by `make lint`. It shouldn't cause any functional changes. This change does remove several functions that are unused. It also removes the `desc_arr` variable which is both unused and out of date with reality.
* fix some style bogosities that crept inGravatar Kurtis Rader2016-05-27
|
* add (or restore) config.h to all filesGravatar David Adam2016-05-18
| | | | | | | | The autoconf-generated config.h contains a number of directives which may alter the behaviour of system headers on certain platforms. Always include it in every C++ file as the first include. Closes #2993.
* lint cleanup: eliminate "redundant" errorsGravatar Kurtis Rader2016-05-04
| | | | | This removes some pointless parentheses but the primary focus is removing redundancies like unnecessary "else" clauses.
* restyle switch blocks to match project styleGravatar Kurtis Rader2016-05-03
| | | | | | | | | | | | | | | I missed restyling a few "switch" blocks to make them consistent with the rest of the code base. This fixes that oversight. This should be the final step in restyling the C++ code to have a consistent style. This also includes a few trivial cleanups elsewhere. I also missed restyling the "complete" module when working my way from a to z so this final change includes restyling that module. Total lint errors decreased 36%. Cppcheck errors went from 47 to 24. Oclint P2 errors went from 819 to 778. Oclint P3 errors went from 3252 to 1842. Resolves #2902.
* add better support for IWYU and fix thingsGravatar Kurtis Rader2016-04-26
| | | | | | | | | Remove the "make iwyu" build target. Move the functionality into the recently introduced lint.fish script. Fix a lot, but not all, of the include-what-you-use errors. Specifically, it fixes all of the IWYU errors on my OS X server but only removes some of them on my Ubuntu 14.04 server. Fixes #2957
* Migrate PATH-completion logic from complete.cpp to expand.cppGravatar ridiculousfish2016-04-07
| | | | | | | | | | | | | | | | Prior to this fix, when completing a command that doesn't have a /, we would prepend each component of PATH and then expand the whole thing. So any special characters in the PATH would be interpreted when performing tab completion. With this fix, we pull the PATH resolution out of complete.cpp and migrate it to expand.cpp. This unifies nicely with the CDPATH resolution already in that file. This requires introducing a new expand flag EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD (which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to resolve paths against PATH instead of the working directory. Fixes #952
* Fix memory leaks at exit found in testsGravatar Andreas Nordal2016-03-27
| | | | | | | | | | This fixes all memory leaks found by compiling with clang++ -g -fsanitize=address and running the tests. Method: Ensure that memory is freed by the destructor of its respective container, either by storing objects directly instead of by pointer, or implementing the required destructor.
* Make expand_argument_list a static functionGravatar ridiculousfish2016-02-27
| | | | It doesn't use any properties of parser_t
* Eliminate parser_t::show_errorsGravatar ridiculousfish2016-02-27
| | | | Errors are now unconditionally shown
* Eliminate parser_type_tGravatar ridiculousfish2016-02-27
| | | | It was never fully implemented and wasn't used for anything
* Allow variable completion from just a $Gravatar ridiculousfish2016-02-27
| | | | | Previously there had to be some variable text, now you can tab complete from just a naked $.
* Remove an unused variableGravatar ridiculousfish2016-02-22
|
* Remove autosuggest_suggest_specialGravatar ridiculousfish2016-02-18
|
* Additional work on unifying cd autosuggestions with completeGravatar ridiculousfish2016-02-18
|
* Complete to take a pointer to output completions, not a mutable refGravatar ridiculousfish2016-02-18
|
* Migrate sort_and_prioritize to complete.cppGravatar ridiculousfish2016-02-18
|
* Early work towards moving the cd special autosuggestion into completionsGravatar ridiculousfish2016-02-18
| | | | This will simplify some code and make the cd autosuggestion smarter
* Clean up completion removalGravatar ridiculousfish2016-01-16
| | | | | Rather than passing a triple of short, long, is_old, pass an option as a string and then a type
* Mark a bit of code as unreachableGravatar ridiculousfish2016-01-16
|
* Simplify locking in complete.cppGravatar ridiculousfish2016-01-16
|
* Clean up complete_entry_opt_tGravatar ridiculousfish2016-01-16
| | | | | | | Rather than storing short and long options separately, using a complicated set of invariants, store them in a single string and use an explicit type complete_option_type_t to track how they are interpreted.
* Remove short_opt_str from completion_entry_tGravatar ridiculousfish2016-01-15
| | | | | | | | | This was a "cache" of dubious value that was also very confusing. The idea was to express in one place all of the short options that were allowed for a command, in a big string. But it's simpler to just construct that on-demand by walking the list of complete_entry_opt_t. Also remove some other dead code as part of cleanup.
* Clean up short_ok in completionsGravatar ridiculousfish2016-01-15
| | | | Preparing to remove short_opt_string
* When autoloading a completion, also autoload the functionGravatar ridiculousfish2015-10-07
| | | | | Fixes a case where a --wraps declaration would be missed because the function would not be loaded. Fixes #2466.
* Don't do intermediate fuzzy directory matching with $PATHGravatar ridiculousfish2015-10-03
| | | | | When expanding an executable with $PATH, don't attempt to interpret the directories in PATH as fuzzy matching. Fixes #2413.
* Eliminate global variables associated with builtin IOGravatar ridiculousfish2015-09-22
| | | | | | | This change eliminates global variables like stdout_buffer. Instead we wrap up the IO information into a new struct io_streams_t, and thread that through every builtin. This makes the intent clearer, gives us a place to hang new IO data, and eliminates the ugly global state management like builtin_push_io.
* Rename sgrep to __fish_sgrepGravatar Fabian Homborg2015-09-09
| | | | Makes it harder to cause issues with aliases, see fish-shell#2245
* Rewrite parse_util_unescape_wildcardsGravatar ridiculousfish2015-08-19
| | | | Make it simpler, and use wcstring instead of wcsdup
* Dead macro cleanupGravatar ridiculousfish2015-08-10
| | | | Enable -Wunused-macros, and remove said unused macros
* rename FOR_COMPLETIONS to EXPAND_FOR_COMPLETIONSGravatar ridiculousfish2015-08-08
| | | | This is yet clearer
* Factor the completion prefix behavior into its own functionGravatar ridiculousfish2015-08-08
| | | | | | In a few places, we need to add a prefix to completions that replace the token. This change factors that logic into its own function prepend_token_prefix.
* rename ACCEPT_INCOMPLETE to FOR_COMPLETIONS, which is clearerGravatar ridiculousfish2015-08-08
|
* Merge branch 'iwyu'Gravatar David Adam2015-07-29
|\ | | | | | | http://include-what-you-use.org/
* | Stop passing mutable references to completions aroundGravatar ridiculousfish2015-07-27
| | | | | | | | | | Replace uses of vector<completion_t>& with vector<completion_t>* This makes it clear at the call site that the object may be mutated.
* | Support file tab completion after = and : separatorsGravatar ridiculousfish2015-07-27
| | | | | | | | | | | | For example, env VAR=/usr<tab> will now work as expected Fixes #2178
* | Fix a warning with g++ about an unused function resultGravatar ridiculousfish2015-07-26
| |
| * Merge branch 'master' into iwyuGravatar David Adam2015-07-26
|/
* Migrate source files into src/ directoryGravatar ridiculousfish2015-07-24
This change moves source files into a src/ directory, and puts object files into an obj/ directory. The Makefile and xcode project are updated accordingly. Fixes #1866