Repository: vscode
Issue: Source Control: The highlighted code is incorrect.
Labels: bug,diff-editor

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.82.2
- OS Version: Windows 11

Steps to Reproduce:

1. Init a new project with `git init`
2. Create file with code like `before.js`
3. Run  `git add .`
4. Change the code like `after.js`
5. Review the changes code in `Source Control`

The highlighted code is incorrect as shown by the arrow in the screenshot.

Code:

`before.js`

```js
class RenderTarget {
	constructor(options = {}) {
		this.texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace);
		this.texture.isRenderTargetTexture = true;

		this.texture.flipY = false;
		this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
		this.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;
		this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;

		this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
		this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;

		this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;

		this.samples = options.samples !== undefined ? options.samples : 0;
	}
}
```

`after.js`

```js
class RenderTarget {
	constructor(options = {}) {
		const {
			generateMipmaps = false,
			internalFormat = null,
			minFilter = LinearFilter,
			depthBuffer = true,
			stencilBuffer = false,
			depthTexture = null,
			samples = 0
		} = options;

		this.texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace);
		this.texture.isRenderTargetTexture = true;

		this.texture.flipY = false;
		this.texture.generateMipmaps = generateMipmaps;
		this.texture.internalFormat = internalFormat;
		this.texture.minFilter = minFilter;

		this.depthBuffer = depthBuffer;
		this.stencilBuffer = stencilBuffer;

		this.depthTexture = depthTexture;

		this.samples = samples;
	}
}
```

```diff
--- a/test.js
+++ b/test.js
@@ -1,18 +1,28 @@
 class RenderTarget {
        constructor(options = {}) {
+               const {
+                       generateMipmaps = false,
+                       internalFormat = null,
+                       minFilter = LinearFilter,
+                       depthBuffer = true,
+                       stencilBuffer = false,
+                       depthTexture = null,
+                       samples = 0
+               } = options;
+
                this.texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace);
                this.texture.isRenderTargetTexture = true;

                this.texture.flipY = false;
-               this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
-               this.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;
-               this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
+               this.texture.generateMipmaps = generateMipmaps;
+               this.texture.internalFormat = internalFormat;
+               this.texture.minFilter = minFilter;

-               this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
-               this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;
+               this.depthBuffer = depthBuffer;
+               this.stencilBuffer = stencilBuffer;

-               this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
+               this.depthTexture = depthTexture;

-               this.samples = options.samples !== undefined ? options.samples : 0;
+               this.samples = samples;
        }
 }
```

Screenshot:

![图片](https://github.com/microsoft/vscode/assets/23699926/03c08f8e-3d7d-4ec6-b780-4c4032d73576)

Relatived PR: https://github.com/mrdoob/three.js/pull/26775

![图片](https://github.com/microsoft/vscode/assets/23699926/9a249cad-30ff-44af-9e98-125e5b79ee0a)