Skip to content

Commit

Permalink
Disable the external type resolver for a hover evaluation (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaneySprings committed Feb 16, 2024
1 parent d2142a7 commit 1903cbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DotNet.Meteor.Debug/DebugSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ public class DebugSession : Session {
if (!frame.ValidateExpression(arguments.Expression))
throw new ProtocolException("invalid expression");
var value = frame.GetExpressionValue(arguments.Expression, session.Options.EvaluationOptions);
var useExternalTypeResolver = arguments.Context != EvaluateArguments.ContextValue.Hover;
var value = frame.GetExpressionValue(arguments.Expression, session.Options.EvaluationOptions, useExternalTypeResolver);
value.WaitHandle.WaitOne(session.Options.EvaluationOptions.EvaluationTimeout);
if (value.IsEvaluating)
Expand Down
5 changes: 5 additions & 0 deletions src/DotNet.Meteor.Debug/Extensions/MonoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public static class MonoExtensions {

return null;
}
public static ObjectValue GetExpressionValue(this StackFrame frame, string expression, EvaluationOptions evaluationOptions, bool useExternalTypeResolver) {
var options = evaluationOptions.Clone();
options.UseExternalTypeResolver = useExternalTypeResolver;
return frame.GetExpressionValue(expression, options);
}
public static bool Exit(this SoftDebuggerSession session, int millisecondsTimeout) {
if (session == null)
return true;
Expand Down

0 comments on commit 1903cbe

Please sign in to comment.