You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.
Log file
14:56:49[DEBUG] Running formatters on /home/mlar/test2.py: { "injected" }
14:56:49[INFO] Run injected on /home/mlar/test2.py
14:56:49[DEBUG] Injected format json:1:2: { "fixjson" }
14:56:49[INFO] Run fixjson on /home/mlar/test2.py.json
14:56:49[DEBUG] Run command: { "fixjson" }
14:56:49[INFO] fixjson exited with code 1
14:56:49[DEBUG] fixjson stdout: { "" }
14:56:49[DEBUG] fixjson stderr: { "Error: <stdin>: Expected 'r' instead of 'e' at line 1 column 3 of the JSON5 data. Still to read: \"est_json = \\\"\\\"\\\"\\n{ \\\"th\"", "" }
14:56:49[ERROR] Formatter 'fixjson' error: Error: <stdin>: Expected 'r' instead of 'e' at line 1 column 3 of the JSON5 data. Still to read: "est_json = \"\"\"\n{ \"th"
14:56:49[ERROR] Formatter 'fixjson' error: Error: <stdin>: Expected 'r' instead of 'e' at line 1 column 3 of the JSON5 data. Still to read: "est_json = \"\"\"\n{ \"th"
Describe the bug
On latest master it fails with the following error
14:44:35[ERROR] Formatter 'fixjson' error: Error: <stdin>: Expected 'r' instead of 'e' at line 1 column 3 of the JSON5 data. Still to read: "est_json = \"\"\"\n{ \"th"
If I checkout commit#eeef888 it works again. By the looks of the log, it seems that conform includes the variable as well as the injection.content?
It does correctly identify json blobs (but still keeps the variable name as well), when having multiple lines of other python code. Also the highlight injection does work, highlighting the contents of test_json as json, and the surrounds as Python code (as expected)
Steps To Reproduce
Create the injections.scm file, as well as the python test file; open the python file and run :lua require("conform").format() and see an error :'(
Could be related to #207. I could see this happening if the injection was catching the newlines adjacent to the quote and not just the single line with the JSON content.
Uh oh!
There was an error while loading. Please reload this page.
Neovim version (nvim -v)
NVIM v0.10.0-dev
Operating system/version
Ubuntu 22.04
Add the debug logs
log_level = vim.log.levels.DEBUG
and pasted the log contents below.Log file
Describe the bug
On latest master it fails with the following error
If I checkout commit#eeef888 it works again. By the looks of the log, it seems that conform includes the variable as well as the
injection.content
?It does correctly identify json blobs (but still keeps the variable name as well), when having multiple lines of other python code. Also the highlight injection does work, highlighting the contents of
test_json
as json, and the surrounds as Python code (as expected)Steps To Reproduce
Create the injections.scm file, as well as the python test file; open the python file and run
:lua require("conform").format()
and see an error :'(Expected Behavior
Formatting to succeed, as in commit#eeef888
Minimal example file
This Python injection:
Fails to format this python code:
Minimal init.lua
Additional context
Hmm, I must be honest, I don't know how to make nvim-treesitter use custom injections when using nvim -u repro.lua ... :'(
I will have a deeper look tomorrow, maybe making a PR :-)
Interestingly, the json injection-formatter works in a markdown document like this:
The text was updated successfully, but these errors were encountered: