Re: [fpc-pascal] Database migration

2020-06-22 Thread Michael Van Canneyt
On Mon, 22 Jun 2020, Jean SUZINEAU wrote: Le 21/06/2020 à 09:55, Michael Van Canneyt a écrit : I use the functionality in the database desktop actively. The generated code even runs in Delphi. If you look at it and find ways to improve it, I'm all ears :-) I got a quick

Re: [fpc-pascal] Database migration

2020-06-21 Thread Michael Van Canneyt
On Sun, 21 Jun 2020, Jean SUZINEAU wrote: Le 21/06/2020 à 00:30, Michael Van Canneyt a écrit : FPC contains this as well since many years, you can drop the components on a form, but they are exposed in the lazarus database desktop as well. Very interesting, I didn't know this existed. I

Re: [fpc-pascal] Database migration

2020-06-20 Thread Michael Van Canneyt
On Sun, 21 Jun 2020, Jean SUZINEAU wrote: Hello, Le 19/06/2020 à 13:55, Darius Blaszyk via fpc-pascal a écrit : Schema::create('flights', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('airline');

Re: [fpc-pascal] optimization for strlicomp()

2020-06-01 Thread Michael Van Canneyt
On Sun, 31 May 2020, Alexey Tor. via fpc-pascal wrote: function strlicomp(str1,str2 : pwidechar;l : SizeInt) : SizeInt;   var    counter: sizeint;    c1, c2: char;   begin     counter := 0;     if l=0 then   begin     strlicomp := 0;     exit;   end;     repeat  

Re: [fpc-pascal] get class of procedure variable

2020-05-29 Thread Michael Van Canneyt
On Fri, 29 May 2020, Michael Van Canneyt wrote: On Fri, 29 May 2020, Ryan Joseph via fpc-pascal wrote: In the example below "callback" is assigned to a method of "obj", but is it possible to get the class back from the variable? In the pseudo code I would expect .Get

Re: [fpc-pascal] get class of procedure variable

2020-05-29 Thread Michael Van Canneyt
On Fri, 29 May 2020, Ryan Joseph via fpc-pascal wrote: In the example below "callback" is assigned to a method of "obj", but is it possible to get the class back from the variable? In the pseudo code I would expect .GetClass to return "obj". I think "of object" must be a record which keep

Re: [fpc-pascal] Implementing a simple tcp/ip connection

2020-05-28 Thread Michael Van Canneyt
On Thu, 28 May 2020, Marco van de Voort wrote: Op 2020-05-28 om 17:08 schreef Giuliano Colla: Hi everybody, I needed to implement a simple dedicated TCP/IP connection between a client and a server. Nothing fancy, just sending and receiving short strings. I have used in the past for that

Re: [fpc-pascal] Ethernet Relays

2020-05-25 Thread Michael Van Canneyt
. James -Original Message- From: fpc-pascal On Behalf Of Michael Van Canneyt Sent: Monday, May 25, 2020 4:47 AM To: ja...@productionautomation.net; FPC-Pascal users discussions Cc: 'Ched' Subject: Re: [fpc-pascal] Ethernet Relays On Sun, 24 May 2020, James Richters wrote: I got

Re: [fpc-pascal] Ethernet Relays

2020-05-25 Thread Michael Van Canneyt
On Sun, 24 May 2020, James Richters wrote: I got this working, thanks for the advice Ched, Here's my test program: uses fphttpclient; Begin TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/3/01'); TFPHTTPCLIENT.SIMPLEGET('http://10.10.01.01/3/03');

Re: [fpc-pascal] Zoned date/time conversions

2020-05-24 Thread Michael Van Canneyt
On Sun, 24 May 2020, Graeme Geldenhuys wrote: Hi, I need to do timezone enabled date/time conversions... Use case 1) We want the application server to always use UCT and the application server might not be in the sime timezone as the client app. So we need to convert local time to UCT, do

Re: [fpc-pascal] Delphi TService

2020-05-20 Thread Michael Van Canneyt
On Wed, 20 May 2020, Marco van de Voort wrote: Does somebody have a compatible TService somewhere for dual compilation Delphi/Lazarus purposes? There is daemonapp, but that seems to be incompatible, but maybe it can be wrapped? It can be easily wrapped. The only difference is that the

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Michael Van Canneyt
On Tue, 19 May 2020, Giuliano Colla wrote: Il 19/05/2020 18:57, Michael Van Canneyt ha scritto: They are not missing. How do you think fpsock and lnet implement non-blocking ? It's simply called  O_NONBLOCK. I'm using fpc 3.0.4. With just Sockets in the uses clause both SOCK_NONBLOCK

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Michael Van Canneyt
On Tue, 19 May 2020, Giuliano Colla wrote: I'm struggling with a similar problem. It would appear that the easiest way would be just take advantage of the Sockets unit. You only must define some more constants, such as SO_REUSEPORT and SOCK_NONBLOCK which are missing in fpc. They are not

Re: [fpc-pascal] Optimizing code generation fpc (lazarus)?

2020-05-17 Thread Michael Van Canneyt
On Sun, 17 May 2020, Bo Berglund via fpc-pascal wrote: ADDING ANOTHER QUESTION: Is there a way to find out which functions in a particular unit are called from the other units in the project? Sort of an expanded list of "dependencies"... The lazarus IDE can give

Re: [fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

2020-05-17 Thread Michael Van Canneyt
On Sun, 17 May 2020, Noel Duffy via fpc-pascal wrote: On 17/05/20 3:00 am, Michael Van Canneyt wrote: On Sat, 16 May 2020, Michael Van Canneyt wrote: On Sat, 16 May 2020, Jonas Maebe wrote: On 15/05/2020 12:39, Noel Duffy via fpc-pascal wrote: While doing some work on bug 37060

Re: [fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

2020-05-16 Thread Michael Van Canneyt
On Sat, 16 May 2020, Michael Van Canneyt wrote: On Sat, 16 May 2020, Jonas Maebe wrote: On 15/05/2020 12:39, Noel Duffy via fpc-pascal wrote: While doing some work on bug 37060, the refactoring of StrToHostAddr and StrToHostAddr6 in the sockets unit,(https://bugs.freepascal.org/view.php

Re: [fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

2020-05-16 Thread Michael Van Canneyt
On Sat, 16 May 2020, Jonas Maebe wrote: On 15/05/2020 12:39, Noel Duffy via fpc-pascal wrote: While doing some work on bug 37060, the refactoring of StrToHostAddr and StrToHostAddr6 in the sockets unit,(https://bugs.freepascal.org/view.php?id=37060), I found that StrToHostAddr is doing no

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-16 Thread Michael Van Canneyt
Applied, thank you very much ! Michael. On Sat, 16 May 2020, Noel Duffy via fpc-pascal wrote: Per discussions, I've posted a proposed patch on bug 37060 https://bugs.freepascal.org/view.php?id=37060 I've also attached a test program that exercises the new functions.

Re: [fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

2020-05-15 Thread Michael Van Canneyt
On Fri, 15 May 2020, Noel Duffy via fpc-pascal wrote: That must be a new record in bug fix speed. You fixed that within ten minutes of my message to the list! I forgot to mention in my message, but did mention in the bug report, that leading zeroes are also allowed, so you can parse:

Re: [fpc-pascal] Bug 37080 -- StrToHostAddr accepts all Pascal number notations

2020-05-15 Thread Michael Van Canneyt
On Fri, 15 May 2020, Noel Duffy via fpc-pascal wrote: While doing some work on bug 37060, the refactoring of StrToHostAddr and StrToHostAddr6 in the sockets unit,(https://bugs.freepascal.org/view.php?id=37060), I found that StrToHostAddr is doing no validation at all on input address

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-14 Thread Michael Van Canneyt
On Thu, 14 May 2020, Giuliano Colla wrote: Hi all, I need to implement a simple dedicated TCP/IP connection between a client and a server. Nothing fancy, just sending and receiving short strings. I have used in the past for that purpose the unit Sockets lifting it from Kylix. This unit

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 9:24 pm, Bart via fpc-pascal wrote: On Wed, May 13, 2020 at 10:40 AM Noel Duffy via fpc-pascal As I've already learned the hard way, the sockets unit is compiled in "fpc" mode, so there's no "out" parameters. Otherwise I

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 7:26 pm, Michael Van Canneyt wrote: Always a new issue for new changes. Makes it easier to track where something went wrong if something is wrong. Done. https://bugs.freepascal.org/view.php?id=37060 I will try to get

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Christo Crause via fpc-pascal wrote: On Tue, May 12, 2020 at 11:11 PM Noel Duffy via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Sure, I can do that. I will look at creating a patch for this. For your purposes, do you prefer to have a new bug in the bug tracker

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 12/05/20 10:32 pm, Michael Van Canneyt wrote:> On Tue, 12 May 2020, Noel Duffy via fpc-pascal wrote:>>>> A simple solution is to add functions to the sockets unit which accep a var record into which the output will be wr

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-12 Thread Michael Van Canneyt
On Tue, 12 May 2020, Noel Duffy via fpc-pascal wrote: While working with StrToHostAddr and StrToHostAddr6 over the past couple of weeks I've run into issues caused by the functions returning all zero addresses to indicate errors. All-zero addresses are technically valid according to the

Re: [fpc-pascal] Compiler mode for code in rtl and rtl-extra

2020-05-11 Thread Michael Van Canneyt
On Mon, 11 May 2020, Noel Duffy via fpc-pascal wrote: I've been beavering away at a fix for https://bugs.freepascal.org/view.php?id=37013 and I've run into something unexpected. When I try to build rtl-extra with my proposed patch applied, I get compiler errors for things like the use of

Re: [fpc-pascal] BSON formatter

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Ryan Joseph via fpc-pascal wrote: On May 7, 2020, at 4:44 PM, Michael Van Canneyt wrote: I'm not even sure BSON will be accepted for LSP. I talked to them already and they're not keen to add extensions to the plugin so I'll probably give up on this route. The spec

Re: [fpc-pascal] BSON formatter

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Andreas Schneider wrote: Am 2020-05-07 08:40, schrieb Ryan Joseph via fpc-pascal: Working on the language server it's become clear that JSON is going to be a killer bottleneck, but that's what Microsoft decided to use. It's almost a deal breaker just because of the sheer

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: On 7/05/20 9:17 pm, Michael Van Canneyt wrote: On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: Great. My worry was that the sockets unit might fall into the same category as the libc one, available but deprecated

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: On 6/05/20 11:21 pm, Christo Crause via fpc-pascal wrote: > On Wed, May 6, 2020 at 12:19 PM Noel Duffy via fpc-pascal > > > wrote: > > So I guess the question is, is it worth the effort to make >

Re: [fpc-pascal] BSON formatter

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Ryan Joseph via fpc-pascal wrote: Working on the language server it's become clear that JSON is going to be a killer bottleneck, but that's what Microsoft decided to use. It's almost a deal breaker just because of the sheer size of the data due to JSON's verbose plain

Re: [fpc-pascal] FPCMake and Makefile.fpc question

2020-05-05 Thread Michael Van Canneyt
On Tue, 5 May 2020, Bart via fpc-pascal wrote: Hi, Here's the first line of the Lazarus Makefile: - # # Don't edit, this file is generated by FPCMake Version 2.0.0 # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd

Re: [fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Michael Van Canneyt
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 have a compilerproc modifier set, so I suppose there is some property/attribute of the identifier

Re: [fpc-pascal] Code tools unrelated completions

2020-05-05 Thread Michael Van Canneyt
On Tue, 5 May 2020, Ryan Joseph via fpc-pascal wrote: Code tools completions are returning functions that don't appear related to the current unit such as "fpc_Copy" from /usr/local/share/fpcsrc/rtl/inc/compproc.inc. Here's a snippet of the code I use to get identifiers. if

Re: [fpc-pascal] Code tools and constants in generics

2020-05-05 Thread Michael Van Canneyt
On Tue, 5 May 2020, Ryan Joseph via fpc-pascal wrote: As to be expected with new feature code tools now fails with constants in generics. Should I make a bug report to fix this? Yes, but on the Lazarus bugtracker. Michael. ___ fpc-pascal

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-04 Thread Michael Van Canneyt
On Mon, 4 May 2020, Ryan Joseph via fpc-pascal wrote: On May 4, 2020, at 2:12 PM, Michael Van Canneyt wrote: Methods can't be keywords either, unless prefixed with &. It's not safe to change this, that's why a keyword is a keyword: it supersedes all identifiers, it is

Re: [fpc-pascal] Name collisions in scoped enums

2020-05-04 Thread Michael Van Canneyt
On Mon, 4 May 2020, Ryan Joseph via fpc-pascal wrote: On May 4, 2020, at 12:40 PM, Sven Barth wrote: No, keywords have a higher priority than identifiers, their context doesn't matter (e.g. you can't have a method named "File" either though one could apply the same reasoning here). If

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: The problem is that the StrToHostAddr6 function doesn't set its return value until the end of the function

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Ryan Joseph via fpc-pascal wrote: On May 3, 2020, at 4:04 PM, Michael Van Canneyt wrote: Just set the Collection property of the items to the concatenated collection instance. Note that this effectively moves the items. That means I'll need to set it back later

Re: [fpc-pascal] Concat TCollection?

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Ryan Joseph via fpc-pascal wrote: I have many TCollection's that I need to concat together into one larger collection for streaming. Since it's just a list I thought I could add the elements together but it appears TCollection requires that it allocate each item. Is

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: Using fpc 3.0.4 on Fedora 30. I've just started using the StrToHostAddr6 function in the sockets unit to parse IPv6 addresses. I've found a couple of issues with it. 1. Even if address parsing fails, StrToHostAddr6 doesn't return an

Re: [fpc-pascal] Pascal Language Server

2020-04-29 Thread Michael Van Canneyt
On Wed, 29 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 29, 2020, at 3:37 PM, Michael Van Canneyt wrote: if the Lazarus team can implement a LSP plugin for the editor, then we'd have instant language support for a whole bunch of languages. That would be awesome... but language

Re: [fpc-pascal] Pascal Language Server

2020-04-29 Thread Michael Van Canneyt
On Wed, 29 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 29, 2020, at 3:23 PM, Michael Van Canneyt wrote: and then it should be a matter of creating a descendent of the language client. The C# one seems easy enough to convert :-) Let me know if you can figure it out. Will do

Re: [fpc-pascal] Pascal Language Server

2020-04-29 Thread Michael Van Canneyt
On Wed, 29 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 28, 2020, at 7:47 PM, Michael Van Canneyt wrote: Incredibly looking forward to test-driving this in Atom... :-) Michael, do you actually know how to setup a language server in Atom? I've only tested on Sublime Text but I

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Michael Van Canneyt
On Tue, 28 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 28, 2020, at 4:04 PM, Michael Van Canneyt wrote: You can do what most VSCode/Atom project managers seem to, add package.json or somesuch: { "pascal-lsp" : { "projectfile" : "yourproject.pas&qu

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Michael Van Canneyt
On Tue, 28 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 28, 2020, at 3:45 PM, Michael Van Canneyt wrote: Why do you think so ? The codetools will find all referenced units that it finds in the unit search path. You're right. I was thinking there are going to be units that aren't

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Michael Van Canneyt
On Tue, 28 Apr 2020, 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 provide the program file

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Michael Van Canneyt
On Tue, 28 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 28, 2020, at 3:06 PM, Mattias Gaertner via fpc-pascal wrote: You can add any number of files as start. Just call AddStartUnit for every starting module. For example add all Pascal modules of the workspace directory. In

Re: [fpc-pascal] Pascal Language Server

2020-04-28 Thread Michael Van Canneyt
On Tue, 28 Apr 2020, Mattias Gaertner via fpc-pascal wrote: 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

Re: [fpc-pascal] Pascal Language Server

2020-04-27 Thread Michael Van Canneyt
On Mon, 27 Apr 2020, 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; SearchInCode: TCodeBuffer;

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Michael Van Canneyt
On Sat, 25 Apr 2020, 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? I thought they were in the Lazarus directory but I guess not. I suspect

Re: [fpc-pascal] Pascal Language Server

2020-04-25 Thread Michael Van Canneyt
On Sat, 25 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 25, 2020, at 7:48 PM, Mattias Gaertner via fpc-pascal wrote: It's gpl/lgpl. Feel free to use parts. sure, but does it does it depend on other systems which are installed from Lazarus or will a stand-alone binary run on a

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 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 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 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-23 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 10:23 AM, Ryan Joseph wrote: Just tested on my language server and the problem is you provided a null error key, which is not in the protocol. I've never seen the fpjsonrpc unit before so I don't know where this

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote: OK, I just downloaded the laz sources and rebuilt from scratch (as usual) and it's building with the 3.3.1 now. I'm testing the server in Sublime Text and first thing I get is: LSP: invalid response payload {'id': 1, 'result':

Re: [fpc-pascal] Issues with svn?

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Martin wrote: I suddenly start receiving errors: B:\FPC\SVN\build_fixes_3_2\fpcsrc Error running context: An existing connection was forcibly closed by the remote  host. B:\FPC\SVN\build_fixes_3_2\fpcdocs Unable to connect to a repository at URL  

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Sven Barth via fpc-pascal wrote: Arjan Adriaanse schrieb am Do., 23. Apr. 2020, 08:33: I am new to Pascal programming and since I like using Emacs, I wanted to try to improve its support for editing Pascal code. I decided to implement an LSP server which text editors

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Mattias Gaertner via fpc-pascal wrote: 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

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Ryan Joseph via fpc-pascal wrote: 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 entire project and keeps the symbols

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 23, 2020, at 2:08 PM, Michael Van Canneyt wrote: VSCode has omnipascal ? (The TMS Web core VS Code studio plugin uses this, and it seems pretty complete) yes it does but they don't support ObjFPC mode syntax very well which

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
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

Re: [fpc-pascal] Pascal Language Server

2020-04-23 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Ryan Joseph via fpc-pascal wrote: yes! Pascal *badly* needs this to be productive outside of Lazarus. I use Sublime Text and frequently now VSCode but not having good code tools is getting painful. VSCode has omnipascal ? (The TMS Web core VS Code studio plugin uses

Re: [fpc-pascal] Best practice porting a Windows service application to Linux?

2020-04-22 Thread Michael Van Canneyt
On Thu, 23 Apr 2020, Bo Berglund via fpc-pascal wrote: On Wed, 22 Apr 2020 07:56:38 +0200, Sven Barth via fpc-pascal wrote: Bo Berglund via fpc-pascal schrieb am Mi., 22. Apr. 2020, 05:33: But what about the general service framework? The existing code uses a class inherited from

Re: [fpc-pascal] StrToHostAddr in sockets unit accepts negative octets

2020-04-20 Thread Michael Van Canneyt
On Sun, 19 Apr 2020, Karoly Balogh (Charlie/SGR) wrote: Hi, On Sun, 19 Apr 2020, Michael Van Canneyt wrote: > The StrToHostAddr function in the sockets unit accepts negative octets > in the source ip address. Consider this program: This should indeed be ckecked. Please

Re: [fpc-pascal] StrToHostAddr in sockets unit accepts negative octets

2020-04-19 Thread Michael Van Canneyt
On Sun, 19 Apr 2020, Noel Duffy via fpc-pascal wrote: Running fpc 3.0.4 on Fedora 30. The StrToHostAddr function in the sockets unit accepts negative octets in the source ip address. Consider this program: This should indeed be ckecked. Please report this in the bugtracker, so we don't

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sun, 12 Apr 2020, fredvs via fpc-pascal wrote: I would think this is about the biggest failure of all for a compiler ? Imo, the worst thing is when the compilation is ok but code are bad interpreted. simply because unix does not do this. OK, like I did for all my arguments, can you

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sun, 12 Apr 2020, fredvs via fpc-pascal wrote: committed in rev. 44697 Yep, excellent! Note that this still may cause surprises, because paramstr(0) is not 100% reliable. Hum, ok, but I assume to take the risk. Finally, the worst that can happen is fail to compil. I would think

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sun, 12 Apr 2020, Sven Barth via fpc-pascal wrote: Why does fpc look for .fpc.cfg in the user home dir when it is otherwise looking for fpc.cfg? Because the naming convention on unixes is like that for config files in your home directory. This is not fpc specific. This convention

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sun, 12 Apr 2020, Bo Berglund via fpc-pascal wrote: On Fri, 10 Apr 2020 13:44:17 -0700 (MST), fredvs via fpc-pascal wrote: 2)Your home directory, it looks for .fpc.cfg. This is something I have been wondering about for a while.. When I install FPC from sources I have to create a

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: I did try this without luck: -Fu$PPC_EXEC_PATH/units/$fpctarget -Fu$PPC_EXEC_PATH/units/$fpctarget/* -Fu$PPC_EXEC_PATH/units/$fpctarget/rtl PPC_EXEC_PATH is an environment variable, not a compiler variable. see globals.pas:

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-12 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: I promise, it is the last for tonight. It would be wonderful if in /compiler/globals.pas, at line 906, you add this line (or something like that): { Replace some macros }

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: You just need to be a little patient Huh, if I may, the so.n bug date from 3 years ago and is not yet assigned. I was referring to the config file issue. if the .so.n issue was really so urgent for you, you could have brought it up much

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: It's perfectly fine to change the name. See e.g. the first answer to https://stackoverflow.com/questions/4475319/how-to-rebrand-copyright-a-forked-project-gnu-gpl# Really, did you think that I ever had the idea to change anything in the

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: It will create one in your home directory if it detects you do not have root access. Could you explain that? Of course if you can show me a trick for configuring a script that will install fpc in the home directory (.fpc.cfg), with for

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, fredvs via fpc-pascal wrote: There's a prompt in the freepascal installer that asks for the prefix. Your users should be capable of that? As explained in previous post, the goal is to not touch the system. If you use the fpc installer, even if you install it in the

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, Alexander Grotewohl wrote: Why not just provide instructions for installation in the user's home directory, for example. It's what you'd have to do if you didn't have root access anyways. Then you can pretend that it's "cleaner" than just installing it systemwide.

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, Jonas Maebe wrote: On 11/04/2020 08:24, Michael Van Canneyt wrote: it is not done on unices to search in the binary directory for config files. That's a windows thing. And the main reason for this is that "the" compiler binary does not necessarily exist

Re: [fpc-pascal] Error format question

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, Ryan Joseph via fpc-pascal wrote: On Apr 11, 2020, at 1:17 PM, Michael Van Canneyt wrote: My guess is you have a config file lying around that causes this to look different (-Fr option?), or you have a custom-made errore.msg file built-in. Interesting, so I

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Fri, 10 Apr 2020, fredvs via fpc-pascal wrote: Does fpc accept relative path for -Fu in the fpc.cfg config file, something like: -Fu./units/$fpctarget -Fu./units/$fpctarget/* -Fu./units/$fpctarget/rtl No, it seems that it is not possible. So I propose to do this, dont hurt existing

Re: [fpc-pascal] Search path order for fpc.cfg

2020-04-11 Thread Michael Van Canneyt
On Fri, 10 Apr 2020, fredvs via fpc-pascal wrote: Hello. According: https://wiki.freepascal.org/Configuration_file Under a Unix or Unix-like operating systems (e.g. FreeBSD, Linux) 1)The current directory. 2)Your home directory, it looks for .fpc.cfg. 3)The directory specified

Re: [fpc-pascal] Error format question

2020-04-11 Thread Michael Van Canneyt
On Sat, 11 Apr 2020, Ryan Joseph via fpc-pascal wrote: Sorry to ask this yet again but I keep forgetting or remembering wrong. I thought this was a one time error that was fixed but I'm still getting different error formats with the trunk (as of today) vs 3.0.4. Can anyone please confirm

Re: [fpc-pascal] About fpc license.

2020-04-10 Thread Michael Van Canneyt
On Fri, 10 Apr 2020, fredvs via fpc-pascal wrote: I'm surprised you want to distribute your own version of the compiler. Huh, https://bugs.freepascal.org/view.php?id=32367 No answer, no no good will, hate, dont want to understand, ... ---> conclusion: https://github.com/fredvs/freepascal

Re: [fpc-pascal] About fpc license.

2020-04-09 Thread Michael Van Canneyt
On Thu, 9 Apr 2020, fredvs via fpc-pascal wrote: Hello. I have done a fork of fpc fixes_3_2 and made some modification of original code. May I distribute the fpc binary of that patched version with the units files, ready to use out-of-the-box? Yes. Must I add the source of the change

Re: [fpc-pascal] PLEASE I NEED AN URGENT HELP, cant run Bundle.sh Succefully.

2020-04-06 Thread Michael Van Canneyt
On Mon, 30 Mar 2020, mr.jenuine mr.jenuine via fpc-pascal wrote: i have been trying for a month now to work on a project, but have been having difficulties with it i complied pascal and intellej, uploaded file source code but when i run the bundle.sh i get error warning as shown below;

Re: [fpc-pascal] Ncurses unit and newer releases of ncurses

2020-03-30 Thread Michael Van Canneyt
On Sun, 29 Mar 2020, Noel Duffy via fpc-pascal wrote: Running fpc 3.0.4 on Fedora 30. The ncurses unit is based on version 5.6 of ncurses, according to constants defined in the source. The upstream ncurses is now at 6.2, and I wondered if there are plans afoot to upgrade the ncurses unit

Re: [fpc-pascal] Killing the mail list

2020-03-15 Thread Michael Van Canneyt
On Sun, 15 Mar 2020, Jonas Maebe wrote: On 15/03/2020 14:55, Ryan Joseph via fpc-pascal wrote: Has there ever been any discussion into replacing it with a modern web based forum? There are web forums if you prefer them to using a mailing list: https://forum.lazarus.freepascal.org/ (see

Re: [fpc-pascal] New Warnings with fpc >= 3.2.0

2020-03-11 Thread Michael Van Canneyt
On Wed, 11 Mar 2020, fredvs via fpc-pascal wrote: Thanks Michael. You'll need to disable that particular warning if you want to use such tricks. For the "-1" trick, it can be easy fixed with if (kind = tabulatorkindty(tak_lef)) or (kind = tabulatorkindty(tak_right)) or (kind =

Re: [fpc-pascal] New Warnings with fpc >= 3.2.0

2020-03-11 Thread Michael Van Canneyt
On Wed, 11 Mar 2020, fredvs via fpc-pascal wrote: Do it properly, and add a tab_None or somesuch If I may, I would prefer "somesuch" vs adding a new constant. Of course you may. It is a free world. But, really, would it not possible to write the equivalent of if (kind <>

Re: [fpc-pascal] New Warnings with fpc >= 3.2.0

2020-03-11 Thread Michael Van Canneyt
On Wed, 11 Mar 2020, fredvs via fpc-pascal wrote: Re-hello. What must be changed, a new constant should be added at end of the array, Lot of work because with this the array must be initialized with tak_none. But maybe there is now a new fpc trick to write: --> if (kind <>

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Ryan Joseph via fpc-pascal wrote: On Mar 10, 2020, at 11:57 AM, Anthony Walter via fpc-pascal wrote: To demonstrate, if I have MyUnit.pas that defines a string type helper with EndsWith() and an IntToStr() function then consider the following code: program Test;

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Michael Van Canneyt wrote: I know some of you might see this as a small problem, but it's an inconstancy that can lead to a situation where the wrong methods will be called without being obvious. The standard has long been that when an identifier of the same name

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Anthony Walter via fpc-pascal wrote: I started adding {$modeswitch multihelpers} to some of my code and noticed a problem. It would seem that the SysUtils unit is defining type helpers for the string type and this led me to discover that multiple type helpers takes

Re: [fpc-pascal] fpc trunk = Operator is not overloaded: "Class Of TBlobField" and "Boolean"

2020-03-08 Thread Michael Van Canneyt
On Sun, 8 Mar 2020, fredvs via fpc-pascal wrote: Hello. I did try last fpc trunk and get that error message when compiling a program (mseide): ---> Error: Operator is not overloaded: "Class Of TBlobField" and "Boolean" This comes from that line: ---> if fld1 is tblobfield then // here

Re: [fpc-pascal] custhttpapp doesn't terminate

2020-02-27 Thread Michael Van Canneyt
On Thu, 27 Feb 2020, Luca Olivetti wrote: Hello, I just realized that when I call CustomApplication.Terminate from my signal handler, the server stops listening but the application doesn't terminate. It worked when I initially programmed it with fpc 2.6.4 (IIRC) 5 years ago. Now I'm

Re: [fpc-pascal] Last fix for RegExpr (error on empty input)

2020-02-15 Thread Michael Van Canneyt
On Sat, 15 Feb 2020, AlexeyT via fpc-pascal wrote: My app does mass replace with regex. in big text, user enters regex "\b" and replaces it to eg "__". app calls Substitute() with each found match, match is zero length so your code will NOT replace it to "__". but it's needed to replace it

Re: [fpc-pascal] Last fix for RegExpr (error on empty input)

2020-02-15 Thread Michael Van Canneyt
On Sat, 15 Feb 2020, AlexeyT via fpc-pascal wrote: 1) typo in new Id: iMput. Indeed, I looked right over that. I fixed that. 2) wrong fix for 2nd "Error" call in Substitute(): you disabled Error call but didn't disable Exit, you need to skip Exit there too, so Substitute will return

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