Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Multiline diagnostics #67255

Closed
2 tasks done
sandy081 opened this issue Jan 28, 2019 · 0 comments
Closed
2 tasks done

Test Multiline diagnostics #67255

sandy081 opened this issue Jan 28, 2019 · 0 comments

Comments

@sandy081
Copy link
Member

sandy081 commented Jan 28, 2019

Testing: #1927

Complexity: 3

  • Create a simple extension that generates multi-line diagnostics and verify that the Problems view show the diagnostic message in multiple lines. You can also toggle to show the message in multiple lines or single line in the view.

  • Play around with problems view by generating different types of diagnostics

Sample extension code:

'use strict';

import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
    const diagnosticsCollection = vscode.languages.createDiagnosticCollection('test');
    vscode.window.onDidChangeActiveTextEditor(e => {
        if (e && e.document) {
            const diagnostics: vscode.Diagnostic[] = [];
            let message = "this is a message with multiple lines. \nLine 1\nLine2\nLine3";
            const diagnostic = new vscode.Diagnostic(new vscode.Range(new vscode.Position(10, 1), new vscode.Position(10, 10)), message, vscode.DiagnosticSeverity.Error);
            diagnostic.source = 'test';
            diagnostic.code = '1234';
            diagnostic.relatedInformation = [];
            diagnostics.push(diagnostic);
            diagnosticsCollection.set(e.document.uri, diagnostics);
        }
    });
}

Or use the following typescript code that has a multiple line diagnostic

interface foo {
	a: string;
}

interface bar extends foo {
	a: number;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants