Refactoring in "plain-file" projects

  • Often I use QtCreator to edit projects that are no C/C++. Sometimes they are simply plain files, i.e. YAML files. So I create a new project selecting the options to import existing one, that basically allows you to choose a folder and select which files in there should be imported in the QtCreator project.

    It's understandable that there are no refactoring options, but I wonder if there's a way to "fool" the system and get get they working. What I what to do is a smarter search/replace feature.

    Let's say my project is composed of these files:


    In one file I might have something like this:

      name: Sensors

    and in the others:

          - group.sensorGroup

    Now if I want to change "sensorGroup" to something else I have to manually search & replace in all files the same string. If they are a lot it's time-consuming and error prone.
    With "refactoring" I would highlight sensorGroup in any file, right click -> rename to whatever and that's done!

    Is it possible?

  • Lifetime Qt Champion

    I dont think its possible as it has no concept of what
    it is and cant find the use of it. Its just text

    However, search and replace can use regular expressions so
    you can make it find only the right ones if you write the proper regexp.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.