Skip to content

Fix inlay hints reading from disk instead of editor buffer#8250

Draft
shulhi wants to merge 3 commits intorescript-lang:masterfrom
shulhi:fix-inlay-hint-file-source
Draft

Fix inlay hints reading from disk instead of editor buffer#8250
shulhi wants to merge 3 commits intorescript-lang:masterfrom
shulhi:fix-inlay-hint-file-source

Conversation

@shulhi
Copy link
Member

@shulhi shulhi commented Feb 22, 2026

The inlay hints doesn't read the document from the buffer, but instead read it from disk. This causes stale position location when the document is edited, at least until you saved it. This stale position interferes with user inputs as well (see video).

This fixed it by reading from the buffer just like completion, etc. See rescript-lang/rescript-vscode#1179

Before/After.

Screen.Recording.2026-02-22.at.10.55.28.AM.mov
Screen.Recording.2026-02-22.at.11.04.41.AM.mov

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 22, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8250

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8250

@rescript/win32-x64

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

commit: 31658a3

@shulhi shulhi requested review from nojaf and zth February 22, 2026 23:40
@cknitt
Copy link
Member

cknitt commented Feb 26, 2026

Nice! 🎉 Good to go? Could you add a CHANGELOG entry?

@shulhi
Copy link
Member Author

shulhi commented Feb 27, 2026

Nice! 🎉 Good to go? Could you add a CHANGELOG entry?

It is considered as breaking change depending on the LSP extension you're using. I explained more in rescript-lang/rescript-vscode#1179

I'm not exactly sure how we want to tackle this. On the plus side, I've been using this fix on my work stuff and it is such an improvement.

@zth @nojaf what do you think?

Copy link
Member

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Could you add some more code comments on what the context of this fix is?

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