Closed whyjacker closed 1 year ago
@mattn I think the issue is with format %f(%l,%c): %tarning %m
. As %f
contains spaces.
Loving the plugin, thanks for your work mattn!
Seeing this as well, an example can be reproduced using the Pandoc config from the README. Ex:
config.yaml
version: 2
root-markers:
- .git/
lint-debounce: 1s
tools:
markdown-pandoc: &markdown-pandoc
format-command: 'pandoc -f markdown -t gfm -sp --tab-stop=2'
languages:
markdown:
- <<: *markdown-pandoc
Create a file in a directory like "test dir", and open or attempt to save a .md file. Logs:
[START][2023-07-15 20:13:03] LSP logging initiated
[ERROR][2023-07-15 20:13:03] .../vim/lsp/rpc.lua:734 "rpc" "/home/X/.local/share/nvim/mason/bin/efm-langserver" "stderr" "2023/07/15 20:13:03 efm-langserver: reading on stdin, writing on stdout\n"
[ERROR][2023-07-15 20:13:25] .../vim/lsp/rpc.lua:734 "rpc" "/home/X/.local/share/nvim/mason/bin/efm-langserver" "stderr" "2023/07/15 20:13:25 pandoc -f markdown -t gfm -sp --tab-stop=2 /home/X/dev/test dir/test.md: pandoc: /home/X/dev/test: withBinaryFile: does not exist (No such file or directory)\n\n"
We can also change the config's format-command to:
markdown-pandoc: &markdown-pandoc
format-command: 'pandoc -f markdown -t gfm -sp --tab-stop=2 "${FILENAME}"'
... However, the original filename is still appended at the end:
[ERROR][2023-07-15 20:15:52] .../vim/lsp/rpc.lua:734 "rpc" "/home/X/.local/share/nvim/mason/bin/efm-langserver" "stderr" '2023/07/15 20:15:52 pandoc -f markdown -t gfm -sp --tab-stop=2 "/home/X/dev/test dir/test.md" /home/X/dev/test dir/test.md: pandoc: /home/X/dev/test: withBinaryFile: does not exist (No such file or directory)\n\n'
Perhaps there's a way to signal that FILENAME is being interpolated and should not be appended?
I'd be interested in taking a crack at that--would preventing the filename from being appended when provided with the ${FILENAME}
argument be a breaking change for some configurations?
What happend with "${INPUT}"
?
Ah hey, my mistake in that pandoc will indeed handle from stdin, so this isn't an issue for this particular case.
markdown-pandoc: &markdown-pandoc
format-command: 'pandoc -f markdown -t gfm -sp --tab-stop=2'
format-stdin: true
When using "${INPUT}"
(and not format-stdin: true
) the file contents seem to be replaced with nothing, though there's probably some other flag to be set on pandoc. I can see from an unrelated issue that the filename is quoted and passed correctly; sorry for missing that.
Appreciate the help! I think this issue can be closed 👍
With below setting for ESlint, ESlint only receives
/tmp/Space
in place of${INPUT}
. And double quoting"${INPUT}"
in the command, breaks ESlint.This works (from cli):
Means, it's not ESlint's fault.
This causes ESlint to show some wrong linting messages, because some linting rules depend on file names.
Suggested fix
I think this should be easy to fix, as EFM only has to quote
${INPUT}
properly when passing it to the command.Using with Neovim LSP. ESlint
v7.32.0
EFM:
0.0.36