Skip to content

Commit

Permalink
dependencies, protoc regen, analysis, asdf references
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnitschke-wk committed Sep 1, 2023
2 parents b94a375 + 9867fe9 commit 4ac2fcb
Show file tree
Hide file tree
Showing 31 changed files with 1,339 additions and 714 deletions.
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2
updates:
- package-ecosystem: "pub"
directory: "/"
- package-ecosystem: pub
versioning-strategy: increase
directory: /
schedule:
interval: "weekly"
interval: weekly
6 changes: 3 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.18.7
sdk: 3.1.0
- run: dart pub get
- run: dart analyze

Expand All @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.18.7
sdk: 3.1.0
- run: dart pub get
- run: dart format --set-exit-if-changed .

Expand All @@ -30,6 +30,6 @@ jobs:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.18.7
sdk: 3.1.0
- run: dart pub get
- run: dart run dependency_validator
11 changes: 9 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install scip cli
run: |
bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.2.3/scip-linux-amd64.tar.gz"' | tar xzf - scip
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
Expand All @@ -24,15 +24,22 @@ jobs:
- name: pub get scip-dart package
run: dart pub get

- name: pub get snapshots directory
- name: pub get basic-project directory
run: dart pub get
working-directory: ./snapshots/input/basic-project

- name: pub get relationships-project directory
run: dart pub get
working-directory: ./snapshots/input/relationships-project

- name: Snapshots Diff Check
run: |
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
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dart 3.1.0
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "scip-dart",
"request": "launch",
"program": "bin/scip_dart.dart",
"type": "dart",
"args": ["./snapshots/input/staging-project"]
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.sdkPath": "~/.asdf/installs/dart/3.1.0/dart-sdk"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.1.4

- Put the generation of relationships field behind a `--index-relationships` flag which needs to be opted in. This was to continue to work on coverage of relationships support without effecting consumers.
- Fixed issue where the `projectRoot` uri was being calculated incorrectly

## 1.1.3

- generated scip bindings updated to provide relationship fields. This allows for "Go to Implementations" and other class/method inheritance navigation.

## 1.1.2

- added `--version` flag to retrieve the version of scip-dart
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
regen-snapshots:
dart run scip_dart ./snapshots/input/basic-project --verbose
dart run scip_dart ./snapshots/input/basic-project
scip snapshot --to ./snapshots/output/basic-project

dart run scip_dart ./snapshots/input/dart3-features --verbose
scip snapshot --to ./snapshots/output/dart3-features

dart run scip_dart --index-relationships ./snapshots/input/relationships-project
scip snapshot --to ./snapshots/output/relationships-project

run:
dart run scip_dart ./snapshots/input/staging-project --verbose

snap:
scip snapshot --to ./snapshots/output/staging-project
scip snapshot --project-root ./snapshots/input/staging-project --to ./snapshots/output/staging-project

lint:
scip lint ./index.scip

stats:
scip stats

# Requires running `dart pub global acitvate protoc_plugin`
gen-proto:
protoc --dart_out=. ./lib/src/gen/scip.proto

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# scip-dart

Experimental spike on a [scip](https://github.com/sourcegraph/scip) indexer for [dart](https://github.com/dart-lang)
Implementation of a [scip](https://github.com/sourcegraph/scip) indexer for [dart](https://github.com/dart-lang)

Designed to be a replacement for [lsif_indexer](https://github.com/Workiva/lsif_indexer), with better coverage and reliability

Expand Down
4 changes: 2 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include: package:workiva_analysis_options/v2.yaml

analyzer:
strong-mode:
implicit-casts: false
language:
strict-casts: true
exclude:
- snapshots/**
14 changes: 12 additions & 2 deletions bin/scip_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ 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 @@ -22,8 +29,11 @@ Future<void> main(List<String> args) async {
defaultsTo: false,
help: 'Whether or not to display debugging text during indexing',
)
..addFlag('version',
defaultsTo: false, help: 'Display the current version of scip-dart')
..addFlag(
'version',
defaultsTo: false,
help: 'Display the current version of scip-dart',
)
..addMultiOption(
'path',
abbr: 'p',
Expand Down
4 changes: 4 additions & 0 deletions lib/src/flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ 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
Loading

0 comments on commit 4ac2fcb

Please sign in to comment.