Skip to content
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

Fast typing causes semantic highlights to flicker #89552

Closed
JacksonKearl opened this issue Jan 28, 2020 · 2 comments
Closed

Fast typing causes semantic highlights to flicker #89552

JacksonKearl opened this issue Jan 28, 2020 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority semantic-tokens Semantic tokens issues verified Verification succeeded
Milestone

Comments

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jan 28, 2020

Testing #89351.

Open, for instance, https://github.com/microsoft/vscode/blob/2ce17a576c278df08d07213c8cd5b42c605cc8c3/src/vs/workbench/contrib/search/browser/searchEditorInput.ts

Start a string below the import block. Type in that string. As you type faster, the import block will start flickering between semantic highlighting and textmate highlighting. This is distracting

(I use a string to show its not an issue of the document being semantically invalid)

@aeschli aeschli assigned alexdima and unassigned aeschli Jan 29, 2020
@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority labels Jan 29, 2020
@alexdima
Copy link
Member

This is because the TS semantic tokens provider receives (offset,len) from TS and then, if the document changed in the meantime, cannot convert them to (pos,col) and then returns null.

On the API impl side, seeing null is equivalent to throwing away all the tokens.

@alexdima alexdima added the semantic-tokens Semantic tokens issues label Jan 29, 2020
@alexdima alexdima added this to the January 2020 milestone Jan 29, 2020
@alexdima
Copy link
Member

This reproduces the best in vscode because a large project is needed to get tsserver to be slower... Also useful:

"editor.tokenColorCustomizationsExperimental": {
	"type": {"fontStyle": "bold italic" },
},

Kapture 2020-01-29 at 16 11 38

@rebornix rebornix added the verified Verification succeeded label Jan 31, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority semantic-tokens Semantic tokens issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants