digma-ai / digma-intellij-plugin

Digma JetBrains plugin
MIT License
31 stars 7 forks source link

indexing for java and python #321

Open shalom938 opened 1 year ago

shalom938 commented 1 year ago

java is indexed. but enrichDocumentInfo happens every time a file is opened and on every document change. its probably not an issue when a file is opened but on document change it may happen too many times.

we need to check:

  1. we enrich a DocumentInfo that was fetched from the index, we add the spans to DocumentInfo. it is the same reference that is in the cache. so maybe the next time the file is opened we don't need to enrich again because the spans are there already. there is no api to update the cache with a new DocumentInfo like there is in Rider.
  2. on document change, instead of fully computing code object discovery for the file we can process only the code block that was changed and update DocumentInfo if necessary. again, need to check if when updating a DocumentInfo that was fetched from the cache still has the spans that were added the first time.

python is not indexed, so again, when a file is opened its not such a big issue, but on docuement change we do full discovery for every event and maybe that is an issue.

shaykeren commented 1 year ago

when a document is changed in python we should think about not running fill discovery, maybe using a timer to reduce the amount of re-scanning of the whole file.