elm-language-server icon indicating copy to clipboard operation
elm-language-server copied to clipboard

Inferred type annotation for top-level definitions is unavailable in vscode when diagnostics are only updated on save

Open odf opened this issue 3 years ago • 1 comments

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)

  1. Start vscode and enable "Only Update Diagnostics On Save"
  2. 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
  1. Save the file.
  2. 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

odf avatar Jun 12 '21 03:06 odf

Ah! Been wondering why that code action stopped being available. Can confirm, I'm seeing this too.

derrickbeining avatar Aug 22 '21 03:08 derrickbeining