wakatime / jetbrains-wakatime

IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, Goland, Rider, & WebStorm plugin for quantifying your coding.
https://wakatime.com/intellij-idea
BSD 3-Clause "New" or "Revised" License
1.14k stars 167 forks source link

Sometimes .wakatime-project is ignored #118

Closed Hermesiss closed 2 years ago

Hermesiss commented 5 years ago

Some of my activity on project ignores name in .wakatime-project and is displays in dashboard as solution name

alanhamlett commented 5 years ago

That's a bug where this block should be moved down: https://github.com/wakatime/wakatime/blob/d11c64db2b9568d9914043dd16a201848a4bdf1d/wakatime/project.py#L52

I'll release a fix soon.

Edit: Nevermind, that only applies to coding activity that's not category Coding.

alanhamlett commented 5 years ago

Are you sure the solution project is new coding activity after creating the .wakatime-project file?

Hermesiss commented 5 years ago

@alanhamlett yes my actions:

  1. create this file with desired name in root folder for Unity project I never opened using any Wakatime plugins
  2. open project in Unity with configured
  3. dashboard shows overridden name
  4. open some script in Rider
  5. dashboard now shows 1 min of solution project
  6. all followed statistics appears in the right project
alanhamlett commented 5 years ago

Can you turn on debug mode in Rider, relaunch Rider, then tail your idea.log file and ~/.wakatime.log file to look for any error messages? Here's info about finding your idea.log file: https://github.com/wakatime/jetbrains-wakatime#troubleshooting

Maybe we find a file read error when opening .wakatime-project but let's see.

Hermesiss commented 5 years ago

forgot to enable debug mode on second machine, and found this strange record: image it was tracked to completely different project

Hermesiss commented 5 years ago

image I figured it out

  1. open solution D:/Foo/Foo.sln with overridden project name foo-override
  2. open any *.cs file (not solution!) from D:/Bar/ without .wakatime-project at its root. It will open in same Rider window
  3. it will try to open D:/Bar/.wakatime-project, there is none, so it will ask Rider for project name, which is Foo
  4. Now we have record in dashboard about file e.g. BarController.cs in Foo project
gandarez commented 3 years ago

@alanhamlett I could reprocude the behaviour on my side also. What do you think to pass --alternate-project instead of --project and let the cli finds the correct project instead of the IDE? By doing it the cli will traverse the right folder of the opened file.

ahmedosama94 commented 2 years ago

Facing the same (or a very similar) issue, it was working fine until recently. Now ALL the activity on WebStorm is ignoring the .wakatime-project file.

gandarez commented 2 years ago

Was that fixed by https://github.com/wakatime/jetbrains-wakatime/commit/a7533fdf2ff11f15b1d755ba32bfb046a08c9bbb @alanhamlett?

alanhamlett commented 2 years ago

Should be fixed now.