33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import { types } from 'util' ;
67import { ConfigurationTarget , vscode , WorkspaceConfiguration } from '../vscodeAdapter' ;
78
89// Option in the array should be identical to each other, except the name.
@@ -65,6 +66,10 @@ export const migrateOptions = [
6566 omnisharpOption : 'csharp.testsCodeLens.enabled' ,
6667 roslynOption : 'dotnet.codeLens.enableTestsCodeLens' ,
6768 } ,
69+ {
70+ omnisharpOption : 'csharp.unitTestDebuggingOptions' ,
71+ roslynOption : 'dotnet.unitTestDebuggingOptions' ,
72+ } ,
6873] ;
6974
7075export async function MigrateOptions ( vscode : vscode ) : Promise < void > {
@@ -84,12 +89,25 @@ export async function MigrateOptions(vscode: vscode): Promise<void> {
8489 continue ;
8590 }
8691
87- if ( roslynOptionValue == inspectionValueOfRoslynOption . defaultValue ) {
92+ if ( shouldMove ( roslynOptionValue , inspectionValueOfRoslynOption . defaultValue ) ) {
8893 await MoveOptionsValue ( omnisharpOption , roslynOption , configuration ) ;
8994 }
9095 }
9196}
9297
98+ function shouldMove ( roslynOptionValue : unknown , defaultInspectValueOfRoslynOption : unknown ) : boolean {
99+ if ( roslynOptionValue == defaultInspectValueOfRoslynOption ) {
100+ return true ;
101+ }
102+
103+ // For certain kinds of complex object options, vscode will return a proxy object which isn't comparable to the default empty object {}.
104+ if ( types . isProxy ( roslynOptionValue ) ) {
105+ return JSON . stringify ( roslynOptionValue ) === JSON . stringify ( defaultInspectValueOfRoslynOption ) ;
106+ }
107+
108+ return false ;
109+ }
110+
93111async function MoveOptionsValue (
94112 fromOption : string ,
95113 toOption : string ,
0 commit comments