File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11# changelog  
22
33## 2.4.0  
4+ *  ` NEW `  loading settings from ` .luarc.json ` 
45*  ` NEW `  settings:
56 +  ` Lua.diagnostics.libraryFiles ` 
67 +  ` Lua.diagnostics.ignoredFiles ` 
Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ local progress = require 'progress'
1414local  tm  =  require  ' text-merger' 
1515local  cfgLoader  =  require  ' config.loader' 
1616local  converter  =  require  ' proto.converter' 
17+ local  filewatch  =  require  ' filewatch' 
1718
1819local  function  updateConfig ()
1920 local  new 
2021 if  CONFIGPATH  then 
2122 new  =  cfgLoader .loadLocalConfig (CONFIGPATH )
2223 config .setSource  ' path' 
2324 log .debug (' load config from local' CONFIGPATH )
25+  filewatch .watch (workspace .getAbsolutePath (CONFIGPATH ))
2426 else 
2527 new  =  cfgLoader .loadRCConfig (' .luarc.json' 
2628 if  new  then 
@@ -40,6 +42,19 @@ local function updateConfig()
4042 log .debug (' loaded config dump:' util .dump (new ))
4143end 
4244
45+ filewatch .event (function  (changes )
46+  local  configPath  =  workspace .getAbsolutePath (CONFIGPATH  or  ' .luarc.json' 
47+  if  not  configPath  then 
48+  return 
49+  end 
50+  for  _ , change  in  ipairs (changes ) do 
51+  if  change .path  ==  configPath  then 
52+  updateConfig ()
53+  return 
54+  end 
55+  end 
56+ end )
57+ 
4358proto .on (' initialize' function  (params )
4459 client .init (params )
4560 config .init ()
                         You can’t perform that action at this time. 
           
                  
0 commit comments