I am currently trying to make an extension in visual studio that uses the results from the normal search and shows the results in it's own view that does not display the found results per file, but per user-defined modules.
For example the usual search gives:
4 results found in 3 files
src/extension.ts (2 results)
folder2/file1.ts (1 result)
folder2/file2.ts (1 result)
Then my extension could show:
4 results found in 2 modules
src/ (2 results)
folder2/ (2 results)
For this I looked up the Contribution points and in "contributes.menus" there is the Explorer context menu that contains the group "4_search" - Commands related to searching in the search view.
How can I use this contribution point for my extension? Is it even feasible to use the search results and show the data in a new view like the example above?
Edit:
I realised that I did not understand the contribution points at all when asking and it is not what I need. Do you know how I can execute a command whenever the user searches for something in the search view and get the search results as parameters for the command?
Thanks for your help.
Related
The current behavior as follow:
- List item 1
- List item 1.1 that span over
multiple line
- List item 2
I want it to look like this:
- List item 1
- List item 1.1 that span over
multiple lines
- List item 2
The main reason I want to improve this is readability. I already searched everywhere and couldn't find an answer to that, I hope someone will be able to help me, if it's even possible.
I tried to search in google and looked at the settings of visual studio code but I couldn't find any solution. Referring to the textMateRules didn't help as well.
I found a solution; adding the following lines to the settings.json file will change the wrapping indent to what I described above.
"[markdown]": {
"editor.tabSize": 1,
"editor.wrappingIndent": "deepIndent"
}
As per the answers in this question, there are two primary ways to search for files in VSCode:
By using CTRL/CMD + P/E to search and "go to file"
By clicking anywhere in the explorer tree and typing
Why do the above solutions not suit my needs?
I need a way to search for files and get a full list of them (in plain view) so I can easily scan them.
The 1st method returns only partial results unless I scroll down.
The 2nd method only searches the folder tree that's currently open.
I know I can use the find command in Linux to achieve this, but can I achieve something similar in the editor itself?
Suppose I do:
ctrl+shift+p
Search: Find in Files
<provide search term>
Can I sort the results by recent changes?
Note, all included files are also under version control, if that matters.
It isn't very accessible (not on the search side bar / panel) but there is a setting for this:
Features > Search > Sort Order
And an option to set it to modified like this in JSON:
"search.sortOrder": "modified"
That is still shown grouped by file but at last shows the most recently modified result first.
When we are searching using ctrl + shift + f command in visual studio code for entire project , we are getting multiple files listing in which search values found.
Is there any way so that I can sort those search files because visual studio code not showing sorted search files.
I have gone through official website but not able to find such command.
I have checked to find similiar option to sort files as you are asking in visual studio code but not able to find any but you can see that visual code already sorting those file based on folder like account,base etc...
You can try regex to search to minify your serach criteria like a*.html, bo*.html,
[abc]*.html.
Hope above help you to sort out your problem.
You can (now?) sort results by updating user settings. Settings > Search "sort order". You'll see a few options:
Search: Sort Order - Sorting search results
Explorer: Sort Order - Sorting files in the file explorer
We have one installation of Eclipse which does not show the individual lines on which search results occur as do all other installations, as shown here:
How can we turn on this feature so that individual results in each line are shown?
I think it's a question of what tool you are using. If you do a text search, you get one line per hit. But if, say, you look for references to a Java method, you get one line per file.
Although it seems like a perfectly desirable thing, I can't find any way to get Java search to return one line per hit.
In the preferences of the Search window (usually button with triangle icon) choose "Show as List" item