Implemented the signature help request.

Refreshes builtin data, added 0.7.1 builtins
This commit is contained in:
Alexandros Naskos
2021-04-02 20:49:01 +03:00
parent 9cc8085699
commit 7f432d8715
11 changed files with 3864 additions and 683 deletions

View File

@@ -2234,6 +2234,21 @@ pub fn iterateSymbolsGlobal(
return try iterateSymbolsGlobalInternal(store, arena, handle, source_index, callback, context, &use_trail);
}
pub fn innermostScope(handle: DocumentStore.Handle, source_index: usize) ast.Node.Index {
var current = handle.document_scope.scopes[0].data.container;
if (handle.document_scope.scopes.len == 1) return current;
for (handle.document_scope.scopes[1..]) |scope| {
if (source_index >= scope.range.start and source_index <= scope.range.end) {
switch (scope.data) {
.container, .function, .block => |node| current = node,
else => {},
}
}
}
return current;
}
pub fn innermostContainer(handle: *DocumentStore.Handle, source_index: usize) TypeWithHandle {
var current = handle.document_scope.scopes[0].data.container;
if (handle.document_scope.scopes.len == 1) return TypeWithHandle.typeVal(.{ .node = current, .handle = handle });