You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've also pushed a change here that adds a preview flag "dart.previewDtdLspIntegration": true that will call that method to establish this connection. To enable this without a flag in future we'll need to make some further server changes (to advertise that this is available), but we should have more testing before doing that.
When using Dart-Code and an SDK with those changes, you can see the LSP request registered over DTD (you need to streamListen for Service for ServiceRegistered and Lsp if you want the initialized event):
[2:49:11 PM] [DartToolingDaemon] [Info] ==> {"id":"1234","jsonrpc":"2.0","method":"Lsp.textDocument/hover","params":{"position":{"line":1,"character":2},"textDocument":{"uri":"file:///C:/Dev/Dart-Code/Dart-Code/src/test/test_projects/hello_world/lib/deferred_script.dart"}}}
[2:49:12 PM] [DartToolingDaemon] [Info] <== {"jsonrpc":"2.0","result":{"type":"Hover","result":{"contents":{"kind":"markdown","value":"```dart\nvoid print(Object? object)\n```\nType: `void Function(Object?)`\n\n*dart:core*\n\n---\nPrints an object to the console.\n\nOn the web, `object` is converted to a string and that string is output to\nthe web console using `console.log`.\n\nOn native (non-Web) platforms, `object` is converted to a string and that\nstring is terminated by a line feed (`'\\n'`, U+000A) and written to\n`stdout`. On Windows, the terminating line feed, and any line feeds in the\nstring representation of `object`, are output using the Windows line\nterminator sequence of (`'\\r\\n'`, U+000D + U+000A).\n\nCalls to `print` can be intercepted by [Zone.print]."},"range":{"end":{"character":7,"line":1},"start":{"character":2,"line":1}}}},"id":"1234"}
There's still more to do (such as scheduling in the server, and figuring out how client capabilities should be handled), but it's hopefully near a point that other development can be started against it (using the preview flags).
The work for passing the DTD URI to the analysis server (and for it to connect) is done, but we're still behind a flag here because there's not been a huge amount of testing. I suggest we keep it behind the flag while the property editor work is done and then switch to gating on an SDK version where the property editor APIs are in a place we're happy with.
Activity
DanTup commentedon Aug 21, 2024
I have a change open at https://dart-review.googlesource.com/c/sdk/+/379303 that allows the server to accept a DTD URI and connect to it, exposing the shared LSP handlers.
I've also pushed a change here that adds a preview flag
"dart.previewDtdLspIntegration": truethat will call that method to establish this connection. To enable this without a flag in future we'll need to make some further server changes (to advertise that this is available), but we should have more testing before doing that.When using Dart-Code and an SDK with those changes, you can see the LSP request registered over DTD (you need to
streamListenforServiceforServiceRegisteredandLspif you want theinitializedevent):You can then call these methods over DTD:
There's still more to do (such as scheduling in the server, and figuring out how client capabilities should be handled), but it's hopefully near a point that other development can be started against it (using the preview flags).
Add support for providing the DTD URI to the analysis server
Add some basic test that the LSP server appeared in DTD
Add support for providing the DTD URI to the analysis server
5 remaining items
DanTup commentedon Oct 28, 2024
The work for passing the DTD URI to the analysis server (and for it to connect) is done, but we're still behind a flag here because there's not been a huge amount of testing. I suggest we keep it behind the flag while the property editor work is done and then switch to gating on an SDK version where the property editor APIs are in a place we're happy with.
Remove the LSP DTD preview flag and use >= Dart 3.8