question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error on save

See original GitHub issue

I’ve installed the extension and sourcekite, but whenever I save my swift file, I get

[Error - 15:12:57] Request textDocument/formatting failed.
  Message: Request textDocument/formatting failed with message: Unexpected token s in JSON at position 67
  Code: -32603 

in the output pane. Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sbrombergercommented, Apr 27, 2018

That’s awesome; thank you for the info and the config. Here’s my debugging config in case it helps anyone else:

   "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "preLaunchTask": "swiftc with debug",
            "name": "Debug",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "sourceLanguages": [
                "swift"
            ]
        }
    ]

and the swiftc with debug build script:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "swiftc with debug",
            "type": "shell",
            "command": "swiftc -g ${file}",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "presentation": {
                "panel": "dedicated"
            }
        }
    ]
}
1reaction
vknabelcommented, Apr 27, 2018

Thanks for filing an issue and investigating on this! Yes, the output is YAML but has been parsed as JSON (with some intermediate regex mutations in between). This part came from a previous maintainer and until now it has worked far better than expected. I will do some small refactorings and have some additional testing before releasing the fix this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the "Word Cannot Complete the Save Due to a File ...
1. Try Saving the File With a Different Name and to a Different Location ... Before getting into technical fixes, try to save...
Read more >
How to troubleshoot errors when you save Excel workbooks
Possible reasons why documents don't save · Exit Excel. · Select Start, and point to Programs. · As Excel starts, press and hold...
Read more >
I am trying to save a file but getting an error - Stack Overflow
While trying to save a file I get the following error: Error: TypeError: expected str, bytes or os.PathLike object, not _io.TextIOWrapper.
Read more >
Error on saving PDF in Acrobat on Windows 10 - Adobe Support
The above-mentioned error appears when Acrobat is denied permission to save PDF files on your computer. You have to add Acrobat to the...
Read more >
Error Message: "Unable to save video to gallery" or ... - HelpHub
Issue 1: The app does not have the required permission to access your phone's gallery - or - you are on an old...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found