qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.36k stars 2.98k forks source link

Variable editor should should used references #32799

Open NathanW2 opened 4 years ago

NathanW2 commented 4 years ago

It would be nice if we had a way to know where a variable has been used within the open project so when you change a variable you will know where it is going to be used

Note: Created from Nyalls FOSS4G style workshop

m-kuhn commented 4 years ago

A "walk all expressions used in project" would be sweet!

This could be used for project file translation too, i.e. having a tr('Text to translate') method and when exporting the .ts file for translation we could collect all those usages.

Or to throw around a warning "You are using $now which has been replaced with now()".

nyalldawson commented 4 years ago

This is quite trivial to do for symbology now, thanks to the style entity visitor.

We could potentially extend this to a expression visitor to allow collection from other things like editor widgets, field constraints, etc...