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

Request : Add file path and line number to make MarkedPlugin error messages more friendly. #1557

Closed
MasatoMakino opened this issue Mar 29, 2021 · 2 comments
Labels
enhancement Improved functionality good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged

Comments

@MasatoMakino
Copy link
Contributor

Search Terms

error message, getHighlighted, markedOptions, highlight

Problem

Currently, the error messages of the getHighlighted function of MarkedPlugin.ts do not show the file path and line number of the file where the error occurred. So users need a lot of time to identify the cause of the error message.

Suggested Solution

Currently, getHighlighted generates the following error messages

public getHighlighted(text: string, lang?: string): string {
lang = lang || "typescript";
lang = lang.toLowerCase();
if (!isSupportedLanguage(lang)) {
// Extra newline because of the progress bar
this.application.logger.warn(
`\nUnsupported highlight language "${lang}" will not be highlighted. Run typedoc --help for a list of supported languages.`
);
return text;
}
return highlight(text, lang, this.theme);
}

Unsupported highlight language "{language type}" will not be highlighted. Run typedoc --help for a list of supported languages.

The following information will be added to this message.

This code block is in line n of "path/to/file".
@MasatoMakino MasatoMakino added the enhancement Improved functionality label Mar 29, 2021
@Gerrit0 Gerrit0 added help wanted Contributions are especially encouraged good first issue Easier issue for first time contributors labels Mar 31, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 31, 2021

This is a good idea 👍

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 3, 2021

Resolved by #1561

@Gerrit0 Gerrit0 closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality good first issue Easier issue for first time contributors help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants