-
Notifications
You must be signed in to change notification settings - Fork 73
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
Dart Analysis Server always crashes whenever I launch my custom lint project on vs code #60
Comments
Could you share your custom_lint.log file, if any? |
Sorry. The log file is not there. |
Any chance you could create a git repo for reproducing the issue? |
Okay. So, I had a folder |
Sure but I'd need something I can run. It's unlikely to be something I can debug with just a description of your situation |
Alright. let me create a git repo. |
Seeing these crashes as well on 0.1.0
After playing around with the versions, I seem to only be able to run anything with |
Hey @rrousselGit. Sorry for the late response. |
I have the exact same project setup, an example project with test cases. |
Hi @kuhnroyal. Can you check something for me? Try launching the lint package's code separately on your IDE and see if the analyzer works. |
Yea seems to work. |
@kuhnroyal You have two projects or more in your repository that use different dependency versions. I'll see how I can make the error more obvious, but in any case, you need to fix this on your side. |
@Biplab-Dutta Your custom_lint setup is incorrect. It's weird that the analyzer crashes, but you shouldn't have a |
Should have checked the CHANGELOG 🤦♂️. |
@rrousselGit looks like the README has not been updated. |
Eh I updated the code snippet but forgot to change the path. Will fix |
I shall try again tomorrow following the new instructions as shown in the CHANGELOG. Shall let you know if anything goes wrong. Thanks. It's almost 1 am 🥶 |
So, I gave it a last go before going to bed. @rrousselGit would you mind checking if I am doing something wrong again? The analysis server still crashes after editing the entry points. |
@Biplab-Dutta You didn't implement the Afaik the server crashes because it fails to report the error about how your plugin failed to start, so it makes debugging a bit difficult. |
Let's not close this issue for now. I will come back to it tomorrow again. |
Yea I figured and after freezing some deps my test project (example folder inside my lints project) has the expected lints when running |
@kuhnroyal it'd be great if you could share some way to reproduce your issue |
I all, I'm having the same issue.. not sure if I did something wrong.. if it can help here is my repo: https://github.com/marcotrumpet/my_custom_lints/tree/bugfix/dart-analysis-server-error Please ask if you want more specifications I'll continue to inspect this. Thanks! EDIT with flutter doctor:
|
It could be based on your SDK version too. Do you have the issue with the stable channel and master channel? |
But my bet is that there's something that doesn't compile in your plugin, which prevents the plugin from starting. |
Hey, thanks for your fast response. I'll check with other flutter versions. Before the upgrade btw I had an error from vscode about the error starting the plugin (if there was an error). |
you're too fast :D just fixed that.. also upgraded to flutter 3.3.10 but same error.. wonder if a reboot will solve as always |
So, disabling custom_lint seems to let server analysis alive and working. But running |
So it works when using the CLI eh. Go in the file: Inside final processFuture = _asyncRetry(retryCount: 5, () async {
port = await _findPossiblyUnusedPort();
final process = await Process.start(
Platform.resolvedExecutable,
[
'--enable-vm-service=$port',
join('lib', 'main.dart'),
await _serverSocket.then((value) => value.port.toString())
],
workingDirectory: _tempDirectory.path,
);
return process;
});
+ void log(Object message) {
+ for (final root in _contextRoots.roots) {
+ final file = File(join(root.root, 'log.txt'));
+ file.writeAsString('$message\n', mode: FileMode.append);
+ }
+ }
+
+ log('Here');
+ processFuture.then(
+ (_) => log('Started successfully'),
+ onError: (err, stack) {
+ log('Error: $err\n$stack');
+ },
+ );
await processFuture.then(
_process.complete,
onError: _process.completeError,
); Restarting the project should create a |
Yea same for me, running in CLI works and outputs the expected lints but constant crashing in IntelliJ. |
But keeps crashing |
Funky. At least it shows the problem isn't here. I'll try some things and make a dev release. I have some theories. |
Found something. When running
|
Yeah that's an analyzer bug. It was fixed In theory if you switch to the master channel, the crash will disappear |
To me is crashing also when I clone the repo to add log.. the thing is why it's working for you with the same code 😨I even tested the 0.1.1 version but still the same |
You mean cloning custom_lint causes a crash too? eh |
yep, cloning this whole repo and opening with vscode give me a crash.. double check this is not my mac problem by opening other repo (and closing every other one).. |
The plugins for both example projects fail to start for me. |
What error? |
I've published version 0.1.2-dev in an attempt to fix this. Make sure to look at the custom_lint.log file to see if there's any error in it too. |
Shall give it a try tonight.. |
It keeps crashing, there is no
|
There's nothing of value in those logs sadly |
This has something to do with the Flutter/Dart version. It works on the Flutter beta channel. |
Does it work on the master channel as I suggested before? If so, a solution could be to bump the minimum Dart SDK constraint on |
This works:
|
Thanks, but that's the beta channel. I'd like to know for |
If it works for both beta+master, the issue could probably be closed.... right? |
Upgrading Flutter, will check in a minute. |
Yea seems to work on master as well. |
I see. Then considering a stable release will probably be made in a few weeks, I'd be open to simply wait for this. Unless someone else still has an issue? |
Guys sorry, can't check for a bit. Thanks @rrousselGit for support and @kuhnroyal for help debugging this! |
hey @rrousselGit! I still get this issue. I've tried 0.1.1 and 0.1.2-dev and I'm running Dart 2.18.6 with analyzer 5.4.0 and analyzer_plugin 0.11.2 - is the error expected?
|
@jonaslundquist That's something fixed on newer versions of Dart |
Closing since a new Flutter/Dart stable version is available |
* Bump version to `0.1.0` * Pull changes from `solid-metrics` repository * Update .gitignore Co-authored-by: Yuri Prykhodko <40931732+solid-yuriiprykhodko@users.noreply.github.com> * Update example/lib/solid_lints_example.dart Co-authored-by: Yuri Prykhodko <40931732+solid-yuriiprykhodko@users.noreply.github.com> * Update `CHANGELOG.md` * Add code checks with GitHub Actions * Add support for the number of parameters metric * Remove DCM references * Change lint message * Simplify configuration and remove redundant code * Fix code comments * Add missing tests * Add `lines_of_code` lint * Fix rule name * Add test and fix an edge case * Update lint to match the specification * Add `avoid_non_null_assertion` lint * Add missing comment * Add `avoid_late_keyword` lint * Update problem message * Add `avoid_global_state` lint * Fix failing tests * Add `avoid_returning_widgets` lint * Use pattern-matching * Simplify `isWidgetReturned` * Update lib/lints/avoid_returning_widgets/avoid_returning_widgets_rule.dart Co-authored-by: Yuri Prykhodko <40931732+solid-yuriiprykhodko@users.noreply.github.com> * Cleanup of `getLintRules` * Fix comment * rename MetricRule -> RuleConfig * add a sceleton for the double-literal-format rule * implement the double-literal-format rule * fix review warnings * implement quick-fix for the double-literal-format rule * fix lint warnings * add avoid-unnecessary-type-assertions rule ('is' part) * fix lint warning * add avoid-unnecessary-type-assertions rule ('whereType' part) * add quick-fix for unnecessary operator is * add quick-fix for unnecessary whereType * fix review warnings; fix a bug * add utility class for type chekcking methods * add constants for is and whereType names * add needed comments * rewrite _isUnnecessaryWhereType with pattern matching * rewrite _areGenericsWithSameTypeArgs with pattern matching * refactoring: move a castTypeInHierarchy to TypeCast class * implement "avoid unnecessary setstate" rule (invertase#44) * implement "avoid unnecessary setstate" rule * fix pr comments * added idea files to gitignore * fix pr comments * Fix merge conflict * Fix tests and improve GitHub workflow * Fix workflow file * Fix conflicts after merge * Remove non-existing import * Add missing rule to tests and remove unnecessary GitHub actions step --------- Co-authored-by: Yaroslav Laptiev <yaroslav.laptiev@wmg.com> Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Add avoid_unnecessary_type_casts_rule * Refactor types_utils, extract common methods * Add fix for avoid_unnecessary_type_casts_rule * Add AvoidUnnecessaryTypeCastsRule.createRule to solid_lints.dart * Fix 'quickFix' for avoid-unnecessary-type-casts * Add tests for avoid-unnecessary-type-casts * Fix formatting * Add more test cases * Group code for more readability * Switch to getters, refactor areGenericsWithSameTypeArgs * Avoid unrelated type assertions (invertase#48) * Add avoid-unrelated-type-assertions rule * Add tests for avoid-unrelated-type-assertions rule --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Feature/newline before return (invertase#52) * Add newline-before-return rule * Fix typos, remove unnecessary negation * Add tests for newline-before-return --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Fixes Issue invertase#54 multiple rule reporting (invertase#55) * Fix newline-before-return * Fix avoid-unrelated-type-assertions * Fix avoid-unnecessary-type-casts --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Feature/no empty block (invertase#53) * Add no-empty-block rule * Add tests no-empty-block rule * Add cyclomatic tests case, fix formatting --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Add no equal then else rule (invertase#56) * Add no-equal-then-else rule * Add tests for no-equal-then-else rule --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Feature/member ordering (invertase#51) * Add required models for member-ordering rule * Add member-ordering rule * Add MIT License comments * Fix parser type mismatch * Add tests for member-ordering and enable rule * Organize imports, ignore member-ordering in unrelated test * Group *_member_group.dart into one directory * Add more test cases * Add more test cases * Add alphabetize test cases * Add tests for alphabetical-by-type option * Ignore no-empty-block in test * Ignore member-ordering in test --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Add avoid unused parameters rule (invertase#49) * Add avoid-unused-parameters rule * Add tests for avoid-unused-parameters rule * Fix function name, remove null check operator and remove negation * Fix multiple reporting * Add more test cases * Fix formatting * Rename method * Add constructors and factories unused params handling * Fix constructors with named field parameters * Simplify rule run method * Fix tests * Fix tests after merge * Fix tests after merge --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Added no magic number rule (invertase#57) * Add no-magic-number rule * Add tests for no-magic-number rule * Fix import lost in merge * Ignore no-magic-number in test --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> * Added prefer condtional expressions rule and fix (invertase#59) * Add prefer-conditional-expressions rule and fix * Add tests for prefer-conditional-expressions rule * fix nested test plugin path * Fix tests after merge * Update lint_test/prefer_conditional_expressions_ignore_nested_test/prefer_conditional_expressions_ignore_nested_test.dart --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Added prefer first rule (invertase#60) * Add prefer-conditional-expressions rule and fix * Add tests for prefer-conditional-expressions rule * fix nested test plugin path * Fix tests after merge * Add prefer-first rule and fix * Add tests for prefer-first rule --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Add prefer last rule (invertase#61) * Add prefer-conditional-expressions rule and fix * Add tests for prefer-conditional-expressions rule * fix nested test plugin path * Fix tests after merge * Add prefer-first rule and fix * Add tests for prefer-first rule * Add prefer-last rule & fix * Add tests for prefer-last rule --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Add prefer match file name (invertase#62) * Add prefer-conditional-expressions rule and fix * Add tests for prefer-conditional-expressions rule * fix nested test plugin path * Fix tests after merge * Add prefer-first rule and fix * Add tests for prefer-first rule * Add prefer-last rule & fix * Add tests for prefer-last rule * Add prefer-match-file-name rule * Add tests for prefer-match-file-name rule * Typos, naming * Typos, naming * rm todo comment * Update lint_test/prefer_match_file_name_test.dart * Update lint_test/prefer_match_file_name_test.dart --------- Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> Co-authored-by: Yurii Prykhodko <yurii.prykhodko@solid.software> * Rename custom lints to use snake_case (invertase#66) * Rename custom lints to use snake_case * Rename missed parameter --------- Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Take into account the constructor initializer in the avoid_unused_parameters rule (invertase#67) Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Fix linter issues * Bump custom_lint_builder version * Update LICENSE to include third party code license * Allow magic numbers for default values (invertase#72) * Allow magic numbers for default values * More tests --------- Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Ignore magic number in constructor initializer (invertase#73) * Ignore magic number in constructor initializer * Minor naming improvement --------- Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Remove DCM steps from readme * Fix avoid-late if initialized (invertase#71) * Implement proper-super-calls (invertase#77) * Fix avoid-late if initialized * Update lint_test/avoid_late_keyword_test.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Custom avoid-late * Fix naming * Apply suggestions from code review Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Avoid late simplified * Update lib/lints/avoid_late_keyword/models/avoid_late_keyword_parameters.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Avoid-late ignored_types * Avoid-late ignored_types formatted * Update lib/lints/avoid_late_keyword/models/avoid_late_keyword_parameters.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Avoid-late ignored_types fix * Avoid-late ignored_types Fix * Avoid-late allow_initialized testcases * Update lint_test/avoid_late_keyword_allow_initialized_test/pubspec.yaml Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Update lib/lints/avoid_late_keyword/models/avoid_late_keyword_parameters.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Allow subclasses for avoid-late whitelist * Fix naming * Short-circuit of there's no ignored types * Short-circuit earlier * Update lib/lints/avoid_late_keyword/avoid_late_keyword_rule.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Avoid-late ignored_types tests * Avoid-late add testcases * Proper-super-calls impl * Proper-super-calls format * Apply suggestions from code review Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Proper-super-calls refactoring * Update lib/lints/proper_super_calls/proper_super_calls_rule.dart Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> * Proper-super-keyword annotation check * Proper-super-keyword format * Proper-super-calls cleanup --------- Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> Co-authored-by: Yurii Prykhodko <yurii.prykhodko@solid.software> * Ignore magic numbers in widget parameters (invertase#74) * Ignore magic numbers in widget parameters * Add lint parameter to ignore magic numbers in widget params * Improve the allowed_in_widget_params parameter to exclude magic numbers in nested objects of Widget parameters * Add tests for disabled allowed_in_widget_params lint parameter * Remove unnecessary dependency --------- Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> * Set default severity level to warning (invertase#78) Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> --------- Co-authored-by: Nikodem Bernat <n.bernat@outlook.com> Co-authored-by: Vadym Khokhlov <xvadima@ukr.net> Co-authored-by: Yaroslav <43727448+laptevw@users.noreply.github.com> Co-authored-by: Yaroslav Laptiev <yaroslav.laptiev@wmg.com> Co-authored-by: vladimir-beloded <x-volodymyr.beloded@transcarent.com> Co-authored-by: Denis Bogatirov <denis.bohatyrov@computools.com> Co-authored-by: DenisBogatirov <denis.bogatirov@gmail.com> Co-authored-by: Yurii Prykhodko <144313329+yurii-prykhodko-solid@users.noreply.github.com> Co-authored-by: solid-vovabeloded <41615621+solid-vovabeloded@users.noreply.github.com> Co-authored-by: Illia Romanenko <442086+illia-romanenko@users.noreply.github.com> Co-authored-by: maxxlab <42914015+maxxlab@users.noreply.github.com>
Describe the bug
Dart Analysis Server always crashes whenever I launch my custom lint project on vs code. The crash doesn't take place when I launch my other flutter projects.
flutter doctor -v
The text was updated successfully, but these errors were encountered: