IRkernel implements it in completions.r, this is mostly based on utils:::.guessTokenFromLine.
This can be fine for a first version, but e.g. Rstudio has a richer logic for getting completions, that is %>% and |> aware, but this might involve a lot more work.
For reference, the Rstudio logic is in SessionRCompletions.R and associated C++ files. From experience it is not an easy logic to navigate.
My belief is that a good completion system should live in a separate 📦 that could be accessed from Rstudio, this kernel, etc ... This can easily become a substantial project in itself.
IRkernel
implements it in completions.r, this is mostly based onutils:::.guessTokenFromLine
.This can be fine for a first version, but e.g. Rstudio has a richer logic for getting completions, that is
%>%
and|>
aware, but this might involve a lot more work.For reference, the Rstudio logic is in SessionRCompletions.R and associated C++ files. From experience it is not an easy logic to navigate.
My belief is that a good completion system should live in a separate 📦 that could be accessed from Rstudio, this kernel, etc ... This can easily become a substantial project in itself.