knoxfighter / intellij-factorio-autocompletion

Autocompletion for the Factorio-API within Jetbrains IDEs
MIT License
16 stars 5 forks source link

Rewrite factorio api version logic #22

Closed serieznyi closed 2 years ago

serieznyi commented 2 years ago
serieznyi commented 2 years ago

Sort the config in the options in reverse order, so the latest version number is directly below the latest tag.

When setting the option to Latest version and then clicking on ok or reload integration, an error pops up Error getting current tag. Lualib not downloaded.

On first startup i had the crash.

java.lang.NullPointerException: Cannot invoke "org.jsoup.nodes.Element.text()" because the return value of "org.jsoup.nodes.Document.selectFirst(String)" is null
  at moe.knox.factorio.core.parser.ApiParser.downloadAndParseAPI(ApiParser.java:687)
  at moe.knox.factorio.core.parser.ApiParser.assureDir(ApiParser.java:653)
  at moe.knox.factorio.core.parser.ApiParser.run(ApiParser.java:127)
  at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
  at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
  at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
  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:608)
  at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
  at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
  at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
  at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
  at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
  at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
  at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
  at java.base/java.lang.Thread.run(Thread.java:833)

To reproduce: Select any version and download it, then restart the IDE.

Also i would recommend to also save latest as state, so on every startup it is checked if a new version is available and then automatically downloaded (and not only manually).

It is because ApiParser can`t parse html page of 1.1.62 because in new version of api she was changed.

How you know develop branch not a stable, so I dont see a problem in this