> @techee

> TM gives you more info than what you can obtain from LSP using its API
> What extra does TM have?

I should maybe have said "incompatible" or vaguely described. First, you can't 
be sure that the LSP server returns all the fields or that it even support 
certain feature. For instance, the `documentSymbol` call may not be supported 
at all. Then, some fields of the returned structures may not be returned, for 
instance, the documentSymbol structure looks this way:
```
export interface DocumentSymbol {

        /**
         * The name of this symbol. Will be displayed in the user interface and
         * therefore must not be an empty string or a string only consisting of
         * white spaces.
         */
        name: string;

        /**
         * More detail for this symbol, e.g the signature of a function.
         */
        detail?: string;

        /**
         * The kind of this symbol.
         */
        kind: SymbolKind;

        /**
         * Tags for this document symbol.
         *
         * @since 3.16.0
         */
        tags?: SymbolTag[];

        /**
         * Indicates if this symbol is deprecated.
         *
         * @deprecated Use tags instead
         */
        deprecated?: boolean;

        /**
         * The range enclosing this symbol not including leading/trailing 
whitespace
         * but everything else like comments. This information is typically 
used to
         * determine if the clients cursor is inside the symbol to reveal in the
         * symbol in the UI.
         */
        range: Range;

        /**
         * The range that should be selected and revealed when this symbol is 
being
         * picked, e.g. the name of a function. Must be contained by the 
`range`.
         */
        selectionRange: Range;

        /**
         * Children of this symbol, e.g. properties of a class.
         */
        children?: DocumentSymbol[];
}
```

All the members with `?` may be omitted. Second, for instance `detail` is 
defined as
```
More detail for this symbol, e.g the signature of a function.
```
You can't be sure if it contains signature or not - for instance, for C it 
contains `void (gpointer)` for a void function returning void and taking 
`gpointer` parameter, for Go it's something like `func(bar int) string` and one 
would have to implement a LSP-server-specific parser of these fields to get the 
true signature out of strings like that.

Then the `SymbolKind` kind contains symbol kinds but these are different than 
the one Geany uses; moreover, depending on the LSP protocol version the server 
supports, it may contain only a subset of the values so may get different 
results with different versions of the same LSP server.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3571#issuecomment-1793392440
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3571/c1793392...@github.com>

Reply via email to