Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(completion): add virtual fun foo() {} to completion #114

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ export class MemberFunctionCompletionProvider implements CompletionProvider {
insertTextFormat: InsertTextFormat.Snippet,
weight: CompletionWeight.KEYWORD,
})

result.add({
label: "virtual fun",
labelDetails: {
detail: " name() {}",
},
kind: CompletionItemKind.Keyword,
insertText: "virtual fun $1($2)$3 {$0}",
insertTextFormat: InsertTextFormat.Snippet,
weight: CompletionWeight.KEYWORD,
})
}
}
}
1 change: 1 addition & 0 deletions server/src/e2e/suite/testcases/completion/constants.test
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ trait Foo {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}
6 changes: 6 additions & 0 deletions server/src/e2e/suite/testcases/completion/traits.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of override methods in trait with deep inheritance
Expand Down Expand Up @@ -54,6 +55,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of override methods in trait with method
Expand Down Expand Up @@ -82,6 +84,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of fields in trait
Expand Down Expand Up @@ -110,6 +113,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of fields in trait with deep inheritance
Expand Down Expand Up @@ -144,6 +148,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of fields in trait with field
Expand Down Expand Up @@ -175,6 +180,7 @@ trait Child with Parent {
13 receive(msg: <type>) {}
13 receive("<message>") {}
13 receive() {}
13 virtual fun name() {}

========================================================================
Completion of methods and fields without self
Expand Down