From fb128aaa24cb0b508d60349d913af5d64f2b0099 Mon Sep 17 00:00:00 2001 From: "marco.silipo" Date: Wed, 15 Apr 2020 15:27:22 +0200 Subject: [PATCH] Added variable value info on hover --- Arma.Studio/UI/TextEditor.xaml | 18 ++++++++++++++++++ Arma.Studio/UI/TextEditorDataContext.cs | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/Arma.Studio/UI/TextEditor.xaml b/Arma.Studio/UI/TextEditor.xaml index 116b532..73d9c06 100644 --- a/Arma.Studio/UI/TextEditor.xaml +++ b/Arma.Studio/UI/TextEditor.xaml @@ -32,6 +32,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arma.Studio/UI/TextEditorDataContext.cs b/Arma.Studio/UI/TextEditorDataContext.cs index aaa366b..b0ff307 100644 --- a/Arma.Studio/UI/TextEditorDataContext.cs +++ b/Arma.Studio/UI/TextEditorDataContext.cs @@ -492,6 +492,15 @@ private void TextEditor_MouseHover(object sender, MouseEventArgs e) { this.ToolTip.Content = lintInfo; } + else if (!String.IsNullOrWhiteSpace(word) && App.MWContext.Debugger != null && App.MWContext.Debugger.State != Data.Debugging.EDebugState.NA) + { + var variable = App.MWContext.Debugger.GetLocalVariables().FirstOrDefault((it) => it.VariableName.Equals(word, StringComparison.InvariantCultureIgnoreCase)); + if (variable is null) + { + variable = App.MWContext.Debugger.GetVariable(word, Data.Debugging.ENamespace.MissionNamespace); + } + this.ToolTip.Content = variable; + } } private void TextEditor_MouseHoverStopped(object sender, MouseEventArgs e) {