question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decorations flickering on editor change

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.61.2
  • OS Version: macOS Big Sur 11.6

I’ve recently been trying to optimize an extension that decorates [[...]] wikilinks in markdown documents. Every time I switched between editors a very noticeable flickering happened because of the syntax rehighlighting of the editor and, not so shortly after that, a delayed repainting of decorations. I checked other similar extensions and the pattern was always the same. It’s even suggested in this “official” example: https://github.com/microsoft/vscode-extension-samples/blob/main/decorator-sample/src/extension.ts. There are two problems:

  1. The suggested delay of 500ms might be reasonable for in-editor changes but for editor switching it produces this: https://github.com/foambubble/foam/issues/805#issuecomment-954604703.
  2. Even with no throttling at all and with precalculation and caching of document decorations (that I roughly implemented here https://github.com/svsool/vscode-memo/pull/479) there is the same repainting glitch, although it’s less obvious.

The second point is likely the hard one because it might be due to a more structural limit of the design. Why is VSCode triggering document-wise updates of decorations in unchanged documents? From the perspective of the extension author, is there any way to do that update incrementally, some knowledge of damaged/exposed chunks?

N.B. in the above cases extending the syntax was also problematic, for example because of the need to distinctively decorate valid and invalid links. Even if the syntax extension approach were effective here, the point still stands that decorations seem ill-suited for anything but small documents and even in those documents they produce visual artifacts on editor switching.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:30
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
memeplexcommented, Nov 4, 2021

Sure @alexdima I’m pretty busy right now but I’ll give it a try in a few days.

1reaction
memeplexcommented, Nov 3, 2021

One thing that may be changed in any case is the reference example: the problem is made worse because extension developers may be copying a recipe that delays redecoration by 500ms even on editor switch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Re: Shadow/Highlight flickering - Page 4 - 3118612
When I use the shadow/highlight effect, my image flickers. I'm using manual settings. Someone suggested changing black clip to 0%, but that did...
Read more >
CSS Transform causes flicker in Safari, but only when the ...
EDIT — Wesley Hales, said here "I encountered glitchy behaviour when ... Choose Drawing/Compositing flags > Show Compositing borders.
Read more >
What Causes Screen Flickering With LCDs? - Nelson Miller
Perhaps the most common cause of screen flickering in LCDs is a low refresh rate. All display devices have a refresh rate. It's...
Read more >
Flickering issue in Porwer App Edit forms
Hello Friends, We are facing issue in editing the powerApp forms. when user tries to type in the textbox controls, the form flickers...
Read more >
Twinkly Support — Polygroup
Edit the pre-set effects or create new effects from scratch. ... To make the most of your smart decoration, connect Twinkly to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found