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: vue-tsc does not show ts errors in the terminal with --incremental #158

Merged

Conversation

wangshunnn
Copy link
Contributor

  • I'm trying to fix the issue I raised:
    TypeScript errors are not displayed in terminal with --incremental (vue-tsc@2) vuejs/language-tools#4194

  • In the process of locating the problem, I found that when tsc --incremental is run repeatedly, the TS error message is converted by tsc.js's convertToDiagnosticRelatedInformation method, which does not correctly get the text content corresponding to the error. So, I'm going to proxy this function to get diagnostic.file.text correctly.

  • I don't think my solution is very elegant, and I'm worried about introducing new issues, but at least I hope to provide some clues. Since I'm not familiar with volar at the moment, I'm expecting a simpler fix as well.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Apr 4, 2024

Thanks for the investigation, I tried proxy getSourceFileByPath to re-fix it, please let me know if you find any problems or not.

@wangshunnn
Copy link
Contributor Author

Thanks for the investigation, I tried proxy getSourceFileByPath to re-fix it, please let me know if you find any problems or not.

Oh, this is a really great fix that is more compatible with the current decorateProgram logic!

I just tested the fix and it's working fine and I haven't found any problems yet!

I once tried to proxy program.getSourceFileByPath like you did, but I didn't handle it properly in the end, so I took a "detour" haha. Thank you very much!

@johnsoncodehk
Copy link
Member

Thanks for confirming!

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.

2 participants