XUO/SWE-PolyBench huggingface dataset:
Repository: microsoft/vscode (TypeScript) — 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.


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.

Resolving 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) — 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


Discussion:

Resolving 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) — 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)



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

Resolving 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) — 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.


Discussion:

Resolving 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) — 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)




Discussion:

Resolving 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();
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
git similar command doesn't re-run the command w args
![Screen Shot 2022-10-06 at 7 16 36 AM](https://user-images.githubusercontent.com/29464607/194336900-3729551e-d019-4a9d-9aa6-f9aeecc67716.png)



Discussion:

Resolving patch:
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts
--- a/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts
@@ -33,10 +33,6 @@ export function gitSimilarCommand(): ITerminalQuickFixOptions {
 			if (!matchResult?.outputMatch) {
 				return;
 			}
-			// const fixedCommand = matchResult?.outputMatch?.[1];
-			// if (!fixedCommand) {
-			// 	return;
-			// }
 			const actions: TerminalQuickFixAction[] = [];
 			const results = matchResult.outputMatch[0].split('\n').map(r => r.trim());
 			for (let i = 1; i < results.length; i++) {
@@ -44,7 +40,7 @@ export function gitSimilarCommand(): ITerminalQuickFixOptions {
 				if (fixedCommand) {
 					actions.push({
 						type: 'command',
-						command: `git ${fixedCommand}`,
+						command: command.command.replace(/git\s+[^\s]+/, `git ${fixedCommand}`),
 						addNewLine: true
 					});
 				}


Test patch:
diff --git a/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts b/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts
--- a/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts
+++ b/src/vs/workbench/contrib/terminal/test/browser/quickFixAddon.test.ts
@@ -112,6 +112,19 @@ suite('QuickFixAddon', () => {
 					}];
 					assertMatchOptions(getQuickFixes(createCommand('git pu', output, GitSimilarOutputRegex), expectedMap, openerService), actions);
 				});
+				test('passes any arguments through', () => {
+					output = `git: 'checkoutt' is not a git command. See 'git --help'.
+
+				The most similar commands are
+						checkout`;
+					assertMatchOptions(getQuickFixes(createCommand('git checkoutt .', output, GitSimilarOutputRegex), expectedMap, openerService), [{
+						id: `quickFix.command`,
+						enabled: true,
+						label: 'Run: git checkout .',
+						tooltip: 'Run: git checkout .',
+						command: 'git checkout .'
+					}]);
+				});
 			});
 		});
 		suite('gitTwoDashes', async () => {
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
Untitled editors are not force opened when auto save is on
A bug in our tracker for dirty models, somehow never reported but obvious in an issue I noticed with Copilot. The end result is that you see a dirty indicator e.g. in the explorer but no editor that is opening and associated with it.

Steps: https://github.com/github/copilot/issues/2362


Discussion:

Resolving patch:
diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.ts b/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.ts
--- a/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.ts
+++ b/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.ts
@@ -69,9 +69,10 @@ export class TextFileEditorTracker extends Disposable implements IWorkbenchContr
 				return false; // resource must not be pending to save
 			}
 
-			if (this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY && !fileModel?.hasState(TextFileEditorModelState.ERROR)) {
+			if (resource.scheme !== Schemas.untitled && this.filesConfigurationService.getAutoSaveMode() === AutoSaveMode.AFTER_SHORT_DELAY && !fileModel?.hasState(TextFileEditorModelState.ERROR)) {
 				// leave models auto saved after short delay unless
-				// the save resulted in an error
+				// the save resulted in an error and not for untitled
+				// that are not auto-saved anyway
 				return false;
 			}
 


Test patch:
diff --git a/src/vs/workbench/contrib/files/test/browser/textFileEditorTracker.test.ts b/src/vs/workbench/contrib/files/test/browser/textFileEditorTracker.test.ts
--- a/src/vs/workbench/contrib/files/test/browser/textFileEditorTracker.test.ts
+++ b/src/vs/workbench/contrib/files/test/browser/textFileEditorTracker.test.ts
@@ -154,8 +154,16 @@ suite('Files - TextFileEditorTracker', () => {
 		}
 	}
 
-	test('dirty untitled text file model opens as editor', async function () {
-		const accessor = await createTracker();
+	test('dirty untitled text file model opens as editor', function () {
+		return testUntitledEditor(false);
+	});
+
+	test('dirty untitled text file model opens as editor - autosave ON', function () {
+		return testUntitledEditor(true);
+	});
+
+	async function testUntitledEditor(autoSaveEnabled: boolean): Promise<void> {
+		const accessor = await createTracker(autoSaveEnabled);
 
 		const untitledTextEditor = await accessor.textEditorService.resolveTextEditor({ resource: undefined, forceUntitled: true }) as UntitledTextEditorInput;
 		const model = disposables.add(await untitledTextEditor.resolve());
@@ -166,7 +174,7 @@ suite('Files - TextFileEditorTracker', () => {
 
 		await awaitEditorOpening(accessor.editorService);
 		assert.ok(accessor.editorService.isOpened(untitledTextEditor));
-	});
+	}
 
 	function awaitEditorOpening(editorService: IEditorService): Promise<void> {
 		return Event.toPromise(Event.once(editorService.onDidActiveEditorChange));
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
Doing `code <file>` from integrated terminal in portable mode uses wrong user data
Does this issue occur when all extensions are disabled?: No

<!-- 🪓 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.74.2
- OS Version:  Arch with Linux v6.1.3

Steps to Reproduce:
1. Open VS Code in portable mode (VSCODE_PORTABLE env var set to a directory)
2. Open a file in the instance by typing `code <file>` in the integrated terminal.
3. VS Code opens a new window rather than opening the file as a tab, and the new window reads userdata from `~/.vscode` instead of "$VSCODE_PORTABLE".

Possible solution:
I investigated and noticed that the integrated terminal in VS Code reads the `VSCODE_PORTABLE` env var as unset even if it is set by the OS. As a workaround, I have added this to my config, and it works:
```
	"terminal.integrated.env.linux": { "VSCODE_PORTABLE": "${env:VSCODE_PORTABLE}" },
```



Discussion:
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.3. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!
Happens on the latest version as well:

![image](https://user-images.githubusercontent.com/31820255/212296920-9952436c-e2fd-4386-b3c7-ca5196fdcd5c.png)
Oh if we just need `VSCODE_PORTABLE` set for this to work I can remove that from the env sanitization.

Resolving patch:
diff --git a/src/vs/base/common/processes.ts b/src/vs/base/common/processes.ts
--- a/src/vs/base/common/processes.ts
+++ b/src/vs/base/common/processes.ts
@@ -108,7 +108,7 @@ export function sanitizeProcessEnvironment(env: IProcessEnvironment, ...preserve
 	}, {} as Record<string, boolean>);
 	const keysToRemove = [
 		/^ELECTRON_.+$/,
-		/^VSCODE_(?!SHELL_LOGIN).+$/,
+		/^VSCODE_(?!(PORTABLE|SHELL_LOGIN)).+$/,
 		/^SNAP(|_.*)$/,
 		/^GDK_PIXBUF_.+$/,
 	];


Test patch:
diff --git a/src/vs/base/test/common/processes.test.ts b/src/vs/base/test/common/processes.test.ts
--- a/src/vs/base/test/common/processes.test.ts
+++ b/src/vs/base/test/common/processes.test.ts
@@ -19,7 +19,7 @@ suite('Processes', () => {
 			VSCODE_DEV: 'x',
 			VSCODE_IPC_HOOK: 'x',
 			VSCODE_NLS_CONFIG: 'x',
-			VSCODE_PORTABLE: 'x',
+			VSCODE_PORTABLE: '3',
 			VSCODE_PID: 'x',
 			VSCODE_SHELL_LOGIN: '1',
 			VSCODE_CODE_CACHE_PATH: 'x',
@@ -30,6 +30,7 @@ suite('Processes', () => {
 		processes.sanitizeProcessEnvironment(env);
 		assert.strictEqual(env['FOO'], 'bar');
 		assert.strictEqual(env['VSCODE_SHELL_LOGIN'], '1');
-		assert.strictEqual(Object.keys(env).length, 2);
+		assert.strictEqual(env['VSCODE_PORTABLE'], '3');
+		assert.strictEqual(Object.keys(env).length, 3);
 	});
 });
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
Dispose the Throttler in ThrottledDelayer
Followup from https://github.com/microsoft/vscode/pull/185688- the Throttler in ThrottledDelayer should also be disposed, but I will wait for debt week to do this


Discussion:

Resolving patch:
diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts
--- a/src/vs/base/common/async.ts
+++ b/src/vs/base/common/async.ts
@@ -417,6 +417,7 @@ export class ThrottledDelayer<T> {
 
 	dispose(): void {
 		this.delayer.dispose();
+		this.throttler.dispose();
 	}
 }
 


Test patch:
diff --git a/src/vs/base/test/common/async.test.ts b/src/vs/base/test/common/async.test.ts
--- a/src/vs/base/test/common/async.test.ts
+++ b/src/vs/base/test/common/async.test.ts
@@ -255,6 +255,12 @@ suite('Async', () => {
 					// OK
 				}
 			});
+
+			test('trigger after dispose throws', async () => {
+				const throttledDelayer = new async.ThrottledDelayer<void>(100);
+				throttledDelayer.dispose();
+				await assert.rejects(() => throttledDelayer.trigger(async () => { }, 0));
+			});
 		});
 
 		test('simple cancel', function () {
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
[Outdated] Color hints may display twice at view edges with line wrap
    With &#x60;"editor.wordWrap": "on"&#x60;, the color hints (inline color decorators) may be double-displayed near the wrapped view edges.

&#x2D;---

Version: 1.75.1
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0
Embedder: github.dev

<!-- generated by web issue reporter -->


Discussion:
Can you share a screenshot?
<img src="https://user-images.githubusercontent.com/81106051/222521417-58651c0a-e873-4a92-99f7-f08a82747b38.png" alt="https://github.dev/MasterInQuestion/Markup/blob/main/Verbose.htm" />


Resolving patch:
diff --git a/src/vs/editor/common/viewModel/modelLineProjection.ts b/src/vs/editor/common/viewModel/modelLineProjection.ts
--- a/src/vs/editor/common/viewModel/modelLineProjection.ts
+++ b/src/vs/editor/common/viewModel/modelLineProjection.ts
@@ -193,7 +193,7 @@ class ModelLineProjection implements IModelLineProjection {
 						if (options.inlineClassName) {
 							const offset = (outputLineIndex > 0 ? lineBreakData.wrappedTextIndentLength : 0);
 							const start = offset + Math.max(injectedTextStartOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, 0);
-							const end = offset + Math.min(injectedTextEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections);
+							const end = offset + Math.min(injectedTextEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections);
 							if (start !== end) {
 								inlineDecorations.push(new SingleLineInlineDecoration(start, end, options.inlineClassName, options.inlineClassNameAffectsLetterSpacing!));
 							}


Test patch:
diff --git a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
--- a/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
+++ b/src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts
@@ -921,7 +921,7 @@ suite('SplitLinesCollection', () => {
 				})),
 				[
 					{ inlineDecorations: [{ startOffset: 8, endOffset: 23 }] },
-					{ inlineDecorations: [{ startOffset: 4, endOffset: 42 }] },
+					{ inlineDecorations: [{ startOffset: 4, endOffset: 30 }] },
 					{ inlineDecorations: [{ startOffset: 4, endOffset: 16 }] },
 					{ inlineDecorations: undefined },
 					{ inlineDecorations: undefined },
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
Diff Editor V2: No Notification When Document Has Only Whitespace Change
Verification steps:
Make sure you are on diff editor version 2. Enable whitespace only diffing (the reversed P in the toolbar). Diff two identical documents, change indentation.
Verify that a notification is shown.


Discussion:

Resolving patch:
diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts
--- a/src/vs/base/common/event.ts
+++ b/src/vs/base/common/event.ts
@@ -682,6 +682,7 @@ export namespace Event {
 				}
 			};
 			observable.addObserver(observer);
+			observable.reportChanges();
 			return {
 				dispose() {
 					observable.removeObserver(observer);


Test patch:
diff --git a/src/vs/base/test/common/observable.test.ts b/src/vs/base/test/common/observable.test.ts
--- a/src/vs/base/test/common/observable.test.ts
+++ b/src/vs/base/test/common/observable.test.ts
@@ -4,7 +4,7 @@
  *--------------------------------------------------------------------------------------------*/
 
 import * as assert from 'assert';
-import { Emitter } from 'vs/base/common/event';
+import { Emitter, Event } from 'vs/base/common/event';
 import { ISettableObservable, autorun, derived, ITransaction, observableFromEvent, observableValue, transaction, keepAlive } from 'vs/base/common/observable';
 import { BaseObservable, IObservable, IObserver } from 'vs/base/common/observableImpl/base';
 
@@ -962,6 +962,36 @@ suite('observables', () => {
 			myObservable2.set(1, tx);
 		});
 	});
+
+	test('bug: fromObservableLight doesnt subscribe', () => {
+		const log = new Log();
+		const myObservable = new LoggingObservableValue('myObservable', 0, log);
+
+		const myDerived = derived('myDerived', reader => {
+			const val = myObservable.read(reader);
+			log.log(`myDerived.computed(myObservable2: ${val})`);
+			return val % 10;
+		});
+
+		const e = Event.fromObservableLight(myDerived);
+		log.log('event created');
+		e(() => {
+			log.log('event fired');
+		});
+
+		myObservable.set(1, undefined);
+
+		assert.deepStrictEqual(log.getAndClearEntries(), [
+			'event created',
+			'myObservable.firstObserverAdded',
+			'myObservable.get',
+			'myDerived.computed(myObservable2: 0)',
+			'myObservable.set (value 1)',
+			'myObservable.get',
+			'myDerived.computed(myObservable2: 1)',
+			'event fired',
+		]);
+	});
 });
 
 export class LoggingObserver implements IObserver {
Repository: microsoft/vscode (TypeScript) — Testing

Issue:
Investigate why #189096 was not discovered by tests
Investigate why #189096 was not discovered by tests.


Discussion:

Resolving patch:
diff --git a/src/vs/base/common/observableImpl/autorun.ts b/src/vs/base/common/observableImpl/autorun.ts
--- a/src/vs/base/common/observableImpl/autorun.ts
+++ b/src/vs/base/common/observableImpl/autorun.ts
@@ -128,12 +128,13 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
 
 		this.state = AutorunState.upToDate;
 
-		getLogger()?.handleAutorunTriggered(this);
-
 		try {
-			const changeSummary = this.changeSummary!;
-			this.changeSummary = this.createChangeSummary?.();
-			this.runFn(this, changeSummary);
+			if (!this.disposed) {
+				getLogger()?.handleAutorunTriggered(this);
+				const changeSummary = this.changeSummary!;
+				this.changeSummary = this.createChangeSummary?.();
+				this.runFn(this, changeSummary);
+			}
 		} finally {
 			// We don't want our observed observables to think that they are (not even temporarily) not being observed.
 			// Thus, we only unsubscribe from observables that are definitely not read anymore.


Test patch:
diff --git a/src/vs/base/test/common/observable.test.ts b/src/vs/base/test/common/observable.test.ts
--- a/src/vs/base/test/common/observable.test.ts
+++ b/src/vs/base/test/common/observable.test.ts
@@ -992,6 +992,29 @@ suite('observables', () => {
 			'event fired',
 		]);
 	});
+
+	test('dont run autorun after dispose', () => {
+		const log = new Log();
+		const myObservable = new LoggingObservableValue('myObservable', 0, log);
+
+		const d = autorun('update', reader => {
+			const v = myObservable.read(reader);
+			log.log('autorun, myObservable:' + v);
+		});
+
+		transaction(tx => {
+			myObservable.set(1, tx);
+			d.dispose();
+		});
+
+		assert.deepStrictEqual(log.getAndClearEntries(), [
+			'myObservable.firstObserverAdded',
+			'myObservable.get',
+			'autorun, myObservable:0',
+			'myObservable.set (value 1)',
+			'myObservable.lastObserverRemoved',
+		]);
+	});
 });
 
 export class LoggingObserver implements IObserver {
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
Powerline symbols should not be included in links
When using a powerline prompt:

![image](https://github.com/microsoft/vscode/assets/2193314/9a58da15-8354-4e7e-a74c-9da6633bd85a)

We should not be allowing the powerline symbols to be links (ctrl+hover):

![image](https://github.com/microsoft/vscode/assets/2193314/d8c7bec8-47cd-44ba-b798-968f4be0bd3a)

Running the open detected links command is the clearest way to see this:
 
![image](https://github.com/microsoft/vscode/assets/2193314/e8455eb2-a6d3-406f-9a7f-3b0ffa884865)



Discussion:

Resolving patch:
diff --git a/src/vs/workbench/contrib/terminalContrib/links/browser/terminalWordLinkDetector.ts b/src/vs/workbench/contrib/terminalContrib/links/browser/terminalWordLinkDetector.ts
--- a/src/vs/workbench/contrib/terminalContrib/links/browser/terminalWordLinkDetector.ts
+++ b/src/vs/workbench/contrib/terminalContrib/links/browser/terminalWordLinkDetector.ts
@@ -127,6 +127,10 @@ export class TerminalWordLinkDetector extends Disposable implements ITerminalLin
 
 	private _refreshSeparatorCodes(): void {
 		const separators = this._configurationService.getValue<ITerminalConfiguration>(TERMINAL_CONFIG_SECTION).wordSeparators;
-		this._separatorRegex = new RegExp(`[${escapeRegExpCharacters(separators)}]`, 'g');
+		let powerlineSymbols = '';
+		for (let i = 0xe0b0; i <= 0xe0bf; i++) {
+			powerlineSymbols += String.fromCharCode(i);
+		}
+		this._separatorRegex = new RegExp(`[${escapeRegExpCharacters(separators)}${powerlineSymbols}]`, 'g');
 	}
 }


Test patch:
diff --git a/src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalWordLinkDetector.test.ts b/src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalWordLinkDetector.test.ts
--- a/src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalWordLinkDetector.test.ts
+++ b/src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalWordLinkDetector.test.ts
@@ -72,6 +72,14 @@ suite('Workbench - TerminalWordLinkDetector', () => {
 		});
 	});
 
+	suite('should ignore powerline symbols', () => {
+		for (let i = 0xe0b0; i <= 0xe0bf; i++) {
+			test(`\\u${i.toString(16)}`, async () => {
+				await assertLink(`${String.fromCharCode(i)}foo${String.fromCharCode(i)}`, [{ range: [[2, 1], [4, 1]], text: 'foo' }]);
+			});
+		}
+	});
+
 	// These are failing - the link's start x is 1 px too far to the right bc it starts
 	// with a wide character, which the terminalLinkHelper currently doesn't account for
 	test.skip('should support wide characters', async () => {
Repository: microsoft/vscode (TypeScript) — Bug Fix

Issue:
focusing a task terminal tab removes its status
1. run a task, like `VS Code - Build`
2. click on the terminal tab for one of the task terminals
3. 🐛 the status is gone


Discussion:

Resolving patch:
diff --git a/src/vs/workbench/contrib/terminal/browser/terminalStatusList.ts b/src/vs/workbench/contrib/terminal/browser/terminalStatusList.ts
--- a/src/vs/workbench/contrib/terminal/browser/terminalStatusList.ts
+++ b/src/vs/workbench/contrib/terminal/browser/terminalStatusList.ts
@@ -70,7 +70,9 @@ export class TerminalStatusList extends Disposable implements ITerminalStatusLis
 		let result: ITerminalStatus | undefined;
 		for (const s of this._statuses.values()) {
 			if (!result || s.severity >= result.severity) {
-				result = s;
+				if (s.icon || !result?.icon) {
+					result = s;
+				}
 			}
 		}
 		return result;


Test patch:
diff --git a/src/vs/workbench/contrib/terminal/test/browser/terminalStatusList.test.ts b/src/vs/workbench/contrib/terminal/test/browser/terminalStatusList.test.ts
--- a/src/vs/workbench/contrib/terminal/test/browser/terminalStatusList.test.ts
+++ b/src/vs/workbench/contrib/terminal/test/browser/terminalStatusList.test.ts
@@ -92,14 +92,19 @@ suite('Workbench - TerminalStatusList', () => {
 	});
 
 	test('onDidChangePrimaryStatus', async () => {
-		const result = await new Promise<ITerminalStatus>(r => {
-			store.add(list.onDidRemoveStatus(r));
+		const result = await new Promise<ITerminalStatus | undefined>(r => {
+			store.add(list.onDidChangePrimaryStatus(r));
 			list.add({ id: 'test', severity: Severity.Info });
-			list.remove('test');
 		});
 		deepStrictEqual(result, { id: 'test', severity: Severity.Info });
 	});
 
+	test('primary is not updated to status without an icon', async () => {
+		list.add({ id: 'test', severity: Severity.Info, icon: Codicon.check });
+		list.add({ id: 'warning', severity: Severity.Warning });
+		deepStrictEqual(list.primary, { id: 'test', severity: Severity.Info, icon: Codicon.check });
+	});
+
 	test('add', () => {
 		statusesEqual(list, []);
 		list.add({ id: 'info', severity: Severity.Info });
Repository: mui/material-ui (TypeScript) — Bug Fix

Issue:
MenuItem doesn't respect focusVisibleClassName
Related to #10976. 

The changes in #10976 work awesome for the `Switch`, however it looks like the `MenuItem`'s `focusVisibleClassName` prop doesn't work as expected. Passing a `focusVisibleClassName` to the item works great from a typing perspective, but they don't seem to be applied to the `ListItem` correctly.

Example: https://codesandbox.io/s/5638ox58n 


Discussion:
@ianschmitz Correct, we need to merge the classnames in
https://github.com/mui-org/material-ui/blob/e99f23e85f9f0241a08165b435cd4d51f696ac12/packages/material-ui/src/ListItem/ListItem.js#L108

Resolving patch:
diff --git a/packages/material-ui/src/ListItem/ListItem.js b/packages/material-ui/src/ListItem/ListItem.js
--- a/packages/material-ui/src/ListItem/ListItem.js
+++ b/packages/material-ui/src/ListItem/ListItem.js
@@ -78,6 +78,7 @@ class ListItem extends React.Component {
       disabled,
       disableGutters,
       divider,
+      focusVisibleClassName,
       ...other
     } = this.props;
 
@@ -105,7 +106,10 @@ class ListItem extends React.Component {
 
     if (button) {
       componentProps.component = componentProp || 'div';
-      componentProps.focusVisibleClassName = classes.focusVisible;
+      componentProps.focusVisibleClassName = classNames(
+        classes.focusVisible,
+        focusVisibleClassName,
+      );
       Component = ButtonBase;
     }
 
@@ -186,6 +190,10 @@ ListItem.propTypes = {
    * If `true`, a 1px light border is added to the bottom of the list item.
    */
   divider: PropTypes.bool,
+  /**
+   * @ignore
+   */
+  focusVisibleClassName: PropTypes.string,
 };
 
 ListItem.defaultProps = {


Test patch:
diff --git a/packages/material-ui/src/ListItem/ListItem.test.js b/packages/material-ui/src/ListItem/ListItem.test.js
--- a/packages/material-ui/src/ListItem/ListItem.test.js
+++ b/packages/material-ui/src/ListItem/ListItem.test.js
@@ -158,4 +158,15 @@ describe('<ListItem />', () => {
       assert.strictEqual(wrapper.hasClass('bubu'), true);
     });
   });
+
+  describe('prop: focusVisibleClassName', () => {
+    it('should merge the class names', () => {
+      const wrapper = shallow(<ListItem button focusVisibleClassName="focusVisibleClassName" />);
+      assert.strictEqual(wrapper.props().component, 'div');
+      assert.strictEqual(
+        wrapper.props().focusVisibleClassName,
+        `${classes.focusVisible} focusVisibleClassName`,
+      );
+    });
+  });
 });
Repository: mui/material-ui (TypeScript) — Bug Fix

Issue:
[Popover] Centering issue with scrollable
See https://codesandbox.io/s/n9nvnqlx74 for an example.
It only breaks if the browser uses static scrollbars (not those invisible ones like on OSX)

## Expected Behavior
Popover should be properly centered

## Current Behavior
Popover is slightly offset to the right

![image](https://user-images.githubusercontent.com/6547794/41227809-6c45bb6a-6d76-11e8-996a-b6f9fc353623.png)

## Steps to Reproduce (for bugs)
Open https://codesandbox.io/s/n9nvnqlx74 and click the button




Discussion:
At least, the white part is centered 🙈.
Not really - I don't see it aligning on the right side 😕 

Resolving patch:
diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js
--- a/packages/material-ui/src/Popover/Popover.js
+++ b/packages/material-ui/src/Popover/Popover.js
@@ -124,8 +124,8 @@ class Popover extends React.Component {
     // Check if the parent has requested anchoring on an inner content node
     const contentAnchorOffset = this.getContentAnchorOffset(element);
     const elemRect = {
-      width: element.clientWidth,
-      height: element.clientHeight,
+      width: element.offsetWidth,
+      height: element.offsetHeight,
     };
 
     // Get the transform origin point on the element itself


Test patch:
diff --git a/packages/material-ui/src/Popover/Popover.test.js b/packages/material-ui/src/Popover/Popover.test.js
--- a/packages/material-ui/src/Popover/Popover.test.js
+++ b/packages/material-ui/src/Popover/Popover.test.js
@@ -657,7 +657,7 @@ describe('<Popover />', () => {
 
         instance.getTransformOriginValue = stub().returns(true);
 
-        element = { clientHeight: 0, clientWidth: 0 };
+        element = { offsetHeight: 0, offsetWidth: 0 };
       });
 
       after(() => {
Repository: mui/material-ui (TypeScript) — Bug Fix

Issue:
Cannot convert undefined or null to object
After a migration to the 3.6.1 version and when I open a Modal. I have the following error:

![errorlog](https://user-images.githubusercontent.com/9904165/49368135-411eff80-f6ee-11e8-9d46-c547c0872e1a.png)

`data.style is undefined`

![error](https://user-images.githubusercontent.com/9904165/49368051-1765d880-f6ee-11e8-8e1d-3c60d5674208.png)

I think wee need to check if `data.style` exists or not (?)
 
- [x] This is not a v0.x issue. <!-- (v0.x is no longer maintained) -->
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Your Environment 🌎

| Tech         | Version |
|--------------|---------|
| Material-UI  | v3.6.1  |
| React        |    16.6.3     |
| Browser      |         |
| TypeScript   |         |
| etc.         |         |



Discussion:

Resolving patch:
diff --git a/packages/material-ui/src/Modal/ModalManager.js b/packages/material-ui/src/Modal/ModalManager.js
--- a/packages/material-ui/src/Modal/ModalManager.js
+++ b/packages/material-ui/src/Modal/ModalManager.js
@@ -50,9 +50,12 @@ function setContainerStyle(data) {
 }
 
 function removeContainerStyle(data) {
-  Object.keys(data.style).forEach(key => {
-    data.container.style[key] = data.style[key];
-  });
+  // The modal might be closed before it had the chance to be mounted in the DOM.
+  if (data.style) {
+    Object.keys(data.style).forEach(key => {
+      data.container.style[key] = data.style[key];
+    });
+  }
 
   const fixedNodes = ownerDocument(data.container).querySelectorAll('.mui-fixed');
   for (let i = 0; i < fixedNodes.length; i += 1) {


Test patch:
diff --git a/packages/material-ui/src/Modal/Modal.test.js b/packages/material-ui/src/Modal/Modal.test.js
--- a/packages/material-ui/src/Modal/Modal.test.js
+++ b/packages/material-ui/src/Modal/Modal.test.js
@@ -541,4 +541,27 @@ describe('<Modal />', () => {
       assert.strictEqual(document.body.style.overflow, '');
     });
   });
+
+  it('should support open abort', () => {
+    class TestCase extends React.Component {
+      state = {
+        open: true,
+      };
+
+      componentDidMount() {
+        this.setState({
+          open: false,
+        });
+      }
+
+      render() {
+        return (
+          <Modal open={this.state.open}>
+            <div>Hello</div>
+          </Modal>
+        );
+      }
+    }
+    mount(<TestCase />);
+  });
 });
Repository: mui/material-ui (TypeScript) — Bug Fix

Issue:
[Tooltip] Suppress "disabled button" console warning when tooltip is controlled
<!-- Checked checkbox should look like this: [x] -->
- [x] This is not a v0.x issue. <!-- (v0.x is no longer maintained) -->
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Expected Behavior 🤔
When a Tooltip is controlled and has a disabled button as child, this should not raise a warning.

## Current Behavior 😯
There is a "disabled button" warning in both controlled and uncontrolled Tooltips.

## Context 🔦
The warning is valid when the Tooltip is uncontrolled, as it needs the button events to control its visibility.

In a controlled tooltip, having a disabled button child shouldn't be a problem, as its events do not control the Tooltip visibility.

While wrapping a `<div>` around the button circumvents the warning, this is not always an option: In Labs/SpeedDialAction the `<Tooltip><Button></Tooltip>` structure is hardcoded. See #15216 


Discussion:

Resolving patch:
diff --git a/packages/material-ui/src/Tooltip/Tooltip.js b/packages/material-ui/src/Tooltip/Tooltip.js
--- a/packages/material-ui/src/Tooltip/Tooltip.js
+++ b/packages/material-ui/src/Tooltip/Tooltip.js
@@ -91,6 +91,7 @@ class Tooltip extends React.Component {
   componentDidMount() {
     warning(
       !this.childrenRef.disabled ||
+        (this.childrenRef.disabled && this.isControlled) ||
         (this.childrenRef.disabled && this.props.title === '') ||
         this.childrenRef.tagName.toLowerCase() !== 'button',
       [


Test patch:
diff --git a/packages/material-ui/src/Tooltip/Tooltip.test.js b/packages/material-ui/src/Tooltip/Tooltip.test.js
--- a/packages/material-ui/src/Tooltip/Tooltip.test.js
+++ b/packages/material-ui/src/Tooltip/Tooltip.test.js
@@ -254,11 +254,11 @@ describe('<Tooltip />', () => {
   });
 
   describe('disabled button warning', () => {
-    before(() => {
+    beforeEach(() => {
       consoleErrorMock.spy();
     });
 
-    after(() => {
+    afterEach(() => {
       consoleErrorMock.reset();
     });
 
@@ -273,7 +273,7 @@ describe('<Tooltip />', () => {
       assert.strictEqual(consoleErrorMock.callCount(), 0, 'should not call console.error');
     });
 
-    it('should raise a warning when we can listen to events', () => {
+    it('should raise a warning when we are uncontrolled and can not listen to events', () => {
       mount(
         <Tooltip title="Hello World">
           <button type="submit" disabled>
@@ -287,6 +287,17 @@ describe('<Tooltip />', () => {
         /Material-UI: you are providing a disabled `button` child to the Tooltip component/,
       );
     });
+
+    it('should not raise a warning when we are controlled', () => {
+      mount(
+        <Tooltip title="Hello World" open>
+          <button type="submit" disabled>
+            Hello World
+          </button>
+        </Tooltip>,
+      );
+      assert.strictEqual(consoleErrorMock.callCount(), 0);
+    });
   });
 
   describe('prop: interactive', () => {
Repository: mui/material-ui (TypeScript) — Bug Fix

Issue:
Regression: <Select native id="my-id"> No Longer Has an Id
The "id" prop is ignored for \<Select\>'s that have the "native" prop set.

At some point in the past (maybe a few versions ago) this use to work.

- [x] The issue is present in the latest release.
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Steps to Reproduce 🕹

1. Go to: https://codesandbox.io/s/create-react-app-u2uwe
2. In the console run `document.getElementById('select-id')`. Nothing will match showing the id isn't set.



Discussion:

Resolving patch:
diff --git a/packages/material-ui/src/Select/Select.js b/packages/material-ui/src/Select/Select.js
--- a/packages/material-ui/src/Select/Select.js
+++ b/packages/material-ui/src/Select/Select.js
@@ -69,7 +69,7 @@ const Select = React.forwardRef(function Select(props, ref) {
       type: undefined, // We render a select. We can ignore the type provided by the `Input`.
       multiple,
       ...(native
-        ? {}
+        ? { id }
         : {
             autoWidth,
             displayEmpty,


Test patch:
diff --git a/packages/material-ui/src/Select/Select.test.js b/packages/material-ui/src/Select/Select.test.js
--- a/packages/material-ui/src/Select/Select.test.js
+++ b/packages/material-ui/src/Select/Select.test.js
@@ -867,4 +867,23 @@ describe('<Select />', () => {
       expect(getByRole('button')).to.have.attribute('id', 'mui-component-select-foo');
     });
   });
+
+  describe('prop: native', () => {
+    it('renders a <select />', () => {
+      const { container } = render(<Select native />);
+
+      expect(container.querySelector('select')).not.to.be.null;
+    });
+
+    it('can be labelled with a <label />', () => {
+      const { getByLabelText } = render(
+        <React.Fragment>
+          <label htmlFor="select">A select</label>
+          <Select id="select" native />
+        </React.Fragment>,
+      );
+
+      expect(getByLabelText('A select')).to.have.property('tagName', 'SELECT');
+    });
+  });
 });