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
Feedback on preview feature - Angular analyzer plugin integration #396
Comments
Thanks for adding the feedback issue and editor message! Errors and completions are working on 2.3.5. The only thing I've noticed is that it seems angular template analysis doesn't work properly until the entire workspace has completed analysis, even if the html file is the focused file. I'm guessing this is some artifact of how the plugin works. @MichaelRFairhurst Do you have any insight into this? |
Hmm, strange. We should be sending the html files as priority files - you could confirm this by setting If it's not being sent as a priority file, that's a bug in Dart Code. If it is, then probably this is the plugin or analyzer. I'm sure I had a bug where files weren't set as priority if they were open during project reload, but then I couldn't repro it when I investigated - see #354. If it looks like that and you can reliably repro, please let me know! |
I believe this is actually a result of the plugin not activating when opening an HTML file. I've created #399 - but I can't find a way to change the activation events based on the configuration. |
@LorenVS we do analyze html templates last. Mostly because dart files point to html files and not the other way around. So autocompletion won't work and errors/navigation will take a while, but once dart has finished analyzing it should act normal. |
Has anything changed with the Angular plugin - is this preview still required? |
I've been using this pretty regularly over the last few months, and haven't run into any significant issues. I'm fine with just moving it to a normal option |
I re-checked the changes here and realise the changes were actually just about invoking the providers for HTML. So I guess a more appropriate question is, if we drop the |
FYI - in the next version I plan to drop the "preview" from the setting name but also default it to on (after testing which versions of SDK it works fine with). Doing this in #458. If you think this isn't a good idea let, please let me know. That version is probably around a week away, depending on how testing of the multi-root changes go. |
Is it supposed to work out of the box if
is present in the analysis_options.yaml ? I'm new to angulardart. And on my vscode, templates are interpreted are just plain strings. |
@rrousselGit For now, you also need to add |
I had it enabled already. In fact it seems like it's working. I get warnings when a field doesn't exist inside a template. |
Oh, I see. I think for that too work (assuming the plugin supports it) we need this: Please click the 👍 on the first comment there! |
I am unable to see template errors even if installed as suggested. Maybe this is a dart SDK failure and has nothing to do with DartVS plugin? VSCode:
Dart VM version: 2.0.0-dev.39.0 (Fri Mar 16 00:17:07 2018 +0100) on "windows_x64" modified analysis_options.yaml:
VScode user settings:
Test: Messed up dashboard_component.html by changing {{hero.name}} to {{herozz.name}}.
|
Thanks for the detailed report! The logs show that we are are sending the contents of the HTML, but the analyzer says no errors:
I think this may be best raised at https://github.com/dart-lang/angular_analyzer_plugin since I don't think there's much I can do to troubleshoot past asking you to do what you're already done. |
I see you beat me to it 👍 |
Thanks for your fast reply! Yea, that was my first guess after reading the logs that I should submit the bug report to analyzis server plugin devs, too. |
FYI - the next version of Dart Code is flipping this flag to on by default (and renaming to drop There will likely be a beta release before it goes out, so any testing it can be given would be appreciated (probably it'll be end of next week or early the next). |
This flag was flipped and is available in a beta of v2.12 here: https://github.com/Dart-Code/Dart-Code/releases/tag/v2.12.0-beta.1 Provisional release notes here: https://dartcode.org/releases/v2-12/ Please test it out and let me know if you have any issues. |
v2.3.4 includes a preview feature enabled with the
dart.previewAnalyzeAngularTemplates
setting. Because the plugin is still in development, in order to use this you will need to download the angular analyzer plugin and build it yourself (instructions can be found here). Note: You do not need to overwrite theanalyzer.snapshot
in your SDK because Dart Code supports custom analyzer snapshots; simply set thedart.analyzerPath
setting (which can be done at the workspace level, along withdart.previewAnalyzeAngularTemplates
to enable this only for some projects) to the full path of theanalyzer.snapshot
that is built.This feature is behind a preview flag because it's currently incomplete (both the plugin and the Dart Code integration). Depending on how the plugin ships once complete, it may become enabled by default.
Please post your feedback below!
Known issues:
Dart Code doesn't activate for projects withoutpubspec.yaml
unless a.dart
file is openedSuggestions
The text was updated successfully, but these errors were encountered: