forked from qt-creator/qt-creator
		
	Introduce JSON validation
Support basic validation for JSON files according to the draft http://tools.ietf.org/html/draft-zyp-json-schema-03. This is not a complete implementation yet, but it should already be useful, since "type" verification along with many of the attributes is done. Change-Id: I364bc98dd92937c5e2ea9cba7e15ed8e03eb9beb Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
This commit is contained in:
		@@ -70,6 +70,7 @@
 | 
			
		||||
#include <texteditor/textfilewizard.h>
 | 
			
		||||
#include <texteditor/texteditoractionhandler.h>
 | 
			
		||||
#include <utils/qtcassert.h>
 | 
			
		||||
#include <utils/json.h>
 | 
			
		||||
 | 
			
		||||
#include <QtCore/QtPlugin>
 | 
			
		||||
#include <QtCore/QDebug>
 | 
			
		||||
@@ -98,7 +99,10 @@ QmlJSEditorPlugin::QmlJSEditorPlugin() :
 | 
			
		||||
    m_actionHandler(0),
 | 
			
		||||
    m_quickFixAssistProvider(0),
 | 
			
		||||
    m_reformatFileAction(0),
 | 
			
		||||
    m_currentEditor(0)
 | 
			
		||||
    m_currentEditor(0),
 | 
			
		||||
    m_jsonManager(new Utils::JsonSchemaManager(
 | 
			
		||||
            QStringList() << Core::ICore::instance()->userResourcePath() + QLatin1String("/json/")
 | 
			
		||||
                          << Core::ICore::instance()->resourcePath() + QLatin1String("/json/")))
 | 
			
		||||
{
 | 
			
		||||
    m_instance = this;
 | 
			
		||||
}
 | 
			
		||||
@@ -285,6 +289,11 @@ void QmlJSEditorPlugin::initializeEditor(QmlJSEditor::QmlJSTextEditorWidget *edi
 | 
			
		||||
    TextEditor::TextEditorSettings::instance()->initializeEditor(editor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Utils::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() const
 | 
			
		||||
{
 | 
			
		||||
    return m_jsonManager.data();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void QmlJSEditorPlugin::followSymbolUnderCursor()
 | 
			
		||||
{
 | 
			
		||||
    Core::EditorManager *em = Core::EditorManager::instance();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user