| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | /****************************************************************************
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2016-01-15 14:57:40 +01:00
										 |  |  | ** Copyright (C) 2016 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** This file is part of Qt Creator. | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							| 
									
										
										
										
											2016-01-15 14:57:40 +01:00
										 |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2016-01-15 14:57:40 +01:00
										 |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2012-10-02 09:12:39 +02:00
										 |  |  | ****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "qmljsquickfixassist.h"
 | 
					
						
							|  |  |  | #include "qmljseditorconstants.h"
 | 
					
						
							| 
									
										
										
										
											2014-02-07 13:45:51 +01:00
										 |  |  | #include "qmljseditordocument.h"
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | //temp
 | 
					
						
							|  |  |  | #include "qmljsquickfix.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-08 17:20:48 +01:00
										 |  |  | #include <utils/algorithm.h>
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | using namespace QmlJSTools; | 
					
						
							|  |  |  | using namespace TextEditor; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-03 19:31:32 +02:00
										 |  |  | namespace QmlJSEditor { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace Internal; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | // -----------------------
 | 
					
						
							|  |  |  | // QuickFixAssistInterface
 | 
					
						
							|  |  |  | // -----------------------
 | 
					
						
							| 
									
										
										
										
											2014-08-25 20:01:46 +02:00
										 |  |  | QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSEditorWidget *editor, | 
					
						
							| 
									
										
										
										
											2015-02-03 23:48:57 +02:00
										 |  |  |                                                            AssistReason reason) | 
					
						
							| 
									
										
										
										
											2014-09-04 00:04:18 +02:00
										 |  |  |     : AssistInterface(editor->document(), editor->position(), | 
					
						
							| 
									
										
										
										
											2014-12-21 21:54:30 +02:00
										 |  |  |                       editor->textDocument()->filePath().toString(), reason) | 
					
						
							| 
									
										
										
										
											2014-02-07 13:45:51 +01:00
										 |  |  |     , m_semanticInfo(editor->qmlJsEditorDocument()->semanticInfo()) | 
					
						
							| 
									
										
										
										
											2014-02-07 14:47:35 +01:00
										 |  |  |     , m_currentFile(QmlJSRefactoringChanges::file(editor, m_semanticInfo.document)) | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QmlJSQuickFixAssistInterface::~QmlJSQuickFixAssistInterface() | 
					
						
							|  |  |  | {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const SemanticInfo &QmlJSQuickFixAssistInterface::semanticInfo() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return m_semanticInfo; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-17 11:35:57 +02:00
										 |  |  | QmlJSRefactoringFilePtr QmlJSQuickFixAssistInterface::currentFile() const | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2011-08-17 11:35:57 +02:00
										 |  |  |     return m_currentFile; | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ---------------------------
 | 
					
						
							|  |  |  | // QmlJSQuickFixAssistProvider
 | 
					
						
							|  |  |  | // ---------------------------
 | 
					
						
							| 
									
										
										
										
											2016-03-16 13:04:05 +01:00
										 |  |  | QmlJSQuickFixAssistProvider::QmlJSQuickFixAssistProvider(QObject *parent) | 
					
						
							| 
									
										
										
										
											2017-12-15 09:46:29 +01:00
										 |  |  |     : IAssistProvider(parent) | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | QmlJSQuickFixAssistProvider::~QmlJSQuickFixAssistProvider() | 
					
						
							|  |  |  | {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-30 11:58:20 +02:00
										 |  |  | IAssistProvider::RunType QmlJSQuickFixAssistProvider::runType() const | 
					
						
							| 
									
										
										
										
											2013-09-17 13:25:39 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-04-30 11:58:20 +02:00
										 |  |  |     return Synchronous; | 
					
						
							| 
									
										
										
										
											2013-09-17 13:25:39 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor() const | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-12-15 09:34:02 +01:00
										 |  |  |     return new QuickFixAssistProcessor(QmlJSQuickFixFactory::allQuickFixFactories()); | 
					
						
							| 
									
										
										
										
											2011-04-15 16:19:23 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2013-06-03 19:31:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | } // namespace QmlJSEditor
 |