diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 20442e1..4c2b5f4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,7 +45,43 @@ jobs: echo "No changes to snapshot files" else echo - echo "Snapshot diff detected differences, run 'make run snap' to re-generate snapshots" + echo "Snapshot diff detected differences, run 'make gen-snaps' to re-generate snapshots" + git status --short ./snapshots/output + echo + exit 1 + fi + + snapshots-diagnostics: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install scip cli + run: | + bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.0/scip-linux-amd64.tar.gz"' | tar xzf - scip + ./scip --version + - uses: dart-lang/setup-dart@v1 + with: + sdk: 2.18.7 + - name: pub get scip-dart package + run: dart pub get + + - name: pub get diagnostics directory + run: dart pub get + working-directory: ./snapshots/input/diagnostics + + - name: Install jq + uses: dcarbone/install-jq-action@v2.0.2 + + - name: Snapshots Diff Check + run: | + make gen-snap_diagnostics + + if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; + then + echo "No changes to snapshot files" + else + echo + echo "Snapshot diff detected differences, run 'make gen-snaps' to re-generate snapshots" git status --short ./snapshots/output echo exit 1 diff --git a/Makefile b/Makefile index a57f6ae..89b3d99 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,21 @@ -regen-snapshots: +gen-snaps: + make gen-snap_basic-project + make gen-snap_relationships-project + make gen-snap_diagnostics + +gen-snap_basic-project: dart run scip_dart ./snapshots/input/basic-project scip snapshot --to ./snapshots/output/basic-project +gen-snap_relationships-project: dart run scip_dart --index-relationships ./snapshots/input/relationships-project scip snapshot --to ./snapshots/output/relationships-project +gen-snap_diagnostics: + dart run scip_dart ./snapshots/input/diagnostics + scip print --json ./index.scip | jq '.documents[].occurrences[] | select(.diagnostics)' | jq -s . > ./snapshots/output/diagnostics/output.json + + run: dart run scip_dart ./snapshots/input/staging-project --verbose diff --git a/lib/src/metadata.dart b/lib/src/metadata.dart index 14b0704..cc9c252 100644 --- a/lib/src/metadata.dart +++ b/lib/src/metadata.dart @@ -1,4 +1,3 @@ -import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/diagnostic/diagnostic.dart'; import 'package:analyzer/error/error.dart'; @@ -39,7 +38,7 @@ class SymbolMetadata { /// within the protobuf schema for scip SymbolMetadata getSymbolMetadata( Element element, - AstNode node, + int offset, List analysisErrors, ) { final displayString = element.getDisplayString( @@ -53,7 +52,7 @@ SymbolMetadata getSymbolMetadata( ); final diagnostics = analysisErrors - .where((error) => error.offset == node.offset) + .where((error) => error.offset == offset) .map((error) => proto.Diagnostic( code: error.errorCode.name, message: error.message, diff --git a/lib/src/scip_visitor.dart b/lib/src/scip_visitor.dart index 01c7f00..959b6a8 100644 --- a/lib/src/scip_visitor.dart +++ b/lib/src/scip_visitor.dart @@ -166,7 +166,7 @@ class ScipVisitor extends GeneralizingAstVisitor { }) { final symbol = _symbolGenerator.symbolFor(element); if (symbol != null) { - final meta = getSymbolMetadata(element, node, _analysisErrors); + final meta = getSymbolMetadata(element, offset, _analysisErrors); occurrences.add(Occurrence( range: _lineInfo.getRange(offset, length), symbol: symbol, @@ -177,7 +177,7 @@ class ScipVisitor extends GeneralizingAstVisitor { if (!globalExternalSymbols.any( (symbolInfo) => symbolInfo.symbol == symbol, )) { - final meta = getSymbolMetadata(element, node, _analysisErrors); + final meta = getSymbolMetadata(element, offset, _analysisErrors); globalExternalSymbols.add(SymbolInformation( symbol: symbol, documentation: meta.documentation, @@ -198,7 +198,8 @@ class ScipVisitor extends GeneralizingAstVisitor { }) { final symbol = _symbolGenerator.symbolFor(element); if (symbol != null) { - final meta = getSymbolMetadata(element, node, _analysisErrors); + final meta = + getSymbolMetadata(element, element.nameOffset, _analysisErrors); symbols.add(SymbolInformation( symbol: symbol, documentation: meta.documentation, diff --git a/pubspec.lock b/pubspec.lock index e06cf1a..240dd79 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,392 +5,448 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: e440ac42679dfc04bbbefb58ed225c994bc7e07fccc8a68ec7d3631a127e5da9 + url: "https://pub.dev" source: hosted version: "54.0.0" analyzer: dependency: "direct main" description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "2c2e3721ee9fb36de92faa060f3480c81b23e904352b087e5c64224b1a044427" + url: "https://pub.dev" source: hosted version: "5.6.0" args: dependency: "direct main" description: name: args - url: "https://pub.dartlang.org" + sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + url: "https://pub.dev" source: hosted version: "2.4.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + url: "https://pub.dev" source: hosted version: "2.3.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169" + url: "https://pub.dev" source: hosted version: "3.1.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95 + url: "https://pub.dev" source: hosted version: "2.2.0" build_runner: dependency: transitive description: name: build_runner - url: "https://pub.dartlang.org" + sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 + url: "https://pub.dev" source: hosted version: "2.3.3" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + url: "https://pub.dev" source: hosted version: "7.2.7" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" source: hosted version: "8.6.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + url: "https://pub.dev" source: hosted version: "2.0.2" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" + url: "https://pub.dev" source: hosted version: "4.4.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted version: "1.18.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" dart_dev: dependency: "direct dev" description: name: dart_dev - url: "https://pub.dartlang.org" + sha256: "4690ea2277e95cc7832dd761e667dc876de32025704db1472a0f1741ae6af38d" + url: "https://pub.dev" source: hosted version: "4.0.2" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "5be16bf1707658e4c03078d4a9b90208ded217fb02c163e207d334082412f2fb" + url: "https://pub.dev" source: hosted version: "2.2.5" dependency_validator: dependency: "direct dev" description: name: dependency_validator - url: "https://pub.dartlang.org" + sha256: f727a5627aa405965fab4aef4f468e50a9b632ba0737fd2f98c932fec6d712b9 + url: "https://pub.dev" source: hosted version: "3.2.3" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" source: hosted version: "1.0.1" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted version: "3.2.0" glob: dependency: "direct dev" description: name: glob - url: "https://pub.dartlang.org" + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + url: "https://pub.dev" source: hosted version: "2.1.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" source: hosted version: "2.3.1" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted version: "4.0.2" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted version: "1.0.4" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + url: "https://pub.dev" source: hosted version: "4.8.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + url: "https://pub.dev" source: hosted version: "1.1.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted version: "0.12.16" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted version: "1.0.4" package_config: dependency: "direct main" description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted version: "2.1.0" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted version: "1.8.3" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted version: "1.5.1" protobuf: dependency: "direct main" description: name: protobuf - url: "https://pub.dartlang.org" + sha256: "01dd9bd0fa02548bf2ceee13545d4a0ec6046459d847b6b061d8a27237108a08" + url: "https://pub.dev" source: hosted version: "2.1.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted version: "2.1.4" pubspec_parse: dependency: "direct main" description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" source: hosted version: "1.2.3" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted version: "1.0.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted version: "0.6.0" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" source: hosted version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted version: "1.3.2" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" source: hosted version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted version: "2.4.0" workiva_analysis_options: dependency: "direct dev" description: name: workiva_analysis_options - url: "https://pub.dartlang.org" + sha256: "428e75a330786b519c87409530c52a1f366731af2cf94fe6da85582889d583bc" + url: "https://pub.dev" source: hosted version: "1.3.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" sdks: diff --git a/snapshots/input/diagnostics/analysis_options.yaml b/snapshots/input/diagnostics/analysis_options.yaml new file mode 100644 index 0000000..7b9c1b0 --- /dev/null +++ b/snapshots/input/diagnostics/analysis_options.yaml @@ -0,0 +1,5 @@ +include: package:lints/recommended.yaml + +linter: + rules: + - avoid_empty_else \ No newline at end of file diff --git a/snapshots/input/diagnostics/lib/main.dart b/snapshots/input/diagnostics/lib/main.dart new file mode 100644 index 0000000..b6753ee --- /dev/null +++ b/snapshots/input/diagnostics/lib/main.dart @@ -0,0 +1,31 @@ +import 'dart:collection'; // unused import + +class _UnusedClass {} + +void _unusedMethod() {} + +String _unusedTopLevelVariable = 'asdf'; + +@Deprecated('This method is deprecated') +void deprecatedMethod() {} + +void deprecatedParam({ + @Deprecated('this param is deprecated') dynamic foobar +}) {} + +void main() { + final unusedVariable = 'asdf'; + + String variableWithUnecssaryDeclaration = 'asdf'; + + // dead_code example + if (true) { } else { + print('This condition is never met!'); + } + + deprecatedMethod(); + deprecatedParam(foobar: 2); +} + +@deprecated +void someDeprecatedFunc() {} \ No newline at end of file diff --git a/snapshots/input/diagnostics/pubspec.lock b/snapshots/input/diagnostics/pubspec.lock new file mode 100644 index 0000000..5727478 --- /dev/null +++ b/snapshots/input/diagnostics/pubspec.lock @@ -0,0 +1,12 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + lints: + dependency: "direct main" + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" +sdks: + dart: ">=2.18.0 <3.0.0" diff --git a/snapshots/input/diagnostics/pubspec.yaml b/snapshots/input/diagnostics/pubspec.yaml new file mode 100644 index 0000000..ce96a96 --- /dev/null +++ b/snapshots/input/diagnostics/pubspec.yaml @@ -0,0 +1,7 @@ +name: dart_test_diagnostics +version: 1.0.0 + +environment: + sdk: ">=2.18.0 <3.0.0" +dependencies: + lints: ^2.0.1 diff --git a/snapshots/output/diagnostics/output.json b/snapshots/output/diagnostics/output.json new file mode 100644 index 0000000..fc58227 --- /dev/null +++ b/snapshots/output/diagnostics/output.json @@ -0,0 +1,118 @@ +[ + { + "range": [ + 2, + 6, + 18 + ], + "symbol": "local 0", + "symbolRoles": 1, + "diagnostics": [ + { + "severity": "Information", + "code": "UNUSED_ELEMENT", + "message": "The declaration '_UnusedClass' isn't referenced." + } + ] + }, + { + "range": [ + 4, + 5, + 18 + ], + "symbol": "local 1", + "symbolRoles": 1, + "diagnostics": [ + { + "severity": "Information", + "code": "UNUSED_ELEMENT", + "message": "The declaration '_unusedMethod' isn't referenced." + } + ] + }, + { + "range": [ + 6, + 7, + 30 + ], + "symbol": "local 2", + "symbolRoles": 1, + "diagnostics": [ + { + "severity": "Information", + "code": "UNUSED_ELEMENT", + "message": "The declaration '_unusedTopLevelVariable' isn't referenced." + } + ] + }, + { + "range": [ + 16, + 8, + 22 + ], + "symbol": "local 3", + "symbolRoles": 1, + "diagnostics": [ + { + "severity": "Information", + "code": "UNUSED_LOCAL_VARIABLE", + "message": "The value of the local variable 'unusedVariable' isn't used." + } + ] + }, + { + "range": [ + 18, + 9, + 41 + ], + "symbol": "local 4", + "symbolRoles": 1, + "diagnostics": [ + { + "severity": "Information", + "code": "UNUSED_LOCAL_VARIABLE", + "message": "The value of the local variable 'variableWithUnecssaryDeclaration' isn't used." + } + ] + }, + { + "range": [ + 25, + 2, + 18 + ], + "symbol": "scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedMethod().", + "diagnostics": [ + { + "severity": "Information", + "code": "DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE", + "message": "'deprecatedMethod' is deprecated and shouldn't be used. This method is deprecated.", + "tags": [ + "Deprecated" + ] + } + ] + }, + { + "range": [ + 26, + 18, + 24 + ], + "symbol": "scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam().(foobar)", + "diagnostics": [ + { + "severity": "Information", + "code": "DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE", + "message": "'foobar' is deprecated and shouldn't be used. this param is deprecated.", + "tags": [ + "Deprecated" + ] + } + ] + } +]