Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃毇 Bug] Setting.setValue() does not work for combo box #1243

Open
ronsig opened this issue Apr 8, 2024 · 3 comments
Open

[馃毇 Bug] Setting.setValue() does not work for combo box #1243

ronsig opened this issue Apr 8, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@ronsig
Copy link

ronsig commented Apr 8, 2024

Describe the bug

This used to work before.
I try to set a value to a combo box field - e.g. Files->Auto Save or Editor->Cursor Style
I'm able to locate the setting using
let setting = await settingsEditor.findSetting('Auto Save', 'Files');

However, calling await setting.setValue("afterDelay"); shows me the combo box opening, but the value is not set.
image
I also tried using await setting.sendKeys("a");, but got an "not interactable" error.

Similarly, await setting.getValue() always returns an empty string, regardless of which setting the combo box has.
I tried adding short delays or repatign the action - but this had no effect.
Note that setValue() appears to function ok for text fields (e.g. "Auto Save Delay")

Steps to reproduce

1. run
let setting = await settingsEditor.findSetting('Auto Save', 'Files');
await setting.setValue("afterDelay"); 

2. you will see the combo box opening, but its value is not modified

Logs

no errors are thrown

Operating System

Windows 10

Visual Studio Code

1.88.0

vscode-extension-tester

7.1.0. Also tried 8.0.2

NodeJS

18.13

npm

8.19.3

@ronsig ronsig added bug Something isn't working new-issue New issue which was not discussed yet labels Apr 8, 2024
@djelinek
Copy link
Collaborator

Hello @ronsig , thank you for reaching to us!

did you tried to get setting as ComboSetting? could you please try with

let setting = await settingsEditor.findSetting('Auto Save', 'Files') as ComboSetting;

other should remain same as you have.

@djelinek djelinek removed the new-issue New issue which was not discussed yet label Apr 10, 2024
@djelinek djelinek self-assigned this Apr 10, 2024
@djelinek djelinek modified the milestones: BACKLOG, NEXT Apr 10, 2024
@djelinek djelinek modified the milestones: NEXT, BACKLOG May 7, 2024
@djelinek djelinek removed their assignment May 7, 2024
@ronsig
Copy link
Author

ronsig commented Jun 2, 2024

Hi @djelinek,
I tried casting as CobmboSetting, as suggested. Works ok now.
Thanks!

Ron

@ronsig
Copy link
Author

ronsig commented Jun 4, 2024

Hi @djelinek,

Please note that after upgrading to 8.2.0 I now see a degradation.
By the time await settingsEditor.findSetting('Auto Save', 'Files') as ComboSetting; returns, the setting may not have loaded yet
I had to implement a do-while loop. It usually takes 0-5 attempts until the setting is retrieved and I can modify it.
Here's what I used:

    let count = 0;
    do {
        let setting = await settingsEditor.findSetting('Auto Save', 'Files') as ComboSetting;
        if(setting) {
            await setting.setValue(state);
            break;
        }
        count++;
    } while (count < 10);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants