Chakroun-Anas / turbo-console-log

597 stars 141 forks source link

Multi Line issue for chained expressions with dot #62

Closed kalaschnik closed 5 years ago

kalaschnik commented 5 years ago

I’m using 1.2.23 and consider this code:

let myVariable = resources
  .filter(e => some filtering using e)
  .map(e => some mapping using e);

When selecting myVariable, hitting Ctrl+Alt+L it will insert the console.log here:

let myVariable = resources
console.log() // :-1: 
  .filter(e => some filtering using e)
  .map(e => some mapping using e);

yet, it should appear here:

let myVariable = resources
  .filter(e => some filtering using e)
  .map(e => some mapping using e);
console.log() // :+1: 
Chakroun-Anas commented 5 years ago

Hello,

Sorry for the delay, i have just pushed a new version (1.2.24) that deals with this, please verify and share with me your feedback so we can close the issue.

Thank you so much.

kalaschnik commented 5 years ago

This changes might introduce another bug. The console.log is not set directly after the line. Instead it seems somehow random, see the gif: Peek 2019-06-29 17-27

germanfleitas commented 5 years ago

Hello, same issue here as @Kalaschnik. Some time it put the log even outside the function.

Turbo Console Log: v1.2.25 VS Code: v1.36.0 SO: Windows 10

Thanks!

Chakroun-Anas commented 5 years ago

Hello,

I have made a real quick fix (it took me 5 minutes xD), i'm not sure if it cover all the cases so please test again and give me your feedback.

I promise that i will go back to this once i have more time.

Thanks and sorry for any inconvenience.

germanfleitas commented 5 years ago

Thanks for the very quick feedback and sorry for my delayed response. I try it and it seems that it's working as expected now! But I guess the issue pointed by @Kalaschnik is still there.

Thanks!

germanfleitas commented 5 years ago

Hi! Using the new version today I found that the error still happen, same system conditions: tcl_out_of_bounds

Thanks!

Chakroun-Anas commented 5 years ago

Hi @germanfleitas @Kalaschnik,

I have just pushed a fix, would you please test again and give me your feedback

Thx

germanfleitas commented 5 years ago

Hi @Chakroun-Anas, Sorry for the late response. I was testing and it seems that it works as intended! Thanks!