DCD icon indicating copy to clipboard operation
DCD copied to clipboard

support "environments"

Open yannick opened this issue 9 years ago • 10 comments

instead of the need to run n different instances of dcd on n different ports it would be nice if clients could choose an "environment" that has separate source files.

yannick avatar Jan 04 '16 13:01 yannick

Something like this?

$ dcd-client --list-environments
☐ nightly-dmd
☑ latest-dmd
☐ latest-ldc
☑ gtkd
☑ libdparse
$ dcd-client --disable latest-dmd --enable nightly-dmd

Hackerpilot avatar Jan 04 '16 22:01 Hackerpilot

That looks like it could be pretty useful. In my case - I wanted to add the compiler sources for the current compiler configured in intellij plus the current source directory for the project. So that a user doesn't have to manually configure the imports list for DCD.

How would an "environment" be specified?

Currently I set the imports on the dcd-server and not on the dcd-client. It looks like environments config would apply at the dcd-client level - so you start one dcd-server which knows about environments - and then multiple dcd-clients specify the particular environment they want?

I like --enable option - not sure about --disable because that suggests all environments are active and you disable the ones you don't want - whereas --enable means to me that all environments are not active and you specifically --enable the ones you want.

Overall I think this would make configuration a lot easier when you are running multiple versions of dcd.

kingsleyh avatar Jan 09 '16 08:01 kingsleyh

the main use case i saw was dependencies with different versions. say you work on two projects, website A and B. a depends on vibe.d ~master and B depends on a specific version.

one could go as far as directly recognizing an "environment" by sending a path to a dub.json and it automatically gets all paths and the name. i think https://github.com/Pure-D/workspace-d does something similar.

(not sure if currently possible, but if not: there should also be a way to reload all files from a folder in case where the dependency/environment is a git (sub-)repo and you switch the branch. however if you have lots of dependencies you do not want to refresh everything.

yannick avatar Jan 09 '16 12:01 yannick

(not sure if currently possible, but if not: there should also be a way to reload all files from a folder in case where the dependency/environment is a git (sub-)repo and you switch the branch. however if you have lots of dependencies you do not want to refresh everything.

DCD already checks the modification times on files when a symbol from them is used for completion. I'm not sure what git does with modification times though.

Hackerpilot avatar Jan 10 '16 02:01 Hackerpilot

A different idea would be that the client sends a unique key and the server keeps the data separate based on that key.

jacob-carlborg avatar Apr 06 '16 19:04 jacob-carlborg

A different idea would be that the client sends a unique key and the server keeps the data separate based on that key.

There is no need for a unique key - dcd-server should just do the right thing and use only the import paths it is given together with the request. See #316 for some thoughts on this.

CyberShadow avatar Jan 13 '19 00:01 CyberShadow

There is no need for a unique key - dcd-server should just do the right thing and use only the import paths it is given together with the request. See #316 for some thoughts on this.

How would you deal with different projects using different version of druntime and Phobos at the same time?

jacob-carlborg avatar Jan 13 '19 10:01 jacob-carlborg

The request would specify the Druntime and Phobos include path.

CyberShadow avatar Jan 13 '19 10:01 CyberShadow

The request would specify the Druntime and Phobos include path.

So every request would need to specify all the needed import paths, every time?

jacob-carlborg avatar Jan 13 '19 11:01 jacob-carlborg

Yes. There is no downside to it.

CyberShadow avatar Jan 13 '19 11:01 CyberShadow