Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Refactoring in "plain-file" projects
Forum Updated to NodeBB v4.3 + New Features

Refactoring in "plain-file" projects

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 467 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    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.

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

    main.yaml
    module1.yaml
    module2.yaml
    

    In one file I might have something like this:

    sensorGroup:
      name: Sensors
    

    and in the others:

    entities:     
          - 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?

    mrjjM 1 Reply Last reply
    0
    • M Mark81

      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.

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

      main.yaml
      module1.yaml
      module2.yaml
      

      In one file I might have something like this:

      sensorGroup:
        name: Sensors
      

      and in the others:

      entities:     
            - 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?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Mark81
      Hi
      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.

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved