From efb0896f21e03f64e3a14e7c09994e81956f47b9 Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 3 Apr 2023 15:21:24 +0200 Subject: refactor(api): make typed dicts appear as types in the source code problem: can we have Serde? solution: we have Serde at home This by itself is just a change of notation, that could be quickly merged to avoid messy merge conflicts, but upcoming changes are planned: - keysets no longer need to be defined in one single file. `keysets.h` is just the initial automatic conversion of the previous `keysets.lua`. keysets just used in a single api/{scope}.h can be moved to that file, later on. - Typed dicts will have more specific types than Object. this will enable most of the existing manual typechecking boilerplate to be eliminated. We will need some annotation for missing value, i e a boolean will need to be represented as a TriState (none/false/true) in some cases. - Eventually: optional parameters in form of a `Dict opts` final parameter will get added in some form to metadata. this will require a discussion/desicion about type forward compatibility. --- src/nvim/api/command.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/api/command.h') diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h index b1c9230551..f16bd0acde 100644 --- a/src/nvim/api/command.h +++ b/src/nvim/api/command.h @@ -1,6 +1,7 @@ #ifndef NVIM_API_COMMAND_H #define NVIM_API_COMMAND_H +#include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" #include "nvim/decoration.h" #include "nvim/ex_cmds.h" -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/api/command.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/nvim/api/command.h') diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h index f16bd0acde..78af5cbf64 100644 --- a/src/nvim/api/command.h +++ b/src/nvim/api/command.h @@ -1,5 +1,4 @@ -#ifndef NVIM_API_COMMAND_H -#define NVIM_API_COMMAND_H +#pragma once #include "nvim/api/keysets.h" #include "nvim/api/private/defs.h" @@ -9,4 +8,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/command.h.generated.h" #endif -#endif // NVIM_API_COMMAND_H -- cgit From 574d25642fc9ca65b396633aeab6e2d32778b642 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 17:21:58 +0800 Subject: refactor: move Arena and ArenaMem to memory_defs.h (#26240) --- src/nvim/api/command.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/api/command.h') diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h index 78af5cbf64..7f8c35f89a 100644 --- a/src/nvim/api/command.h +++ b/src/nvim/api/command.h @@ -1,9 +1,9 @@ #pragma once +#include // IWYU pragma: keep + #include "nvim/api/keysets.h" -#include "nvim/api/private/defs.h" -#include "nvim/decoration.h" -#include "nvim/ex_cmds.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/command.h.generated.h" -- cgit From e3f735ef101d670555f44226614a5c3557053b1f Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:13:32 +0100 Subject: refactor: fix includes for api/autocmd.h --- src/nvim/api/command.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/api/command.h') diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h index 7f8c35f89a..95f0e05993 100644 --- a/src/nvim/api/command.h +++ b/src/nvim/api/command.h @@ -2,7 +2,7 @@ #include // IWYU pragma: keep -#include "nvim/api/keysets.h" +#include "nvim/api/keysets_defs.h" #include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit From 718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 28 Nov 2023 07:47:36 +0800 Subject: refactor: fix runtime_defs.h (#26259) --- src/nvim/api/command.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/api/command.h') diff --git a/src/nvim/api/command.h b/src/nvim/api/command.h index 95f0e05993..1cccbfb4c7 100644 --- a/src/nvim/api/command.h +++ b/src/nvim/api/command.h @@ -2,7 +2,7 @@ #include // IWYU pragma: keep -#include "nvim/api/keysets_defs.h" +#include "nvim/api/keysets_defs.h" // IWYU pragma: keep #include "nvim/api/private/defs.h" // IWYU pragma: keep #ifdef INCLUDE_GENERATED_DECLARATIONS -- cgit