Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neomake quickfix not opening lnum: 0 bufnr: 0 ... #2523

Closed
danielnehrig opened this issue Mar 17, 2021 · 3 comments
Closed

Neomake quickfix not opening lnum: 0 bufnr: 0 ... #2523

danielnehrig opened this issue Mar 17, 2021 · 3 comments

Comments

@danielnehrig
Copy link

danielnehrig commented Mar 17, 2021

Expected behavior

Running a Test with vim-test and neomake strategy should open the quickfix list when tests finished

Steps to reproduce

  1. typescript test file
  2. using vim-test to trigger neomake
  3. using jest reporter https://github.com/olalonde/jest-quickfix-reporter
11:40:09 43524 [D  +759] [2.-:2:1] Running makers: makeprg (auto).
11:40:09 43524 [D      ] [-.-:2:1] Using setting append_file=0 from 'maker'.
11:40:09 43524 [V      ] [2.2:2:1] Starting async job: /usr/local/bin/zsh -c 'node_modules/.bin/jest --reporters jest-vim-reporter --no-coverage -- domain/shared/shop-config/TenantSerializer.test.ts'.
11:40:09 43524 [D      ] [2.2:2:1] cwd: /Users/dNehrig/code/work/microfrontend-checkout.
11:40:09 43524 [D      ] [2.2:2:1] Calling User autocmd NeomakeJobStarted with context: {'jobinfo': 'Job 2: makeprg'}.
11:40:12 43524 [D +3.05] [2.2:2:1] output on stdout: ['TenantSerializer return an array which separates tenant from environment', '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:5:39: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "qs", "tenant": "com"}', 'TenantSerializer should not return an empty string for environment if none was provided', '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:10:36: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "", "tenant": "com"}', ''].
11:40:12 43524 [D      ] [2.2:2:1] exit: makeprg: 1.
11:40:12 43524 [D      ] [2.2:2:1] Processing 4 lines of output.
11:40:12 43524 [D      ] [2.-:2:1] Adding 4 list entries.
11:40:12 43524 [D      ] [2.-:2:1] Creating quickfix list for entries.
11:40:12 43524 [D      ] list: call: set: [[], ' ', {'context': {'neomake': {'make_info': 'make_id=2'}}, 'items': [], 'title': 'Neomake[project]: makeprg...'}].
11:40:12 43524 [D      ] list: got qfid (action=set): 5.
11:40:12 43524 [D      ] list: call: set: [[], 'a', {'id': 5, 'items': [{'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': 'TenantSerializer return an array which separates tenant from environment'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:5:39: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "qs", "tenant": "com"}'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': 'TenantSerializer should not return an empty string for environment if none was provided'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'module': '', 'type': '', 'pattern': '', 'text': '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:10:36: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "", "tenant": "com"}'}], 'title': 'Neomake[project]: makeprg...'}].
11:40:12 43524 [D      ] list: call: "get", returning items: [['getqflist', [{'id': 5, 'items': 1}]]].
11:40:12 43524 [D      ] [2.2:2:1] Processing 4 entries.
11:40:12 43524 [D      ] [2.-:2:1] Project-level errors cleaned.
11:40:12 43524 [D      ] [2.2:2:1] Skipped 4 entries without bufnr: [{'lnum': 0, 'bufnr': 0, 'col': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'TenantSerializer return an array which separates tenant from environment'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:5:39: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "qs", "tenant": "com"}'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'TenantSerializer should not return an empty string for environment if none was provided'}, {'lnum': 0, 'bufnr': 0, 'col': 0, 'pattern': '', 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': '/Users/dNehrig/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts:10:36: Error: expect(received).toThrow() Matcher error: received value must be a function Received has type: object Received has value: {"environment": "", "tenant": "com"}'}].
11:40:12 43524 [D      ] [2.2:2:1] Handling quickfix list: executing cwindow.
11:40:12 43524 [D      ] [2.2:2:1] makeprg: completed with exit code 1.
11:40:12 43524 [D      ] [2.2:2:1] Cleaning jobinfo.
11:40:12 43524 [D      ] [2.2:2:1] Calling User autocmd NeomakeJobFinished with context: {'jobinfo': 'Job 2: makeprg [finished]'}.
11:40:12 43524 [D      ] Removing signs: {file: {}, project: {}}.
11:40:12 43524 [D      ] list: call: "title": [[], 'a', {'id': 5, 'title': 'Neomake[project]: makeprg(4)'}].
11:40:12 43524 [D      ] [2.-:2:1] Cleaning make info.

for some reason it will not detect the line number col number and what not from stdout

Output from :NeomakeInfo

Neomake debug information

Async support: 1
Current filetype: typescript
Windows: 0
[shell, shellcmdflag, shellslash]: ['/usr/local/bin/zsh', '-c', 0]
makeprg=tsc $* %, Last set from ~/.dotfiles-darwin/.dotfiles-vim/plugged/vim-test/autoload/test/strategy.vim line 187

Enabled makers

For the current filetype ("typescript", used with :Neomake):

  • tsc
    • append_file: 0
    • args: ['--noEmit', '--watch', 'false', '--pretty', 'false', '--project', '/Users/dNehrig/code/work/microfrontend-checkout/tsconfig.json']
    • auto_enabled: 1
    • errorformat: '%E%f %#(%l,%c): error %m,%E%f %#(%l,%c): %m,%Eerror %m,%C%\s%+%m'
    • exe: 'tsc'
    • WARNINGS:
      • maker's exe (tsc) is not executable.
  • tslint
    • args: ['-t', 'prose', '--project', '/Users/dNehrig/code/work/microfrontend-checkout/tsconfig.json']
    • auto_enabled: 1
    • cwd: '/Users/dNehrig/code/work/microfrontend-checkout'
    • errorformat: '%-G,%EERROR: %f:%l:%c - %m,%WWARNING: %f:%l:%c - %m,%EERROR: %f[%l, %c]: %m,%WWARNING: %f[%l, %c]: %m'
    • exe: 'tslint'
    • version information (/usr/local/bin/tslint --version): 6.1.3
      NOTE: you can define g:neomake_typescript_enabled_makers to configure it (or b:neomake_typescript_enabled_makers).

For the project (used with :Neomake!):

  • makeprg
    • append_file: 0
    • args: ['-c', 'tsc $* %']
    • auto_enabled: 1
    • errorformat: '%+A %#%f %#(%l,%c): %m,%C%m'
    • exe: '/usr/local/bin/zsh'
    • version information (/usr/local/bin/zsh --version): zsh 5.8 (x86_64-apple-darwin19.6.0)
      NOTE: you can define g:neomake_enabled_makers to configure it.

Default maker settings:

  • output_stream: 'both'
  • remove_invalid_entries: 0
  • buffer_output: 1
Settings
New-style (dict, overrides old-style)
g:neomake: {
  'automake': {
    'ignore_filetypes': [
      'startify',
    ],
  },
}
b:neomake: unset
Old-style
g:neomake_logfile = '/tmp/neomake.log'
g:neomake_open_list = 2
g:neomake_place_signs = 1

:version

NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20210221-22062-cmfqom/neovim-0.4.4/build/config -I/tmp/neovim-20210221-22062-cmfqom/neovim-0.4.4/src -I/usr/local/include -I/usr/local/opt/luv/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210221-22062-cmfqom/neovim-0.4.4/build/src/nvim/auto -I/tmp/neovim-20210221-22062-cmfqom/neovim-0.4.4/build/include
Compiled by brew@BigSur

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.4_1/share/nvim"

Run :checkhealth for more info

:messages

"~/code/work/microfrontend-checkout/domain/shared/shop-config/TenantSerializer.test.ts" 12L, 468C
4 lines yanked
4 lines yanked into "+
E14: Invalid address
E492: Not an editor command: Neomakeinfo
@blueyed
Copy link
Member

blueyed commented Mar 18, 2021

for some reason it will not detect the line number col number and what not from stdout

Yeah - you're seeing 4 entries I guess, but they are not parsed, right?
This is due to the (wrong) errorformat likely ('%+A %#%f %#(%l,%c): %m,%C%m').

See the FAQ:

6.3 How to develop/debug the errorformat setting?~

@blueyed
Copy link
Member

blueyed commented Mar 18, 2021

https://github.com/olalonde/jest-quickfix-reporter says:

The output is compatible with Vim's default errorformat.

But the one you have is not the default.
Check :verb set efm? to see where it might have been set.

@danielnehrig
Copy link
Author

i figure the issue was 'vim-polygot' which overwrote the errorformat
@blueyed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants