Skip to content

Commit

Permalink
Merge pull request #152 from sqlfluff/ac/rule_docs
Browse files Browse the repository at this point in the history
Update to rule permalinks
  • Loading branch information
alanmcruickshank authored Aug 14, 2024
2 parents f2859ea + e723439 commit 7dfd941
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/features/providers/linter/actions/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export default class HoverProvider implements vscode.HoverProvider {
}

private createHover(diagnostic: vscode.Diagnostic): vscode.Hover {
const path = `https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.rules.sphinx.Rule_${diagnostic.code}`;
// Link to the rule permalinks so that if the rule docs move in the future that
// we don't have to update the links here. We rely on the docs internally redirecting
// us to the appropriate location.
const path = `https://docs.sqlfluff.com/en/stable/perma/rule/${diagnostic.code}.html`;
const markdownString = new vscode.MarkdownString();

markdownString.appendMarkdown(`[View Documentation](${path}) for Rule ${diagnostic.code}.\n`);
Expand Down

0 comments on commit 7dfd941

Please sign in to comment.