@@ -17,6 +17,7 @@ import {
1717 getPlatform ,
1818} from './utils/vscodeEnvironment' ;
1919import { VSCodeEdition , Platform } from './types/vscodeEdition' ;
20+ import * as jsonc from 'jsonc-parser' ;
2021
2122export class DataCollector {
2223 public readonly vscodeEdition : VSCodeEdition ;
@@ -101,7 +102,6 @@ export class DataCollector {
101102 }
102103
103104 async getSettings ( ) : Promise < SettingsExport > {
104- const config = vscode . workspace . getConfiguration ( ) ;
105105 const settings : SettingsExport = { } ;
106106
107107 // 获取用户设置
@@ -220,7 +220,7 @@ export class DataCollector {
220220 const settingsPath = this . getUserSettingsPath ( ) ;
221221 if ( fs . existsSync ( settingsPath ) ) {
222222 const content = fs . readFileSync ( settingsPath , 'utf8' ) ;
223- return JSON . parse ( content ) ;
223+ return jsonc . parse ( content ) ;
224224 }
225225 } catch ( error ) {
226226 if ( this . outputChannel ) {
@@ -237,7 +237,7 @@ export class DataCollector {
237237 const settingsPath = path . join ( workspaceFolder . uri . fsPath , '.vscode' , 'settings.json' ) ;
238238 if ( fs . existsSync ( settingsPath ) ) {
239239 const content = fs . readFileSync ( settingsPath , 'utf8' ) ;
240- return JSON . parse ( content ) ;
240+ return jsonc . parse ( content ) ;
241241 }
242242 }
243243 } catch ( error ) {
0 commit comments