MCPcopy Create free account
hub / github.com/facebook/pyrefly / showRunnableCodeLensError

Function showRunnableCodeLensError

lsp/src/codeLens.ts:110–134  ·  view source on GitHub ↗
(
  uri: vscode.Uri,
  kind: string,
  message: string,
)

Source from the content-addressed store, hash-verified

108}
109
110async function showRunnableCodeLensError(
111 uri: vscode.Uri,
112 kind: string,
113 message: string,
114): Promise<void> {
115 const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);
116 const errorKey = `${kind}:${workspaceFolder?.uri.toString() ?? 'workspace'}`;
117 if (shownRunnableCodeLensErrors.has(errorKey)) {
118 return;
119 }
120 shownRunnableCodeLensErrors.add(errorKey);
121 const action = await vscode.window.showErrorMessage(
122 message,
123 OPEN_RUNNABLE_CODE_LENS_SETTING,
124 DISABLE_RUNNABLE_CODE_LENS,
125 );
126 if (action === OPEN_RUNNABLE_CODE_LENS_SETTING) {
127 await vscode.commands.executeCommand(
128 'workbench.action.openSettings',
129 'python.pyrefly.runnableCodeLens',
130 );
131 } else if (action === DISABLE_RUNNABLE_CODE_LENS) {
132 await disableRunnableCodeLens(uri);
133 }
134}
135
136async function canImportModule(
137 interpreter: string,

Callers 2

runMainFileFunction · 0.85
runTestAtLocationFunction · 0.85

Calls 2

disableRunnableCodeLensFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected