vscode-hack
vscode-hack copied to clipboard
Langserver fails to connect on windows with docker
Hi! I tried to setup a development environment on Windows and running hhvm and hh_client in docker (Linux), unfortunately without luck. Has anyone succeeded with similar setup? The diag log here is not really helpful as the lang server gracefully disconnects and after 3 tries the extension gives up.
Hi @retk, could you post versions of everything you are using in this setup? I'll try and get a repro.
hi @PranayAgarwal, sry for the late answer! here are the details:
code --version
1.28.2
7f3ce96ff4729c91352ae6def877e59c561f4850
x64
docker --version
Docker version 18.06.1-ce, build e68fc7a
Hack extension version is: 1.0.1
hhvm running in docker:
docker run -d -t --name my-hhvm -v c:/sources/hack-proof:/mnt/project hhvm/hhvm:latest
docker exec -t my-hhvm hhvm --version
HipHop VM 3.29.1 (rel)
Compiler: 1540927204_429022038
Repo schema: 35c5e7214afd06767bbd9fd42039b2f7f5ee7c9d
workspace settings
{
"hack.clientPath": "docker exec -i my-hhvm hh_client",
"hack.workspaceRootPath": "/mnt/project",
"hack.trace.server": "verbose",
"hack.useHhast": false
}
extension output:
[Trace - 5:09:55 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 23240,
"rootPath": "c:\\sources\\hack-proof",
"rootUri": "file:///mnt/project",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
}
},
"executeCommand": {
"dynamicRegistration": true
},
"configuration": true,
"workspaceFolders": true
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true
},
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
]
}
},
"definition": {
"dynamicRegistration": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
}
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true
},
"documentLink": {
"dynamicRegistration": true
},
"typeDefinition": {
"dynamicRegistration": true
},
"implementation": {
"dynamicRegistration": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true
}
}
},
"initializationOptions": {
"useTextEditAutocomplete": true
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///mnt/project",
"name": "hack-proof"
}
]
}
[Trace - 5:09:56 PM] Received notification 'telemetry/event'.
Params: {
"type": 1,
"message": "End_of_file, from_client\nRaised at file \"string.ml\", line 118, characters 19-34\nCalled from file \"sexp.ml\", line 112, characters 13-47\n---\nRaised at file \"client/clientLsp.ml\", line 397, characters 32-79\nCalled from file \"client/clientLsp.ml\", line 2353, characters 18-46\n"
}
[Info - 5:09:56 PM] Connection to server got closed. Server will restart.
@retk I tried to repro this, but was actually able to get the language server started successfully with errors, intellisense and other features mostly working. There was a small problem with path translations (windows to linux) which I will fix, but other than that I didn't see the benavior you mentioned.
Could you try to run docker exec -it my-hhvm /bin/bash
, navigate to your application path and run hh_client
and see the output?
could be an issue on my end, but currently have no idea where to look. the output:
root@b193ca487f6f:/mnt/project# hh_client
For more detailed logs, try `tail -f $(hh_client --monitor-logname) $(hh_client --logname)`
Server launched with the following command:
'/usr/bin/hh_server' '-d' '/mnt/project' '--waiting-client' '5'
Spawned typechecker (child pid=70)
Logs will go to /tmp/hh_server/monitor_logs/zSmntzSproject-2018-11-16-21-09-12.monitor_log
No errors!
Can you share your setup? Versions and relevant settings. I also noticed noticed that if I change a file outside in Windows hh_server must be restarted within the container to detect the change. But afaik it is a known limitation of docker on windows.
Basically the same as yours. Win 10, latest Docker, hhvm/hhvm:3.29.1
image, same docker commands. I tested with the https://github.com/hhvm/hhast repository, which may have made the difference.
I'll try it out soon and get back to you. If it is source related at least I have an idea where to start debugging. What was that small path translation issue is about? Thanks for your help!
I just wrote about this into the PR (https://github.com/slackhq/vscode-hack/pull/44). Can it be, that maybe the problem is with the docker container itself? Did anybody else try it with - either other docker container or - a manually installed VM?
Update: I just tried it with a VM. I installed a Ubuntu, and an HHVM, openned ssh to it. Shared the necessary folders, so now it's in sync. But the SSH probably doesn't even try to connect to it. Is there any possibility to open some debug panel or something?