| @@ -74,7 +74,6 @@ fn load_config(custom_path: Option<PathBuf>) -> Result<(oxwm::Config, bool)> { |
| 74 |
println!(" See the new config.lua template for examples.\n"); |
74 |
println!(" See the new config.lua template for examples.\n"); |
| 75 |
} |
75 |
} |
| 76 |
} else { |
76 |
} else { |
| 77 |
- // Always update LSP files to match the running version |
|
|
| 78 |
update_lsp_files()?; |
77 |
update_lsp_files()?; |
| 79 |
} |
78 |
} |
| 80 |
|
79 |
|
| @@ -105,7 +104,6 @@ fn init_config() -> Result<()> { |
| 105 |
let config_path = config_dir.join("config.lua"); |
104 |
let config_path = config_dir.join("config.lua"); |
| 106 |
std::fs::write(&config_path, config_template)?; |
105 |
std::fs::write(&config_path, config_template)?; |
| 107 |
|
106 |
|
| 108 |
- // Update LSP files |
|
|
| 109 |
update_lsp_files()?; |
107 |
update_lsp_files()?; |
| 110 |
|
108 |
|
| 111 |
println!("✓ Config created at {:?}", config_path); |
109 |
println!("✓ Config created at {:?}", config_path); |
| @@ -119,16 +117,13 @@ fn init_config() -> Result<()> { |
| 119 |
fn update_lsp_files() -> Result<()> { |
117 |
fn update_lsp_files() -> Result<()> { |
| 120 |
let config_dir = get_config_path(); |
118 |
let config_dir = get_config_path(); |
| 121 |
|
119 |
|
| 122 |
- // Create lib directory for LSP files |
|
|
| 123 |
let lib_dir = config_dir.join("lib"); |
120 |
let lib_dir = config_dir.join("lib"); |
| 124 |
std::fs::create_dir_all(&lib_dir)?; |
121 |
std::fs::create_dir_all(&lib_dir)?; |
| 125 |
|
122 |
|
| 126 |
- // Always overwrite oxwm.lua with the version from this binary |
|
|
| 127 |
let oxwm_lua_template = include_str!("../../templates/oxwm.lua"); |
123 |
let oxwm_lua_template = include_str!("../../templates/oxwm.lua"); |
| 128 |
let oxwm_lua_path = lib_dir.join("oxwm.lua"); |
124 |
let oxwm_lua_path = lib_dir.join("oxwm.lua"); |
| 129 |
std::fs::write(&oxwm_lua_path, oxwm_lua_template)?; |
125 |
std::fs::write(&oxwm_lua_path, oxwm_lua_template)?; |
| 130 |
|
126 |
|
| 131 |
- // Create/update .luarc.json for LSP configuration |
|
|
| 132 |
let luarc_content = r#"{ |
127 |
let luarc_content = r#"{ |
| 133 |
"workspace.library": [ |
128 |
"workspace.library": [ |
| 134 |
"lib" |
129 |
"lib" |