-
Notifications
You must be signed in to change notification settings - Fork 208
Lint error: hGetContents: invalid argument (invalid byte sequence) (Win10 + Atom) #1560
Comments
@andregpss All logs would be more interesting to see if some thread crashed, whether you were using stack or cabal, etc... |
There is a bug in the vscode extension prior to |
@jneira I am already using The error messages on VS Code are now the same as those that appear in Atom:
@fendor I do not think i am using unicode characters. That message pops up for every |
Weird, can you share the project? The error message is unfortunately not very helpful. |
In the comment there is some non-ascii character |
Ok, I tried myself on windows 10, latest master, hie 8.6.5: module Marshaller where
import Data.Binary (decode, encode, Binary)
import Data.ByteString (ByteString)
import Data.ByteString.Lazy (fromStrict, toStrict)
marshall :: Binary a => a -> [ByteString]
marshall d = [(toStrict . encode) d]
unmarshall :: Binary a => [ByteString] -> a
unmarshall = decode . fromStrict . head And everything seems to work, although there are some suspicous log messages. Well, some semi-random debug ideas: would you mind trying to use cabal? You are using cabal if you add a Can you run If your project is simple enough (only one exe and lib), you can also try the explicit project configuration, to do that, add a file named cradle:
stack: Or, more complex: cradle:
stack:
component: "project:lib" Where project:lib is the library component of your project. You can find the available components with Last idea, not sure if it is important, did you maybe install hie over WSL and are using it without WSL? |
I openned an
I have a
How can i do that on linux with neo-vim?
Is it really necessary when using a
I have two scenarios on the same computer:
Here is the |
That or delete your local
I dont know, sorry, not using neovim :(
It is not, it is an experiment.
Ok, so probably not the culprit. |
Are you maybe running into #1519? |
HIE now works on my project, using |
HIE is finally working on Atom + Windows 10! Regarding the main issue of the current thread, the error message ´Lint error: hGetContents: invalid argument (invalid byte sequence)´ was caused by the use of UTF-8 characters on Maybe if HIE pass However, i think that the following steps i've done were also necessary to make HIE works:
The following HIE features still do not work on atom: apply-refact, Jump to definition, List all top level definitions. |
Thanks for finding this out! I didnt know we need to pass a flag to hlint to activate utf-8! We should probably pass that flag always? It does not work without |
I dont know. Due to Portuguese idiom, i have used some UTF-8 characters on code comments. I think it is a good idea to test the use of that flag because it can avoid that kind of error. However, it is not an error provoked by HIE, but by HLint. If we use HLint external to HIE, the error also occurs.
Right. HIE just dont work, but the |
Can you link logs for using hie without |
I tried to execute HIE on debug mode ( The log created on normal mode (no debug) is here: |
I think you need a custom wrapper, e.g. C:/bin/hie --debug --lsp Or, I think you can also set the server trace to: |
I am continuing the HIE test without
I dont know if i did it right. I created a
The HIE Wrapper generated the following log: |
Another idea: checkout the pr #1569, install this version of hie and execute it with |
I did not undestand... What version are you talking about? |
From the pr. Check it out, following the instructions on github and install it using the install script! |
Exact instructions: cd <hie-git-project>
git checkout -b fendor-extend-debug-utility master
git pull https://github.com/fendor/haskell-ide-engine.git extend-debug-utility
stack install.hs latest # or `./cabal-hie-install latest` or whatever ghc version you need
cd <project-to-build>
hie --debug |
Sorry... i was very busy past weeks and abandoned this discussion.
is this test still worth it? if you want it, i can perform it now. |
Yes, but you can use just the current master, no need for checking out the pr. |
Is the current master the default instalation (deacribed on readme.md)? |
We are using hlint as a library but i hope we could tell to use utf8. |
I updated HIE today to check the question discussed above. I think HIE is working better on Windows 10 with the new version . The type information appears very fast now.
@jneira The UTF problem persists. On the other hand, HIE now shows the line where the error is, as the below figure shows: |
@andregpss finally the fix has been done in the hie dep I dont have lexical errors with utf8 strings (but i did not have them before the patch that only fixes hlint) Just in case, are you using utf8 encoding for your files (you can check it in the state bar of vscode)? |
Yes, i'm using utf-8 encoding (i saw this on
How can i update HIE to use that branch? is it the last master commit? can i just pull the updates on HIE project? |
@andregpss yeah (to the last question), you can checkout the branch in the hie project root dir:
|
The UTF-8 problem persist, the same way as before.
This command did not work. I used The HIE version i am using now is:
Also, i wrote before that HIE now works without |
oh sorry for my incomplete and erroneous steps: D:\ws\haskell\haskell-ide-engine>git status
On branch master
Your branch is up to date with 'upstream/master'.
nothing to commit, working tree clean
D:\ws\haskell\haskell-ide-engine>git log -n 1
commit dc03b0b453dff503005804fe0bba04fc8b8d95f5 (HEAD -> master, origin/master
, upstream/HEAD)
...............
D:\ws\haskell\haskell-ide-engine>git remote -v | grep haskell/haskell-ide-engine
origin https://github.com/haskell/haskell-ide-engine (fetch)
origin https://github.com/haskell/haskell-ide-engine (push)
D:\ws\haskell\haskell-ide-engine>git checkout -t origin/fix-hlint-utf8
Switched to a new branch 'fix-hlint-utf8'
Branch 'fix-hlint-utf8' set up to track remote branch 'fix-hlint-utf8' from 'origin'.
D:\ws\haskell\haskell-ide-engine>git log -n 1
commit b1f50edc095d454087e2e34e9419922e2d248f15 (HEAD -> fix-hlint-utf8, origin/fix-hlint-utf8)
Author: jneira <[email protected]>
Date: Wed Jan 29 10:04:07 2020 +0100
Use haskell-lsp with utf8 fix
D:\ws\haskell\haskell-ide-engine>stack install.hs hie-8.6.5
Sorry to hear that, could you attach the log with verbose mode on using the fix-hlint-utf8 version? |
@jneira The command
|
In the log i see |
I am planning on getting an updated haskell-lsp release out soon.
…On Thu, 30 Jan 2020 at 18:04, Javier Neira ***@***.***> wrote:
In the log i see git checkout -t upstream/fix-hlint-utf8 but it should be
origin/fix-hlint-utf8 (like in the start of your comment)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1560?email_source=notifications&email_token=AADEAB3BQLLHNU4VABBEOW3RAMJETA5CNFSM4KDK6K3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKL6NUQ#issuecomment-580380370>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADEABYAQ7VSHKDFAWE62YLRAMJETANCNFSM4KDK6K3A>
.
|
@jneira I'm sorry. Now using
@jneira I deleted |
@andregpss great! dont worry about, those thing happens continually I'll reopen this and close it when hie start to use the |
@andregpss current master already has the
should install a hie version that works |
@andregpss wow, however, afaiu the hlint one is gone definitely, right? |
@jneira the current error message is the same as the title of this issue:
The difference between when i opend this thread and now is that there is a second error message, that i sent on a figure attached in a message above:
I warn that when i used |
@andregpss Assuming you pulled in the latest changes, yeah, it should be. |
errr, it seems the fix is in
@andregpss sorry for the inconveniences, i thought that we already have bumped the version |
@jneira No problem! Please warn me when you want me to test a new HIE version. |
Hi again @andregpss, i think this time will be the right one. Pull again from master and it should work. |
@jneira UTF-8 issue fixed on master branch! thanks a lot! |
HIE is not working.
When i open an ".hs" file on Atom, the following error happens:
When i open the same project on VS Code, the error is:
On HIE log, the last lines are:
I am using Atom 1.42.0 on Windows 10.
The text was updated successfully, but these errors were encountered: