{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/nodejstools/issues/1414","repository_url":"https://api.github.com/repos/Microsoft/nodejstools","labels_url":"https://api.github.com/repos/Microsoft/nodejstools/issues/1414/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/nodejstools/issues/1414/comments","events_url":"https://api.github.com/repos/Microsoft/nodejstools/issues/1414/events","html_url":"https://github.com/Microsoft/nodejstools/issues/1414","id":187955912,"number":1414,"title":"Task Runner Explorer - Detect hanging discovery of tasks","user":{"login":"ste2425","id":8177767,"avatar_url":"https://avatars.githubusercontent.com/u/8177767?v=3","gravatar_id":"","url":"https://api.github.com/users/ste2425","html_url":"https://github.com/ste2425","followers_url":"https://api.github.com/users/ste2425/followers","following_url":"https://api.github.com/users/ste2425/following{/other_user}","gists_url":"https://api.github.com/users/ste2425/gists{/gist_id}","starred_url":"https://api.github.com/users/ste2425/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ste2425/subscriptions","organizations_url":"https://api.github.com/users/ste2425/orgs","repos_url":"https://api.github.com/users/ste2425/repos","events_url":"https://api.github.com/users/ste2425/events{/privacy}","received_events_url":"https://api.github.com/users/ste2425/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-08T10:32:09Z","updated_at":"2016-11-08T19:12:14Z","closed_at":null,"body":"In my naivety i didn't fully understand how `Gulp`'s watches worked. This led me to defining a `watch` outside of of a `task`. This meant as soon as the file was loaded and the `watch` fired up it prevented the process exiting. \r\n\r\nIn normal CLI use this wasn't noticeable, however when the Task Runner Explorer executes `gulp --tasks-simple` to find the tasks this excutes the `watch` causing that command to hang, which in turn causes the Task Runner Explorer to hang endlessly. \r\n\r\nIt was only after much trial and error i found the Gulp command the Task Runner Explorer executes which allowed me to debug the issue. If the Explorer detected the hanging script this would have been a trivial thing to understand and fix.\r\n\r\n##### Expected Behavior \r\nThe user should be presented with some form of loading spinner to indicate the Task Runner Explorer is actively searching for tasks. Should discovery of tasks hang, it should be detected in some form and provide the user with an error.\r\n\r\n##### Actual Behavior \r\nThe Task Runner Explorer does not present the user with any messages when searching for tasks. It still displays that there are no tasks available and does not display the NPM scripts either. The user is left non the wiser that the task runner explorer is actually currently searching for tasks, or that the command to `Gulp` to find the tasks is hanging.\r\n\r\nThe biggest issue here is that no errors are logged either as the Explorer has hung.\r\n\r\n<!---(from Help -> About Microsoft Visual Studio)-->\r\n- NTVS Version: 1.2.40726.00\r\n- Visual Studio Version: 14.25425.01 Update 3\r\n- Node.js Version: v6.6.0 (Linked to my local install, not the version VS tries to use internally)\r\n- NPM Task Runner: 1.3.73\r\n\r\n##### Steps to Reproduce\r\n1. Create `gulpfile.js`\r\n2. Add following code:\r\n``` javascript\r\n'use strict';\r\n\r\nvar gulp = require('gulp');\r\n\r\ngulp.watch('/**/*.js', ['one']);\r\n\r\ngulp.task('one', () => console.log('one'));\r\n```\r\n3. Open Task Runner Explorer: View -> Other Windows -> Task Runner Explorer\r\n    It will sit there telling the user `No task runner configurations were found`. When in reality its currently hung searching for them.\r\n\r\n4. NOTE: If you already had a working gulp file before making this change, upon saving it Task Runner Explorer won't update. When you re-load Visua Studio that's when it will not display anything.\r\n\r\nI think its worth pointing out i understand this is not an issue with the NodeJS Tooling for VS directly. However i do believe that the interaction with third party tooling could have these hanging script fail safes in place the provide a greater user experience in the event of errors.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/nodejstools/issues/comments/259230225","html_url":"https://github.com/Microsoft/nodejstools/issues/1414#issuecomment-259230225","issue_url":"https://api.github.com/repos/Microsoft/nodejstools/issues/1414","id":259230225,"user":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars.githubusercontent.com/u/12821956?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbvz","html_url":"https://github.com/mjbvz","followers_url":"https://api.github.com/users/mjbvz/followers","following_url":"https://api.github.com/users/mjbvz/following{/other_user}","gists_url":"https://api.github.com/users/mjbvz/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbvz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbvz/subscriptions","organizations_url":"https://api.github.com/users/mjbvz/orgs","repos_url":"https://api.github.com/users/mjbvz/repos","events_url":"https://api.github.com/users/mjbvz/events{/privacy}","received_events_url":"https://api.github.com/users/mjbvz/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T19:12:14Z","updated_at":"2016-11-08T19:12:14Z","body":"This issue was moved to aspnet/Tooling#848"}}
{"actor":{"display_login":"mjbvz"}}