Open hinrik opened 5 years ago
This is the same problem https://github.com/crystal-lang-tools/emacs-crystal-mode/pull/18 would fix and also the same issue that #20 report.
Please have a look at the discussion in #18 and if you have any ideas of how to move forward, please add your suggestion (or fix!) in the thread.
How do you generally use
flycheck-crystal
? I find that it's basically useless for lots of perfectly fine code because compiling the source file you're editing on its own can give errors about missing namespaces or namespaces that are incorrectly loaded as modules when they should be classes.This is not an issue for real-world compilation as the compilation targets (such as
bin/something
orspec/something_test.cr
) usually follow a pattern of calling a main module/class file (e.g.src/something.cr
) which loads everything and does so in the correct order.I thought about extending the call to
flycheck-define-checker
to also compilespec/spec_helper.cr
if it exists, but that's not so clean since a lot of projects use it to set up mocks and other things.