You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix unpredictable markdown link text when copying permalink from gutter (#8252)
* Initial plan
* Initial analysis of permalink markdown text issue
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
* Fix unpredictable markdown link text when copying permalink from gutter
- Add range field to PermalinkInfo to track the range used for the permalink
- Update getMarkdownLinkText to accept and use the permalink range
- When copying markdown permalink, extract text from the correct line/range
- Fixes issue where right-clicking gutter would use previous selection text
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
* Add comment explaining NotebookRange exclusion in getMarkdownLinkText
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
* Full line length
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
@@ -311,12 +312,12 @@ export async function createSinglePermalink(
311
312
): Promise<PermalinkInfo>{
312
313
const{ uri, range }=getFileAndPosition(context,positionInfo);
313
314
if(!uri){
314
-
return{permalink: undefined,error: vscode.l10n.t('No active text editor position to create permalink from.'),originalFile: undefined};
315
+
return{permalink: undefined,error: vscode.l10n.t('No active text editor position to create permalink from.'),originalFile: undefined,range: undefined};
315
316
}
316
317
317
318
constrepository=getRepositoryForFile(gitAPI,uri);
318
319
if(!repository){
319
-
return{permalink: undefined,error: vscode.l10n.t('The current file isn\'t part of repository.'),originalFile: uri};
320
+
return{permalink: undefined,error: vscode.l10n.t('The current file isn\'t part of repository.'),originalFile: uri, range};
320
321
}
321
322
322
323
letcommitHash: string|undefined;
@@ -328,7 +329,7 @@ export async function createSinglePermalink(
@@ -431,11 +433,11 @@ export async function createSingleGitHubLink(
431
433
): Promise<PermalinkInfo>{
432
434
const{ uri, range }=getFileAndPosition(context);
433
435
if(!uri){
434
-
return{permalink: undefined,error: vscode.l10n.t('No active text editor position to create permalink from.'),originalFile: undefined};
436
+
return{permalink: undefined,error: vscode.l10n.t('No active text editor position to create permalink from.'),originalFile: undefined,range: undefined};
0 commit comments