标签: intero

在emacs上使用Hlint和intero

我无法使用intero获得在emacs中出现的hlint建议.

  • 我有一个新的emacs 24.5安装
  • 我把这里的intero东西添加到新~/.emacs文件中
  • 我没有为emacs做任何其他事情.

我读过解决方案是:

(flycheck-add-next-checker 'intero
                           '(warning . haskell-hlint))
Run Code Online (Sandbox Code Playgroud)

但我不知道我应该怎么做.如果我将其添加到我的~/.emacs文件中,则emacs会在启动时失败.

(其余的似乎没问题 - 当我打开一个Haskell文件时,intero会启动 - 错误会在我输入时立即被标记.)

如何获得Hlint建议?

emacs haskell hlint intero

10
推荐指数
1
解决办法
1225
查看次数

intero 错误:错误类型参数 stringp nil

我正在尝试让 intero运行。安装后,从现有堆栈项目中打开 Haskell 文件会导致:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  signal(wrong-type-argument (stringp nil))
  flycheck-buffer()
  flycheck-buffer-automatically()
  flycheck-perform-deferred-syntax-check()
  set-window-buffer(#<window 1 on Lib.hs> #<buffer Lib.hs>)
  window--display-buffer(#<buffer Lib.hs> #<window 1 on Lib.hs> reuse ((inhibit-same-window)))
  display-buffer-same-window(#<buffer Lib.hs> ((inhibit-same-window)))
  display-buffer(#<buffer Lib.hs> (display-buffer-same-window (inhibit-same-window)))
  pop-to-buffer(#<buffer Lib.hs> (display-buffer-same-window (inhibit-same-window)) nil)
  pop-to-buffer-same-window(#<buffer Lib.hs>)
  find-file("~/test/src/Lib.hs" t)
  funcall-interactively(find-file "~/test/src/Lib.hs" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
Run Code Online (Sandbox Code Playgroud)

当我flycheck-buffer在同一个缓冲区中运行时,即使源代码中有错误,也没有任何反应。

这是我的.emacs文件的内容:

(setq debug-on-error t)

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)

(package-install 'intero)
(add-hook 'haskell-mode-hook 'intero-mode)
Run Code Online (Sandbox Code Playgroud)

由于我在 Mac …

emacs haskell haskell-stack intero

6
推荐指数
1
解决办法
800
查看次数

Intero:来自堆栈配置的ghc不匹配

intero-mode试图自动安装关于Interotube,它产生以下错误:

Intero is not installed in the Stack environment.

Installing intero-0.1.23 automatically ...


Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for intero-0.1.23:
    ghc-8.2.2 from stack configuration does not match >=7.8 && <8.2.2 (latest matching version
              is 8.2.1)
needed since intero is a build target.

Some potential ways to resolve this:

  * Recommended action: try adding the following to your extra-deps
    in <project directory>\stack.yaml:

- ghc-8.2.1

  * Set 'allow-newer: true' to ignore …
Run Code Online (Sandbox Code Playgroud)

emacs haskell haskell-stack intero

5
推荐指数
1
解决办法
1222
查看次数

Stack 无法安装 intero

我刚刚安装了 Stack 使用

curl -sSL https://get.haskellstack.org/ | sh
Run Code Online (Sandbox Code Playgroud)

安装顺利,但尝试使用 Stack 安装 Intero 时失败

ffriis@BNEC02QR6Y0G8WN ~> stack install hlint intero

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for intero-0.1.32:
    ghc-8.4.4 from stack configuration does not match >=7.8 && <=8.4.3  (latest matching version is 8.4.3)
needed since intero is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' in /Users/ffriis/.stack/config.yaml to ignore all version constraints and build anyway.

  * Consider trying …
Run Code Online (Sandbox Code Playgroud)

haskell haskell-stack intero

4
推荐指数
1
解决办法
1886
查看次数

Haskero失败,"不是有效的Unicode代码点!"

我正在尝试运行Haskero来使用VSCode进行Haskell编辑.但是,它在初始化时失败,出现以下错误:

Initializing Haskero...
Spawning process 'stack' with command 'stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load'
(node:3726) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: reason.indexOf is not a function
(node:3726) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run Code Online (Sandbox Code Playgroud)

当我从控制台中的错误运行命令时,我收到以下错误:

$ stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load
The following GHC options are incompatible with GHCi and have not been passed to …
Run Code Online (Sandbox Code Playgroud)

haskell visual-studio-code haskell-stack intero haskero

3
推荐指数
1
解决办法
253
查看次数

编译错误构建intero

我无法在新的堆栈项目上使用 emacs,因为 intero 无法构建。

  1. 我刚刚在 ubuntu 16.04 上安装了 stack 1.6.3
  2. 我使用以下方法创建了一个新的 (lts-10.2) 堆栈项目 ('play'): stack new play
  3. 当我尝试在 emacs 中打开源文件时,它无法构建 intero

    Intero is not installed in the Stack environment.
    
    Installing intero-0.1.24 automatically ...
    
    intero-0.1.24: configure
    intero-0.1.24: build
    
    --  While building custom Setup.hs for package intero-0.1.24 using:
    /home/wmorgan/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/wmorgan/haskell/play/.stack-work/logs/intero-0.1.24.log
    Configuring intero-0.1.24...
    Preprocessing executable 'intero' for intero-0.1.24..
    Building executable 'intero' for intero-0.1.24..
    [1 of 8] …
    Run Code Online (Sandbox Code Playgroud)

haskell-stack intero

3
推荐指数
1
解决办法
823
查看次数

更改cabal文件后更新Intero flycheck

我在emacs下使用Intero来编辑我的新Haskell项目.我向我的代码添加了第三方库的导入,以查看Intero是否会自动添加必要的依赖项,但事实并非如此.所以我.cabal手动编辑了文件以添加必要的依赖项.现在我该怎么做 - 没有重启emacs?

我尝试cabal install --dependencies-only; cabal configure在命令行运行并且它们成功运行,但是flycheck缓冲区仍然显示错误.

emacs haskell haskell-mode intero

2
推荐指数
1
解决办法
396
查看次数

为什么emacs 找不到haskell-mode 包?

我目前得到的错误是:

File error: http://melpa.org/packages/haskell-mode-20161110.316.tar, Not found
Run Code Online (Sandbox Code Playgroud)

安装intero 时。我该如何解决这个问题?

谢谢!

emacs haskell intero

2
推荐指数
1
解决办法
654
查看次数