0

I am new to programming in Scala and wondered if there is a way to keep spaces in my folder directories when using scala worksheets in VS Code. I have my folders and files stored in OneDrive and they are structured to include other files outside of the ones required for my scala programs. They have spaces in their names Eg. C:/user/username/uni courseX/scalaprojectfolderx.

Below is the error message I receive. I can rectify this issue by replacing all spaces with underscores etc. Just wanted to know if there is a way around this for convenience.

[Error - 12:43:01 pm] Request textDocument/onTypeFormatting failed._ Message: Internal error. Code: -32603 java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Illegal character in path at index 100: file:///C:/Users/franc/OneDrive/UNI COURSE/tailrecursivemadness/src/main/scala/recursion/test.worksheet.sc

I am using the metals extension.

  • 1
    Perhaps try wrapping the path (that has spaces) with quotes (either single or double) for whatever command you are trying to run? See: https://stackoverflow.com/a/68057625/5065400 – Randomness Slayer Apr 17 '22 at 18:22
  • 1
    Great thank you! The problem for some reason has gone away and the worksheets are now working even with paths that have spaces. Not sure what is different. As I didn't change anything. But if I run into the problem again I will refer to the link you provided. – Engineerthis May 14 '22 at 07:14

0 Answers0