Re: [Qt-creator] SyntaxHighlighting + Bison/FLex

2017-11-22 Thread David Schulz

Hi Jeremy,

That sounds more like a semantic highlighter to me. Have a look at 
SemanticHighlighter::incrementalApplyExtraAdditionalFormats in 
src\plugins\texteditor\semantichighlighter.cpp and the usages in the 
QML/JS and C++ semantic highlighter.



Br,

David


On 23-Nov-17 07:29, JeremY Larrieu wrote:

Hello,

I'm working on making a plugin to support a specific language: Anubis.

I've started the highlighting part and I saw that QtCreator is making 
syntax highlighting line by line instead of making it "globally" for 
the whole file.


I just wanna know, how can I use the Bison/Flex files, used to check 
syntax for Anubis language, to make syntax highlighting in QtCreator.
Knowing that most of the tokens declared in the Flex file can be 
multiline, making a lexer, working line by line, able to detect those 
tokens is hard and the code is too "verbose".


I've tried to adapt what I've found in Bison/Flex files to make a 
syntax highlighter, but it's really painful and it makes further 
updates harder.
If I was able to apply highlighting on the whole file (not line by 
line), it were simpler and I could use it to make some other 
functionalities at the same time: code completion, code analysis, 
symbol detection, ...


Do you have an idea on how I can make syntax highlighting without 
rewriting a full lexer ?


Thanks in advance.

Jeremy


___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Disabling auto-reload of qbs files

2017-11-22 Thread André Hartmann

Hi Christian (Gagneraud),

OK, I just realised that i'm using a custom build of Qtc, "Qt Creator 
4.5.0-rc1 (4.4.83)" - built on the 18th of October.
The reason being that Qt doesn't support Linux-x86_32 anymore, so I have 
to build it myself (I cannot switch to Linux-x86_64).
So this might not help at having a stable QtC. I will first install a 
release build (4.4.1 tag) and see how it goes.


Why? There won't be fixes to 4.4 anymore, as 4.5 is near the release. 
I'd continue with this version and provide as much info as possible to 
Christian (Kandeler). Perhaps its a regression? Then fixing it would be 
much appreciated by others also.


Best regards,
André
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


[Qt-creator] SyntaxHighlighting + Bison/FLex

2017-11-22 Thread JeremY Larrieu
Hello,

I'm working on making a plugin to support a specific language: Anubis.

I've started the highlighting part and I saw that QtCreator is making
syntax highlighting line by line instead of making it "globally" for the
whole file.

I just wanna know, how can I use the Bison/Flex files, used to check syntax
for Anubis language, to make syntax highlighting in QtCreator.
Knowing that most of the tokens declared in the Flex file can be multiline,
making a lexer, working line by line, able to detect those tokens is hard
and the code is too "verbose".

I've tried to adapt what I've found in Bison/Flex files to make a syntax
highlighter, but it's really painful and it makes further updates harder.
If I was able to apply highlighting on the whole file (not line by line),
it were simpler and I could use it to make some other functionalities at
the same time: code completion, code analysis, symbol detection, ...

Do you have an idea on how I can make syntax highlighting without rewriting
a full lexer ?

Thanks in advance.

Jeremy
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Disabling auto-reload of qbs files

2017-11-22 Thread Christian Gagneraud

On 22/11/2017 10:57 PM, Christian Kandeler wrote:

On Wed, 22 Nov 2017 17:27:11 +1300 Christian Gagneraud
 wrote:


When i work with QtC and qbs, and i need to tweak my qbs files,
Qtc auto-reload my project each time I save a qbs file, which in my
case means ca. 1 minute of un-usability.


First of all, that seems too long. Can you please file a task and
assign it to me? I'll provide you with instructions on how to see
where the time is spent. (Chances are it's somewhere else in Creator,
as project resolving happens in its own thread and should thus not
freeze the GUI).


OK, I just realised that i'm using a custom build of Qtc, "Qt Creator 
4.5.0-rc1 (4.4.83)" - built on the 18th of October.
The reason being that Qt doesn't support Linux-x86_32 anymore, so I have 
to build it myself (I cannot switch to Linux-x86_64).
So this might not help at having a stable QtC. I will first install a 
release build (4.4.1 tag) and see how it goes.


Chris
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Disabling auto-reload of qbs files

2017-11-22 Thread Christian Gagneraud

On 22/11/2017 10:57 PM, Christian Kandeler wrote:

On Wed, 22 Nov 2017 17:27:11 +1300 Christian Gagneraud
 wrote:


When i work with QtC and qbs, and i need to tweak my qbs files,
Qtc auto-reload my project each time I save a qbs file, which in my
case means ca. 1 minute of un-usability.


First of all, that seems too long. Can you please file a task and
assign it to me? I'll provide you with instructions on how to see
where the time is spent. (Chances are it's somewhere else in Creator,
as project resolving happens in its own thread and should thus not
freeze the GUI).


I have to say it's hard to reproduce, it's morning here, and my machine 
restarted overnight, so I've just run QtC and opened my project, and i 
cannot notice any slow down yet.


As the day goes i will try to report the exact condition(s), but i think 
it has to do with:

- Edit qbs (a build might be running)
- kill build and save qbs
- The qbs process kicks in
- The "Scanning for tests" kicks in
- The code model process kicks in
- Hit build  again (maybe while the test scan and code model are still 
running)


Thinking further as i type this message, this could be actually a 
resource problem with my machine: "only" 4 cores, it's a VM (gnome/mir 
thingy) that has poor graphical performance (I had to disable some gnome 
settings).
I'm constantly monitoring the CPU load, and I've notice that QtC is 
resource intensive (that might be due to the code model and test scanning).




I would prefer to edit and save my qbs files as I wish, and then 
explicitly tell QtC to "re-run qbs".


I think the auto-reload is very useful on small project, but is
not desirable on big projects. It would be nice to have an option
somewhere to control this behaviour.

Any comment on this feature request? I'm sure I'm not the only one
to be "hit" by this.


Independent of the build system, there are certain cases where the
"auto-reload" functionality is annoying, e.g. when you type in a new
build directory (there is a delay, but it only helps so much). On the
other hand, suppose you could switch that off via some hypothetical
checkbox. If you then forget to manually reload, Creator will have an
outdated view of the project, which may result in surprising behavior
e.g. regarding the code model, in turn leading to bogus bug reports.
That's not to be underestimated.


I fully agree with you, but i feel comfortable with that.
The reason being that, on this project, right now, i mainly do "qbs 
stuff" within QtC, my goal is to build this project with QtC and Qbs. At 
this stage, I do not really care about up-to-date code model (which 
takes quite some time) and the auto-tests (which takes quite some time 
too, but I've now disabled this plugin).
I would say that the size of my project is very roughly similar to QtC's 
one. My Qbs files are actually not complicated, there's no crazy 
dependency, ...


Basically my work flow is:
- try to build
- analyse build failure
- tweak Qbs
- rince and repeat

Will see later in the day, if I can capture the scenario and i have the 
feeling that it's not due to my VM, I will create a ticket with all the 
necessary details.


Thanks for your help,
Chris

___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator


Re: [Qt-creator] Disabling auto-reload of qbs files

2017-11-22 Thread Christian Kandeler
On Wed, 22 Nov 2017 17:27:11 +1300
Christian Gagneraud  wrote:

> When i work with QtC and qbs, and i need to tweak my qbs files, Qtc 
> auto-reload my project each time I save a qbs file, which in my case 
> means ca. 1 minute of un-usability.

First of all, that seems too long. Can you please file a task and assign it to 
me? I'll provide you with instructions on how to see where the time is spent. 
(Chances are it's somewhere else in Creator, as project resolving happens in 
its own thread and should thus not freeze the GUI).

> I would prefer to edit and save my qbs files as I wish, and then 
> explicitly tell QtC to "re-run qbs".
> 
> I think the auto-reload is very useful on small project, but is not 
> desirable on big projects. It would be nice to have an option somewhere 
> to control this behaviour.
> 
> Any comment on this feature request? I'm sure I'm not the only one to be 
> "hit" by this.

Independent of the build system, there are certain cases where the 
"auto-reload" functionality is annoying, e.g. when you type in a new build 
directory (there is a delay, but it only helps so much). On the other hand, 
suppose you could switch that off via some hypothetical checkbox. If you then 
forget to manually reload, Creator will have an outdated view of the project, 
which may result in surprising behavior e.g. regarding the code model, in turn 
leading to bogus bug reports. That's not to be underestimated.


Christian
___
Qt-creator mailing list
Qt-creator@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qt-creator