Skip to content

Add draft for unified highlighting api that can be used via database …#57

Open
suung wants to merge 5 commits into
mainfrom
51_code_highlighting
Open

Add draft for unified highlighting api that can be used via database …#57
suung wants to merge 5 commits into
mainfrom
51_code_highlighting

Conversation

@suung
Copy link
Copy Markdown
Collaborator

@suung suung commented Sep 30, 2025

  • Add highlighting of code from database
  • Add optionally highlighting in realtime without going to database
  • Use tool registry
  • Add tests

@suung suung added the WIP label Sep 30, 2025
@suung suung mentioned this pull request Oct 16, 2025
@suung suung force-pushed the 51_code_highlighting branch from ebeeee8 to 99ba264 Compare October 16, 2025 19:54
@suung suung removed the WIP label Oct 16, 2025
@suung suung requested a review from pessi-v October 16, 2025 20:41
@pessi-v
Copy link
Copy Markdown
Collaborator

pessi-v commented Oct 20, 2025

@suung I would not merge this before the demo, since there is no other linter that we're going to add

@suung
Copy link
Copy Markdown
Collaborator Author

suung commented Oct 20, 2025

@suung I would not merge this before the demo, since there is no other linter that we're going to add

@pessi-v I would like to merge it because

a) we won't have capacity after the demo
b) it integrates with the database

The question for me is: What would need to be done to merge it? Do you see specific blockers?

}

// Store to database if enabled
if (this.storeToDatabase) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

new vscode.Position(Math.max(0, highlight.end_line - 1), Math.max(0, highlight.end_column - 1))
);

const diagnostic = new vscode.Diagnostic(range, highlight.message, this.mapSeverityToVSCode(highlight.severity));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

}


private extractHighlightsFromAssessmentData(assessmentData: AssessmentData[]): CodeHighlight[] {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

return contents;
}

private mapSeverity(severity: string): "error" | "warning" | "info" | "hint" {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

}
});

test.describe('Code Highlighting System', () => {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

}, async (progress, token) => {
return new Promise<void>((resolve) => {
// Run Semgrep directly
const child = spawn('semgrep', ['--config', 'auto', '--json', filePath], { stdio: 'pipe' });
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pessi-v thinking again over it, all of this shouldn't be here, we have solved this already and it makes problems in the e2e tests...

@suung
Copy link
Copy Markdown
Collaborator Author

suung commented Oct 30, 2025

@pessi-v @grrrau I would close this PR when #93 is merged, unless we discuss something else

@suung suung linked an issue Nov 10, 2025 that may be closed by this pull request
6 tasks
@suung suung mentioned this pull request Nov 10, 2025
6 tasks
@suung
Copy link
Copy Markdown
Collaborator Author

suung commented Dec 9, 2025

@grrrau this should be now implemented in a different order on top of main in #167

we can discuss if there is anything that is still in this branch we don't have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unified code highlighting api

2 participants