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

No errors shown anymore after clean & rebuild #980

Open
cknitt opened this issue May 23, 2024 · 10 comments
Open

No errors shown anymore after clean & rebuild #980

cknitt opened this issue May 23, 2024 · 10 comments
Assignees
Milestone

Comments

@cknitt
Copy link
Member

cknitt commented May 23, 2024

Steps to reproduce:

  • Create a new project with create-rescript-app ("basic" template is sufficient)
  • Build the project
  • Open the editor
  • Introduce an error (e.g. "Console.log" -> "Cnsole.log") => the error is underlined correctly in the editor
  • Undo the error
  • Clean and rebuild the project, keeping the editor open
  • Reintroduce the error => it is not shown in the editor this time
@cknitt
Copy link
Member Author

cknitt commented May 23, 2024

It seems that, when you currently have a ReScript file open in the editor and clean the project, the language server terminates unexpectedly with the following error:

node:fs:605
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/Users/christoph/projects/playground/editor-tooling-test/lib/bs/.compiler.log'
    at Object.openSync (node:fs:605:3)
    at Object.func [as openSync] (node:electron/js2c/node_init:2:2214)
    at Object.readFileSync (node:fs:473:35)
    at t.readFileSync (node:electron/js2c/node_init:2:9771)
    at /Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.50.0/server/out/cli.js:42:1359
    at Map.forEach (<anonymous>)
    at Gv (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.50.0/server/out/cli.js:42:1284)
    at vo.<anonymous> (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.50.0/server/out/cli.js:42:2538)
    at vo.emit (node:events:517:28)
    at vo.emitWithAll (/Users/christoph/.vscode/extensions/chenglou92.rescript-vscode-1.50.0/server/out/cli.js:35:25605) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/christoph/projects/playground/editor-tooling-test/lib/bs/.compiler.log'
}

@zth
Copy link
Collaborator

zth commented May 24, 2024

Perfect. thank you!

@fhammerschmidt
Copy link
Member

fhammerschmidt commented Jun 11, 2024

Just encountered this one as well while doing a rebase on an old feature branch. The only way to work is to click on the links in the compiler output directly for every remaining error and fix the issues without LSP help. After a successful compile, rescript-vscode can be restarted and works again without crashing.

@zth
Copy link
Collaborator

zth commented Jun 11, 2024

Feels like fixing this should be quite straight forward. @fhammerschmidt want to take a stab at it?

@fhammerschmidt
Copy link
Member

Is that so? Can you give some guidance on how to approach it?

@zth
Copy link
Collaborator

zth commented Jun 12, 2024

@fhammerschmidt I could be totally wrong of course, but this sounds like a scenario where we're just not cleaning up the state appropriately when the clean/rebuild happens. So, I'd start with tracking the events that happen around cleaning/rebuilding (what happens to the compiler log, are we watching any lock file for bsb, etc), and then try to figure out at which point we should be resetting the state for that project. There's code already that purges the server state when all files of a specific project is closed.

Have a look at it and maybe we can look more together if you can't figure it out?

@fhammerschmidt
Copy link
Member

Sounds good, Ill take a shot.

@fhammerschmidt fhammerschmidt self-assigned this Jun 12, 2024
@cknitt cknitt added this to the v12.0 milestone Aug 25, 2024
@cknitt cknitt moved this to Backlog in ReScript development Aug 29, 2024
@cknitt
Copy link
Member Author

cknitt commented Aug 31, 2024

@jfrolich This was fixed as part of #1033, right?

@cknitt
Copy link
Member Author

cknitt commented Sep 9, 2024

No, still broken for me in 1.58.0.

@fhammerschmidt
Copy link
Member

Somehow this only happens with the production versions (both 1.58.0 and 1.59.x) but not locally in debug mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

3 participants