volarjs / volar.js

💙🌊
https://volarjs.dev/
MIT License
963 stars 47 forks source link

Complete support for multi-source mapping in plugin mode #197

Closed piotrtomiak closed 3 months ago

piotrtomiak commented 3 months ago

Also, support disablement of code assist in associated non-TS files

johnsoncodehk commented 3 months ago

@piotrtomiak Thanks for the PR! I will review it soon, can you share any sample repo that can test this behavior?

piotrtomiak commented 3 months ago

@johnsoncodehk - it is difficult to share the whole repo, as templates are transpiled on JVM side for performance reasons - you need to build the whole Angular application model first. Here is the plugin project: https://drive.google.com/file/d/1y7hDmtP7l1VsWWR48jxv0PngFGLPGU3X/view?usp=sharing. It is only the TypeScript side, which runs as TSC plugin. You can see that transpiled template is sent to the server with webStormNgUpdateTranspiledTemplate command. I guess you could mock it up, or I can prepare for you a nightly build of WebStorm, where you can check the whole code flow. You can debug the TS server when it's running within WebStorm.

johnsoncodehk commented 3 months ago

Here is the plugin project: https://drive.google.com/file/d/1y7hDmtP7l1VsWWR48jxv0PngFGLPGU3X/view?usp=sharing.

Thanks! Very useful. 👍

I've released 2.3.0-alpha.8 for this, please let me know if you find problems, or please feel free to send a PR.

Update: I seem to have broken the use case of doing a find definition jump from .html to .ts and am trying to fix it.

johnsoncodehk commented 3 months ago

Update: I seem to have broken the use case of doing a find definition jump from .html to .ts and am trying to fix it.

It should be fixed by https://github.com/volarjs/volar.js/commit/511b4c1f8946534cc98c427894b0e37afeca0612.

piotrtomiak commented 3 months ago

@johnsoncodehk - thanks for working on this PR and all the fixes! Really appreciated!