Skip to content

Unable to open diagnostic link from problems panel with keyboard #89562

@RMacfarlane

Description

@RMacfarlane

Issue Type: Bug

Testing #89320

Create an extension that uses the new diagnostic link API:

export function activate(context: vscode.ExtensionContext) {
	const fooErrors = vscode.languages.createDiagnosticCollection('foo');
	let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
		fooErrors.clear();
	
		const activeDocUri = vscode.window.activeTextEditor!.document.uri;
	
		fooErrors.set(activeDocUri, [
			{
				range: new vscode.Range(0, 0, 0, 5),
				message: 'You should always use semicolon;',
				source: 'eslint',
				code: '@typescript-eslint/semi',
				code2: {
					value: '@typescript-eslint/semi',
					link: vscode.Uri.parse('https://eslint.org/docs/rules/semi')
				},
				severity: vscode.DiagnosticSeverity.Error,
			},
			{
				range: new vscode.Range(1, 0, 1, 5),
				// message: 'Ensures that double quoted strings are passed to a localize call\nto provide proper strings for\ndifferent locales',
				message: 'Ensures that double\nquoted strings are passed to a localize call to provide proper strings for different locales',
				source: 'eslint',
				code2: {
					value: 'code-no-unexternalized-strings',
					link: vscode.Uri.parse('https://github.com/microsoft/tslint-microsoft-contrib/blob/master/src/noUnexternalizedStringsRule.ts')
				},
				severity: vscode.DiagnosticSeverity.Error,
			}
		]);
	});

	context.subscriptions.push(disposable);
}

In the problems panel, focus on one of the diagnostics, and tab to the documentation link. Hitting enter on the keyboard causes focus to shift to the editor instead of triggering the link to open

VS Code version: Code - Insiders 1.42.0-insider (c4b6a6b, 2020-01-28T06:36:30.779Z)
OS version: Linux x64 4.11.12-100.fc24.x86_64

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugerror-listProblems viewverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions