Add to the file mask: *.py, *.ipynb Pick Scope > Current File in Ctrl+Shift+F window. Works on 2024.1 Personal record for the easiest and fastest answer.
*.py, *.ipynb