17

Syntastic works for me in general (say, if I edit C/C++ files then I get syntax error notifications), but I can't get it to show syntax errors for OCaml.

My OCaml install seems fine otherwise, and the binaries that are mentioned in the header of Syntastic's ocaml.vim file are in my path.

Any ideas?

Aditya Vikas Devarapalli
  • 3,186
  • 2
  • 36
  • 54
Nicholas Meyer
  • 253
  • 2
  • 7
  • Did you check comment in the header of `syntastic/syntax_checkers/ocaml.vim`? It's explained there how to configure Vim to use specific ocaml checker... – plesiv Jan 27 '13 at 00:47
  • Strange. I don't remember doing anything special to get it working with OCaml. Did you install syntastic through vundle or something simialar? – rgrinberg Jan 27 '13 at 05:13
  • I have the same problem, and I installed syntastic. After running through it some, I found that reading the plugin text shows that it requires ocamlp4o in order to run. If you have that on your path you should be good, but I have it on my bash path and it still doesn't work. Another thing you learn when reading the plugin's ocamlp4o.vim file is that he comments that there is no exception thrown when it can't set things up correctly... I've sent an email to both the syntastic developer and the creator of the ocaml syntastic add on and posted to the forum as well. – Adam Miller Feb 02 '13 at 18:33
  • Also-omlet is what does the syntax highlighting from me. I want to make sure that we're on the same level: syntastic is supposed to show errors, but its not. I have my .ml files highlighted well enough. Let me know if you understand it differently. – Adam Miller Feb 02 '13 at 18:38
  • 1
    So it appears that for some .ml files the error checking works, but not all of them. I don't see a pattern exactly to why it works for some files in my project but not others. However I do know that if I just create an arbitrary .ml file (not part of my project), it does not seem to work. – Nicholas Meyer Feb 06 '13 at 19:41
  • `:SyntasticInfo` will tell you available, and active checkers. – everett1992 Sep 23 '13 at 22:16

2 Answers2

7

The most likely reason is that none of the syntax checkers that it requires is installed. For example: python requires either flake8, pyflakes or pylint to be installed and in $PATH. To see which executables are supported, just look in syntax_checkers//*.vim. Note that aliases do not work; the actual executable must be available in your $PATH. Symbolic links are okay. You can see syntastic's idea of available checkers by running :SyntasticInfo.

Another reason it could fail is that either the command line options or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request

Source: https://github.com/scrooloose/syntastic

Farooq Nasser
  • 71
  • 1
  • 4
0

Merlin provides much more complete checking than Syntastic's included checker and will give proper type errors and let you use packages outside of core.