Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ updates:
- "@typescript-eslint/*"
- "typescript*"
- "eslint*"
- "jest*"
- "ts-jest"
- "vitest*"
- "@vitest/*"
- "esbuild"
- "rimraf"
- "@vscode/*"
Expand Down
59 changes: 30 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,39 @@ on:
type: string

jobs:
crlf-tests:
name: CRLF Tests
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
timeout-minutes: 10
strategy:
matrix:
node-version: [lts/*]
env:
CI: true
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci
- name: Test CRLF
run: npm run test:crlf --if-present

ci:
# CI runs on all pushes (branches and tags) and pull requests
# This ensures releases only happen if all tests pass
name: CI Build & Test
runs-on: ubuntu-latest
needs: crlf-tests
permissions:
contents: read
timeout-minutes: 10
Expand Down Expand Up @@ -60,34 +89,6 @@ jobs:
DISPLAY: ':99'
run: npm run test:e2e

crlf-tests:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
timeout-minutes: 10
strategy:
matrix:
node-version: [lts/*]
env:
CI: true
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci
- name: Test CRLF
run: npm run test:crlf --if-present

# npm audit runs in .github/workflows/npm-audit.yml (dedicated workflow + README badge).

# The "cd-vsce" job runs only when a tag starting with "v" is pushed (i.e., a version tag), because of the conditional below:
cd-vsce:
# Only runs when the push references a tag that starts with "v" (for example: refs/tags/v1.2.3) or on workflow_dispatch
Expand Down Expand Up @@ -247,7 +248,7 @@ jobs:
echo "notes=Changelog file not found" >> $GITHUB_OUTPUT
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
files: dist/extension.vsix
tag_name: ${{ steps.tag_version.outputs.TAG }}
Expand Down
9 changes: 5 additions & 4 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
.vscode-test/**
src/**
.gitignore
.eslintrc.json
.npmignore
tsconfig.json
tsconfig.build.json
jest.config.js
jest.setup.js
tsconfig.vitest.json
vitest.config.ts
*.map
**/*.map
dist/**/*.map
Expand All @@ -28,10 +27,12 @@ specs/**
.specify/**

# Demo assets (only needed for GitHub README, not in extension)
assets/autoplay-demo.gif
assets/demo.gif
assets/example-video.gif
assets/example-ui.png
assets/example-ui-selected-line.png
assets/icon.png~

# Build artifacts
branding/**
Expand Down Expand Up @@ -72,4 +73,4 @@ cliff.toml
.eslintignore
.vscode-test-cursor.mjs
.vscode-test.mjs
tsconfig.e2e.json
tsconfig.e2e.json
20 changes: 15 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Before making changes:
- TypeScript (strict mode)
- VS Code Extension API
- [remark](https://github.com/remarkjs/remark) for markdown parsing
- Jest for testing
- Vitest for testing
- esbuild for bundling

## Project Structure
Expand All @@ -34,28 +34,38 @@ Before making changes:
**Core Files:**
- `extension.ts` - Extension entry point, activation, command registration
- `config.ts` - Centralized configuration access (VS Code settings)
- `parser.ts` - Main markdown parser, converts AST to decoration ranges
- `parser.ts` - Stable parser facade exporting parser API and shared parser types
- `parser/core.ts` - Main markdown parser implementation, converts AST to decoration ranges
- `parser/types.ts` - Shared parser result and decoration type definitions
- `parser-remark.ts` - Remark parser setup and utilities
- `decorations.ts` - Decoration type factories (transparent, faint, etc.)
- `decorator.ts` - Decoration orchestration, applies decorations to editors
- `decorator.ts` - Decoration orchestration facade, coordinates parsing and application

**Specialized Modules:**
- `diff-context.ts` - Detects diff views and applies policies
- `link-targets.ts` - Resolves link/image URLs (relative, absolute, workspace)
- `link-interactions/shared.ts` - Shared link target/range resolution used by provider, hover, and click flows
- `markdown-parse-cache.ts` - Caching layer for parsed markdown (performance critical)
- `position-mapping.ts` - Handles CRLF/LF normalization for position calculations
- `language-support.ts` - Shared list of supported markdown-like language IDs and document selectors

**Feature Modules:**
- `link-provider.ts` - Makes links clickable (DocumentLinkProvider)
- `link-hover-provider.ts` - Shows link URLs on hover
- `image-hover-provider.ts` - Shows image previews on hover
- `link-click-handler.ts` - Handles single-click navigation
- `commands/` - User-facing command registrations and implementations
- `registration/` - Provider and event-wiring helpers used by `extension.ts`

**Decoration System:**
- `decorator/decoration-type-registry.ts` - Manages decoration type lifecycle
- `decorator/visibility-model.ts` - 3-state filtering (Rendered/Ghost/Raw)
- `decorator/checkbox-toggle.ts` - Handles checkbox clicks
- `decorator/decoration-categories.ts` - Categorizes decoration types
- `decorator/file-decoration-state.ts` - Persists and migrates per-file enable/disable state
- `decorator/update-scheduler.ts` - Debounced and idle update scheduling
- `decorator/editor-decoration-applier.ts` - Range creation, scope entry building, and decoration application helpers
- `decorator/mermaid-update-coordinator.ts` - Async Mermaid rendering and decoration coordination

**Test Directories:**
- Each module has a corresponding `__tests__/` directory
Expand All @@ -79,7 +89,7 @@ npm run clean # Remove build artifacts
npm run package # Package extension as .vsix
```

**Testing:**
**Testing (Vitest):**
```bash
npm test # Run all tests
npm run test:watch # Run tests in watch mode
Expand Down Expand Up @@ -142,7 +152,7 @@ npm run release # Automated release (see Release section)
- Mock VS Code API when needed (see existing tests for patterns)

**Current Test Coverage:**
- 438+ passing tests across 33 test suites (parser, hover providers, click handler, decorator, and more)
- 770+ passing tests across 60+ test files (parser, hover providers, click handler, decorator, and more)
- Maintain or improve this coverage

### 4. Code Style
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extractDecorations(text: string): DecorationRange[] {

### 4. Testing

**All changes must include tests.** The project uses Jest for testing with **438+ passing tests** across 33 test suites.
**All changes must include tests.** The project uses Vitest for testing with **770+ passing tests** across 60+ test files.

**Run tests:**
```bash
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Press `F5` to launch the Extension Development Host and test your changes.
- **[remark](https://github.com/remarkjs/remark)** – Markdown parser for precise AST-based parsing
- **[unified](https://github.com/unifiedjs/unified)** – AST processing framework
- **[remark-gfm](https://github.com/remarkjs/remark-gfm)** – GitHub Flavored Markdown support
- **Jest** – Testing framework
- **Vitest** – Testing framework

**Runtime Requirements:**
- **Node.js** 20 or higher
Expand All @@ -209,7 +209,7 @@ Press `F5` to launch the Extension Development Host and test your changes.
- `remark-gfm`, `remark-parse`, `unified`, `unist-util-visit`

**Development Dependencies:**
- TypeScript, Jest, ESLint, VS Code extension tools
- TypeScript, Vitest, ESLint, VS Code extension tools

### Architecture

Expand Down
Binary file removed assets/icon.png~
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{a as e,b as r}from"./chunk-RERM46MO.mjs";import"./chunk-4R4BOZG6.mjs";import"./chunk-AQ6EADP3.mjs";export{e as ArchitectureModule,r as createArchitectureServices};

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading