New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mix): add options for mix run
#1078
Conversation
Overviewsrc/mix.ts:Info:Single Scripts:
|
|
Hello @Darth-Knoppix,
Please add a 👍 as a reaction to this comment to show that you read this. |
src/mix.ts
Outdated
| { | ||
| name: "--preload-modules", | ||
| description: "Preloads all modules defined in applications", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-compile", | ||
| description: "Does not compile even if files require compilation", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-deps-check", | ||
| description: "Does not check dependencies", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-archives-check", | ||
| description: "Does not check archives", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-halt", | ||
| description: "Does not halt the system after running the command", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-mix-exs", | ||
| description: "Allows the command to run even if there is no mix.exs", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-start", | ||
| description: "Does not start applications after compilation", | ||
| args: {}, | ||
| }, | ||
| { | ||
| name: "--no-elixir-version-check", | ||
| description: "Does not check the Elixir version from mix.exs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure these accept an argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this was a misunderstanding. Fixing now 👍
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
|
Thanks for the tips and great feedback @fedeci! I used the |
src/mix.ts
Outdated
| function generatePreferredFilepaths(): Fig.Generator { | ||
| return { | ||
| template: "filepaths", | ||
| filterTemplateSuggestions: (paths) => | ||
| paths.map((path) => | ||
| path.name.endsWith(".exs") ? { ...path, priority: 75 } : path | ||
| ), | ||
| }; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be a function - it can just be a constant.
| function generatePreferredFilepaths(): Fig.Generator { | |
| return { | |
| template: "filepaths", | |
| filterTemplateSuggestions: (paths) => | |
| paths.map((path) => | |
| path.name.endsWith(".exs") ? { ...path, priority: 75 } : path | |
| ), | |
| }; | |
| } | |
| const preferredFilepaths: Fig.Generator = { | |
| template: "filepaths", | |
| filterTemplateSuggestions: (paths) => | |
| paths.map((path) => | |
| path.name.endsWith(".exs") ? { ...path, priority: 75 } : path | |
| ), | |
| } | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be also simplified with the @fig/autocomplete-generators package!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't see this either 🤦. I've simplified it based on what's in the elixir autocomplete using @fig/autocomplete-generators as suggested 🙏
Co-authored-by: Matt Schrage <matthewschrage@gmail.com>
Simplify the generators where .exs files are preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
mix run
What kind of change does this PR introduce?
Improve option suggestions for the
mix runcommand based off Mix run documentation.What is the current behavior?
Fig does not suggest any options for the
mix runcommand.What is the new behavior?
Fig will suggest options like:
mix run --no-haltmix run --no-deps-checkAdditional info: