Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation variants with shifted spans for content #244

Open
drahnr opened this issue Jul 24, 2020 · 1 comment
Open

documentation variants with shifted spans for content #244

drahnr opened this issue Jul 24, 2020 · 1 comment

Comments

@drahnr
Copy link

drahnr commented Jul 24, 2020

Attempting to parse doc comments I find myself in need of various adjustments so the string representation and the actual span length are equiv as well as extracting a span that covers just the literal spans check https://github.com/drahnr/cargo-spellcheck/blob/master/src/documentation/literal.rs#L104-L123 .

While the above is only for ascii due to the len, just adding " in a /// comment breaks the above.

I.e. /// if a layer is provided a identiacla "input" and "output", it will only be supplied an would become a rendered literal "/// if a layer is provided a identiacla \"input\" and \"output\", it will only be supplied an would"` with a unexpected length and also a wrong (from application pov) span.

How would I extract the correct span for the actual documentation content?

Any help would be highly appreciated.

@drahnr
Copy link
Author

drahnr commented Jul 24, 2020

There are already a bunch of tests in an attempt the correct span https://github.com/drahnr/cargo-spellcheck/blob/master/src/documentation/literal.rs#L302-L591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant