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

Quotation marks problems #270

Closed
krzbe opened this issue Feb 11, 2013 · 4 comments
Closed

Quotation marks problems #270

krzbe opened this issue Feb 11, 2013 · 4 comments

Comments

@krzbe
Copy link

krzbe commented Feb 11, 2013

Hello,

I have two problems with quotation marks in cpp code, when using clang-complete:
First: when quick-fix will find warning exactly on quotation mark, inside function call, whole file after that place will be marked as string content (syntax highlighting is broken there), for example:

void test(char * x)     
{

}

void function()
{

    char * str = "str";
    int y=23;

    test("some text");
    test("other text");
    int x=10;
    //comment here

}

After that, code completion is not working anymore (until I fix the code).

Second issue: when I leave " sign alone, quick-fix will throw exception (maybe output from clang should be escaped?):

Error detected while processing function g:ClangUpdateQuickFix..<SNR>16_DoPeriodicQuickFix..<SNR>16_ClangQuickFix:
line    8:
E722: Missing comma in Dictionary: "\' character', 'type': 'W', 'col': 5, 'bufnr': 1}, {'lnum': 12, 'text': 'expected expression', 'type': 'E', 'col': 5, 'bufnr': 1}, {'lnum': 14, 'text': "conversion from string literal to 'char *' is d
eprecated", 'type': 'W', 'col': 10, 'bufnr': 1}]
E15: Invalid expression: [{'lnum': 9, 'text': "conversion from string literal to 'char *' is deprecated", 'type': 'W', 'col': 18, 'bufnr': 1}, {'lnum': 12, 'text': 'missing terminating \'"\' character', 'type': 'W', 'col': 5, 'bufnr': 1
}, {'lnum': 12, 'text': 'expected expression', 'type': 'E', 'col': 5, 'bufnr': 1}, {'lnum': 14, 'text': "conversion from string literal to 'char *' is deprecated", 'type': 'W', 'col': 10, 'bufnr': 1}]
Traceback (most recent call last):
  File "<string>", line 1, in <module>
vim.error
line   27:
E121: Undefined variable: l:list
E116: Invalid arguments for function setqflist

It is somehow connected with warning/error reporting.

Tested with clang-3.3-svn.

xavierd added a commit that referenced this issue Feb 15, 2013
@xavierd
Copy link
Owner

xavierd commented Feb 15, 2013

Issue 1: I don't know if that can be fixed, will look into that.
Issue 2: Can you try the code I pushed to branch issue270?

@krzbe
Copy link
Author

krzbe commented Feb 15, 2013

Code from branch 'issue270' fixes second issue, thanks! But to use this fix, I had to upgrade vim to latest version (because of missing 'pyeval' function in my old 7.3 vim).

@mlen
Copy link
Contributor

mlen commented May 12, 2017

I'm using latest clang_complete with clang 4.0 and I'm hitting the second issue. Probably there was some regression since the time it was fixed

Error detected while processing function <SNR>40_DoPeriodicQuickFix[8]..<SNR>40_ClangQuickFix:        
line    5:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function <SNR>40_DoPeriodicQuickFix[8]..<SNR>40_ClangQuickFix:
line    5:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function <SNR>40_DoPeriodicQuickFix[8]..<SNR>40_ClangQuickFix:
line    5:
vim.error: Vim(let):E722: Missing comma in Dictionary: "\' character', 'type': 'W', 'col': 5, 'bufnr': 1},
 {'lnum': 35, 'text': 'expected expression', 'type': 'E', 'col': 5, 'bufnr': 1}]

EDIT: I assumed that the fix was merged, turns out it is not. Maybe it is worth to consider merging it anyway? I think most vim builds are compiled with +python today

@mlen
Copy link
Contributor

mlen commented May 12, 2017

Another solution (that doesn't require pyeval): #524

@xaizek xaizek closed this as completed in d8a2bec May 23, 2017
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

3 participants