Skip to content

Commit

Permalink
No code frame synthetic (#2565)
Browse files Browse the repository at this point in the history
fix [#2448](#2448)

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
  • Loading branch information
timotheeguerin and markcowl authored Oct 13, 2023
1 parent 1599bdd commit 897507d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@typespec/compiler",
"comment": "Stop showing empty code frame when diagnostic has no location",
"type": "none"
}
],
"packageName": "@typespec/compiler"
}
2 changes: 1 addition & 1 deletion packages/compiler/src/core/logger/console-sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function formatSourceLocation(options: FormatLogOptions, location: SourceLocatio
* 9 | op doBeta(@path id: string): string;
*/
function formatSourcePreview(options: FormatLogOptions, location: SourceLocation) {
if (!options.pretty) {
if (!options.pretty || location.isSynthetic) {
return "";
}
const postion = getLineAndColumn(location);
Expand Down

0 comments on commit 897507d

Please sign in to comment.