-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathRpcContracts.cs
More file actions
52 lines (45 loc) · 2 KB
/
RpcContracts.cs
File metadata and controls
52 lines (45 loc) · 2 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
using System.Collections.Generic;
using System.Threading.Tasks;
using CodingWithCalvin.MCPServer.Shared.Models;
namespace CodingWithCalvin.MCPServer.Shared;
/// <summary>
/// RPC interface for Visual Studio operations.
/// Implemented by VS extension, called by MCP server process.
/// </summary>
public interface IVisualStudioRpc
{
Task<SolutionInfo?> GetSolutionInfoAsync();
Task<bool> OpenSolutionAsync(string path);
Task CloseSolutionAsync(bool saveFirst);
Task<List<ProjectInfo>> GetProjectsAsync();
Task<List<DocumentInfo>> GetOpenDocumentsAsync();
Task<DocumentInfo?> GetActiveDocumentAsync();
Task<bool> OpenDocumentAsync(string path);
Task<bool> CloseDocumentAsync(string path, bool save);
Task<string?> ReadDocumentAsync(string path);
Task<bool> WriteDocumentAsync(string path, string content);
Task<SelectionInfo?> GetSelectionAsync();
Task<bool> SetSelectionAsync(string path, int startLine, int startColumn, int endLine, int endColumn);
Task<bool> InsertTextAsync(string text);
Task<bool> ReplaceTextAsync(string oldText, string newText);
Task<bool> GoToLineAsync(int line);
Task<List<FindResult>> FindAsync(string searchText, bool matchCase, bool wholeWord);
Task<bool> BuildSolutionAsync();
Task<bool> BuildProjectAsync(string projectName);
Task<bool> CleanSolutionAsync();
Task<bool> CancelBuildAsync();
Task<BuildStatus> GetBuildStatusAsync();
Task<List<SymbolInfo>> GetDocumentSymbolsAsync(string path);
Task<WorkspaceSymbolResult> SearchWorkspaceSymbolsAsync(string query, int maxResults = 100);
Task<DefinitionResult> GoToDefinitionAsync(string path, int line, int column);
Task<ReferencesResult> FindReferencesAsync(string path, int line, int column, int maxResults = 100);
}
/// <summary>
/// RPC interface for MCP Server operations.
/// Implemented by MCP server process, called by VS extension.
/// </summary>
public interface IServerRpc
{
Task<List<ToolInfo>> GetAvailableToolsAsync();
Task ShutdownAsync();
}