AmazonScience/SWE-PolyBench huggingface dataset:
Repository: serverless/serverless (JavaScript)
Date: 2019-07-08 16:34:27+00:00
Task type: Feature

Issue:
Allow warnings to be hidden
<!--
1. If you have a question and not a feature request please ask first at http://forum.serverless.com
2. Please check if an issue already exists. This feature may have already been requested
3. Check out and follow our Guidelines: https://github.com/serverless/serverless/blob/master/CONTRIBUTING.md
4. Fill out the whole template so we have a good overview on the issue
5. Do not remove any section of the template. If something is not applicable leave it empty but leave it in the Issue
6. Please follow the template, otherwise we'll have to ask you to update it
-->

# This is a Feature Proposal

## Description

I am working on a project at work which makes use of **Serverless**.

I have some SSM parameters that can be intentionally left undefined, and this behavior produces a warning for each undefined parameter.

I'd like to hide these warnings.

I already have a PR for it: https://github.com/serverless/serverless/pull/6345



Issue discussion:

Solution patch:
diff --git a/lib/classes/CLI.js b/lib/classes/CLI.js
index 80299ddf43a..4e26e801733 100644
--- a/lib/classes/CLI.js
+++ b/lib/classes/CLI.js
@@ -209,6 +209,12 @@ class CLI {
     this.consoleLog(chalk.yellow.underline('Framework'));
     this.consoleLog(chalk.dim('* Documentation: https://serverless.com/framework/docs/'));
 
+    this.consoleLog('');
+
+    this.consoleLog(chalk.yellow.underline('Environment Variables'));
+    this.consoleLog(chalk.dim('* Set SLS_DEBUG=* to see debugging logs'));
+    this.consoleLog(chalk.dim('* Set SLS_WARNING_DISABLE=* to hide warnings from the output'));
+
     this.consoleLog('');
     if (!_.isEmpty(this.loadedCommands)) {
       _.forEach(this.loadedCommands, (details, command) => {
diff --git a/lib/classes/Error.js b/lib/classes/Error.js
index c5f2e3ca1a8..75f8664ea32 100644
--- a/lib/classes/Error.js
+++ b/lib/classes/Error.js
@@ -97,6 +97,10 @@ module.exports.logError = e => {
 };
 
 module.exports.logWarning = message => {
+  if (process.env.SLS_WARNING_DISABLE) {
+    return;
+  }
+
   writeMessage('Serverless Warning', message);
 };
 


Test patch:
diff --git a/lib/classes/Error.test.js b/lib/classes/Error.test.js
index 43b10139415..47938e8b14b 100644
--- a/lib/classes/Error.test.js
+++ b/lib/classes/Error.test.js
@@ -110,6 +110,20 @@ describe('Error', () => {
       expect(message).to.have.string('SLS_DEBUG=*');
     });
 
+    it('should hide warnings if SLS_WARNING_DISABLE is defined', () => {
+      process.env.SLS_WARNING_DISABLE = '*';
+
+      logWarning('This is a warning');
+      logWarning('This is another warning');
+      logError(new Error('an error'));
+
+      const message = consoleLogSpy.args.join('\n');
+
+      expect(consoleLogSpy.called).to.equal(true);
+      expect(message).to.have.string('an error');
+      expect(message).not.to.have.string('This is a warning');
+    });
+
     it('should print stack trace with SLS_DEBUG', () => {
       process.env.SLS_DEBUG = '1';
       const error = new ServerlessError('a message');
Repository: serverless/serverless (JavaScript)
Date: 2019-02-25 13:27:36+00:00
Task type: Feature

Issue:
Allow non-alphanumeric characters for websocket routes
# Allow non-alphanumeric characters for websocket routes

## Description

When deploying a websocket route, you will get an error, if you use a non-alphanumeric name for the route. This is more restrictive than what APIGateway allows.

I couldn't find a documentation from AWS regarding the allowed characters. By trial&error I found out, that at least the following characters are allowed in route names:
* `/`
* `-`
* `_`
* `.`

Serverless framework should allow the use of these characters too.


## Additional Data

In the past, we have solved similar issues by simply sanitizing the names for the Cloudformation Stack entries:

`
orgName => orgName.replace(/_/g, 'Underscore').replace(/-/g, 'Dash').replace(/\./g, 'Point').replace(/\//g, 'Slash')
`


Issue discussion:

Solution patch:
diff --git a/lib/plugins/aws/lib/naming.js b/lib/plugins/aws/lib/naming.js
index 21631aa63d8..31f1efd772c 100644
--- a/lib/plugins/aws/lib/naming.js
+++ b/lib/plugins/aws/lib/naming.js
@@ -181,7 +181,12 @@ module.exports = {
   },
 
   getNormalizedWebsocketsRouteKey(route) {
-    return route.replace('$', 'S');
+    return route
+      .replace('$', 'S') // dollar sign
+      .replace('/', 'Slash')
+      .replace('-', 'Dash')
+      .replace('_', 'Underscore')
+      .replace('.', 'Period');
   },
 
   getWebsocketsRouteLogicalId(route) {


Test patch:
diff --git a/lib/plugins/aws/lib/naming.test.js b/lib/plugins/aws/lib/naming.test.js
index 643981306a9..8395f8a1773 100644
--- a/lib/plugins/aws/lib/naming.test.js
+++ b/lib/plugins/aws/lib/naming.test.js
@@ -259,6 +259,18 @@ describe('#naming()', () => {
     it('should return a normalized version of the route key', () => {
       expect(sdk.naming.getNormalizedWebsocketsRouteKey('$connect'))
         .to.equal('Sconnect');
+
+      expect(sdk.naming.getNormalizedWebsocketsRouteKey('foo/bar'))
+        .to.equal('fooSlashbar');
+
+      expect(sdk.naming.getNormalizedWebsocketsRouteKey('foo-bar'))
+        .to.equal('fooDashbar');
+
+      expect(sdk.naming.getNormalizedWebsocketsRouteKey('foo_bar'))
+        .to.equal('fooUnderscorebar');
+
+      expect(sdk.naming.getNormalizedWebsocketsRouteKey('foo.bar'))
+        .to.equal('fooPeriodbar');
     });
   });
Repository: serverless/serverless (JavaScript)
Date: 2018-01-12 14:03:06+00:00
Task type: Bug Fix

Issue:
Allow explicit name for authorisers specified by arn.
# This is a Bug

## Description

Serverless (v1.25.0) does not respect the 'name' property if 'arn' is specified for an authorizer.

This is unexpected- but is especially problematic because it stops you using the same authorizer function with different configurations (e.g. cached/non-cached) across the same service.

Similar or dependent issues:
* #3413 mentions this in the commentary below, but is focused on the sanity of the implict naming function.


Issue discussion:

Solution patch:
diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
index 03dcbcfb259..bbafbb75163 100644
--- a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
+++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
@@ -220,7 +220,11 @@ module.exports = {
         type = 'AWS_IAM';
       } else if (authorizer.arn) {
         arn = authorizer.arn;
-        name = this.provider.naming.extractAuthorizerNameFromArn(arn);
+        if (_.isString(authorizer.name)) {
+          name = authorizer.name;
+        } else {
+          name = this.provider.naming.extractAuthorizerNameFromArn(arn);
+        }
       } else if (authorizer.name) {
         name = authorizer.name;
         arn = this.getLambdaArn(name);


Test patch:
diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
index 6338005f271..a2132f048e0 100644
--- a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
+++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
@@ -934,6 +934,30 @@ describe('#validate()', () => {
     expect(validated.events[0].http.authorizer.arn).to.equal('xxx:dev-authorizer');
   });
 
+  it('should handle an authorizer.arn with an explicit authorizer.name object', () => {
+    awsCompileApigEvents.serverless.service.functions = {
+      first: {
+        events: [
+          {
+            http: {
+              path: 'foo/bar',
+              method: 'GET',
+              authorizer: {
+                arn: 'xxx:dev-authorizer',
+                name: 'custom-name',
+              },
+            },
+          },
+        ],
+      },
+    };
+
+    const validated = awsCompileApigEvents.validate();
+    expect(validated.events).to.be.an('Array').with.length(1);
+    expect(validated.events[0].http.authorizer.name).to.equal('custom-name');
+    expect(validated.events[0].http.authorizer.arn).to.equal('xxx:dev-authorizer');
+  });
+
   it('should throw an error if the provided config is not an object', () => {
     awsCompileApigEvents.serverless.service.functions = {
       first: {
Repository: serverless/serverless (JavaScript)
Date: 2017-05-12 14:27:08+00:00
Task type: Feature

Issue:
CORS: Add `X-Amz-User-Agent` to list of allowed headers
# This is a Feature Request

## Description

I'm using the default CORS options in our backend Lambda to allow our frontend to access it via JavaScript. In order to make this work properly I needed to add `X-Amz-User-Agent` to the list of `Access-Control-Allow-Origin` headers as shown in this example:

```yaml
functions:
  api:
    handler: handlers/api/handler.handler
    description: General API
    events:
      - http:
          path: api/{any+}
          method: GET
          cors:
            origins:
              - '*'
            headers:
              - Content-Type
              - Authorization
              - X-Amz-Date
              - X-Amz-Security-Token
              - X-Amz-User-Agent      # <-- have to add this manually!
              - X-Api-Key
          authorizer: aws_iam
```

My request is to simply add `X-Amz-User-Agent` as a default allowed header. That would make things much simpler.

## Additional Data

* ***Serverless Framework Version you're using***: 1.12.1



Issue discussion:

Solution patch:
diff --git a/docs/providers/aws/events/apigateway.md b/docs/providers/aws/events/apigateway.md
index 255f5466f99..e4e5385b1aa 100644
--- a/docs/providers/aws/events/apigateway.md
+++ b/docs/providers/aws/events/apigateway.md
@@ -123,6 +123,7 @@ functions:
               - Authorization
               - X-Api-Key
               - X-Amz-Security-Token
+              - X-Amz-User-Agent
             allowCredentials: false
 ```
 
diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
index a3a57387173..365cafe8e6e 100644
--- a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
+++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.js
@@ -269,6 +269,7 @@ module.exports = {
       'Authorization',
       'X-Api-Key',
       'X-Amz-Security-Token',
+      'X-Amz-User-Agent',
     ];
 
     let cors = {


Test patch:
diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
index d175bcdd4b6..433126e1fa3 100644
--- a/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
+++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/validate.test.js
@@ -433,7 +433,8 @@ describe('#validate()', () => {
     const validated = awsCompileApigEvents.validate();
     expect(validated.events).to.be.an('Array').with.length(1);
     expect(validated.events[0].http.cors).to.deep.equal({
-      headers: ['Content-Type', 'X-Amz-Date', 'Authorization', 'X-Api-Key', 'X-Amz-Security-Token'],
+      headers: ['Content-Type', 'X-Amz-Date', 'Authorization', 'X-Api-Key',
+        'X-Amz-Security-Token', 'X-Amz-User-Agent'],
       methods: ['OPTIONS', 'POST'],
       origins: ['*'],
       allowCredentials: false,
Repository: serverless/serverless (JavaScript)
Date: 2017-03-31 05:43:43+00:00
Task type: Feature

Issue:
Missing description for Lambda Version
# This is a Feature Proposal

## Description

Version of Lambda function is supported to add the properties of "Description" on [publish version](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#publishVersion-property). Append the function description into version if specified, it is ease to use and great presentation to determine what is it for each version.



Issue discussion:

Solution patch:
diff --git a/lib/plugins/aws/deploy/compile/functions/index.js b/lib/plugins/aws/deploy/compile/functions/index.js
index 3df59a6a67d..7f9c21bfcfa 100644
--- a/lib/plugins/aws/deploy/compile/functions/index.js
+++ b/lib/plugins/aws/deploy/compile/functions/index.js
@@ -177,6 +177,9 @@ class AwsCompileFunctions {
 
     newVersion.Properties.CodeSha256 = hash.read();
     newVersion.Properties.FunctionName = { Ref: functionLogicalId };
+    if (functionObject.description) {
+      newVersion.Properties.Description = functionObject.description;
+    }
 
     // use the SHA in the logical resource ID of the version because
     // AWS::Lambda::Version resource will not support updates


Test patch:
diff --git a/lib/plugins/aws/deploy/compile/functions/index.test.js b/lib/plugins/aws/deploy/compile/functions/index.test.js
index ebe49c047e7..f243931543b 100644
--- a/lib/plugins/aws/deploy/compile/functions/index.test.js
+++ b/lib/plugins/aws/deploy/compile/functions/index.test.js
@@ -924,6 +924,23 @@ describe('AwsCompileFunctions', () => {
       );
     });
 
+    it('should include description under version too if function is specified', () => {
+      awsCompileFunctions.serverless.service.functions = {
+        func: {
+          handler: 'func.function.handler',
+          description: 'Lambda function description',
+        },
+      };
+
+      awsCompileFunctions.compileFunctions();
+
+      expect(
+        awsCompileFunctions.serverless.service.provider.compiledCloudFormationTemplate
+          .Resources.FuncLambdaVersionw6uP8Tcg6K2QR905Rms8iXTlksL6OD1KOWBxTK7wxPI
+        .Properties.Description
+      ).to.equal('Lambda function description');
+    });
+
     it('should not create function output objects when "versionFunctions" is false', () => {
       awsCompileFunctions.serverless.service.provider.versionFunctions = false;
       awsCompileFunctions.serverless.service.functions = {
Repository: serverless/serverless (JavaScript)
Date: 2016-12-02 00:40:10+00:00
Task type: Feature

Issue:
Include Multiple Resource Files
# This is a Feature Proposal

## Description
This feature enables multiple resource files to be included in the 'Resources' section.  This enables larger services to include sub resource files independantly.  One resource file can be broken up a number to enable better independant managability / change control as these files can get large and hard to manage in larger implementations.

e.g 

```yml
resources:
  Resources:
    - ${file(resources/first-cf-resources.yml)}
    - ${file(resources/second-cf-resources.yml)}
```


Issue discussion:

Solution patch:
diff --git a/lib/classes/Service.js b/lib/classes/Service.js
index 871ab8822e8..eca7aa75713 100644
--- a/lib/classes/Service.js
+++ b/lib/classes/Service.js
@@ -86,6 +86,12 @@ class Service {
           throw new SError(errorMessage);
         }
 
+        if (Array.isArray(serverlessFile.resources)) {
+          serverlessFile.resources = serverlessFile.resources.reduce((memo, value) =>
+            Object.assign(memo, value)
+          , {});
+        }
+
         that.service = serverlessFile.service;
         that.provider = serverlessFile.provider;
         that.custom = serverlessFile.custom;


Test patch:
diff --git a/lib/classes/Service.test.js b/lib/classes/Service.test.js
index 91b0baf049a..3c833624acc 100644
--- a/lib/classes/Service.test.js
+++ b/lib/classes/Service.test.js
@@ -169,6 +169,37 @@ describe('Service', () => {
       });
     });
 
+    it('should merge resources given as an array', () => {
+      const SUtils = new Utils();
+      const serverlessYml = {
+        service: 'new-service',
+        provider: 'aws',
+        resources: [
+          {
+            aws: {
+              resourcesProp: 'value',
+            },
+          },
+          {
+            azure: {},
+          },
+        ],
+      };
+
+      SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yml'),
+        YAML.dump(serverlessYml));
+
+      const serverless = new Serverless();
+      serverless.init();
+      serverless.config.update({ servicePath: tmpDirPath });
+      serviceInstance = new Service(serverless);
+
+      return serviceInstance.load().then(() => {
+        expect(serviceInstance.resources.aws).to.deep.equal({ resourcesProp: 'value' });
+        expect(serviceInstance.resources.azure).to.deep.equal({});
+      });
+    });
+
     it('should make sure function name contains the default stage', () => {
       const SUtils = new Utils();
       const serverlessYml = {
Repository: serverless/serverless (JavaScript)
Date: 2016-09-27 15:53:16+00:00
Task type: Bug Fix

Issue:
Other provider values (than aws) are not supported
# This is a Bug Report
## Description

If I switch the provider property in my `serverless.yml` file from e.g. `aws` to `ibm` or `google` I get the error message that this provider is not supported and I should chosse from a list with supported providers (supported providers include `ibm` and `google`).



Issue discussion:

Solution patch:
diff --git a/lib/classes/Service.js b/lib/classes/Service.js
index 24b50630373..32fd3d62020 100644
--- a/lib/classes/Service.js
+++ b/lib/classes/Service.js
@@ -69,7 +69,7 @@ class Service {
           };
         }
 
-        if (['aws', 'azure', 'google', 'ibm'].indexOf(serverlessFile.provider.name)) {
+        if (['aws', 'azure', 'google', 'ibm'].indexOf(serverlessFile.provider.name) === -1) {
           const errorMessage = [
             `Provider "${serverlessFile.provider.name}" is not supported.`,
             ' Valid values for provider are: aws, azure, google, ibm.',


Test patch:
diff --git a/tests/classes/Service.js b/tests/classes/Service.js
index e39a8079911..520361f7498 100644
--- a/tests/classes/Service.js
+++ b/tests/classes/Service.js
@@ -207,6 +207,37 @@ describe('Service', () => {
       });
     });
 
+    it('should support Serverless file with a non-aws provider', () => {
+      const SUtils = new Utils();
+      const serverlessYaml = {
+        service: 'my-service',
+        provider: 'ibm',
+        functions: {
+          functionA: {
+            name: 'customFunctionName',
+          },
+        },
+      };
+
+      SUtils.writeFileSync(path.join(tmpDirPath, 'serverless.yaml'),
+        YAML.dump(serverlessYaml));
+
+      const serverless = new Serverless({ servicePath: tmpDirPath });
+      serviceInstance = new Service(serverless);
+
+      return serviceInstance.load().then(() => {
+        const expectedFunc = {
+          functionA: {
+            name: 'customFunctionName',
+            events: [],
+          },
+        };
+        expect(serviceInstance.service).to.be.equal('my-service');
+        expect(serviceInstance.provider.name).to.deep.equal('ibm');
+        expect(serviceInstance.functions).to.deep.equal(expectedFunc);
+      });
+    });
+
     it('should support Serverless file with a .yaml extension', () => {
       const SUtils = new Utils();
       const serverlessYaml = {
Repository: serverless/serverless (JavaScript)
Date: 2016-09-07 05:54:29+00:00
Task type: Bug Fix

Issue:
API Gateway returns 200 when function times out
# This is a Bug Report
## Description
- What went wrong?
  When a lambda function times out, API Gateway still returns a 200 OK status code
- What should have happened?
  API Gateway should return a 500 or 504 status code when a lambda function times out
- What was the config you used?
  Serverless 1.0 RC1

The code change for this is very simple. PR to follow shortly



Issue discussion:

Solution patch:
diff --git a/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js b/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js
index 521925868de..e150d834ef9 100644
--- a/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js
+++ b/lib/plugins/aws/deploy/compile/events/apiGateway/lib/methods.js
@@ -333,7 +333,8 @@ module.exports = {
             { StatusCode: 422, SelectionPattern: '.*\\[422\\].*' },
             { StatusCode: 500,
               SelectionPattern:
-                '.*(Process\\s?exited\\s?before\\s?completing\\s?request|\\[500\\]).*' },
+                // eslint-disable-next-line max-len
+                '.*(Process\\s?exited\\s?before\\s?completing\\s?request|Task\\s?timed\\s?out\\s?|\\[500\\]).*' },
             { StatusCode: 502, SelectionPattern: '.*\\[502\\].*' },
             { StatusCode: 504, SelectionPattern: '.*\\[504\\].*' }
           );


Test patch:
diff --git a/lib/plugins/aws/deploy/compile/events/apiGateway/tests/methods.js b/lib/plugins/aws/deploy/compile/events/apiGateway/tests/methods.js
index 563eb505342..ab169a668bc 100644
--- a/lib/plugins/aws/deploy/compile/events/apiGateway/tests/methods.js
+++ b/lib/plugins/aws/deploy/compile/events/apiGateway/tests/methods.js
@@ -665,7 +665,9 @@ describe('#compileMethods()', () => {
         awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate
           .Resources.ApiGatewayMethodUsersListGet.Properties.Integration.IntegrationResponses[6]
       ).to.deep.equal({ StatusCode: 500,
-        SelectionPattern: '.*(Process\\s?exited\\s?before\\s?completing\\s?request|\\[500\\]).*' });
+        SelectionPattern:
+          // eslint-disable-next-line max-len
+          '.*(Process\\s?exited\\s?before\\s?completing\\s?request|Task\\s?timed\\s?out\\s?|\\[500\\]).*' });
       expect(
         awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate
           .Resources.ApiGatewayMethodUsersListGet.Properties.Integration.IntegrationResponses[7]
Repository: serverless/serverless (JavaScript)
Date: 2016-07-26 09:05:02+00:00
Task type: Refactoring

Issue:
Plugins Are Being Loaded Twice
##### Serverless Framework Version: V.1 Alpha 1
##### Operating System:  OSX 10.11.2
##### Expected Behavior:
- Plugins should be loaded once, causing hooks and all else to be set only once.
##### Actual Behavior:
- Plugins are loaded twice
- This is because they are each instantiated twice in the PluginManager, due to the way the Plugin commands and shortcuts code is written.  That code needs to be refactored to solve this problem and it could be improved generally.



Issue discussion:
Thanks for reporting! This is really not intended behavior. Will look into it ASAP.


Solution patch:
diff --git a/lib/classes/PluginManager.js b/lib/classes/PluginManager.js
index 8bd9d73ea10..714fdab3365 100644
--- a/lib/classes/PluginManager.js
+++ b/lib/classes/PluginManager.js
@@ -129,13 +129,15 @@ class PluginManager {
   }
 
   addPlugin(Plugin) {
-    this.loadCommands(Plugin);
+    const pluginInstance = new Plugin(this.serverless, this.cliOptions);
+
+    this.loadCommands(pluginInstance);
 
     // shortcuts should be converted into options so that the plugin
     // author can use the option (instead of the shortcut)
     this.convertShortcutsIntoOptions(this.cliOptions, this.commands);
 
-    this.plugins.push(new Plugin(this.serverless, this.cliOptions));
+    this.plugins.push(pluginInstance);
   }
 
   loadCorePlugins() {
@@ -172,8 +174,8 @@ class PluginManager {
     }
   }
 
-  loadCommands(Plugin) {
-    this.commandsList.push((new Plugin(this.serverless)).commands);
+  loadCommands(pluginInstance) {
+    this.commandsList.push(pluginInstance.commands);
 
     // TODO: refactor ASAP as it slows down overall performance
     // rebuild the commands


Test patch:
diff --git a/tests/classes/PluginManager.js b/tests/classes/PluginManager.js
index 7dc65d6f4f7..79bfa8008b3 100644
--- a/tests/classes/PluginManager.js
+++ b/tests/classes/PluginManager.js
@@ -410,7 +410,8 @@ describe('PluginManager', () => {
 
   describe('#loadCommands()', () => {
     it('should load the plugin commands', () => {
-      pluginManager.loadCommands(SynchronousPluginMock);
+      const synchronousPluginMockInstance = new SynchronousPluginMock();
+      pluginManager.loadCommands(synchronousPluginMockInstance);
 
       expect(pluginManager.commandsList[0]).to.have.property('deploy');
     });
@@ -418,7 +419,8 @@ describe('PluginManager', () => {
 
   describe('#getEvents()', () => {
     beforeEach(() => {
-      pluginManager.loadCommands(SynchronousPluginMock);
+      const synchronousPluginMockInstance = new SynchronousPluginMock();
+      pluginManager.loadCommands(synchronousPluginMockInstance);
     });
 
     it('should get all the matching events for a root level command in the correct order', () => {
Repository: microsoft/vscode (TypeScript)
Date: 2020-12-31 06:39:42+00:00
Task type: Bug Fix

Issue:
Diffing two empty files shows them as having changes
<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.51.1
- OS Version: Windows 10

Steps to Reproduce:

1. Diff two empty files (or an empty file against itself)
2. Notice the diff view shows "removed" and "added" lines:

![image](https://user-images.githubusercontent.com/67761731/102942100-484a0f00-4469-11eb-8d87-a7ff583b94c7.png)

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

This behavior is surprising since a file with a single newline shows no differences. So why should an empty file be shown as having differences?

This is important to me because I am using the monaco diff editor, and do not want it to show any differences when both sides are empty.


Issue discussion:

Solution patch:
diff --git a/src/vs/editor/common/diff/diffComputer.ts b/src/vs/editor/common/diff/diffComputer.ts
--- a/src/vs/editor/common/diff/diffComputer.ts
+++ b/src/vs/editor/common/diff/diffComputer.ts
@@ -313,6 +313,13 @@ export class DiffComputer {
 
 		if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
 			// empty original => fast path
+			if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
+				return {
+					quitEarly: false,
+					changes: []
+				};
+			}
+
 			return {
 				quitEarly: false,
 				changes: [{


Test patch:
diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts
--- a/src/vs/editor/test/common/diff/diffComputer.test.ts
+++ b/src/vs/editor/test/common/diff/diffComputer.test.ts
@@ -462,6 +462,13 @@ suite('Editor Diff - DiffComputer', () => {
 		assertDiff(original, modified, expected, true, false, true);
 	});
 
+	test('empty diff 5', () => {
+		let original = [''];
+		let modified = [''];
+		let expected: ILineChange[] = [];
+		assertDiff(original, modified, expected, true, false, true);
+	});
+
 	test('pretty diff 1', () => {
 		let original = [
 			'suite(function () {',
Repository: microsoft/vscode (TypeScript)
Date: 2022-05-04 23:29:50+00:00
Task type: Bug Fix

Issue:
"Don't show again" action is not clickable / doesn't work
This message right here:
<img width="474" alt="image" src="https://user-images.githubusercontent.com/32465942/163148022-f0455cde-552d-44ad-a512-235a644b24da.png">

When i click on "Don't show again", it doesn't really work: as soon as i navigate to that input field again, it shows the same message again.

Version: 1.66.2
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
Embedder: github.dev


Issue discussion:
`git bisect` says this regressed with https://github.com/microsoft/vscode/commit/69d1ad8c65c9fa412fdf9f29abaab1f950be447f.

Solution patch:
diff --git a/src/vs/base/browser/markdownRenderer.ts b/src/vs/base/browser/markdownRenderer.ts
--- a/src/vs/base/browser/markdownRenderer.ts
+++ b/src/vs/base/browser/markdownRenderer.ts
@@ -152,7 +152,7 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
 				.replace(/>/g, '&gt;')
 				.replace(/"/g, '&quot;')
 				.replace(/'/g, '&#39;');
-			return `<a data-href="${href}" title="${title || href}">${text}</a>`;
+			return `<a href="" data-href="${href}" title="${title || href}">${text}</a>`;
 		}
 	};
 	renderer.paragraph = (text): string => {


Test patch:
diff --git a/src/vs/base/test/browser/markdownRenderer.test.ts b/src/vs/base/test/browser/markdownRenderer.test.ts
--- a/src/vs/base/test/browser/markdownRenderer.test.ts
+++ b/src/vs/base/test/browser/markdownRenderer.test.ts
@@ -148,7 +148,7 @@ suite('MarkdownRenderer', () => {
 			mds.appendMarkdown(`[$(zap)-link](#link)`);
 
 			let result: HTMLElement = renderMarkdown(mds).element;
-			assert.strictEqual(result.innerHTML, `<p><a data-href="#link" title="#link"><span class="codicon codicon-zap"></span>-link</a></p>`);
+			assert.strictEqual(result.innerHTML, `<p><a href="" data-href="#link" title="#link"><span class="codicon codicon-zap"></span>-link</a></p>`);
 		});
 
 		test('render icon in table', () => {
@@ -168,7 +168,7 @@ suite('MarkdownRenderer', () => {
 </thead>
 <tbody><tr>
 <td><span class="codicon codicon-zap"></span></td>
-<td><a data-href="#link" title="#link"><span class="codicon codicon-zap"></span>-link</a></td>
+<td><a href="" data-href="#link" title="#link"><span class="codicon codicon-zap"></span>-link</a></td>
 </tr>
 </tbody></table>
 `);
Repository: microsoft/vscode (TypeScript)
Date: 2022-05-20 19:52:46+00:00
Task type: Bug Fix

Issue:
Terminal cwd seems to be behind a command
At least, that's what it seems like. Testing https://github.com/microsoft/vscode/issues/141502 with Powershell 7

1. Follow the setup for `a` and `b`.
2. Open vscode in folder `a`
3. In the terminal, `cd ../b`
4. In the terminal, _type out_ `echo foo.txt` without hitting enter and ctrl+click `foo.txt`. `a/foo.txt` opens 🐛 
5. Hit enter, or run any other command. Even hitting enter on an empty prompt works.
6. Repeat step 4, but this time `b/foo.txt` opens correctly


Issue discussion:
Ah this is because the command doesn't get fully registered until it finishes, same root cause as https://github.com/microsoft/vscode/issues/143704
This works but the opened file has a strange breadcrumb: 
![image](https://user-images.githubusercontent.com/30305945/160063694-a049d701-f175-4409-8766-3af87f52f8f3.png)

Good URI (b/foo.txt):

![image](https://user-images.githubusercontent.com/2193314/160141140-fe5b2750-fd13-47e4-b330-ee11b94fa6b4.png)

Bad URI: (cd b; foo.txt)

![image](https://user-images.githubusercontent.com/2193314/160141304-3e59cb4e-4b85-4e17-a780-f52d37a808bd.png)

Fix will be here, maybe only happens on Windows:

https://github.com/microsoft/vscode/blob/1a93d4f70ea0e0cd5e821dbcf8b6f20d9a7187e3/src/vs/workbench/contrib/terminal/browser/links/terminalLinkHelpers.ts#L150-L175

This is too risky imo for March.

Solution patch:
diff --git a/src/vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners.ts b/src/vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners.ts
--- a/src/vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners.ts
+++ b/src/vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners.ts
@@ -170,7 +170,8 @@ export class TerminalSearchLinkOpener implements ITerminalLinkOpener {
 		let resourceMatch: IResourceMatch | undefined;
 		if (osPathModule(this._os).isAbsolute(sanitizedLink)) {
 			const scheme = this._workbenchEnvironmentService.remoteAuthority ? Schemas.vscodeRemote : Schemas.file;
-			const uri = URI.from({ scheme, path: sanitizedLink });
+			const slashNormalizedPath = this._os === OperatingSystem.Windows ? sanitizedLink.replace(/\\/g, '/') : sanitizedLink;
+			const uri = URI.from({ scheme, path: slashNormalizedPath });
 			try {
 				const fileStat = await this._fileService.stat(uri);
 				resourceMatch = { uri, isDirectory: fileStat.isDirectory };


Test patch:
diff --git a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts
--- a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts
+++ b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLinkOpeners.test.ts
@@ -177,7 +177,7 @@ suite('Workbench - TerminalLinkOpeners', () => {
 					type: TerminalBuiltinLinkType.Search
 				});
 				deepStrictEqual(activationResult, {
-					link: 'file:///c%3A%5CUsers%5Chome%5Cfolder%5Cfile.txt',
+					link: 'file:///c%3A/Users/home/folder/file.txt',
 					source: 'editor'
 				});
Repository: microsoft/vscode (TypeScript)
Date: 2022-06-10 14:46:57+00:00
Task type: Bug Fix

Issue:
Error: Remote authorities containing '+' need to be resolved!
This is impacting Codespaces

![image](https://user-images.githubusercontent.com/5047891/173090258-a921dfe7-2ecd-47b1-9a1e-ac0a7b582742.png)


Issue discussion:

Solution patch:
diff --git a/src/vs/platform/remote/common/remoteHosts.ts b/src/vs/platform/remote/common/remoteHosts.ts
--- a/src/vs/platform/remote/common/remoteHosts.ts
+++ b/src/vs/platform/remote/common/remoteHosts.ts
@@ -51,10 +51,6 @@ export function parseAuthorityWithOptionalPort(authority: string, defaultPort: n
 }
 
 function parseAuthority(authority: string): { host: string; port: number | undefined } {
-	if (authority.indexOf('+') >= 0) {
-		throw new Error(`Remote authorities containing '+' need to be resolved!`);
-	}
-
 	// check for ipv6 with port
 	const m1 = authority.match(/^(\[[0-9a-z:]+\]):(\d+)$/);
 	if (m1) {


Test patch:
diff --git a/src/vs/platform/remote/test/common/remoteHosts.test.ts b/src/vs/platform/remote/test/common/remoteHosts.test.ts
--- a/src/vs/platform/remote/test/common/remoteHosts.test.ts
+++ b/src/vs/platform/remote/test/common/remoteHosts.test.ts
@@ -35,4 +35,8 @@ suite('remoteHosts', () => {
 		assert.deepStrictEqual(parseAuthorityWithOptionalPort('[2001:0db8:85a3:0000:0000:8a2e:0370:7334]', 123), { host: '[2001:0db8:85a3:0000:0000:8a2e:0370:7334]', port: 123 });
 	});
 
+	test('issue #151748: Error: Remote authorities containing \'+\' need to be resolved!', () => {
+		assert.deepStrictEqual(parseAuthorityWithOptionalPort('codespaces+aaaaa-aaaaa-aaaa-aaaaa-a111aa111', 123), { host: 'codespaces+aaaaa-aaaaa-aaaa-aaaaa-a111aa111', port: 123 });
+	});
+
 });
Repository: microsoft/vscode (TypeScript)
Date: 2022-07-02 03:15:36+00:00
Task type: Feature

Issue:
Jump to line+column in terminal links (format `<path> l:c`)
It is possible with VSCode to follow a path printed in the terminal.

When that path also contains the line and column number in the format `<path> l:c` (`l` ≙ line number; `c` ≙ column number),
VSCode currently doesn't interpret it completely and therefore doesn't also jump to the line/column in the opened file.

Example:
````
resources/styles/blocks/cover/rhombus.scss 49:46
````
This path format indicates the path to the file but also the line (49) and column (46) number.

Ctrl + clicking this path currently in VSCode will open the file but not jump to the line or the column.

As this format is used by many linters and compilers (e.g. SASS), it would be a very useful and time-saving feature.


Issue discussion:
Code link:

https://github.com/microsoft/vscode/blob/95a0e2b859aff1f5f3e6300a8d70aa813608da64/src/vs/workbench/contrib/terminal/browser/links/terminalValidatedLocalLinkProvider.ts#L35-L44

I think here we'd want to require the exact (num)(colon)(num) to prevent problems with (link) (number) (text)
nice feature for many front end build tools.

Solution patch:
diff --git a/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts b/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
--- a/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
+++ b/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
@@ -49,6 +49,7 @@ export const winLocalLinkClause = '((' + winPathPrefix + '|(' + winExcludedPathC
 /** As xterm reads from DOM, space in that case is nonbreaking char ASCII code - 160,
 replacing space with nonBreakningSpace or space ASCII code - 32. */
 export const lineAndColumnClause = [
+	'(([^:\\s\\(\\)<>\'\"\\[\\]]*) ((\\d+))(:(\\d+)))', // (file path) 336:9 [see #140780]
 	'((\\S*)[\'"], line ((\\d+)( column (\\d+))?))', // "(file path)", line 45 [see #40468]
 	'((\\S*)[\'"],((\\d+)(:(\\d+))?))', // "(file path)",45 [see #78205]
 	'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13


Test patch:
diff --git a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
--- a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
+++ b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
@@ -66,6 +66,7 @@ const supportedLinkFormats: LinkFormatInfo[] = [
 	{ urlFormat: '{0} ({1}, {2})', line: '5', column: '3' },
 	{ urlFormat: '{0}:{1}', line: '5' },
 	{ urlFormat: '{0}:{1}:{2}', line: '5', column: '3' },
+	{ urlFormat: '{0} {1}:{2}', line: '5', column: '3' },
 	{ urlFormat: '{0}[{1}]', line: '5' },
 	{ urlFormat: '{0} [{1}]', line: '5' },
 	{ urlFormat: '{0}[{1},{2}]', line: '5', column: '3' },
Repository: microsoft/vscode (TypeScript)
Date: 2022-07-05 14:54:52+00:00
Task type: Bug Fix

Issue:
support gulp hygeine links
1. use some `""` or do something that prompts a gulp hygeine error when you commit
2. have an error like ` /Users/meganrogge/Repos/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.ts: line 111, col 32,` try to open that file at the given line and col
3. it opens the file, but doesn't go to the line or col


Issue discussion:

Solution patch:
diff --git a/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts b/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
--- a/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
+++ b/src/vs/workbench/contrib/terminal/browser/links/terminalLocalLinkDetector.ts
@@ -52,7 +52,7 @@ export const lineAndColumnClause = [
 	'((\\S*)[\'"], line ((\\d+)( column (\\d+))?))', // "(file path)", line 45 [see #40468]
 	'((\\S*)[\'"],((\\d+)(:(\\d+))?))', // "(file path)",45 [see #78205]
 	'((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13
-	'((\\S*):line ((\\d+)(, column (\\d+))?))', // (file path):line 8, column 13
+	'((\\S*):\\s?line ((\\d+)(, col(umn)? (\\d+))?))', // (file path):line 8, column 13, (file path): line 8, col 13
 	'(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,\\s?(\\d+))?)[\\)\\]])', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18), (file path)(45, 18), (file path) (45, 18), also with []
 	'(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)' // (file path):336, (file path):336:9
 ].join('|').replace(/ /g, `[${'\u00A0'} ]`);


Test patch:
diff --git a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
--- a/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
+++ b/src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts
@@ -58,6 +58,8 @@ const supportedLinkFormats: LinkFormatInfo[] = [
 	{ urlFormat: '{0} on line {1}, column {2}', line: '5', column: '3' },
 	{ urlFormat: '{0}:line {1}', line: '5' },
 	{ urlFormat: '{0}:line {1}, column {2}', line: '5', column: '3' },
+	{ urlFormat: '{0}: line {1}', line: '5' },
+	{ urlFormat: '{0}: line {1}, col {2}', line: '5', column: '3' },
 	{ urlFormat: '{0}({1})', line: '5' },
 	{ urlFormat: '{0} ({1})', line: '5' },
 	{ urlFormat: '{0}({1},{2})', line: '5', column: '3' },
Repository: microsoft/vscode (TypeScript)
Date: 2022-08-05 19:17:43+00:00
Task type: Bug Fix

Issue:
Remote - WSL workspace path in title bar is using wrong separators
Repro:

- Using `"window.title": "${rootName}${separator}${activeEditorMedium}"`
- Open a Remote - WSL folder

![image](https://user-images.githubusercontent.com/2193314/180217780-362f552b-2de2-4fce-a51f-cccf9fccefd8.png)



Issue discussion:
This would probably not be limited to the title, what about the hover over the tab?
The separators seem to be flipped:
![Recording 2022-07-21 at 07 38 58](https://user-images.githubusercontent.com/2193314/180241614-ba84f72b-fe23-4e24-bc79-d62c248bcad7.gif)


I wonder if https://github.com/microsoft/vscode/commit/28c40a970f6022e313bab06db508f8cccba30860#diff-03884ebe0184813eefa37634b94bab50708d7bb0de73110da41ab72a1aac5625 could have regressed this, is this a recent regression?
I cannot reproduce, so this is some setting you have or some configuration most likely.
It might be remnants of the formatted caching bug? https://github.com/microsoft/vscode/issues/150970

Solution patch:
diff --git a/src/vs/workbench/services/label/common/labelService.ts b/src/vs/workbench/services/label/common/labelService.ts
--- a/src/vs/workbench/services/label/common/labelService.ts
+++ b/src/vs/workbench/services/label/common/labelService.ts
@@ -143,9 +143,9 @@ export class LabelService extends Disposable implements ILabelService {
 		this.os = OS;
 		this.userHome = pathService.defaultUriScheme === Schemas.file ? this.pathService.userHome({ preferLocal: true }) : undefined;
 
-		const memento = this.storedFormattersMemento = new Memento('cachedResourceLabelFormatters', storageService);
+		const memento = this.storedFormattersMemento = new Memento('cachedResourceLabelFormatters2', storageService);
 		this.storedFormatters = memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
-		this.formatters = this.storedFormatters?.formatters || [];
+		this.formatters = this.storedFormatters?.formatters?.slice() || [];
 
 		// Remote environment is potentially long running
 		this.resolveRemoteEnvironment();


Test patch:
diff --git a/src/vs/workbench/services/label/test/browser/label.test.ts b/src/vs/workbench/services/label/test/browser/label.test.ts
--- a/src/vs/workbench/services/label/test/browser/label.test.ts
+++ b/src/vs/workbench/services/label/test/browser/label.test.ts
@@ -166,7 +166,7 @@ suite('URI Label', () => {
 
 
 	test('label caching', () => {
-		const m = new Memento('cachedResourceLabelFormatters', storageService).getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
+		const m = new Memento('cachedResourceLabelFormatters2', storageService).getMemento(StorageScope.PROFILE, StorageTarget.MACHINE);
 		const makeFormatter = (scheme: string): ResourceLabelFormatter => ({ formatting: { label: `\${path} (${scheme})`, separator: '/' }, scheme });
 		assert.deepStrictEqual(m, {});
Repository: microsoft/vscode (TypeScript)
Date: 2022-08-09 17:34:23+00:00
Task type: Bug Fix

Issue:
Suggested code action should put update imports first
![image](https://user-images.githubusercontent.com/900690/183649815-aa6a6248-6f0b-4ae7-ac1f-97f9ba7653d3.png)

I feel this is a regression.


Issue discussion:

Solution patch:
diff --git a/src/vs/editor/contrib/codeAction/browser/codeAction.ts b/src/vs/editor/contrib/codeAction/browser/codeAction.ts
--- a/src/vs/editor/contrib/codeAction/browser/codeAction.ts
+++ b/src/vs/editor/contrib/codeAction/browser/codeAction.ts
@@ -72,7 +72,7 @@ class ManagedCodeActionSet extends Disposable implements CodeActionSet {
 
 	private static codeActionsComparator({ action: a }: CodeActionItem, { action: b }: CodeActionItem): number {
 		if (isNonEmptyArray(a.diagnostics)) {
-			return -1;
+			return isNonEmptyArray(b.diagnostics) ? ManagedCodeActionSet.codeActionsPreferredComparator(a, b) : -1;
 		} else if (isNonEmptyArray(b.diagnostics)) {
 			return 1;
 		} else {


Test patch:
diff --git a/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts b/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts
--- a/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts
+++ b/src/vs/editor/contrib/codeAction/test/browser/codeAction.test.ts
@@ -119,9 +119,9 @@ suite('CodeAction', () => {
 		disposables.add(registry.register('fooLang', provider));
 
 		const expected = [
-			// CodeActions with a diagnostics array are shown first ordered by diagnostics.message
-			new CodeActionItem(testData.diagnostics.abc, provider),
+			// CodeActions with a diagnostics array are shown first without further sorting
 			new CodeActionItem(testData.diagnostics.bcd, provider),
+			new CodeActionItem(testData.diagnostics.abc, provider),
 
 			// CodeActions without diagnostics are shown in the given order without any further sorting
 			new CodeActionItem(testData.command.abc, provider),
Repository: microsoft/vscode (TypeScript)
Date: 2022-08-25 07:05:04+00:00
Task type: Bug Fix

Issue:
Broken image resources in getting started walktrough
- VS Code Version: From sources

Steps to Reproduce:

I'm serving vscode web resources with a base path that contains `:` and `@` characters which are valid characters in the path but they get percent enconded making the url invalid.

![image](https://user-images.githubusercontent.com/25115070/186584909-ffc39ec7-94e0-4dc8-88a7-db391233c6ba.png)




Issue discussion:

Solution patch:
diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts
--- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts
+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts
@@ -248,7 +248,7 @@ export class GettingStartedDetailsRenderer {
 
 const transformUri = (src: string, base: URI) => {
 	const path = joinPath(base, src);
-	return asWebviewUri(path).toString();
+	return asWebviewUri(path).toString(true);
 };
 
 const transformUris = (content: string, base: URI): string => content


Test patch:
diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/test/browser/gettingStartedMarkdownRenderer.test.ts b/src/vs/workbench/contrib/welcomeGettingStarted/test/browser/gettingStartedMarkdownRenderer.test.ts
--- a/src/vs/workbench/contrib/welcomeGettingStarted/test/browser/gettingStartedMarkdownRenderer.test.ts
+++ b/src/vs/workbench/contrib/welcomeGettingStarted/test/browser/gettingStartedMarkdownRenderer.test.ts
@@ -23,7 +23,7 @@ suite('Getting Started Markdown Renderer', () => {
 		const rendered = await renderer.renderMarkdown(mdPath, mdBase);
 		const imageSrcs = [...rendered.matchAll(/img src="[^"]*"/g)].map(match => match[0]);
 		for (const src of imageSrcs) {
-			const targetSrcFormat = /^img src="https:\/\/file%2B.vscode-resource.vscode-cdn.net\/.*\/vs\/workbench\/contrib\/welcomeGettingStarted\/common\/media\/.*.png"$/;
+			const targetSrcFormat = /^img src="https:\/\/file\+.vscode-resource.vscode-cdn.net\/.*\/vs\/workbench\/contrib\/welcomeGettingStarted\/common\/media\/.*.png"$/;
 			assert(targetSrcFormat.test(src), `${src} didnt match regex`);
 		}
 		languageService.dispose();