#1 2020-03-03 21:11:35

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

VsCode as editor

Someone using or tried to use Visual Studio Code with FPC + mORMot?

I've been using it for a week and so far it has been a good experience.

I don't like the Lazarus editor, so I use Delphi for coding.

But Visual Studio Code has a great alternative.


In order not to reinvent the wheel, I use the FPCDeluxe to install FPC + Lazarus + Cross Compilers, etc ...
And Lazarus to create the initial project file and generate the options for the compiler (lazy mode on)

My Setup:

- VS Code
- Omnipascal Extension
- Native Debuger Extension
- VsCode Tasks to Build, compile, debug, etc.

And yes, VsCode handle well then SynCommons size smile

Offline

#2 2020-03-04 14:18:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,693
Website

Re: VsCode as editor

I only use VsCode for TMS WebCore... but perhaps an alternative to Lazarus for regular FPC code.

What is the debugging experience?
Where could we find some step-by-step tuto to setup a configuration like yours? (if you write something, we could add it to the mORMot doc)

Offline

#3 2020-03-04 20:08:31

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

Yes, I saw that TMS Core is heading towards VsCode. What in my opinion is correct.

I'm using the same debug as lazarus.
That is, it is not the same experience as debugging in Delphi. sad

But it has been very similar to what you get at Lazarus, at least as far as I have tested.

Yes, I can create a tutorial.

With some examples of Tasks to do the builds, compilation, etc. This part was where I invested the most time, but it wasn't complicated.

Offline

#4 2020-03-05 06:39:03

edwinsn
Member
Registered: 2010-07-02
Posts: 1,049

Re: VsCode as editor

While I myself enjoyed using vs code for other editing tasks, but out of curiosity,  can you explain for fpc/mORMot coding why you don't like Lazarus? Does vscode for FPC provide the same code-complete experience as Lazarus?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2020-03-05 12:31:28

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

I don't particularly like code completion. It stops working in certain cases. And there are also problems with positioning on the line that has a problem.

There is a bug, which I don't know if it has been fixed, that forces me to put a uses inside the implementation. Without any uses in implementation it generates the error "end of source not found". Not always, is random.

I reported this, but I don't know if it was fixed as I preferred to keep only one version of FCP / lazarus to work well with mORMot:
https://bugs.freepascal.org/view.php?id=35289

In addition, there are all Code extensions that you can add to make editing the code easier.

If Lazarus had support for CnPack and MMX Code Explorer, I might not be looking for other alternatives.

But as far as I know, the IDE does not support plug-ins.

----

In VsCode you need an extension to activate syntax highlighting and code completion for pascal, which in this case is the Omnipascal mentioned above.
With this extension Ctrl + click also works to open the corresponding unit.

Offline

#6 2020-03-06 05:38:27

edwinsn
Member
Registered: 2010-07-02
Posts: 1,049

Re: VsCode as editor

@macfly, Lazarus supports extensions, of course.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#7 2020-03-06 11:38:52

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

I didn't really know that. The last time I researched plugins to improve the editor, like CNPack and MMX it did not support. But it must be a long time.

Could you name a few extensions for editor? Is there anything at the level of MMX code explorer?

Offline

#8 2020-03-30 12:57:30

StefanN
Member
Registered: 2018-06-01
Posts: 4

Re: VsCode as editor

I installed Lazarus as shown in the documentation:
https://synopse.info/files/html/Synopse … l#TITL_203
I used the latest fpcupdeluxe 64 bit version and SVN Revision: 59757 for Lazarus, SVN Revision: 40491 for FPC.

So Lazarus and FPC-Versions are:
Lazarus Version#: 2.1.0
FPC Version: 3.3.1

TestSQLite3 ran without errors.
Installation of all FNC Packages ran without errors, too.

However, when trying to install Wecore (tmswebcorepkgdelaz.lpk) I got a compilation error:
frawebcoreprojectoptions.pp(104,26) Error: Identifier idents no member "Parsers"
My question:
Are there SVN-Revisions,  to set up a installation of Lazarus/FPC via fpcupdeluxe, that will allow mORMot, FNC and Webcore to be used in parallel?

Arnoud, do you use the Delphi or the FPC compiler in vscode for Webcore?

Offline

#9 2020-03-30 13:37:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,693
Website

Re: VsCode as editor

IIRC TMS WebCore comes with its own FPC compiler - or more precisely its FPC2JS transpiler.
I tried to use VSCode for WebCore. With no problem.
It doesn't use my main FPC/Lazarus use.

Perhaps they don't support Lazarus trunk.
It is more a question to the TMS support, I guess.

Offline

#10 2020-03-30 14:05:21

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

As ab said, Webcore has its own compiler.

This setup that you are trying to do would be in case you use pas2js (without webcore).

Offline

#11 2020-03-30 15:08:12

StefanN
Member
Registered: 2018-06-01
Posts: 4

Re: VsCode as editor

@ab
Thank you for that answer. But what do I have to do to use the form designer and components of webcore in vscode? Isn't omnipascal a prerequisite for this?

Offline

#12 2020-03-30 15:40:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 11,693
Website

Re: VsCode as editor

Check the TMS documentation I guess they wrote a setup procedure which deals of that.

Offline

#13 2020-03-30 16:15:59

StefanN
Member
Registered: 2018-06-01
Posts: 4

Re: VsCode as editor

The TMSWEBCoreDevGuide.pdf and TMSWEBCoreSetupGuide.pdf in don't contain any hint about using vscode for tms webcore. Only a sort section about the Installation for Lazarus.

May I ask, what did you test regarding Webcore and vscode? Did you test the form-designer and had you to install the omnipascal-extension? Or what else did you do in order to use VsCode for TMS WebCore?

In the settings of omnipascal one has to specify the path to the delphi or the fpc compiler and to the IDE, Lazarus or Delphi. Isn't this a requirement for using a form-designer in vscode?

Please excuse these many more general, basic questions.

Offline

#14 2020-03-30 17:10:48

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

I believe that the extension to create forms in visual studio code is still in beta.

A quick google search

https://www.google.com/search?q=tms+web … ore+vccode

And in the first 2 results:

https://tmssoftware.com/site/blog.asp?post=599

https://www.tmssoftware.com/site/blog.asp?post=619

And this:
Our TMS ALL-ACCESS users will be the first to receive a beta for this product. We will send out notifications when this is ready.

But why don't you contact TMS support to address this issue. Only they can answer this.


And you are mixing things up.
Wecore does not use the FPC compiler. It uses the compiler for pas2js. Therefore, in ommipascal you should set the path of the pas2js compiler and not the FPC compiler.

Offline

#15 2020-03-31 14:47:28

StefanN
Member
Registered: 2018-06-01
Posts: 4

Re: VsCode as editor

@macfly
Thank you for your hints.
Webcore for vscode is indeed still pending to be released and OmniPascal will be installed automatically if it's not already installed, so no one has to worry about it. IIUC, omnipascal relies on a prior installation of either Delphi or Lazarus if you want a form-designer inside vscode.
I still wonder how Arnaud can use it, may be he got prerelease version.

Last edited by StefanN (2020-03-31 14:49:17)

Offline

#16 2020-03-31 16:33:40

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 276

Re: VsCode as editor

I believe that Arnald does not use a form designer, he must be creating the forms/screens via code.
What in my honest opinion is better than depending on a designer.

From what I read and understood, vscode can be used as stand-alone.
You won't need Delphi / FPC to activate the form designer.
Which makes a lot of sense as it eliminates the need to convert the VCL to HTML / CSS. In VsCode de Designer works with HTML/CSS directly.

All you will need will be the compiler for pas2js, vscode and their extensions.


TMS WEB Core for Visual Studio Code is not a replacement for TMS WEB Core for Delphi. It is nothing more and nothing less than another IDE choice. We believe in freedom of choice. So, every developer can decide for himself what the preferred IDE is, be it Delphi, Lazarus  or Visual Studio Code .

https://tmssoftware.com/site/blog.asp?post=599

Offline

Board footer

Powered by FluxBB