{"action":"created","issue":{"url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/181","repository_url":"https://api.github.com/repos/prabirshrestha/vim-lsp","labels_url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/181/comments","events_url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/181/events","html_url":"https://github.com/prabirshrestha/vim-lsp/issues/181","id":359725259,"node_id":"MDU6SXNzdWUzNTk3MjUyNTk=","number":181,"title":"LspDocumentRangeFormat corrupts the text when using clangd","user":{"login":"smhc","id":6404304,"node_id":"MDQ6VXNlcjY0MDQzMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6404304?v=4","gravatar_id":"","url":"https://api.github.com/users/smhc","html_url":"https://github.com/smhc","followers_url":"https://api.github.com/users/smhc/followers","following_url":"https://api.github.com/users/smhc/following{/other_user}","gists_url":"https://api.github.com/users/smhc/gists{/gist_id}","starred_url":"https://api.github.com/users/smhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smhc/subscriptions","organizations_url":"https://api.github.com/users/smhc/orgs","repos_url":"https://api.github.com/users/smhc/repos","events_url":"https://api.github.com/users/smhc/events{/privacy}","received_events_url":"https://api.github.com/users/smhc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-09-13T03:05:58Z","updated_at":"2018-09-24T21:36:17Z","closed_at":null,"author_association":"NONE","body":"Using:\r\n\r\n```vim\r\nvnoremap <Leader>f :<C-U>LspDocumentRangeFormat<CR>\r\nau User lsp_setup call lsp#register_server({\r\n      \\ 'name': 'clangd',\r\n      \\ 'cmd': {server_info->['clangd']},\r\n      \\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],\r\n      \\ })\r\n```\r\n\r\nWith a stock standard .clang-format file:\r\nclang-format -style=llvm -dump-config > .clang-format\r\n\r\nC++ code gets corrupted and incorrectly formated when invoked. Seemingly random characters are deleted from the text.\r\n\r\nTest code before formatting:\r\n\r\n```cc\r\nint main() {\r\n    char* lf;\r\n\r\n    if (*lf == 'b') {\r\n        return 0;\r\n    }\r\n    return 1;\r\n}\r\n```\r\n\r\nTest code after formatting:\r\n```cc\r\nint main()\r\n  char*\r\n\r\n  if (*lf == 'b')\r\n    return 0\r\n\r\n  return 1;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/comments/424134028","html_url":"https://github.com/prabirshrestha/vim-lsp/issues/181#issuecomment-424134028","issue_url":"https://api.github.com/repos/prabirshrestha/vim-lsp/issues/181","id":424134028,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDEzNDAyOA==","user":{"login":"prabirshrestha","id":287744,"node_id":"MDQ6VXNlcjI4Nzc0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/287744?v=4","gravatar_id":"","url":"https://api.github.com/users/prabirshrestha","html_url":"https://github.com/prabirshrestha","followers_url":"https://api.github.com/users/prabirshrestha/followers","following_url":"https://api.github.com/users/prabirshrestha/following{/other_user}","gists_url":"https://api.github.com/users/prabirshrestha/gists{/gist_id}","starred_url":"https://api.github.com/users/prabirshrestha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prabirshrestha/subscriptions","organizations_url":"https://api.github.com/users/prabirshrestha/orgs","repos_url":"https://api.github.com/users/prabirshrestha/repos","events_url":"https://api.github.com/users/prabirshrestha/events{/privacy}","received_events_url":"https://api.github.com/users/prabirshrestha/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T21:36:17Z","updated_at":"2018-09-24T21:36:17Z","author_association":"OWNER","body":"Can you retry https://github.com/prabirshrestha/vim-lsp/pull/162 branch. Seems like @augustomelo updated the text edit order in the latest commit."}}
{"actor":{"display_login":"prabirshrestha"}}