Fix panic caused by custom zls.json path (#1177)

* fix(config): fix panic caused by custom configuration file path.

* fix(config): revert `openDir` related code
This commit is contained in:
Ai Hoshino 2023-05-13 13:53:44 +08:00 committed by GitHub
parent d0a9911a3a
commit 91645612e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1569,7 +1569,12 @@ pub fn create(
};
server.analyser = Analyser.init(allocator, &server.document_store);
try configuration.configChanged(config, &server.runtime_zig_version, allocator, config_path);
var builtin_creation_dir = config_path;
if (config_path) |path| {
builtin_creation_dir = std.fs.path.dirname(path);
}
try configuration.configChanged(config, &server.runtime_zig_version, allocator, builtin_creation_dir);
if (config.dangerous_comptime_experiments_do_not_enable) {
server.analyser.ip = try analyser.InternPool.init(allocator);