-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-sidebar.js
More file actions
83 lines (71 loc) · 3.28 KB
/
test-sidebar.js
File metadata and controls
83 lines (71 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Test script to verify sidebar configuration
const fs = require('fs');
const path = require('path');
console.log('🔍 Debugging sidebar configuration...\n');
const packageFile = path.join(__dirname, 'package.json');
if (fs.existsSync(packageFile)) {
const pkg = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
console.log('📦 Package.json analysis:');
// Check activation events
if (pkg.activationEvents) {
console.log('✅ Activation events:', pkg.activationEvents);
} else {
console.log('❌ No activation events found');
}
// Check viewsContainers
if (pkg.contributes && pkg.contributes.viewsContainers && pkg.contributes.viewsContainers.activitybar) {
const container = pkg.contributes.viewsContainers.activitybar[0];
console.log('✅ Activity bar container:');
console.log(` ID: ${container.id}`);
console.log(` Title: ${container.title}`);
console.log(` Icon: ${container.icon}`);
} else {
console.log('❌ No activity bar container found');
}
// Check views
if (pkg.contributes && pkg.contributes.views) {
const viewContainerName = Object.keys(pkg.contributes.views)[0];
const view = pkg.contributes.views[viewContainerName][0];
console.log('✅ View configuration:');
console.log(` Container: ${viewContainerName}`);
console.log(` View ID: ${view.id}`);
console.log(` View Name: ${view.name}`);
console.log(` View Type: ${view.type}`);
// Check if container ID matches view container
if (pkg.contributes.viewsContainers && pkg.contributes.viewsContainers.activitybar) {
const containerId = pkg.contributes.viewsContainers.activitybar[0].id;
if (containerId === viewContainerName) {
console.log('✅ Container ID matches view container name');
} else {
console.log(`❌ Container ID mismatch: ${containerId} vs ${viewContainerName}`);
}
}
} else {
console.log('❌ No views found');
}
console.log('\n🔧 Troubleshooting steps:');
console.log('1. Press F5 to launch Extension Development Host');
console.log('2. Check the Output panel > "AI Code Explanation" for logs');
console.log('3. Look for the comment-discussion icon in the Activity Bar');
console.log('4. If not visible, try reloading the Extension Development Host window');
console.log('5. Check VS Code Developer Tools (Help > Toggle Developer Tools) for errors');
} else {
console.log('❌ Package.json not found');
}
// Check if extension.ts exists and has proper registration
const extensionFile = path.join(__dirname, 'src', 'extension.ts');
if (fs.existsSync(extensionFile)) {
const content = fs.readFileSync(extensionFile, 'utf8');
if (content.includes('registerWebviewViewProvider')) {
console.log('✅ Webview provider registration found');
} else {
console.log('❌ Webview provider registration not found');
}
if (content.includes('CodeExplanationWebview.viewType')) {
console.log('✅ ViewType reference found');
} else {
console.log('❌ ViewType reference not found');
}
} else {
console.log('❌ Extension.ts not found');
}