Skip to content
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

[Feature request] Set custom fantomas path on Fantomas.Client #3099

Open
4 of 6 tasks
ratsclub opened this issue Jul 3, 2024 · 2 comments
Open
4 of 6 tasks

[Feature request] Set custom fantomas path on Fantomas.Client #3099

ratsclub opened this issue Jul 3, 2024 · 2 comments
Labels

Comments

@ratsclub
Copy link

ratsclub commented Jul 3, 2024

I propose we add a way to provide a custom path for fantomas on Fantomas.Client.

As explained on Ionide's discussion, we can't currently have an option to set a custom path for fantomas on VSCode.

Pros and Cons

Pros

The advantages of making this adjustment to Fantomas are ...

  • Allows the user to freely set where fantomas is located while using VSCode
  • Nix maintainers can package ionide with fantomas bundled by default (rust-analyzer is an example)

The disadvantages of making this adjustment to Fantomas are ...

  • More code complexity

Affidavit (please submit!)

Please tick this by placing a cross in the box:

Please tick all that apply:

  • This is not a breaking change to Fantomas
  • I or my company would be willing to help implement and/or test this
  • This suggestion is part of the Microsoft style guide (please add a link to section if so)
  • This suggestion is part of the G-Research style guide (please add a link to section if so)
@nojaf
Copy link
Contributor

nojaf commented Jul 3, 2024

Is it possible to use a version of fantomas specified on the path with your nix thing?

See

// Find an executable fantomas file on the PATH
let private fantomasVersionOnPath () : (FantomasExecutableFile * FantomasVersion) option =
let fantomasExecutableOnPathOpt =
match Option.ofObj (Environment.GetEnvironmentVariable("PATH")) with
| Some s -> s.Split([| if isWindows then ';' else ':' |], StringSplitOptions.RemoveEmptyEntries)
| None -> Array.empty
|> Seq.choose (fun folder ->
if isWindows then
let fantomasExe = Path.Combine(folder, "fantomas.exe")
let fantomasToolExe = Path.Combine(folder, "fantomas-tool.exe")
if File.Exists fantomasExe then Some fantomasExe
elif File.Exists fantomasToolExe then Some fantomasToolExe
else None
else
let fantomas = Path.Combine(folder, "fantomas")
let fantomasTool = Path.Combine(folder, "fantomas-tool")
if File.Exists fantomas then Some fantomas
elif File.Exists fantomasTool then Some fantomasTool
else None)
|> Seq.tryHead

@nojaf nojaf added the tooling label Aug 12, 2024
@nojaf
Copy link
Contributor

nojaf commented Aug 12, 2024

Maybe having #3104 would resolve your problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants