Closed guzy0324 closed 5 months ago
Related issue https://github.com/mattickx/copilotignore-vscode/issues/5.
Looks good at first glance. Not able to publish right now. I'll take a look tomorrow and publish then. Thank you for your contribution @guzy0324
I found that this fix causes another ipynb bug. Each cell in a notebook is an visibleTextEditor. And when switching from a notebook to other files, the cell is still in visibleTextEditors. As a result, the copilot will stay disabled unless the notebook is closed.
I fix the new bug by using visibleNotebookEditors for ipynb files, filtering out cells in visibleTextEditors.
ipynb files have different uri format (https://github.com/microsoft/vscode/issues/97881#issue-618778392), which may be the reason why the
vscode.workspace.asRelativePath(editor.document.uri)
returns an absolute path instead of a relative path. Changingvscode.workspace.asRelativePath(editor.document.uri)
tovscode.workspace.asRelativePath(editor.document.fsPath)
simply fixes this bug.