Skip to content
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

New Command so that CopilotChat reads from current in-focus buffer when answering questions #67

Merged
merged 3 commits into from Feb 23, 2024

Conversation

AdrielVelazquez
Copy link
Contributor

@AdrielVelazquez AdrielVelazquez commented Feb 23, 2024

Small addition of :CopilotChatBuffer that will pull in the current in-focus buffer and utilize it for answering the question.

Also included small bug fixes that technically might never be encountered

ChatBuffer.webm

@@ -105,7 +106,7 @@ def ask(
if not self.token:
self.authenticate()
# If expired, reauthenticate
if self.token.get("expires_at") <= round(time.time()):
if self.token.get("expires_at", 0) <= round(time.time()):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed comparing NoneType with int

>>> None <= 2120
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<=' not supported between instances of 'NoneType' and 'int'

@AdrielVelazquez
Copy link
Contributor Author

@jellydn I can't add reviewers to my PR, so just tagging you in the comments. Let me know if you want anything changed.

Copy link
Contributor

@jellydn jellydn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @AdrielVelazquez
Let's wait for @gptlang input on this.

@jellydn jellydn added the enhancement New feature or request label Feb 23, 2024
@jellydn jellydn merged commit 57226f2 into CopilotC-Nvim:main Feb 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants