Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
awelc committed Nov 5, 2024
1 parent ed800be commit 1bfcd63
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
warning[W10007]: issue with attribute value
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:1:9
1 │ #[allow(ide_path_autocomplete)]
│ ^^^^^^^^^^^^^^^^^^^^^ Unknown warning filter 'ide_path_autocomplete'

error[E04023]: invalid method call
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9
23 │ c.b.a.b(); // unresolved method name
│ ^^^^^^^^^
│ │ │
│ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m'
│ Invalid method call. No known method 'b' on type 'a::m::A'

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:10
21 │ c.b.a; // two dots that should trigger auto-completion
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:11
21 │ c.b.a; // two dots that should trigger auto-completion
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:12
21 │ c.b.a; // two dots that should trigger auto-completion
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:21:13
21 │ c.b.a; // two dots that should trigger auto-completion
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:10
22 │ c.b.a.bar(); // resolved method name
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:11
22 │ c.b.a.bar(); // resolved method name
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:12
22 │ c.b.a.bar(); // resolved method name
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:13
22 │ c.b.a.bar(); // resolved method name
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:14
22 │ c.b.a.bar(); // resolved method name
│ ^ Possible dot names: 'a::m::bar' or 'x'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:22:15
22 │ c.b.a.bar(); // resolved method name
│ ^^^ Possible dot names: 'a::m::bar' or 'x'

error[E04023]: invalid method call
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:9
23 │ c.b.a.b(); // unresolved method name
│ ^^^^^^^^^
│ │ │
│ │ No local 'use fun' alias was found for 'a::m::A.b', and no function 'b' was found in the defining module 'a::m'
│ Invalid method call. No known method 'b' on type 'a::m::A'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:10
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:11
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'b'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:12
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:13
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'a'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:14
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'a::m::bar' or 'x'

note[I15001]: IDE dot autocomplete
┌─ tests/move_2024/ide_mode/on_dot_autocomplete.move:23:15
23 │ c.b.a.b(); // unresolved method name
│ ^ Possible dot names: 'a::m::bar' or 'x'

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#[allow(ide_path_autocomplete)]
module a::m {

public struct A has copy, drop {
x: u64
}

public struct B has copy, drop {
a: A
}

public struct C has copy, drop {
b: B
}

public fun bar(_a: A) {}

public fun foo() {
let b = B { a: A { x: 0 } };
let c = C { b: b };
c.b.a; // two dots that should trigger auto-completion
c.b.a.bar(); // resolved method name
c.b.a.b(); // unresolved method name
}
}

0 comments on commit 1bfcd63

Please sign in to comment.