|
2 | 2 | * Copyright (c) Microsoft Corporation. All rights reserved.
|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 |
| -import { commands, ExtensionContext, interactive, window, workspace, languages, modelSelection, env, csevents } from 'vscode'; |
| 5 | +import { commands, ExtensionContext, interactive, window, workspace, languages, modelSelection, env, csevents, Uri, Position } from 'vscode'; |
6 | 6 | import * as os from 'os';
|
7 | 7 | import * as http from 'http';
|
8 | 8 |
|
@@ -302,4 +302,47 @@ export async function activate(context: ExtensionContext) {
|
302 | 302 | );
|
303 | 303 | }
|
304 | 304 | });
|
| 305 | + |
| 306 | + |
| 307 | + // TODO(skcd): I promise to clean this up better, I am trying to see if things still |
| 308 | + // work if I wait here and check the diagnostics and if its working |
| 309 | + // await new Promise(resolve => setTimeout(resolve, 20000)); |
| 310 | + // // over here we will execute the code action provider |
| 311 | + // try { |
| 312 | + // const textDocumentUri = Uri.file('/Users/skcd/scratch/sidecar/sidecar/src/agentic/symbol/helpers.rs'); |
| 313 | + // // opens the text document as required |
| 314 | + // await workspace.openTextDocument(textDocumentUri); |
| 315 | + // const range = new vscode.Range(new Position(3, 24), new Position(3, 25)); |
| 316 | + // const codeActions: vscode.CodeAction[] = await commands.executeCommand( |
| 317 | + // 'vscode.executeCodeActionProvider', |
| 318 | + // textDocumentUri, |
| 319 | + // range, |
| 320 | + // ); |
| 321 | + // console.log('code actions worked'); |
| 322 | + // // lets see what happens over here |
| 323 | + // console.log(codeActions); |
| 324 | + // const firstCodeActionCommand = codeActions[1].command; |
| 325 | + // const firstCodeArguments = codeActions[1].command?.arguments; |
| 326 | + // try { |
| 327 | + // if (firstCodeActionCommand !== undefined && firstCodeArguments !== undefined) { |
| 328 | + // // console.log(firstCodeAction.command); |
| 329 | + // // console.log(firstCodeAction.arguments); |
| 330 | + // console.log(firstCodeArguments[0]); |
| 331 | + // const firstArgument = firstCodeArguments[0][0].arguments; |
| 332 | + // console.log(firstArgument); |
| 333 | + // const result = await commands.executeCommand('rust-analyzer.resolveCodeAction', firstArgument); |
| 334 | + // // const result = await commands.executeCommand(firstCodeActionCommand.command, ...firstCodeArguments); |
| 335 | + // console.log('sub results from result'); |
| 336 | + // console.log(result); |
| 337 | + // } else { |
| 338 | + // console.log('missing command'); |
| 339 | + // } |
| 340 | + // } catch (exception) { |
| 341 | + // console.log(exception); |
| 342 | + // } |
| 343 | + // // await commands.executeCommand(codeActions[0].command, ...codeActions[1].arguments); |
| 344 | + // } catch (exception) { |
| 345 | + // console.log('code action execution error'); |
| 346 | + // console.error(exception); |
| 347 | + // } |
305 | 348 | }
|
0 commit comments