( args: RunMainArgs, pythonEnv: PythonEnvironment, )
| 216 | } |
| 217 | |
| 218 | async function runMainFile( |
| 219 | args: RunMainArgs, |
| 220 | pythonEnv: PythonEnvironment, |
| 221 | ): Promise<void> { |
| 222 | const uri = parseUri(args.uri); |
| 223 | if (!uri) { |
| 224 | return; |
| 225 | } |
| 226 | const interpreter = await pythonEnv.getInterpreterPath(uri); |
| 227 | if (!interpreter) { |
| 228 | void showRunnableCodeLensError( |
| 229 | uri, |
| 230 | 'missing-interpreter', |
| 231 | 'Pyrefly could not determine a Python interpreter for this file. Ensure the correct interpreter is selected in your IDE before using runnable CodeLens.', |
| 232 | ); |
| 233 | return; |
| 234 | } |
| 235 | await executeProcessTask( |
| 236 | uri, |
| 237 | args.cwd, |
| 238 | {type: TASK_SOURCE, action: 'runMain'}, |
| 239 | 'Pyrefly: Run File', |
| 240 | interpreter, |
| 241 | [uri.fsPath], |
| 242 | ); |
| 243 | } |
| 244 | |
| 245 | async function runTestAtLocation( |
| 246 | args: RunTestArgs, |
no test coverage detected