Hi everyone -
Is there a particular URI format that can be used to encode Dart declaration locations? (bonus points if there's a public utility for creating / validating it)
I'm creating a package that creates JSON Schemas from Dart declarations, and want to know the best way to calculate Ref URIs.
I assumed that such a URI would encode the type of the declaration within it (e.g. `MyClass::staticMember` vs. `MyClass.instanceMember`), but when using the analyzer's `element.location.encoding` property, it not only doesn't differentiate, but I actually found it to leave ambiguity, like in the following snippet:
```dart
class MyClass {
MyClass();
factory MyClass.foo() => MyClass(); // my_class.dart;MyClass;foo
String get foo => 'foo'; // my_class.dart;MyClass;foo
}
```
I have the following assumptions about what a "good URI" would be for a Dart declaration, and wondering the team's thoughts / if there's anything else I may be missing:
- URIs should be resolved to either `dart` or `package` URIs (relative paths should be converted to `package`
- this would mean that non `lib` declarations would not be supported, which seems desirable
- declarations should be locatable from just the URI (i.e. without need of a "x-dart-type" property of the schema) - 0 disambiguation
Thanks so much in advance!