annotations.ts ×3

Frontier kind: Joint frontier

unlabeled · c_aeb7c450ec07

3 tests · 41638 LOC · 177 files · introduces 3 tests · 33 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges33 lines · 1 files
Tests
3 tests

Contains — complete concept membership

All code (extent)
3705 ranges41638 lines · 177 files · Browse complete extent
All tests (intent)
3 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

3 tests introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 33 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/widget/annotations.ts 33 introduced LOC · 3 ranges

Open complete file

78 }
79 } else if (item.kind === 'markdownVuln') {
80 > const vulnText = encodeURIComponent(JSON.stringify(item.vulnerabilities)); annotations.ts
81 > const markdownText = `<vscode_annotation details='${vulnText}'>${item.content.value}</vscode_annotation>`;
82 > if (previousItem?.kind === 'markdownContent') {
83 > // Since this is inside a codeblock, it needs to be merged into the previous markdown content.
84 > const merged = appendMarkdownString(previousItem.content, new MarkdownString(markdownText));
85 > result[previousItemIndex] = { ...previousItem, content: merged };
86 > } else {
87 result.push({ content: new MarkdownString(markdownText), kind: 'markdownContent' });
88 }
261
262 export function extractVulnerabilitiesFromText(text: string): { newText: string; vulnerabilities: IMarkdownVulnerability[] } {
263 > const vulnerabilities: IMarkdownVulnerability[] = []; annotations.ts
264 > let newText = text;
265 > let match: RegExpExecArray | null;
266 > while ((match = /<vscode_annotation details='(.*?)'>(.*?)<\/vscode_annotation>/ms.exec(newText)) !== null) {
267 > const [full, details, content] = match;
268 > const start = match.index;
269 > const textBefore = newText.substring(0, start);
270 > const linesBefore = textBefore.split('\n').length - 1;
271 > const linesInside = content.split('\n').length - 1;
272 >
273 > const previousNewlineIdx = textBefore.lastIndexOf('\n');
274 > const startColumn = start - (previousNewlineIdx + 1) + 1;
275 > const endPreviousNewlineIdx = (textBefore + content).lastIndexOf('\n');
276 > const endColumn = start + content.length - (endPreviousNewlineIdx + 1) + 1;
277 >
278 > try {
279 > const vulnDetails: IChatAgentVulnerabilityDetails[] = JSON.parse(decodeURIComponent(details));
280 > vulnDetails.forEach(({ title, description }) => vulnerabilities.push({
281 > title, description, range: { startLineNumber: linesBefore + 1, startColumn, endLineNumber: linesBefore + linesInside + 1, endColumn }
282 > }));
283 > } catch (err) {
284 // Something went wrong with encoding this text, just ignore it
285 }
286 > newText = newText.substring(0, start) + content + newText.substring(start + full.length); annotations.ts
287 > }
288 >
289 > return { newText, vulnerabilities };
290 > }