如何在 windows 上安装 "elm-light"?

how can I install "elm-light" on windows?

elm-light looks like a great plugin for elm in the LightTable editor, but I can't make it work properly on Windows. When I try to establish a connection,我收到此错误:Path must be a string. Received null

请帮忙...

避免在 elm-platform 的路径中出现空格

  • 在 Windows 命令提示符中键入 echo %path% 以检查 Elm 路径
  • 必要时卸载并在另一个文件夹中重新安装 elm

避免在 LightTable 的路径中出现空格

  • 必要时移动 LightTable 文件夹
  • 卸载并在新位置重新安装 elm 插件

安装elm-oracle

  • 在 Windows 命令提示符中执行 npm install elm-oracle 以自动完成工作。

安装elm-format

配置keymaps

  • 在键和弦中使用 ctrl- (Windows) 而不是 cmd (iOS)

"Path must be a string" 在 elm-light-0.42

中应该已经是 fixed

AST

Auto-completions only starts working once you have connected to an Elm project. You can force "suto.connection", through various commands (Lint, toggle docs etc). So if you hit "ctrl-d" on a symbol when you aren't connected, it will connect for you. Another option is to add the Lint command to the save operation in Light Table. Again see Useful configurations -- https://rundis.gitbooks.io/elm-light-guide/content/chapter1.html

用Light打开elm文件后Table,可以看到状态:AST not connected。这意味着 elm-light 还没有 运行。

您必须通过 运行ning ctrl+space > ELM: Load/reload project AST 或更好的 mapping 手动连接此操作才能保存。

为此,运行 ctrl-space > Settings: User keymap。在最后 ] 之前添加第 [:editor.elm "ctrl-s" :save :elm-format :elm.lint] 行,使其看起来像这样:

[
 ;; ...
 [:editor.elm "ctrl-s" :save :elm-format :elm.lint]
]

以上映射到 ctrl-s 也将格式化和整理您的文件。

还有一件事。如果你键入例如 import Dict as Dict exposing (,AST 将报错。为此,我们需要自动关闭括号。为此,运行 ctrl-space > Settings: User behaviors 并添加行 [:editor :lt.objs.editor/autoclose-brackets],使文件看起来像这样:

[
 ;; ...
 [:editor :lt.objs.editor/autoclose-brackets]
]