-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
olsp sometimes formats code into illegal state, e.g., given file
let foo ~i ~j = i + j
let bar = 10
let y = foo ~i:5
let lst = []
let map = List.m
let map = List.m []
let map = List.m
olsp formats it to
let foo ~i ~j = i + j
let bar = 10
let y = foo ~i:5
let lst = []
let map = List.mlet map = List.m []
let map = List.m
trace (notice how ofmt says it's disabled but still formats code)
[Trace - 10:35:22 PM] Sending request 'textDocument/formatting - (374)'.
Params: {
"textDocument": {
"uri": "file:///Users/ulugbek/code/merlin/tests/test-dirs/completion/application_context.t/application_context.ml"
},
"options": {
"tabSize": 2,
"insertSpaces": true
}
}
File tests/test-dirs/completion/application_context.t/application_context.ml
Warning: Ocamlformat disabled because [--enable-outside-detected-project] is not set and no [.ocamlformat] was found within the project (root: ../merlin)
[Trace - 10:35:22 PM] Received response 'textDocument/formatting - (374)' in 3ms.
Result: [
{
"newText": "",
"range": {
"end": {
"character": 0,
"line": 4
},
"start": {
"character": 0,
"line": 3
}
}
},
{
"newText": "",
"range": {
"end": {
"character": 0,
"line": 10
},
"start": {
"character": 0,
"line": 5
}
}
},
{
"newText": "let map = List.m []\nlet map = List.m\n",
"range": {
"end": {
"character": 0,
"line": 11
},
"start": {
"character": 0,
"line": 11
}
}
}
]
ofmt also sometimes gets stuck and can't get format; restarting olsp enables it to format again.
this must be some ofmt-rpc issue
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working