1c-syntax / bsl-language-server

Реализация Language Server Protocol для языка 1C (BSL)
https://1c-syntax.github.io/bsl-language-server
Other
307 stars 105 forks source link

[BUG] В случае если каталог исполняемого файла и каталога с файлами для анализа различаются происходит ошибка анализа #3252

Open zeegin opened 7 months ago

zeegin commented 7 months ago

Версия v0.23.0-rc.5 v0.22.0

Описание ошибки диагностики

В случае если каталог исполняемого файла и каталога с файлами для анализа различаются происходит ошибка анализа

Надо сделать внятное сообщение об ошибке. Сейчас понять что произошло невозможно.

C:\git\sarif-bsl>"C:\services\bsl-language-server\bsl-language-server.exe" --analyze --srcDir D:\tmp --reporter sarif
Analyzing files... 100% [===================================================================================================================] 8/8 (0:00:00 / 0:00:00) 
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: 'other' has different root
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.reportException(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.invoke(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateParallel(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.call(AnalyzeCommand.java:188)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.call(AnalyzeCommand.java:79)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at com.github._1c_syntax.bsl.languageserver.BSLLSPLauncher.run(BSLLSPLauncher.java:146)
        at com.github._1c_syntax.bsl.languageserver.BSLLSPLauncher.main(BSLLSPLauncher.java:110)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: java.lang.IllegalArgumentException: 'other' has different root
        at java.base/sun.nio.fs.WindowsPath.relativize(Unknown Source)
        at java.base/sun.nio.fs.WindowsPath.relativize(Unknown Source)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.getFileInfoFromFile(AnalyzeCommand.java:207)
        at com.github._1c_syntax.bsl.languageserver.cli.AnalyzeCommand.lambda$call$1(AnalyzeCommand.java:186)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceTask.doLeaf(Unknown Source)
        at java.base/java.util.stream.AbstractTask.compute(Unknown Source)
        at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)

Пример кода

Скриншоты

Дополнительная информация

1276

nixel2007 commented 7 months ago

Тут проблема не в каталоге как таковом, а в том, что диски разные

zeegin commented 7 months ago

Ну вот у меня софт на быстром диске C, а воркспейсы и исходники на D который виртуальный.

https://learn.microsoft.com/en-us/windows/dev-drive/

Новая фича win 11 заметно ускоряет работу.