parsonsmatt / intero-neovim

A neovim plugin for Intero, forked from ghcmod-vim
218 stars 28 forks source link

intero fails to initialize if the directory contains spaces #138

Open mattsawyer77 opened 6 years ago

mattsawyer77 commented 6 years ago

I keep my haskell src files in iCloud, which means the path to those files is ~/Library/Mobile Documents/com~apple~CloudDocs/src But it seems Intero can't handle it. When opening a haskell file, I see this in the Intero_compile window:

Invalid argument `Documents/com~apple~CloudDocs/src/haskell/TestProject/stack.yaml'
File does not exist or is not a regular file `--stack-yaml'

Usage: stack [--help] [--version] [--numeric-version] [--hpack-numeric-version]
             [--docker*] [--nix*] ([--verbosity VERBOSITY] | [-v|--verbose] |
             [--silent]) [--[no-]time-in-log] [--stack-root STACK-ROOT]
             [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc]
             [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD]
             [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR]
             [--with-gcc PATH-TO-GCC] [--with-hpack HPACK]
             [--[no-]skip-ghc-check] [--[no-]skip-msys] [--local-bin-path DIR]
             [--[no-]modify-code-page] [--[no-]allow-different-user]
             [--[no-]dump-logs] [--resolver RESOLVER] [--compiler COMPILER]
             [--[no-]terminal] [--color WHEN] [--terminal-width INT]
             [--stack-yaml STACK-YAML] COMMAND|FILE

[Process exited 1]

I copied my src folder to a location where the directory path doesn't have any spaces, and Intero seems to work fine.

parsonsmatt commented 6 years ago

There's a regex that looks at the filepath for the stack.yaml file. It needs to be modified to accept whitespace as a valid character.