Skip to content

Typing module A at the top of an empty .res file causes VSCode to not respond #409

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

Closed
fhammerschmidt opened this issue May 6, 2022 · 10 comments

Comments

@fhammerschmidt
Copy link
Member

fhammerschmidt commented May 6, 2022

When I create a file called NodeJs.res in a rescript project, and type module A in it, VSCode completely crashes.

image

I tried to get something meaningful out of the debugger, but there is nothing.

(tested with current master/194bd3a)

@cristianoc
Copy link
Collaborator

Would you add some details?
Was that a pre-exiting project, and was "Start Build" pressed? Or was it being build from the outside, or not built at all.
And was the file created from within vscode?

@fhammerschmidt
Copy link
Member Author

fhammerschmidt commented May 6, 2022

It happened in a pre-existing project as well as in a quick rescript inited one where I just created the NodeJs.res within VSCode beside the demo.res. It even crashed with no lib folder created, before any build.

Edit: Ah, but it only happens when rescript-vscode is activated.

@cristianoc
Copy link
Collaborator

To rule out an issue with building the extension locally, would you try with the .vsix generated by CI?

@fhammerschmidt
Copy link
Member Author

I already tried it both with the built vsix (rescript-vscode-194bd3a.vsix) as well as locally built.

@cknitt
Copy link
Member

cknitt commented May 6, 2022

Also happens on my machine with the VSIX built from master. Happens with "Node.res", too.

@cknitt
Copy link
Member

cknitt commented May 6, 2022

Actually it does not seem to be related to the filename at all.

@fhammerschmidt fhammerschmidt changed the title A file named NodeJs.res causes VSCode to not respond Typing module A at the top of an empty .res file causes VSCode to not respond May 6, 2022
@fhammerschmidt
Copy link
Member Author

fhammerschmidt commented May 6, 2022

You are right, it seems the file just needs to be empty and the module ... needs to be the first thing.

@cristianoc
Copy link
Collaborator

Can see it now, thanks.

@cristianoc
Copy link
Collaborator

Turns out the compact array notation bases on offset used by semantic tokens for speed will crash on an invalid index and bring down the whole thing without any debug info.

Well spotted.

@fhammerschmidt
Copy link
Member Author

Thank you for the fast fix!

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

No branches or pull requests

3 participants