Closed betlgtu closed 9 years ago
Can't reproduce. Could you test with Atom 0.181.0? (since it looks a lot like bug in Atom 0.180.0) If it still happens, could you list actions needed to reproduce, or show a minimal example?
I update atom to 0.181.0. The error still. Minimal example is yesod default scaffolded site. Are you have yesod installed? On small programm (< 200 code rows) I can't reproduce error.
Tested with default yesod 1.4.1 site (created with yesod init
with simple
db). Still couldn't reproduce.
Would you mind running
atom.packages.getActivePackage('haskell-ghc-mod').mainModule.process.getType(atom.workspace.getActiveEditor().getText(),atom.workspace.getActiveEditor().getSelectedBufferRange(),function(range,type){console.log(range.start); console.log(range.end); console.log(type);})
in dev console with your haskell source open and text cursor on symbol you can't get type of, and sending me its output? (it may take a couple seconds before any meaningful output) Please also include output from
atom.workspace.getActiveEditor().getBuffer().getRange().end
If you set cursor on import statement something like this:
import Text.Jasmine (minifym)
And then press Ctrl+Alt+I Or run your command in Dev mode:
atom.packages.getActivePackage('haskell-ghc-mod').mainModule.process.getType(atom.workspace.getActiveEditor().getText(),atom.workspace.getActiveEditor().getSelectedBufferRange(),function(range,type){console.log(range.start); console.log(range.end); console.log(type);}) undefined events.js:94 Uncaught Error: This socket has been ended by the other party atom.workspace.getActiveEditor().getBuffer().getRange().end Point {row: 150, column: 0, copy: function, negate: function, freeze: function…}
It is another error, if I press Ctrl+Alt+T
got something strange from ghc-mod type: ["ghc-mod.exe:
The error "Cannot read property 'length' of undefined" show me after first start of Atom. After 10-20 seconds, I see another error "This socket has been ended by the other party"
Ok, it makes some semblance of sense now. First, half those errors are from ide-haskell. Second, try running ghc-mod check Application.hs
in your project directory. You'll likely find that ghc-mod spits out errors. Try correcting those.
Note that cabal sandboxes have very limited support both in ide-haskell and this package, so if you're using them, you may be out of luck for now.
You may also want to uncheck some ticks in haskell-ghc-mod settings, since you're using ide-haskell anyway.
Please also note, that ghc-modi does not support spaces in project path. This is a bug in ghc-mod, so nothing I can do.
Closing due to no activity (probably solved)
FWIW, I'm seeing this error consistently today.
While I have experience with programming in general, I'm new to Haskell, but if you want more details, I'll be happy to supply them, if only you tell me what I need to do to obtain them.
This error message appears in the Atom editor, where I'm using these packages:
I don't expect that this in itself is enough information, but I'll be happy to provide more data upon request.
@ploeh, if you could create an isolated test case for this, this would be best. But I would guess that's not easy, if at all possible. If you could start with providing Atom version you're running, OS and stack traces for this error, that would probably be good enough. You can copy Atom's error report to clipboard (click little clipboard icon above "View this Issue" button on error message), which would provide this information.
I'll see if I can chase down a simpler repro, but I'm currently working my way through Real World Haskell, having now reached chapter 5. In that chapter, the authors are explaining how to develop a library, and I'm typing in the code as I read along.
Here are some steps that seem to reproduce the issue on my machine.
Add the following files to the same directory:
SimpleJSON.hs
module SimpleJSON
(
JValue(..)
, getString
, getInt
, getDouble
, getBool
, getObject
, getArray
, isNull
) where
data JValue =
JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
| JArray [JValue]
deriving (Eq, Ord, Show)
getString :: JValue -> Maybe String
getString (JString s) = Just s
getString _ = Nothing
getInt (JNumber n) = Just (truncate n)
getInt _ = Nothing
getDouble (JNumber n) = Just n
getDouble _ = Nothing
getBool (JBool b) = Just b
getBool _ = Nothing
getObject (JObject o) = Just o
getObject _ = Nothing
getArray (JArray a) = Just a
getArray _ = Nothing
isNull v = v == JNull
PrettyStub.hs
module PrettyStub where
import SimpleJSON
data Doc = ToBeDefined
deriving (Show)
-- string :: String -> Doc
-- string str = undefined
text :: String -> Doc
text str = undefined
double :: Double -> Doc
double num = undefined
(<>) :: Doc -> Doc -> Doc
a <> b = undefined
PrettyStub.hs
file.Ctrl+s
, or just use the File -> Save menu). This triggers the error. It's not necessary to edit the file first.Atom Version: 1.0.7 System: Microsoft Windows 10 Pro Thrown From: haskell-ghc-mod package, v0.8.13
Uncaught TypeError: Cannot read property 'length' of undefined
At C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\util.coffee:100
TypeError: Cannot read property 'length' of undefined
at Object.module.exports.Util.pointWithTabsRev (C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\util.coffee:142:32)
at C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\ghc-modi-process.coffee:331:28
at Array.forEach (native)
at queueCmd.callback (C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\ghc-modi-process.coffee:321:17)
at C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\ghc-modi-process.coffee:166:11
at BufferedProcess.exit (C:\Users\mark\.atom\packages\haskell-ghc-mod\lib\ghc-modi-process-base.coffee:124:20)
at triggerExitCallback (C:\Users\mark\AppData\Local\atom\app-1.0.7\resources\app.asar\src\buffered-process.js:213:47)
at ChildProcess.<anonymous> (C:\Users\mark\AppData\Local\atom\app-1.0.7\resources\app.asar\src\buffered-process.js:235:18)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:169:7)
-7:27.2.0 core:save (atom-text-editor.editor.is-focused)
-7:27.1.0 ide-haskell:check-file (atom-text-editor.editor.is-focused)
-7:27.1.0 ide-haskell:lint-file (atom-text-editor.editor.is-focused)
-0:35.2.0 pane:show-next-item (atom-text-editor.editor.is-focused)
-0:31.9.0 core:move-to-bottom (atom-text-editor.editor.is-focused)
-0:31.4.0 editor:newline (atom-text-editor.editor.is-focused)
-0:21.8.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused.autocomplete-active)
-0:12.8.0 editor:newline (atom-text-editor.editor.is-focused)
-0:04.1.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
-0:03.3.0 core:save (atom-text-editor.editor.is-focused)
-0:03.3.0 ide-haskell:check-file (atom-text-editor.editor.is-focused)
-0:03.3.0 ide-haskell:lint-file (atom-text-editor.editor.is-focused)
{
"core": {},
"haskell-ghc-mod": {}
}
# User
autocomplete-haskell, v0.4.5
haskell-ghc-mod, v0.8.13
ide-haskell, v0.7.1
keyboard-localization, v1.4.7
language-haskell, v1.4.1
# Dev
No dev packages
Mea culpa. I didn't think a fix for another issue trough. Reverted that for now, 0.8.14 should be good.
That was fast :open_mouth:
Initial testing seems to indicate that this has resolved the problem. :+1:
Thank you
On default for yesod project Application.hs file I get Uncaught TypeError.
Atom Version: 0.180.0 System: Windows 7 Thrown From: haskell-ghc-mod package, v0.4.1
Stack Trace
Uncaught TypeError: Cannot read property 'length' of undefined
Commands
Config
Installed Packages