nvms / wingman

Your pair programming wingman. Supports OpenAI, Anthropic, or any LLM on your local inference server.
https://marketplace.visualstudio.com/items?itemName=nvms.ai-wingman
ISC License
61 stars 10 forks source link

New {{cursor}} placeholder for prompts #37

Open Entaigner opened 7 months ago

Entaigner commented 7 months ago

Text manipulation around the text cursor

  1. {{cursor}}
    • Returns the text cursors current line
  2. {{cursor:2:5}}
    • Returns the text from... 'cursor line-2 at the start of the line' to 'cursor line+5 at the end of the line'
  3. {{cursor:1:1:'[SOME_MARKER]'}}
    • Like 2. but inserts [SOME_MARKER] at text cursor position

Important:

Why: https://huggingface.co/stabilityai/stable-code-3b#run-with-fill-in-middle-fim-%E2%9A%A1%EF%B8%8F

Entaigner commented 7 months ago

The pull request might've been a little rash but i got lost in the moment whilst testing a model.

My implementation lacks a comfortable integration into the rest of the project.

Maybe {{selection_with_marker}} to allow the placement of a marker somewhere in the selection. Or keep {{cursor:1:1:'[SOME_MARKER]'}} but without the line deltas {{cursor:'[SOME_MARKER]'}} and select after. Haven't figured it out.

Anyway, thanks for the awesome project.