Skip to content

Fix missing backtick and incorrect variable in DiagnosticLinkInlineParser#2261

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-closing-backtick-error
Open

Fix missing backtick and incorrect variable in DiagnosticLinkInlineParser#2261
Copilot wants to merge 4 commits intomainfrom
copilot/fix-closing-backtick-error

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

  • Fix missing closing backtick in error message on line 275
  • Fix incorrect variable usage (url -> newUrl) in LastIndexOf on line 343
  • Run unit tests to ensure changes don't break existing functionality
  • Verify build succeeds after changes
  • Verify code formatting
  • Fix indentation to use tabs instead of spaces (lines 280-282)
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"Missing closing backtick in the error message. The string should end with `{pathOnDisk}`.","fixFiles":[{"filePath":"src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs","diff":"diff --git a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n--- a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n+++ b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n@@ -272,7 +272,7 @@\n \t\t\t\tprocessor.EmitWarning(link, $\"Local file `{url}` has a redirect, please update this reference to: {name}\");\n \t\t\t}\n \t\t\telse\n-\t\t\t\tprocessor.EmitError(link, $\"`{url}` does not exist. If it was recently removed add a redirect. resolved to `{pathOnDisk}\");\n+\t\t\t\tprocessor.EmitError(link, $\"`{url}` does not exist. If it was recently removed add a redirect. resolved to `{pathOnDisk}`\");\n \n \t\t}\n \t}\n"}]},{"message":"Using `url` instead of `newUrl` for LastIndexOf is incorrect. This should be `newUrl.LastIndexOf(\".md\", StringComparison.Ordinal)` to maintain consistency with the variable being modified.","fixFiles":[{"filePath":"src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs","diff":"diff --git a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n--- a/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n+++ b/src/Elastic.Markdown/Myst/InlineParsers/DiagnosticLinkInlineParser.cs\n@@ -340,7 +340,7 @@\n \t\t{\n \t\t\tnewUrl = newUrl.EndsWith($\"{Path.DirectorySeparatorChar}index.md\")\n \t\t\t\t? newUrl.Remove(newUrl.LastIndexOf(\"index.md\", StringComparison.Ordinal), \"index.md\".Length)\n-\t\t\t\t: newUrl.Remove(url.LastIndexOf(\".md\", StringComparison.Ordinal), \".md\".Length);\n+\t\t\t\t: newUrl.Remove(newUrl.LastIndexOf(\".md\", StringComparison.Ordinal), \".md\".Length);\n \t\t}\n \n \t\t// TODO this is hardcoded should be part of extension system\n"}]}]

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing closing backtick in error message Fix missing backtick and incorrect variable in DiagnosticLinkInlineParser Nov 24, 2025
Copilot AI requested a review from reakaleek November 24, 2025 12:27
@reakaleek reakaleek added the fix label Jan 30, 2026
Comment on lines 280 to 282
{
processor.EmitError(link, $"`{url}` does not exist. If it was recently removed add a redirect. resolved to `{pathOnDisk}`");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix the formatting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 763675b - replaced spaces with tabs for consistent indentation.

Co-authored-by: reakaleek <16325797+reakaleek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants