diff --git a/completion/context.cpp b/completion/context.cpp --- a/completion/context.cpp +++ b/completion/context.cpp @@ -1609,7 +1609,7 @@ ///TODO: function-like statements should just be handled as a function with declaration etc. /// e.g.: empty, eval, die, exit, isset, unset /// but _not_ echo, print, catch, include*, require* - ///TODO: use user's style for indendation etc. + ///TODO: use user's style for indentation etc. ADD_KEYWORD2("abstract class", "abstract class %SELECT%NAME%ENDSELECT% {\n%INDENT%\n}\n"); ADD_KEYWORD2("final class", "final class %SELECT%NAME%ENDSELECT% {\n%INDENT%\n}\n"); ADD_KEYWORD2("class", "class %SELECT%NAME%ENDSELECT% {\n%INDENT%\n}\n"); diff --git a/completion/helpers.h b/completion/helpers.h --- a/completion/helpers.h +++ b/completion/helpers.h @@ -60,15 +60,15 @@ const QString KDEVPHPCOMPLETION_EXPORT indentString(KTextEditor::Document *document); /** - * Get the indendation of a given line. + * Get the indentation of a given line. * * You usually want to use it with something like the following: * * \code - * const QString indendation = getIndendation( document->line(replaceRange.start().line()) ); + * const QString indentation = getIndentation( document->line(replaceRange.start().line()) ); * \endcode */ -QString KDEVPHPCOMPLETION_EXPORT getIndendation( const QString &line ); +QString KDEVPHPCOMPLETION_EXPORT getIndentation( const QString &line ); } #endif diff --git a/completion/helpers.cpp b/completion/helpers.cpp --- a/completion/helpers.cpp +++ b/completion/helpers.cpp @@ -209,7 +209,7 @@ return QStringLiteral("\t"); } -QString getIndendation( const QString &line ) { +QString getIndentation( const QString &line ) { return line.left(line.indexOf(QRegExp("\\S"), 0)); } diff --git a/completion/implementationitem.cpp b/completion/implementationitem.cpp --- a/completion/implementationitem.cpp +++ b/completion/implementationitem.cpp @@ -120,22 +120,22 @@ replaceRange.start() = KTextEditor::Cursor(methodText.count('\n'), methodText.length() - methodText.lastIndexOf('\n') - 1); } - // get indendation - QString indendation; + // get indentation + QString indentation; { QString currentLine = document->line(replaceRange.start().line()); - indendation = getIndendation(currentLine); + indentation = getIndentation(currentLine); - if ( !currentLine.isEmpty() && currentLine != indendation ) { + if ( !currentLine.isEmpty() && currentLine != indentation ) { // since theres some non-whitespace in this line, skip to the enxt one - replText += '\n' + indendation; + replText += '\n' + indentation; } - if (indendation.isEmpty()) { - // use a minimal indendation + if (indentation.isEmpty()) { + // use a minimal indentation // TODO: respect code style - indendation = QStringLiteral(" "); - replText += indendation; + indentation = QStringLiteral(" "); + replText += indentation; } } @@ -151,12 +151,12 @@ qCDebug(COMPLETION) << "completion item for implementation has no parent context!"; } - replText += "/**\n" + indendation + " * "; + replText += "/**\n" + indentation + " * "; // insert old comment: - const QString indentationWithExtra = "\n" + indendation + " *"; + const QString indentationWithExtra = "\n" + indentation + " *"; replText += m_declaration->comment().replace('\n', indentationWithExtra.toAscii().constData()); - replText += "\n" + indendation + " * @overload " + m_declaration->internalContext()->scopeIdentifier(true).toString(); - replText += "\n" + indendation + " **/\n" + indendation; + replText += "\n" + indentation + " * @overload " + m_declaration->internalContext()->scopeIdentifier(true).toString(); + replText += "\n" + indentation + " **/\n" + indentation; } #endif @@ -251,15 +251,15 @@ } } - replText += QStringLiteral("\n%1{\n%1 ").arg(indendation); + replText += QStringLiteral("\n%1{\n%1 ").arg(indentation); if (isInterface || m_type == ImplementationItem::Implement) { } else if (!isConstructorOrDestructor && !voidReturnType) { - replText += QStringLiteral("$ret = parent::%2%3;\n%1 return $ret;").arg(indendation, functionName, arguments); + replText += QStringLiteral("$ret = parent::%2%3;\n%1 return $ret;").arg(indentation, functionName, arguments); } else { replText += QStringLiteral("parent::%1%2;").arg(functionName, arguments); } replText += QStringLiteral("\n%1}\n%1") - .arg(indendation); + .arg(indentation); } diff --git a/completion/keyworditem.cpp b/completion/keyworditem.cpp --- a/completion/keyworditem.cpp +++ b/completion/keyworditem.cpp @@ -71,7 +71,7 @@ KTextEditor::Document *document = view->document(); if ( !m_replacement.isEmpty() ) { QString replacement = m_replacement; - replacement = replacement.replace('\n', '\n' + getIndendation(document->line(word.start().line()))); + replacement = replacement.replace('\n', '\n' + getIndentation(document->line(word.start().line()))); replacement = replacement.replace(QLatin1String("%INDENT%"), indentString(document)); int cursorPos = replacement.indexOf(QStringLiteral("%CURSOR%")); diff --git a/docs/phpdocsconfig.ui b/docs/phpdocsconfig.ui --- a/docs/phpdocsconfig.ui +++ b/docs/phpdocsconfig.ui @@ -33,7 +33,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">By default the online <a href="http://php.net"><span style=" text-decoration: underline; color:#0000ff;">PHP documentation</span></a> is used remotely. Alternatively you can set the location to a local copy of the documentation in the language of your choice. Make sure you downloaded the <span style=" font-style:italic;">"Many HTML files"</span> package.</p></body></html> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">By default the online <a href="https://php.net"><span style=" text-decoration: underline; color:#0000ff;">PHP documentation</span></a> is used remotely. Alternatively you can set the location to a local copy of the documentation in the language of your choice. Make sure you downloaded the <span style=" font-style:italic;">"Many HTML files"</span> package.</p></body></html> false diff --git a/duchain/builders/declarationbuilder.h b/duchain/builders/declarationbuilder.h --- a/duchain/builders/declarationbuilder.h +++ b/duchain/builders/declarationbuilder.h @@ -198,7 +198,7 @@ bool &arrayAccess); /** - * Declare a class member in @p parentCtx. Validates whether the current context allowes + * Declare a class member in @p parentCtx. Validates whether the current context allows * redeclaration of private/protected members. * * @param parentCtx The class context you want to add the member to. diff --git a/duchain/builders/declarationbuilder.cpp b/duchain/builders/declarationbuilder.cpp --- a/duchain/builders/declarationbuilder.cpp +++ b/duchain/builders/declarationbuilder.cpp @@ -74,7 +74,7 @@ { parent = QualifiedIdentifier(); if ( node->variablePropertiesSequence ) { - // at least one "->" in the assigment target + // at least one "->" in the assignment target // => find he parent of the target // => find the target (last object property) if ( node->variablePropertiesSequence->count() == 1 ) { @@ -1319,7 +1319,7 @@ declareClassMember(ctx, type, m_findVariable.identifier, m_findVariable.node); } } else { - // assigment to other variables + // assignment to other variables declareVariable(currentContext(), type, m_findVariable.identifier, m_findVariable.node ); } } @@ -1426,7 +1426,7 @@ if ( refType ) { // this argument is referenced, so if the node contains undeclared variables we have // to declare them with a NULL type, see also: - // http://de.php.net/manual/en/language.references.whatdo.php + // https://de.php.net/manual/en/language.references.whatdo.php // declare with NULL type, just like PHP does declareFoundVariable(AbstractType::Ptr(new IntegralType(IntegralType::TypeNull))); diff --git a/duchain/builders/typebuilder.cpp b/duchain/builders/typebuilder.cpp --- a/duchain/builders/typebuilder.cpp +++ b/duchain/builders/typebuilder.cpp @@ -546,7 +546,7 @@ if (!classDec) { ///FIXME: this is just a hack for https://bugs.kde.org/show_bug.cgi?id=269369 /// a proper fix needs full fledged two-pass, i.e. get rid of PreDeclarationBuilder - // 0 == global lookup and the delcaration is found again... + // 0 == global lookup and the declaration is found again... classDec = dynamic_cast(type->declaration(nullptr)); } if (classDec) { diff --git a/duchain/tests/duchain.cpp b/duchain/tests/duchain.cpp --- a/duchain/tests/duchain.cpp +++ b/duchain/tests/duchain.cpp @@ -2144,7 +2144,7 @@ } { - // same as above but with indendation + // same as above but with indentation TopDUContext* top = parse("localDeclarations().at(4); QCOMPARE(dec->qualifiedIdentifier().toString(), QString("ns6")); QVERIFY(dynamic_cast(dec)); - ///TODO: find out why this is explictly required + ///TODO: find out why this is explicitly required QVERIFY(!dynamic_cast(dec)->importIdentifier().explicitlyGlobal()); } @@ -3571,7 +3571,7 @@ "}\n" "namespace {\n" "try { /* ... */ }\n" - "catch(\\ns\\e $exeption) { /* ... */ }" + "catch(\\ns\\e $exception) { /* ... */ }" "}\n" , DumpNone); QVERIFY(top);