最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - Visual Studio Diagnostic API Extension works while debugging but when I Install the VSIX it is not working - Stack

programmeradmin1浏览0评论

I used diagnostic Api for finding compilation errors. It works well in debug mode but after creating .VSIX it is not working.

Can Any one help me ?

const diagnostics = vscode.languages.getDiagnostics();

const filteredDiagnostics = diagnostics
    .filter(([uri, diagnosticList]) => modifiedFilesTobeChecked.includes(uri.fsPath) && Array.isArray(diagnosticList))//checks only the modified files
    .reduce((acc, [uri, diagnosticList]) => {
        const errors = diagnosticList.filter(d => d.severity === vscode.DiagnosticSeverity.Error);
        errorCount = errors?.length + errorCount;
        if (errors.length > 0) {
            errorFiles.push(uri.fsPath); // Store files that have errors
        }
        if (errors.length) {
            if (!acc[uri.fsPath]) {
                acc[uri.fsPath] = []; // Initialize array if not present
            }
            acc[uri.fsPath].push(...errors.map(d => ({
                message: d.message,
                line: d.range.start.line + 1
            })));
        }
        return acc;

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论