forked from qt-creator/qt-creator
QML Observer: Refresh debug id's when new objects are created
Previously, the user had to navigate to the context of a qml item in order to edit its source code in Live Preview mode. This change tells the client to update when new objects are created on server-side, and makes the editing possible without having to manually trigger updates.
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
#include <qmljs/qmljsdelta.h>
|
||||
#include <qmljs/parser/qmljsast_p.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/project.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
@@ -532,6 +534,12 @@ void QmlJSLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc)
|
||||
if (!core->hasContext(dbgcontext))
|
||||
return;
|
||||
|
||||
if (ProjectExplorer::Project *debugProject = Inspector::instance()->debugProject()) {
|
||||
QStringList files = debugProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
|
||||
if (!files.contains(doc->fileName()))
|
||||
return;
|
||||
}
|
||||
|
||||
bool experimentalWarningShown = false;
|
||||
|
||||
if (m_applyChangesToQmlObserver) {
|
||||
|
||||
Reference in New Issue
Block a user