[fpc-pascal] Pascal Language Server

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Apr 23 10:49:47 CEST 2020

> Ryan Joseph via fpc-pascal <fpc-pascal at lists.freepascal.org> hat am 23. April 2020 um 10:14 geschrieben:
> > On Apr 23, 2020, at 3:00 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> > 
> > I think the decision to use the codetoolboss is the best, see above as to why.
> Very well. I assume the code tools parses the entire project and keeps the symbols in a database? That was something I was going to have to implement myself so it's good to not have to now.
> I'm using the parser with "TPasElement" so I think that's fcl-passrc. It's a shame to have so many competing parsers but yours looked really solid to me.

These parsers are optimized for different purposes.
fcl-passrc is for parsing like a compiler. It parses everything everytime and has neither functions to alter code nor code completion.
codetools is for parsing only needed unit interfaces/implementations and when a file changes, parse only things that have changed. And it provides many code completions. 

> Here the basics which code tools needs needs to provide:
> 1) Basic identifier completions like function, class, types names etc... these should be scope sensitive based on the document offset we receive from LSP.


> 2) Function parameter completions.

see lazarus/ide/codecontextform.pas for an example.

> 3) Class/record member completions.

I guess you mean identifier completion after a dot.
> 4) Identifier references, i.e return all locations "DoThis" was called in the current workspace. (Workspace is the LSP term for the project). Code tools thus needs to parse all files in the workspace upon initialization.


> 5) Go to definition/declaration in workspace.

> 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.


More information about the fpc-pascal mailing list