Skip to content

Commit 48ce040

Browse files
Merge pull request #32 from PythonGermany/clangd-compatibility-improvements
Clangd compatibility improvements
2 parents 79fdb17 + 8d9d48c commit 48ce040

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ docker/webserv/source
2424
database/
2525
.env
2626

27-
# Clangd config file
28-
.clangd
27+
.cache/
28+
29+
compile_commands.json

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ docker.build:
117117
docker.run:
118118
docker run --rm -p 8080:80 --name webserv webserv:latest
119119

120+
bear: fclean
121+
bear -- make
122+
120123
lines:
121124
@wc -l $(SRC_DIR)/*.cpp $(INC_DIR)/*.hpp $(SRC_DIR)/*/*.cpp $(INC_DIR)/*/*.hpp | sort
122125

@@ -132,6 +135,7 @@ help:
132135
@echo " run : Run webserv binary with project configuration file"
133136
@echo " docker.build : Build webserv docker image"
134137
@echo " docker.run : Run webserv docker image"
138+
@echo " bear : Use bear to generate compile_commands.json file which can be used by clangd"
135139
@echo " lines : Count lines of code in source files"
136140

137141
.PHONY: all clean fclean re performance debug fsanitize custom flamegraph jmeter lines help

include/output/output.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#ifndef OUTPUT_HPP
22
#define OUTPUT_HPP
33

4-
#include <iostream>
5-
6-
#include "colors.hpp"
7-
#include "webserv.hpp"
4+
#include <string>
85

96
typedef enum output_flag_e { SET = 1, PRINT = 2, UNSET = 4 } output_flag_t;
107

src/output/output.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#include "output.hpp"
22

3+
#include <iostream>
4+
5+
#include "colors.hpp"
6+
#include "webserv.hpp"
7+
38
int getBit(output_flag_t flag, int value) { return value & flag; }
49

510
void printInfo(int flags) {

0 commit comments

Comments
 (0)