continue icon indicating copy to clipboard operation
continue copied to clipboard

Show plaintext scratch files in prompt context view

Open pkirkovsky opened this issue 1 year ago • 1 comments

Validations

  • [X] I believe this is a way to improve. I'll try to join the Continue Discord for questions
  • [X] I'm not able to find an open issue that requests the same enhancement

Problem

Unsaved/"un-languaged" files are not displayed in the "Add Context" menu in Continue.

Steps to reproduce:

  • Create a new text file in VSCode (Cmd-N/Ctrl-N)
  • Open the Continue extension pane
  • Use the @ shortcut or the "Add Context" menu to view workspace files available for context

Expected: Fresh unsaved files (Untitled-*) appear in the workspace files view and are available for use as prompt context

Actual: These files are not visible to the extension

Comments: I often find myself using scratch files to quickly try out new ideas or store code snippets/test data/whatever, and being able to use an LLM on these pieces of text would be very handy. Setting the language manually provides a workaround for this, but that can get annoying.

Solution

Looks like documentIsCode() here is responsible for this behavior.

I suggest adjusting the logic so that document.isUntitled(ref) being true should override document.languageId === "plaintext", since the user is probably interacting with a scratch file.

pkirkovsky avatar Dec 12 '23 01:12 pkirkovsky

Definitely a good update to make! Aiming to completely solve this, /edit, and cmd+m problems within unsaved files soon. Will update here as progress is made

sestinj avatar Dec 13 '23 01:12 sestinj