Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 5.0.3
-
None
Description
If a variable is used inside a template literal, it is not affected by "Rename symbol under cursor" refactoring, and you cannot use go-to definition with it.
Consider
import QtQuick 2.15 import QtQuick.Window 2.15Rectangle { objectName: "foo" width: 640 height: 480 visible: true Component.onCompleted: { let fullContentPath = "/full/content/path" let volume = "super loud" let fillMode = "dashed" var src = `var videoPlayer = document.getElementById("videoPlayer"); var videoSource = document.getElementById("videoSource"); videoSource.src = ${fullContentPath}; videoPlayer.load(); videoPlayer.volume = ${volume} ; videoPlayer.setAttribute("style", "object-fit : ${fillMode};"); videoPlayer.play(); `; console.log(volume) } }
and rename `volume` to `loudness`: One would expect that it changes in the template literal, but it only changes in the console.log statement.
Moreover, you cannot click on it in the template literal to go to the definition (whereas it does work in the console.log statement).
Attachments
Issue Links
- resulted from
-
QTCREATORBUG-21869 Syntax highlight for backtick and template literals not supported
-
- Closed
-