Skip to content

Commit

Permalink
Address review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
malinthar committed Jul 26, 2023
1 parent ba13e1a commit 70de0f2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public Object[][] dataProvider() {
return new Object[][]{
{"sample_completion_package_1/main.bal", 22, 5, "expected_completions1.json"},
{"sample_completion_package_2/main.bal", 22, 5, "expected_completions1.json"},
{"sample_completion_package_2/main.bal", 35, 5, "expected_completions1.json"},

{"sample_completion_package_2/main.bal", 35, 5, "expected_completions1.json"}
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public List<CompletionItem> getCompletions(CompletionContext completionContext,

//Add resource function snippets for get,post,delete,put,head,and options http methods.
return Constants.METHODS.stream().map(method -> {
String insertText = "resource function " + method + " "
+ CompletionUtil.getPlaceHolderText(1, "path")
+ "(" + CompletionUtil.getPlaceHolderText(2) + ") " + CompletionUtil.getPlaceHolderText(3)
+ "{" + CompletionUtil.LINE_BREAK + CompletionUtil.PADDING + CompletionUtil.getPlaceHolderText(4)
+ CompletionUtil.LINE_BREAK + "}";
String insertText = String.format("resource function %s %s(%s) %s{%s}", method
, CompletionUtil.getPlaceHolderText(1, "path")
, CompletionUtil.getPlaceHolderText(2), CompletionUtil.getPlaceHolderText(3)
, CompletionUtil.LINE_BREAK + CompletionUtil.PADDING + CompletionUtil.getPlaceHolderText(4)
+ CompletionUtil.LINE_BREAK);
String label = "resource function " + method + " path()";
return new CompletionItem(label, insertText, CompletionItem.Priority.HIGH);
}).collect(Collectors.toList());
Expand Down

0 comments on commit 70de0f2

Please sign in to comment.