diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2024-12-30 12:30:52 -0500 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-12-30 12:30:52 -0500 |
commit | 736273c49ad78d4285b90d01eaa72baa6438c04b (patch) | |
tree | 91d2d24308cc99599f68f5032d350a754824c665 | |
parent | ea767decae8022d9535296061df01b908928dca8 (diff) |
lsp: add ccls & .clang-format
-rw-r--r-- | .clang-format | 8 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .nvim.lua | 6 | ||||
-rw-r--r-- | kernel/drivers/vga_text_buffer/vga_text_buffer.c | 11 | ||||
-rw-r--r-- | kernel/libk/printk.c | 2 |
5 files changed, 21 insertions, 7 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..65c9a5f --- /dev/null +++ b/.clang-format @@ -0,0 +1,8 @@ +BasedOnStyle: GNU +IndentWidth: 2 +TabWidth: 2 +BreakBeforeBraces: Linux +SpaceBeforeParens: ControlStatements +SpaceAfterCStyleCast: true +BinPackArguments: false +BinPackParameters: false @@ -5,3 +5,4 @@ toolchain/host/ toolchain/build/ .cache/ compile_commands.json +.ccls-cache diff --git a/.nvim.lua b/.nvim.lua new file mode 100644 index 0000000..934af41 --- /dev/null +++ b/.nvim.lua @@ -0,0 +1,6 @@ +--- Set Up Lspconfig +local lspconfig = require('lspconfig') +local capabilities = require('cmp_nvim_lsp').default_capabilities() +lspconfig['ccls'].setup { + capabilities = capabilities +} diff --git a/kernel/drivers/vga_text_buffer/vga_text_buffer.c b/kernel/drivers/vga_text_buffer/vga_text_buffer.c index 0c05f0e..2de8f81 100644 --- a/kernel/drivers/vga_text_buffer/vga_text_buffer.c +++ b/kernel/drivers/vga_text_buffer/vga_text_buffer.c @@ -16,9 +16,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdbool.h> #include <stddef.h> #include <stdint.h> -#include <stdbool.h> #include <libk/string.h> @@ -68,10 +68,8 @@ vga_text_buffer_initialize(void) { vga_text_buffer_row = 0; vga_text_buffer_column = 0; - vga_text_buffer_color = vga_entry_color( - VGA_COLOR_LIGHT_GREY, - VGA_COLOR_BLACK - ); + vga_text_buffer_color + = vga_entry_color(VGA_COLOR_LIGHT_GREY, VGA_COLOR_BLACK); vga_text_buffer_buffer = (uint16_t *) 0xB8000; for (uint8_t y = 0; y < VGA_HEIGHT; y++) @@ -88,7 +86,8 @@ vga_text_buffer_write_char(char c) vga_text_buffer_row++; vga_text_buffer_column = 0; } else { - vga_text_buffer_write_entry_at(c, vga_text_buffer_color, vga_text_buffer_column, vga_text_buffer_row); + vga_text_buffer_write_entry_at( + c, vga_text_buffer_color, vga_text_buffer_column, vga_text_buffer_row); if (++vga_text_buffer_column == VGA_WIDTH) { vga_text_buffer_column = 0; diff --git a/kernel/libk/printk.c b/kernel/libk/printk.c index 1465ea1..1ddd05d 100644 --- a/kernel/libk/printk.c +++ b/kernel/libk/printk.c @@ -16,8 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <libk/io.h> #include <driver/vga_text_buffer.h> +#include <libk/io.h> void printk(char *msg) |