r238823 - Make vim also output a helpful message in some error cases.

Manuel Klimek klimek at google.com
Fri Jun 5 01:56:11 PDT 2015


Nope, the fix is good anyway. Just wanted to understand what went wrong.
And let you know that you might be on an outdated version :)

On Fri, Jun 5, 2015, 9:16 AM Chandler Carruth <chandlerc at google.com> wrote:

> It's possible. I don't think my script and my clang format binary are
> version locked. Should they be? Is that important?
>
> On Thu, Jun 4, 2015, 21:45 Manuel Klimek <klimek at google.com> wrote:
>
>> Were you on an outdated version of clang-format?
>>
>> On Thu, Jun 4, 2015, 11:27 PM Chandler Carruth <chandlerc at google.com>
>> wrote:
>>
>>> It's because the dict doesn't always have the key.
>>>
>>> Fixed in r239098.
>>>
>>> On Thu, Jun 4, 2015 at 2:21 PM Chandler Carruth <chandlerc at google.com>
>>> wrote:
>>>
>>>> After this, all my code produces this error... The message isn't very
>>>> helpful, how should I debug this?
>>>>
>>>> On Tue, Jun 2, 2015 at 5:08 AM Manuel Klimek <klimek at google.com> wrote:
>>>>
>>>>> Author: klimek
>>>>> Date: Tue Jun  2 07:01:50 2015
>>>>> New Revision: 238823
>>>>>
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=238823&view=rev
>>>>> Log:
>>>>> Make vim also output a helpful message in some error cases.
>>>>>
>>>>> When clang-format encounters a syntax error, it will not format that
>>>>> line; we're now using the same mechanism we're already using in emacs
>>>>> to
>>>>> show a helpful error message to the user.
>>>>>
>>>>> Modified:
>>>>>     cfe/trunk/tools/clang-format/clang-format.py
>>>>>
>>>>> Modified: cfe/trunk/tools/clang-format/clang-format.py
>>>>> URL:
>>>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/clang-format.py?rev=238823&r1=238822&r2=238823&view=diff
>>>>>
>>>>> ==============================================================================
>>>>> --- cfe/trunk/tools/clang-format/clang-format.py (original)
>>>>> +++ cfe/trunk/tools/clang-format/clang-format.py Tue Jun  2 07:01:50
>>>>> 2015
>>>>> @@ -85,6 +85,8 @@ def main():
>>>>>      for op in reversed(sequence.get_opcodes()):
>>>>>        if op[0] is not 'equal':
>>>>>          vim.current.buffer[op[1]:op[2]] = lines[op[3]:op[4]]
>>>>> +    if output['IncompleteFormat']:
>>>>> +      print 'clang-format: incomplete (syntax errors)'
>>>>>      vim.command('goto %d' % (output['Cursor'] + 1))
>>>>>
>>>>>  main()
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> cfe-commits mailing list
>>>>> cfe-commits at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150605/4967fa24/attachment.html>


More information about the cfe-commits mailing list