Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
I have FindCodeContext working correctly I believe because ProcName from TCodeContextInfo returns the correct name of the function. In TCodeContextInfoItem the params string list is nil though. Shouldn't that contain the list of parameters? Not sure how this intended to be used if that list of

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
In the FPC streaming system with published properties, what type do I use for an array of strings? I've tried TStringList and TCollection but they give me errors like: :: <~~ pascal-language-server 1: {'message': ' : Unsupported JSON type for object property: "jtArray"', 'code': -32603}

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 9:44 PM, Mattias Gaertner via fpc-pascal > wrote: > >> I assumed it was just a >> reference to the current file which corresponds to the line/column >> numbers. >> >> Sorry, what do you want to see a demo of? The language server? > > Yes. The first message has the

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Joost van der Sluis
Op 24-04-2020 om 16:44 schreef Mattias Gaertner via fpc-pascal: On Fri, 24 Apr 2020 21:34:41 +0700 Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 9:28 PM, Mattias Gaertner via fpc-pascal wrote: Still FindFile instead of LoadFile? Do you get all mails from this list? I don't know

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 21:34:41 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 9:28 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Still FindFile instead of LoadFile? > > > > Do you get all mails from this list? > > I don't know what the code buffer technically is but

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 9:28 PM, Mattias Gaertner via fpc-pascal > wrote: > > Still FindFile instead of LoadFile? > > Do you get all mails from this list? I don't know what the code buffer technically is but FindFile works after the source was set previously. I assumed it was just a

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 20:58:45 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:54 PM, Ryan Joseph > > wrote: > > > > I'm not able to get this one working then. Is the buffer the > > current file? This is what I'm doing: > > > > > >URI := ParseURI(textDocument.uri); > >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:54:43 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:49 PM, Mattias Gaertner via fpc-pascal > > wrote: > >> When I hover over a function in Lazarus I get a function definition > >> and unit location. Is that coming from > >> TCodeManager.FindSmartHint?

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 4:54 PM, Ryan Joseph wrote: > > I'm not able to get this one working then. Is the buffer the current file? > This is what I'm doing: > > >URI := ParseURI(textDocument.uri); >Code := CodeToolBoss.FindFile(URI.Path + URI.Document); >X := position.character; >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 5:28 PM, Joost van der Sluis wrote: > > I did not have a look at your code, but if you have serialization-issues, you > might consider looking at Cerialization. > (https://gitlab.freepascal.org/Joost/cerialization) > > It is what I use for my debugging-project. And it

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Joost van der Sluis
Op 24-04-2020 om 11:25 schreef Arjan Adriaanse: Indeed with the current way JSON streaming is handled, optional values are not considered. This needs more work and the issue is tracked here https://github.com/arjanadriaanse/pascal-language-server/issues/7 [1]. I did not have a look at your

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:40:14 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 24, 2020, at 4:35 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > codetools that scans Lazarus packages. > > > > In Short: You can omit LAZARUSDIR. > > > > Setting PP might be useful. > > > > You can add

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 4:49 PM, Mattias Gaertner via fpc-pascal > wrote: > >> When I hover over a function in Lazarus I get a function definition >> and unit location. Is that coming from TCodeManager.FindSmartHint? > > Yes I'm not able to get this one working then. Is the buffer the current

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 4:25 PM, Arjan Adriaanse wrote: Indeed with the current way JSON streaming is handled, optional values are not considered. This needs more work and the issue is tracked here

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 16:39:09 +0700 Ryan Joseph via fpc-pascal wrote: > When I hover over a function in Lazarus I get a function definition > and unit location. Is that coming from TCodeManager.FindSmartHint? Yes Mattias ___ fpc-pascal maillist -

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 4:35 PM, Mattias Gaertner via fpc-pascal > wrote: > > codetools that scans Lazarus packages. > > In Short: You can omit LAZARUSDIR. > > Setting PP might be useful. > > You can add unit and include paths: >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
When I hover over a function in Lazarus I get a function definition and unit location. Is that coming from TCodeManager.FindSmartHint? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 15:11:26 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > > It does not require lazarus, but it does require the FPC source > > tree. > > Ok then. How do I setup code tools on the FPC source tree? See my mail about SimpleInit. Mattias

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 10:59:21 +0200 Arjan Adriaanse wrote: > The options for initializing CodeToolsBoss are passed through > environment variables as described at > https://wiki.lazarus.freepascal.org/Codetools [1]. > > For example, mine are set up as follows through the Emacs client > settings.

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 4:25 PM, Arjan Adriaanse wrote: > > Indeed with the current way JSON streaming is handled, optional values > are not considered. This needs more work and the issue is tracked > here https://github.com/arjanadriaanse/pascal-language-server/issues/7 > [1]. We may need to

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 2:54 PM, Michael Van Canneyt wrote: What do you want to omit exactly ? For example, I'm not a lazarus user but I'm getting strange errors that don't relate to my single file program. That's going to confuse

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Arjan Adriaanse
Indeed with the current way JSON streaming is handled, optional values are not considered. This needs more work and the issue is tracked here https://github.com/arjanadriaanse/pascal-language-server/issues/7 [1]. Regards, Arjan [1]

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 3:59 PM, Arjan Adriaanse wrote: > > FPCDIR="/usr/lib/fpc/3.2.0/source" > LAZARUSDIR="/usr/share/lazarus" I see now! I didn't know that but it's easy to document once we get that far. btw, I'm having a problem with the fact that published un-set properties are being set

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Arjan Adriaanse
The options for initializing CodeToolsBoss are passed through environment variables as described at https://wiki.lazarus.freepascal.org/Codetools [1]. For example, mine are set up as follows through the Emacs client settings. FPCDIR="/usr/lib/fpc/3.2.0/source" LAZARUSDIR="/usr/share/lazarus"

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 3:32 PM, Mattias Gaertner via fpc-pascal > wrote: > > Are there any ppu files left after "make distclean"? I just trashed the entire thing and started over. It was easier that way, much easier. It's working now so I'm happy. :) I'm still getting that code tools error

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 22:11:54 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 10:07 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Please post the last couple of lines, e.g. starting at the last > > ppcx64 call. > > > > /bin/cp -f Makefile.compiled >

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 2:54 PM, Michael Van Canneyt > wrote: > > What do you want to omit exactly ? For example, I'm not a lazarus user but I'm getting strange errors that don't relate to my single file program. That's going to confuse users like it did me. I'd like to omit the need to

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 2:37 PM, Mattias Gaertner via fpc-pascal wrote: fpextres.ppu is installed by default on darwin. Maybe you didn't setup codetools for your fpc units. Because of the vast amount of fpc units, codetools needs to

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 2:37 PM, Mattias Gaertner via fpc-pascal > wrote: > > fpextres.ppu is installed by default on darwin. > Maybe you didn't setup codetools for your fpc units. Because of the > vast amount of fpc units, codetools needs to scan them once. There is a > simple init function,

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 14:12:48 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > In my test I'm getting an error at this block, "Parse error: unit not > found: fpextres". > > Does code tools need access to this unit? It's not part of the source > I've supplied it so I don't know why it's looking

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 1:47 PM, Ryan Joseph wrote: end else begin if CodeToolBoss.ErrorMessage<>'' then writeln(stderr, 'Parse error: ',CodeToolBoss.ErrorMessage) else writeln(stderr, 'Error: no context');

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 1:47 PM, Ryan Joseph wrote: > >end else begin > if CodeToolBoss.ErrorMessage<>'' then >writeln(stderr, 'Parse error: ',CodeToolBoss.ErrorMessage) > else >writeln(stderr, 'Error: no context'); >end; In my test I'm getting an error at this

Re: [fpc-pascal] Pascal Language Server

2020-04-24 Thread Ryan Joseph via fpc-pascal
> On Apr 24, 2020, at 12:46 PM, Michael Van Canneyt > wrote: > > I fixed TCustomJSONRPCDispatcher not to add a Null in case of V2. But V1 > needs it. > see https://www.jsonrpc.org/specification_v1 > > Committed in revision 45047. Nice, it was a bug. :) So the Sublime Text people explained