{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21590","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21590/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21590/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/21590/events","html_url":"https://github.com/Microsoft/TypeScript/issues/21590","id":294043857,"number":21590,"title":"Odd file completions for file in subdirectories returned when using compilerOptions.path","user":{"login":"mjbvz","id":12821956,"avatar_url":"https://avatars2.githubusercontent.com/u/12821956?v=4","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-02T22:31:36Z","updated_at":"2018-02-02T22:31:36Z","closed_at":null,"author_association":"COLLABORATOR","body":"**TypeScript Version:**  2.7.1\r\n\r\n**Search Terms:** \r\n- Path intellisense\r\n- Path completions\r\n\r\n**Code**\r\n```bash\r\n$ git clone https://github.com/mjbvz/ts-issue-21582\r\n```\r\n\r\n1. For a js project:\r\n\r\n```\r\njsconfig.json\r\nsrc/\r\n  index.js\r\n  keeper.js\r\n  animals/\r\n      cat.js\r\n```\r\n\r\nWith `jsconfig.json`:\r\n\r\n```\r\n{\r\n\t\"compilerOptions\": {\r\n\t\t\"module\": \"commonjs\",\r\n\t\t\"target\": \"es2016\",\r\n\t\t\"baseUrl\": \".\",\r\n\t\t\"paths\": {\r\n\t\t\t\"@zoo/*\": [\"./src/*\"]\r\n\t\t}\r\n\t},\r\n\t\"exclude\": [\r\n\t\t\"node_modules\",\r\n\t\t\"**/node_modules/*\"\r\n\t]\r\n}\r\n```\r\n\r\n2. In `src/index.js`, type: `import {} from '@zoo/animals/'`\r\n\r\n3. Trigger path intellisense after `@zoo/animals/c`\r\n\r\n**Expected behavior:**\r\nReturns a file completion for `cat.\r\n\r\n**Actual behavior:**\r\nAn odd completion for `/cat` is returned:\r\n\r\n```\r\n[Trace  - 2:30:56 PM] Response received: completions (470). Request took 4 ms. Success: true \r\nResult: [\r\n    {\r\n        \"name\": \"/cat\",\r\n        \"kind\": \"external module name\",\r\n        \"kindModifiers\": \"\",\r\n        \"sortText\": \"/cat\",\r\n        \"replacementSpan\": {\r\n            \"start\": {\r\n                \"line\": 1,\r\n                \"offset\": 30\r\n            },\r\n            \"end\": {\r\n                \"line\": 1,\r\n                \"offset\": 30\r\n            }\r\n        }\r\n    }\r\n]\r\n```\r\n\r\nThis causes the import to become `'@zoo/animals//cat'`\r\n\r\n**Related:**\r\n#21589"}}
{"actor":{"display_login":"mjbvz"}}