Skip to content

Instantly share code, notes, and snippets.

@chrisber
Created February 23, 2015 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisber/789d59372e9b41e657d9 to your computer and use it in GitHub Desktop.
Save chrisber/789d59372e9b41e657d9 to your computer and use it in GitHub Desktop.
Example
public static void CleanupSemanticCache()
{
var ls = v8Engine.GlobalObject.GetProperty("languageService");
var resultHandle = ls.Call("cleanupSemanticCache", null);
}
public static Diagnostic[] GetSyntacticDiagnostics(string fileName)
{
Handle fileNameHandle = v8Engine.CreateValue(fileName);
var ls = v8Engine.GlobalObject.GetProperty("languageService");
var resultHandle = ls.Call("getSyntacticDiagnostics", null, fileNameHandle);
Diagnostic[] diagnostics = TypeMapper<Diagnostic[]>(resultHandle);
return diagnostics;
}
public static Diagnostic[] GetSemanticDiagnostics(string fileName)
{
Handle fileNameHandle = v8Engine.CreateValue(fileName);
var ls = v8Engine.GlobalObject.GetProperty("languageService");
var resultHandle = ls.Call("getSemanticDiagnostics", null, fileNameHandle);
Diagnostic[] diagnostics = TypeMapper<Diagnostic[]>(resultHandle);
return diagnostics;
}
public static Diagnostic[] GetCompilerOptionsDiagnostics()
{
var ls = v8Engine.GlobalObject.GetProperty("languageService");
var resultHandle = ls.Call("getCompilerOptionsDiagnostics", null);
Diagnostic[] diagnostics = TypeMapper<Diagnostic[]>(resultHandle);
return diagnostics;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment