Open dickermoshe opened 1 month ago
@simolus3
See how I setup the tests. Lmk if you have a better way of setting them up.
Also, Some of the async code is copied from the dart sdk, I don't know how this affects licensing.
Right now warnings in manager generation are not reported in the resolver, so the linter can't use them
The warning I'm focusing on are duplicate reverse names e.g.
class User extends Table {
late final group = integer().references(Group, #id)
late final supergroup = integer().references(Group, #id)
}
class Group extends Table {
// `userRefs` has 2 relations!!!
}
How would I go about this?
I add a warning level to DriftAnalysisError
to show orange squiggles instead of red for less severe errors
Right now warnings in manager generation are not reported in the resolver, so the linter can't use them
Ideally, these warnings should be discovered in the analysis step instead of during code generation. I know that some of them are easier to report during codegen, is it a lot of work to port them over to something that could run in FileAnalyzer
? The parts under if (element is BaseDriftAccessor)
should have the same information available to them as the generator, especially in the end when all transitive tables have been added). I can also get started on this to set up the basic infrastructure for those warnings if that works for you.
Yeah, could you please do that? I tried myself, but after an hour I gave up.
@simolus3 Any update on this. Just need you to write some scaffolding where to do these analysis.
In FileAnalyzer I don't have access to the base element to report the error
Dunno what happened to the old PR. I think the VScode Github Plugin must've closed it. Anyway, here's it as a new PR
createReturning
with ignore mode