diff --git a/IDE/src/ui/HoverWatch.bf b/IDE/src/ui/HoverWatch.bf index 75447c03..fd647c8f 100644 --- a/IDE/src/ui/HoverWatch.bf +++ b/IDE/src/ui/HoverWatch.bf @@ -261,7 +261,7 @@ namespace IDE.ui float mOrigScreenY; float mTaskbarXOffset; float mTaskbarYOffset; - bool mIsShown; + public bool mIsShown; bool mCreatedWindow; bool mClosed; bool mOwnsListView = true; @@ -752,7 +752,7 @@ namespace IDE.ui showString.RemoveToEnd(crPos); } } - + showString.Replace('\r', '\n'); useListViewItem.Label = showString; isStringLiteral = true; } @@ -1543,6 +1543,13 @@ namespace IDE.ui public bool Show(TextPanel textPanel, float x, float y, String displayString, String evalString) { + if ((mIsShown) && (evalString.StartsWith(':'))) + { + mDisplayString.Set(evalString.Substring(1)); + Rehup(); + return true; + } + if (mIsShown) Clear(); diff --git a/IDE/src/ui/SourceViewPanel.bf b/IDE/src/ui/SourceViewPanel.bf index f28d7129..e451d7ea 100644 --- a/IDE/src/ui/SourceViewPanel.bf +++ b/IDE/src/ui/SourceViewPanel.bf @@ -4763,8 +4763,6 @@ namespace IDE.ui public void UpdateMouseover(bool mouseoverFired, bool mouseInbounds, int line, int lineChar, bool isManual = false) { - - #unwarn CompilerBase compiler = ResolveCompiler; @@ -4989,7 +4987,9 @@ namespace IDE.ui if (mHoverResolveTask != null) { if (mHoverResolveTask.mCursorPos != textIdx) + { DeleteAndNullify!(mHoverResolveTask); + } } if ((!String.IsNullOrEmpty(mHoverResolveTask?.mResult))) @@ -5031,10 +5031,20 @@ namespace IDE.ui } } - if ((!didShow) && - ((debugExpr == null) || (isOverMessage) || (!mHoverWatch.Show(this, x, y, origDebugExpr ?? debugExpr, debugExpr)))) + /*if ((!didShow) && + ((debugExpr == null) || (isOverMessage) || (!mHoverWatch.Show(this, x, y, origDebugExpr ?? debugExpr, debugExpr))))*/ + if (!didShow) { - if (mHoverResolveTask == null) + if ((debugExpr != null) && (!isOverMessage)) + { + if ((mHoverWatch.mIsShown) && (!debugExpr.StartsWith(':'))) + didShow = true; + else + didShow = mHoverWatch.Show(this, x, y, origDebugExpr ?? debugExpr, debugExpr); + } + + if ((mHoverResolveTask == null) && + ((debugExpr == null) || (!debugExpr.StartsWith(':')))) { if ((!handlingHoverResolveTask) && (ResolveCompiler != null) && (!ResolveCompiler.mThreadWorkerHi.mThreadRunning) && (gApp.mSettings.mEditorSettings.mHiliteCursorReferences) && (!gApp.mDeterministic)) { @@ -5100,7 +5110,7 @@ namespace IDE.ui } #endif - if ((parser != null) && (mIsBeefSource)) + if ((parser != null) && (mIsBeefSource) && (!didShow)) ErrorScope: { //TODO: Needed this? @@ -5226,7 +5236,7 @@ namespace IDE.ui if ((DarkTooltipManager.sTooltip != null) && (DarkTooltipManager.sTooltip.mRelWidget == this)) DarkTooltipManager.CloseTooltip(); - if (!CheckAllowHoverWatch()) + if ((!CheckAllowHoverWatch()) && (mHoverResolveTask?.mResult == null)) { return; } diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 16964047..ae901d37 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -7391,6 +7391,48 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu failed = true; } + if ((arg != NULL) && (autoComplete != NULL) && (autoComplete->mResolveType == BfResolveType_GetResultString) && (autoComplete->IsAutocompleteNode(arg))) + { + if (!autoComplete->mResultString.Contains('\r')) + { + String str; + str += methodInstance->GetParamName(paramIdx); + str += " @ "; + bool isCtor = methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor; + if (isCtor) + str += methodInstance->GetOwner()->mTypeDef->mName->ToString(); + else + str += methodInstance->mMethodDef->mName; + str += "("; + for (int i = isCtor ? 1 : 0; i < methodInstance->GetParamCount(); i++) + { + if (i > (isCtor ? 1 : 0)) + str += ","; + if (i == paramIdx) + { + if (methodInstance->GetParamKind(paramIdx) == BfParamKind_Params) + str += "params "; + str += mModule->TypeToString(methodInstance->GetParamType(paramIdx)); + } + } + str += ")"; + + if (!autoComplete->mResultString.StartsWith(":")) + autoComplete->mResultString.Clear(); + + int crPos = (int)autoComplete->mResultString.IndexOf('\n'); + if (crPos == -1) + crPos = autoComplete->mResultString.mLength; + int insertPos = BF_MAX(1, crPos); + + if (autoComplete->mResultString.IsEmpty()) + autoComplete->mResultString += ":"; + if (insertPos > 1) + str.Insert(0, '\r'); + autoComplete->mResultString.Insert(insertPos, str); + } + } + if (argValue) { if ((isThis) && (argValue.mType->IsRef()))