diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4c2b5f4..f52c1b7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,9 +37,6 @@ jobs: dart run scip_dart ./snapshots/input/basic-project ./scip snapshot --to ./snapshots/output/basic-project - dart run scip_dart --index-relationships ./snapshots/input/relationships-project - ./scip snapshot --to ./snapshots/output/relationships-project - if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; then echo "No changes to snapshot files" diff --git a/Makefile b/Makefile index 89b3d99..4e35121 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,10 @@ 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/bin/scip_dart.dart b/bin/scip_dart.dart index 189546a..d49b701 100644 --- a/bin/scip_dart.dart +++ b/bin/scip_dart.dart @@ -10,13 +10,6 @@ import 'package:scip_dart/src/version.dart'; Future main(List args) async { final result = (ArgParser() - ..addFlag( - 'index-relationships', - defaultsTo: false, - help: 'Whether or not to index symbol relationships. ' - 'This functionality is currently in alpha, and should not be ' - 'considered stable and accurate.', - ) ..addFlag( 'performance', aliases: ['perf'], @@ -34,6 +27,10 @@ Future main(List args) async { defaultsTo: false, help: 'Display the current version of scip-dart', ) + ..addFlag( + 'index-relationships', + help: 'DEPRECATED, has no effect on executed code', + ) ..addMultiOption( 'path', abbr: 'p', diff --git a/lib/src/flags.dart b/lib/src/flags.dart index 3d66017..cc1a7d6 100644 --- a/lib/src/flags.dart +++ b/lib/src/flags.dart @@ -7,13 +7,9 @@ class Flags { bool get performance => _performance; bool _performance = false; - bool get indexRelationships => _indexRelationships; - bool _indexRelationships = false; - void init(ArgResults results) { _verbose = results['verbose'] as bool? ?? false; _performance = results['performance'] as bool? ?? false; - _indexRelationships = results['index-relationships'] as bool? ?? false; } static Flags get instance => _instance; diff --git a/lib/src/scip_visitor.dart b/lib/src/scip_visitor.dart index 959b6a8..49c35f2 100644 --- a/lib/src/scip_visitor.dart +++ b/lib/src/scip_visitor.dart @@ -5,7 +5,6 @@ import 'package:analyzer/error/error.dart'; import 'package:analyzer/source/line_info.dart'; import 'package:package_config/package_config.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; -import 'package:scip_dart/src/flags.dart'; import 'package:scip_dart/src/metadata.dart'; import 'package:scip_dart/src/gen/scip.pb.dart'; import 'package:scip_dart/src/relationship_generator.dart'; @@ -67,10 +66,7 @@ class ScipVisitor extends GeneralizingAstVisitor { final element = node.declaredElement!; - List? relationships; - if (Flags.instance.indexRelationships) { - relationships = relationshipsFor(node, element, _symbolGenerator); - } + final relationships = relationshipsFor(node, element, _symbolGenerator); _registerAsDefinition( element, diff --git a/snapshots/input/relationships-project/lib/main.dart b/snapshots/input/basic-project/lib/relationships.dart similarity index 100% rename from snapshots/input/relationships-project/lib/main.dart rename to snapshots/input/basic-project/lib/relationships.dart diff --git a/snapshots/input/relationships-project/pubspec.lock b/snapshots/input/relationships-project/pubspec.lock deleted file mode 100644 index 89b205e..0000000 --- a/snapshots/input/relationships-project/pubspec.lock +++ /dev/null @@ -1,5 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: {} -sdks: - dart: ">=2.18.0 <3.0.0" diff --git a/snapshots/input/relationships-project/pubspec.yaml b/snapshots/input/relationships-project/pubspec.yaml deleted file mode 100644 index e565a0b..0000000 --- a/snapshots/input/relationships-project/pubspec.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: dart_test -version: 1.0.0 - -environment: - sdk: ">=2.18.0 <3.0.0" \ No newline at end of file