Skip to content

Commit c82aa9f

Browse files
centurysysxiaoxiang781216
authored andcommitted
config.nims: fix NimSuggest crash.
When editing in VSCode, NimSuggest refers to config.nims and tries to find the NuttX .config. Fixed a problem that .config cannot be read because the environment variable "TOPDIR" is not defined. Signed-off-by: Takeyoshi Kikuchi <[email protected]>
1 parent dabdad7 commit c82aa9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config.nims

+2-1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ proc setup_cfg(cfg: DotConfig) =
127127
switch("define", "nimMemAlignTiny")
128128

129129

130-
let topdir = getEnv("TOPDIR")
130+
const key = "TOPDIR"
131+
let topdir = if existsEnv(key): getEnv(key) else: thisDir() & "/../nuttx"
131132
let cfg = read_config(topdir & "/.config")
132133
cfg.setup_cfg()

0 commit comments

Comments
 (0)