gtache / intellij-lsp

Plugin adding Language Server Protocol support for IntelliJ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java.lang.NullPointerException

jazithedev opened this issue · comments

Hello. I would like to refer to the issue created in here: vimeo/psalm#3038

I wanted to add Psalm support in my PHP project, but error occurs:

java.lang.NullPointerException
	at com.github.gtache.lsp.utils.FileUtils$.pathToUri(FileUtils.scala:186)
	at com.github.gtache.lsp.utils.FileUtils$.editorToProjectFolderUri(FileUtils.scala:165)
	at com.github.gtache.lsp.PluginMain$.$anonfun$editorOpened$1(PluginMain.scala:135)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	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.lang.Thread.run(Thread.java:834)

Maybe it is somehow related to file paths different on local machine, and on Docker container. I've checked the "Connected files" list and got one PHP file:

file:///srv/www/project/src/Controller/SomeController.php
(this path is on my local machine)

But inside of Docker container this path is

file:///srv/www/src/Controller/SomeController.php
(without the `project` dir)

Does it matter, and is it somehow related with above error? Thanks in advance for your help!

Same problem but on Linux Arch

java.lang.NullPointerException
	at com.github.gtache.lsp.utils.FileUtils$.pathToUri(FileUtils.scala:186)
	at com.github.gtache.lsp.utils.FileUtils$.editorToProjectFolderUri(FileUtils.scala:165)
	at com.github.gtache.lsp.PluginMain$.$anonfun$editorOpened$1(PluginMain.scala:135)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	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.lang.Thread.run(Thread.java:834)

Yes unfortunately I'm getting the same exception and I'm using PHPStorm on a mac. I can't seem to find a solution. Does anyone have any workarounds?