rescript-lang / rescript-compiler

The compiler for ReScript.
https://rescript-lang.org
Other
6.74k stars 448 forks source link

Some files get randomly deleted #4231

Closed gaku-sei closed 4 years ago

gaku-sei commented 4 years ago

It's extremely hard to provide any more information on that one, but since BuckleScript 7.2.x I got some files randomly deleted in the apps using BuckleScript. I suspect it could be related to https://github.com/jaredly/reason-language-server, but I have really no clue what is going on. I sometimes don't even do anything, and BuckleScript recompiles, and fails since a file disappeared... Do you have any idea on what that could be?

bobzhang commented 4 years ago

Which files are deleted? Do you have hand written files with suffix .bs.js?

gaku-sei commented 4 years ago

Sorry, I haven't provided a lot of information. I'm using Bucklescript 7.2.2 with the following bsconfig:

{
  "name": ...,
  "reason": {
    "react-jsx": 3
  },
  "sources": [
    {
      "dir": "src",
      "subdirs": true
    },
    {
      "dir": "tests",
      "subdirs": true,
      "type": "dev"
    }
  ],
  "package-specs": [
    {
      "module": "es6",
      "in-source": true
    }
  ],
  "suffix": ".bs.js",
  "namespace": true,
  "bs-dependencies": [
    ...
  ],
  "bs-dev-dependencies": [...],
  "ppx-flags": [...],
  "refmt": 3,
  "warnings": {
    "number": "-48",
    "error": "+A+8+11+12+16+26+27+31+32+33+34+35+39+44+45+101+102+104+105"
  },
  "bsc-flags": ["-bs-super-errors"],
  "gentypeconfig": {
    "language": "typescript",
    "importPath": "relative",
    "shims": {
      "ReactEvent": "ReactEvent"
    },
    "debug": {
      "all": false,
      "basic": false
    }
  }
}

With the Reason Language Server 1.7.8 on Vs Code.

And I get some .re files randomly deleted 😕 It happens rather frequently (several times a day), and there seems to be no pattern, litterally any .re file can get dropped at any time (expect the ones being edited).

bobzhang commented 4 years ago

hmm, we rarely deleted things, cc @cristianoc for gentype Would the RLS delete things?

cristianoc commented 4 years ago

@bobzhang genType only deletes .gen.tsx files when the file does not need to be generated anymore. Does not touch .re files.

gaku-sei commented 4 years ago

Thank you @cristianoc .

I spent the last few days with all the the extensions disabled on vs code (except for RLS), and apparently it fixed issue. Since the files got deleted after I updated to bs 7.2.0 I thought it could be the cause for it, but apparently it's not, my bad 🙏