continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.25k stars 1.66k forks source link

Get current file untitled support #2841

Closed RomneyDa closed 1 week ago

RomneyDa commented 1 week ago

Description

Current pattern is getCurrentFile -> readCurrentFile

The problem is if it's untitled there's no way to deduce that reliably from a single path

Also in every single use case, getCurrentFile read the file contents

So I just made getCurrent file return the file contents

Adjusted some types here and there

isUntitled is unused at the moment

Checklist

Fixes https://github.com/continuedev/continue/issues/2798 https://github.com/continuedev/continue/issues/1226 seems related but as far as I can tell it's already been fixed