fix 'Cannot resolve std library import'

This commit is contained in:
Techatrix 2022-08-05 13:01:39 +02:00
parent 6ed5ba833b
commit c9d41650da
3 changed files with 9 additions and 7 deletions

View File

@ -54,6 +54,7 @@ allocator: std.mem.Allocator,
handles: UriToHandleMap = .{}, handles: UriToHandleMap = .{},
build_files: BuildFileList = .{}, build_files: BuildFileList = .{},
// TODO use pointer back to Server.config
config: Config, config: Config,
std_uri: ?[]const u8, std_uri: ?[]const u8,
// TODO make this configurable // TODO make this configurable

View File

@ -2568,15 +2568,16 @@ pub fn init(
// see: https://github.com/zigtools/zls/issues/536 // see: https://github.com/zigtools/zls/issues/536
analysis.init(allocator); analysis.init(allocator);
var server: Server = .{ var cfg = config;
.config = config,
try cfg.configChanged(allocator, config_path);
return Server{
.config = cfg,
.allocator = allocator, .allocator = allocator,
.document_store = try DocumentStore.init(allocator, config), .document_store = try DocumentStore.init(allocator, cfg),
.log_level = log_level, .log_level = log_level,
}; };
try server.configChanged(config_path);
return server;
} }
pub fn deinit(server: *Server) void { pub fn deinit(server: *Server) void {

View File

@ -14,7 +14,7 @@ test "Open file, ask for semantic tokens" {
try ctx.request("textDocument/semanticTokens/full", try ctx.request("textDocument/semanticTokens/full",
\\{"textDocument":{"uri":"file:///test.zig"}} \\{"textDocument":{"uri":"file:///test.zig"}}
, ,
\\{"data":[0,0,5,7,0,0,6,3,2,32,0,4,1,11,0,0,2,7,12,0,0,8,5,9,0]} \\{"data":[0,0,5,7,0,0,6,3,0,33,0,4,1,11,0,0,2,7,12,0,0,8,5,9,0]}
); );
} }