Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request textDocument/documentSymbol failed. - Cannot read properties of undefined (reading 'range') #182

Open
ulugbekna opened this issue Mar 21, 2023 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@ulugbekna
Copy link

ulugbekna commented Mar 21, 2023

Getting Request textDocument/documentSymbol failed notification. I think the problem in that the textDocument/documentSymbol is returning "name": [] (see the trace below), while name should be a string (ref)

JSON doc contents (my keybindings.json):

[
	{
		"key": [],
		"command": "runCommands",
		"args": {}
	},
]

Exception trace

[Error - 14:48:33] Request textDocument/documentSymbol failed.
TypeError: Cannot read properties of undefined (reading 'range')
    at W (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:2:886962)
    at c (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:2:925248)
    at Object.t.map (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:2:925334)
    at Object.asSymbolInformations (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:2:894974)
    at i (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:2:833738)
    at t.provideDocumentSymbols (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:100:38974)

Log Trace

[Trace - 14:48:33] Sending request 'textDocument/documentSymbol - (148)'.
Params: {
    "textDocument": {
        "uri": "vscode-userdata:/Users/ulugbekna/Library/Application%20Support/Code%20-%20Insiders/User/keybindings.json"
    }
}


[Trace - 14:48:33] Received response 'textDocument/documentSymbol - (148)' in 1ms.
Result: [
    {
        "name": [],
        "kind": 12,
        "range": {
            "start": {
                "line": 1,
                "character": 1
            },
            "end": {
                "line": 3,
                "character": 2
            }
        },
        "selectionRange": {
            "start": {
                "line": 2,
                "character": 2
            },
            "end": {
                "line": 2,
                "character": 7
            }
        }
    }
]

Version info

Version: 1.77.0-insider (Universal)
Commit: 833ac685084e2028b09753392b82c641c7025bbc
Date: 2023-03-21T05:26:40.905Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin arm64 22.3.0
Sandboxed: Yes

@ulugbekna ulugbekna added the bug Issue identified by VS Code Team member as probable bug label Mar 21, 2023
@aeschli aeschli added this to the March 2023 milestone Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants