-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid error after editing Dockerfile caused by incorrect handling of changes from textDocument/didChange #216
Comments
Interesting. Thank you for the bug report, @chrisdias. I might not be able to look at it for a while pending hotel wifi... |
looks like this is in 0.0.13 as well. |
I couldn't reproduce this with the current version of the online editor. I guess that makes sense. It must be something to do with VS Code instead of Monaco. |
I was able to reproduce this problem. Interestingly enough, I received two events when I initiated the undo with the second being an empty array... {
"textDocument": {
"uri": "file:///blah/blah/Dockerfile",
"version": 9
},
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 7
},
"end": {
"line": 1,
"character": 7
}
},
"rangeLength": 0,
"text": "/"
},
{
"range": {
"start": {
"line": 1,
"character": 8
},
"end": {
"line": 1,
"character": 8
}
},
"rangeLength": 0,
"text": "t"
},
{
"range": {
"start": {
"line": 1,
"character": 9
},
"end": {
"line": 1,
"character": 9
}
},
"rangeLength": 0,
"text": "m"
},
{
"range": {
"start": {
"line": 1,
"character": 10
},
"end": {
"line": 1,
"character": 10
}
},
"rangeLength": 0,
"text": "p"
}
]
}
|
This is caused by the fix for #58. It seems like we'll need to figure out how to merge and sort the received |
Actually, I think I've just been misinterpreting the specification this whole time. I've always applied the changes in reverse order but I don't remember why. However, given that the specification states: /**
* The actual content changes. The content changes describe single state changes
* to the document. So if there are two content changes c1 and c2 for a document
* in state S10 then c1 move the document to S11 and c2 to S12.
*/
contentChanges: TextDocumentContentChangeEvent[]; It does sound like the changes should just be applied in the order it appears in the notification. |
Remove a function that is no longer used now that we are no longer trying to sort the changes received from textDocument/didChange. Signed-off-by: Remy Suen <[email protected]>
@chrisdias Thanks again for the bug report! I've fixed the bug now and it will be included in the next release! |
I'm testing the Docker extension for release, with
0.0.14
of the server.Create this dockerfile:
Put the cursor at the end of the line
VOLUME /tmp
and press backspace to delete/tmp
Press CMD+Z to undo your change so the line says
VOLUME /tmp
again.Result: Red squiggles. Hover over ARG and see
Invalid error [dockerfile-utils] Unknown instruction: /tmpARG
The text was updated successfully, but these errors were encountered: