Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Racket checker runs GUI program #1773

Closed
kasbah opened this issue May 17, 2016 · 5 comments
Closed

Racket checker runs GUI program #1773

kasbah opened this issue May 17, 2016 · 5 comments
Labels

Comments

@kasbah
Copy link

kasbah commented May 17, 2016

With vim-racket installed, working on a GUI program, the racket checker runs the GUI program, :make does not.

vim-racket sets:

setl makeprg=raco\ make\ --\ %

which might be a better option for the checker. I couldn't find where to define the actual checker as this line seems sort of magical.

@lcd047
Copy link
Collaborator

lcd047 commented May 17, 2016

Syntastic doesn't use, nor cares about, Vim's option makeprg, Vim's command :make, and their friends. It used to do that, but it stopped doing it a few years ago. The name of the internal variable makeprg is a legacy from those days. The variable still holds a command line that eventually gets passed to a shell, but other than that it could have had any other name, it has no relation to Vim's option makeprg.

Back to your problem: you can see the command lines constructed by syntastic in the debug logs (see :h syntastic-config-debug). By default, the racket checker simply runs racket file.rkt, and parses the output into a loclist with lgetexpr. Unsurprisingly, this just runs the program.

You can change the command line constructed by syntastic by setting the various options (see :h syntastic-config-makeprg). Changing the command line to raco make -- file.rkt is unlikely to work though, since lgetexpr expects the output of racket, not that of make. It's up to you to make sure syntastic runs something that makes sense.

@lcd047 lcd047 closed this as completed May 19, 2016
@kasbah
Copy link
Author

kasbah commented May 19, 2016

Thank you very much for the explanation. Do you not think the checker should be changed if it actually executes the program under test? Would you be so kind as to point me to where the executed command is defined in the syntastic source code?

@lcd047
Copy link
Collaborator

lcd047 commented May 20, 2016

Do you not think the checker should be changed if it actually executes the program under test?

Can racket check the syntax of a (single) file without running it? If it can, I can try to fix the problem. If it can't, I can wash my hands of it. If the answer involves raco make then the fix might be more involved, and you'll have to explain me in some detail what is supposed to be going on (keeping into account that I barely know what Racket is, let alone how it works).

@2sb18 Any comments on this?

Would you be so kind as to point me to where the executed command is defined in the syntastic source code?

It's here. See the guide and the manual for an explanation.

lcd047 added a commit that referenced this issue May 23, 2016
This checker executes the code in the files it checks. This is probably fine
if you wrote the files yourself, but it can be a problem if you're trying to
check third party files. If you are 100% willing to let Vim run the code in
your files, set g:enable_racket_racket_checker to 1 in your vimrc to enable
this checker: vim let g:enable_racket_racket_checker = 1 There is also a
buffer-local version of this variable, that takes precedence over it in the
buffers where it is defined.

Reference: #1773
@lcd047
Copy link
Collaborator

lcd047 commented May 23, 2016

Ok, assuming the worst. Commit 95879f1.

@kasbah
Copy link
Author

kasbah commented May 23, 2016

Probably for the best. I will try out the alternative racket checker and try and define one based on raco make if I am not happy with that one.

Slm0n87 pushed a commit to Slm0n87/syntastic that referenced this issue Mar 7, 2019
This checker executes the code in the files it checks. This is probably fine
if you wrote the files yourself, but it can be a problem if you're trying to
check third party files. If you are 100% willing to let Vim run the code in
your files, set g:enable_racket_racket_checker to 1 in your vimrc to enable
this checker: vim let g:enable_racket_racket_checker = 1 There is also a
buffer-local version of this variable, that takes precedence over it in the
buffers where it is defined.

Reference: vim-syntastic#1773
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants