fmt: keep any langauge prefix variations in struct fields (#7534)
parent
e5d3aa916d
commit
691e6f9d3f
|
@ -622,7 +622,7 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl) {
|
|||
max = comments_len + field.name.len
|
||||
}
|
||||
mut ft := f.no_cur_mod(f.table.type_to_str(field.typ))
|
||||
if !ft.starts_with('C.') && !ft.starts_with('JS.') {
|
||||
if !ft.contains('C.') && !ft.contains('JS.') {
|
||||
ft = f.short_module(ft)
|
||||
}
|
||||
field_types << ft
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import os
|
||||
|
||||
struct KeepAnyLanguagePrefixVariation {
|
||||
x C.bar
|
||||
y &C.bar
|
||||
z []C.bar
|
||||
z2 []&C.bar
|
||||
}
|
||||
|
||||
fn foo(a []os.File) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue