Giter Site home page Giter Site logo

Comments (3)

ajermakovics avatar ajermakovics commented on September 7, 2024

I like the idea though detecting versioning systems might be challenging since there are a number of plugins for git/hg. Not sure there is a universal solution.

Right now it will periodically reindex files that changed in the workspace once Eclipse detects that they've changed. There will be some lag after changing branches but the re-indexing period can be configured in preferences InstaSearch.java#L68. Perhaps tuning that helps in your case.

And there is always the option to manually trigger Re-Indexing with the button from the toolbar.

from eclipse-instasearch.

amadawn avatar amadawn commented on September 7, 2024

I don't think that you should use any of the existing mercurial or git plugins to implement this feature.

In theory you should only need to execute a single mercurial or git command to detect that there has been a revision change ('hg id' in the case of mercurial and 'git log -1 --format="%H"' in the case of git). Thus it does not seem such a bad idea to simply execute the command and parse the command output. These commands are so common that they are extremely unlikely to ever change (in the case of mercurial it is guaranteed to never change, since mercurial never changes its command line "API").

So my proposal is to execute these commands relatively often (e.g. once every 10 or 15 seconds or so), and if their output changes then it means that a full reindex is needed.

As for the periodic reindex that you mention, what do you mean when you say "once Eclipse detects that they've changed"? I thought that instasearch would simply reindex all files every period?

from eclipse-instasearch.

ajermakovics avatar ajermakovics commented on September 7, 2024

Yes, InstaSearch re-indexes only files that have changed. Eclipse provides an api to listen for file changes and then every X seconds InstaSearch will re-index those that changed. Indexing job is scheduled here InstaSearch.java#L75.
So, if everything works correctly, we shouldn't need to execute additional commands because Eclipse will tell the plugin about files that changed.

Another thing is that you shouldn't need a full re-index when switching branches because just a few files might have changed.

I'd encourage you to lower the re-indexing interval to, say, 5 seconds and see if within 10-15 seconds of switching branches new files appear in search results. If they don't then it could be a bug.

from eclipse-instasearch.

Related Issues (20)

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.