Git Product home page Git Product logo

vscode-finditfaster's Introduction

FindItFaster

CI pipeline - release Platform support

Finds files and text within files, but faster than VS Code normally does.

Make sure to check the Requirements below (TL;DR: have fzf, rg, bat on your PATH).


Default key bindings:

  • cmd+shift+j / ctrl+shift+j to search files,
  • cmd+shift+u / ctrl+shift+u to search for text within files,
  • cmd+shift+ctrl+u / ctrl+shift+alt+u to search for text within files with type pre-filtering.

You can change these using VS Code's keyboard shortcuts.

Recommended settings:

  • set find-it-faster.general.useTerminalInEditor to true to have the extension window open in the editor panel rather than in the terminal panel.

Native Windows support is now implemented (experimental)! Also see Known Issues.


Features

This plugin is useful if you deal with very large projects with lots of files (which makes VS Code's search functionality quite slow), or when you simply love using fzf and rg and would like to bring those tools inside VS Code, similar to how the excellent fzf.vim plugin works for Vim.

This extension exposes four commands:

  1. Search for files and open them. Uses a combination of fzf, rg, and bat.
  2. Search within files for text and open them. Uses a combination of fzf, rg, and bat.
  3. Like 2., but you can limit the file types that will be searched.
  4. Resume search. Repeats the last run command with the previous query prepopulated.

If your active text editor has a selection, it will be used as the initial query (you can disable this setting).

⬇️  Find files
Find Files

⬇️  Find text within files
Find Within Files

⬇️  Find text within files, with file type filter
Find Within Files

This extension has also been tested on remote workspaces (e.g. SSH sessions).


Requirements

This plugin opens a terminal inside VS Code. Make sure that you can run fzf, rg, bat, and sed by running these commands directly in your terminal. If those work, this plugin will work as expected. If it doesn't, confirm that you are running recent versions of all three tools.

If you're not familiar with these command line tools, you might want to check them out. They are awesome tools that can be individually used and make you more productive. And when combined such as for instance in this extension, they're very powerful. They're available for many platforms and easy to install using package managers or by simply installing a binary.

I have no affiliation with any of these tools, but hugely appreciate them, and wanted to bring them into a VS Code context.


Extension Settings

See the settings for this extension in the GUI.
You might want to play with fzf, rg and bat on the command line and read their manuals in order to get a better understanding of some of the settings in this extension. It will be worth your time.

fzf can also be configured through various environment variables. This extension does nothing to disable that behavior, so feel free to use those. You can also check whether fzf is running inside this extension by checking whether the FIND_IT_FASTER_ACTIVE environment variable is set.


Known Issues

Windows. There are two ways of running this extension on Windows:

  1. Natively using Powershell. This feature was added as of May 2022 and is experimental at this stage. Please file an issue on Github if you find one.
  2. Through WSL (Windows Subsystem for Linux). You can run this extension inside a Remote-WSL workspace.

Not tested on Docker / Github code spaces. Will likely work without issues as the functionality is very similiar to other remote sessions (e.g. SSH, WSL).

Various small terminal issues. VS Code gives developers little control over the terminal. We can't know if you typed text into the terminal we create, so that might interfere with the extension. There are various subtle ways in which in which things can break, many of which can't be detected. That said, if you don't touch the FindItFaster terminal, things should work well!

NixOS:

The bash scripts use a shebang that conflicts with NixOs: #!/bin/bash , as bash isn't available in /bin, a work around is to this to follow the instructions in Issue #44 and change the shebangs manually, after this, the extention should work normally.


FAQ

🕹 How do I control the fuzzy finder view?

➥ Whatever defaults are present on your system (and read by VS Code) are used. For fzf, this means <Ctrl+K> moves the selection up, <Ctrl+J> moves down, and <Enter> selects. You can also use the up and down arrows if that's your thing. <TAB> for multiple select when available. Read the excellent fzf documentation to learn more about using fzf.

⬆️ I'm on Linux and I can't use Ctrl+K to navigate upwards in fzf.

➥ Probably VS Code is waiting for you to complete a multi-step keyboard shortcut (chord). Change the following setting in your preferences to disable chords:

"terminal.integrated.allowChords": false

🔍 There's a file that cannot be found / searched through?

➥ This extension enables you to search through multiple directories: the process working directory, the workspace directories, and any additional directories you specify in the extension settings. What paths are included is configured through the settings. There's a listSearchLocations command that can show you which paths are currently being indexed.

🧘 Can you give focus back to my editor / my problems panel / other?

➥ I don't the VS Code API enables me to do this. Shoot me a message if you think I'm mistaken and I'll try to make this better.
2023 Update: Added a setting find-it-faster.general.killTerminalAfterUse. When true, it will kill the extension's terminal which may result in VS Code focusing the previous one. It may help you.
2024 Update: I recommend using find-it-faster.general.useTerminalInEditor. This way, the extension window won't interfere with your other terminals, and you get more real estate for previewing files.

🐞 I found a bug!

➥ Yeah, that's not unlikely. There are a lot of edge cases with this sort of tooling. Three options:

  1. Shrug :)
  2. File a Github issue. Please give detailed information as the devil is in the details. Please provide at least:
    • OS
    • VS Code version
    • Does it happen after you reset to default settings (if relevant)?
    • Anything special about your configuration / workspace. Did you have spaces in there? Is it on a network share or some other thing I definitely didn't test? Did you modify the extension settings?
  3. For the most up to date information on contributing fixes and features, see CONTRIBUTING.md.

💩 I don't like fzf / rg / bat. Can I just use find, grep, and cat or something else?

➥ You can actually already use other preview tools than bat, e.g. cat. I've left some hints in the settings. Outside of what's available, substituting other tools is not supported.

💲 Can I set FZF env vars that only work within this extension?

➥ You can, by adding something like this to ~/.bashrc or whatever configures your enviroment:

if [[ $FIND_IT_FASTER_ACTIVE -eq 1 ]]; then
  FZF_DEFAULT_OPTS='--height=50%'
fi

🪚 Can I build in a feature myself / contribute in some way?

➥ For the most up to date information on contributing fixes and features, see CONTRIBUTING.md.

🤑 Do you take donations?

➥ Thanks for asking, but no. The amount of work that went into this extension is tiny compared to the countless hours that have gone into the command line tools that are leveraged in this extension. Please support those tools instead.
What I do appreciate is if you'd help others find this extension by spreading the word and/or leaving a rating!


Release Notes

0.0.38

  • Updated dependencies, addressed a bug that caused the extension to not open

0.0.37 (broken)

  • New setting to have the window appear in the editor panel: find-it-faster.general.useTerminalInEditor. Please try it out!
  • This extension is now also available on OpenVSX (and therefore VSCodium)

0.0.36

  • Testing publishing to OpenVSX

0.0.35

  • Testing publishing to OpenVSX

0.0.34

  • Improve initial checks on Windows
  • Fix some issues with text selection on Windows
  • Better handling of special characters in paths

0.0.33

  • Fixed an issue related to directories with special characters in them

0.0.32

  • Fixed a bug in cursor when opening files that were previously opened

0.0.31

  • Various Windows fixes

0.0.30

  • Remove unnecessary check for sed on Windows

0.0.29

  • Fixed an issue with the killTerminalAfterUse feature
  • Add option to restore the previously active terminal
  • Small improvements to resumeSearch and query fuzzing

0.0.28

  • Fixed a bug that caused the extension to stop working altogether.

0.0.27

  • Add setting to fuzzy match on space bar in search within files function
  • Add FIND_IT_FASTER_ACTIVE environment variable when running inside extension

0.0.26

  • Resume search added as a new command. Resumes the last invoked command with the same query. Thanks for implementing @alexrenz!
  • Add feature to kill terminal after each use such that focus goes back to the previous terminal

0.0.25

  • Fix for UTF-8 paths on Windows. Thanks @ch0pex!

0.0.24

  • No user facing changes

0.0.023

  • Address Dependabot security issues

0.0.22

  • Bug fix on Windows that caused files to not open. Thank you @ObieMunoz for reporting and @Coombszy! for submitting a fix!

0.0.21

  • Add option to open editors in preview window. Thank you @phrabos!

0.0.20

  • Experimental windows support! Thanks so much @ihdavids!

0.0.19

  • Add a new command: search file (with type filter). Thanks for suggesting @prime31!
  • Add option to set the bat theme. Thanks for suggesting @mariush2!
  • Add --cycle to fzf call. Thanks for suggesting @shlomocarmeter!
  • Fix some bugs that caused search within files to behave incorrectly

0.0.18

  • Add an option to use the contents of .gitignore files to limit search paths (on by default)

0.0.17

  • Fix a bug that caused search within files to not search in all paths

0.0.16

  • Ensure text selection searches immediately
  • Small bug fix where the extension wouldn't correctly initialize when a text selection was present

0.0.15

  • Show relative paths when only one directory is on the search path

0.0.14

  • Fix a bug in search within files on Linux
  • Prevent custom PS1 prompt from leaking into user's history
  • Fix a bug regarding fzf version discovery (e.g. Homebrew, Ubuntu 21.04 installs)

0.0.13

  • Lower minimum required VS Code version to 1.48
  • Small bug fix in type filtering window
  • New screen captures in README

0.0.12

  • Option to "find within files", but pre-filter by file type.
    Exposes a new keyboard shortcut (default: cmd+shift+ctrl+u / ctrl+shift+alt+u).
    The selection is stateful; it will be kept across searches such that you can easily re-run a search with the same file types. Should add new screen captures, but will do that in 0.0.13.

0.0.11

  • Bug fix: bring back preview window in "Find Files"

0.0.10

  • No new features, but this version should be automatically published through Github Actions.

0.0.9

  • Much better search path support (see extension settings)
    • Option to add the process working directory under various conditions
    • Option to disable searching the workspace folders
    • Option to add additional search paths through the settings under various conditions
  • Better error message for native Windows use case
  • Filtering out stderr output when searching. Prevents messing up fzf's layout when permissions errors arise during searching.
  • Add basic CI sanity checks and badge.
  • Small logo update

0.0.7

  • Text selections: if you have text selected, we'll use that to fill fzf's query. There's an option to disable it.
  • Clean up some terminal spam

0.0.6

  • Honor search.exclude setting and add option to disable
  • Don't store command history
  • Always run bash in terminal, add warning to PS1

0.0.3

  • Support multiple sessions at the same time without interfering with one another.
  • Option to disable checks (e.g. which bat). Useful if you want to use e.g. cat instead.
  • Option to disable previews for each of the find commands
  • Settings overhaul; they're now empty when default. Enables some more flexibility on the backend.
  • Cosmetic improvements if using fzf >= 0.27

0.0.2

  • SSH support 🎉
  • Ignore .git directory
  • Always show error dialog box when a dependency isn't found
  • Default search location preference for when a session has no workspace
  • Add screen captures showing functionality
  • Add an ugly icon
  • Various smaller fixes

0.0.1

You gotta start somewhere!

Tested on these configurations:

Mac OS:

OS         : Darwin 20.1.0 (MacOS Big Sur 11.0.1)
bat version: bat 0.18.0
fzf version: 0.27.1 (brew)
rg version : ripgrep 13.0.0

Linux:

OS         : Linux 5.8.0-55-generic (Ubuntu 20.04)
bat version: bat 0.12.1
fzf version: 0.20.0
rg version : ripgrep 12.1.1 (rev 7cb211378a)

vscode-finditfaster's People

Contributors

alexrenz avatar benjaffe avatar bisho avatar ch0pex avatar coombszy avatar cosine0 avatar ethanol48 avatar ihdavids avatar luiggi33 avatar mykhailosukhostavets avatar numanhg avatar phrabos avatar sainsay avatar tomrijndorp avatar zivkaplan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-finditfaster's Issues

Resume search (also called "repeat search")

Hi! I recently switched from Emacs to VSCode and absolutely love this extension 💛 Thank you so much for developing this!

I found that I am missing one feature that I used to use a lot: resume search (often also called "repeat search"). That means: I search for a term with find_within_files, open one candidate in the editor to edit something (thus closing the search terminal), and then resume the search to visit other candidates. This exists as ivy-resume, vertico-repeat, selectrum-repeat in the Emacs world. At least one of my colleagues is also missing this functionality.

I looked around the extension a bit and it seems that this is not directly supported. Or am I missing something?

I thought about + searched for potential workarounds/alternatives:

  1. I found this: #27 (using tab to select multiple files + open them together). However, this seems to not work for me, so I wasn't able to try this yet. But this wouldn't directly support my preferred workflow.
  2. One could potentially keep the search window open while making edits in the editor. This does not work well for me because the keyboard shortctus that I use to move around vscode don't work in the terminal (i.e., I have no way to conveniently switch out of the terminal and back into it). But maybe with some good shortcuts this might be tenable.

How do you feel about a resume/repeat functionality? I.e., a separate key binding for resuming the last search. A nice to have would be to have it jump back to the candidate that was marked when the search was last exited, but even a resume functionality without that would be extremely helpful for me.

I am willing to implement this if you are generally interested. One approach would be to write the current query to a "last query" file when a search is exited, and restore this query when a newly introduced "repeat query" action is invoked. An alternative approach would be to record query history more generally in a history file and allow the user to cycle through the last queries. Other ideas?

Again, I absolutely love this extension, and would love to help make it a tiny bit better for me and maybe a few others :)

Default fzf --height to 100% or allow setting it

I think it makes sense for fzf to take up the entire terminal window in this case, so I think it should just default --height='100%' or if that doesn't seem like a good default, could you please add a setting for it? Maybe a general setting where the user can override any fzf defaults.

always ,prompt the ",Failed to active the plugin , bat not found on your PATH"

Env:
1. the latest vscode is available /workable on the windows , running with WSL ,
2. window 11
3. vscode v1.76.2
4. rg (13)
5. fzf (0.29)
6. bat (0.19.0)
7. already install wsl extension as well .
Step:
1. already installed the fd ,rg and bat . And those command is available and worked well on the ubuntu under WSL .
8. run "code . " within ubuntu's terminal .
9. trigger the plugin with short-cut "ctrl+shift+j/u".
result :
,prompt the ",Failed to active the plugin , bat not found on your PATH"

Customizing of FZF_DEFAULT_OPTS or other options

(I hope this is the right place to ask questions, this extension is amazing).

I was wondering if there was any way to override my system FZF_DEFAULT_OPTS variable when used in VSCode. I noticed at adding things like this in my .zshrc file:

FZF_DEFAULT_OPTS="--height=50% --layout=reverse

Will take effect in VSCode (the 50% for example will make the take half the VSC terminal and look weird). My use case is using --layout=reverse in VSC and not using it in my terminal.

I took a quick look at the code and see that it seems to just default to the one set in your terminal.

I supposed one could write an if/then in the .zshrc to configure it, but not sure how to tell if the terminal sourcing the .zshrc file is inside VSC.

Thx.

Add a command to search using the previous search query

Hi! I love this extension, use it every day. 🥇

Something I've noticed I do a lot is going through search results one by one, editing as I go.
It would be great if there's a way to open the search prompt using the same search query as I ended on the last time I ran the command.

Either that, or add a shortcut when searching that prefills the last searched result (or maybe history?). Maybe this option would be more part of FZF (maybe it already exists, I can't find it).

If you got a better way, please tell me!

Search files does not open files that are gitignored

Platform: MacOS Ventura 13.2.1 (Apple M1 Pro)
VSCode version: 1.78.1

find-it-faster configuration:

{
  "find-it-faster.general.additionalSearchLocations": ["some-ignored-dir"]
}

With the above configuration when I add an ignored directory in FiF's search locations the "search files" command is able to find the files just fine but hitting Enter when focused on a filename doesn't open that file in the editor if the file is in the ignored directory. The directory I am trying is ignored via .gitignore but I am assuming this is true for any file that's ignored by the VSCode search...?

I would be interested in fixing this bug if someone could point me in the right direction.

Windows support?

Also see #2. I think there are two options:

  1. Invoke the bash scripts from Windows. I'm not sure how / whether this can be done. Will require WSL to be installed. Not sure if there are further issues with access permissions etc. Will require some investigation.
  2. Create Windows versions of find_files.sh and find_within_files.sh (the scripts in the extension that invoke fzf). This may be the nicest solution as it's a native implementation, but requires Windows shell scripting, which I'm not familiar at all.

If you're a Windows user, please vote on this ticket using 🚀 for the first solution, 🎉 for the second, or 😕 for don't know / don't care as long as you do something. Votes will compel me to take action (and learn windows batch file scripting).

If you're interested in implementing solution 2 and supporting it, please shoot me a message! The extension is built in such a way that implementing this solution requires writing two scripts that invoke the terminal commands, and there are reference implementations in bash shell script.

Feature request: ripgrep (find within files) with args

Telescope (a Neovim finder / picker like this extension and fzf.vim) has a version of the ripgrep finder that can pass arguments from the user input to the underlying ripgrep command. It'd be great if this extension had a version of the findWithinFiles command that worked the same way.

Here's the readme with some examples of how this was implemented and why it's useful. A nice feature is that user inputs with no quotation marks are treated as a single argument; you have to "opt in" to passing arguments by wrapping the query phrase in quotes, otherwise the search works the same way that findWithinFiles does today.

`search within files` doesn't actually search

Hi!
I'm on ubuntu 20.04, vscode is at 1.60.1 and finditfaster at 0.0.13.

I have all the dependencies installed, and search file works fine.

The problem is with search within files.
No matter what I type, the number of matches doesn't change. I can see the matches list change a little, but nothing related to my actual search comes up. It almost look like it's doing some random reordering of the list.

Thank you for writing the extension! I was about to write one myself because I really hate the sidebar :D

find_within_file.ps1 can't search comma

When I type comma in global search (Ctrl+Shift+U) powershell command fails:
image

How to reproduce:
1- Ctrl+Shift+U (global search) in vscode.
2- Type ','


I couldn't fix the powershell script. So, for people who are reading this issue, here is a quick band-aid which requires python as a dependency. It opens the file in code directly and ignores all of the extension settings.

New find_within_file.ps1:

 python D:\rep\dotfiles\.local\bin\live-grep-windows.py

live-grep-windows.py:

import subprocess

# Define the rg command as a list of arguments
rg_command = [
    "rg",
    "--color=always",
    "--line-number",
    "--no-heading",
    "--smart-case",
    ".*",
]

CATPPUCCIN_GREEN = "#a6da95"
CATPPUCCIN_MAUVE = "#c6a0f6"

# Define the fzf command as a list of arguments
fzf_command = [
    "fzf",
    "--ansi",
    "--border",
    f'--color "hl+:{CATPPUCCIN_GREEN}:reverse,hl:{CATPPUCCIN_MAUVE}:reverse"',
    '--delimiter ":"',
    '--height "100%"',
    "--multi",
    "--print-query --exit-0",
    '--preview "bat  {1} --highlight-line {2} --color=always --style=numbers "',
    '--preview-window "right,+{2}+3/3,~3"',
    '--scrollbar "▍"',
]

fzf_command = " ".join(fzf_command)
print(fzf_command)
print("")


try:
    # Run the rg command and pipe its output to fzf
    rg_process = subprocess.Popen(
        rg_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
    )
    fzf_process = subprocess.Popen(
        fzf_command,
        stdin=rg_process.stdout,
        stdout=subprocess.PIPE,
        text=True,
    )

    # Close the standard output of rg process since it's being piped to fzf
    rg_process.stdout.close()

    # Wait for the user to interact with fzf and press Enter
    selected_string, stderr = fzf_process.communicate()

    # Check if there was any error
    if fzf_process.returncode != 0:
        print("An error occurred:", stderr)
    else:
        # Print the selected string
        selected_string = selected_string.strip()
        selected_string = (
            selected_string.split("\n")[1]
            if "\n" in selected_string
            else selected_string
        )
        print("Selected string:", selected_string)
        file_path, line_number, *_ = selected_string.split(":")
        # Split the selected string into file path and line number

        # Construct the code command to open the file in Visual Studio Code
        code_command = f'code -g "./{file_path}:{line_number}"'

        # Execute the code command
        code_process = subprocess.Popen(
            code_command,
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
        )
        code_process.communicate()

except FileNotFoundError:
    print(
        "rg, fzf, or code command not found. Please install them and ensure they're in your PATH."
    )
except KeyboardInterrupt:
    print("\nOperation canceled by the user.")

image

Fuzzy search within files searches only for exact matches

Hi! Thanks for your work!

I have a question though: how do I do fuzzy search in files? Let's say there is var for partner param and in different languages it is written differently: partner-param and partner_param. I'd like to search for both of them.
If I try to use the command line rg . | fzf then it works as expected and I can type partnerparam and I will see both entries.
But this doesn't work in the extension. It looks like it always searches for exact matches. Adding ' at the beginning doesn't help.

Do I miss something?

terminal stays open after search is selected

After opening the search fucntion and selecting a result, when you open the terminal panel again in vscode it opens the finditfaster terminal. This is annoying because I want to go back to using an active terminal and need to open a new panel for this.

Is there anyway around this?

Is there a quick way to add new file type for pre-filtering?

This plugin indeed is awesome. I am new to these terminal stuff, so I am still struggling here.

The problem I have is that I have some graphql schema files in my project, but this type is not available for searching with pre-filtering.

I want to add this type so that I can use the feature. How can I do that or maybe it is impossible right now?

`Search Within Files` `rg` options

Frist off, thanks for this extension! I found it while trying to convert my Vim setup to vscode.

Is there a way to modify the search within files rg command? I would like to modify the output to remove the portion of the path that leads up to the project folder.

This is in vscode

In vim, I have modified the results of rg to omit the path preceding the project directory

Feature request: Ability to change the preview bat theme

Hi! Started using this tool and it makes changing files and searching in vscode x10 better.

I was wondering if it is possible to expose a setting called "BAT_THEME" or something similar, either that or maybe it is possible to piggy back of the $BAT_THEME shell variable that bat uses itself

find no effect

OS: macOS 13.2.1 22D68 arm64

When I press the keyboard,
following appears
//
bash
export PS1="::: Terminal allocated for FindItFaster. Do not use. ::: "; clear
/Users/keeyu/.vscode/extensions/tomrijndorp.find-it-faster-0.0.21/find_within_files.sh '/Users/keeyu/code/company/probation'
//
But I directly execute the following command. It works very well
//
/Users/keeyu/.vscode/extensions/tomrijndorp.find-it-faster-0.0.21/find_within_files.sh '/Users/keeyu/code/company/probation'
//

Add cycle option to fzf

Hi,

First I'd like to say that this is a great plugin!
Could you please add the switch --cycle on line 58 of find_files.sh ?

Thanks

Suggestion: Find in single active file

I wondering if this was considered and not implemented for any reason? It would be a nice addition and make this have the same features as the FZF plugin available for Neovim, which has a buffer search mode.

(Again, this is a game changer for me and making me come back to VsCode from Nvim.)

How to get this working in a devcontainer?

Thanks for making this! Works nice locally, but I got into trouble making this work in a devcontainer because of bat

Using something like:

 "postCreateCommand": "sudo apt-get update && sudo apt-get install -y bat fzf ripgrep",

in the devcontainer.json will not work, although it does make bat usable as a cli tool.

Making the symbolic link also does not help here:

  "postCreateCommand": "sudo apt-get update && sudo apt-get install -y bat fzf ripgrep && mkdir -p ~/.local/bin && ln -s /usr/bin/batcat ~/.local/bin/bat"

This wsl fix also did not do it for me.

The error is always: Failed to active the plugin , bat not found on your PATH.

Any ideas?

Automated testing features wanted!

I built this extension a couple years ago. We're now in a situation where this extension:

  • has been stable for quite a while
  • is running on multiple platforms
  • has thousands of users
  • is seeing increasingly many community contributions
  • has been increasing in complexity to the point where it's infeasible to manually check all edges cases

As such, we'd greatly benefit from having automated testing in CI. I have a Circle CI instance set up that ensures that at least the extension can be installed and loaded, but that's it.

I'm no hero on VS Code extension testing, and my expectation is that due to its reliance on the terminal, there may not be enough features to effectively do this. That said, if anybody has experience / ideas and would like to give this a stab, I'd greatly appreciate it.

Search results duplicated in multi-root workspaces that overlap

When searching on a workspace with multiple root directories the search is run on each configured directory independently (that is my guess). Later when the results come there is no deduplication. Duplicates might happen with the following workspace config:

{
  "folders": [
    {
      "name": "ROOT",
      "path": "."
    },
    {
      "path": "./src"
    }
  ]
}

It would be nice to filter the duplicated based on absolute file path.

Execute find command twice will choose the first selected item

Sometimes I trigger the search command in terminal and want to search it later, then I hide the terminal, and second time I trigger the command it will make me jump to the first selected item from the hidden terminal, maybe type command twice without enter can just open panel(if it is invisible) and does nothing?

@ in directory name causing issues

Hi,

I happen to be working in a directory starting with @dir, which seems to be causing an issue when trying to use FindItFaster:

::: Terminal allocated for FindItFaster. Do not use. ::: /home/marc/.vscode/extensions/tomrijndorp.find-it-faster-0.0.26/find_within_files.sh '/home/marc/Documents/%40WebDev/test' /home/marc/.vscode/extensions/tomrijndorp.find-it-faster-0.0.26/find_within_files.sh: line 12: cd: /home/marc/Documents/%40WebDev/test: No such file or directory

It works without issues in dirs not containing @

I want to add custom keybindings for preview window to scoll

First of all big thanks for this wonderful plugin and I like fzf. I want to add custom keybindings to scroll up and down, page half up and bottom vice-versa. I set it up for my fzf terminal but i have no idea how to add those lines to this plugin in vscode. i could't see any related options in vscode keyboard shortcuts. The default shift + up/down arrow is not so comfortable for me because I need to give extra key strokes in my keyboard.
Can you help me of this.
** file up/down with ctrl+ j/k are working fine **

info

  • os : Arch Linux

Search hidden/exclude files

Great extension, thanks for making it!

I want to search in files at hidden and excluded folders. Is it possible to do this with the extension?

I'm not sure if related but if I set

"find-it-faster.general.useWorkspaceSearchExcludes": false,

I get a Command failed error, unfortunately I cannot see the full error to check the options.

[win] "unknown options: canceled"

Hi,
I use Powershell 7.4 (pwsh) on Win11.
The fzf program flashed for a moment and soon disappeared.
Then it shows:

image

Text version:

PS C:\Users\vales\Workspace\dotfiles-and-scripts> c:\Users\vales\.vscode\extensions\tomrijndorp.find-it-faster-0.0.30\find_within_files.ps1  'c:\Users\vales\Workspace\dotfiles-and-scripts'
rg --column --hidden  --line-number --no-heading --color=always --smart-case --colors "match:fg:green" --colors "path:fg:white" --colors "path:style:nobold" --glob "!**/.git/"  --glob  "!**/node_modules"  --glob  "!**/bower_components"  --glob  "!**/*.code-search"  --glob  "!**/dist"  --glob  "!**/dist*"  --glob  "!**/.vscode"  --glob  "!**/.build"  --glob  "!**/.dll"  --glob  "!**/.cache-loader" "^"
unknown option:
canceled
PS C:\Users\vales\Workspace\dotfiles-and-scripts> c:\Users\vales\.vscode\extensions\tomrijndorp.find-it-faster-0.0.30\find_files.ps1  'c:\Users\vales\Workspace\dotfiles-and-scripts'       
unknown option: 
canceled

Relative content of my settings.json:

    "security.workspace.trust.untrustedFiles": "open",
    "terminal.external.windowsExec": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
    "terminal.explorerKind": "both",
    "find-it-faster.general.hideTerminalAfterFail": false,
    "find-it-faster.general.hideTerminalAfterSuccess": false,
    "find-it-faster.general.clearTerminalAfterUse": false,
    "find-it-faster.findFiles.showPreview": false,
    "find-it-faster.findWithinFiles.showPreview": false

Waiting for your reply.

Publish to open-vsx

Hey!

Some of the tools are using open-vsx to automatically install extensions in remote containers.

Can we publish find-it-faster there? Thanks!

Options to search in other directory

Hi, thank you for this amazing plugin!

The current version only supports searching in the current working directory, but sometimes I want to search the files outside the project folder. Is it possible to implement an pop-up window (like the one when you press cmd+o) to confirm which directory I would like to search?

Unable to open files from terminal window

Describe the bug
Unable to open files from terminal window.

EXCEPTION: A parameter cannot be found that matches parameter name 'Path'.
at <ScriptBlock>, ...\.vscode\extensions\tomrijndorp.find-it-faster-0.0.21\find_within_files.ps1: line 115
at <ScriptBlock>, <No file>: line 1
Out-File : A parameter cannot be found that matches parameter name 'Path'.
At ...\.vscode\extensions\tomrijndorp.find-it-faster-0.0.21\find_within_files.ps1:115 char:75
+ ... Path "$SINGLE_DIR_ROOT" -ChildPath "$result" | Out-File -Path "$Env:C ...
+                                                             ~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Out-File], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.OutFileCommand

To Reproduce
Steps to reproduce the behavior:

  1. ctrl+shift+j or ctrl+shift+u
  2. Navigate the file tree using keyboard
  3. Press enter on a file
  4. See error

Expected behavior
File opens in VS Code when selected

Screenshots
image
image

Desktop:

  • OS: MS Windows 10 Enterprise
  • Version 10.0.19045
  • Terminal: PowerShell
    • PSVersion 5.1.19041.2364
  • rg, fzf, and bat all are confirmed to work independently.

0.0.27 breaks the flight check

As per title, when the extension updated to 0.0.27 the flight check now fails. It says it's unable to find rg on my PATH. Reverting back to 0.0.26 and the problem goes away.

Can't open files when there are multiple folders in workspace

When I have several folders in the workspace (File->Add folder to workspace), the extension still searches correctly in the terminal, but it can't open the selected file when pressing enter. Strangely enough, clicking on the path+line link in the terminal works as intended.

Massive typescript performance degredation with extension enabled

Type: Bug

Enable extension, attempt typescript auto complete in a large project, observe it fail completely or become extremely slow. Disable extension and problem disappears.

Extension version: 0.0.21
VS Code version: Code 1.79.2 (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:58:33.551Z)
OS version: Darwin arm64 22.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 34, 28, 21
Memory (System) 16.00GB (0.08GB free)
Process Argv
Screen Reader yes
VM 0%

Search window closes if settings.json is changed.

How to reproduce:
1- Open settings.json in an editor (vscode, neovim, notepad ...).
2- Open vscode (code) and start fuzzy search Ctrl+Shift+j. Don't press enter let it wait.
3- Edit settings.json:

    "editor.cursorStyle": "block", ->     "editor.cursorStyle": "line", 

4- Save settings.json

In vscode suddenly fuzzy search terminates and terminal closes.

Using `/usr/bin/env bash` instead of `/bin/bash`

Currently /bin/bash is used in all the bash scripts. This would break on systems like NixOS which doesn not have /bin/bash because of its non standard file system. Is it possible to change it to /usr/bin/env bash instead?

Feature Request: Files open in 'preview editor'

Hey Tom, I love this extension, thank you for the time and effort and for sharing this with us. When I open files using cmd+p I prefer for them to open in a preview editor and added this setting "workbench.editor.enablePreviewFromQuickOpen": true,. Is it possible to add this as a setting to your extension? Thank you!

feat-request: add a bool option to be able to kill terminal session after executing a command

First of all, thank you so much for this extension. I've been using it literally every day since I found it on the marketplace.

Proposal

Add a boolean option "find-it-faster.general.killTerminalAfterUse" It may be implemented the same way as "find-it-faster.general.clearTerminalAfterUse"

Behavior

If this option is set to true, then after each use allocated terminal will be killed. It probably adds some performance penalties, since it creates a new terminal instance per call to the extension, but I didn't find these penalties to be even remotely meaningful, when I've been doing the same manually all the time.

Why

I'm using integrated terminal for compilation/linting/testing/commiting and etc. So, I always have one active instance.
But after call to the extension, it's terminal becomes active, pushing previously active instance into the background. I'm forced to manually kill this new instance or switch back to previously active one. With this option, allocated for extension instance won't push previously active instance into the background.

Can't use the extension on Windows

I get this error when I try to use the extension on windows.. I do have fzf, ripgrep, and bat installed and added to the PATH

Failed to run checks before starting extension. Maybe this is helpful: Error: Command failed: C:\WINDOWS\system32\cmd.exe /d /s /c "c:\Users\####\.vscode\extensions\tomrijndorp.find-it-faster-0.0.6\flight_check.sh"

Bug: Terminal closses before I can see the error

I managed to run the extension locally on Windows (through Powershell), but when I press a shortcut the terminal Windows appears, but immediately disappears. I tried splitting the terminal Window to let it persist, but it hides the window even with the other opened.

Can not run when default terminal is not Powershell on Windows

Running on Windows with VScode, and some of the workspaces have different default terminal setting rather than Powershell.
Finditfast open default terminal and the ps.1 file is not executed.

Can you force it to use powershell even if default terminal is other?
Thanks

I can't use tmux as my default terminal

When the option terminal.integrated.defaultProfile.linux: tmux is set, I cannot use the extension, so I need to set it to terminal.integrated.defaultProfile.linux": zsh and I get this msg:

/home/darianmorat/.vscode-server/extensions/tomrijndorp.find-it-faster-0.0.30/find_files.sh: line 4: EXTENSION_PATH: -it-faster-0.0.30/find_files.sh '/home/darianmorat/dev/js'unbound variable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.