| 69 | } |
| 70 | |
| 71 | void QmlJS::ModuleCompletionItem::execute(KTextEditor::View* view, const KTextEditor::Range& word) |
| 72 | { |
| 73 | switch (m_decoration) { |
| 74 | case Import: |
| 75 | // Replace the whole line with an import statement |
| 76 | view->document()->replaceText( |
| 77 | KTextEditor::Range(word.start().line(), 0, word.start().line(), INT_MAX), |
| 78 | QLatin1String("import ") + m_name |
| 79 | ); |
| 80 | break; |
| 81 | case Quotes: |
| 82 | view->document()->replaceText(word, QStringLiteral("\"%1\"").arg(m_name)); |
| 83 | break; |
| 84 | } |
| 85 | } |