Giter Club home page Giter Club logo

Comments (2)

tomv564 avatar tomv564 commented on May 24, 2024

Should be fixed by f3f1ace

from lsp.

TheAifam5 avatar TheAifam5 commented on May 24, 2024

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'

from lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.