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/highlight_group.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index bf6bad1a86..77a3684067 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -1,6 +1,7 @@ #ifndef NVIM_HIGHLIGHT_GROUP_H #define NVIM_HIGHLIGHT_GROUP_H +#include "nvim/api/keysets.h" #include "nvim/api/private/helpers.h" #include "nvim/highlight_defs.h" #include "nvim/types.h" -- cgit From 09a17f91d0d362c6e58bfdbe3ccdeacffb0b44b9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 2 Oct 2023 10:45:33 +0800 Subject: refactor: move cmdline completion types to cmdexpand_defs.h (#25465) --- src/nvim/highlight_group.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 77a3684067..369864552c 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -3,6 +3,7 @@ #include "nvim/api/keysets.h" #include "nvim/api/private/helpers.h" +#include "nvim/cmdexpand_defs.h" #include "nvim/highlight_defs.h" #include "nvim/types.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/highlight_group.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 369864552c..f40a741003 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -1,5 +1,4 @@ -#ifndef NVIM_HIGHLIGHT_GROUP_H -#define NVIM_HIGHLIGHT_GROUP_H +#pragma once #include "nvim/api/keysets.h" #include "nvim/api/private/helpers.h" @@ -18,5 +17,3 @@ extern color_name_table_T color_name_table[]; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "highlight_group.h.generated.h" #endif - -#endif // NVIM_HIGHLIGHT_GROUP_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/highlight_group.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index f40a741003..857121b5ca 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -1,8 +1,9 @@ #pragma once #include "nvim/api/keysets.h" +#include "nvim/api/private/defs.h" // IWYU pragma: keep #include "nvim/api/private/helpers.h" -#include "nvim/cmdexpand_defs.h" +#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/highlight_defs.h" #include "nvim/types.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/highlight_group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 857121b5ca..034de2c533 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/api/keysets.h" +#include "nvim/api/keysets_defs.h" #include "nvim/api/private/defs.h" // IWYU pragma: keep #include "nvim/api/private/helpers.h" #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/highlight_group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 034de2c533..03e1508539 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -5,7 +5,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/highlight_defs.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" #define MAX_HL_ID 20000 // maximum value for a highlight ID. -- 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/highlight_group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/highlight_group.h') diff --git a/src/nvim/highlight_group.h b/src/nvim/highlight_group.h index 03e1508539..ca7bd36271 100644 --- a/src/nvim/highlight_group.h +++ b/src/nvim/highlight_group.h @@ -5,7 +5,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/cmdexpand_defs.h" // IWYU pragma: keep #include "nvim/highlight_defs.h" -#include "nvim/types_defs.h" +#include "nvim/types_defs.h" // IWYU pragma: keep #define MAX_HL_ID 20000 // maximum value for a highlight ID. -- cgit