Open COMAC919 opened 11 months ago
Filing an issue in four different places is not going to get it answered faster, it will just annoy people who are spammed with repeated email notifications.
Filing an issue in four different places is not going to get it answered faster, it will just annoy people who are spammed with repeated email notifications.
I beg your pardon for my ignorance and my mistakes. I didn't know where to ask this question, so I posted it in a few places hoping that someone who knows could see it.This situation will not occur again.
In the Diagnostics.cpp file of the clangd module in LLVM, there is a function called getDiagnosticDocURI that retrieves the URL address of a rule check. The code is as follows:
case Diag::ClangTidy: { StringRef Module, Check; std::tie(Module, Check) = Name.split('-'); if (Module.empty() || Check.empty()) return llvm::None; return ("https://clang.llvm.org/extra/clang-tidy/checks/" + Module + "/" + Check + ".html") .str(); }
Now, I have defined several custom rules and have corresponding MD documents in the code repository. Therefore, in the clangd plugin in VSCode, when there is an alert, I want to be able to click on the hyperlink to go to the corresponding document. I modified the code as follows:case Diag::ClangTidy: { StringRef Module, Check; if (Name.contains(StringRef("xxx-xxx"))){ std::string url = R"(https://open.codehub.xxx.com/innersource/DragonGlass/DragonGlass/files?ref%3Dmaster&isFile&%3Dtrue&filePath=clang-tools-extra/clang-tidy/xxx/docs/security/Check8Byte.md)"; return url ; }
In the plugin, the alert is displayed, but when I check the hyperlink in the alert, it is always escaped as the following link: https://open.codehub.xxx.com/innersource/DragonGlass/DragonGlass/files?ref%3Dmaster%26isFile%3Dtrue%26filePath%3Dclang-tools-extra%2Fclang-tidy%2Fhuawei%2Fdocs%2Fsecurity%2FCheck8Byte.mdThis prevents me from being able to click on the hyperlink and access the specified website. How can I resolve this issue?