theniceboy / coc-flutter-tools

Rich Flutter development experience for (Neo)vim
64 stars 5 forks source link

Error message after hot-reload #1

Closed unknowledgeable closed 4 years ago

unknowledgeable commented 4 years ago

Describe the bug

Not sure what this means so not sure if it's a problem with the coc-extension or my dart config or even a problem at all but I've had this message pop up a in the DevLog few times after writing my buffer:

Performing hot reload...
Reloaded 1 of 513 libraries in 133ms.
[VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port

To Reproduce

not 100% on this and can't reproduce all the time but last time I was just testing and did:

  1. flutter create
  2. CocList command > flutter.run
  3. CocList command > flutter.dev.openProfiler (Woop woop DevTools yeah baby 🤟)
  4. Edit lib/main.dart
  5. :w
  6. CocList command > flutter.dev.openDevLog
  7. see error after latest hot reload, sometimes twice between reloads

Expected behavior

no error

Desktop (please complete the following information):

Output channel:

  1. Set "flutter.trace.server": "verbose"
  2. Reproduce the issue
  3. :CocList output open output list and select flutter

Log:

I did the above and the output is over 18k lines so not sure if that's what you really want!

theniceboy commented 4 years ago

Right now I’m getting devtools from port 9100, can you try flutter pub global run devtools and see what port is it actually running on please? Thanks!

unknowledgeable commented 4 years ago

I initially had:

No active package devtools.
pub finished with exit code 65

So I looked around and ran:

flutter pub global activate devtools

I got a message that I should add this to my $PATH

$HOME/Developer/flutter/.pub-cache/bin

It's saying it's at port 9100

I'm a bit lost now though as I've now got both of these in my $PATH:

$HOME/Developer/flutter/bin $HOME/Developer/flutter/.pub-cache/bin

Is that how it should be setup? How was devtools working before? Sorry if it's off topic but I'm starting to feel like I've got no idea what I'm doing!

theniceboy commented 4 years ago

So I looked around and ran:

flutter pub global activate devtools

Good call, I should actually add that to README.

When you run the CocCommand openProfiler that opens devtools, did devtools actually get opened? If your devtools was opened, then your PATH should be configured correctly

I'm looking into the [VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port issue.

theniceboy commented 4 years ago

Based on this issue, I think the [VERBOSE-2:profiler_metrics_ios.mm(184)] error is not an issue that this extension caused but rather an issue that Flutter 1.20 has brought. Although I can't reproduce this issue on my end, I think that by setting "flutter.trace.server" to off might suppress the error message that you were seeing. Please let me know if that has any effect @unknowledgeable

My configuration:

unknowledgeable commented 4 years ago

When you run the CocCommand openProfiler that opens devtools, did devtools actually get opened? If your devtools was opened, then your PATH should be configured correctly.

Yeah and that's why I'm confused, do I have two versions of devtools in different places now that I ran flutter pub global activate devtools? Thanks for your help on this though, I'll do some more digging around instead of bothering you about it.

I think that by setting "flutter.trace.server" to off might suppress the error message that you were seeing. Please let me know if that has any effect

Thanks @theniceboy, I'll report back if I see it again. Anything to be wary of by setting it to off or is that safe to leave off?

theniceboy commented 4 years ago

@unknowledgeable I think that your devtools might have stopped working because you updated flutter (so that you had to re-activate it). Please let me know if you have any more difficulties on that.

About the ”flutter.trace.server” setting, I’ve actually never really look into what this setting really does, because I thought that it’s for debugging the coc-flutter extension itself. I’ve always had it off and it’s off by default. So I think it’s safe to leave it off. I’ll look into the code and get back to you on what does the setting actually do.

theniceboy commented 4 years ago

@unknowledgeable I've checked the code and I've deleted this option from readme. flutter.trace.server controls how much log that this extension produces. It's used to debug this extension.

Btw I've added a feature to this extension. You can try it out with :CocCommand flutter.outline!

unknowledgeable commented 4 years ago

Great thanks for letting me know, I haven't had much time to test so apologies for not closing the issue yet.

Btw I've added a feature to this extension. You can try it out with :CocCommand flutter.outline!

OH DAMN!! That's cool as hell! This thing's on track to becomming a full blown Flutter IDE! Great work!

Here are a couple of things I noticed that you might want to think about, I'll post screenshots too in case there are things you notice that aren't behaving as you'd expect:

Screenshot 2020-08-13 at 12 14 45 Screenshot 2020-08-13 at 12 13 35

Loving the work you're putting in to this, I hope my feedback is useful!

theniceboy commented 4 years ago

@unknowledgeable Hey thank you so much!!! I really appreciate your feedback and it’s super helpful! I’ve added the CocCommand description, and fixed the line number issue (classic off by one lol). More importantly I made it so that the outline window will close when it becomes the last window in the current tab page. I used coc notifications instead of autocmds because coc notifications are remote thus won’t affect your vim’s performance. I also made the out line buffer invisible. Either way, thank you so much for the helpful feedback! Thanks to you this extension has become more useful to me as well!

unknowledgeable commented 4 years ago

Nice! I'm glad I'm helping in the small way I can!

Another couple of things:

I currently have this setup:

let g:airline_filetype_overrides = {
      \ 'defx':  ['defx', '%{b:defx.paths[0]}'],
      \ 'gundo': [ 'Gundo', '' ],
      \ 'help':  [ 'Help', '%f' ],
      \ 'minibufexpl': [ 'MiniBufExplorer', '' ],
      \ 'nerdtree': [ get(g:, 'NERDTreeStatusline', 'NERD'), '' ],
      \ 'startify': [ 'Startify', '' ],
      \ 'coc-explorer': ['Explorer',''],
      \ }

I did :echo &filetype to be able to modify the coc-explorer airline bar but when I do :echo &filetype on the widget tree I get nothing back. Is that something that's possible to do or should I just get back to work and stop faffing?

theniceboy commented 4 years ago

Currently, I'm only counting windows in the current tab page when your cursor goes to the outline buffer. When the count is 1, I close the outline window. I'll try to implement window filtering in the future to exclude windows such as coc-explorer, nerdtree when counting. I do have to do some research on how to reliably exclude them tho.

I added a filetype to the outline window. Now flutter outline buffers should have the filetype flutterOutline. Enjoy~

unknowledgeable commented 4 years ago

Ok I've worked on a project for long enough now and haven't seen the error of the original topic here so I'll close this. I've got a few other bits about the flutterOutline that I'll open in a new issue. Thanks!

theniceboy commented 4 years ago

Awesome! Thanks! Please do a :CocUpdate. There are some more quality of life changes on flutter outline.

unknowledgeable commented 4 years ago

Unfortunately, just started getting this error again:

[VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port

Doesn't seem to affect anything I'm doing, DevTools is working fine etc

theniceboy commented 4 years ago

I suppressed this error from showing up as floating notifications. I don't think this error will have any effect on production.