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

Formatting not working with cquery? #499

Closed
tomv564 opened this issue Jan 24, 2019 · 2 comments
Closed

Formatting not working with cquery? #499

tomv564 opened this issue Jan 24, 2019 · 2 comments

Comments

@tomv564
Copy link
Contributor

tomv564 commented Jan 24, 2019

That is not fixed @tomv564 . After formatting, deletes some code and I need to wait for a while to get a formatting working properly.

In my case, the comment after '#endif' was getting slowly deleted, character by a character, from left to right, every time when I pressed my keybind.

Also try to add #define log_info(...) log (LOG_INFO, __FILE__, __LINE__, __VA_ARGS__). It's getting worser than this.

I'm using cquery in C project.

Example code:

#ifndef __LOGGER_H__
#define __LOGGER_H__

#include <stdarg.h>
#include <stdio.h>

typedef void (*log_lock_t) (void * udata, int lock);
enum { LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL };

#define log_trace(...) log (LOG_TRACE, __FILE__, __LINE__, __VA_ARGS__)
#define log_debug(...) log (LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
#define log_info(...) log (LOG_INFO, __FILE__, __LINE__, __VA_ARGS__)
#define log_warn(...) log (LOG_WARN, __FILE__, __LINE__, __VA_ARGS__)
#define log_error(...) log (LOG_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#define log_fatal(...) log (LOG_FATAL, __FILE__, __LINE__, __VA_ARGS__)

void log_set_udata (void * udata);
void log_set_lock (hlt_log_lock_t fn);
void log_set_fp (FILE * fp);
void log_set_level (int level);
void log_set_quiet (int enable);

void log (int level, const char * file, int line, const char * fmt, ...);

#endif  // __LOGGER_H__

Example .clang-format:

BasedOnStyle: Google
IndentPPDirectives: AfterHash
IndentWidth: '2'
Language: Cpp
DerivePointerAlignment: 'false'
PointerAlignment: Middle
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceBeforeParens: Always
Standard: Cpp03
TabWidth: '2'
UseTab: Never
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'

Originally posted by @TheAifam5 in #3 (comment)

@tomv564 tomv564 changed the title Formatting not working with cquery Formatting not working with cquery? Jan 24, 2019
@tomv564
Copy link
Contributor Author

tomv564 commented Jan 24, 2019

@TheAifam5 I don't have cquery set up at the moment, can you share the logs on a minimal repro?

@rwols
Copy link
Member

rwols commented Jun 29, 2019

Closing this due to timeout and cquery seems abandoned https://github.com/cquery-project/cquery, the ccls fork continues development https://github.com/MaskRay/ccls

@rwols rwols closed this as completed Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants