omniPascal isn't working correctly :(

Issue #77 new
Former user created an issue

I followed all install instructions.

.~dpr files are not recognized as source files!

1

when I change file type to object pascal, uses aren't recognized

2

btw: is this path correct "C:\Program Files (x86)\Borland\Delphi7" for omnipascal.delphiInstallationPath setting?

also please can someone link me a tutorial on how to compile and in debug Delphi project in vscode?

Comments (1)

  1. Christopher Wosinski repo owner

    The default file extension for Delphi project source files is .dpr. You opened a .~dpr file which is a backup file managed by the Delphi IDE. You usually don't want to work with this kind of files. However, if you want OmniPascal to be active in .~dpr files then you need to create a file association for this file type in VSCode's user settings. Example:

      "files.associations": {
            "*.~dpr": "objectpascal",
            "*.dproj": "xml",
            "*.lpi": "xml"
        }
    

    btw: is this path correct "C:\Program Files (x86)\Borland\Delphi7" for omnipascal.delphiInstallationPath setting?

    The settings file is in JSON format. So you need to escape all the backslashes like this: "omnipascal.delphiInstallationPath": "C:\\Program Files (x86)\\Embarcadero\\Studio\\17.0", Your path looks good then. But to be honest I never tested OmniPascal against an old version of Delphi, so there might be some problems.

    It's pretty easy to compile projects from .dproj files from newer Delphi versions as they are compatible to msbuild. Unfortunately this isn't possible for D7 projects. So you need to create build-tasks on your own which can be a quite painful way. You should definitely know how to create a custom build task in VSCode and how to compile a Delphi project from command line. Then it will be easy for you to create .bat file for the compilation that is triggered from your tasks.json file.

    debug Delphi project in vscode?

    It's not possible to use the Delphi debugger in a different editor :-(

  2. Log in to comment