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.

Error on Paste - Range Formatting

See original GitHub issue

Hello:

I have Visual Studio Code 1.38.0-insider and YAML 0.5.1. Every time I paste code I receive a range formatting error in the Outputs window of the console.

I’ve tried opening a workspace, a folder, and an individual file - all with the same results. I enabled YAML Server Trace and this is the output that I’m seeing right around the error message. It does not seem to matter if I’m pasting real YAML - or any other text - the error message is always the same:

[Trace - 9:14:58 AM] Sending request 'textDocument/rangeFormatting - (16)'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/GitRepos/CFInfra/dns-zone.yaml"
    },
    "range": {
        "start": {
            "line": 151,
            "character": 0
        },
        "end": {
            "line": 151,
            "character": 17
        }
    },
    "options": {
        "tabSize": 2,
        "insertSpaces": true
    }
}


[Trace - 9:14:58 AM] Received response 'textDocument/rangeFormatting - (16)' in 1ms. Request failed: Unhandled method textDocument/rangeFormatting (-32601).
[Error - 9:14:58 AM] Request textDocument/rangeFormatting failed.
  Message: Unhandled method textDocument/rangeFormatting
  Code: -32601 
[Trace - 9:14:58 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///d%3A/GitRepos/CFInfra/dns-zone.yaml",
    "diagnostics": [
        {
            "message": "can not read a block mapping entry; a multiline key may not be an implicit key",
            "range": {
                "start": {
                    "line": 151,
                    "character": 5102
                },
                "end": {
                    "line": 151,
                    "character": 5102
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 151,
                    "character": 5102
                },
                "end": {
                    "line": 151,
                    "character": 5102
                }
            },
            "severity": 1
        },
        {
            "message": "incomplete explicit mapping pair; a key node is missed",
            "range": {
                "start": {
                    "line": 151,
                    "character": 5104
                },
                "end": {
                    "line": 151,
                    "character": 5104
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 165,
                    "character": 5539
                },
                "end": {
                    "line": 165,
                    "character": 5539
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 179,
                    "character": 5957
                },
                "end": {
                    "line": 179,
                    "character": 5957
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 190,
                    "character": 6218
                },
                "end": {
                    "line": 190,
                    "character": 6218
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 202,
                    "character": 6577
                },
                "end": {
                    "line": 202,
                    "character": 6577
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 213,
                    "character": 6919
                },
                "end": {
                    "line": 213,
                    "character": 6919
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 224,
                    "character": 7261
                },
                "end": {
                    "line": 224,
                    "character": 7261
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 235,
                    "character": 7564
                },
                "end": {
                    "line": 235,
                    "character": 7564
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 246,
                    "character": 7874
                },
                "end": {
                    "line": 246,
                    "character": 7874
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 257,
                    "character": 8197
                },
                "end": {
                    "line": 257,
                    "character": 8197
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 268,
                    "character": 8512
                },
                "end": {
                    "line": 268,
                    "character": 8512
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 279,
                    "character": 8804
                },
                "end": {
                    "line": 279,
                    "character": 8804
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 290,
                    "character": 9103
                },
                "end": {
                    "line": 290,
                    "character": 9103
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 301,
                    "character": 9386
                },
                "end": {
                    "line": 301,
                    "character": 9386
                }
            },
            "severity": 1
        },
        {
            "message": "bad indentation of a mapping entry",
            "range": {
                "start": {
                    "line": 312,
                    "character": 9700
                },
                "end": {
                    "line": 312,
                    "character": 9700
                }
            },
            "severity": 1
        }
    ]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
fmvilascommented, Sep 1, 2019

@JPinkney I still see the bug, although the solution provided by @subzerochi works temporarily.

I’m running the latest version of VS Code on Mac and version 0.5.2 of this plugin.

VS Code:

Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 15.6.0

Steps to reproduce:

  1. Create new empty YAML file.
  2. Type: “createOrders:” (or anything else)
  3. Open another document, type and copy the following:
bindings:
  http:
    code: 200
  1. Go to first file. Place cursor at the end of createOrders:, hit enter and then Cmd+V.
  2. Output panel opens up with the following error:
[Error - 12:38:48 PM] Request textDocument/rangeFormatting failed.
  Message: Unhandled method textDocument/rangeFormatting
  Code: -32601 

Hope it helps!

3reactions
JPinkneycommented, Sep 11, 2019

@danielroe No worries! I just wanted to make sure the fix wasn’t a ‘works on my machine’. I’ll probably release this fix this friday

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug in Excel: Paste Values & Source formatting pastes formulas
The prompt when Pasting Values & Formatting is normal behavior in Excel. It's just letting the user know to be cautious when pasting...
Read more >
copying and pasting multiple ranges with formatting issue in ...
I got two errors. 1. It should be End Select instead of End if 2. Its throwing me error that the copy action...
Read more >
Paste with destination formatting error - Excel Help Forum
Hi, I tried using the below VBA to enable paste with destination formatting and infact it works. Sub PasteAsValue() ActiveSheet.
Read more >
Excel Fix Copy Paste Problems Work on Multiple Selections
Why You See Copy Error. Excel will show that copy error message if you selected multiple ranges, and those ranges don't “match up”....
Read more >
How to Fix the 'Too Many Cell Formats' Error in Excel - Causal
If you're getting the "too many cell formats" error in Excel, it means that you're trying to apply too many different formatting options...
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