Skip to content

Commit

Permalink
format all the files with the new fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jul 3, 2024
1 parent e91f8a4 commit 25f18df
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/analyzer/psi/GenericTypeInferer.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import math

struct GenericTypeInferer {}

fn (g &GenericTypeInferer) infer_generic_call(arg_owner GenericArgumentsOwner, params_owner GenericParametersOwner, result_type types.Type) types.Type {
fn (g &GenericTypeInferer) infer_generic_call(arg_owner GenericArgumentsOwner, params_owner GenericParametersOwner,
result_type types.Type) types.Type {
generic_ts_map := g.infer_generic_ts_map(arg_owner, params_owner)
return result_type.substitute_generics(generic_ts_map)
}
Expand Down Expand Up @@ -43,7 +44,8 @@ fn (g &GenericTypeInferer) infer_generic_ts_map(arg_owner GenericArgumentsOwner,
return g.infer_simple_generic_ts_map(arg_owner, params_owner, map[string]types.Type{})
}

fn (g &GenericTypeInferer) infer_simple_generic_ts_map(arg_owner GenericArgumentsOwner, params_owner GenericParametersOwner, additional map[string]types.Type) map[string]types.Type {
fn (g &GenericTypeInferer) infer_simple_generic_ts_map(arg_owner GenericArgumentsOwner, params_owner GenericParametersOwner,
additional map[string]types.Type) map[string]types.Type {
generic_parameters := g.generics_parameter_names(params_owner)

// No data for inference, call is not generic.
Expand Down
3 changes: 2 additions & 1 deletion src/analyzer/psi/StubBase.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ pub mut:
id StubId
}

pub fn new_stub_base(parent &StubElement, stub_type StubType, name string, identifier_text_range TextRange, text_range TextRange, data StubData) &StubBase {
pub fn new_stub_base(parent &StubElement, stub_type StubType, name string, identifier_text_range TextRange,
text_range TextRange, data StubData) &StubBase {
mut stub_list := if parent is StubBase {
if !isnil(parent.stub_list) { parent.stub_list } else { &StubList{} }
} else {
Expand Down
6 changes: 4 additions & 2 deletions src/analyzer/psi/TypeInferer.v
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ pub fn (t &TypeInferer) infer_call_expr_type(element CallExpression) types.Type
return types.unknown_type
}

pub fn (t &TypeInferer) process_map_array_method_call(element FunctionOrMethodDeclaration, element_type types.FunctionType, expr CallExpression) ?types.Type {
pub fn (t &TypeInferer) process_map_array_method_call(element FunctionOrMethodDeclaration, element_type types.FunctionType,
expr CallExpression) ?types.Type {
receiver_type := types.unwrap_pointer_type(element.receiver_type())

if types.is_builtin_array_type(receiver_type) {
Expand All @@ -531,7 +532,8 @@ pub fn (t &TypeInferer) process_map_array_method_call(element FunctionOrMethodDe
return none
}

pub fn (_ &TypeInferer) process_array_method_call(element FunctionOrMethodDeclaration, element_type types.FunctionType, expr CallExpression) ?types.Type {
pub fn (_ &TypeInferer) process_array_method_call(element FunctionOrMethodDeclaration, element_type types.FunctionType,
expr CallExpression) ?types.Type {
return_type := element_type.result

if return_type is types.VoidPtrType {
Expand Down
3 changes: 2 additions & 1 deletion src/analyzer/psi/search/common.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import analyzer.psi
import analyzer.psi.types

// is_implemented checks if the given symbol (methods and fields) implements the given interface (methods and fields).
fn is_implemented(iface_methods []psi.PsiElement, iface_fields []psi.PsiElement, symbol_methods []psi.PsiElement, symbol_fields []psi.PsiElement) bool {
fn is_implemented(iface_methods []psi.PsiElement, iface_fields []psi.PsiElement, symbol_methods []psi.PsiElement,
symbol_fields []psi.PsiElement) bool {
mut symbol_methods_set := map[string]psi.FunctionOrMethodDeclaration{}
for symbol_method in symbol_methods {
if symbol_method is psi.FunctionOrMethodDeclaration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn (mut r ReferenceCompletionProvider) add_completion(ctx &completion.Completion
}
}

fn (mut r ReferenceCompletionProvider) process_fields(ctx &completion.CompletionContext, element psi.PsiElement, already_assigned []string) {
fn (mut r ReferenceCompletionProvider) process_fields(ctx &completion.CompletionContext, element psi.PsiElement,
already_assigned []string) {
grand := element.parent() or { return }
if grand.node.type_name != .element_list {
return
Expand Down

0 comments on commit 25f18df

Please sign in to comment.