Can QTCreator search for a specific warning or error and show all instances? - qt-creator

In example, let's say I want to search for all lines that have a warning about an extra semicolon (;). Can I search for that somehow?
I can easily look at the "issues" tab in QTCreator, but there's no way (as far as I know) to filter by type of issue. And if there are many, it's hard to find them.
Even more helpful, is it possible to search for macro-related issues, ie, unterminated conditional directive and show all files with an instance of it?

Related

What is spifno1stsp really doing as a rsyslog property?

I was reading the template documentation of rsyslog to find better properties and I stumble upon this one:
spifno1stsp - expert options for RFC3164 template processing
However, as you can see, the documentation is quite vague. Moreover, I have not been able to find a longer explanation anywhere. The only mentions found with Google are always about the same snippet or the same very short description.
Indeed, there is no explanation of this property:
on the entire rsyslog.com website,
or in the RFC3164,
or anywhere else actually.
It is like everybody copy & paste the same snippet here and there but it is very difficult to understand what it is actually doing.
Any idea ?
Think of it as somewhat like an if statement. If a space is present, don't do anything. Otherwise, if a space is not present, add a space.
It is useful for ensuring that just one space is added to the output, often between two strings.
For any cases like this that you find where the docs can be improved please feel free to open an issue with a request for clarification in the official GitHub rsyslog documentation project. The documentation team is understaffed, but team members will assist where they can.
If you're looking for general help, the rsyslog-users mailing list is also a good resource. I've learned a lot over the years by going over the archives and reading prior threads.
Back to your question about the spifno1stsp option:
While you will get a few hits on that option, what you'll probably find more results on is searching for the older string template option, sp-if-no-1st-sp. Here is an example of its use from the documentation page you linked to:
template(name="forwardFormat" type="string"
string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%msg%"
)
Here is the specific portion that is relevant here:
`%msg:::sp-if-no-1st-sp%%msg%`
From the Property Replacer documentation:
sp-if-no-1st-sp
This option looks scary and should probably not be used by a user. For
any field given, it returns either a single space character or no
character at all. Field content is never returned. A space is returned
if (and only if) the first character of the field’s content is NOT a
space. This option is kind of a hack to solve a problem rooted in RFC
3164: 3164 specifies no delimiter between the syslog tag sequence and
the actual message text. Almost all implementation in fact delimit the
two by a space. As of RFC 3164, this space is part of the message text
itself. This leads to a problem when building the message (e.g. when
writing to disk or forwarding). Should a delimiting space be included
if the message does not start with one? If not, the tag is immediately
followed by another non-space character, which can lead some log
parsers to misinterpret what is the tag and what the message. The
problem finally surfaced when the klog module was restructured and the
tag correctly written. It exists with other message sources, too. The
solution was the introduction of this special property replacer
option. Now, the default template can contain a conditional space,
which exists only if the message does not start with one. While this
does not solve all issues, it should work good enough in the far
majority of all cases. If you read this text and have no idea of what
it is talking about - relax: this is a good indication you will never
need this option. Simply forget about it ;)
In short, sp-if-no-1st-sp (string template option) is analogous to spifno1stsp (standard template option).
Hope that helps.

Highlight specific keywords in the terminal as they appear

In iTerm2 you can create triggers that highlight a line if your regex matches. This is great for some cases but I was wondering if it was possible to highlight only a word on a specific line.
The purpose of this is to help read my server logs where specific keywords can be easily pointed out. Highlighting the entire line is a bit distracting
A Profile-based trigger can highlight as much or little of a line as you choice (via the regex).
To highlight just a "word" in a line, you can create a simple Highlight Text trigger, i.e.:
Results in:
Ref: https://iterm2.com/documentation-triggers.html
Below is where you will find Triggers
As an additional usage of the selected answer, I'd like to suggest adding a tigger for "smart quotes" with the regex [”“’‘]
This will save you some day when a coworker sends you a line of code via a chat mechanism (like Slack) and the quotes get automagically "improved". The trigger won't fire as you paste/type them, but they will happen after the line scrolls up your terminal. So, it won't prevent the mistake, but it will save you time wondering why the command failed.

Search and display all Exceptions in VisualStudio2010 solution in a grouped view/list

I am trying to find every exception used in within a big solution. I am doing this so I can replace generic Exceptions of Type "Exception" or "ArgumentException" with more specific ones.
What I tried at first was using the build in "Show Using"-Feature which, in case the Object is beeing used more than once" shows a nice tree-view of all the findings. It's great to navigate.
Only Problem ist that I don't know every Type that was used. If I use the normal search feature I get a simple List.
Using ReSharper I found that I can use the "Find" > "Search with PAttern" Feature. Only Problem here is that it is automatically case sensitive and "whole words" only.
Is there a build in feature like the "Usages"-Feature for a search?
PS: I also tried the "Find in File", that is just a list. I get every occurance of the word exception, which is helpfull but I lose the ability to navigate through a tree view.
You can use argument placeholders to search for anything that inherits from System.Exception
And I'm not sure what you mean about it being case-sensitive. I tried the below (notice that I'm in VB and I've failed to capitalize ThrowandNew`), but it still matched all the places I throw exceptions in my code.
I wasn't however able to search for just $type$, but this should catch any exceptions you throw in your code. You could try similar patterns to look for methods that handle exceptions. I'm using ReSharper 7.1.

How to make Intellisense in Visual Studio 2012 not to substitute text right to the cursor?

While programming I often realize that I need to add something before already typed code. For example I type the name of the variable:
input[0]
and then I realize that my array is of type string and I need to convert it. So, I move to the beginning of the word (with Ctrl-Left Arrow) and start typing
Convert.To|input[0]
with pipe used to show the position of my cursor. I get some suggestions from Intellisense, including the ToInt32() method I am looking for. But as long as I confirm this suggestion with Tab or Space, I get the following:
Convert.ToInt32(|)[0]
So, the text from the cursor position to the end of the word is substituted with suggestion, and this is definitely not what I want.
This problem is not specific for VS 2012 and might be due to some extensions I have installed, but my attempt to pursue its origin did not yield anything. I have following extensions installed: ReSharper, PowerCommands, Productivity Power Tools.
If you are entering an unrelated expression before an identifier, add a space before you start typing the new expression. This will prevent the completion from replacing the existing identifier.
For example, if | marks the caret, the following scenario would avoid the problem you are facing.
Convert.To| input
This code completion feature is designed to prevent the insertion of incorrect identifiers. If Visual Studio behaved like some other IDEs I know of, using the code completion feature in your original example would result in the insertion of ToInt32input, which would never be valid.
If you are interested in additional thoughts regarding this feature in general, I have described this as the Extend (default for Visual Studio) and No-extend (default for NetBeans, Eclipse, and others) modes in my blog article Code Completion filtering, selection, and replacement algorithms.
A two years later answer. But it might still be useful for some.
What helped for me in VS2015 (which might also work in VS2012) is to add the a space character to the list of 'Member List Commit Characters' in the Intellisense settings.
After this the characters after the cursor are not removed by an auto-completion.

Is there a way to exclude unnecessary classes from a keyword search in MSDN?

When using "keyword search" in offline MSDN that came with VS2008, is there any way to exclude unnecessary classes / namespaces that I know beforehand is out of the scope of my search? The search "filter" seems way to broad for this purpose.
To be specific, when I search for a class, say "ListView", I DO NOT want System.Web.UI class to show up as the first suggestion just because it is the first one alphabetically, and instead would like to see System.Windows.Forms.ListView as the document that comes up. I guess I could live with going to search result and browse through to find the intended class, or maybe typing class names with full namespace... But it would make my life easier if I could either temporary or even permanently (I know I won't touch ASP.NET for a while) remove unnecessary classes from the search index.
TIA
After trying several options I found out that manually taking the .HXS files associated with the unneeded namespaces out of the MSDN directory (In my case, C:\Program Files\MSDN\MSDN9.0\1041) seems to do the trick. MSDN document explorer recreates help index on the next launch after the content of the directory was modified. So even in case you need the documentation again, you can restore the help by simply moving the files back into the original folder.
The files I moved to take out System.Web.UI documentations were:
fxref_system.web.ui.adapters.hxs
fxref_system.web.ui.desi_obilecontrols.converters.hxs
fxref_system.web.ui.design.hxs
fxref_system.web.ui.design.mobilecontrols.hxs
fxref_system.web.ui.design.webcontrols.hxs
fxref_system.web.ui.design.webcontrols.webparts.hxs
fxref_system.web.ui.htmlcontrols.hxs
fxref_system.web.ui.hxs
fxref_system.web.ui.mobi_s.adapters.xhtmladapters.hxs
fxref_system.web.ui.mobilecontrols.adapters.hxs
fxref_system.web.ui.mobilecontrols.hxs
fxref_system.web.ui.webcontrols.adapters.hxs
fxref_system.web.ui.webcontrols.hxs
fxref_system.web.ui.webcontrols.webparts.hxs
Was pretty surprised when I saw this kind of somewhat primitive and forcible method to be the most effective...
Type "listview NOT System.Web.UI.ListView" for example - without the quotes :)

Resources