Introduced Document::isQmlDocument() and Document::isJSDocument().

This commit is contained in:
Roberto Raggi
2010-03-29 12:56:25 +02:00
parent 6c1606a31b
commit 4ee8a199af
4 changed files with 36 additions and 10 deletions

View File

@@ -1354,12 +1354,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
if (! doc) {
snapshot = source.snapshot;
doc = snapshot.documentFromSource(source.code, source.fileName);
// ### This doesn't really work: what if snapshot doesn't have the doc?
if (snapshot.document(source.fileName)->qmlProgram())
doc->parseQml();
else if (snapshot.document(source.fileName)->jsProgram())
doc->parseJavaScript();
doc->parse();
}
SemanticInfo semanticInfo;