- ResultParameterPtr aParam;
- return ModelAPI_Tools::findVariable(FeaturePtr(), theName.toStdString(), outValue, aParam);
+ QString aPrefix;
+ QString aText = lineEdit()->text();
+ theStart = theEnd = myCompletePos;
+ const int aLen = aText.length();
+ if (aLen > 0) {
+ if (myCompletePos > 0) {
+ int aLastChar = myCompletePos - 1;
+ QChar aChar = aText.at(aLastChar);
+ while (isVariableSymbol(aChar)) {
+ aPrefix.prepend(aText.at(aLastChar));
+ aLastChar--;
+ if (aLastChar < 0)
+ break;
+ aChar = aText.at(aLastChar);
+ }
+ theStart = aLastChar + 1;
+ }
+ if (myCompletePos < aLen) {
+ int aLastChar = myCompletePos;
+ QChar aChar = aText.at(aLastChar);
+ while (isVariableSymbol(aChar)) {
+ aPrefix.append(aText.at(aLastChar));
+ aLastChar++;
+ if (aLastChar >= aLen)
+ break;
+ aChar = aText.at(aLastChar);
+ }
+ theEnd = aLastChar;
+ }
+ }
+ return aPrefix;