facebook

Insert of code by the plugin adds newline

  1. Copilot4Eclipse – GitHub Copilot on Eclipse
  2.  > 
  3. General Discussion
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #700516 Reply

    axbu
    Participant

    Hi,

    all in all the plugins works fine for me but i have the following problem:
    when there is some code suggestion i see they suggestion in grey which looks fine (suggestion.png)
    but if i accept via [TAB] there are forced empty newlines(?) added between every codeline
    (see result.png)

    these empty lines are not reformatable by clang format. the empty lines are kept. so i have to delete them and edit the text so it is one one line(edit.png) and then clangformat can format teh code to the correct output(endresult.png)

    this is really anoying. is this something produced by the plugin or is this some eclipse setting which results in this behaviour?

    regards

    Attachments:
    You must be logged in to view attached files.
    #700532 Reply

    wayne
    Moderator

    >this is really anoying

    I can understand the annoyance. Please help us replicate this issue by providing more info:

    1) What Eclipse plugin or Eclipse-based product are you using?

    2) What editor is are your using?

    3) Are extra lines added for every completion insertion or only some of them? If the behavior is not consistent please share any details you have observed.

    I suspect there is a clash between the editor’s formatter and the code suggestion as it is being inserted into the editor at the point of the cursor. This is something we can look into.

    Wayne
    Copilot4Eclipse Team

    #700538 Reply

    axbu
    Participant

    “this is really anoying”
    should not sound that harsh. so please bear with me, it’s not my 1st language 😉

    I attached a screenshot of the eclipse editor. It is renesas e2 studio.

    but i’m using https://github.com/wangzw/CppStyle to be able to use clang-format.
    clang format is only running when my code file is saved so i thought this would be no problem.

    but it seems like somehow this plugin messes with the the insert buffer(or whatever mechanism you are using to put text into the textarea).
    if i disable this plugin, then your plugin inserts the text just fine without any empty lines inbetween.

    on the one hand this is good to know, on the other hand bad as it seems the cppstyle plugin is kind of abandoned 🙁

    Attachments:
    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Insert of code by the plugin adds newline

You must be logged in to post in the forum log in