dense-analysis / dense-analysis/ale

Cabal ghc check report import error when it shouldn't

Open
#2,554 7 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

```
▶ nvim --version
NVIM v0.3.5
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/lib/ccache/bin/cc -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe -g -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/builddir/neovim-0.3.5/build/config -I/builddir/neovim-0.3.5/src -I/usr/include -I/builddir/neovim-0.3.5/build/src/nvim/auto -I/builddir/neovim-0.3.5/build/include
Compiled by void-buildslave@a-hel-fi

Features: +acl +iconv -jemalloc +tui
See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
```

Operating System:

```
▶ uname -a
Linux modular 4.19.47_1 #1 SMP PREEMPT Sat Jun 1 07:32:05 UTC 2019 x86_64 GNU/Linux

▶ cat /etc/*release*
NAME="void"
ID="void"
DISTRIB_ID="void"
PRETTY_NAME="void"
```

## What went wrong

Haskell `cabal ghc` checker return import error on sub module source:

```
Could not find module 'Foo.Bar’
```

## Reproducing the bug

Project structure:

```
src
├── Foo
│ ├── Bar.hs
│ └── Baz.hs
└── Main.hs
```

when editing `Main.hs` which import `Foo.Bar` there is no issue, but when editing `Foo.Baz` which import `Foo.Bar` then the error occure.

I've made a `git bisect` to find when this issue was added, and it came from PR #2345, commit `2eb68f6d23f51c33f3d64a15172c869e71d7829b`, prior to that PR / commit this issue is not present.

So `ale v2.4.0` is not affected.

### :ALEInfo

```
Current Filetype:
Available Linters: []
Enabled Linters: []
Suggested Fixers:
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
Linter Variables:

Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'haskell': ['hfmt'], 'sh': ['shfmt'], 'python': ['black', 'isort']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'never'
let g:ale_linter_aliases = {}
let g:ale_linters = {'haskell': ['cabal-ghc', 'hlint', 'hdevtools'], 'python': ['flake8']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 'on_save'
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.