rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
28 stars 15 forks source link

Errors Shown in VSCode Problems panel for Non-Existent Files #128

Closed addison-adler closed 3 weeks ago

addison-adler commented 3 weeks ago

Issue: diagnosticFilters not being applied to files that do not exist

I discovered the issue while using Maestro. Maestro creates a ton of files under maestro/generated. However, the linter thinks these files are located under components/maestro/generated when the actual path is src/components/maestro/generated.

So there are two problems here:

  1. The source path for maestro/generated is incorrect (I'm not sure if this is caused by maestro or by bsconfig)
  2. The errors are not being filtered out despite diagnostic filters that should be applied

The files produce 1082 errors. If you click on any of the warnings you receive an editor error "Cannot open because file not found" because the path is incorrect


I think something similar may have been mentioned like this relating to erroneous errors/warnings after moving/renaming files? The suggestion I remember was to try the 1.0.0 alpha, but I had issues trying that and the lang server kept crashing 🙁 (I haven't had time to debug that, sorry, just noting that I couldn't get that to work)


bsconfig.json

{
  "sourceMap": true,
  "stagingDir": "build",
  "retainStagingDir": true,
  "rootDir": "src",
  "files": [
    "manifest",
    "source/**/*.*",
    "images/**/*.*",
    "fonts/**/*.*",
    "meta/**/*.*",
    "components/**/*.*",
  ],
  "autoImportComponentScript": true,
  "createPackage": false,
  "diagnosticFilters": [
    "**/roku_modules/**",
    "**/maestro/**",
    "**/RALETrackerTask.*",
  ],
  "plugins": [
    "maestro-roku-bsc-plugin",
    "rooibos-roku",
    "roku-log-bsc-plugin",
    "@rokucommunity/bslint"
  ],
  "maestro": {
    "excludeFilters": [
      "**/RALETrackerTask.*",
      "**/roku_modules/**/*",
      "**/node_modules/**/*",
      "**/rooibos/**/*"
    ],
    "buildForIDE": true,
    "extraValidation": {
      "doExtraValidation": true,
      "doExtraImportValidation": true,
      "excludeFilters": []
    }
  },
  "rooibos": {
    "isRecordingCodeCoverage": false,
    "testsFilePattern": null
  },
  "rokuLog": {
    "strip": false,
    "insertPkgPath": true,
    "removeComments": true
  },
  "logLevel": "error",
  "transpileOptions": {
    "removeParameterTypes": true
  }
}
addison-adler commented 3 weeks ago

Updated the original post with revised information and bsconfig

Edit: closed; moved issue to the VSCode extension