Skip to content

Commit 58718c9

Browse files
authored
Update pandas detection. (microsoft#188113)
1 parent df22ab1 commit 58718c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,14 @@ export class NotebookEditorSimpleWorker implements IRequestHandler, IDisposable
286286
continue;
287287
}
288288

289+
if (cell.language !== 'python') {
290+
continue;
291+
}
292+
289293
const lineCount = cell.textBuffer.getLineCount();
290294
const maxLineCount = Math.min(lineCount, 20);
291295
const range = new Range(1, 1, maxLineCount, cell.textBuffer.getLineLength(maxLineCount) + 1);
292-
const searchParams = new SearchParams('import\\s*pandas', true, false, null);
296+
const searchParams = new SearchParams('import\\s*pandas|from\\s*pandas', true, false, null);
293297
const searchData = searchParams.parseSearchRequest();
294298

295299
if (!searchData) {

0 commit comments

Comments
 (0)