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

It seems a server will start in VSCode and Atom regardless of the setting to autostart #33

Closed
dwhitney opened this issue Mar 14, 2018 · 9 comments

Comments

@dwhitney
Copy link

I have a scenario where I'd like to setup my own server so that I can edit code in some bower link'd projects and have the server take care of compiling code regardless of the project I'm in. It works fine in vim, so I know the server setup is good, but when I use VSCode or Atom they both start up their own server regardless of the "autostart on load" setting, which means they don't talk to the server I've setup for my own purposes.

I'll look through this code and see if I can figure out how to resolve this, but might be better if someone who understood this codebase better took a look

@dwhitney
Copy link
Author

others are reporting that the pscIdePort option is being ignored as well

@dwhitney
Copy link
Author

I think maybe here?

@nwolverson
Copy link
Owner

I agree this setting shouldn't be ignored, but if before launching the plugin you echo -n 12345 > .psc-ide-port it will connect to that port. You'll need to make sure a server is running with the correct working directory in that case.

@kritzcreek
Copy link

I think the idea is to start a server in the "wrong" working directory and still have the server compile into that folders output/ directory.

@dwhitney
Copy link
Author

dwhitney commented Mar 15, 2018 via email

@dwhitney
Copy link
Author

I just tried this and it doesn't work. Just to re-describe the issue: I have a parent directory containing several related purescript projects, for example a "web" project that depends on a "core" project. I want to start a psc ide server in the "web" project, but open my editor in the parent folder so that I can easily edit code in either the "core" or the "web" projects and have changes reflected immediately in the "web" project's output folder by having my editor communicate changes to the psc ide server. It doesn't work in either Atom or VSCode, but it does work in vim, so I'm certain I have not setup the psc ide server incorrectly.

Just to reiterate - I've tried: putting .psc-ide-port with port 4242 in the parent folder, web, and core. And it didn't work. Doing that did stop Atom and VSCode from running their own servers, but They don't seem to interact much with the running server. The only logging output I get is the following when the editor loads (nothing when saving files):

[Debug] Accepted a connection @(main:Command.Ide app/Command/Ide.hs:204:5)
[Debug] Received command: {"command":"cwd"} @(main:Command.Ide app/Command/Ide.hs:214:9)
[perf] Command Cwd took 0.14ms

whereas with I use vim I get the following from opening the editor and saving a file:

[Debug] Accepted a connection @(main:Command.Ide app/Command/Ide.hs:204:5)
[Debug] Received command: {"command": "load"} @(main:Command.Ide app/Command/Ide.hs:214:9)
[perf] Command Load took 2301.55ms
[perf] Finished populating volatile state in: 119.67ms
[Debug] Accepted a connection @(main:Command.Ide app/Command/Ide.hs:204:5)
[Debug] Received command: {"params": {"file": "/Users/dtwhitney/development/valence/valence/projects/core/src/Core/Components/Workspace.purs"}, "command": "rebuild"} @(main:Command.Ide app/Command/Ide.hs:214:9)
[perf] Sorting externs: 16.75ms
[perf] Rebuilding Module: 171.20ms
[perf] Command Rebuild took 195.84ms
[perf] Finished populating volatile state in: 100.64ms

Hope this helps. I tried to poke around in the code base, but I couldn't figure out how to get the extension stuff going in VSCode. I'm not really familiar with making extensions

@nwolverson
Copy link
Owner

What output do you get from the PureScript output panel in vscode? That should tell you what's going on, I expect in this case it's finding that you are connecting to a server in the wrong directory (it runs Cwd and refuses to continue).

We can add an option to skip the cwd check on server startup, but the reason it's there is that connecting to random servers is going to give wrong results.

Regarding "open my editor in the parent folder" - you should not do this, this will not work in either atom or vscode plugin just now - in vscode you should open each project as a root folder (multi-root workspace)

@nwolverson
Copy link
Owner

This should now be fixed, along with the port configuration, with the latest LS release. That's released in the latest vscode plugin (0.18.1) but not yet in atom.

@dwhitney
Copy link
Author

dwhitney commented Mar 31, 2018 via email

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