Skip to content

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

Merged
jellydn merged 3 commits into
CopilotC-Nvim:mainfrom
AdrielVelazquez:main
Feb 23, 2024
Merged

New Command so that CopilotChat reads from current in-focus buffer when answering questions#67
jellydn merged 3 commits into
CopilotC-Nvim:mainfrom
AdrielVelazquez:main

Conversation

@AdrielVelazquez

@AdrielVelazquez AdrielVelazquez commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

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

self.authenticate()
# If expired, reauthenticate
if self.token.get("expires_at") <= round(time.time()):
if self.token.get("expires_at", 0) <= round(time.time()):

@AdrielVelazquez AdrielVelazquez Feb 23, 2024

Copy link
Copy Markdown
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
Copy Markdown
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.

@jellydn jellydn left a comment

Copy link
Copy Markdown
Contributor

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
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.

3 participants