Discussion:
[dart-misc] Why am I getting UNKNOWN_SOURCE here with the analysis server?
Ryan Gonzalez
2017-10-23 16:42:49 UTC
Permalink
e.g. :

***@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/
--
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+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2017-10-23 16:45:11 UTC
Permalink
+brian, who might know the answer.

– bob
Post by Ryan Gonzalez
/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot
{"event":"server.connected","params":{"version":"1.18.0","
pid":20025,"sessionId":""}}
{"/tst.dart": {"type": "add", "content": "void main() => int."}}}}
{"id":"1","result":{}}
"/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/
--
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
--
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+***@dartlang.org.
'Brian Wilkerson' via Dart Misc
2017-10-23 17:22:12 UTC
Permalink
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
<https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html#request_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
Post by 'Bob Nystrom' via Dart Misc
+brian, who might know the answer.
– bob
Post by Ryan Gonzalez
/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot
{"event":"server.connected","params":{"version":"1.18.0","pi
d":20025,"sessionId":""}}
{"/tst.dart": {"type": "add", "content": "void main() => int."}}}}
{"id":"1","result":{}}
"/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/
--
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
--
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+***@dartlang.org.
Loading...