copilotAgentSession.ts ×3

Frontier kind: Joint frontier

unlabeled · c_139df8b0c364

3 tests · 43858 LOC · 243 files · introduces 1 test · 16 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges16 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4065 ranges43858 lines · 243 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts 16 introduced LOC · 3 ranges

Open complete file

1713 try {
1714 const text = await this._readSelectedText(uri, attachment.selection.range);
1715 > return { type: 'selection' as const, filePath: path, displayName, text, selection: attachment.selection.range }; copilotAgentSession.ts
1716 } catch (err) {
1717 this._logService.warn(`[Copilot:${this.sessionId}] Failed to read selected text for ${uri.toString()}: ${err}`);
1728 private async _readSelectedText(uri: URI, range: { readonly start: { readonly line: number; readonly character: number }; readonly end: { readonly line: number; readonly character: number } }): Promise<string> {
1729 const content = await this._fileService.readFile(uri);
1730 > const text = content.value.toString(); copilotAgentSession.ts
1731 > // AHP carries the resource range; the public SDK can carry the selected text too.
1732 > // This reads the resource URI, so unsaved editor changes are not included.
1733 > const lines = splitLinesIncludeSeparators(text);
1734 > const start = this._getOffsetAt(lines, range.start);
1735 > const end = this._getOffsetAt(lines, range.end);
1736 > return text.substring(start, Math.max(start, end));
1737 }
1738
1739 private _getOffsetAt(lines: readonly string[], position: { readonly line: number; readonly character: number }): number {
1740 > const line = Math.max(0, Math.min(position.line, lines.length - 1)); copilotAgentSession.ts
1741 > let offset = 0;
1742 > for (let i = 0; i < line; i++) {
1743 > offset += lines[i].length;
1744 > }
1745 > const lineText = lines[line].replace(/\r\n|\r|\n$/, '');
1746 > return offset + Math.max(0, Math.min(position.character, lineText.length));
1747 > }
1748
1749 /**