neoclide / coc-json

Json language extension for coc.nvim
234 stars 21 forks source link

Formatting does not work correctly #10

Closed xulongwu4 closed 5 years ago

xulongwu4 commented 5 years ago

I created a simple json file with the following content:

[
    {
    "link": {
        "bashrc": "~/.bashrc"
        }
    }
]

Then I tried to use coc-json to format it. The result is as follows:

[
    {
        "link": {
            "bashrc": "~/.bashrc"
        }
    }
]
    "link": {
        "bashrc": "~/.bashrc"
        }
    }
]

The formatted document has some part of text dupliated and has an extra right bracket.

chemzqm commented 5 years ago

Could be bug, but I can't reproduce

xulongwu4 commented 5 years ago

I can reproduce this issue on two different OSes: Solus and void linux, both with vim 8.1.1764 though. @chemzqm Did you try formatting the block of json file I posted above?

patrick96 commented 5 years ago

I was able to reproduce this just now (vim 8.1.2268). I created a minimal config and was good to go, then I remembered I should maybe update my vim plugins. Now I can't reproduce this anymore, so this was probably fixed in a version of coc.nvim