markdown icon indicating copy to clipboard operation
markdown copied to clipboard

Provide offset/lengths for nodes

Open DanTup opened this issue 4 years ago • 9 comments

There are some places in the analysis server that could benefit from parsing Markdown. For example https://github.com/Dart-Code/Dart-Code/issues/3330 relates to code blocks no longer being highlighted in VS Code when Semantic Tokens are enabled (Semantic Tokens replace the old regex-based colouring, but the server doesn't produce highlights regions for the code blocks nested inside markdown).

Parsing the comments using this library produces code elements for the things I'd like to highlight, but it appears the offset/length are not provided on the nodes so it's not possible to produce a highlight region for that code.

If this seems like a reasonable extension, I'm happy to have a go at implementing it if someone is happy to provide pointers and/or reviews. Thanks!

DanTup avatar May 17 '21 15:05 DanTup

This is in the works. I hope to land it this quarter (in the next 6 weeks). It involves a huge refactoring of how markdown is parsed; currently there is no Markdown source parse tree; only an output HTML AST.

srawlins avatar May 17 '21 15:05 srawlins

Neat! I did wonder if the current AST might cause issues for non-HTML uses, so this sounds ideal. Thanks!

DanTup avatar May 17 '21 15:05 DanTup

Any update on this issue? Thanks.

frmatthew avatar Aug 13 '21 01:08 frmatthew

My teammate and I with whom I planned to work on this had a lot of non-overlapping vacation this summer, so I didn't get to land anything in June as I hoped. My new target is end of September. 🤞

srawlins avatar Aug 19 '21 17:08 srawlins

@srawlins out of interest, is this still on your radar?

DanTup avatar Jan 18 '22 17:01 DanTup

Oof, it is, but it keeps getting bumped by other slightly higher priority projects. :/ I should not announce a new target date.

srawlins avatar Jan 18 '22 17:01 srawlins

lol, I know the feeling. It's not urgent to me, it's just useful to know if it may be on the way in the near-term or not :-) Thanks!

DanTup avatar Jan 18 '22 17:01 DanTup

2024 - Any updates yet?

Concerning Issue #3648 - Comment References

I would really appreciate this, since this is the reason that documentation comment references cannot be parsed.

Since this is a pretty big bug, I think this issue deserves more attention.

For me, it is one of the only problems with the otherwise nearly-perfect Dart extension for VSCode.

[!NOTE] This works in JavaScript, maybe something could be copied over from that?

Number-3434 avatar Jan 05 '24 11:01 Number-3434

2024 - No updates.

I would appreciate it as well. Sorry, it has not made it to the top of our priorities.

srawlins avatar Jan 05 '24 15:01 srawlins