holgerbrandl / r4intellij

An integration of the R programming language into Intellij IDEA
BSD 2-Clause "Simplified" License
148 stars 28 forks source link

Path completion support #150

Closed khud closed 6 years ago

khud commented 6 years ago

It is initial support of path completion capabilities for arbitrary string literals. This completion supports Unix like systems and Windows in uniform way, only paths with normal slashes will be completed. For Windows both styles are supported: c:/Program Files and /Program Files. Unfortunately dynamic changes of working directory by setwd() aren't supported in this PR, but I am working it on.

holgerbrandl commented 6 years ago

sorry for the late reply. It's a great idea to add path-completion support. Let me know once you think that the PR for testing & merging.

khud commented 6 years ago

I have tested PR on Mac OS 10.11.6, Windows 10 and Ubuntu MATE 16.04. Works pretty good. Let's try yourself, I believe it is ready to merge.

holgerbrandl commented 6 years ago

Awesome, I have look asap.

holgerbrandl commented 6 years ago

I took the liberty to change the completion logic a bit to also take the script file into account, and to resolve relative paths such as "./". See above commit for details. Next we would need to provide setwd support I guess.

The updated plugin was published as v1.0..9 to the plugin repo (which usually takes another day to get reviewed by jb).

khud commented 6 years ago

Nice work, thank you! I will provide setwd support soon.

holgerbrandl commented 6 years ago

I still wonder how we could add unit test support for the completion provider? Not just for path completion but in general. @ktisha ?