Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

custom_lint is not showing warnings in VSCode #368

@codeOfJannik

Description

@codeOfJannik

Describe the bug
dart run custom_lint works just fine and shows me the riverpod_lint warnings. But VSCode is not showing me any warnings neither in the problems tab nor the editor window.

custom_lint.log show me the following error:

[custom_lint] 2025-11-13T18:48:47.718308 Crash when compiling:
[custom_lint] 2025-11-13T18:48:47.718308 type 'Null' is not a subtype of type 'Procedure' in type cast
[custom_lint] 2025-11-13T18:48:47.718308
[custom_lint] 2025-11-13T18:48:47.718308 #0      MatchingExpressionVisitor.visitObjectPattern (package:front_end/src/fasta/type_inference/matching_expressions.dart:414:68)
[custom_lint] 2025-11-13T18:48:47.718308 #1      ObjectPattern.accept1 (package:kernel/src/ast/patterns.dart:622:15)
[custom_lint] 2025-11-13T18:48:47.718308 #2      MatchingExpressionVisitor.visitPattern (package:front_end/src/fasta/type_inference/matching_expressions.dart:27:17)
[custom_lint] 2025-11-13T18:48:47.718308 #3      ConstantsTransformer.visitPatternVariableDeclaration (package:front_end/src/fasta/kernel/constant_evaluator.dart:1692:35)
[custom_lint] 2025-11-13T18:48:47.718308 #4      PatternVariableDeclaration.accept1 (package:kernel/src/ast/patterns.dart:2050:14)
[custom_lint] 2025-11-13T18:48:47.718308 #5      RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919:21)
[custom_lint] 2025-11-13T18:48:47.718308 #6      ConstantsTransformer.visitBlock (package:front_end/src/fasta/kernel/constant_evaluator.dart:820:27)
[custom_lint] 2025-11-13T18:48:47.718308 #7      Block.accept1 (package:kernel/ast.dart:9104:58)
[custom_lint] 2025-11-13T18:48:47.718308 #8      RemovingTransformer.transform (package:kernel/visitor.dart:1883:17)
[custom_lint] 2025-11-13T18:48:47.718308 #9      ForInStatement.transformOrRemoveChildren (package:kernel/ast.dart:9646:14)
[custom_lint] 2025-11-13T18:48:47.718308 #10     RemovingTransformer.defaultTreeNode (package:kernel/visitor.dart:2166:10)
[custom_lint] 2025-11-13T18:48:47.718308 #11     TreeVisitor1Default.defaultStatement (package:kernel/visitor.dart:743:48)
[custom_lint] 2025-11-13T18:48:47.718308 #12     StatementVisitor1DefaultMixin.visitForInStatement (package:kernel/visitor.dart:2572:7)
[custom_lint] 2025-11-13T18:48:47.718308 #13     ForInStatement.accept1 (package:kernel/ast.dart:9621:9)
[custom_lint] 2025-11-13T18:48:47.718308 #14     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919:21)
[custom_lint] 2025-11-13T18:48:47.718308 #15     ConstantsTransformer.visitBlock (package:front_end/src/fasta/kernel/constant_evaluator.dart:820:27)
[custom_lint] 2025-11-13T18:48:47.718308 #16     Block.accept1 (package:kernel/ast.dart:9104:58)
[custom_lint] 2025-11-13T18:48:47.718308 #17     RemovingTransformer.transform (package:kernel/visitor.dart:1883:17)
[custom_lint] 2025-11-13T18:48:47.718308 #18     ConstantsTransformer.visitFunctionNode (package:front_end/src/fasta/kernel/constant_evaluator.dart:643:19)
[custom_lint] 2025-11-13T18:48:47.718308 #19     FunctionNode.accept1 (package:kernel/ast.dart:3800:9)
[custom_lint] 2025-11-13T18:48:47.718308 #20     RemovingTransformer.transform (package:kernel/visitor.dart:1883:17)
[custom_lint] 2025-11-13T18:48:47.718308 #21     ConstantsTransformer.visitProcedure.<anonymous closure> (package:front_end/src/fasta/kernel/constant_evaluator.dart:560:23)
[custom_lint] 2025-11-13T18:48:47.718308 #22     ConstantEvaluator.withNewEnvironment (package:front_end/src/fasta/kernel/constant_evaluator.dart:5351:18)
[custom_lint] 2025-11-13T18:48:47.718308 #23     ConstantsTransformer.visitProcedure (package:front_end/src/fasta/kernel/constant_evaluator.dart:558:23)
[custom_lint] 2025-11-13T18:48:47.718308 #24     Procedure.accept1 (package:kernel/ast.dart:3170:55)
[custom_lint] 2025-11-13T18:48:47.718308 #25     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919:21)
[custom_lint] 2025-11-13T18:48:47.718308 #26     RemovingTransformer.transformList (package:kernel/visitor.dart:2143:19)
[custom_lint] 2025-11-13T18:48:47.718308 #27     RemovingTransformer.transformProcedureList (package:kernel/visitor.dart:2035:5)
[custom_lint] 2025-11-13T18:48:47.718308 #28     ConstantsTransformer.visitClass.<anonymous closure> (package:front_end/src/fasta/kernel/constant_evaluator.dart:513:7)
[custom_lint] 2025-11-13T18:48:47.718308 #29     ConstantEvaluator.withNewEnvironment (package:front_end/src/fasta/kernel/constant_evaluator.dart:5351:18)
[custom_lint] 2025-11-13T18:48:47.718308 #30     ConstantsTransformer.visitClass (package:front_end/src/fasta/kernel/constant_evaluator.dart:508:23)
[custom_lint] 2025-11-13T18:48:47.718308 #31     Class.accept1 (package:kernel/ast.dart:1447:53)
[custom_lint] 2025-11-13T18:48:47.718308 #32     RemovingTransformer.transformOrRemove (package:kernel/visitor.dart:1919:21)
[custom_lint] 2025-11-13T18:48:47.718308 #33     RemovingTransformer.transformList (package:kernel/visitor.dart:2143:19)
[custom_lint] 2025-11-13T18:48:47.718308 #34     RemovingTransformer.transformClassList (package:kernel/visitor.dart:1998:5)
[custom_lint] 2025-11-13T18:48:47.718308 #35     ConstantsTransformer.convertLibrary (package:front_end/src/fasta/kernel/constant_evaluator.dart:460:5)
[custom_lint] 2025-11-13T18:48:47.718308 #36     transformLibraries (package:front_end/src/fasta/kernel/constant_evaluator.dart:112:26)
[custom_lint] 2025-11-13T18:48:47.718308 #37     KernelTarget.runBuildTransformations (package:front_end/src/fasta/kernel/kernel_target.dart:1532:19)
[custom_lint] 2025-11-13T18:48:47.718308 #38     KernelTarget.buildComponent.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:624:7)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #39     withCrashReporting (package:front_end/src/fasta/crash.dart:133:12)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #40     KernelTarget.buildComponent (package:front_end/src/fasta/kernel/kernel_target.dart:574:12)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #41     _buildInternal (package:front_end/src/kernel_generator_impl.dart:210:19)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #42     withCrashReporting (package:front_end/src/fasta/crash.dart:133:12)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #43     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:49:12)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #44     CompilerContext.clear (package:front_end/src/fasta/compiler_context.dart:139:3)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #45     generateKernel (package:front_end/src/kernel_generator_impl.dart:48:10)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #46     kernelForModule (package:front_end/src/api_prototype/kernel_generator.dart:100:11)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #47     SingleShotCompilerWrapper.compileInternal (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/vm/bin/kernel_service.dart:414:11)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #48     Compiler.compile.<anonymous closure> (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/vm/bin/kernel_service.dart:220:45)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308 #49     _processLoadRequest (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/vm/bin/kernel_service.dart:897:37)
[custom_lint] 2025-11-13T18:48:47.718308 <asynchronous suspension>
[custom_lint] 2025-11-13T18:48:47.718308
[custom_lint] 2025-11-13T18:48:47.718308
[custom_lint] 2025-11-13T18:48:47.718308
Failed to start pluginsThe request analysis.setContextRoots failed with the following error:
RequestErrorCode.PLUGIN_ERROR
Bad state: Failed to start the plugins.
at:
#0      SocketCustomLintServerToClientChannel._checkInitializationFail.<anonymous closure> (package:custom_lint/src/v2/server_to_client_channel.dart:223)
<asynchronous suspension>
#1      Future.any.onValue (dart:async/future.dart:616)
<asynchronous suspension>

To Reproduce

Flutter version: 3.35.6
Dart version: 3.9.2

pubspec.yaml

name: test_project
description: "A new Flutter project."
publish_to: "none" 

version: 1.0.0+1

environment:
  sdk: ^3.9.2

dependencies:
  cupertino_icons: ^1.0.8
  flutter:
    sdk: flutter
  flutter_riverpod: ^3.0.3
  riverpod_annotation: ^3.0.3

dev_dependencies:
  build_runner: ^2.7.1
  custom_lint: ^0.8.0
  flutter_lints: ^5.0.0
  flutter_test:
    sdk: flutter
  riverpod_generator: ^3.0.3
  riverpod_lint: ^3.0.3

flutter:
  uses-material-design: true
include: package:flutter_lints/flutter.yaml

analyzer:
  plugins:
    - custom_lint
  
linter:
  rules:

Expected behavior
I would expect to see the same warnings in the VSCode problems tab and editor window that I get running the CLI command.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions