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
Creating maker with InitForJob
fails with instructions from documentation
#2503
Comments
To make it work, the function definition must be changed in:
If writing your own maker, another option is to define the InitForJob directly inside it (doing so will apply that InitForJob only to that particular maker of course), like this:
This also works, because it defines the function directly on the dict, like in Either way, the example in the neomake documentation needs to be fixed accordingly. |
Thanks for chiming in here, really appreciate it. I installed Neomake again and edited the function accordingly: diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix
index ea97447..74a8f2f 100644
--- a/modules/neovim/default.nix
+++ b/modules/neovim/default.nix
@@ -60,6 +60,7 @@ in
unicode-vim
minimap-vim
nvim-compe
+ neomake
# Git
vim-fugitive
diff --git a/modules/neovim/initvim.nix b/modules/neovim/initvim.nix
index 010ecdd..9b14fa9 100644
--- a/modules/neovim/initvim.nix
+++ b/modules/neovim/initvim.nix
@@ -318,4 +318,12 @@ in
};
}
EOF
+
+ function! MyCustomExe(jobinfo) abort dict
+ let maker = deepcopy(self)
+ call insert(maker.args, maker.exe)
+ let maker.exe = 'some_custom_wrapper'
+ return maker
+ endfunction
+ call neomake#config#set('ft.go.InitForJob', function('MyCustomExe'))
'' Unfortunately the error remains more or less the same for
I don't get an error for |
Ok, I wasn't getting that error because I was setting the InitForJob for a specific maker, not for a whole filetype. With the This is where I think the error is being generated: Line 913 in 5e140db
Thing is, I'm not sure if there's a bug there or in the documentation (maybe we are not really supposed to modify argument for a whole filetype). While we wait for an answer might I suggest you try setting manually the InitForJob for every maker you need modified in the filetype as a workaround? Something like:
|
Yup that works. Thanks a lot for taking the time. I'll leave the issue open. In case one of the maintainers replies I can update documentation. I don't currently have the time to dive into the code, also because I know very little vim script. |
Expected behavior
No crash
Steps to reproduce
Use this minimal config
Log output
Steps:
... or 3. Hit Enter after
:Neomake
Output from :NeomakeInfo
Neomake debug information
Async support: 1
Current filetype: go
Windows: 0
[shell, shellcmdflag, shellslash]: ['/nix/store/xcdg9wkfq9xlfz4ncpxzg714ir56c3w4-fish-3.1.2/bin/fish', '-c', 0]
makeprg=go build, Last set from ~/.config/nvim/ftplugin/go.vim line 18
Enabled makers
For the current filetype ("go", used with :Neomake):
NOTE: you can define g:neomake_go_enabled_makers to configure it (or b:neomake_go_enabled_makers).
For the project (used with :Neomake!):
NOTE: you can define g:neomake_enabled_makers to configure it.
Default maker settings:
Settings
New-style (dict, overrides old-style)
Old-style
:version
:messages
The text was updated successfully, but these errors were encountered: