question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API Proposal for multiline quick input

See original GitHub issue

Problem

Currently there’s no way to take a multiline input via showInputBox. We need one because we use showInputBox to take the commit message (which can be multiline) in git extension. (#40295, #39969)

Solution APIs

TLDR: allow passing a multiline property to the showInputBox options
  • PROPOSED API: Allow passing a multiline property to the showInputBox options.

    • Problem: Users can have { multiline: true, password: true } which won’t work because it’s a textarea. More importantly in future there could be more options applicable to only multiline (eg an option mapping to textarea’s row attribute) or to only singleline

      • PROPOSED Solution: It’s okay just document it

      • Solution: It’s okay just document it and throw an error if such case arises

      • Solution: make the type of options like { multiline?: false, password?: boolean } | { multiline?: true, password?: false }

        • Problem: Terrible typescript inference and error message ergonomics if the options are not literal
        • Problem: It’s typescript-only solutiton
  • API: Have another function called showMultilineInputBox that takes options only applicable to it (meaning doesn’t take password property as option)

    • Problem: Feels a little overkill especially at the moment as we only one option (ie password) exclusive to singleline. It would have been okay if we had a bunch of options only exclusive to multiline eg maxHeight, autoGrow, initialRows, etc. or bunch of options exclusive to singleline

Solution Behaviors

TLDR: when multiline is set to true, showInputBox shows a multline quick input where the user hits shift+enter to insert a newline and works exactly like current quick input
  • PROPOSED Behavior: Allow users to insert a newline with shift+enter instead of submitting
    • Prior art: In chrome developer console enter executes the code but shift+enter inserts a newline. As in, usually afaik in scenarios where enter is already taken, shift+enter mimics the “usual” enter behavior. I guess it’s also popular convention.
  • Behavior: Allow users to insert a newline with enter instead of submitting and have shift+enter submit it.
    • Problem: The behavior is not “additive” to singleline behavior as user would expect enter to submit it in multiline also as it does in singleline
  • Behavior: Allow users to insert a newline with enter instead of submitting and have a button to submit it.
    • Problem: Kinda kills the whole point of “quick input” you’ll have to press tab to focus to button and hit enter, foreign to quick action ui and not additive to singleline behavior

Implementation

For currently proposed api and behavior: #98042, demo

cc @jrieken @chrmarti @joaomoreno

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:50
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
PELockcommented, Jul 22, 2020

Just started coding my extension for VSCode, it lacs basic UI input methods. No multiline inputs, no way to design a simple dialog box (we need to use Electron apps like the Color Palette is using and do IPC…). I’m surprised VScode extension API lacks so many basic features.

4reactions
nvuillamcommented, Jan 13, 2022

Feature needed, pleaaaase 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect MultiLine to an external application via API user | MultiLine
Enter the Personal Details. Select External Applications for which the API user will be accessing the organization data. Click Save.
Read more >
Scripting API: UI.InputField.multiLine - Unity - Manual
If the input field supports multiple lines. using UnityEngine; using System.Collections; using UnityEngine.UI; // Required when Using UI elements. public class ...
Read more >
jira cloud api save value for multi line text field
can you please let me know which params we need to save data for multi line ! api gives this error "customfield_10029":"Operation value...
Read more >
Add newline formatting in macros for Custom Ticket Fields ...
A quick glance at the ticket data via API however does show me that newlines are indeed registered in the ticket field as...
Read more >
Multiline String Converter - Convert text to verbatim C# strings
With elmah.io's free multi-line text to C# verbatim string converter, you simply input a string in the field above and let us do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found