elm-language-server
elm-language-server copied to clipboard
Inferred type annotation for top-level definitions is unavailable in vscode when diagnostics are only updated on save
Expected Behavior
When selecting a definition and bringing up the associated quick-fix menu via Ctrl-. or clicking on the light bulb symbol that appears next to it, "Add inferred annotation" should be among the options.
Current Behavior
If the "Only Update Diagnostics On Save" setting is enabled, inferred annotations are only available from the menu for nested definitions, but not for top-level ones.
Possible Solution
Steps to Reproduce (for bugs)
- Start vscode and enable "Only Update Diagnostics On Save"
- Open a new file
Test.elm
and insert the following code:
module Test exposing (..)
cubed x =
let
squared y =
y * y
in
squared x * x
- Save the file.
- Click on
cubed
and type Ctrl-. to bring up the quick-fix menu.
Context
Your Environment
- Version used: 2.2.0 (also present in previous version)
- Editor used: vscode 1.57.0
- Environment name and version (e.g. node.js 5.4): elm 0.19.1
- Operating System and version: Windows 10
Ah! Been wondering why that code action stopped being available. Can confirm, I'm seeing this too.