How to configure VSCode to work with SCIP Optimization software

Viewed 200

I am trying to move to VSCode from sublime text and I was wondering how to configure VSCode to work properly with SCIP.

my c_cpp_properties.json file looks like this:

    {
        "configurations": [
            {
                "name": "Mac",
                "includePath": [
                    "${workspaceFolder}/**",
                    "/Library/scip7/scip/",
                    "/Library/scip7/scip/src"
                ],
                "defines": [],
                "macFrameworkPath": [],
                "compilerPath": "/usr/local/bin/gcc-9",
                "cStandard": "c11",
                "cppStandard": "gnu++14",
                "intelliSenseMode": "clang-x64"
            }
        ],
        "version": 4
    }

I am able to get code completion working but I have having these errors in the Problems tab of the VScode terminal

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/morpheus/main.cpp)

cannot open source file "scip/config.h" (dependency of "/Users/morpheus/main.cpp")

This doesn't severely affect the development but I would like to know if there is a simple fix.

1 Answers

As far as I know (and I'm not a VScode pro), the include path is not recursive if you don't use **. This looks like scip is not in your workspaceFolder is that correct? You could try to use "/Library/scip7/scip/src/**" and see if that fixes your issue?

Edit: Ok last hope: I just post my own configuration that works for me. Note that my $workspaceFolder here is the scip source directory.

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}",
                "${workspaceFolder}/src",
                "${workspaceFolder}/src/scip",
                "${workspaceFolder}/src/lpi"
            ],
            "defines": [
                "SOPLEX_WITH_GMP",
                "SCIP_WITH_GMP",
                "SCIP_WITH_ZIMPL"
            ],
            "intelliSenseMode": "clang-x64",
            "browse": {
                "path": [
                    "${workspaceFolder}/src"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            },
            "cStandard": "c11",
            "cppStandard": "c++11"
        }
    ],
    "version": 4
}
Related