Closed
Description
TypeScript Version: 2.7.1
Search Terms:
- Path intellisense
- Path completions
Code
$ git clone https://github.com/mjbvz/ts-issue-21582
- For a js project:
jsconfig.json
src/
index.js
keeper.js
animals/
cat.js
With jsconfig.json
:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"baseUrl": ".",
"paths": {
"@zoo/*": ["./src/*"]
}
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
-
In
src/index.js
, type:import {} from '@zoo/'
-
Trigger path intellisense after
@zoo/
Expected behavior:
Returns two completions, one for the file keeper
and one for the directory animals
. These should have kinds of script
and directory
respectively. This is in fact what happens for path completions on import {} from './'
:
Result: [
{
"name": "animals",
"kind": "directory",
"kindModifiers": "",
"sortText": "animals",
"replacementSpan": {
"start": {
"line": 2,
"offset": 19
},
"end": {
"line": 2,
"offset": 19
}
}
},
{
"name": "keeper",
"kind": "script",
"kindModifiers": "",
"sortText": "keeper",
"replacementSpan": {
"start": {
"line": 2,
"offset": 19
},
"end": {
"line": 2,
"offset": 19
}
}
}
]
Actual behavior:
Correct suggestions returned but both have "kind": "external module name"
[Trace - 12:50:32 PM] Response received: completions (36). Request took 4 ms. Success: true
Result: [
{
"name": "index",
"kind": "external module name",
"kindModifiers": "",
"sortText": "index",
"replacementSpan": {
"start": {
"line": 1,
"offset": 22
},
"end": {
"line": 1,
"offset": 22
}
}
},
{
"name": "keeper",
"kind": "external module name",
"kindModifiers": "",
"sortText": "keeper",
"replacementSpan": {
"start": {
"line": 1,
"offset": 22
},
"end": {
"line": 1,
"offset": 22
}
}
}
]