-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
After accepting suggestion with "overwriteOnAccept" one (next) char is removed #83400
Comments
I cannot reproduce... (tried with JS) |
never mind - I can reproduce... |
This is actually very similar to #66187. The issue is that the default replace/insert ranges are computed "after" the completion have be computed. If you are either typing fast or if completions are slow then the document contains one more character after completions have been computed. That breaks things. The fix is to compute the default ranges upfront. |
Thanks for explaining it and fixing. Good work! |
@jrieken Unfortunately issue still exists. |
Unfortunately I cannot use a gif as input. I also wonder what version of TypeScript (I assume) offers word base suggestions at that place? Is that an extension? |
I'm using JavaScript and TypeScript Nightly ( interface CheckoutOrderDetailsProps {
data: CartItem[];
currencyCode: CurrencyCode;
languageCode: LanguageEnum;
totalPrice: string;
children?: ReactNode;
} |
I stil don't see word based suggests there. Sure that there is no other extension involved? |
@jrieken I know how to reproduce it. interface Props {
totalPrice: string;
}
const totalPrice = `${totalPrice}` Try now to remove |
Not sure what that means. Can provide step by step what you are doing? |
interface Props {
totalPrice: string;
}
const totalPrice = `${totalPrice}`
interface Props {
: string;
}
const totalPrice = `${totalPrice}`
Try 3 and 4 step several times. GIF: |
idk what's going on here, I don't get word based suggestions because typescript always proposed Anyways, I do have a theory. This is the same problem just in a different place. Word based suggestions are computed on a web worker (not on the extension host process) and there we have the same problem: first suggestions, then defaults are computed and therefore words from a later state are used. |
Pushed another change. Next try tomorrow |
I'm using VS Code Insiders ( Thanks, I will try to test it tomorrow. |
That's just the first round: It's usually snippets, then extensions (TS in this case), then and only when the former didn't produce a result it's word-suggestions |
Feature that caused the issue got reverted. |
29ffbfe3f1c21b01a2d0670170855669dd2b3b4f
)Steps to Reproduce:
"editor.suggest.overwriteOnAccept": true
in settings.For e.g. write
document.()
and move cursor between.
and(
and try to auto-complete something for e.g.getAnimations
instead ofdocument.getAnimations()
you will getdocument.getAnimations)
Remember this happens often, but not every time, just try and I'm sure you will be able to reproduce the problem.
/cc @jrieken
The text was updated successfully, but these errors were encountered: