-
Notifications
You must be signed in to change notification settings - Fork 19
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
Display most recently used tokens when completing #40
Comments
@lppedd look awesome, thanks for picking this up! |
@Gerrit-K No problem 😄 Also, beware I can't guarantee the correctness of ordering, and with that I mean even if |
Testing the integration with VCS was somewhat successfull. The code would feel like an hack to a possible contributor so it needs to be rewritting using the right objects (the flow of the VCS log is horrible to debug). private fun getVcsCommits(): List<VcsCommitMetadata> {
val vcsLogManager = VcsProjectLog.getInstance(project).logManager!!
val vcsLogData = vcsLogManager.dataManager.also {
it.addDataPackChangeListener(MyDataPackChangeListener(it))
it.refresh(it.roots)
}
queue.take()
val vcsScopesWithTimes = mutableListOf<VcsCommitMetadata>()
val allCommits = vcsLogData.dataPack.permanentGraph.allCommits
vcsLogData.miniDetailsGetter.loadCommitsData(
allCommits.map { it.id },
vcsScopesWithTimes::add,
ProgressManager.getInstance().progressIndicator,
)
return vcsScopesWithTimes
}
inner class MyDataPackChangeListener(private val vcsLogData: VcsLogData) : DataPackChangeListener {
override fun onDataPackChange(newDataPack: DataPack) {
vcsLogData.removeDataPackChangeListener(this)
queue.put(Unit)
}
} |
Me neither ;) but it sounds fine to me.
That's a pity, but not a dealbreaker. Having suggestions in incorrect order is still better than having none at all I guess :) Regarding your code, I'd love to help, but that would require me to learn kotlin from scratch as well as the IntelliJ plugin framework :/ Perhaps there's another open-source plugin out there that already parses the vcs log, from which you could take some bits? |
@Gerrit-K oh don't worry, I post code in issues only as a sort of "backup" or remainder. |
Implemented with commit a61f2b9. |
@lppedd I received the plugin update today and tested it briefly. Works great and I think this will be really helpful for our workflow in the future. Thanks again for addressing this so quickly! :) |
@Gerrit-K fantastic! Let me know of any issue in case. |
As of now we display scopes which are strictly attached to a type.
Until we implement an independent extension which looks at the full VCS history, we can show the most recently used scopes without considering the inputted type. Obviously this mechanism is not precise, but it's still something worth adding.
It is important to highlight those items come from the (renamed) DefaultVcsCommitTokenProvider so we could display "Recently used" on the right.
A quick implementation shows this result:
Idea from #35
@Gerrit-K what do you think?
The text was updated successfully, but these errors were encountered: