Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add a method to force Continue to include file(s) in the index #1869

Open
2 tasks done
sealad886 opened this issue Jul 30, 2024 · 5 comments
Open
2 tasks done
Labels
area:indexing Relates to embedding and indexing kind:enhancement Indicates a new feature request, imrovement, or extension

Comments

@sealad886
Copy link

Validations

  • I believe this is a way to improve. I'll try to join the Continue Discord for questions
  • I'm not able to find an open issue that requests the same enhancement

Problem

Continue indexing uses .gitignore to determine files that should not be in the index. There is currently no way to force the index to include a file or directory that is listed in .gitignore.

Solution

Create a .continueinclude file that is checked after ignore to add missing files and directories back into the index.

@sestinj
Copy link
Contributor

sestinj commented Jul 30, 2024

@sealad886 With .gitignore syntax in .continueignore you can use the negation operator, which should override previous rules, like !node_modules if you wanted this. I'd be curious whether this works for your use case

@dosubot dosubot bot added area:indexing Relates to embedding and indexing kind:enhancement Indicates a new feature request, imrovement, or extension labels Jul 30, 2024
@sealad886
Copy link
Author

So my use-case is specifically in a Flask project, where I don't want to check in a couple dot-env files into git, but I still want the index to recognize that I do have those variables defined...so the LLM will stop creating code that loads environment variables, config files, etc.
It's a very edge use-case for me, but realistically the concepts of "include in index" and "include in git" aren't interchangeable. I could imagine others might have more examples.

@src-r-r
Copy link

src-r-r commented Aug 7, 2024

I kind of like this idea, too. I'd like finer controls over what is/isn't indexed. For example, I'm working on an app now with a 3rdparty directory that I have no intention of ever needing. It's eating up a lot of indexing power. Maybe something like this in vscode settings.json?

{
  "indexing": {
     "include": [
         "${workspaceFolder}/backend/**/*.py",
         "${workspaceFolder}/frontent/**/*.ts",
     ],
     "exclude": [
         "${workspaceFolder}/3rdparty"
     ]
  }
}

I realize continuedev is not just for VSCode, so there might be a better way to do it agnostic of server/vscode.

@meanderix
Copy link

@sestinj I've tried to use the negation operator, but it does not appear to have an effect in the .continueignore file (it works if I edit .gitignore). Possibly related to #1191.

@shannonrdunn
Copy link

@meanderix I've gotten it to work in .continueignore
#1191 (comment)

taken from suggestions on the node-ignore repo: kaelzhang/node-ignore#57 (comment)

*.*
!*.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:indexing Relates to embedding and indexing kind:enhancement Indicates a new feature request, imrovement, or extension
Projects
None yet
Development

No branches or pull requests

5 participants