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

its hanging on intl #43

Open
fredgrott opened this issue Sep 28, 2021 · 9 comments
Open

its hanging on intl #43

fredgrott opened this issue Sep 28, 2021 · 9 comments
Labels
dependency Tickets related to dcdg as a dependency duplicate This issue or pull request already exists

Comments

@fredgrott
Copy link

Its hanging on intl classes

my command lien and output errors:
PS D:\fredgrttsstuff\GithubProjects\flutter_best_practices\fbp_one> flutter pub global run dcdg -o reports\docs\diagrams\src\diagrams.puml
Unhandled exception:
Bad state: Unable to find the context to D:\fredgrttsstuff\GithubProjects\flutter_best_practices\fbp_one\lib\src\localization_gen\intl\messages_all.dart
#0 AnalysisContextCollectionImpl.contextFor (package:analyzer/src/dart/analysis/analysis_context_collection.dart:89:5)
#1 findClassElements (package:dcdg/src/find_class_elements.dart:44:39)

#2 main (file:///D:/fluttersdk/myfluttersdk/flutter/.pub-cache/hosted/pub.dartlang.org/dcdg-3.1.1/bin/dcdg.dart:35:19)

pub finished with exit code 255
PS D:\fredgrttsstuff\GithubProjects\flutter_best_practices\fbp_one>

@SkywalkerDarren
Copy link

same issue

❯ dcdg -V            
Unhandled exception:
Bad state: Unable to find the context to /home/darren/FlutterProjects/xxxx/lib/generated/intl/messages_zh_HK.dart
#0      AnalysisContextCollectionImpl.contextFor (package:analyzer/src/dart/analysis/analysis_context_collection.dart:89:5)
#1      findClassElements (package:dcdg/src/find_class_elements.dart:44:39)
<asynchronous suspension>
#2      main (file:///home/darren/.pub-cache/hosted/pub.flutter-io.cn/dcdg-3.1.1/bin/dcdg.dart:35:19)
<asynchronous suspension>

@fredgrott
Copy link
Author

okay per my tracking is it due to not using correct version of dart analzer?

error says line 89 in dart analzer analysiscontent collection but in current .26.0 ver of dart analyzer there is no such line as file is than only 39 codelines not a 100.

seems that issue 44 updating dep versions will probably resolve it.

@glesica
Copy link
Owner

glesica commented Oct 15, 2021

I'm unsurprised that it's failing, they've made a ton of changes to the analyzer in the past couple years. I created #45 to update dependencies, but I haven't had time to actually figure out what to replace missing fields / methods with yet.

@fredgrott
Copy link
Author

I kno what it is I think...per this dart-lang/sdk#25551

if I use brackets in my analysis excludes it hangs...if I list my exclude folders separately should stop haning.

@glesica glesica added dependency Tickets related to dcdg as a dependency duplicate This issue or pull request already exists labels Oct 20, 2021
@glesica
Copy link
Owner

glesica commented Oct 20, 2021

My guess is that this will be fixed when #44 is fixed.

@fredgrott
Copy link
Author

here is the workaround I have to use on windows within the analysis_options.yaml file:

exclude:
- lib\src\localization_gen\l10n.dart
- lib\src\localization_gen\intl\messages_all.dart

I tried quotes, did not work
I tried folder spearators the other way no go either it has to be that way on Windows.

Other path separtors work on analysis side but notthe DCDG tool side. Not sure why just as long as it freaking works which it does.

I confirmed via powershell terminal.

Strange

@glesica
Copy link
Owner

glesica commented Nov 2, 2021

Hmm, I don't love the way I've currently got the exclusion stuff implemented since it does the comparison only after it has transformed the name for the output format. This means that, for PlantUML at least, you have to using package::Class (for example), which is surprising since Dart doesn't use that syntax. I'm thinking about how to improve this. In the meantime, I think another good addition would be to allow exclusions simply based on relative paths, so basically "exclude this directory entirely".

@fredgrott
Copy link
Author

@glesica excluding the lib/src/localization_gen path would be an ideal stop-gap fix. Obvious question is would just excluding the loclaization_gen classes work? For most devs that would be the AppLocalizationDelegate and the what ever they named the other class to, in my case I use S.

@fredgrott
Copy link
Author

The quick fix that works is to temporary relocate the localization_gen library out of the src folder when generating diagrams.

The other fix I talked about does not work.

But at least now I know a temp work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Tickets related to dcdg as a dependency duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants