devrt / ros-devcontainer-vscode

ROS dev container for vscode
Other
174 stars 47 forks source link

mount workspace & better python linting #5

Open tgoelles opened 4 years ago

tgoelles commented 4 years ago

The changes allow to use pylint and auto completion with Python correctly. In addition the workspace is mounted so files can be easily accessed with the host system and are persistent.

yosuke commented 4 years ago

Hi, Thank you for the pull request. Enable linting by default is nice.

Can you consider following two points?

  1. ROS distribution "kinetic" is hardcoded in the setting

We have melodic and dashing distribution as well in this project: https://hub.docker.com/r/devrt/ros-devcontainer-vscode/tags

Hardcoding to "kinetic" is not convenient at this point. PYTHONPATH is already set in entrypoint script, so we do not have to set in the vscode side. Completion should without "python.autoComplete.extraPaths" setting, since vscode will read it from PYTHONPATH. So we probably don't need them. Can you delete these settings and check how it works?

  1. Binding workspace to host is slow

We first tried to mount workspace to the host, but it turns out to be very slow in many platforms: https://github.com/docker/for-mac/issues/3677 https://github.com/docker/for-win/issues/188 It is OK, when we only edit python scripts, but it is really slow if we compile C++ modules even if we set "cache" option.

Currently, we use mutagen (see https://mutagen.io/ ) to sync workspace folder to the host. mutagen sync can be started by using following script: https://github.com/devrt/ros-devcontainer-vscode/blob/master/start-mutagen.sh

Can you try this and let me know your opinion?

tgoelles commented 4 years ago

Hi,

1.) yes the hardcoded part is a valid point. I will look into it. The vs code way does not use the entrypoint script, so code completion did not work that way. 2.) I don't think its very slow on my windows workcomputer, but I will try it out. I should have time in the next days to take check mutagen out and compare it to the native VS code way.