Formatting issue during typing

Sysprogs forums Forums VisualGDB Formatting issue during typing

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32738
    oto313
    Participant

    I have cmake project with clang format setup (.clangformat in attachment)

    Imgur: The magic of the Internet

    There is annoying issue. I am in state as first image in imgur and I have cursor between curly braces then when I press enter the curly braces it does not properly align (as shown in second image). I think that the formatting engine does not respect clang format file.

     

    I also had problem that I must change in Options->Text Editor->C/C++ (VisualGDB)->Tabs indent size to match the one in clang format file. When I have different settings in clang format and in visual studio settings then it does not work. I had to run Edit->Advanced->Format document to apply the correct formatting settings. I think there is some issue with formatting engine (during typing) so it does not respect clang format settings at all.

     

    Thanks for help

     

    I have version 5.6r6

    #32739
    oto313
    Participant

    Reuploading clang-format file

    • This reply was modified 2 years, 5 months ago by oto313.
    Attachments:
    You must be logged in to view attached files.
    #32742
    support
    Keymaster

    Unfortunately, it is hard to suggest anything specific based on the description you provided.
    In order for us to provide any help with this, we need to be able to reproduce the problem on our side.
    Please provide complete and detailed steps to reproduce the issue as described below:

    1. The steps should begin with launching Visual Studio. They should include every step necessary to create the project from scratch and reproduce the issue.
    2. Please make sure the steps do not involve any 3rd-party code as we will not be able to review it. If the problem only happens with a specific project, please make sure you can reproduce it on a clean project created from scratch.
    3. The steps should include uncropped screenshots of all wizard pages, VisualGDB Project Properties pages and any other GUI involved in reproducing the problem. This is critical for us to be able to reproduce the problem on our side.

    You can read more about the best way to report VisualGDB issues in our problem reporting guidelines, If you do not wish to document the repro steps and save the screenshots, please consider recording a screen video instead and sending us a link to it.

    #32747
    oto313
    Participant

    Imgur: The magic of the Internet

    There are videos of all steps. I used a xbox gamebar on windows and it cannot record across multiple windows so its splitted into multiple videos. Used clang format is in the attachment.

     

    There is some inconsistencies that the intellisense formatting does not use clang format rules. But format document works properly.

     

    Thanks for help

    Attachments:
    You must be logged in to view attached files.
    #32749
    oto313
    Participant

    I noticed that there was some error

     

    [+0:18:05.330] Starting operation: Determining code formatting settings for C:\Users\otodu\Downloads\VisualGdbTest\VisualGdbTest.cpp
    [+0:18:05.331] Error HRESULT E_FAIL has been returned from a call to a COM component. while trying load C:\Users\otodu\Downloads\VisualGdbTest\.clang-format
    [+0:18:05.331] Stack trace:
    [+0:18:05.331] Server stack trace:
    [+0:18:05.331] at hs2.c(Byte[] b, Int32 a)
    [+0:18:05.331] at sj3.d(String a)

    [+0:18:05.331] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
    [+0:18:05.331] at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
    [+0:18:05.331] Exception rethrown at [0]:
    [+0:18:05.331] at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    [+0:18:05.331] at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    [+0:18:05.331] at sj3.d(String a)
    [+0:18:05.331] at wn1.t4.a()
    [+0:18:05.331] Operation completed: Determining code formatting settings for C:\Users\otodu\Downloads\VisualGdbTest\VisualGdbTest.cpp [0 msec]

     

    Maybe there should be some warning that it cannot load .clang-format file

    But even if i provide correct clang format file intellisense does not apply formatting settings from there

    [+0:18:05.329] Indentation size: 3, will insert spaces

    for example it uses indentation size 3 instead 2

    Attachments:
    You must be logged in to view attached files.
    #32753
    support
    Keymaster

    Thanks for the detailed repro steps. It looks like your .clang-format file is corrupt or contains statements that are not supported by Clang 6.0 used by VisualGDB:

    Error HRESULT E_FAIL has been returned from a call to a COM component. while trying load C:\Users\otodu\Downloads\VisualGdbTest\.clang-format

    Please try narrowing this down to a specific statement/line that prevents the file from being loaded. E.g. you can remove half of the statements and check if the file still loads. If yes, restore half of the previously removed ones, and try again.

    If you can pinpoint a specific statement that is not loaded properly, please let us know and we will provide more details.

    #32755
    oto313
    Participant

    Yeah in previous message I wrote that I figured it out. But even with correct clang format it does not work. The correct clang format in the attachment

    Attachments:
    You must be logged in to view attached files.
    #32759
    support
    Keymaster

    Sorry about the confusion.

    The indentation settings shown in the diagnostic log are taken from Tools->Options->Text Editor->C/C++ (VisualGDB)->Tabs. The clang-format file should normally override them, but if it’s not happening, you can always change them manually via the VS Options window.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.