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

Trailing markdown codeblock #1

Closed
JosefLitos opened this issue Apr 26, 2024 · 2 comments
Closed

Trailing markdown codeblock #1

JosefLitos opened this issue Apr 26, 2024 · 2 comments

Comments

@JosefLitos
Copy link
Owner

Hi @JosefLitos, thank you for the fix. I have some trouble in using this fork version. After hit the enter key to input the completion text, there is always the markdown code chunk marks around the code. One example:

When enter
image

The output become:

image

Originally posted by @y9c in zbirenbaum#105 (comment)

@JosefLitos
Copy link
Owner Author

JosefLitos commented Apr 26, 2024

This unfortunately seems to be directly from copilot - this is what comes from the api for for i in :

{
  completions = { {
      displayText = '{1..100}; do\n\techo -n "$i "\ndone',
      docVersion = 245,
      position = <1>{},
      range = <table 1>,
      text = 'for i in {1..100}; do\n\techo -n "$i "\ndone',
      uuid = "fa9f8b8e-60ad-4452-9824-8c9a35a4eb03"
    }, {
      displayText = "$(seq 1 100); do\n\techo $i\ndone\n```\n\n```bash",
      docVersion = 245,
      position = <table 1>,
      range = <table 1>,
      text = "for i in $(seq 1 100); do\n\techo $i\ndone\n```\n\n```bash",
      uuid = "44311928-7ef1-4cef-893a-c20eb4e333d1"
    } }
}

When looking into :Copilot panel I saw a lot of weird things containing simillar suggestions. Try to see for yourself if it is also there.

But I don't think it shows up for everything. Even in this suggestion you can see the first one was fine, it was just the second one that contains the weird markdown.

So it still can return normal responses, it just doesn't know what to suggest. I also wasn't able to reproduce this anywhere outside an empty file, so it may just be it having too little context.

@y9c
Copy link

y9c commented Apr 26, 2024

Thank you very much for solving this. I have confirmed that when there is too little content in the file, Copilot adds the markdown block. I used to think the issue might be related to the plugin. However, if the issue is caused by Copilot, I can simply ignore the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants