Commit Graph

3173 Commits

Author SHA1 Message Date
Paul Berry c6e2497569 Migration: capture more exception information and make it easier to examine stack traces.
Change-Id: If509121fcf2b1f9b9e0a7bf722945241b90c647b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-20 15:20:00 +00:00
Brian Wilkerson ed69e2dc35 Add a hint if extension methods are used with an sdk version constraint that does not support them
Also clean up some tests that were not correctly awaiting futures.

Change-Id: I646e24ec81edc3f2129ae8bacee5e0a0d0873981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113272
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-19 17:44:52 +00:00
lambdabaa c7ea359627 Check for null tokens while walking backward from cursor
ML completion will start at the cursor token and walk backwards
along the token linked list until it's read some n tokens or
finds an EOF character. In some cases, there are null tokens which
we should treat as terminal when constructing model queries as well.

Bug: https://github.com/dart-lang/sdk/issues/37878
Change-Id: Id840d519f5cf1093a63881ee6cd41cde61dbc0fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113285
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-08-18 02:02:23 +00:00
Brian Wilkerson b40b301564 Add more extension completion tests and fix a bug they uncovered
Change-Id: I3e89eed886e3100e2d1942e38b124f99bebd6b3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113385
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-16 19:39:45 +00:00
Konstantin Shcheglov c6a6220bfc Stop using LocalElement.visibleRange in refactorings.
I want to get rid of it altogether.

R=brianwilkerson@google.com

Change-Id: Ia6158e21adf0a614b2bf5ffaec168a51c328ed4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-16 17:54:09 +00:00
Konstantin Shcheglov 8280a31ef0 Fix CREATE_LOCAL_VARIABLE for function typed variable.
R=brianwilkerson@google.com

Change-Id: If9ecaa595e36ec8f3c9ff112acb235a03372248b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-16 17:49:15 +00:00
Konstantin Shcheglov a29261b553 Change MoveFileRefactoringImpl to use (already computed) resolved units.
R=brianwilkerson@google.com

Change-Id: I667d04c2cd6ff52d4c1527b147eefccd9f95949b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-16 17:46:03 +00:00
Brian Wilkerson ba5c2a16bd Support completion of extension members
Change-Id: I78a59216add7ea612d77bae0d3e52a0185a682e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-16 14:30:37 +00:00
Ari Aye 8d1dc8c99b Add a cli flag to enable ML code completion using the default SDK path
This will make it easier for beta testers to enable ML ranking for
code completion. Setting the --completion-model flag explicitly will
still work but there will also be a shorthand --enable-completion-model
which is equivalent to --completion-model=/path/to/dart-sdk/model/lexeme.

I tested this manually through IntelliJ.

Change-Id: Icd445e233f1eddec29d025769279dc03979cdb79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113127
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-14 23:09:42 +00:00
Ari Aye 28e857bbf5 Use a small pool of code completion model isolates
This change makes it so that model can parallelize load over
a handful of isolates when a user is typing very quickly
instead of relying on a single isolate. I played around with
this manually while looking at the diagnostics graphs and found
that model response latency grows with consecutive requests using
a single isolate. Four isolates kept latency constant even as I
typed very quickly.

Change-Id: Id03afc67cb7d6a9e13605393a8658835bd88e4b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-14 13:29:17 +00:00
Ari Aye 6c46a93361 Check whether completion has been aborted before making model request or blocking on response
Change-Id: If24e1024de1d23c3489f9b5920af90cced5c1c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112936
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-14 01:39:03 +00:00
Konstantin Shcheglov 9776e3699f Tests and fixes for searching extensions and extension members.
R=brianwilkerson@google.com

Change-Id: I6fda5fd473f9a215d29024eb315af702a11bce42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112931
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-14 01:36:46 +00:00
Konstantin Shcheglov 37a483ef78 Set incorrectly referenced static element, and test CHANGE_TO_STATIC_ACCESS.
R=brianwilkerson@google.com

Change-Id: I8d479ccd17fc3f6429d7fa17bc4e78955194095d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112935
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-14 00:33:06 +00:00
Ari Aye fd10fa1b1d Defend against null includedSuggestionRelevanceTags
Bug: https://github.com/dart-lang/sdk/issues/37841
Change-Id: I967352999341f453b13de887c3b8c759033e04c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112927
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-13 21:32:06 +00:00
Ari Aye 3cc20cd185 Remove quotes from suggestions coming out of model when completion is requested inside of quotes
There's an issue right now where accepting string literal model completions inside of quotes
will produce duplicate quotes.

Bug: https://github.com/dart-lang/sdk/issues/37820
Change-Id: I7c2f280c8050bd583c4ab49bf97f86fec3df6d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112749
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-13 18:54:40 +00:00
Brian Wilkerson e86ce41bcf Rename a hint code to be consistent with similar codes
Change-Id: I916c97c2e3ef34f2cf8d613b2b192dcde96c87e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-12 16:29:05 +00:00
Ari Aye 81569e5fe3 Ignore ErrorToken when locating previous n tokens for completion ranking
Bug: https://github.com/dart-lang/sdk/issues/37798
Change-Id: I65b2b57d874ccf8e748841f3d0742e883a91ec46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112702
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-12 16:20:25 +00:00
Ari Aye 6d2902576b Emit a server.error event if we fail to start the completion model isolate
Change-Id: Ibcdd4478b7717cf10534d63d94800baa88cc3c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112408
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-09 14:41:02 +00:00
lambdabaa d19a590687 Extract the lexeme from included suggestion tags when correlating with model results
Make sure that we're comparing model lexeme to analyzer lexeme since https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart#L226.

Change-Id: I01d93623fb09ecc169be92674b58a91ef0bf56ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112263
Commit-Queue: Ari Aye <ariaye@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-07 20:40:55 +00:00
Danny Tuppeny 31cd2bd75a Ensure LSP completion filterText doesn't include '()' or '(…)'
Change-Id: I01c380ee3a36dbdd15706cb55b108899cacd9fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112249
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-08-07 15:25:40 +00:00
Ari Aye 0b349e8c0a Compensate classic suggestions rather than penalizing cached ones
After a bit of manual testing it seems that subtracting 9 from
the relevanceBoost values given to the included suggestion tags
is overpenalizing them for any base suggestion set relevance
they might be holding on the client. We can compensate instead
by adding a medium size base relevance for classic completion
suggestions. The intention here is to make it so that neither
suggestion kind is universally preferred over the other for
ranking.

Change-Id: Ibaacbb35fc56c269271339df08d85b82fe6b6284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112150
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-08-07 01:19:37 +00:00
Konstantin Shcheglov a62de52d04 Insert new named arguments before 'child' or 'children'.
R=brianwilkerson@google.com

Change-Id: Idbe5bb7efbeaa81a8f2319fab929944e7b3492d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112027
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-06 01:31:27 +00:00
Ari Aye 211d7f2993 Do not throw away analysis server suggestions when inside quotes
Although analysis server does not suggest literals in general,
there are specific cases like import uris where it will make
suggestions.

Change-Id: I72cba31617adffdd4d7327d1963d115fbadf0bc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112025
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-05 23:38:29 +00:00
danrubel 8b2993568e implement dartfix --pedantic
This CL adds a new --pedantic option to dartfix for applying all fixes
marked as pedantic. In addition, this addresses comments in
https://dart-review.googlesource.com/c/sdk/+/111840

Change-Id: Ia2e7a792911f19edb698c126c8fd77cd8f8f77cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111981
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-05 20:18:05 +00:00
danrubel 1c5911982e add includePedanticFixes flag to dartfix protocol
Change-Id: I43c40eacf038beed6245ec873e746dcbb1ed80df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-05 20:18:05 +00:00
Konstantin Shcheglov cdf6103b38 Support for free-form 'expression' in FlutterWidgetPropertyValue.
Also add ENUM_LIKE property editor, that is like ENUM, but allows
such free-form expressions.

R=brianwilkerson@google.com

Change-Id: I3910b6bea98110c192b6cc9fb716b73270e1d97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111985
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-05 18:43:29 +00:00
Danny Tuppeny 3011ca2da7 Include "import function" fixes for UNDEFINED_IDENTIFIER
Change-Id: I66ad76e82f419ed19ca8e47574d1ec8335571bd5
Bug: https://github.com/Dart-Code/Dart-Code/issues/1898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111738
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-08-05 16:27:07 +00:00
Konstantin Shcheglov be581f69db Move search.getDeclarations to available declarations.
So, we keep this feature working when switch to summary2.
IntelliJ does not use it though.

Change-Id: I11f71443dc7354de8a593442de470fa91aa228e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111870
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-03 15:10:06 +00:00
pq ed2764d055 remove unused import
Change-Id: I59a1d2ba11baed58ce60517c2c402f811eabd8f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-08-02 16:33:21 +00:00
Brian Wilkerson f8f77eb4c0 Add keyword completion suggestions
Change-Id: I2ec6de7a68397aa9e43b155db52c5473e3d7035d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111667
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-02 15:09:01 +00:00
Mike Fairhurst c0f23ce8bc [nnbd_migration] fix kind -> description, drop empty, tests
Change-Id: I7224167ae26344336f665827b145c57319076d73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111382
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-08-02 07:35:41 +00:00
danrubel fc5b4e3cef Rework dartfix lint fixes to remove race condition
This refactors the way that dartfix finds lints to fix to be based on
error codes rather than manually running the lints. This prevents
a race condition that occurs between calling setAnalysisRoots and
requesting fixes.

Fix https://github.com/dart-lang/sdk/issues/37558

Change-Id: I35817a9b152a28db9e78662a5ea5096f275f68bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-02 02:04:57 +00:00
Konstantin Shcheglov 42e978ca54 Fix Windows bot.
Change-Id: I4a92643e2007818555c96cd782c7ef9b6b17c42d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111670
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-01 21:31:32 +00:00
Brian Wilkerson 86bdb3e3fa Clean up some warnings in analysis server code
This also sorts the content of these files. The analyzer team uses the Sort Members function on all of the source code in our packages.

Change-Id: Id0700954aefe63f6c7d2e43df021997f95ad7e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111663
Reviewed-by: Ari Aye <ariaye@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-08-01 21:24:00 +00:00
Konstantin Shcheglov 6123dbdae5 Support for extensions in available declarations.
R=brianwilkerson@google.com

Change-Id: Id173e18fb7e7167cae6677318cc6fca68889c8ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-01 02:26:22 +00:00
Konstantin Shcheglov 6a4d805df4 Implement 'Import Library' quick fix using DeclarationsTracker.
This reverts commit 143e5ef556.

Change-Id: I3c575ff690fd8c8d93a90e50a451a6ec993c4164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111305
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-31 22:14:21 +00:00
danrubel 3f22f1f5df do not include double-to-int fix by default
This changes the default fixes applied by dartfix so that it no longer
converts doubles to ints by default. The fix can still be applied
by specifying '--fix double-to-int' on the command line.

Change-Id: I751a42a9c6ae6589259e0b7ac5c769fd4efc4313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-07-30 18:05:50 +00:00
danrubel 8dc24d0919 report dartfix error for unknown fix
Change-Id: I0ebc73423d46ad5c07f4755847fe2ec68020428f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-30 18:05:50 +00:00
lambdabaa 33ce54e45d Don't try to start ML completion isolate on 32 bit systems
Instead of asking tflite_native to try to load a 32 bit dynamic library only to have it notice that none exist, we can simply disable ML ranking in analysis server.

Change-Id: Ibd001430d3e37f2fe854c72ef9f3f5466c96f46e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-07-30 15:03:47 +00:00
Ari Aye db796d5b96 Fix for bad handling of predict response from model isolate
I also went ahead and updated the CIPD dart/language_model version to the latest model version.

Change-Id: I4522209150a90acfba210885316e78381c2aee45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-07-29 20:41:35 +00:00
Konstantin Shcheglov 1a0fe21fb2 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
This reverts commit b8614ca613.

Change-Id: Ic31ee323b21311d8a89f50bcb533316eb55f75e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110941
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-07-29 19:02:24 +00:00
lambdabaa fc82ed2286 Isolate-based CompletionRanking
Screenshots: https://i.imgur.com/IOLKOCU.png, https://i.imgur.com/dM9VsNr.png

Change-Id: Ieae0f9066b7a349bb4adff6b327b67bcae49aab2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-29 13:45:23 +00:00
Konstantin Shcheglov ec5bf35152 Update analysis_server and analyzer_plugin to stop using DartType.isSubtypeOf().
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If7365bd82b97bd692af9508697307976ea7c69e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110881
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-29 00:19:37 +00:00
Paul Berry b8614ca613 Revert InheritanceManager3 changes.
These changes were inadvertenly rolled out in a way that breaks
clients, so we need to stage them out more gradually.  See discussion
at
https://dart-review.googlesource.com/c/sdk/+/110552/2/pkg/analyzer/lib/src/generated/resolver.dart#3768

This reverts commit 5b5ddeda92.
This reverts commit e76879acc4.
This reverts commit 27bec56744.

Change-Id: Ic80a577b1cdc4a6c89ca06afceae01af6621d3e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110841
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-07-28 13:54:09 +00:00
Brian Wilkerson e57b7f2101 Update member sorter to sort extensions
Change-Id: I710123e389adfdd5191ff7538be17982d8f3630c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110767
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-27 14:06:30 +00:00
Devon Carew 4c34d5825b [analyzer] change listPostfixCompletionTemplates to not be async
Change-Id: I8a1ae029fde59a5bb8242c0578ebc44f40bae9dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110749
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-07-26 21:43:31 +00:00
Konstantin Shcheglov e76879acc4 Add 'inheritanceManager' to LinterContext.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I3cb4061afe1d2330494ac90c961e26c468eb5c51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-26 21:35:26 +00:00
Konstantin Shcheglov 27bec56744 Add ExecutableElement(s) based InheritanceManager3, and switch analyzer to it.
Initial: 5d6bab4ed2.
Reverted: 39afa4e555
Change-Id: If611f96e6b0156ec218831dd64305e6ccf02e312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110552
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-26 16:16:11 +00:00
Ari Aye 5d5a0c0164 Check in token-level language model via tflite ffi
Local test run after running `gclient sync`:

ariaye@ariaye1:~/sdk/sdk$ dart pkg/analysis_server/test/services/completion/dart/language_model_test.dart
00:00 +0: calculates lookback
INFO: Initialized TensorFlow Lite runtime.
00:00 +1: predict with defaults
00:01 +2: predict with confidence scores
00:03 +3: predict when no previous tokens
00:04 +4: All tests passed!


Change-Id: I4181bea09cf8fec74d03bba4f83cd26dac818f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-07-25 18:39:51 +00:00
Ari Aye 939cce78b9 Create analysis server flag --completion-model
This flag will take a path to a folder where completion language model
files can be located. Omitting this flag will signal to analysis server
that it should not use ML ranking for code completion, and the plan is
for this capability to initially be opt-in / disabled by default.

Change-Id: Ied18cd1e378c11607778fc116a7e0c3d72091e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Ari Aye <ariaye@google.com>
2019-07-24 23:15:39 +00:00