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

feat: Make documentation on hover configurable #9264

Merged
merged 5 commits into from
Jun 21, 2021

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jun 14, 2021

This also implements deprecation support for config options as this renames hoverActions_linksInHover to hover_linksInHover.

Fixes #9232

Comment on lines 144 to 148
/// Whether to show documentation on hover.
hover_documentation: bool = "true",
/// Use markdown syntax for links in hover.
hover_linksInHover: bool = "true",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR splits up hoverActions from general hover configurations as I feel like a split makes more sense here. This does move hoverActions_linksInHover to hover_linksInHover however which is a breaking change. I suppose we can keep both settings and mark the old version deprecated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented configuration deprecation now 178b5ff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, why do we need deprecation functionality? We already have aliases (see behaviour vs behavior), and all the aliases but one are effectively deprecated -- they don't show up in the scheme. If you want to do anything else for deprecated aliases, I think you can build off that functionality?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right I guess we don't need that then? For some reason I thought aliases only worked for the last part of config names. I'll change that back then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I thought aliases only worked for the last part of config names.

They might, I dont' remember. But, even that's the case, we should extend that functionality, rather than add a new, similar one. Might be a good idea to document this!

Comment on lines 39 to +40
pub markdown: bool,
pub documentation: bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like these two fields want to be something like

    pub docs: Option<DocFormat> 

enum DocFormat {
    Markdown, PlainText
}

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as the feature goes, but I think hover module can benefit from some cleanup before tackling more functionality onto it!

@Veykril
Copy link
Member Author

Veykril commented Jun 21, 2021

I'll clean this up in a follow up then as this is big enough as is
bors r+

bors bot added a commit that referenced this pull request Jun 21, 2021
9264: feat: Make documentation on hover configurable r=Veykril a=Veykril

This also implements deprecation support for config options as this renames `hoverActions_linksInHover` to `hover_linksInHover`.

Fixes #9232

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
@matklad
Copy link
Member

matklad commented Jun 21, 2021

bors r-

@bors
Copy link
Contributor

bors bot commented Jun 21, 2021

Canceled.

@matklad
Copy link
Member

matklad commented Jun 21, 2021

Just to double check, are you sure we need deprecated functionality here? #9264 (comment)

@Veykril
Copy link
Member Author

Veykril commented Jun 21, 2021

Oh sorry I didnt see that actually(github could really improve on showing whats new in a PR)

@Veykril
Copy link
Member Author

Veykril commented Jun 21, 2021

bors r+

bors bot added a commit that referenced this pull request Jun 21, 2021
9264: feat: Make documentation on hover configurable r=Veykril a=Veykril

This also implements deprecation support for config options as this renames `hoverActions_linksInHover` to `hover_linksInHover`.

Fixes #9232

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jun 21, 2021

Build failed:

@Veykril
Copy link
Member Author

Veykril commented Jun 21, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 21, 2021

@bors bors bot merged commit 25bf451 into rust-lang:master Jun 21, 2021
@Veykril Veykril deleted the hover-docs branch June 21, 2021 14:25
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

Successfully merging this pull request may close these issues.

Add option to disable hover documentation
2 participants