How to complete parenthesis of a function and tab over parameters (if there are any) using Dart Code extension?

529

This functionality was initially missing from the LSP implementation (I presume you have dart.previewLsp enabled), though has recently been implemented (as a new setting dart.completeFunctionCalls that will supersede the original settings you mentioned):

https://github.com/Dart-Code/Dart-Code/issues/2823

You'll need an updated SDK to get this though (though it hasn't currently made a stable SDK, so it may only be on master/dev channels).

Share:
529
SametSahin
Author by

SametSahin

Updated on December 24, 2022

Comments

  • SametSahin
    SametSahin over 1 year

    I'm using Dart Code extension on VS Code while working on Flutter projects. I'm unable to add parenthesis and tab over parameters of a function on autocomplete.

    Refer to this screen recording to see the problem in action.

    And this to see the expected behavior. This is a simple console.log() statement that has parenthesis completed after accepting the autocomplete suggestion.

    Insert Argument Placeholder option is enabled and enableCompletionCommitCharacters option is disabled.

    VS Code version: 1.49.2

    Dart extension version: 3.14.1

    Dart/Flutter SDK version: Dart - 2.9.2 / Flutter - 1.20.4

    • rioV8
      rioV8 over 3 years
      how can you have pixel noise in a screen capture gif. For some reason I'm looking at mega zoomed version of the gif on a 4K monitor.
    • rioV8
      rioV8 over 3 years
      most likely the Javascript completion provider also calls for the insertion of a snippet created on the fly with insertSnippet command
    • SametSahin
      SametSahin over 3 years
      @rioV8 Do you mean that you can see pixels clearly? I guess it's because of the resolution of my monitor which is 1080p.
    • rioV8
      rioV8 over 3 years
      for some reason the browser was viewing a gif at 500% zoom, viewing it at 100% it still is a font the for visually impaired.
  • ÄR Âmmãř Żąîñh
    ÄR Âmmãř Żąîñh almost 3 years
    It works. If we change lsp setting we have to restart the IDE to work.