Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,8 @@
"prettier": "3.6.2",
"typescript": "^5.8.3"
},
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
"dependencies": {
"jsonc-parser": "^3.3.1"
}
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/dataCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
getPlatform,
} from './utils/vscodeEnvironment';
import { VSCodeEdition, Platform } from './types/vscodeEdition';
import * as jsonc from 'jsonc-parser';

export class DataCollector {
public readonly vscodeEdition: VSCodeEdition;
Expand Down Expand Up @@ -101,7 +102,6 @@ export class DataCollector {
}

async getSettings(): Promise<SettingsExport> {
const config = vscode.workspace.getConfiguration();
const settings: SettingsExport = {};

// 获取用户设置
Expand Down Expand Up @@ -220,7 +220,7 @@ export class DataCollector {
const settingsPath = this.getUserSettingsPath();
if (fs.existsSync(settingsPath)) {
const content = fs.readFileSync(settingsPath, 'utf8');
return JSON.parse(content);
return jsonc.parse(content);
}
} catch (error) {
if (this.outputChannel) {
Expand All @@ -237,7 +237,7 @@ export class DataCollector {
const settingsPath = path.join(workspaceFolder.uri.fsPath, '.vscode', 'settings.json');
if (fs.existsSync(settingsPath)) {
const content = fs.readFileSync(settingsPath, 'utf8');
return JSON.parse(content);
return jsonc.parse(content);
}
}
} catch (error) {
Expand Down
Loading