artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 82 forks source link

Can I exclude source folders? #431

Closed jackysee closed 4 years ago

jackysee commented 4 years ago

I have a project with a typical java project layout, plus a frontend (vue cli generated) part. The layout is

(root)
...
└── src
    ├── frontend
    │   └── src
    │   └── dist
    │   └── ...
    │   └── node_modules
    │           └── ... (a lot of stuff here)
    └── main
        └── java
            └── ... (java sources)

node_modules is notorious for its large number of files and deepness. As jc2 would automatically include all src folders, the file indexing is quite a burden. In my case, a simple completion on java files would take as long as 40s!

Setting let g:JavaComplete_SourcesPath = './src/main/java' would not help as it only add to current detected paths.

By actually remove the frontend folder, the completion can appear within 1-2 seconds.

It would be great if there is a way to exclude certain folders or by pattern.

Update: I've added a demo project here https://github.com/jackysee/spring-boot-jc2 , you will need to run npm ci to "populate" the node_modules folder first.

artur-shaik commented 4 years ago

Try with: let g:JavaComplete_SourceExclude = ['src/frontend']