Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Show doc comments before type expansions in hover information#7774

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@mediremi
Copy link
Member

BeforeAfter
imageimage

When generating hover information, we currently show in order:

  1. main type
  2. expanded types
  3. docstrings

A frequent issue I run into is that my expanded types hover information is long enough that the hover preview box must be scrolled to view docstrings.

In this PR, I've changed the order we present this information to:

  1. main type
  2. docstrings
  3. expanded types

nojaf reacted with thumbs up emoji
@mediremimediremiforce-pushed thedocstrings-before-type-expansions-2 branch from1dbdc67 to6a89573CompareAugust 16, 2025 11:49
@mediremimediremi marked this pull request as ready for reviewAugust 16, 2025 11:49
@pkg-pr-new
Copy link

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7774

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7774

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7774

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7774

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7774

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7774

commit:6a89573

@mediremimediremi changed the titleShow docstrings before type expansions in hover informationShow doc comments before type expansions in hover informationAug 17, 2025
@zthzth requested review fromCopilot andzthAugust 18, 2025 08:14
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves hover information display by reordering the presentation to show docstrings before type expansions, making documentation more visible when type expansions are lengthy.

  • Reordered hover information to display docstrings immediately after the main type, before expanded types
  • Modified thehoverWithExpandedTypes function to accept and integrate docstring parameters
  • Updated test expectations to reflect the new hover information order

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
analysis/src/Hover.mlCore implementation changes to reorder hover elements and integrate docstring display
tests/analysis_tests/tests/src/expected/Hover.res.txtUpdated test expectations for the new hover format
tests/analysis_tests/tests/src/expected/JsxV4.res.txtUpdated test expectations for JSX component hover format
CHANGELOG.mdAdded changelog entry documenting the feature

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

Markdown.codeBlock typeString :: expandedTypes|>String.concat"\n"
let typeString=
match docstringwith
|Some[]|None ->Markdown.codeBlock typeString

Choose a reason for hiding this comment

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

[nitpick] The patternSome [] suggests that an empty docstring list should be treated the same as no docstring. Consider using a helper function or guard clause to make this logic clearer, as the pattern matching combines two conceptually different cases.

Suggested change
|Some[]|None ->Markdown.codeBlock typeString
letis_empty_docstring=function
|None|Some[] ->true
|Some_ ->false
in
match docstringwith
|dwhen is_empty_docstring d ->Markdown.codeBlock typeString

Copilot uses AI. Check for mistakes.
Copy link
Member

@zthzth left a comment

Choose a reason for hiding this comment

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

Great stuff!

mediremi reacted with laugh emoji
@zthzth merged commitdfa1610 intorescript-lang:masterAug 18, 2025
27 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@zthzthzth approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mediremi@zth

[8]ページ先頭

©2009-2025 Movatter.jp