[Qt-creator] QML/JS autocompletion
Orgad Shaneh
orgads at gmail.com
Fri Mar 6 08:35:53 CET 2015
On Tue, Mar 3, 2015 at 12:33 PM, Adam Nalepka <adam.nalepka at gmail.com>
wrote:
> Hi Qt Creator team,
>
> We have questions regarding QMLJS autocompletion. We are developing
> QtCreator plugin that is used to extend QML application. As it is possible
> to edit QML/JS code within the plugin's editor, we would like to have
> QML/JS autocompletion feature there. Best option for us would be to reuse
> autocompletion feature that is already available in QmlJSEditor plugin.
>
> We found out that if QmlJSCompletionAssistInterface symbol is exported
> from QmlJSEditor plugin we be could have autocompletion using a code like:
>
> QmlJSEditor::Internal::QmlJSCompletionAssistInterface *interface =
> new QmlJSEditor::Internal::QmlJSCompletionAssistInterface(...)
> QObject *object = ExtensionSystem::PluginManager::getObjectByClassName(
>
> StringLiteral("QmlJSEditor::Internal::QmlJSCompletionAssistProvider");
> CompletionAssistProvider *completionAssistProvider =
> qobject_cast<CompletionAssistProvider *>(object)
> IAssistProcessor *processor = cas->createProcessor();
> IAssistProposal *proposal = processor->perform(interface);
>
> Would you mind to make QmlJSEditor autocompletion publicly available?
> This could be benefitial for QmlDesigner plugin as well, since there is no
> autocompletion there too.
>
> Best Regards,
> Adam Nalepka
>
> ---
> src/plugins/qmljseditor/qmljscompletionassist.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/plugins/qmljseditor/qmljscompletionassist.h
> b/src/plugins/qmljseditor/qmljscompletionassist.h
> index b68d794..9cc2c92 100644
> --- a/src/plugins/qmljseditor/qmljscompletionassist.h
> +++ b/src/plugins/qmljseditor/qmljscompletionassist.h
> @@ -117,7 +117,7 @@ private:
> };
>
>
> -class QmlJSCompletionAssistInterface : public
> TextEditor::DefaultAssistInterface
> +class QMLJSEDITOR_EXPORT QmlJSCompletionAssistInterface : public
> TextEditor::DefaultAssistInterface
> {
> public:
> QmlJSCompletionAssistInterface(QTextDocument *textDocument,
> --
> 1.8.2.2
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
>
Hi,
Patch pending: https://codereview.qt-project.org/107903
- Orgad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20150306/eacf77df/attachment.html>
More information about the Qt-creator
mailing list