Why am I getting UNKNOWN_SOURCE here with the analysis server?

22 views
Skip to first unread message

Ryan Gonzalez

unread,
Oct 23, 2017, 12:43:12 PM10/23/17
to misc
e.g. :

ryan@DevPC-LX2 ~ $ rlwrap dart
/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot
{"event":"server.connected","params":{"version":"1.18.0","pid":20025,"sessionId":""}}
{"id": "1", "method": "analysis.updateContent", "params": {"files":
{"/tst.dart": {"type": "add", "content": "void main() => int."}}}}
{"id":"1","result":{}}
{"id": "2", "method": "completion.getSuggestions", "params": {"file":
"/tst.dart", "offset": 19}}
{"id":"2","error":{"code":"UNKNOWN_SOURCE","message":"Unknown source"}}


Why the UNKNOWN_SOURCE error? I already added the file using
analysis.updateContent...what am I missing here?

--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/

Bob Nystrom

unread,
Oct 23, 2017, 12:45:47 PM10/23/17
to General Dart Discussion, Brian Wilkerson
+brian, who might know the answer.

– bob

--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.


Brian Wilkerson

unread,
Oct 23, 2017, 1:22:17 PM10/23/17
to Bob Nystrom, General Dart Discussion
Ryan,

The `analysis.updateContent` request doesn't make the updated file part of what's being analyzed. You need to first tell server which files it should be analyzing by using the `analysis.setAnalysisRoots` request.

I'm happy to answer additional questions, expand on the above, and especially to hear more about what you're using server for, but the mailing list 'analyzer...@dartlang.org' would be a more appropriate forum.

Brian
Reply all
Reply to author
Forward
0 new messages