Page 1 of 1

Why we need a VMS-IDE C/C++ mode for Intellisense. Please VSI :-)

Posted: Fri Oct 25, 2019 5:26 am
by l.cedric
Hello,

This subject could be reformulate too like this :
How to deal better with VSCode IntelliSense and Code navigation with our old code (~14 000 files : C/C++, Decforms, CDD, ...) from VMS. And with the feeling of being on VMS, because at the very end we build on VMS and not on Windows.
Indeed wihtout doing nothing, some stuffs work but few horribles red tildes appears :(
RedTildes.jpg
RedTildes.jpg (22.13 KiB) Viewed 5165 times
First of all, i used the VMS-IDE function : Download system headers.
For our code, this 3 librairies were needed : CXXL$ANSI_DEF, DECC$RTLDEF and SYS$STARLET_C

Remarks :
  • VMS-IDE bug v1.2.6(?) : It doesn't work if you have more than 1 folder un the outdir parameter
    outdir.jpg
    outdir.jpg (18.5 KiB) Viewed 5165 times
  • VMS-IDE enhancement (?) : For the Iast 2, I have to rename the extracted headers with .h. For example with an integrated Powershell terminal :

    Code: Select all

    $ Dir | Rename-Item -NewName {$_.BaseName.ToLower() + ".h"}
  • VMS-IDE enhancement (?) : Few system headers were not in a librairie, we have to dowload them manually
Nevertheless, that not enough to remove the whole red tildes. Here's what i have to add (in c_cpp_properties.json) to approxiamte a VMS-IDE C/C++ mode for Intellisense :

Code: Select all

{   
        "configurations": [
        {
            "name": "VMS",

            "intelliSenseMode": "gcc-x64",
            "cStandard": "c99",
            "cppStandard": "c++98",
            
            "includePath": [
                "${workspaceFolder}/**"
            ],

            "forcedInclude": [
                "${workspaceFolder}/src/server/cmnt/cell_type.hxx",
                "${workspaceFolder}/src/server/cmnt/cmn_type.hxx",
                "${workspaceFolder}/src/server/cmnt/jbus_type.hxx",
                "${workspaceFolder}/src/server/cmnt/psfv_type.hxx",
                "${workspaceFolder}/src/server/cmnt/scat_type.hxx"
            ],

            "defines": [
                "__G_FLOAT=1",
                "__DECC=1",
                "vms=1",
                "__USE_STD_IOSTREAM=1",
                "VMS=1",
                "__32BITS=1",
                "__PRAGMA_ENVIRONMENT=1",
                "__ia64__=1",
                "__CRTL_VER=80400000",
                "__vms_version=\"V8.4    \"",
                "CC$gfloat=1  __X_FLOAT=1",
                "vms_version=\"V8.4    \"",
                "__DATE__=\"Oct 15 2019\"",
                "__STDC_VERSION__=199901L",
                "__DECC_MODE_RELAXED=1",
                "__DECC_VER=70390018",
                "__VMS=1",
                "DEBUG=1",
                "VMS_VERSION=\"V8.4    \"",
                "__IEEE_FLOAT=0",
                "__VMS_VERSION=\"V8.4    \"",
                "__TIME__=\"16:50:23\"",
                "__ia64=1",
                "__VMS_VER=80400022",
                "__BIASED_FLT_ROUNDS=2",
                "__INITIAL_POINTER_SIZE=0",
                "__STDC__=2",
                "__LANGUAGE_C__=1",
                "__vms=1",
                "__D_FLOAT=0",

                "_RWSTD_USE_CONFIG",
                "__int64=long long"
            ]
        }
    ],
    "version": 4
}
Few explanations :
  • intelliSenseMode : so as i didn't yet found a stuff like ~ cc-i64 mode, i gave a try to gcc
  • forcedInclude : few files in which we've extacted our CDD definitions, because #pragma dictionnary is of course not handled by IntelliSense
  • defines :
    • Copied from the end of a .lis file (cc/lis ...)
    • The last 2 were found thru an empirical way ... :roll:
It's not yet perfect, few red tildes left,
  • for example with the variant_... keywords (C VMS, no standard)
  • And doubtless other stuffs i did not see yet
This full explanation to untderstood why i hope a VMS-IDE C/C++ mode for Intellisense for our old code (25 years old ...), and of course to allow a more convenient configuration. :idea:

Thanks :)