On Tuesday 11 January 2011 08:00:28 ext C. Bergström wrote:
> 1) What would be the best approach to swap out the current syntax
> highlighting or adding a new language (For example using libclang
> instead of what's built-in now or adding Fortran)

To use different syntax highlighting, you have to adjust the SyntaxHighlighter 
that is used on a text editor. Check CppHighlighter for the implementation of 
the current C++ highlighter.
As long as a different implementation fills the text block's user data in a 
compatible way, they should be interchangable.

Note though that Creator also has a semantic highlighter for C++ that uses the 
code model to adjust the highlighting based on semantic information in a 
second pass. Look at CPPEditor::highlightSymbolUsages and CheckSymbols.

To add support for a new language, we usually make a new editor and extend it 
with a highlighter, auto completer, indenter, etc. Maybe look at 
GLSLTextEditor, I think it's one of the smaller full-blown editors. If all you 
want is syntax highlighting, use the generic highlighting support and provide 
a syntax definition file for your language; I expect Fortran already has one. 
See Settings->Text Editor->Generic Highlighter.

Cheers,
Christian
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator

Reply via email to