sourcegraph / scip-clang

Apache License 2.0
55 stars 7 forks source link

Proper AST translation for hover docs #426

Closed varungandhi-src closed 1 week ago

varungandhi-src commented 1 year ago

We literally just take the hover doc and jam it into Markdown.

However, it's usually written using Doxygen markup, not Markdown. So we need to synthesize a Doxygen AST -> convert that to Markdown.

https://sourcegraph.com/github.com/NVIDIA/MDL-SDK@190249748ddfe75b133b9da9028cc6272928c1b5/-/blob/include/mi/neuraylib/target_code_types.h?L1079

Here's one example where that falls down. Newlines just continue the paragraph in Markdown. But Doxygen uses \param to mark parameter lists.

image

For the param-specific issue, we could potentially just hack it by adding some ad-hoc translation. E.g. if the start of the line has \param <blah>, then emit * <blah>.