microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
733 stars 243 forks source link

Select server dropdown disappears #4861

Closed ajkauffmann closed 4 years ago

ajkauffmann commented 5 years ago

Describe the bug The dropdown to select a server disappears immediately when you want to publish and you have multiple configurations in launch.json. The dropdown works as expected for downloading symbols.

To Reproduce Steps and/or AL code to reproduce the behavior:

  1. Create a new project with AL:Go!
  2. Add a local server to the launch.json
  3. Add a cloud sandbox to launch.json
  4. Download symbols (the dropdown let you select the server to download from)
  5. Publish the app. The dropdown appears for a split second but disappears immediately

Expected behavior The dropdown should let you select to which server you want to publish.

Screenshots I'm talking about this dropdown: image

Versions:

nicolassaleron commented 5 years ago

Hello, I have also noticed that since the last VSCode update.

FSharpCSharp commented 5 years ago

Unfortunately it is no longer displayed here. This is really a bit strange.

calcifieddeveloper commented 5 years ago

Hi, I am having the same issue too..

JohanStenberg100 commented 5 years ago

Hi all, thanks for filing this issue. This is already filed under #4846, and I wasn't able to reproduce with a recent local build. However I will keep this issue open to track progress since so many are affected.

srenders commented 5 years ago

I'm noticing it too as from today...

jwikman commented 5 years ago

@JohanStenberg100 any news on this?

We started to see this behavior after VSCode got updated to v1.33, but it is still present in VSCode v1.34. We where running the same version (3.0.126610) of AL Language extension just fine before the update of VSCode, so there seems to be some incompatibility between the current AL Language extension and the recent builds of VSCode.

All my colleagues are reporting the same issues. As long as you're having only one configuration in launch.json it works, but as soon as you add another configuration and the Quick Pick (where the server should be selected) you're not able to select anything. Sometimes we see the quick pick flashing away, but not always.

If I debug the extension I see that the showQuickPick function call below (in out\src\services\launchService.js) doesn't return any item when this occur. If I step into (F11) showQuickPick everything works fine, if I step over (F10) showQuickPick the issue occur.

 vscode.window.showQuickPick(items, options).then(item => {
                if (item) {
                    const i = items.indexOf(item);
                    if (i !== -1) {
                        resolve(configurations[i]);
                    }
                    else {
                        reject();
                    }
                }
                else {
                    reject();
                }

So there seem to be some issues with vscode.window.showQuickPick, but not always...

Are you still not able to repro?

jwikman commented 5 years ago

@JohanStenberg100 I think I found a solution to this issue. (Note, "a" solution, maybe not "the" solution. ;-) )

Anyways, there seems to be some change of focus that are messing with us.

If I add the ignoreFocusOut option to the showQuickPick call, it seems to work!

chooseLaunchConfiguration(configurations) {
        return new Promise((resolve, reject) => {
            const items = configurations.map(x => ({
                label: x.name,
                detail: this.formatLaunchConfiguration(x),
                description: ""
            }));
            const options = ({
                placeHolder: resources_2.default.chooseServerPrompt,
                matchOnDetail: true,
                ignoreFocusOut: true // <<-- Added line
            });
            vscode.window.showQuickPick(items, options).then(item => {
                if (item) {
                    const i = items.indexOf(item);
                    if (i !== -1) {
                        resolve(configurations[i]);
                    }
                    else {
                        reject();
                    }
                }
                else {
                    reject();
                }
            });
        });
    }

So if someone wants to workaround this until this gets fixed in the AL Language extension, you just need to find your launchService.js file (probably in "%USERPROFILE%\.vscode\extensions\ms-dynamics-smb.al-3.0.126610\out\src\services\") and add this line.

Maybe this will also fix the issue where QuickPick only work on second try when you just started VSCode, #4525...

JohanStenberg100 commented 5 years ago

Hi @jwikman! This issue has been fixed in our master branch and we will try and get it into the next CU for Spring 2019. Thanks

jwikman commented 5 years ago

Hi @jwikman! This issue has been fixed in our master branch and we will try and get it into the next CU for Spring 2019. Thanks

"Next" as in CU1 or CU2?

JohanStenberg100 commented 5 years ago

CU1 is about to be released so it might not get into that update. If not, CU2 will contain it, thanks.

jwikman commented 5 years ago

Ok, glad I found a workaround then :)

JohanStenberg100 commented 5 years ago

Good! Note that our insider builds for Fall 19 is not out yet, when those are out you can run the VS Code extension from there and you'll get the latest updates much faster. ETA on that is 2-3 weeks.

rvanbekkum commented 5 years ago

The issue seems to be resolved in BC14, CU02.

jwikman commented 5 years ago

At least now (v3.0.152816) the dropdown list is usable, but there is still a focus issue (the same issue as I had with my workaround above). I'm not able to select anything with the keyboard, since the focus is moved to the Output window right after the dropdown is shown. But using the mouse works at least.

atoader commented 4 years ago

This issue has been fixed in the Wave 2 2019 release. Please open a new issue if you encounter any problems.