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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ ccoretrace-sarif-tscancode.json
.DS_Store
Thumbs.db

# test
# test.vscode-test/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ No need to wait for a full re-scan. CoreTrace caches file hashes across the enti
4. Click **Run Analysis** to execute `ctrace`. All findings will appear instantly in the panel and directly in your code editor as error/warning highlights.

## ⚙️ Requirements
- The extension automatically uses the `ctrace` / `coretrace` CLI binaries bundled alongside the extension installation. You do not need to install them manually in your PATH.
- The extension automatically downloads and installs the latest `ctrace` / `coretrace` CLI binaries from GitHub Releases during its first activation. You do not need to install them manually in your PATH. It will also periodically check for and download binary updates automatically in the background.
- *Recommended:* For accurate analysis in complex codebases, it is advised to generate a `compile_commands.json` (e.g. via `cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON`) in your workspace root or `build` directory.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 35 additions & 2 deletions media/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
// ── Scope selector ─────────────────────────────────────────────────────────
let workspaceMode = false;
let isRunning = false;
let isDownloading = false;

function applyScope(ws) {
if (isRunning) { return; }
if (isRunning || isDownloading) { return; }
workspaceMode = !!ws;
if (scopeFile) { scopeFile.classList.toggle('active', !workspaceMode); }
if (scopeWs) { scopeWs.classList.toggle('active', workspaceMode); }
if (filePill) { filePill.classList.toggle('hidden', workspaceMode); }
if (wsPill) { wsPill.classList.toggle('hidden', !workspaceMode); }
if (wsProgress) { wsProgress.classList.add('hidden'); }
if (runLabel) { runLabel.textContent = 'Run Analysis'; }
if (runLabel && !isDownloading && !isRunning) { runLabel.textContent = 'Run Analysis'; }
}

if (scopeFile) { scopeFile.addEventListener('click', () => applyScope(false)); }
Expand Down Expand Up @@ -86,6 +87,15 @@
window.addEventListener('message', event => {
const msg = event.data;
switch (msg.type) {
case 'analysis-downloading':
setDownloading(msg.progress);
break;
case 'analysis-download-complete':
setDownloadComplete();
break;
case 'analysis-start':
setRunning(true);
break;
case 'analysis-result':
handleAnalysisResult(msg.data);
break;
Expand All @@ -107,8 +117,31 @@
});

// ── Handlers ───────────────────────────────────────────────────────────────
function setDownloading(progressMsg) {
isDownloading = true;
if (!runBtn) { return; }
runBtn.disabled = true;
runBtn.classList.add('running'); // Force spinner instead of play icon
if (runLabel) { runLabel.textContent = `Downloading (${progressMsg})`; }

if (scopeFile) scopeFile.style.opacity = '0.5';
if (scopeFile) scopeFile.style.cursor = 'not-allowed';
if (scopeWs) scopeWs.style.opacity = '0.5';
if (scopeWs) scopeWs.style.cursor = 'not-allowed';
}

function setDownloadComplete() {
isDownloading = false;
if (!isRunning) {
setRunning(false);
}
}

function setRunning(running) {
isRunning = running;
if (running) {
isDownloading = false;
}
if (!runBtn) { return; }
runBtn.disabled = running;
runBtn.classList.toggle('running', running);
Expand Down
Loading
Loading