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

Make command executable of a checker selectable #1986

Open
nordlow opened this issue Nov 15, 2022 · 5 comments
Open

Make command executable of a checker selectable #1986

nordlow opened this issue Nov 15, 2022 · 5 comments

Comments

@nordlow
Copy link
Contributor

nordlow commented Nov 15, 2022

I'm missing a way to specify the executable of a command for a specific checker in my case the D checker. I would like to be able to switch between dmd and ldmd2.

As consequence of this I have to maintain to versions of my version of the D checker one; using dmd and one using ldmd2. This is not scalable.

@cpitclaudel
Copy link
Member

We have flycheck-d-dmd-executable; does that work?

flycheck-d-dmd-executable is a variable defined in ‘flycheck.el’.

Its value is nil

The executable of the d-dmd syntax checker.

Either a string containing the name or the path of the
executable, or nil to use the default executable from the syntax
checker declaration.

The default executable is "dmd".

  This variable may be risky if used as a file-local variable.
  You can customize this variable.

@nordlow
Copy link
Contributor Author

nordlow commented Nov 16, 2022

I don't find any references to flycheck-d-dmd-executable in flycheck.el, elpa version 20221112.1552.

@cpitclaudel
Copy link
Member

What does C-h v flycheck-d-dmd-executable say?

@nordlow
Copy link
Contributor Author

nordlow commented Nov 16, 2022

Ahh, C-h v flycheck-d-dmd-executable says

flycheck-d-dmd-executable is a variable defined in ‘flycheck.el’.

Its value is nil

The executable of the d-dmd syntax checker.

Either a string containing the name or the path of the
executable, or nil to use the default executable from the syntax
checker declaration.

The default executable is "dmd".

  This variable may be risky if used as a file-local variable.
  You can customize this variable.

but it doesn't have a source location. I see.

The end goal of this to set flycheck-d-dmd-executable to "ldmd2" (LDC) if that's available otherwise "dmd". Because ldmd2 is slightly faster at semantic checking than dmd.

I guess I should do that in a d-mode-hook lambda, right?

Am I right assuming that evaluating

(flycheck-define-checker X .. )

always results in

flycheck-X-executable

being defined?`

@cpitclaudel
Copy link
Member

I guess I should do that in a d-mode-hook lambda, right?

Yep.

Am I right assuming that evaluating …

Correct, this is documented in https://www.flycheck.org/en/latest/user/syntax-checkers.html#change-syntax-checker-executables

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

No branches or pull requests

2 participants