Open malinthar opened 2 years ago
The number of cases to consider is overwhelming.
For example following are some of the cases.
type MyRecord record {|
string name;
int age;
string job;
|};
public function main() {
MyRecord rec = {age: 0, job: "doctor", <cursor>};
MyRecord rec2 = {<cursor>}
rec = {
<cursor>
}
rec = {
age: 0,
<cursor>
job: "doctor"
};
rec = {
age: 0,
<cursro>
};
test({name: "", age: 0});
}
function test(MyRecord rec) {
}
IMHO, it is best not to include the formatting logic in the text edit of the completion item. The users can use the Ballerina formatter to format the file or a selected range. Therefore, we can deprioritize this issue for the moment.
Description: Consider the following screen capture
The text edit of the above completion item is as follows.
The text edit should be formatted as follows.