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).
Fixes#155552
For lists, the outer ul/ol always has the same source line as the first element in the list. We should prefer using the first element in the list when highlighting the active line
This also fixes a bug where scroll sync would stop working if you added lines to the doc. This was caused by `lineCount` getting out of sync as the document is being updated. I've removed this state and made the reveal logic more robust instead
* Use MD LS for resolving all document links
This switches the markdown extension to use the markdown language service when resolving the link. This lets us delete a lot of code that was duplicated between the extension and the LS
* Pick up new ls version
* Markdown path completions tests use mocked out fs
This updates the path completion tests to stop depending on the actual fs and instead use `IMdWorkspace`
* Update remaining tests
Renames in the markdown extension
This renames some types and splits up some files as part of an exploration towards a proper LSP. Changes:
- `SkinnyTextDocument` -> `ITextDocument`
- Moved `ITextDocument` to own file
- `MdWorkspaceContents` -> `IMdWorkspace`
This change reduces the number of times we retokenize a markdown file by doing the following:
- Use `MdTableOfContentsProvider` in more places
- Introduce a `IMarkdownParser` interface that lets us drop in a caching version of the tokenizer
When reloading windows that need to restore a markdown preview, sometimes I'll see an error when the markdown preview tries accessing a disposed of webview. This seems to be cause caused by `provideTextDocumentContent`, where we end up disposing of the webview before an `await` resumes execution