kotlin-language-server
kotlin-language-server copied to clipboard
Doesn't work if file path has special characters (specifically [])
Describe the bug
So I had my project located in C:\repositories\[other], however the language server fails to initialize every time. Looks like it was complaining about an illegal character [ in output. So I moved my project into C:\repositories and it worked.
[Error - 3:40:21 PM] Starting client failed
Message: Internal error.
Code: -32603
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
... 11 more
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 24: file:///c:/repositories/[other]/Kotlin
at java.net.URI.create(Unknown Source)
at org.javacs.kt.util.URIsKt.parseURI(URIs.kt:15)
at org.javacs.kt.KotlinLanguageServer.initialize(KotlinLanguageServer.kt:73)
... 16 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 24: file:///c:/repositories/[other]/Kotlin
at java.net.URI$Parser.fail(Unknown Source)
at java.net.URI$Parser.checkChars(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
... 19 more
To Reproduce Steps to reproduce the behavior:
- Create
.ktfile in a directory path with a[somewhere - Open with vscode
- See error
Expected behavior
Expected language server to initialize and code completion to work in a directory with special characters (specifically [ ?)
^^^
Above image shows it working (currently only work if the directory path does not contain the [] characters
Extension version 0.2.18
Additional context I'm on Windows 10 Pro v 10.0.18362 Build 18362