tighten/tlint-plugin

Tlint plugin is not compatible with phpstorm 2021.3

Opened this issue ยท 30 comments

Hello Tightens!

Thank you for the perfect tool! I was using VSCode and tlint plugin was working perfectly there. recently I migrated to PHPStorm and installed the latest version (2021.3) but I couldn't install tlint plugin because it's not compatible with this version.
image

Phew....ok...the Gradle IntelliJ Plugin released 1.0 which required some upgrades mentioned in #20 to generate a build for the latest versions of PHPStorm. I worked on that migration and also set up GitHub Actions to build the plugin, which should make generating new builds easier, in #22.

Can you do me a favor and install/test the generated build? Please report back if it worked and which version of PHPStorm you're running. Thanks!

You can download the build from this page:
CleanShot 2022-05-27 at 12 29 04

You can install plugins from zip files under this menu:
CleanShot 2022-05-27 at 12 21 51

Peace be upon you!

thanks for coming back for this. I installed the test-generated build as you told me. and it was installed and I was surprised to see that it's not detecting that tlint is installed but I can run it from the command line
image

@RoduanKD interesting ๐Ÿค”

People have experienced this before as mentioned in #15. Do you have the composer package installed globally? If so, can you install it at the project level (as mentioned in this comment) and see if that changes things? You might need to restart PHPStorm after installation.

Thanks!

yes, I have it installed globally, I'll install it now at the project level and report back. I'll make sure to restart PHPStorm.
thanks

I installed it locally and I've restarted PHPStorm. and it also crashed. I'm using PHPstorm 2021.3.2
can't we have options page for this plugin to specify the tlint exec location like in the VSCode extension?

Error running TLint inspection: 

java.lang.NullPointerException
	at tlint.inspection.TLintExternalAnnotator.doAnnotate(TLintExternalAnnotator.kt:78)
	at tlint.inspection.TLintExternalAnnotator.doAnnotate(TLintExternalAnnotator.kt:33)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:212)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:190)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:287)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:190)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:255)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:189)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:333)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:323)
	at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:273)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:287)
	at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:241)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:240)
	at com.intellij.util.Alarm$Request.runSafely(Alarm.java:385)
	at com.intellij.util.Alarm$Request.run(Alarm.java:374)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:246)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:225)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:214)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

I forgot to ask: which operating system are you using? I think all of the devs that have reported success with this build (outside of this thread) are all on macOS and I wonder if that could be an issue.

Regarding an options page to specify the executable location: I think that we would ideally have the plugin automatically pick it up from either the global or local installation (which is what is supposed to be happening now...) for two reasons:

  1. I don't think it is common to have TLint installed in a location other than the two listed above
  2. I'm still new to IntelliJ plugin development and I'm not eager to dive into creating and managing views and settings unless I really have to ๐Ÿ˜…

I'm using Windows 11.
and yeah you're right about that. I tried to fix it myself when I opened this issue by rebuilding the plugin but was a pain for me as I'm not familiar with IntelliJ Plugin development.

if there is anything I can help with please just tell me and I'll do my best.

I've briefly looked into providing a way to set TLint's install location but didn't find a quick and easy solution so it will require more exploring on my part. I'm planning on source-diving some of the repositories listed here for examples of plugins already doing this.

thank you!
let me know if you need anything I'll do my best.
๐Ÿ‘๐Ÿ‘๐Ÿ‘

Hi @RoduanKD, a couple more questions if you have a moment:

When you used the plugin with VSCode, did you have to manually set the TLint executable location or did it work out of the box? Where is the executable in your environment? Any chance if you know if it is different between Windows 11 and previous versions?

Thanks! Really hoping to get this working for you and everyone else ๐Ÿ˜„

Peace be upon you @marcusmoore ,
the plugin used to work out of the box with VSCode. I just install TLint globally with composer and the plugin would work without any interaction.

Also, Windows 11 is no different from previous versions. and TLint is working fine on VSCode on Windows 11.

Thanks for your efforts I hope it works the soonest!

Thanks @RoduanKD

Just to verify, you can run tlint successfully from the command line right? Where is the tlint executable on your machine?

yes, it's working fine and I can run TLint using cmd in any folder

the executable is located exactly here
C:\Users\{MY_USER_NAME_GOES_HERE}\AppData\Roaming\Composer\vendor\bin\tlint.bat
or for short
%APPDATA%\Composer\vendor\bin\tlint.bat

@RoduanKD I just pushed a commit that might solve the issue. Can you give it a try by downloading the TLint-1.3.0 artifact from this page please? ๐Ÿคž๐Ÿพ

thanks @marcusmoore!

I've just installed it again using the new artifact you sent and it's not crashing anymore but also not detecting any errors.
For example, I opened the same project with both VSCode and PHPStrom and VSCode reported an error while PHPStrom was quiet. I enabled the plugin and restarted my IDE after updating it.

Update:

I have this scope in a model

/**
 * Scope a query to search between all columns.
 *
 * @param  \Illuminate\Database\Eloquent\Builder  $query
 * @return \Illuminate\Database\Eloquent\Builder
 */
public function scopeAll($query, $value)
{
    return $query->where('name', 'LIKE', "%{$value}%");
}

I tried to unwrap braces from $value var to see if it's gonna report NoStringInterploaionWithoutBraces or not and unfortunately it crashed once I saved the file.

Error running TLint inspection: 

java.lang.NullPointerException
	at tlint.inspection.TLintExternalAnnotator.doAnnotate(TLintExternalAnnotator.kt:78)
	at tlint.inspection.TLintExternalAnnotator.doAnnotate(TLintExternalAnnotator.kt:33)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:212)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:190)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:287)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:190)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:255)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:189)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:333)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:323)
	at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:273)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:287)
	at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:241)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:240)
	at com.intellij.util.Alarm$Request.runSafely(Alarm.java:385)
	at com.intellij.util.Alarm$Request.run(Alarm.java:374)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:246)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:225)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:214)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

image

and in VSCode it's working fine and reporting as u can see
image

Interesting...looks like the error is the same as before but we've gotten past the Error running TLint inspection: No tint executable found popup from your previous comment?

I'm not sure if the problem is the TLint executable path or the path of the file since tlint.inspection.TLintExternalAnnotator.doAnnotate(TLintExternalAnnotator.kt:78) is referencing the relativeFile variable...

Can you confirm that Error running TLint inspection: No tint executable found is no longer popping up as an error?

yes! the only error I'm facing now is the one I pasted yesterday. the Error running TLint inspection: No tlint executable found error is no where to be found

Thanks for your help in debugging this @RoduanKD.

Another request for when you have time:

Can you download and install the latest build here, open a file in a project that will show a TLint error (like the file you screenshot above), open PHPStorm's log, and copy/paste the section that begins with project.basePath? ๐Ÿ˜…

You should be able to find PHPStorm's log by clicking Show Log in x under the Help menu (for macOS it's Show Log in Finder so Windows might be Show Log in Explorer) and then opening idea.log.

This is an example of what the log lines look like for me:
CleanShot 2022-07-13 at 12 11 54

There shouldn't be any blank lines but I'm thinking the last line might be blank for you.

Thanks again!

Here's what I found

2022-07-13 23:13:47,362 [1611458]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:47,363 [1611459]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:47,363 [1611459]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:47,363 [1611459]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:47,363 [1611459]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:47,363 [1611459]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:13:47,362 [1611458]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:47,368 [1611464]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:47,368 [1611464]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:47,368 [1611464]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:47,368 [1611464]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:47,368 [1611464]   INFO -                         #tlint - routes\api.php 
2022-07-13 23:13:47,841 [1611937]   INFO -        #zielu.gittoolbox.blame - Annotated file://D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php: zielu.gittoolbox.a.d@6a49d05b 
2022-07-13 23:13:50,057 [1614153]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:50:036] Document saved: file:///D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php 
2022-07-13 23:13:50,057 [1614153]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:50:057] [248] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) 
2022-07-13 23:13:50,061 [1614157]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:50:061] [248] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) completed โ€ข 2 ms 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:50,796 [1614892]   INFO -                         #tlint - routes\api.php 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:50,908 [1615004]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:13:53,302 [1617398]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:53:301] Document saved: file:///D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php 
2022-07-13 23:13:53,302 [1617398]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:53:302] [249] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) 
2022-07-13 23:13:53,303 [1617399]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:53:303] [249] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) completed โ€ข 0 ms 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:53,518 [1617614]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:54,127 [1618223]   INFO -                         #tlint - routes\api.php 
2022-07-13 23:13:55,801 [1619897]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:55:801] [24a] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) 
2022-07-13 23:13:55,802 [1619898]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:55:802] [24a] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) completed โ€ข 0 ms 
2022-07-13 23:13:56,311 [1620407]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:56:311] Document saved: file:///D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php 
2022-07-13 23:13:56,312 [1620408]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:56:311] [24b] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) 
2022-07-13 23:13:56,314 [1620410]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:13:56:314] [24b] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) completed โ€ข 2 ms 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:57,003 [1621099]   INFO -                         #tlint - routes\api.php 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:57,099 [1621195]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:59,676 [1623772]   INFO -                         #tlint - routes\api.php 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint - project.basePath 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint - C:\Users\Roduan\AppData\Local\Temp\intellij-tlint-temp\app\Models\Branch.php 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint - relativeFile 
2022-07-13 23:13:59,758 [1623854]   INFO -                         #tlint -  
2022-07-13 23:14:00,087 [1624183]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:087] Document saved: file:///D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php 
2022-07-13 23:14:00,087 [1624183]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:087] [24c] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) 
2022-07-13 23:14:00,104 [1624200]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:104] [24c] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) completed โ€ข 16 ms 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - project.basePath 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - relativeFile 
2022-07-13 23:14:00,824 [1624920]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:14:01,969 [1626065]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:01:968] [24d] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) 
2022-07-13 23:14:01,969 [1626065]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:01:969] [24d] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) completed โ€ข 0 ms 
2022-07-13 23:14:05,845 [1629941]   INFO - rationStore.ComponentStoreImpl - Saving Project(name={PROJECT_NAME_02}, containerState=COMPONENT_CREATED, componentStore=D:\laragon\www\{PROJECT_NAME_02})Inertia.Settings took 58 ms 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - project.basePath 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - relativeFile 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - app\Models\Branch.php 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - project.basePath 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - relativeFile 
2022-07-13 23:14:06,763 [1630859]   INFO -                         #tlint - routes\api.php 

thanks for your efforts in fixing this issue @marcusmoore

@RoduanKD

Thanks for the detailed logs!

Writing out my thoughts:

At the top of your log relativeFile is displayed for each batch of calls but there is a place lower in the log where it is blank. Branch.php shows up with relativeFile displaying, then it disappears, and then reappears again.

2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - project.basePath 
2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - relativeFile 
2022-07-13 23:13:57,099 [1621195]   INFO - #tlint - app\Models\Branch.php 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - project.basePath 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - D:/laragon/www/{PROJECT_NAME_02} 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - D:\laragon\www\{PROJECT_NAME_02}\routes\api.php 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - relativeFile 
2022-07-13 23:13:59,676 [1623772]   INFO - #tlint - routes\api.php 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint - project.basePath 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint - C:\Users\Roduan\AppData\Local\Temp\intellij-tlint-temp\app\Models\Branch.php 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint - relativeFile 
2022-07-13 23:13:59,758 [1623854]   INFO - #tlint -  
2022-07-13 23:14:00,087 [1624183]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:087] Document saved: file:///D:/laragon/www/{PROJECT_NAME_01}/app/Models/Branch.php 
2022-07-13 23:14:00,087 [1624183]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:087] [24c] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) 
2022-07-13 23:14:00,104 [1624200]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:00:104] [24c] CodeStreamAgent.sendNotification(codestream/didChangeData:documents) completed โ€ข 16 ms 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - project.basePath 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - D:/laragon/www/{PROJECT_NAME_01} 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - actualCodeFile.actualFile.absolutePath 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - D:\laragon\www\{PROJECT_NAME_01}\app\Models\Branch.php 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - relativeFile 
2022-07-13 23:14:00,824 [1624920]   INFO - #tlint - app\Models\Branch.php 
2022-07-13 23:14:01,969 [1626065]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:01:968] [24d] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) 
2022-07-13 23:14:01,969 [1626065]   INFO - agent.CodeStreamLanguageClient - [2022-07-13 20:14:01:969] [24d] CodeStreamAgent.sendNotification(codestream/didChangeDocumentMarkers) completed โ€ข 0 ms 
2022-07-13 23:14:05,845 [1629941]   INFO - rationStore.ComponentStoreImpl - Saving Project(name={PROJECT_NAME_02}, containerState=COMPONENT_CREATED, componentStore=D:\laragon\www\{PROJECT_NAME_02})Inertia.Settings took 58 ms 

From what I can gather, the times relativeFile was displayed was when the class was navigated to but is it not displayed when you saved the class since the plugin stores a temporary file (C:\Users\Roduan\AppData\Local\Temp\intellij-tlint-temp\app\Models\Branch.php) that it runs linting on.

My own logs look similar where I navigated to BaseRepo, fixed a TLint error, and then saved the file which triggered a save to a temporary file:

2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - project.basePath
2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages
2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - actualCodeFile.actualFile.absolutePath
2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages/app/BaseRepo.php
2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - relativeFile
2022-07-13 16:47:29,294 [ 297862]   INFO - #tlint - app/BaseRepo.php
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - project.basePath
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - actualCodeFile.actualFile.absolutePath
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages/app/BaseRepo.php
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - relativeFile
2022-07-13 16:47:32,692 [ 301260]   INFO - #tlint - app/BaseRepo.php
2022-07-13 16:47:58,011 [ 326579]   INFO - #tlint - project.basePath
2022-07-13 16:47:58,012 [ 326580]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages
2022-07-13 16:47:58,012 [ 326580]   INFO - #tlint - actualCodeFile.actualFile.absolutePath
2022-07-13 16:47:58,012 [ 326580]   INFO - #tlint - /private/var/folders/mp/4djkcncs49dd41ww84gmwbmh0000gn/T/intellij-tlint-temp/app/BaseRepo.php
2022-07-13 16:47:58,012 [ 326580]   INFO - #tlint - relativeFile
2022-07-13 16:47:58,012 [ 326580]   INFO - #tlint - ../../../../../../private/var/folders/mp/4djkcncs49dd41ww84gmwbmh0000gn/T/intellij-tlint-temp/app/BaseRepo.php
2022-07-13 16:47:59,965 [ 328533]   INFO - STDOUT - []
2022-07-13 16:48:00,074 [ 328642]   INFO - #c.i.c.ComponentStoreImpl - Saving appXmlEditorOptions took 11 ms
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - project.basePath
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - actualCodeFile.actualFile.absolutePath
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - /Users/marcus/dev/tighten/os/novapackages/app/BaseRepo.php
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - relativeFile
2022-07-13 16:48:00,754 [ 329322]   INFO - #tlint - app/BaseRepo.php

The difference is that relativeFile for me is populated...


So, my next steps are to figure out why the plugin cannot access that file on your system and potentially all Windows systems. One thing that stands out is your project is on D: but the temporary file is stored on C:. I don't know if that would be an issue but it caught my eye.


For context: I believe relativeFile is set to null on this line and so the exception is throw when it is called with !! on this line.

Can you download and install the latest build here

Any updates? This build used to work for me with 2022.2 but doesn't work with 2022.3 anymore.

Bildschirmfoto 2022-12-27 um 14 33 15

Hi @helloiamlukas can you try out this build? It's working in 2022.3 for me.

https://github.com/tighten/tlint-plugin/actions/runs/3859951556

Yes, this works :) Thank you!

Here we go again: 2023.1 has been released

@marcusmoore Could you create a new build?

Hi @helloiamlukas

The zip at the bottom of this build should work for you ๐Ÿ‘๐Ÿพ

This works great! Thank you :)

New year, new build ๐Ÿ‘€
@marcusmoore Could you create one?

@helloiamlukas I'm not actually using TLint anymore so I didn't run into the issue when updating ๐Ÿ˜…

I don't know if my local set up is in a good place to generate a build but I'll give it a go when I get a chance.

qrcf commented

Hey guys!

TLint recently has been updated and supports Laravel 11. Is there anyway I can build this to use in new PHPStorm versions?

Happy to do the leg work; but would appreciate any tips on where to begin. @helloiamlukas @marcusmoore