Feature/vscode extension issues: #27 #28#69
Open
taranais wants to merge 6 commits intoakonan:mainfrom
Open
Conversation
… and documentation - Removed unnecessary files from the "files" array in package.json. - Modified the "package" script to exclude dependencies during packaging. - Updated the "wiremd" dependency path in package.json for better resolution. - Added JSDoc comments to the activate, deactivate, and extendMarkdownIt functions in extension.ts for better code documentation.
- Added WiremdPreviewProvider class to handle webview creation and content rendering for markdown files. - Integrated document change, active editor change, and configuration change listeners for dynamic updates. - Implemented methods for opening the preview, refreshing content, changing styles and viewports, and handling messages from the webview. - Created HTML structure for the preview, including error handling and loading states. - Added tests for extension coverage and preview provider functionality, ensuring command execution and configuration handling.
Add targeted tests to improve branch/path coverage in the LSP layer: - add lsp-server wiring/integration tests - expand lsp-engine tests for completion, hover, signature, diagnostics, and parse-error mapping branches Validation: - 64/64 tests passing Coverage (npm run coverage): - All files: 93.19% statements, 91.37% branches, 98% functions - src/lsp: 94.31% statements, 89.26% branches, 100% functions - src/lsp/engine.ts: 92.61% statements, 87.71% branches, 100% functions - src/lsp/server.ts: 100% statements, 100% branches, 100% functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
This PR migrates the VS Code extension from a custom WebView preview to native Markdown preview integration (
markdown.markdownItPlugins+extendMarkdownIt).All
wiremdfenced blocks are now parsed/rendered inside the standard Markdown preview, with per-block support forhtml/jsonoutput and styles (sketch,clean,wireframe,none,tailwind,material,brutal), including CSS scoping to prevent style leakage across blocks.Type of Change
Related Issues
Changes Made
WiremdPreviewProviderand custom preview commands with a Markdown-It plugin (extendMarkdownIt) insrc/extension.ts.wiremdfences in the same document, with per-fence options (html/json+ style).classPrefixand scoped CSS rewrites to avoid global pollution (body,*, etc.).package.json: newactivationEvents,contributes.markdown.markdownItPlugins,esbuild-based scripts, andvitest.tests/extension.test.ts,tests/security-config.test.ts) and updated extension docs.Testing
Test Coverage
npm test)Manual Testing
cd vscode-extension && npm run lintnpm run compilenpm test(13 tests passed)npm run package(successfully generatedwiremd-preview-0.1.0.vsix)Examples
Input
Output
Checklist
Breaking Changes
wiremd.openPreview,wiremd.openPreviewToSide,wiremd.refreshPreview,wiremd.changeStyle,wiremd.changeViewport.wiremd.*settings (defaultStyle,autoRefresh,refreshDelay,showErrorOverlay) and custom WebView preview model.Migration Guide
Open preview using native VS Code commands:
Use
wiremdfenced blocks directly in Markdown:Use per-fence options (order-independent):
wiremd cleanwiremd html materialwiremd jsonRemove old
wiremd.*settings from workspace/user settings; they are no longer used.Screenshots/Recordings
N/A
Performance Impact
Rendering now runs through native Markdown-It pipeline. Operational complexity is reduced by removing the custom WebView, but this branch does not include formal performance benchmarks.
Documentation
Additional Notes
package-lock.jsonhas major changes due to new tooling/dependencies (esbuild,vitest).LICENSE.txtundervscode-extension/and updated packaging ignore rules for.vsix.Reviewer Checklist