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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.