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

Improve lsp hover definition comment formatting #3411

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

hirasawayuki
Copy link
Contributor

@hirasawayuki hirasawayuki commented Oct 20, 2024

This PR introduces a new formatComment function to enhance the formatting of comments displayed in hover definitions. The implementation handles both single-line and multi-line comments, ensuring proper formatting while maintaining Markdown compatibility.

Before

screenshot2

As shown above, hover definitions currently display unnecessary asterisks from the proto file's comment syntax, making the documentation harder to read.

After

screenshot1

The new implementation removes the redundant asterisks while preserving the comment's structure, resulting in cleaner and more readable documentation in hover definitions.

@hirasawayuki hirasawayuki changed the title feat: Improve comment formatting for hover definitions feat(lsp): Improve comment formatting for hover definitions Oct 20, 2024
@hirasawayuki hirasawayuki changed the title feat(lsp): Improve comment formatting for hover definitions Improve lsp hover definition comment formatting Oct 25, 2024
@hirasawayuki hirasawayuki force-pushed the feat/format-comment-docs branch from 18a54b8 to 20f7a11 Compare October 26, 2024 13:05
Copy link
Member

@mcy mcy left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. This hasn't been very high on my priority list and I've only just had a chance to look at this.

private/buf/buflsp/symbol.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Outdated Show resolved Hide resolved
private/buf/buflsp/symbol_test.go Outdated Show resolved Hide resolved
@hirasawayuki
Copy link
Contributor Author

@mcy
Thank you for your review! I've addressed your feedback and made the suggested changes.
Could you please review the updated code?

@hirasawayuki hirasawayuki requested a review from mcy October 30, 2024 15:00
@doriable doriable merged commit 133b9c4 into bufbuild:main Dec 16, 2024
3 checks passed
@hirasawayuki hirasawayuki deleted the feat/format-comment-docs branch December 21, 2024 13:22
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.

3 participants