See More

/***************************************************************************** * Copyright (c) 2007 Andreas Pakulat * * Copyright (c) 2007 Piyush verma * * * * Permission is hereby granted, free of charge, to any person obtaining * * a copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, sublicense, and/or sell copies of the Software, and to * * permit persons to whom the Software is furnished to do so, subject to * * the following conditions: * * * * The above copyright notice and this permission notice shall be * * included in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * *****************************************************************************/ #include "pythonlanguagesupport.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pythonparsejob.h" #include "pythonhighlighting.h" #include "duchain/pythoneditorintegrator.h" #include "codecompletion/pythoncodecompletionmodel.h" #include #include #include #include #include using namespace KDevelop; K_PLUGIN_FACTORY( KDevPythonSupportFactory, registerPlugin<:languagesupport>(); ) K_EXPORT_PLUGIN( KDevPythonSupportFactory( "kdevpythonsupport" ) ) namespace Python { LanguageSupport* LanguageSupport::m_self = 0; LanguageSupport::LanguageSupport( QObject* parent, const QVariantList& /*args*/ ) : KDevelop::IPlugin( KDevPythonSupportFactory::componentData(), parent ), KDevelop::ILanguageSupport() { KDEV_USE_EXTENSION_INTERFACE( KDevelop::ILanguageSupport ) m_self = this; m_highlighting = new Highlighting( this ); PythonCodeCompletionModel* codeCompletion = new PythonCodeCompletionModel(this); new KDevelop::CodeCompletion(this, codeCompletion, "Python"); } LanguageSupport::~LanguageSupport() { delete m_highlighting; m_highlighting = 0; } KDevelop::ParseJob *LanguageSupport::createParseJob( const KUrl &url ) { return new ParseJob(this, url); } QString LanguageSupport::name() const { return "Python"; } LanguageSupport* LanguageSupport::self() { return m_self; } KDevelop::ILanguage *LanguageSupport::language() { kDebug() << core()->languageController()->language( name() ); return core()->languageController()->language( name() ); } KDevelop::ICodeHighlighting* LanguageSupport::codeHighlighting() const { return m_highlighting; } // QWidget* LanguageSupport::specialLanguageObjectNavigationWidget(const KUrl& url, const KDevelop::SimpleCursor& position) // { // kDebug() << "Navigation widget requested *** "; // QFrame* frame = new QFrame(); // QLabel* label = new QLabel(); // QHBoxLayout *layout = new QHBoxLayout(); // label->setText("Foo"); // frame->setLayout(layout); // layout->addWidget(label); // return frame; // } } #include "pythonlanguagesupport.moc"