[fpc-pascal] Pascal Language Server

Michael Van Canneyt michael at freepascal.org
Thu Apr 23 10:00:49 CEST 2020

On Thu, 23 Apr 2020, Ryan Joseph via fpc-pascal wrote:

> Arjan, I briefly skimmed over your code and it looks like instead of using the "DocParser" unit that I was using the parse the files, you're directly using the Lazarus "CodeToolBoss" which I don't have any experience with.
> I think it was Michael actually who instructed me to use this parser but I also think he said the Lazarus code tools use this under the hood.

I don't think I did the latter part, since the codetoolboss is not using the

There are several parsers:

* docparser - not linked to FPC/Lazarus.
   (I can't comment on the completeness, but I would suppose it's very complete)

* fcl-passrc - used in pas2js so very complete.

* I suppose the JCF has its own parser.

* lazarus codetoolboss - used in Lazarus IDE.

Probably the lazarus codetoolboss is best suited for the job since it is
designed to work with incomplete sources. The others are all designed to work
with completed and known-to-be-correct sources. 
e.g. fcl-passrc normally stops on the first error.

> What are the implications of using the code tools as opposed to
> implementing the parser directly?  If you have documents you could direct
> me to about the code tool units that would be helpful.  I have an ok
> understand of LSP now and I want to make sure the code tools is able to
> supply everything we need.

I think the decision to use the codetoolboss is the best, see above as to why.


More information about the fpc-pascal mailing list