Skip to content

Making TM_SELECTED_TEXT snippet variable working with overtyped text v2#105440

Merged
jrieken merged 7 commits intomicrosoft:masterfrom
n-gist:feature-snippets-overtyping
Aug 28, 2020
Merged

Making TM_SELECTED_TEXT snippet variable working with overtyped text v2#105440
jrieken merged 7 commits intomicrosoft:masterfrom
n-gist:feature-snippets-overtyping

Conversation

@n-gist
Copy link
Contributor

@n-gist n-gist commented Aug 26, 2020

Continuation of #105220
Fixes #62907

overtyping_showcase

@n-gist n-gist marked this pull request as ready for review August 26, 2020 16:31
@n-gist
Copy link
Contributor Author

n-gist commented Aug 26, 2020

suggestController.ts is entry point of changes

I did not implemented fixed storage for small overtypes since calling ITextModel.getValueInRange() is producing garbage anyway. So, simply storing. Restricted by 1000000 bytes as was suggested.
Made the retrieval of stored text deferred until needed in the SelectionBasedVariableResolver.

off topic
I noticed that SuggestWidget.onDidHide gets called constantly when typing, even when SuggestWidget.onDidShow has not been called before and the widget is not active. Perhaps this should be removed for performance.

@jrieken jrieken self-requested a review August 27, 2020 08:41
@jrieken jrieken added this to the August 2020 milestone Aug 27, 2020
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good already. A few nits and something about the widget vs model as resume/pause driver.

@n-gist n-gist requested a review from jrieken August 28, 2020 08:33
@jrieken jrieken merged commit 6509b55 into microsoft:master Aug 28, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve Current Selection when using snippet with TM_SELECTED_TEXT variable

2 participants