(
context: vscode.ExtensionContext,
server: OmniSharpServer,
platformInfo: PlatformInformation,
eventStream: EventStream,
monoResolver: IHostExecutableResolver,
dotnetResolver: IHostExecutableResolver,
workspaceInformationProvider: IWorkspaceDebugInformationProvider,
outputChannel: vscode.OutputChannel
)
| 29 | import { IWorkspaceDebugInformationProvider } from '../../shared/IWorkspaceDebugInformationProvider'; |
| 30 | |
| 31 | export default function registerCommands( |
| 32 | context: vscode.ExtensionContext, |
| 33 | server: OmniSharpServer, |
| 34 | platformInfo: PlatformInformation, |
| 35 | eventStream: EventStream, |
| 36 | monoResolver: IHostExecutableResolver, |
| 37 | dotnetResolver: IHostExecutableResolver, |
| 38 | workspaceInformationProvider: IWorkspaceDebugInformationProvider, |
| 39 | outputChannel: vscode.OutputChannel |
| 40 | ): CompositeDisposable { |
| 41 | const disposable = new CompositeDisposable(); |
| 42 | disposable.add(vscode.commands.registerCommand('o.restart', async () => restartOmniSharp(context, server))); |
| 43 | disposable.add(vscode.commands.registerCommand('o.pickProjectAndStart', async () => pickProjectAndStart(server))); |
| 44 | disposable.add(vscode.commands.registerCommand('o.showOutput', () => eventStream.post(new ShowOmniSharpChannel()))); |
| 45 | |
| 46 | disposable.add( |
| 47 | vscode.commands.registerCommand('dotnet.restore.project', async () => |
| 48 | pickProjectAndDotnetRestore(server, eventStream) |
| 49 | ) |
| 50 | ); |
| 51 | disposable.add( |
| 52 | vscode.commands.registerCommand('dotnet.restore.all', async () => dotnetRestoreAllProjects(server, eventStream)) |
| 53 | ); |
| 54 | |
| 55 | disposable.add( |
| 56 | vscode.commands.registerCommand('o.reanalyze.allProjects', async () => reAnalyzeAllProjects(server)) |
| 57 | ); |
| 58 | disposable.add( |
| 59 | vscode.commands.registerCommand('o.reanalyze.currentProject', async () => reAnalyzeCurrentProject(server)) |
| 60 | ); |
| 61 | |
| 62 | // Register command for generating tasks.json and launch.json assets. |
| 63 | disposable.add( |
| 64 | vscode.commands.registerCommand('dotnet.generateAssets', async (selectedIndex) => |
| 65 | generateAssets(workspaceInformationProvider, selectedIndex) |
| 66 | ) |
| 67 | ); |
| 68 | |
| 69 | disposable.add( |
| 70 | vscode.commands.registerCommand('csharp.reportIssue', async () => { |
| 71 | const logOutputChannel = isLogOutputChannel(outputChannel); |
| 72 | return reportIssue( |
| 73 | context, |
| 74 | getDotnetInfo, |
| 75 | platformInfo.isValidPlatformForMono(), |
| 76 | logOutputChannel ? [logOutputChannel] : [], |
| 77 | dotnetResolver, |
| 78 | monoResolver |
| 79 | ); |
| 80 | }) |
| 81 | ); |
| 82 | |
| 83 | return new CompositeDisposable(disposable); |
| 84 | } |
| 85 | |
| 86 | function isLogOutputChannel(channel: vscode.OutputChannel): vscode.LogOutputChannel | undefined { |
| 87 | const anyChannel = channel as any; |
no test coverage detected