Skip to content
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

No more global psc-ide-server #156

Open
reactormonk opened this issue Jan 10, 2019 · 7 comments
Open

No more global psc-ide-server #156

reactormonk opened this issue Jan 10, 2019 · 7 comments

Comments

@reactormonk
Copy link

Currently, the psc-ide-server is global per emacs instance. It should be per-project instead of per-emacs.

@purcell
Copy link
Member

purcell commented Jan 17, 2019

Yep, I expect to tackle this one.

@kritzcreek
Copy link
Collaborator

kritzcreek commented Jan 17, 2019

Some prior art to look into is how the Atom and VSCode plugin as well as pscid handle it, they generate a .psc-ide-port file in the project root with a random port:

https://github.com/kRITZCREEK/purescript-psc-ide/blob/1e6f2f658b6344c505ce9eb7d6c6f6fdb6562c1f/src/PscIde/Server.purs#L104-L124

(Part of the idea here is that different tools can share the same server instance. Useful if you're doing pair programming with two editors, or if you like the pscid workflow but still want to have auto-import resolution in the editor)

@purcell
Copy link
Member

purcell commented Jan 17, 2019

I don't think a temp file with the port is necessary. Once there's a server buffer for a certain directory, it's easy enough to go from any purescript buffer to the server buffer for a parent directory. intero would be a better example IMO.

@kritzcreek
Copy link
Collaborator

That's what I meant with:

Part of the idea here is that different tools can share the same server instance. Useful if you're doing pair programming with two editors, or if you like the pscid workflow but still want to have auto-import resolution in the editor

I'm sure it's easy enough to handle within Emacs, but then you're not interoperating with other tools.

@purcell
Copy link
Member

purcell commented Jan 17, 2019

Part of the idea here is that different tools can share the same server instance. Useful if > you're doing pair programming with two editors, or if you like the pscid workflow but still > want to have auto-import resolution in the editor

Interesting. Do people currently use psc-ide-emacs to do that? I'm not sure it's possible right now. Generally I'd think that the way to go would be to first make Emacs able to start and communicate with several servers, and then after that, mechanisms for sharing (or re-using) servers with non-Emacs clients could be added.

@kritzcreek
Copy link
Collaborator

You can do it right now by just telling pscid to look at the same port that is configured in Emacs. I handle multiple projects by specifying a different psc-ide-port per project with .dir-locals.el. It works "well enough" that I haven't looked into anything more complicated.

Usually when I try to design a feature I don't use myself I do a bad job :D

@purcell
Copy link
Member

purcell commented Jan 18, 2019

It works "well enough" that I haven't looked into anything more complicated.

Simple is good! Thanks for the explanation.

Usually when I try to design a feature I don't use myself I do a bad job

SAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants