0

I am currently creating a custom extension in VSCode. So far i managed to create a simple section for the sidebar like this(I created the robot icon on the bottom and added the buttons):

enter image description here

Now when i click a button it will take a few seconds to calulate the result. When the button gets pressed, visually nothing happens so far. I want the standart blue loading bar to be active while the function is running. For example, when i am commiting something with the git extension, this blue bar is active:

enter image description here

Does someone know how this can be achieved in general?

Mark
  • 143,421
  • 24
  • 428
  • 436

1 Answers1

0

There is a full example extension that uses the progress functionality. See vscode extensions: progress sample.

    context.subscriptions.push(commands.registerCommand('extension.startTask', () => {
        window.withProgress({
            location: ProgressLocation.Notification,
            title: "I am long running!",
            cancellable: true
        },

More at the link above. The location can take a viewID.

Also there is an example at https://stackoverflow.com/a/74744162/836330.

Mark
  • 143,421
  • 24
  • 428
  • 436