Skip to content

Commit 07afa11

Browse files
tsvetomirGerrit0
authored andcommitted
fix: references marked as external if path has dots (#1052)
* fix: references marked as external if path has dots Closes #1049 * refactor: ignore quotes in path * Remove quotes from path since it breaks on Windows
1 parent dfb7207 commit 07afa11

File tree

4 files changed

+154
-4
lines changed

4 files changed

+154
-4
lines changed

src/lib/converter/types/alias.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ export class AliasConverter extends ConverterTypeComponent implements TypeNodeCo
3333
}
3434

3535
const checker = context.checker;
36-
let symbolName = checker.getFullyQualifiedName(type.symbol).split('.');
36+
const fqn = checker.getFullyQualifiedName(type.symbol);
37+
38+
let symbolName = fqn.replace(/".*"\./, '').split('.');
3739
if (!symbolName.length) {
3840
return false;
3941
}
40-
if (symbolName[0].substr(0, 1) === '"') {
41-
symbolName.shift();
42-
}
4342

4443
let nodeName = node.typeName.getText().split('.');
4544
if (!nodeName.length) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as types from './interface-empty';
2+
3+
/**
4+
* This is a simple exported function.
5+
*/
6+
export function exportedFunction(arg: types.EmptyInterface): void {}
7+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* This is a simple interface
3+
*/
4+
export interface EmptyInterface {}
5+
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"id": 0,
3+
"name": "typedoc",
4+
"kind": 0,
5+
"flags": {},
6+
"children": [
7+
{
8+
"id": 3,
9+
"name": "\"function\"",
10+
"kind": 1,
11+
"kindString": "External module",
12+
"flags": {
13+
"isExported": true
14+
},
15+
"originalName": "%BASE%/dots.in.path/function.ts",
16+
"children": [
17+
{
18+
"id": 4,
19+
"name": "exportedFunction",
20+
"kind": 64,
21+
"kindString": "Function",
22+
"flags": {
23+
"isExported": true
24+
},
25+
"signatures": [
26+
{
27+
"id": 5,
28+
"name": "exportedFunction",
29+
"kind": 4096,
30+
"kindString": "Call signature",
31+
"flags": {},
32+
"comment": {
33+
"shortText": "This is a simple exported function."
34+
},
35+
"parameters": [
36+
{
37+
"id": 6,
38+
"name": "arg",
39+
"kind": 32768,
40+
"kindString": "Parameter",
41+
"flags": {},
42+
"type": {
43+
"type": "reference",
44+
"name": "EmptyInterface",
45+
"id": 2
46+
}
47+
}
48+
],
49+
"type": {
50+
"type": "intrinsic",
51+
"name": "void"
52+
}
53+
}
54+
],
55+
"sources": [
56+
{
57+
"fileName": "function.ts",
58+
"line": 6,
59+
"character": 32
60+
}
61+
]
62+
}
63+
],
64+
"groups": [
65+
{
66+
"title": "Functions",
67+
"kind": 64,
68+
"children": [
69+
4
70+
]
71+
}
72+
],
73+
"sources": [
74+
{
75+
"fileName": "function.ts",
76+
"line": 1,
77+
"character": 0
78+
}
79+
]
80+
},
81+
{
82+
"id": 1,
83+
"name": "\"interface-empty\"",
84+
"kind": 1,
85+
"kindString": "External module",
86+
"flags": {
87+
"isExported": true
88+
},
89+
"originalName": "%BASE%/dots.in.path/interface-empty.ts",
90+
"children": [
91+
{
92+
"id": 2,
93+
"name": "EmptyInterface",
94+
"kind": 256,
95+
"kindString": "Interface",
96+
"flags": {
97+
"isExported": true
98+
},
99+
"comment": {
100+
"shortText": "This is a simple interface"
101+
},
102+
"sources": [
103+
{
104+
"fileName": "interface-empty.ts",
105+
"line": 4,
106+
"character": 31
107+
}
108+
]
109+
}
110+
],
111+
"groups": [
112+
{
113+
"title": "Interfaces",
114+
"kind": 256,
115+
"children": [
116+
2
117+
]
118+
}
119+
],
120+
"sources": [
121+
{
122+
"fileName": "interface-empty.ts",
123+
"line": 1,
124+
"character": 0
125+
}
126+
]
127+
}
128+
],
129+
"groups": [
130+
{
131+
"title": "External modules",
132+
"kind": 1,
133+
"children": [
134+
3,
135+
1
136+
]
137+
}
138+
]
139+
}

0 commit comments

Comments
 (0)