Răsfoiți Sursa

* Namespaced VSCode API

Michaël Van Canneyt 1 an în urmă
părinte
comite
590b574fbe

+ 3 - 0
packages/vscode/namespaced/Api.VSCode.pas

@@ -0,0 +1,3 @@
+{$DEFINE FPC_DOTTEDUNITS}
+unit Api.VSCode;
+{$include ../src/libvscode.pas}

+ 3 - 0
packages/vscode/namespaced/Fcl.App.VSCode.pas

@@ -0,0 +1,3 @@
+{$DEFINE FPC_DOTTEDUNITS}
+unit Fcl.App.VSCode;
+{$include ../src/vscodeapp.pp}

+ 20 - 1
packages/vscode/libvscode.pas → 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;
 unit libvscode;
+{$ENDIF}
 
 
 {$mode objfpc}
 {$mode objfpc}
 {$modeswitch externalclass}
 {$modeswitch externalclass}
@@ -6,7 +20,12 @@ unit libvscode;
 
 
 interface
 interface
 
 
-uses Types, JS, Web;
+uses 
+{$IFDEF FPC_DOTTEDUNITS}
+  System.Types, JSApi.JS, BrowserApi.Web;
+{$ELSE}
+  Types, JS, Web;
+{$ENDIF}
 
 
 Type
 Type
   TUint32DynArray = array of Cardinal;
   TUint32DynArray = array of Cardinal;

+ 6 - 1
packages/vscode/vscodeapp.pp → packages/vscode/src/vscodeapp.pp

@@ -10,15 +10,20 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
  **********************************************************************}
  **********************************************************************}
-
+{$IFNDEF FPC_DOTTEDUNITS}
 unit vscodeapp;
 unit vscodeapp;
+{$ENDIF}
 
 
 {$mode objfpc}
 {$mode objfpc}
 
 
 interface
 interface
 
 
 uses
 uses
+{$IFDEF FPC_DOTTEDUNITS}
+  System.Classes, System.SysUtils, JSApi.JS, Api.VSCode, Fcl.CustApp;
+{$ELSE}
   Classes, SysUtils, JS, libvscode, custapp;
   Classes, SysUtils, JS, libvscode, custapp;
+{$ENDIF}
 
 
 Type
 Type
   TVSCodeEnvironment = class (TJSObject)
   TVSCodeEnvironment = class (TJSObject)