-
Notifications
You must be signed in to change notification settings - Fork 108
assistant: fix copilot inline completions for ipynb #8498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
E2E Tests 🚀 |
return true; // No glob patterns configured, so completions are enabled | ||
} | ||
|
||
// Check all of the glob patterns and return true if any match | ||
// Check all of the glob patterns and return false if any match | ||
for (const pattern of globPattern) { | ||
if (glob.match(pattern, uri.path)) { | ||
return true; // File matches an exclusion pattern | ||
return false; // File matches an exclusion pattern, so it is excluded from completions | ||
} | ||
} | ||
|
||
return false; // No patterns matched, so the file is not excluded | ||
return true; // No patterns matched, so completions are enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I saw the name of the function areCompletionsEnabled
, I expected the function to return true when no globs are provided or matched, but this was returning the opposite.
I inverted the logic here so that the returned value aligns with the function name. Somehow, this seems to resolve the issue with ipynb?? 🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't get completions in notebooks. It logs an error in the console about the file URI.
ERR Document for URI could not be found: vscode-notebook-cell:/Users/tmok/source/test/Python/notebook.ipynb#W0sZmlsZQ%3D%3D: Error: Document for URI could not be found: vscode-notebook-cell:/Users/tmok/source/test/Python/notebook.ipynb#W0sZmlsZQ%3D%3D
Ah I see this error too, but I was signed into both Copilot and Gemini for completions. The completions appeared to work for me, but actually Copilot completions are not working, while Gemini completions seem to be all good. Investigating the Copilot completions issue... 🔎 |
This requires more involved investigation than initially thought. I'm going to pause on this while I take a look at some higher priority items. Kicking to Draft -- I'll let you know when this is ready again. Some notes in the meantime:
Console logs with some notes from myself and Wasim (ty!) // debug print right after line 236
*** debug log *** inlineCompletion params: {"context":{"triggerKind":1},"textDocument":{"uri":"vscode-notebook-cell:/Users/sashimi/qa-example-content/workspaces/large_py_notebook/spotify.ipynb#W0sZmlsZQ%3D%3D"},"position":{"line":12,"character":4}} (at console.<anonymous> (file:///Users/sashimi/dev/positron-dev/out/vs/workbench/api/common/extHostConsoleForwarder.js:45:22))
log.ts:464
// error message at line 237, we don't get to a debug print right after line 237
ERR Document for URI could not be found: vscode-notebook-cell:/Users/sashimi/qa-example-content/workspaces/large_py_notebook/spotify.ipynb#W0sZmlsZQ%3D%3D: Error: Document for URI could not be found: vscode-notebook-cell:/Users/sashimi/qa-example-content/workspaces/large_py_notebook/spotify.ipynb#W0sZmlsZQ%3D%3D
at handleResponse (/Users/sashimi/dev/positron-dev/extensions/positron-assistant/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
at handleMessage (/Users/sashimi/dev/positron-dev/extensions/positron-assistant/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
at processMessageQueue (/Users/sashimi/dev/positron-dev/extensions/positron-assistant/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
at Immediate.<anonymous> (/Users/sashimi/dev/positron-dev/extensions/positron-assistant/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
at process.processImmediate (node:internal/timers:483:21)
at process.callbackTrampoline (node:internal/async_hooks:130:17)
// sometimes this error occurs instead of `ERR Document for URI could not be found`
ERR Schema validation failed with the following errors:
- /context/selectedCompletionInfo/range: Expected object
- : Expected all values to match: Error: Schema validation failed with the following errors:
- /context/selectedCompletionInfo/range: Expected object
- : Expected all values to match
|
Summary
Release Notes
Note
TBD if this is a feature or a bugfix 😆
New Features
ipynb
files (Assistant: GitHub Copilot Support in ipynb files #8061)Bug Fixes
ipynb
files (Assistant: GitHub Copilot Support in ipynb files #8061)QA Notes
@:assistant
positron.assistant.inlineCompletionExcludes
setting should continue to work