{"action":"created","issue":{"url":"https://api.github.com/repos/tomv564/LSP/issues/165","repository_url":"https://api.github.com/repos/tomv564/LSP","labels_url":"https://api.github.com/repos/tomv564/LSP/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/tomv564/LSP/issues/165/comments","events_url":"https://api.github.com/repos/tomv564/LSP/issues/165/events","html_url":"https://github.com/tomv564/LSP/issues/165","id":263667431,"number":165,"title":"LSP stops working after \"LSP: Restart Servers\"","user":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars0.githubusercontent.com/u/16542113?v=4","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tomv564","id":4395832,"avatar_url":"https://avatars0.githubusercontent.com/u/4395832?v=4","gravatar_id":"","url":"https://api.github.com/users/tomv564","html_url":"https://github.com/tomv564","followers_url":"https://api.github.com/users/tomv564/followers","following_url":"https://api.github.com/users/tomv564/following{/other_user}","gists_url":"https://api.github.com/users/tomv564/gists{/gist_id}","starred_url":"https://api.github.com/users/tomv564/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomv564/subscriptions","organizations_url":"https://api.github.com/users/tomv564/orgs","repos_url":"https://api.github.com/users/tomv564/repos","events_url":"https://api.github.com/users/tomv564/events{/privacy}","received_events_url":"https://api.github.com/users/tomv564/received_events","type":"User","site_admin":false},"assignees":[{"login":"tomv564","id":4395832,"avatar_url":"https://avatars0.githubusercontent.com/u/4395832?v=4","gravatar_id":"","url":"https://api.github.com/users/tomv564","html_url":"https://github.com/tomv564","followers_url":"https://api.github.com/users/tomv564/followers","following_url":"https://api.github.com/users/tomv564/following{/other_user}","gists_url":"https://api.github.com/users/tomv564/gists{/gist_id}","starred_url":"https://api.github.com/users/tomv564/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomv564/subscriptions","organizations_url":"https://api.github.com/users/tomv564/orgs","repos_url":"https://api.github.com/users/tomv564/repos","events_url":"https://api.github.com/users/tomv564/events{/privacy}","received_events_url":"https://api.github.com/users/tomv564/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-10-07T19:50:12Z","updated_at":"2017-10-08T11:19:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If the \"LSP: Restart Servers\" command is called from command pallet, the server restarts but nothing works for the open documents. Each request sent to the language-server is responded with an error.\r\n\r\nThe debug log shows no `didOpen` notification being sent for any document after restart. Even activating/deactivating a view does not fix the issue. All open views must be closed and re-opened.\r\n\r\nThis issue is related to #145 and definitely an issue of LSP but not the pyls server, which expects `didOpen` to be called before any other request. See last post of #145 for the expected sequence.\r\n\r\n```\r\nLSP: starting in C:\\Apps\\Sublime\\Data\\Packages\r\nLSP: starting ['pyls']\r\nLSP: request 1: initialize \r\nLSP: client registered for window 2 {'pyls': <LSP.main.Client object at 0x00000162B38BC518>}\r\nLSP: got json:  {\"result\":{\"capabilities\":{\"codeActionProvider\":true,\"codeLensProvider\":{\"resolveProvider\":false},\"completionProvider\":{\"resolveProvider\":false,\"triggerCharacters\":[\".\"]},\"documentFormattingProvider\": ...\r\nLSP: notify: initialized\r\nLSP: request 2: textDocument/hover \r\nLSP: got json:  {\"error\":{\"code\":-32000,\"message\":\"Server error\",\"data\":{\"type\":\"KeyError\",\"args\":[\"file:///C:/Apps/Sublime/Data/Packages/GitGutter/modules/compare.py\"],\"message\":\"'file:///C:/Apps/Sublime/Data/Packag ...\r\nLSP: Got error from server:  {'message': 'Server error', 'code': -32000, 'data': {'message': \"'file:///C:/Apps/Sublime/Data/Packages/GitGutter/modules/compare.py'\", 'args': ['file:///C:/Apps/Sublime/Data/Packages/GitGutter/modules/compare.py'], 'type': 'KeyError'}}\r\nLSP: request 3: textDocument/hover \r\nLSP: got json:  {\"error\":{\"code\":-32000,\"message\":\"Server error\",\"data\":{\"type\":\"KeyError\",\"args\":[\"file:///C:/Apps/Sublime/Data/Packages/GitGutter/vcsadapter.py\"],\"message\":\"'file:///C:/Apps/Sublime/Data/Packages/Gi ...\r\nLSP: Got error from server:  {'message': 'Server error', 'code': -32000, 'data': {'message': \"'file:///C:/Apps/Sublime/Data/Packages/GitGutter/vcsadapter.py'\", 'args': ['file:///C:/Apps/Sublime/Data/Packages/GitGutter/vcsadapter.py'], 'type': 'KeyError'}}\r\n```"},"comment":{"url":"https://api.github.com/repos/tomv564/LSP/issues/comments/334999716","html_url":"https://github.com/tomv564/LSP/issues/165#issuecomment-334999716","issue_url":"https://api.github.com/repos/tomv564/LSP/issues/165","id":334999716,"user":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars0.githubusercontent.com/u/16542113?v=4","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"created_at":"2017-10-08T11:19:28Z","updated_at":"2017-10-08T11:19:28Z","author_association":"CONTRIBUTOR","body":"The starting point of it was, I had several python files open in a multi column layout. All working well, when I opened LSP/main.py to investigate on the issues with the completions stuff. \r\n\r\nAfter saving main.py the server is closed and restarted. The main.py recovered, everything working. The other views caused server error when hovering a keyword. So I remembered issue #145 as we were not finally able to find the reason/responsibility there. Saw a chance here to do so. Ok, clicking inside a view triggered didOpen by the on_activate event. Works fine, than.\r\n\r\nI rememberd the RestartServerCommand, so made sure pyls works for all views and called the command from command pallet. From this point on I was no longer able to make things work by activating/deactivating the views. pyls never recovered, always responded with error.\r\n\r\nSame situation while working on the shutdown stuff. I tried to simulate several situations in which a server might close itself by a crash or exits on its own rather than by \"exit\" notification. Just to see whether LSP is able to handle different (error) situations well. As soon as a server exits on its own or is closed via TaskManager LSP is no longer able to recover reliably. I don't want to blame someone for responsibility. There are quite a bunch of situations, I wouldn't have expected at all.\r\n\r\nOk, one could consider all those situations as uncommon edge cases. But in the end LSP should be able to handle server crashes gracefully and recover correctly after its restart. Otherwise a user would always need to restart ST to do so. At least the \"RestartServerCommand\" should recover everything as it can be called by each user in any situation.\r\n\r\nI honestly wouldn't have expected so much things/situations/edge cases/... to be considered, when working with such kind of external services."}}
{"actor":{"display_login":"deathaxe"}}