CH4ACKO3/dsh-render-engine--packages-code-frame-render0

@ch4acko3/dsh-code-frame-render

Syntax-highlighted diagnostic code frame rendering service for DeepSeek Harness Web plugins

包名
@ch4acko3/dsh-code-frame-render
版本
0.1.1
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CH4ACKO3/dsh-render-engine#8401d60319cc256b73167e14460c12cec647db4f&path:packages/code-frame-render

@ch4acko3/dsh-code-frame-render

A browser-side Cordis service that renders syntax-highlighted source context with diagnostic ranges and messages. It performs no file IO and does not depend on an LSP implementation.

Positions are zero-based UTF-16 code-unit offsets, matching the LSP position model. Diagnostics from compilers, linters, tests, agents, or language servers can therefore be adapted into the same request shape.

const result = ctx.codeFrameRenderer.render({
  code: 'const value = missing\n',
  language: 'ts',
  fileName: 'app.ts',
  diagnostics: [{
    range: {
      start: { line: 0, character: 14 },
      end: { line: 0, character: 21 },
    },
    message: 'Cannot find name "missing"',
    severity: 'error',
  }],
})

console.log(result.html)