Re: [fpc-pascal] CodeTools reduce number of completions

2020-07-02 Thread Mattias Gaertner via fpc-pascal
On Thu, 2 Jul 2020 12:55:24 +0700 Ryan Joseph via fpc-pascal wrote: >[...]What would be more helpful is knowing which identifiers are > from those large units and opting out of additional processing. Is > that something which can be quickly known? Maybe something like this: List:=CodeToolBoss.I

Re: [fpc-pascal] CodeTools reduce number of completions

2020-07-01 Thread Mattias Gaertner via fpc-pascal
On Wed, 1 Jul 2020 17:50:50 +0700 Ryan Joseph via fpc-pascal wrote: > I'm using CodeToolBoss.GatherIdentifiers to get completions but with > some units I'm getting 50k identifiers which is simply too much and > too slow. Maybe of these are coming from the RTL I think and I would > be ok with limi

Re: [fpc-pascal] how to make this tp7 code work on fpc

2020-06-27 Thread Mattias Gaertner via fpc-pascal
On Fri, 26 Jun 2020 22:09:39 -0400 Travis Siegel wrote: > I'm porting some code from tp7 to fpc, and I'm running into an error > I don't know how to fix.  The comments claim it's supposed to be a > hash table, but to me, it looks more like labels tied to various > arrays. > > >   Ofs_00_02: Wo

Re: [fpc-pascal] Codetools generic constants

2020-06-25 Thread Mattias Gaertner via fpc-pascal
On Fri, 26 Jun 2020 06:48:52 +0200 Mattias Gaertner via fpc-pascal wrote: > On Fri, 26 Jun 2020 11:36:18 +0700 > Ryan Joseph via fpc-pascal wrote: > > > I got the Lazarus sources on svn and I'm not sure how to make a > > diff! Here are changes I propose to

Re: [fpc-pascal] Codetools generic constants

2020-06-25 Thread Mattias Gaertner via fpc-pascal
On Fri, 26 Jun 2020 11:36:18 +0700 Ryan Joseph via fpc-pascal wrote: > I got the Lazarus sources on svn and I'm not sure how to make a diff! > Here are changes I propose to allow generic constants (I believe this > is Mattias's code so he'll understand). It's just a few lines in a > single functi

Re: [fpc-pascal] Code tools and changing include file text

2020-05-12 Thread Mattias Gaertner via fpc-pascal
On Wed, 13 May 2020 10:48:14 +0700 Ryan Joseph via fpc-pascal wrote: > When a file changes I get the full source text and update the version > in code tools by doing this: > > Code := CodeToolBoss.FindFile(Path); > Code.Source := text; > > This works but I'm having problems with include files n

Re: [fpc-pascal] Code tools search paths

2020-05-12 Thread Mattias Gaertner via fpc-pascal
On Wed, 13 May 2020 10:45:21 +0700 Ryan Joseph via fpc-pascal wrote: > > On May 11, 2020, at 8:02 PM, Ryan Joseph > > wrote: > > > > I wanted this to behave like the compiler normally does, that is > > you supply paths to the units with -Fu and includes with -Fi. What > > is the way to achieve

Re: [fpc-pascal] Code tools search paths

2020-05-11 Thread Mattias Gaertner via fpc-pascal
On Mon, 11 May 2020 16:58:54 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > If I just want to add unit search paths do I do this? The user is > just going to supply absolute paths to the language server (just like > they would from the command line). FPC is happy with ppu files. Codetools need

Re: [fpc-pascal] Code tools search paths

2020-05-11 Thread Mattias Gaertner via fpc-pascal
On Mon, 11 May 2020 10:56:32 +0700 Ryan Joseph via fpc-pascal wrote: > > On May 10, 2020, at 4:47 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > TDefineTemplates. > > see for example > > lazarus/components/codetools/examples/setincludepath.pas >

Re: [fpc-pascal] Code tools search paths

2020-05-10 Thread Mattias Gaertner via fpc-pascal
On Sun, 10 May 2020 16:34:11 +0700 Ryan Joseph via fpc-pascal wrote: > I found out that setting TCodeToolsOptions.FPCOptions (-Fu and -Fi) > was doing something because it helped FindDeclaration to search for > units not in the same same directory as the main program. However now > I've encounter

Re: [fpc-pascal] Using include files in code tools

2020-05-09 Thread Mattias Gaertner via fpc-pascal
On Sat, 9 May 2020 20:55:24 +0700 Ryan Joseph via fpc-pascal wrote: > > On May 9, 2020, at 4:36 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Use Tool.CleanPosToCaret(Node.StartPos,xyp) to get the file, line > > and column. > > Thanks, I

Re: [fpc-pascal] Using include files in code tools

2020-05-09 Thread Mattias Gaertner via fpc-pascal
On Thu, 7 May 2020 20:21:35 +0700 Ryan Joseph via fpc-pascal wrote: > > On May 7, 2020, at 5:26 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Nodes are always associated with a Tool. Tool.MainFilename gives the > > file, where parsing started. > >

Re: [fpc-pascal] Using include files in code tools

2020-05-07 Thread Mattias Gaertner via fpc-pascal
On Thu, 7 May 2020 12:26:53 +0200 Mattias Gaertner via fpc-pascal wrote: >[...]how do I know which include a > > node came from? > > Nodes are always associated with a Tool. Tool.MainFilename gives the > file, where parsing started. > > > I need this information s

Re: [fpc-pascal] Using include files in code tools

2020-05-07 Thread Mattias Gaertner via fpc-pascal
On Thu, 7 May 2020 16:26:12 +0700 Ryan Joseph via fpc-pascal wrote: > When using code tools I've found that it needs to start from a main > unit (otherwise other relevant macros may not be set) and then insert > includes into the source text. This is fine but when I inspect the > node tree (TCode

Re: [fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Mattias Gaertner via fpc-pascal
On Tue, 5 May 2020 11:19:34 +0200 (CEST) Michael Van Canneyt wrote: > On Tue, 5 May 2020, Ryan Joseph via fpc-pascal wrote: > > > > > > >> On May 5, 2020, at 3:56 PM, Michael Van Canneyt > >> wrote: > >> > >> They are in the system unit, so they're always related to any unit. > >> > >> They

Re: [fpc-pascal] Pascal Language Server

2020-05-02 Thread Mattias Gaertner via fpc-pascal
On Sat, 2 May 2020 10:18:36 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > Found the problem. I overwrote "FirstChild" of TCodeTreeNode using a > var param. oops! I still thought LoadFile should have rebuilt the > node tree but it doesn't seem to do this (even if UpdateFromDisk and > Revert par

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
On Fri, 1 May 2020 21:32:24 +0700 Ryan Joseph via fpc-pascal wrote: > > On May 1, 2020, at 9:28 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > "Explore" checks if some files have changed and if so rebuilds the > > nodes. > > so I missed

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
On Fri, 1 May 2020 20:23:01 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > > What are you doing between calls of Explore? > > I'm walking the node tree and then using the Start/EndPos to read > into the source text so that I can extract identifier. It's just: > LoadFile, Explore, WalkTree. I

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
On Wed, 29 Apr 2020 21:18:02 +0700 Ryan Joseph via fpc-pascal wrote: > Testing this more I'm having a problem getting overwhelmed by > completions for classes because of methods from TObject (and other > parents) The RTL is powerful. That's why I prefer to put recently used identifiers at top of

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
This thread is getting too long. Can you please create new threads for new topics? On Fri, 1 May 2020 16:27:46 +0700 Ryan Joseph via fpc-pascal wrote: > Ok, got things working now. Here's the basic pattern I'm using. I > call explore and then walk the root tree node to find what I need but > i'

Re: [fpc-pascal] Pascal Language Server

2020-05-01 Thread Mattias Gaertner via fpc-pascal
On Fri, 1 May 2020 12:31:26 +0700 Ryan Joseph via fpc-pascal wrote: > Stuck on another code tools problem. > > I've been using code like this to find words at node offsets and this > works well until there are $ifdefs in the file and then the text > position getting offset and fail to return the

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 20:58:18 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 8:52 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Codetoolboss.Error* > > Not sure I'm understand the usage. When do I check for errors and are > t

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 20:28:16 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > Speaking of that is there a way in code tools to get a list of > parsing errors that occurred for a given file? It's possible that > parsing fails but I don't know where errors occurred until I make a > query and comes

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 15:34:57 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 3:26 PM, Michael Van Canneyt > > wrote: > > > > That's a wrong approach. Pascal units are in a uses-tree. You need > > a starting point, the top of the tree: a single module. > > I can make the user

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Mattias Gaertner via fpc-pascal
On Tue, 28 Apr 2020 09:34:36 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 28, 2020, at 4:18 AM, Mattias Gaertner via fpc-pascal > > wrote: >[...] > LSP doesn't have a concept of the "main file" but this seems to > require the main program file to star

Re: [fpc-pascal] Pascal Language Server

2020-04-27 Thread Mattias Gaertner via fpc-pascal
On Mon, 27 Apr 2020 22:12:30 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 26, 2020, at 4:46 PM, Ryan Joseph > > wrote: > > > > The other thing I'm stuck on with code tools. In TCodeManagerTool: > > > >function FindReferences(IdentifierCode: TCodeBuffer; > > X, Y: integer; Se

Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 15:49:30 +0200 Martin Frb wrote: > On 23/04/2020 22:10, Joost van der Sluis wrote: > > But maybe it should become a separate package now. Lazarus can use > > is as a dependency. We'll see. > > That would then reverse the burden > > As it is part of bigide, it must be s

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 21:08:52 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 25, 2020, at 8:49 PM, Michael Van Canneyt > > wrote: > > > > It will run on a server that never installed lazarus. > > Excellent. Where are the caches kept btw? Memory. Mattias __

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 19:43:32 +0700 Ryan Joseph via fpc-pascal wrote: > Is the following line something which can be cached? Currently this > is going to be called very often but is it an expensive operation? > Not sure what it does exactly > > Code := CodeToolBoss.FindFile(URI.Path + URI.Doc

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 19:29:41 +0700 Ryan Joseph via fpc-pascal wrote: >[...] > Since we're so invested in code tools now what is actually required > for users in terms of Lazarus? Can we just package a single binary > which links to code tools or do users need to install an entire > Lazarus setup?

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Fri, 24 Apr 2020 15:55:44 +0700 Ryan Joseph via fpc-pascal wrote: > > 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 star

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 09:02:50 +0200 Mattias Gaertner via fpc-pascal wrote: > On Sat, 25 Apr 2020 12:03:55 +0700 > Ryan Joseph via fpc-pascal wrote: > > > I have FindCodeContext working correctly I believe because ProcName > > from TCodeContextInfo returns the correct nam

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 12:03:55 +0700 Ryan Joseph via fpc-pascal wrote: > 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

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'

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 &

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

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

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

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 fo

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 21:54:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 9:51 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > You have old ppu files. > > > > For example: > > make distclean all > > ok, did this a

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 21:41:34 +0700 Ryan Joseph via fpc-pascal wrote: > I just tried update my lazarus sources using "svn up" and now I'm > getting another strange error when using lazbuild. > > /Users/ryanjoseph/Developer/lazarus/components/ideintf/ideintf.pas:11:3: > fatal: Can't find unit Laza

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 20:45:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 8:20 PM, Arjan Adriaanse > > wrote: > > > > Perhaps not all the used generics features are available yet in > > older FPC versions. I use the most recent release candidate from > > ftp://ftp.freepascal

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
On Thu, 23 Apr 2020 20:45:58 +0700 Ryan Joseph via fpc-pascal wrote: > > On Apr 23, 2020, at 8:20 PM, Arjan Adriaanse > > wrote: > > > > Perhaps not all the used generics features are available yet in > > older FPC versions. I use the most recent release candidate from > > ftp://ftp.freepascal

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
> Ryan Joseph via fpc-pascal hat am 23. April > 2020 um 10:58 geschrieben: > > > > On Apr 23, 2020, at 3:49 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > 3) Class/record member completions. > > I guess you mean identifier completion after a d

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Mattias Gaertner via fpc-pascal
> Ryan Joseph via fpc-pascal hat am 23. April > 2020 um 10:14 geschrieben: > > > > On Apr 23, 2020, at 3:00 PM, Michael Van Canneyt > > 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 entir

[fpc-pascal] Lazarus Release 2.0.8

2020-04-16 Thread Mattias Gaertner via fpc-pascal
Please read carefully: The Lazarus team is glad to announce the release of Lazarus 2.0.8. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.6 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazar

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 08:11:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > I'm inclined to think you found the reason why Embarcadero disallows > type helpers. That would imply E thought type helpers through. I doubt that, e.g. write access to read only properties. > A type helper extends a

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 00:57:12 -0400 Anthony Walter via fpc-pascal wrote: >[...] > What should happen is that both examples use the function from the > last unit in the uses clause. Yes, that's how Pascal usually works and so it works in pas2js. Strange that fpc does it the other way round. Bug o

Re: [fpc-pascal] $modeswitch from command line

2020-02-04 Thread Mattias Gaertner via fpc-pascal
On Tue, 4 Feb 2020 08:41:22 + (UTC) Mr Bee via fpc-pascal wrote: > As mention in the email title, what I meant is {$modeswitch} not > {$mode} as explain > here: https://www.freepascal.org/docs-html/prog/progsu105.html > > For example, if I want to use extended record in objfpc mode, then I >

[fpc-pascal] Lazarus Release 2.0.6

2019-11-01 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.6. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.4 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-26 Thread Mattias Gaertner via fpc-pascal
On Sat, 26 Oct 2019 00:45:22 +0100 Graeme Geldenhuys wrote: > On 14/10/2019 7:38 pm, Alexey Tor. wrote: > > >Does SysUtils.DirectoryExists work? > > > > No, the dir name is pure English, so DirectoryExistsUTF8 does the > > same. > > :-) There is no such thing as "pure English". He meant A

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-15 Thread Mattias Gaertner via fpc-pascal
On Tue, 15 Oct 2019 16:38:35 -0400 Ryan Joseph wrote: > Another related question about functions. > > In unit files there is a InterfaceSection/ImplementationSection in > TPasModule and I can use those to get a list of functions (because > they descend from TPasSection). In a program file there

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 16:07:31 +0300 "Alexey Tor." wrote: >  FPC 3.3.1-r43118 [2019/10/04], on Linux x64, cross compiling to > FreeBSD x64 12.0 (TrueOS). > Smth is broken in DirectoryExistsUTF8() on FreeBSD. Does SysUtils.DirectoryExists work? > After this FPC > update CudaText cannot see tha

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 14:02:44 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 14. Okt. 2019, 10:39: >[...] > First you agree with me and then you provide in essence the same > examples as Ryan? So what is it now? Ryan gave several exa

Re: [fpc-pascal] fcl-passrc method/function invocations

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Sun, 13 Oct 2019 23:13:04 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The resolver is implemented in pasresolver.pp and pasresolveeval.pas > (but I think you'll only need the former) The latter is used by the former. Note that the resolver can only parse whole modules, not mere expressio

Re: [fpc-pascal] fcl-passrc errors

2019-10-14 Thread Mattias Gaertner via fpc-pascal
On Mon, 14 Oct 2019 07:37:38 +0200 Sven Barth via fpc-pascal wrote: >[...] > Because the iterator returns a Pointer and not whatever you think it > might return. If you know it's something else, you cast that inside > the loop. I agree with Sven. What about the other way round? For example th

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 16:35:42 -0400 Ryan Joseph wrote: >[...] > procedure Run(a: integer; b: string); > begin > end; > > generic procedure Run(a: S; b: T; c: integer); > begin > end; > > > // fails because the non-generic Run() will always be picked and the > parameter count will be wrong. Run(1

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 19:47:58 +0200 Sven Barth via fpc-pascal wrote: > Mattias Gaertner via fpc-pascal > schrieb am Mo., 7. Okt. 2019, 18:42: > > > On Mon, 7 Oct 2019 12:38:51 -0400 > > Ryan Joseph wrote: > > > > > > On Oct 7, 2019, at 10:19 AM, Mattias

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 12:38:51 -0400 Ryan Joseph wrote: > > On Oct 7, 2019, at 10:19 AM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Note that in Delphi the "non-generic-wins" rule is per parameter: > > > > procedure Run(a:T; b: word); > &

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 09:38:45 -0400 Ryan Joseph wrote: >[...] > > This means you don't support: > > generic procedure Run(a: T; b:S); overload; > > That’s correct, this breaks the logic entirely. This to me looks like > a sneaky way to trick the compiler and since it’s trying to infer > somethin

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 09:51:47 -0400 Ryan Joseph wrote: > Right now this gives an error because you can’t add normal functions > AFTER generic functions with the same name in the same scope. I can’t > find the bug report but I think Sven fixed this recently or gave a > better error at least. I see

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 15:37:46 +0200 (CEST) Michael Van Canneyt wrote: >[...] > > You mean, if a bad overload can be nullified by a good one? That > > would be insane... > > > > Yes, Delphi eats it without warning. > > > > And it works even with a generic param: > > > > generic function Run(a: T; b:

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:37:16 +0200 (CEST) Michael Van Canneyt wrote: > On Mon, 7 Oct 2019, Mattias Gaertner via fpc-pascal wrote: > >[...] > I think sven means if you have e.g. 3 functions: > > generic function DoThis(a: T): T; overload; > begin end; > > gener

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 14:12:32 +0200 Sven Barth via fpc-pascal wrote: >[...] > > > > > generic function DoThis(a: T): T; overload; > > > > > begin end; > > > > > generic function DoThis(a: T): U; overload; > > > > > begin end; > > > > > > > > > > begin > > > > > DoThis(3); // both fits, should give

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Mon, 7 Oct 2019 07:54:51 +0200 Sven Barth via fpc-pascal wrote: > Ryan Joseph schrieb am Mo., 7. Okt. 2019, > 00:16: >[...] > > >>> 3. > > >>> timpfuncspez2.pp > > >>> DoThis > > >>> DoThis > > >>> Delphi gives an error "Ambiguous call to DoThis". FPC silently > > >>> selects the one with on

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: >[...] > I think my logic is different from what you expect though and I’m > happy to change it if we need to. > > There’s the comment I left in the code for the > “try_implicit_specialization” function. > > { find generic procsyms by p

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: >[...] > >>> 3. > >>> timpfuncspez2.pp > >>> DoThis > >>> DoThis > >>> Delphi gives an error "Ambiguous call to DoThis". FPC silently > >>> selects the one with only one param. IMO this is dangerous, it > >>> should give an error. > > > >

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:16:16 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:40 PM, Mattias Gaertner via fpc-pascal > > wrote: > >> Which test? Please post a sample. > > > > generic procedure DoThis(a:T; b:T); > > begin end; > > > > be

Re: [fpc-pascal] generic proc inference

2019-10-07 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 18:19:37 -0400 Ryan Joseph wrote: >[...] > That works then. Added a test: > [...] Thanks. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 17:10:54 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 5:03 PM, Ryan Joseph > > wrote: > >> On Oct 6, 2019, at 2:06 PM, Mattias Gaertner via fpc-pascal > >> wrote: > >> > >> 1. > >> FPC allows default params, Delph

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 17:03:10 -0400 Ryan Joseph wrote: >[...] > > 2. > > DoThis(1,200) gives range check warning instead of error. A warning > > means there are some rare cases, where this code is correct. Is > > this a todo or do you see a useful case? > > Which test? Please post a sample. gen

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Sun, 6 Oct 2019 12:23:57 -0400 Ryan Joseph wrote: > > On Oct 6, 2019, at 12:18 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > Ryan, is patch_3_25.diff the latest patch? > > > > I get a lot of merge conflicts. > > What fpc revision is nee

Re: [fpc-pascal] generic proc inference

2019-10-06 Thread Mattias Gaertner via fpc-pascal
On Fri, 4 Oct 2019 11:10:22 -0400 Ryan Joseph wrote: > > On Oct 3, 2019, at 6:07 PM, Sven Barth via fpc-pascal > > wrote: > > > > A patch for it by Ryan Joseph exists > > ( https://bugs.freepascal.org/view.php?id=35261 ), but I've not yet > > found the time to review it. > > I’m eager to use

[fpc-pascal] generic proc inference

2019-10-03 Thread Mattias Gaertner via fpc-pascal
Hi, What is the state of FPC support for calling generic procedures using inference like Delphi? For example: {$mode objfpc} generic procedure Run(a: T); begin end; begin Run(2); end. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] [Pas2js] It's alive !

2019-09-29 Thread Mattias Gaertner via fpc-pascal
On Sun, 29 Sep 2019 08:01:18 +0200 (CEST) Michael Van Canneyt wrote: > On Sun, 29 Sep 2019, Joao Schuler wrote: > > > I would like to give a try to WebAssembly as a target in my own > > project ( https://github.com/joaopauloschuler/neural-api ). From > > where can I get this compiler? > > >

Re: [fpc-pascal] It's alive !

2019-09-21 Thread Mattias Gaertner via fpc-pascal
On Sat, 21 Sep 2019 15:22:54 +0200 (CEST) Michael Van Canneyt wrote: >[...] > The first result can be seen here: > > https://www.freepascal.org/~michael/lyff/ > > Conway's game of life written using FPC: > > - FPC itself for the WebAssembly Backend library. > - pas2js for the necessary Javascr

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
On Mon, 9 Sep 2019 19:27:49 +0200 Bart wrote: > On Mon, Sep 9, 2019 at 4:54 PM Jonas Maebe > wrote: > > > "var i : longint = 0;" is internally handled using the same code > > path as "const i : longint = 0", and typed constants cannot be used > > as counter variables. This is indeed probably a

Re: [fpc-pascal] Illegal counter variable?

2019-09-09 Thread Mattias Gaertner via fpc-pascal
On Mon, 9 Sep 2019 11:44:05 +0200 SPRL AFOR wrote: > Hi. > > Index variable can neither be initialized nor computed. Read > https://wiki.lazarus.freepascal.org/FOR..DO That page only talks about assigning the loop var *inside* the loop, which is forbidden. James question is about the differen

[fpc-pascal] Lazarus Release 2.0.4

2019-08-06 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.4. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.2 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] wiki and mailing lists are moved

2019-06-12 Thread Mattias Gaertner via fpc-pascal
On Wed, 12 Jun 2019 00:50:22 +0200 (CEST) "Karoly Balogh (Charlie/SGR)" wrote: > Hi, > > So after the too long period of the wiki and mailing lists in limbo, > and facing danger of data corruption/los they've been moved to a > brand new cloud hosted server. Thank You! > Additionally, HTTPS h

Re: [fpc-pascal] wiki.freepascal.org is down?

2019-06-10 Thread Mattias Gaertner via fpc-pascal
On Wed, 5 Jun 2019 16:44:14 +0200 (CEST) "Karoly Balogh (Charlie/SGR)" wrote: > Hi, > > On Wed, 5 Jun 2019, Dmitry Boyarintsev wrote: > > > It's in maintenance mode now.You can actually open a sub page. > > I.e.: http://wiki.freepascal.org/Lazarus_Faq > > > > Yet the main page seems to be affec

Re: [fpc-pascal] Checking if a TStringList already exists

2019-05-21 Thread Mattias Gaertner via fpc-pascal
On Tue, 21 May 2019 16:47:28 +0100 Graeme Geldenhuys wrote: >[...] > I fully agree with what Michael said. You can't truly expect > applications developer to trail and error what needs to be done. It's > an LCL issue that the Lazarus project needs to fix. Delphi's VCL, > fpGUI Toolkit and MSEide+

Re: [fpc-pascal] Feature Announcement: Support for multiple active helpers per type

2019-05-10 Thread Mattias Gaertner via fpc-pascal
On Fri, 10 May 2019 21:56:56 +0200 Sven Barth via fpc-pascal wrote: >[...] > We are pleased to announce that Free Pascal now supports the usage of > multiple active helper types per extended type. This feature has been > developed by Ryan Joseph, so thank you very much Ryan. Thanks Ryan! >[

Re: [fpc-pascal] Record helper properties

2019-04-24 Thread Mattias Gaertner via fpc-pascal
On Wed, 24 Apr 2019 17:16:05 +0200 Sven Barth via fpc-pascal wrote: > Am 24.04.2019 um 15:28 schrieb Ryan Joseph: > > > >> On Apr 24, 2019, at 2:27 AM, Michael Van Canneyt > >> wrote: > >> > >> I would think this should be allowed, yes. I see no reason to > >> disallow it. > > Agreed but Sve

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 21:13:52 +0200 Rainer Stratmann wrote: > On Dienstag, 16. April 2019 21:02:50 CEST Rainer Stratmann wrote: > > But how can I install/activate it. > > I found an instruction, but I got an error: > > lazarus.pp(1,1) Fatal: Kann anchordockingdsgn nicht finden verwendet > von

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 21:02:50 +0200 Rainer Stratmann wrote: > On Dienstag, 16. April 2019 14:34:05 CEST Sven Barth via fpc-pascal > wrote: > > You can install the AnchorDockingDsgn package and have all windows > > integrated (except for forms which need an additional package). > > That sounds g

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Mattias Gaertner via fpc-pascal
On Tue, 16 Apr 2019 11:37:56 -0700 Ralf Quint wrote: >[...] > Anyone who seriously develops software, specially desktop > applications, is/should be using at least two (better 3 monitors). > And the "many" different windows allow easily to spread those out to > those various screens as needed. On

[fpc-pascal] Lazarus Release 2.0.2

2019-04-16 Thread Mattias Gaertner via fpc-pascal
The Lazarus team is glad to announce the release of Lazarus 2.0.2. This release was built with FPC 3.0.4. The previous release Lazarus 2.0.0 was built with FPC 3.0.4 as well. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes h

Re: [fpc-pascal] strict private construct

2019-04-12 Thread Mattias Gaertner via fpc-pascal
On Fri, 12 Apr 2019 12:23:15 +0100 Graeme Geldenhuys wrote: > Hi, > > What exactly is the point of "strict private"? I believe FPC supports > it too, after Delphi added it. It makes absolutely no senses to me. > From the name and original intent, it means it is "really really > private" even in

Re: [fpc-pascal] bug in make install ?

2019-03-19 Thread Mattias Gaertner via fpc-pascal
On Tue, 19 Mar 2019 11:17:42 +0100 Joost van der Sluis wrote: >[...] > > Probably it fails because I have old 2.6.4 fppkg configs. I ran the samplecfg, which said it would create ~/.fpc.cfg, ~/.fp, ... Then the error was gone. I restored the files from backup. Initial dialog pops up with erro

Re: [fpc-pascal] bug in make install ?

2019-03-18 Thread Mattias Gaertner via fpc-pascal
On Mon, 18 Mar 2019 22:04:17 +0100 Joost van der Sluis wrote: >[...] > > If fppkg.cfg is the cause, why does the Lazarus initial setup not > > tell this? > > I found it difficult to come up with a descriptive message. > > Do you think that "fppkg.cfg" is better then "fppkg configuration"? D

Re: [fpc-pascal] bug in make install ?

2019-03-18 Thread Mattias Gaertner via fpc-pascal
On Mon, 18 Mar 2019 17:02:35 +0100 Joost van der Sluis wrote: > Op 15-03-19 om 22:48 schreef Mattias Gaertner via fpc-pascal: > > How to install fpc 3.3.1? > > > > When I use make install under Linux, Lazarus complains: > > Error: the Fppkg configuration is corr

[fpc-pascal] bug in make install ?

2019-03-15 Thread Mattias Gaertner via fpc-pascal
Hi, How to install fpc 3.3.1? When I use make install under Linux, Lazarus complains: Error: the Fppkg configuration is corrupt. I can compile everything without errors. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.

Re: [fpc-pascal] *.rst vs *.rsj

2019-03-06 Thread Mattias Gaertner via fpc-pascal
On Wed, 6 Mar 2019 21:09:26 + Graeme Geldenhuys wrote: > Hi, > > Somewhere after FPC 2.6.4 the FPC compiler changed to generating JSON > based *.rsj files for resource strings. > > 1. What was the benefit of doing that? AFAIR multilines: http://lists.lazarus.freepascal.org/pipermail/lazar

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 12:20:13 -0500 Ryan Joseph wrote: > Question, is this mode switch allowed in Delphi mode? I disabled it > because I had a comment that said it was ObjFPC mode only but that > doesn’t make sense it couldn’t be enabled manually even in Delphi > mode. Since $modeswitch typehelpe

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 12:49:16 -0500 Ryan Joseph wrote: > > On Feb 25, 2019, at 12:41 PM, Mattias Gaertner via fpc-pascal > > wrote: > > > > At least FPC helpers are more consistent than Delphi. > > inherited crap > > I’m pretty confident I didn’t add any

Re: [fpc-pascal] Multi helpers

2019-02-25 Thread Mattias Gaertner via fpc-pascal
On Mon, 25 Feb 2019 11:44:35 -0500 Ryan Joseph wrote: > Update on multi-scope helpers. I’ve added tests (tmshlp*.pp), fixed a > bug and renamed the mode switch to “multihelpers” which I think is > more concise than “multiscopehelpers” and fits the format with > “typehelpers”. Thanks! Good that

<    1   2   3   4   5   6   7   8   9   10   >