intellij-lsp icon indicating copy to clipboard operation
intellij-lsp copied to clipboard

NPE in FileUtils.scala:99 when editor '.gitignore' is open initially

Open mutech opened this issue 6 years ago • 2 comments

Here's the stack trace:

java.lang.NullPointerException
	at com.github.gtache.lsp.utils.FileUtils$.editorToProjectFolderPath(FileUtils.scala:99)
	at com.github.gtache.lsp.PluginMain$.$anonfun$editorOpened$3(PluginMain.scala:117)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

It appears that this exception only occurs if an editor containing .gitignore is open initially.

  • Reproducing no error:
    • close all editors
    • quit & restart Webstorm
    • all is good
  • Reproducing error
    • close all editors, open '.gitignore'
    • quit & restart Webstorm
    • Webstorm exception alert is popping up after about 5s

Hey, I got #42, that's nice ;-)

mutech avatar Nov 14 '18 05:11 mutech

That's strange, I can't reproduce it on IntelliJ. Tried with only .gitignore opened and with both .gitignore and a C file while having cquery configured, but I don't get the error. That may be Webstorm-specific or specific to a language server.

I'll try later with Webstorm, what language server are you using?

gtache avatar Dec 12 '18 12:12 gtache

None right now. I used the plugin for another project a while ago, not using LSP currently.

Let me know if you cannot reproduce with webstorm. I had this behaviour on two different computers, so I can probably consistently reproduce.

mutech avatar Dec 12 '18 22:12 mutech