[fpc-pascal] Pascal Language Server
Mattias Gaertner
nc-gaertnma at netcologne.de
Thu Apr 23 11:09:21 CEST 2020
> Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> hat am 23. April 2020 um 10:58 geschrieben:
>
>
> > On Apr 23, 2020, at 3:49 PM, Mattias Gaertner via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> > > 3) Class/record member completions.
> > I guess you mean identifier completion after a dot.
>
> Exactly. Fields or methods and helpers even if possible. I assume that exists.
>
> Btw, the names you're giving like "FindDeclaration" where can I find these? Maybe there's a wiki or unit header I can look at.
https://wiki.freepascal.org/Codetools
And then look at the examples in lazarus/components/codetools/examples.
> > > I would like to implement "code lens" which shows the context of a symbol in a popup window but I think only VScode supports this feature and it's no common so code tools may not be able to retrieve.
> > What do you mean with "context"? Codetools can give you all kind of context.
>
> For example VScode lets you hover over a symbol name like TObject and a window will popup that shows the declaration in code, like a mini-editor that goes to the line where the declaration starts in that file. It's basically the same as opening a new tab/window but it's more for really quick references. I'm not sure how it's implemented in LSP but maybe you could return the line number and file name and the client does the rest.
FindDeclaration gives you the line and column. You can also get the source span of the declaration.
And there is FindSmartHint, which returns a brief text for a declaration including some context like type/var/const, private/public, parent class, etc.
Mattias
More information about the fpc-pascal
mailing list