Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP Known Issues #2286

Closed
DanTup opened this issue Mar 4, 2020 · 23 comments
Closed

LSP Known Issues #2286

DanTup opened this issue Mar 4, 2020 · 23 comments
Labels
in lsp/analysis server Something to be fixed in the Dart analysis server is discussion / feedback

Comments

@DanTup
Copy link
Member

DanTup commented Mar 4, 2020

When running in LSP mode, the following things are known not to work (or function differently to non-LSP):

@ericdallo
Copy link

ericdallo commented Apr 24, 2020

  • For some reason the widget guides feature is not available.
  • Tests codeLens(Run|Debug) is not available.

@DanTup I'm implementing the Emacs support for dart/flutter on lsp-dart so I'm checking how you did it on this extension and notice the problems above :)

@DanTup
Copy link
Member Author

DanTup commented May 4, 2020

@ericdallo thanks! I've added UI Guides to the list above. CodeLens is supposed to work, though I can see it failing so I've opened #2421 - probably will be an easy fix. Thanks!

@ericdallo
Copy link

ericdallo commented May 4, 2020

I implemented the both features on lsp-dart, so I think it's easy to fix them on the vscode extension :)

@DanTup
Copy link
Member Author

DanTup commented May 5, 2020

@ericdallo actually, the reason my code lens didn't work is that I was using an older Dart SDK that wasn't sending the outline notifications. On the most recent nightly the code lens seem to work fine. Do you know what version you were using when you saw it fail?

@ericdallo
Copy link

Yeah, me too 😅 I was using dart dev 2.8.0-10

@DanTup
Copy link
Member Author

DanTup commented May 5, 2020

Ok great, working as expected then :-) I've fixed up Flutter UI Guides and Gutter icons too.

@ericdallo
Copy link

Nice! just a thing to keep in mind, If the next features could be implemented for LSP too, I could implement it on lsp-dart :)
Thanks!

@DanTup
Copy link
Member Author

DanTup commented May 5, 2020

@ericdallo do you mean specific features, or just in general? Any new features being implemented are very likely to be added to LSP too (some may even only be implemented in LSP) as I'd like to switch Dart-Code over to LSP by default (without losing any significant functionality).

Some of the things mentioned above (like dart.analysisExcludedFolders and dart.doNotFormat) are kinda hacks though, so they might not be carried over (or may be reworked if they are).

@ericdallo
Copy link

Nice, good to know!
That's what I wanted to hear, I was afraid that DAS was the focus for new features, not LSP

@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Jun 1, 2020
@DanTup DanTup modified the milestones: On Deck, Backlog Jul 2, 2020
@Kavantix
Copy link

Kavantix commented Jul 8, 2020

I just tested the lsp preview in vscode and dart-lang/sdk#41195 also happens in vscode.
If you have a file open and add some class to it you cannot auto import it into another file until you close the window or tab the file was opened in.

@Kavantix
Copy link

Kavantix commented Jul 8, 2020

Also, the line length setting for the formatter is ignored

@DanTup
Copy link
Member Author

DanTup commented Jul 13, 2020

@Kavantix

I just tested the lsp preview in vscode and dart-lang/sdk#41195 also happens in vscode.

Do you have steps to repro this in VS Code? I just tried following essentially the same instructions, but it didn't seem to happen. If you can grab an analysis server log while doing so, that may help too.

Also, the line length setting for the formatter is ignored

Thanks! Got a fix for this at https://dart-review.googlesource.com/c/sdk/+/154008.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jul 13, 2020
Noted at Dart-Code/Dart-Code#2286 (comment).

Change-Id: If45bede84a0a4414a16d1809a1aa0f81d18cebfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154008
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
@Kavantix
Copy link

I enabled the log file but it stays empty (other than the versions I am using)
Here is a gif showing the issue:
ezgif com-video-to-gif

@DanTup
Copy link
Member Author

DanTup commented Jul 15, 2020

@Kavantix I reproduced this with Dart 2.8.2 but couldn't reproduce on the current code to try and debug. Could you temporarily try with the latest nightly SDK from http://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/ to see if it still happens for you there?

I enabled the log file but it stays empty (other than the versions I am using)

That doesn't sound right - though VS Code sometimes doesn't update files that are modified correctly unless you close/re-open them - could it be that? Also - can you check you used dart.analyzerLogFile and not dart.analyzerInstrumentationLogFile? Thanks!

@RaviKavaiya
Copy link

Thanks! Got a fix for this at https://dart-review.googlesource.com/c/sdk/+/154008.

@DanTup I am using latest beta version of DartCode in LSP mode. How can I set custom line length?

@Kavantix
Copy link

@DanTup Also happens with the last version:
image

It did however now write some info to the log file
dartlog_import_issue.txt

Btw I was checking the log file using tail -f from the command line ;)

@DanTup
Copy link
Member Author

DanTup commented Jul 18, 2020

@RaviKavaiya

@DanTup I am using latest beta version of DartCode in LSP mode. How can I set custom line length?

This fix is in the server, so you need an updated Dart SDK (such as a nightly from http://gsdview.appspot.com/dart-archive/channels/be/raw/latest/sdk/). It should then use the same dart.lineLength setting that the non-LSP implementation uses.

@Kavantix

@DanTup Also happens with the last version:

Thanks - I also managed to hit this again yesterday in the nightly, so it is still there. I'll do some more digging, thanks!

@RaviKavaiya
Copy link

@DanTup Sorry, I don't know whether I should ask that here. But, Flutter doesn't allow custom Dart SDKs right? If yes, then I would wait for it. (BTW, I am on Flutter Dev channel)

@DanTup
Copy link
Member Author

DanTup commented Jul 18, 2020

@RaviKavaiya correct - for Flutter you need to use the SDK it provides. When you run flutter --version it will show the version of the SDK (eg. Dart 2.9.0 (build 2.9.0-21.0.dev 89fe12b12a)) so once that's higher than the version that includes this change it should work.

@DanTup
Copy link
Member Author

DanTup commented Jul 20, 2020

@Kavantix I got to the bottom of the issue - I've got a fix out for review at https://dart-review.googlesource.com/c/sdk/+/154960/. Thanks!

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jul 20, 2020
Bug: Dart-Code/Dart-Code#2286 (comment)
Change-Id: Ibb49a3b244ca40da5018fd705adffdbe6e0ce880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
@Kavantix
Copy link

@DanTup I can confirm that the fix works, Thanks a lot this will save me quite some headaches using the LSP in vim :)

@DanTup
Copy link
Member Author

DanTup commented Jul 21, 2020

@Kavantix excellent, thanks for confirming!

@DanTup
Copy link
Member Author

DanTup commented Nov 11, 2020

Most of the issue here are resolved. There are a few outstanding which have their own issues (which I've linked in the description above), which I'm hoping to address fairly soon so that LSP can become the default.

If you encounter any other issues not listed, please file new specific issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in lsp/analysis server Something to be fixed in the Dart analysis server is discussion / feedback
Projects
None yet
Development

No branches or pull requests

5 participants
@DanTup @Kavantix @ericdallo @RaviKavaiya and others