Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/mcp/src/automationTools/statusbar.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
7
import { ApplicationService } from '../application';
8
9
/**
10
* Status Bar Tools
11
*/
12
export function applyStatusBarTools(server: McpServer, appService: ApplicationService): RegisteredTool[] {
13
const tools: RegisteredTool[] = [];
14
15
// Seems too niche
16
// server.tool(
17
// 'vscode_automation_statusbar_wait_for_element',
18
// 'Wait for a specific status bar element to appear',
19
// {
20
// element: z.enum([
21
// 'BRANCH_STATUS',
22
// 'SYNC_STATUS',
23
// 'PROBLEMS_STATUS',
24
// 'SELECTION_STATUS',
25
// 'INDENTATION_STATUS',
26
// 'ENCODING_STATUS',
27
// 'EOL_STATUS',
28
// 'LANGUAGE_STATUS'
29
// ]).describe('Status bar element to wait for')
30
// },
31
// async (args) => {
32
// const { element } = args;
33
// // Map string to enum value
34
// const elementMap: Record<string, number> = {
35
// 'BRANCH_STATUS': 0,
36
// 'SYNC_STATUS': 1,
37
// 'PROBLEMS_STATUS': 2,
38
// 'SELECTION_STATUS': 3,
39
// 'INDENTATION_STATUS': 4,
40
// 'ENCODING_STATUS': 5,
41
// 'EOL_STATUS': 6,
42
// 'LANGUAGE_STATUS': 7
43
// };
44
45
// await app.workbench.statusbar.waitForStatusbarElement(elementMap[element]);
46
// return {
47
// content: [{
48
// type: 'text' as const,
49
// text: `Status bar element found: ${element}`
50
// }]
51
// };
52
// }
53
// );
54
55
// Playwright can probably figure this out
56
// server.tool(
57
// 'vscode_automation_statusbar_click',
58
// 'Click on a specific status bar element',
59
// {
60
// element: z.enum([
61
// 'BRANCH_STATUS',
62
// 'SYNC_STATUS',
63
// 'PROBLEMS_STATUS',
64
// 'SELECTION_STATUS',
65
// 'INDENTATION_STATUS',
66
// 'ENCODING_STATUS',
67
// 'EOL_STATUS',
68
// 'LANGUAGE_STATUS'
69
// ]).describe('Status bar element to click')
70
// },
71
// async (args) => {
72
// const { element } = args;
73
// // Map string to enum value
74
// const elementMap: Record<string, number> = {
75
// 'BRANCH_STATUS': 0,
76
// 'SYNC_STATUS': 1,
77
// 'PROBLEMS_STATUS': 2,
78
// 'SELECTION_STATUS': 3,
79
// 'INDENTATION_STATUS': 4,
80
// 'ENCODING_STATUS': 5,
81
// 'EOL_STATUS': 6,
82
// 'LANGUAGE_STATUS': 7
83
// };
84
85
// await app.workbench.statusbar.clickOn(elementMap[element]);
86
// return {
87
// content: [{
88
// type: 'text' as const,
89
// text: `Clicked status bar element: ${element}`
90
// }]
91
// };
92
// }
93
// );
94
95
// Seems too niche
96
// server.tool(
97
// 'vscode_automation_statusbar_wait_for_eol',
98
// 'Wait for a specific End of Line (EOL) type in the status bar',
99
// {
100
// eol: z.string().describe('EOL type to wait for (e.g., "LF", "CRLF")')
101
// },
102
// async (args) => {
103
// const { eol } = args;
104
// const result = await app.workbench.statusbar.waitForEOL(eol);
105
// return {
106
// content: [{
107
// type: 'text' as const,
108
// text: `EOL status found: ${result}`
109
// }]
110
// };
111
// }
112
// );
113
114
// Playwright can probably figure this out
115
// server.tool(
116
// 'vscode_automation_statusbar_wait_for_text',
117
// 'Wait for specific text to appear in a status bar element',
118
// {
119
// title: z.string().describe('Title/identifier of the status bar element'),
120
// text: z.string().describe('Text to wait for in the status bar element')
121
// },
122
// async (args) => {
123
// const { title, text } = args;
124
// await app.workbench.statusbar.waitForStatusbarText(title, text);
125
// return {
126
// content: [{
127
// type: 'text' as const,
128
// text: `Status bar text found - ${title}: "${text}"`
129
// }]
130
// };
131
// }
132
// );
133
134
return tools;
135
}
136
137