Skip to content

Commit

Permalink
default index-relationships to true
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnitschke-wk committed Nov 9, 2023
1 parent f8305b7 commit c2021be
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 34 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 5 additions & 7 deletions bin/scip_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ import 'package:scip_dart/src/version.dart';

Future<void> main(List<String> 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'],
Expand All @@ -34,6 +28,10 @@ Future<void> main(List<String> 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',
Expand Down
4 changes: 0 additions & 4 deletions lib/src/flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions lib/src/scip_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -67,10 +66,7 @@ class ScipVisitor extends GeneralizingAstVisitor {

final element = node.declaredElement!;

List<Relationship>? relationships;
if (Flags.instance.indexRelationships) {
relationships = relationshipsFor(node, element, _symbolGenerator);
}
final relationships = relationshipsFor(node, element, _symbolGenerator);

_registerAsDefinition(
element,
Expand Down
5 changes: 0 additions & 5 deletions snapshots/input/relationships-project/pubspec.lock

This file was deleted.

5 changes: 0 additions & 5 deletions snapshots/input/relationships-project/pubspec.yaml

This file was deleted.

0 comments on commit c2021be

Please sign in to comment.