Open tsoernes opened 7 years ago
I have the same problem on two different computers, both Fedora 26 with neovim v0.2.0. If I disable intero autostart, but otherwise keep the vim config the same, the highlighting is there.
Was a recent change, or has it only ever done this for you? (Even better, it'd be great to find the commit that introduced this behavior) On Fri, Jul 21, 2017 at 7:48 AM tsoernes notifications@github.com wrote:
I have the same problem on two different computers, both Fedora 26 with neovim v0.2.0. If I disable intero autostart, but otherwise keep the vim config the same, the highlighting is there.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/parsonsmatt/intero-neovim/issues/67#issuecomment-316992084, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSaVEYaZM5eYdklhbJhIE3hovflDaOOks5sQJ40gaJpZM4OcscL .
I first installed intero-neovim a couple of days ago and it's been that way from the start.
2017-07-21 19:22 GMT+02:00 Jake Zimmerman notifications@github.com:
Was a recent change, or has it only ever done this for you? (Even better, it'd be great to find the commit that introduced this behavior) On Fri, Jul 21, 2017 at 7:48 AM tsoernes notifications@github.com wrote:
I have the same problem on two different computers, both Fedora 26 with neovim v0.2.0. If I disable intero autostart, but otherwise keep the vim config the same, the highlighting is there.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/parsonsmatt/intero-neovim/issues/67#issuecomment- 316992084, or mute the thread https://github.com/notifications/unsubscribe-auth/ AFSaVEYaZM5eYdklhbJhIE3hovflDaOOks5sQJ40gaJpZM4OcscL .
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parsonsmatt/intero-neovim/issues/67#issuecomment-317061083, or mute the thread https://github.com/notifications/unsubscribe-auth/AGd9xDqkuQ1cyZjikg290SfF-m-HlFR9ks5sQN43gaJpZM4OcscL .
With intero enabled, I get filetype=conf, when disabled, I get filetype=haskell on the very same .hs file, when querying :set ft?
.
That's really bizarre. There's nothing in intero that sets the filetype. Thanks for reporting. What's your OS and vim version?
Nvim 0.2.0 on Fedora 26 KDE xorg.
I found the culprit: In my .hs file I had
#!/usr/bin/env stack
at the top to allow it to be run as a script. Removing that line and syntax highlighting works.
When saving hs files without the aforementioned line (so that intero-neovim actually starts), and without a stack.yaml (which is not wanted when scripting with haskell), the following appear in terminal after :wq
Error detected while processing function <SNR>51_on_stdout[26]..<SNR>51_new_response[22]..intero#maker#write_update:
line 3:
E482: Can't open file /tmp/nvimWuC10t/3 for writing: no such file or directory
Intero-neovim seems to be working fine for hs files without stack env variable and with stack.yaml file.
Hmmm, that's tricky. In order for the Neomake maker to work, we do assume the presence of a .stack-work directory to stuff the process log, which is then read from neomake to display errors. We'll need to handle the case of no stack directory somehow.
Can you disable the Neomake integration and see if Intero works on non-project Haskell files?
@tsoernes Would it be fair to say we've identified two issues?
Yes, I very much agree. Regarding 2., for starters it would perhaps be possible to skip checking for .stack-work if neomake is disabled, which it is in my case (g:intero_use_neomake=0).
I'm going to retitle this issue Syntax highlighting fails on Haskell files with a shebang
and open a new issue for the Neomake integration on bare files using STACK_YAML env var.
Also saw the same issue (filetype=conf
) after installation.
My workaround was to set au BufRead,BufNewFile *.hs set filetype=haskell
on init.vim
.
Whenever I enable intero-neovim, as in include the line
Plug ..
, syntax highlighting no longer works for Haskell files. If I remove the line, highlighting comes back. Here's my init.vim: init.vim.txt(EDIT: The below is from Matt Parsons, annotating this issue with more information)
The problem is reproducible by loading the following file into neovim with Intero enabled:
Removing the shebang fixes the issue.
set filetype
returnsconf
for this file when Intero is loaded. Otherwise, it knows it is a Haskell file.