ballerina-platform / ballerina-lang

The Ballerina Programming Language
https://ballerina.io/
Apache License 2.0
3.66k stars 750 forks source link

[Bug]: Returning null as the description in markdownDocumentation when trying to get the BSymbol #40671

Open mindula opened 1 year ago

mindula commented 1 year ago

Description

When trying to retrieve the BSymbol, the description appears as null in the markdownDocumentation. Hence, when we hover over the following named arg auth, the type is not shown.

Screenshot 2023-06-13 at 15 04 24

Steps to Reproduce

import ballerina/http;

final http:Client ep = check new ("https://localhost:9091/items",
    auth = {},
    secureSocket = {
        cert: "./resources/public.crt"
    });

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Compilation

Related issue(s) (optional)

38874

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

mindula commented 1 year ago

@LakshanWeerasinghe

gimantha commented 1 year ago

Simpler example to reproduce the issue without standard library dependencies:

public type ABC record {|
    int a?;
    int b?;
|};

public type Foo record {|
    ABC auth?;
|};

type DDD record {|
    int x;
|};

type CCC record {|
    *DDD;
    int f;
|};

public function ddd(string name, *Foo fd) {
    CCC _ = {x: 0, f: 0};
}

public function main() {
    ddd(name = "FDFD", auth = {});
}

We need to handle the Record field symbol in https://github.com/ballerina-platform/ballerina-lang/blob/c5b312be47558e63f943580fda433e345a61d7a0/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/hover/HoverObjectResolver.java#L47

Then the type will be shown and type will be shown for record mapping constructors as well.