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

IDE: Improve display of the documentation on hover #5394

Merged
merged 8 commits into from Nov 13, 2018

Conversation

Projects
None yet
4 participants
@Duhemm
Copy link
Contributor

Duhemm commented Nov 6, 2018

screenshot 2018-11-06 at 10 06 47


/** A mapping from tag name to `TagFormatter` */
private val knownTags: ListMap[String, TagFormatter] = ListMap(
"@tparam" -> TagFormatter("Type Parameters", toDescriptionList),

This comment has been minimized.

@smarter

smarter Nov 7, 2018

Member

This seems like something that could be useful when displaying documentation outside of the IDE e.g. in the repl, or even to generate the dottydoc output. Can we move it to compiler/ ?

This comment has been minimized.

@Duhemm

Duhemm Nov 8, 2018

Contributor

I've moved it to dotty.tools.dotc.util

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-better-doc branch from 02ea0b7 to f0af0bb Nov 8, 2018

@odersky

This comment has been minimized.

Copy link
Contributor

odersky commented Nov 8, 2018

Looks neat!

@odersky

odersky approved these changes Nov 8, 2018

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-better-doc branch from c778d46 to 534262d Nov 9, 2018

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-better-doc branch from 3972d91 to d687932 Nov 12, 2018

@Duhemm

This comment has been minimized.

Copy link
Contributor

Duhemm commented Nov 12, 2018

@smarter I just pushed the changes you suggested. VSCode shows just a little more space than I wish it did, but I think overall it's better

screenshot 2018-11-12 at 09 28 49

I've also made the changes you suggested to display the documentation in the REPL.

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-better-doc branch from d687932 to c20fb75 Nov 12, 2018

@smarter

This comment has been minimized.

Copy link
Member

smarter commented Nov 12, 2018

VSCode shows just a little more space than I wish it did, but I think overall it's better

Maybe we could just use bold then ? I haven't tried it

* prepending `####`.
*/
private def heading(str: String)(implicit ctx: Context): String = {
if (colorEnabled) s"$UNDERLINED$str$RESET"

This comment has been minimized.

@smarter

smarter Nov 12, 2018

Member

Have you played with using bold instead of with underlined ?

This comment has been minimized.

@Duhemm

Duhemm Nov 13, 2018

Contributor

I changed it to bold, that looks great too 😄

Duhemm added some commits Nov 5, 2018

Improve display of documentation in IDE
This commit introduces `ParsedComment` which is used to parse the doc
comments and make it easier to retrieve parts of the comments (for
instance, the documentation associated with a given method parameter).

The documentation marked with the tags that scaladoc supports are
extracted and their content are formatted into lists, code fences, etc.

@Duhemm Duhemm force-pushed the dotty-staging:topic/ide-better-doc branch from c20fb75 to cc1b7fa Nov 13, 2018

@Duhemm

This comment has been minimized.

Copy link
Contributor

Duhemm commented Nov 13, 2018

Writing the titles in bold rather than #### puts a lot less space between them, which is better 👍

screenshot 2018-11-13 at 08 38 55

@Duhemm Duhemm merged commit e27b6fa into lampepfl:master Nov 13, 2018

2 checks passed

CLA User signed CLA
Details
continuous-integration/drone/pr the build was successful
Details

@Duhemm Duhemm deleted the dotty-staging:topic/ide-better-doc branch Nov 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment