elm-language-client-vscode icon indicating copy to clipboard operation
elm-language-client-vscode copied to clipboard

Externally changed exposed values are not picked up by the extension

Open harmboschloo opened this issue 2 years ago • 0 comments

Expected Behavior

When the exposed values of a module change outside of VSCode then the autocomplete should show the new values and there should not be an error shown when the new values are used.

Current Behavior

I have two modules A and B, and module A imports module B. When the exposed values of module B change outside of VSCode then the new exposed values do not show up in the autocomplete in module A, and when I add them manually then an error is shown that the variable can not be found. Important here is that module B is not open in VSCode, otherwise it does work correctly.

Possible Solution

The extension could watch any elm files and update the language server accordingly.

Steps to Reproduce (for bugs)

  1. create module A with import B and a value a = B.b1
  2. create module B with exposed value b1
  3. make sure module B is not open in VSCode and module A is
  4. open module B outside VSCode and add an exposed value b2
  5. go back to VSCode and try to use B.b2 in module A, the autocomplete will not work and an error will be shown

Context

I often run into this issue when I have generated elm code with a watch on the source file. When I change the source file then the elm module is generated with a newly exposed value. But then in the elm code where I want to use that value it is not recognized. It can help to open the generated elm module, but not always.

Your Environment

  • Version used: 2.4.1
  • Editor name and version (e.g. VSCode 1.36.1): VSCode 1.69.0
  • Environment name and version (e.g. node.js 5.4): node.js 16.15.1
  • Operating System and version: Windows 11 Home

harmboschloo avatar Jul 08 '22 07:07 harmboschloo