ros-industrial / ros_qtc_plugin

ROS Qt Creator Plug-in (https://ros-qtc-plugin.readthedocs.io)
398 stars 214 forks source link

Add highlighting file for *.launch, *.xacro, and *.urdf #416

Open mpowelson opened 3 years ago

mpowelson commented 3 years ago

Should fix syntax highlighting for launch, xacro, and urdf files. Currently you have to modify the settings to add them to the default xml highlighting file or add <?xml version="1.0"?> to your files.

christian-rauch commented 3 years ago

Is the syntax highlighting different from other XML documents? Would it be possible to register the ROS MIME types with the other syntax or include the base XML syntax here?

A quick googling gave me https://www.qtcentre.org/threads/38353-Cannot-add-new-mimetype-for-a-custom-Qt-Creator-Plugin where it looks like the mimetypes.xml registers a new file format that subclasses application/xml. Could we do something like this so .launch, .xacro and *.urdf files are recognised as XML files and will always use the same XML syntax highlighting?

Levi-Armstrong commented 3 years ago

Is the syntax highlighting different from other XML documents? Would it be possible to register the ROS MIME types with the other syntax or include the base XML syntax here?

A quick googling gave me https://www.qtcentre.org/threads/38353-Cannot-add-new-mimetype-for-a-custom-Qt-Creator-Plugin where it looks like the mimetypes.xml registers a new file format that subclasses application/xml. Could we do something like this so .launch, .xacro and *.urdf files are recognised as XML files and will always use the same XML syntax highlighting?

Yea, at one point I had this working early on then when I updated to another version it was broken, and never got around to figuring it out. Though it should be possible.

Here is the file that is being added but it does not appear to work anymore.

https://github.com/ros-industrial/ros_qtc_plugin/blob/devel/src/project_manager/ROSProjectManager.mimetypes.xml