editor icon indicating copy to clipboard operation
editor copied to clipboard

Incorrect handling of quotes in function files

Open Joelant05 opened this issue 3 years ago • 3 comments

When typing a value after an argument that is surrounded with quotes, the command doesn't seem to be tokenised correctly and the argument after has the incorrect range in the file; in the images below mainhand should be inserted with a space between it and the last argument but this isn't what happens.

image

After pressing tab to auto-complete:

image

Joelant05 avatar Sep 11 '22 10:09 Joelant05

I can't seem to reproduce this error. I do see the strange warning offset and I'll see what I can do to fix that. I also see that when you hit tab for autocompletes it removes the space for some reason but that should be caused by the validator so I wouldn't know how to fix that.

outercloudstudio avatar Sep 11 '22 18:09 outercloudstudio

Also, I believe the strange error/warning offset is also from the tokenizer not the validator so I'm not sure how to fix that.

outercloudstudio avatar Sep 11 '22 18:09 outercloudstudio

Ok, It'll be something to fix here then https://github.com/bridge-core/common-utils/blob/main/src/command/tokenize.ts

When fixing this we'll need to be careful that we don't break embedded command auto-completions in json, since I think the problem comes from how we handle quotes for this case.

Joelant05 avatar Sep 11 '22 20:09 Joelant05