Skip to content

Instantly share code, notes, and snippets.

@wz1000
Last active June 10, 2017 17:33
Show Gist options
  • Save wz1000/a2f7ae98a42ec0414bed62476b10d285 to your computer and use it in GitHub Desktop.
Save wz1000/a2f7ae98a42ec0414bed62476b10d285 to your computer and use it in GitHub Desktop.
HIE Execute Command bug
2017-06-10 22:48:34 [ThreadId 9] - <--2--{"result":[{"arguments":[{"file":{"textDocument":{"uri":"file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs"}}},{"start_pos":{"position":{"line":3,"character":8}}}],"title":"Apply hint:Redundant bracket","command":"applyrefact:applyOne"}],"jsonrpc":"2.0","id":3}
2017-06-10 22:48:36 [ThreadId 7] - ---> {"jsonrpc":"2.0","id":4,"method":"workspace/executeCommand","params":{"command":"applyrefact:applyOne","arguments":[{"file":{"textDocument":{"uri":"file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs"}}},{"start_pos":{"position":{"line":3,"character":8}}}]}}
2017-06-10 22:48:36 [ThreadId 10] - reactor:got ExecuteCommandRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 4, _method = WorkspaceExecuteCommand, _params = ExecuteCommandParams {_command = "applyrefact:applyOne", _arguments = Just (List [Object (fromList [("file",Object (fromList [("textDocument",Object (fromList [("uri",String "file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs")]))]))]),Object (fromList [("start_pos",Object (fromList [("position",Object (fromList [("line",Number 3.0),("character",Number 8.0)]))]))])])}}
2017-06-10 22:48:36 [ThreadId 7] - ---> {"jsonrpc":"2.0","id":5,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs"},"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":15}},"context":{"diagnostics":[{"range":{"start":{"line":3,"character":8},"end":{"line":3,"character":15}},"message":"Redundant bracket\nFound:\n (x + 1)\nWhy not:\n x + 1\n","severity":4,"source":"hlint"}]}}}
2017-06-10 22:48:36 [ThreadId 10] - reactor:got CodeActionRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 5, _method = TextDocumentCodeAction, _params = CodeActionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs"}}, _range = Range {_start = Position {_line = 3, _character = 8}, _end = Position {_line = 3, _character = 15}}, _context = CodeActionContext {_diagnostics = List [Diagnostic {_range = Range {_start = Position {_line = 3, _character = 8}, _end = Position {_line = 3, _character = 15}}, _severity = Just DsHint, _code = Nothing, _source = Just "hlint", _message = "Redundant bracket\nFound:\n (x + 1)\nWhy not:\n x + 1\n"}]}}}
2017-06-10 22:48:36 [ThreadId 9] - <--2--{"result":[{"arguments":[{"file":{"textDocument":{"uri":"file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs"}}},{"start_pos":{"position":{"line":3,"character":8}}}],"title":"Apply hint:Redundant bracket","command":"applyrefact:applyOne"}],"jsonrpc":"2.0","id":5}
2017-06-10 22:48:36 [ThreadId 11] - ExecuteCommand response got:r=fromList [("diff",Object (fromList [("changes",Object (fromList [("file:///home/zubin/haskell-ide-engine/test/testdata/ApplyRefact.hs",Array [Object (fromList [("range",Object (fromList [("start",Object (fromList [("line",Number 3.0),("character",Number 0.0)])),("end",Object (fromList [("line",Number 3.0),("character",Number 15.0)]))])),("newText",String "foo x = x + 1")])])]))]))]
2017-06-10 22:48:36 [ThreadId 11] - ExecuteCommand got workspace edit: WorkspaceEdit {_changes = Nothing, _documentChanges = Nothing}
2017-06-10 22:48:36 [ThreadId 11] - ExecuteCommand sending edit: RequestMessage {_jsonrpc = "2.0", _id = IdInt 1, _method = WorkspaceApplyEdit, _params = ApplyWorkspaceEditParams {_edit = WorkspaceEdit {_changes = Nothing, _documentChanges = Nothing}}}
2017-06-10 22:48:36 [ThreadId 9] - <--2--{"result":{},"jsonrpc":"2.0","id":4}
2017-06-10 22:48:36 [ThreadId 9] - <--2--{"jsonrpc":"2.0","id":1,"method":"workspace/applyEdit","params":{"edit":{}}}
2017-06-10 22:48:36 [ThreadId 7] - ---> {"jsonrpc":"2.0","id":1,"result":{"applied":true}}
2017-06-10 22:48:36 [ThreadId 7] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"applied\":true}}"
2017-06-10 22:48:36 [ThreadId 7] - ******** got ResponseMessage, ignoring:ResponseMessage {_jsonrpc = "2.0", _id = IdRspInt 1, _result = Just (Object (fromList [("applied",Bool True)])), _error = Nothing}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment