@@ -245,6 +245,72 @@ int main() {
245245 }
246246};
247247
248+ TEST_CASE (Comments) {
249+ constexpr auto code = R"CODE(
250+ /// This is line comment
251+ /// This comment line 2
252+ /// This comment line 3 with indent
253+ /// This comment line 4
254+ static void fu$(pos_0)nc() {
255+
256+ }
257+
258+ // This is line comment
259+ // This comment line 2
260+ // This comment line 3 with indent
261+ // This comment line 4
262+ static void fu$(pos_1)nc1() {
263+
264+ }
265+
266+ /*
267+ * This is block comment
268+ * This comment line 2
269+ * This comment line 3 with indent
270+ * This comment line 4
271+ */
272+ static void fu$(pos_2)nc2() {
273+
274+ }
275+
276+ /**
277+ * This is block comment
278+ * This comment line 2
279+ * This comment line 3 with indent
280+ * This comment line 4
281+ **/
282+ static void fu$(pos_3)nc3() {
283+
284+ }
285+
286+ /********************************************
287+ * This is block comment
288+ * This comment line 2
289+ * This comment line 3 with indent
290+ * This comment line 4
291+ *******************************************/
292+ static void fu$(pos_4)nc4() {
293+
294+ }
295+ )CODE" ;
296+
297+ auto annotation = AnnotatedSource::from (code);
298+ tester.add_main (" main.cpp" , annotation.content );
299+ tester.compile ();
300+ ASSERT_TRUE (tester.unit .has_value ());
301+ const unsigned count = annotation.offsets .size ();
302+ for (unsigned i = 0 ; i < count; ++i) {
303+ unsigned offset = annotation.offsets [std::format (" pos_{}" , i)];
304+ auto HI = clice::feature::hover (*tester.unit , offset, {});
305+ // if(HI.has_value()) {
306+ // auto msg = HI->display({});
307+ // std::println("```\n{}```\n", *msg);
308+ // } else {
309+ // std::println("No hover info");
310+ // }
311+ }
312+ }
313+
248314TEST_CASE (Namespace) {
249315 run (R"cpp(
250316namespace A {
0 commit comments