How to make search by multiline string? - phpstorm

Can I in PhpStorm 2021.2 to make search by multiline string, like :
Facility
::orderBy()
...
If yes, how?
Thanks in advance!

Easy, just click on the "New Line" button to add the new line (see screenshots below).
Alternatively (if a text is already in the file) make a selection first and then hit the Find button -- the selected text will be inserted into the search field.
Local Find (in a current file):
Find in Files:

Related

Google App Script. How can i get hyperlink name?

Have troubles with extracting url from text in google document. I found method getLinkUrl(offset). It works fine, but if i for example add link not directly to text but via menu item Insert -> Link i can specify some name for link, for example name, that will be displayed in text will be StackOverflow and the link is https://stackoverflow.com, so when i use method getLinkUrl() i will get hyperlink but not the name. I need to get position of this link on text, so i need to get this word StackOverflow but i didn't find corresponding method for this.
Is someone know how i can get this word or its start and end indexes?
I know about attributeIndices property which contains indexes of starting of special formatting of text and it can be used in this case, but if link is last word in paragraph, there is no any more attribute index in this array, so i can not determine length of this word.
Would be appreciate for any advice)

Sublime Text: Accept Suggested Autocomplete Without Expanding it

In Sublime Text, I have installed Emmet so that I can do zen coding. Now, the problem is that when I'm typing, and get an autocomplete suggestion, as soon as I accept that autocomplete suggestion (either by entering tab, enter, or even pressing space bar), the suggested tag is expanded; this causes me not to be able to continue the zen coding.
To give you an example, say I want to insert a <select> with 6 <option> child elements. If I enter select>opt, then autocomplete suggests option, but as soon as I accept option, that expands to select<option></option>.
What I want is to accept option, but that it won't expand to <option></option>.
Is there anyway to accomplish this?
Actually, the answer is very simple. In your example, when you get the autocomplete suggestions for option, you will get 2 of them. One is the tag, the other is text. Use Ctrl+Space to go through all the suggestions, and select the text version of option and not the tag version.
In Sublime Text completions consists of a 2-tuple containing the showed string and the inserted characters/snippet. I don't think know whether it is possible to just insert the showed string. However if you search for any way, there is a way to establish: modify the source code of the html tag completion file.
Install PackageResourceViewer, then press ctrl+shift+p write PackageResourceViewer: Open Resource. Select HTML >>> html_completions.py.
If you save the file it will shadow (not overwrite) the original completions file. Hence just remove it to get the original behavior.
In this file:
in line 15 replace return (tag + '\tTag', tag + '>$0</' + tag) by return (tag + '\tTag', tag).
in line 245 replace completion_list = [(pair[0], '<' + pair[1]) for pair in completion_list] by completion_list = [(pair[0], pair[1]) for pair in completion_list]
Now it should insert the tag names instead of the whole tags.

What is the style of search used in Sublime Text Command Pallette called?

I have a simple question.. I want to know what a style of searching is referred to as, like how may I refer to this style of searching when I am researching it.
In Sublime Text 3 when you hit Ctrl+ Shift + P the command pallette pops up, and you are able to type in a search query... Now, the special thing about this Sublime Text find box is that it will find search results based on the number of matched characters in sequence, rather than the strict name of the file. So, something like "packcon" will bring up "Package Control" and then something like "synrub" will bring up "Syntax: Ruby".
What is this style of string matching called?
Fuzzy Matching is the common name but more correctly referred to as Approximate String Matching.
More to read here : http://en.wikipedia.org/wiki/Approximate_string_matching

Sublime Text syntax highlighting regex not working

I use angularJS, and have various directives that follow a naming convention like "app-data-grid", "app-slider", "app-carousel" or "app-compile-some-template", etc. Essentially, it is the normal angular directive naming convention of [app name]-[dash delimited words]. Sublime Text HTML language syntax highlighting doesn't properly match these with its regex. It will highlight "app" in "<app-carousel" or "<app-some-long-directive-name" but will not highlight the entire tag name.
Here is the predefined regex in the HTML.tmLanguage file:
(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)
I tried adding a dash after the colon of the second matching group:
(<)([a-zA-Z0-9:-]++)(?=[^>]*></\2>)
The second regex worked in a regex tester, but did not work in Sublime Text.
Also, I have downloaded an AngularJS plugin that gave me an AngularJS-HTML language definition... which also has the same problem.
How can I fix the regex so that it matches the full tag name for highlighting?
Go to Preferences >> Settings-User.
On this JSON add to ignored_packages array an iten named "HTML", like this:
"ignored_packages":
[
"Vintage",
"HTML"
]
Save the file.
Now go to Preferences >> Browse Packeges, make a copy of HTML directory and rename it as "HTMLAngularJS".
Enter in to HTMLAngularJS directory and rename the file "HTML.tmLanguage" to "HTMLAngularJS.tmLanguage".
Edit "HTMLAngularJS.tmLanguage" file, find this both Regex:
<string>(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)</string> Line 45
and
<string>(</?)([a-zA-Z0-9:]+)</string> Line 514
Just add the slash and - after double points, should be like this:
<string>(<)([a-zA-Z0-9:\-]++)(?=[^>]*></\2>)</string>
and
<string>(</?)([a-zA-Z0-9:\-]+)</string>
Save the file and be happy!
Regards!
Use the HTML Extended sublime plugin
Did you add HTML to your ignore_package array in your user settings?
With that entry, you are overriding the default HTML syntax package, therefore forcing sublime to user your HTML.tmLanguage.
I found this answer from BoundinCode where he explains it, and this actually did the trick for me.

What is "overlay" in sublime text editor?

What is the "overlay" in ST and how can it be used? (please indicate default key bindings)
It's just a generic interface element which pops up a list of options and a field for searching them. Examples of overlays include the command palette (Ctrl+Shift+P) and Goto Anything (Ctrl+P).
Do you talking about command which by default binded to "ctrl+;"?
As far as i know it works like find(ctrl+f), but overlay can search for one word only.
For example we have this file:
Someone correct my english pls
If we will use find command we could look for more than one word like "my english".
But if we gonna use overlay we could to search for "my" or "english" only.
We can't search with overlay for "my engligh" cuz here is more than one word.
Sublime Text can read settings from multiple configuration files.
The default order is described here.
Packages/Default/Preferences.sublime-settings
Packages/Default/Preferences (<platform>).sublime-settings
Packages/User/Preferences.sublime-settings
<Project Settings>
Packages/<syntax>/<syntax>.sublime-settings
Packages/User/<syntax>.sublime-settings
<Buffer Specific Settings>
The latter configuration files override ("overlay") the former, allowing you to have more specific settings for certain programming language, project, etc.