0

I have to give my clients the ability to edit scripts with VS Code. The problem.. when my software call:

CSharpScript.EvaluateAsync<int>(code, opt, host);

host object, should be passed to the script so that the script can interact with my application (CAD application). It's possibile from VS Code to see host object instance and have intellisense also on it?

Is this the right way to allow intellisense editing of scripts with externally supplied variables. Thank you very much

GRVPrasad
  • 1,228
  • 1
  • 9
  • 24
andreat
  • 297
  • 2
  • 15

1 Answers1

0

Some advise on this topic can be found in this OmniSharp issue discussion. In particular, you could create/generate a special globals.csx file which would define your global object. Then, you could reference that file in your omnisharp.json like this:

{
  "script": {
     "enabled": true,
     "defaultTargetFramework": "net461",
     "enableScriptNuGetReferences": false,
    "includes": ["globals.csx"]
  }
}

Also I would like to add that instead of trying to make Visual Studio Code to work with your scripting solution, you could use our product called AlterNET Studio, which includes a code editor control with a support for automatic IntelliSense for script host objects.

yz1
  • 31
  • 1