Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2020-12

VS Code extensions in Pas2JS

17 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

Earlier this week, I committed and announced support for creating Atom packages. I then promised to commit VS Code extension support.

I didn't make it for Christmas, but today nevertheless, VS Code extension support has been committed :-)

It allows you to create VS Code extensions with Pas2JS. The full VS Code API is available (just as the Atom API is available) in the "libvscode" unit. A "vscodeapp" unit is also available.

I have created a "hello, world" demo (see attached screenshots).

The Lazarus IDE has been extended with a 'VS Code Extension' project type. It will create a skeleton extension, much as the Atom Package wizard does.

The created skeleton extension contains the necessary support files to work on the extension in VS Code:
* build the extension (using the default Build command: ctrl-shift-B)
* launch VS Code with the package installed (using Ctrl-F5).

In view of the popularity of VS Code, I would like to ask:

Please consider contributing some examples to pas2js which demonstrate the various APIs of VS Code. They need not be big, just enough to demonstrate an API.

I of course expect now to see lots of pas2js VS Code extensions appearing in the coming weeks and months :-)

For the really brave:

* Consider integrating pas2js itself in VS Code: the compiler can be run in node.js, so it can also be run as part of VS Code, no need to launch an extenal executable :-)

* Consider compiling the Lazarus code tools for use in VS Code. If succesful, they will do a lot better than the omnipascal tools.

* When TMS Software has an API for their VS Code plugin, consider contributing to that as well: the more Object Pascal the better.

* In general: Go wild :-)

A warning: the VS Code API is HUGE (4000 lines), this is currently slightly more than the web unit :)

If you notice any shortcomings in the API, please let me know and I will correct as soon as possible.

Enjoy,

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vscode.png
Type: image/png
Size: 30359 bytes
Desc:
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20201227/90e85bd7/attachment-0002.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: vscode2.png
Type: image/png
Size: 37812 bytes
Desc:
URL: <http://lists.freepascal.org/pipermail/pas2js/attachments/20201227/90e85bd7/attachment-0003.png>

Reply by email

heliosroots
to Michael Van Canneyt: Earlier this week, I committed and announced support for creating Atom packages. I then…

Ihis is very good.
I did an extension for vscode, now i'm going to port it to pas2js. So i would like to remove some dependencies
As suggested i'm looking at codetools ....
I am having a problem with the parse ....

== >>>
CodeToolBoss.FindDeclaration

<<< ==
### TCodeToolManager.HandleException: [20170421195736] "expected ;, but to found" at Line = 372 Col = 47 in
"/home/helio/Documentos/dev/fpc/pas2js/packages/rtl/sysutils.pas" Parse error: expected ;, but to found

Fear some adjustment to make him ignore some warnings and continue ????

Reply by email

Mattias Gaertner
to heliosroots
Show quoted text 14 lines
Ihis is very good. I did an extension for vscode, now i'm going to port it to pas2js. So i would like to remove some dependencies As suggested i'm looking at codetools .... I am having a problem with the parse .... == >>> CodeToolBoss.FindDeclaration <<< == ### TCodeToolManager.HandleException: [20170421195736] "expected ;, but to found" at Line = 372 Col = 47 in "/home/helio/Documentos/dev/fpc/pas2js/packages/rtl/sysutils.pas" Parse error: expected ;, but to found

You must tell codetools to fetch settings from pas2js, instead of fpc.

set env var PP to path of pas2js.

Codetoolboss.SimpleInit(YourCfgFilename);
Fear some adjustment to make him ignore some warnings and continue ????

Mattias

Reply by email