| Issue |
185378
|
| Summary |
[clang-doc] Support ending parameter names with colon
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Alunderin
|
Currently, clang-doc will include trailing colons as part of parameter names. The Doxygen devs [acknowledge that ending parameter names with colons is non-standard](https://github.com/doxygen/doxygen/issues/7928#issuecomment-667031139), but it *is* supported so I would have expected Clang to handle this as well.
This presumably also affect clangd which fails to match parameter descriptions to function parameters if they are followed by a colon instead of a space.
*`clang-doc --version`: `Ubuntu LLVM version 23.0.0`*
*`clang --version`: `Ubuntu clang version 23.0.0 (++20260308081943+e25e010b9618-1~exp1~20260308202123.1506)`*
## Example
Given this function:
```cpp
/** Asserts that a given output path is a valid destination file.
* @param path: The output path to check.
* @param noClobber: Whether or not an existing file at the destination should be considered invalid.
*/
static auto ValidOutputPath(const char* path, bool noClobber) -> std::filesystem::path;
```
clang-doc will produce the following Markdown:
```md
### ValidOutputPath
*private static std::filesystem::path ValidOutputPath(const char * path, bool noClobber)*
*Defined at src/ArgumentParser.cpp#122*
Asserts that a given output path is a valid destination file.
**path:** The output path to check.
**noClobber:** Whether or not an existing file at the destination should be considered invalid.
```
And the following YAML:
```yaml
- USR: 'D2F6835117211029CB231F58C0604A01AED2FAF9'
Name: 'ValidOutputPath'
Namespace:
- Type: Record
Name: 'ArgumentParser'
QualName: 'ArgumentParser'
USR: '20F00DD31FCD0B8E076329471A608D070C2A328A'
- Type: Namespace
Name: 'GlobalNamespace'
QualName: 'GlobalNamespace'
Description:
- Kind: FullComment
Children:
- Kind: ParagraphComment
Children:
- Kind: TextComment
Text: ' Asserts that a given output path is a valid destination file.'
- Kind: TextComment
- Kind: ParamCommandComment
Direction: '[in]'
ParamName: 'path:'
Children:
- Kind: ParagraphComment
Children:
- Kind: TextComment
Text: ' The output path to check.'
- Kind: TextComment
- Kind: ParamCommandComment
Direction: '[in]'
ParamName: 'noClobber:'
Children:
- Kind: ParagraphComment
Children:
- Kind: TextComment
Text: ' Whether or not an existing file at the destination should be considered invalid.'
- Kind: TextComment
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs