GithubHelp home page GithubHelp logo

Comments (4)

RyanCavanaugh avatar RyanCavanaugh commented on June 27, 2024

Simpler repro that's demonstrative

interface Foo {
    bar(): void;
}
interface Baz { }

interface Foo {
    bar(s?: string): void;
}

image

{
    "seq": 0,
    "type": "response",
    "command": "navtree",
    "request_seq": 22,
    "success": true,
    "body": {
        "text": "<global>",
        "kind": "script",
        "kindModifiers": "",
        "spans": [
            {
                "start": {
                    "line": 1,
                    "offset": 1
                },
                "end": {
                    "line": 8,
                    "offset": 4
                }
            }
        ],
        "childItems": [
            {
                "text": "Baz",
                "kind": "interface",
                "kindModifiers": "",
                "spans": [
                    {
                        "start": {
                            "line": 4,
                            "offset": 1
                        },
                        "end": {
                            "line": 4,
                            "offset": 18
                        }
                    }
                ],
                "nameSpan": {
                    "start": {
                        "line": 4,
                        "offset": 11
                    },
                    "end": {
                        "line": 4,
                        "offset": 14
                    }
                }
            },
            {
                "text": "Foo",
                "kind": "interface",
                "kindModifiers": "",
                "spans": [
                    {
                        "start": {
                            "line": 1,
                            "offset": 1
                        },
                        "end": {
                            "line": 3,
                            "offset": 2
                        }
                    },
                    {
                        "start": {
                            "line": 6,
                            "offset": 1
                        },
                        "end": {
                            "line": 8,
                            "offset": 2
                        }
                    }
                ],
                "nameSpan": {
                    "start": {
                        "line": 1,
                        "offset": 11
                    },
                    "end": {
                        "line": 1,
                        "offset": 14
                    }
                },
                "childItems": [
                    {
                        "text": "bar",
                        "kind": "method",
                        "kindModifiers": "",
                        "spans": [
                            {
                                "start": {
                                    "line": 2,
                                    "offset": 5
                                },
                                "end": {
                                    "line": 2,
                                    "offset": 17
                                }
                            },
                            {
                                "start": {
                                    "line": 7,
                                    "offset": 5
                                },
                                "end": {
                                    "line": 7,
                                    "offset": 27
                                }
                            }
                        ],
                        "nameSpan": {
                            "start": {
                                "line": 2,
                                "offset": 5
                            },
                            "end": {
                                "line": 2,
                                "offset": 8
                            }
                        }
                    }
                ]
            }
        ]
    }
}

@mjbvz We're sending back two copies of bar that have unambiguously different parent Foo declarations based on the span. Is it incorrect to coalesce like this? What's the expected response shape in this situation?

from typescript.

yyx1111 avatar yyx1111 commented on June 27, 2024

interface Foo {
bar(): void;
}
interface Baz { }

interface Foo {
bar(s?: string): void;
}

let symbols = await vscode.commands.executeCommand(
"vscode.executeDocumentSymbolProvider",
uri
);
20240619150647594
The second "interface Foo"
selectionRange: should be {start:[5,10],end:[5,13]}, should not be {start:[5,0],end:[7,1]}

from typescript.

DanielRosenwasser avatar DanielRosenwasser commented on June 27, 2024

I think for

interface Foo {
    bar(): void;
}
interface Baz { }

interface Foo {
    bar(s?: string): void;
}

Showing the following:

image

feels like a bug on VS Code itself. But I think there is also a question on whether TypeScript should create two separate entries for Foo.

from typescript.

yyx1111 avatar yyx1111 commented on June 27, 2024

This is the case with many d.ts

from typescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.