From 590b574fbeaf62b670b8da92c0518bea35d98fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 28 Nov 2023 00:10:53 +0100 Subject: [PATCH] * Namespaced VSCode API --- packages/vscode/namespaced/Api.VSCode.pas | 3 +++ packages/vscode/namespaced/Fcl.App.VSCode.pas | 3 +++ packages/vscode/{ => src}/libvscode.pas | 21 ++++++++++++++++++- packages/vscode/{ => src}/vscodeapp.pp | 7 ++++++- 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 packages/vscode/namespaced/Api.VSCode.pas create mode 100644 packages/vscode/namespaced/Fcl.App.VSCode.pas rename packages/vscode/{ => src}/libvscode.pas (99%) rename packages/vscode/{ => src}/vscodeapp.pp (94%) diff --git a/packages/vscode/namespaced/Api.VSCode.pas b/packages/vscode/namespaced/Api.VSCode.pas new file mode 100644 index 0000000..70e6344 --- /dev/null +++ b/packages/vscode/namespaced/Api.VSCode.pas @@ -0,0 +1,3 @@ +{$DEFINE FPC_DOTTEDUNITS} +unit Api.VSCode; +{$include ../src/libvscode.pas} diff --git a/packages/vscode/namespaced/Fcl.App.VSCode.pas b/packages/vscode/namespaced/Fcl.App.VSCode.pas new file mode 100644 index 0000000..dbfe024 --- /dev/null +++ b/packages/vscode/namespaced/Fcl.App.VSCode.pas @@ -0,0 +1,3 @@ +{$DEFINE FPC_DOTTEDUNITS} +unit Fcl.App.VSCode; +{$include ../src/vscodeapp.pp} diff --git a/packages/vscode/libvscode.pas b/packages/vscode/src/libvscode.pas similarity index 99% rename from packages/vscode/libvscode.pas rename to packages/vscode/src/libvscode.pas index 3bfa1c1..f1a1b51 100644 --- a/packages/vscode/libvscode.pas +++ b/packages/vscode/src/libvscode.pas @@ -1,4 +1,18 @@ +{ + This file is part of the Pas2JS run time library. + Copyright (c) 2017-2020 by the Pas2JS development team. + + See the file COPYING.FPC, included in this distribution, + for details about the copyright. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + **********************************************************************} +{$IFNDEF FPC_DOTTEDUNITS} unit libvscode; +{$ENDIF} {$mode objfpc} {$modeswitch externalclass} @@ -6,7 +20,12 @@ unit libvscode; interface -uses Types, JS, Web; +uses +{$IFDEF FPC_DOTTEDUNITS} + System.Types, JSApi.JS, BrowserApi.Web; +{$ELSE} + Types, JS, Web; +{$ENDIF} Type TUint32DynArray = array of Cardinal; diff --git a/packages/vscode/vscodeapp.pp b/packages/vscode/src/vscodeapp.pp similarity index 94% rename from packages/vscode/vscodeapp.pp rename to packages/vscode/src/vscodeapp.pp index ebb281a..aeb44fe 100644 --- a/packages/vscode/vscodeapp.pp +++ b/packages/vscode/src/vscodeapp.pp @@ -10,15 +10,20 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} - +{$IFNDEF FPC_DOTTEDUNITS} unit vscodeapp; +{$ENDIF} {$mode objfpc} interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes, System.SysUtils, JSApi.JS, Api.VSCode, Fcl.CustApp; +{$ELSE} Classes, SysUtils, JS, libvscode, custapp; +{$ENDIF} Type TVSCodeEnvironment = class (TJSObject)