This makes scroll sync faster by using a broadcast channel instead of the normal vscode webview api. This means the two webviews can communicate with each other directly instead of having to go through the extension host and renderer each time
Two regressions from the merge of #287050:
1. preview.ts: The merge retained `this.#isScrolling = false` inside
the early-return guard of `scrollTo()`, which was intentionally
removed in the original PR. This resets the timer-based flag on
the very first forward-sync call, allowing subsequent editor scroll
events to re-trigger forward sync while reverse sync is in
progress, causing the editor to jump back up.
2. index.ts: The PR converted `onUpdateView` from a decrement-counter
to a timer-based approach but left initialization and resize
handlers still using `scrollDisabledCount += 1` without a
corresponding timer reset. The old scroll handler decremented the
counter naturally; the new handler only returns early. As a result,
after page load `scrollDisabledCount` stays at 1 indefinitely,
blocking all preview-to-editor sync until the user scrolls the
editor once.
Fixes:
- Remove the erroneous `this.#isScrolling = false` from scrollTo()
- Apply the same timer-reset pattern (200ms) to initialization and
resize handlers so scrollDisabledCount is always auto-cleared
Fixes#307762
Fixes#278930
This commit fixes the scroll synchronization issues between the markdown
editor and preview when scrolling through code blocks:
1. **Code block line tracking**: Added endLine calculation for fenced
code blocks by counting newlines, enabling accurate line-to-position
mapping within multi-line code blocks.
2. **Padding-aware scrolling**: Implemented getContentBounds() to
calculate scroll positions excluding padding, preventing jumps when
scrolling through code blocks with padding.
3. **Scroll loop prevention**: Changed scroll disable flags from counters
to timer-based booleans (50ms) to prevent infinite sync loops while
maintaining smooth bidirectional synchronization.
The fix ensures smooth scrolling through code blocks without jumping or
stuttering in both directions (editor ↔ preview).
For #271167
This makes it so our built-in extensions can mostly be built using `tsc` on the command line. Previously the extensions were picking up a lot of typing info from the root `node_modules` that meant they weren't truly independent
For #269213
This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks
Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
Fixes#243454
This restores the previous behavior. If the default security settings are used, scripts will still block blocked by the CSP. If you fully disable the security settings, then we'll try to run them