Skip to content

Quickfix navigation for "Make" does not work #16

Description

@fulv

I'm still a beginner when it comes to dispatch and this plugin, but I am having a problem with the quickfix window from the Make output. Somehow the error parsing does not work, while it works fine in vim-dispatch if I disable vim-dispatch-neovim. I have created the following test case to reproduce the problem.

Here is my environment:

  • OS: Ubuntu 16.04
  • nvim: v0.2.2
  • vim-dispatch: master branch
  • vim-dispatch-neovim: master branch
  • ~/.vimrc: none
  • ~/.config/nvim/after/compiler/typescript.vim:
let current_compiler = "typescript"
CompilerSet makeprg=tsc\ $*\ --outDir\ build\ %
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
  • ~/.config/nvim/pack/bundle/start: vim-dispatch and vim-dispatch-neovim
  • nothing else at all in ~/.config/nvim
  • nothing in ~/.vim
  • node: v8.11.3
  • npm: 5.6.0
  • tsc: 2.9.2

I have this simple typescript file src/greeting.ts which contains two errors:

class Time {
  constructor(public timestamp: Date) {}

  label() {
    let message: string;
    let hour = this.timestamp.getHours();

    if (hour < 12 && hour > 6) {
      message = 1;
    } else if (hour < 18) {
      message = "afternoon"
    } else if (hour < 21){
      message = "evening"
    } else {
      message = "night"
    }

    return message;
  }
}

function greeting() {
  let now = new Time('now');
  return `Good ${now.label()}`;
}

document.body.innerHTML = greeting();

Then I open this file in nvim, and do the following:

:compiler typescript
:Make

Here is the output in the quickfix window from Make with vim-dispatch-neovim disabled:

src/greeting.ts|9 col 7| src/greeting.ts(9,7): error TS2322: Type '1' is not assignable to type 'string'.                           
src/greeting.ts|23 col 22| src/greeting.ts(23,22): error TS2345: Argument of type '"now"' is not assignable to parameter of type 'Da
te'.

The :cfirst, :cnext, :cprev, :clast commands work fine and position the cursor in the source file accordingly.

By contrast, here it is with vim-dispatch-neovim enabled:

|| src/greeting.ts:9:7 - error TS2322: Type '1' is not assignable to type 'string'.
|| 
|| 9       message = 1;
||         ~~~~~~~
||  
||  
|| src/greeting.ts:23:22 - error TS2345: Argument of type '"now"' is not assignable to parameter of type 'Date'.
||  
|| 23   let now = new Time('now');
||                         ~~~~~
||    
||  
||                     

As you migth imagine, the :cfirst, :cnext, :cprev, :clast commands don't work in the second case. In particular, :cn and :cp simply move forward and backward one line at a time, and do not position the cursor in the source file.

I would be grateful for any insights!

For reference, this example is copied verbatim from the book "Modern Vim", and can be found in every detail in this extract made available to the public by the publisher: https://media.pragprog.com/titles/modvim/failures.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions