[Question] only analyze opened files in VSCode #946
Comments
@taibaiyinxing hi, it should analyze the whole project by default. Can you share the package version and the sdk version you have? |
@incendial Thanks. My dart-code-metircs version is 4.16.0, and Dart version is 2.16.1, Flutter version is based on 2.10.2 (which has a little custom made from my company) |
and the analyzer version is 4.1.0; the analyzer_plugin version is 0.10.0 in the pubspec.lock file |
Can you please try to clear plugin_manager folder as described here https://github.com/dart-code-checker/dart-code-metrics/blob/master/CONTRIBUTING.md#run-the-plugin-in-ide, 5 step and then reload the IDE? |
@incendial I have tried to delete the .dartServer folder following the step 5 from the link just now, and found that the clear couldn't solve my problem. I also tried this in the Android Studio, the problem was still exist. |
Strange, I see that you created an issue in sdk repo dart-lang/sdk#49551, let's see what the Dart team will say, coz it looks mostly like integration issue on their side |
@incendial Thanks. I got the logs and had a new discover and commented it in that issue, maybe we can discuss it there. |
@incendial Hi, I just tried to solve the problem as described in sdk repo dart-lang/sdk#49551, and it seems work. Do you have any suggestions about it? Thanks. |
@taibaiyinxing sorry for the delay. I've checked the example with adding the path to the context root excludes and I think that it should be supported just from analysis_options. I'll check our code today |
Thanks. I've get some info from dart-lang/sdk#49551 as they said:
Maybe we should wait for a conclusion about this. |
@taibaiyinxing sorry for the long delay, but have you found a solution for the problem? |
@incendial I'm sorry for such a long delay. My solution is adding the ".flutterw" folder which has lots of dart files to the 'exclude' field of the ContextRoot instance in the 'createAnalysisDriver' method, and it did work for me. |
@taibaiyinxing so you have a fork of DCM plugin? |
@incendial Emmm, I just downloaded the source code of v4.16.0 and modified it and used it locally. My main flutter project does not support Flutter3.0 now. |
Yeah, I meant that you use some modified version and it works for you? Looks like since you're on the old version, there is not much we can do |
@incendial Yes, my modification works for me now, and I don't think there's any thing you need to do, because it's not a common situation. |
Okay, so I'm closing this for now. Feel free to reopen when you update to the latest version. We'll see what we can do (maybe some API for those type of excludes). |
What do you want to discuss?
I just learned to add dart-code-metrics to my test project, but after I added configurations to the analysis_options.yaml, and written some code that against a rule ('avoid-returning-widgets', which is added to the analysis_options.yaml file), then I switched to another file which didn't have any proplem, and finaly I restart my VS Code, and found that the warning info only show when I switch back to the one with proplem. My question is 'How to make the analyzer plugin analyze the full project when I open the IDE or project?', thanks.
The text was updated successfully, but these errors were encountered: