Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: references marked as external if path has dots #1052

Merged
merged 4 commits into from Jul 5, 2019

Conversation

tsvetomir
Copy link
Contributor

Closes #1049

@tsvetomir
Copy link
Contributor Author

The Node v6 build fails with the same error in other PRs. Should I do anything about the error here?

-<pre><code><span class="hljs-attr">export</span> = SingleExportedClass<span class="hljs-comment">;</span></code></pre>
+<pre><code><span class="hljs-attribute">export</span> = SingleExportedClass<span class="hljs-comment">;</span></code></pre>

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 14, 2019

Don't worry about node 6, support has been dropped. If you merge master in, you'll see we are only testing Node 8,10,12 now.


I don't particularly like this solution, but looking at the rest of that function, this might be as good as it gets. I'll put this off until the weekend so that I can take a closer look. Thanks for the PR!

@tsvetomir
Copy link
Contributor Author

I've updated the regex to ignore quotes in the path. The only assumption now is that the symbol name doesn't contain quotes.

I'm not familiar with the context here - is there a function that will get us just the path? This should be more precise than the regex.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 14, 2019

I suspect there probably is a way to get that information from the checker, but I don't know how off the top of my head. That's part of the reason I want to take some time to look at this more closely :)

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 16, 2019

I spent some time looking at this today, and have come to the realization that I don't understand the reasoning behind why some ReferenceTypes are created by the alias converter, and some are created by the reference converter.

The code hasn't really been touched since Sebastian Lenz wrote it ~4 years ago, so I'd be surprised if anyone still working on the project knows why it was done this way. I'll hopefully have the time to figure it out tomorrow.

@tsvetomir
Copy link
Contributor Author

Okay, let me know if I can be of any help with the investigation.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 27, 2019

Following smart people working with TS is really helpful sometimes. I have a feeling this will be helpful in determining how this ought to work. I haven't had time to look at it yet... but I'm rather inclined to just merge this PR, it is at worst an improvement over the current behavior.

dsherret/ts-morph#653 (comment)

@tsvetomir
Copy link
Contributor Author

tsvetomir commented Jun 27, 2019

Seems like the TS compiler drops information for aliases early on — not good. The proposed hack in the issue is not relevant to Typedoc as it requires modifying the type definition.

I'm glad there is such an extensive test suite in place. I'd definitely be uncomfortable with fixing this without one.

@tsvetomir
Copy link
Contributor Author

I'll appreciate it if this patch makes it to production, as the original issue is really getting in our way. Thanks!

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 5, 2019

Sorry for the delay here, it's been a couple of really busy weeks.

I just tried to pull this down on a Windows machine to play with it locally before merging and ran into an issue since Windows doesn't allow quotes in file paths. I did some research and was unable to find a workaround, so I just removed that and pushed, once the build passes I'll merge.

I can't make releases, but TypeDoc is past due for one. When Anthony has the time there will be a release on the typedoc package. I maintain @gerrit0/typedoc which is just the TypeDoc master branch (+ theme master branch) if you need these changes sooner.

Edit: @gerrit0/typedoc at 0.15.2 has the changes

@Gerrit0 Gerrit0 merged commit 07afa11 into TypeStrong:master Jul 5, 2019
@tsvetomir tsvetomir deleted the dots-in-path branch July 5, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

References are marked as external when the path includes a dot
2 participants