Skip to content

Error: Request textDocument/documentSymbol failed. #2438

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

Closed
Nauxscript opened this issue Feb 22, 2023 · 30 comments
Closed

Error: Request textDocument/documentSymbol failed. #2438

Nauxscript opened this issue Feb 22, 2023 · 30 comments
Labels
bug Something isn't working

Comments

@Nauxscript
Copy link

Nauxscript commented Feb 22, 2023

I got the below error after upgrading volar:

Error: selectionRange must be contained in fullRange
    at Function.validate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:26004)
    at new t (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:26218)
    at sn (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:79365)
    at sn (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:79542)
    at sn (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:79542)
    at sn (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:79542)
    at s (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:54756)
    at Object.xP [as map] (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:54842)
    at Object.ji [as asDocumentSymbols] (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:33:79332)
    at c (/Users/nauxscript/.vscode/extensions/vue.volar-1.1.6-darwin-x64/dist/node/client.js:37:56075)
    at i.provideDocumentSymbols (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:98:32441)

and I found I lost all the snippet or suggestion from voloar.

volar version: 1.1.6
vscode version: 1.75.1
OS: MacOS M1 pro, Ventura 13.1

@johnsoncodehk
Copy link
Member

Thanks for the report, can you provide the code that lead to throw this error?

@johnsoncodehk johnsoncodehk added bug Something isn't working need info labels Feb 22, 2023
@Nauxscript
Copy link
Author

actually i didn't do anything; I opened VSCode as usual and there a notification reminding me to relaunch VSCode to upgrade volar, and I did that, and the error showed after relaunching.

@johnsoncodehk
Copy link
Member

Can you provide the code for the file that VSCode is currently opening when the crash occurs?

@AmelloAster
Copy link

I'm having the same problem, opening any vue file will report an error

@johnsoncodehk
Copy link
Member

@AmelloAster Please provide the vue code that reporting error as I cannot reproduce.

@sccpt
Copy link

sccpt commented Feb 22, 2023

The same problem occurs

@Nauxscript
Copy link
Author

Can you provide the code for the file that VSCode is currently opening when the crash occurs?

I am sorry I couldn't provide the file 😂, but I will try to build a minimal reproduction later;
but I found that when the error occur, there were some problems in the code files, like eslint warning or error :

[{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-unused-vars",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-unused-vars.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-unused-vars.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "'throttle' is defined but never used.",
	"source": "eslint",
	"startLineNumber": 12,
	"startColumn": 10,
	"endLineNumber": 12,
	"endColumn": 18
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-unused-vars",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-unused-vars.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-unused-vars.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "'values' is defined but never used.",
	"source": "eslint",
	"startLineNumber": 12,
	"startColumn": 20,
	"endLineNumber": 12,
	"endColumn": 26
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 655,
	"startColumn": 5,
	"endLineNumber": 655,
	"endColumn": 26
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 656,
	"startColumn": 5,
	"endLineNumber": 656,
	"endColumn": 26
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 657,
	"startColumn": 5,
	"endLineNumber": 657,
	"endColumn": 26
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 1087,
	"startColumn": 8,
	"endLineNumber": 1087,
	"endColumn": 29
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 1286,
	"startColumn": 21,
	"endLineNumber": 1286,
	"endColumn": 42
},{
	"resource": "...",
	"owner": "eslint",
	"code": {
		"value": "@typescript-eslint/no-non-null-assertion",
		"target": {
			"$mid": 1,
			"external": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"path": "/typescript-eslint/typescript-eslint/blob/v4.33.0/packages/eslint-plugin/docs/rules/no-non-null-assertion.md",
			"scheme": "https",
			"authority": "github.com"
		}
	},
	"severity": 4,
	"message": "Forbidden non-null assertion.",
	"source": "eslint",
	"startLineNumber": 1294,
	"startColumn": 21,
	"endLineNumber": 1294,
	"endColumn": 42
}]

@Nauxscript
Copy link
Author

I reinstall volar 1.1.5, and the same eslint problems are also output in the preblems pannel, but volar had not crashed

@AmelloAster
Copy link

I think I may have found the problem, I noticed that when I opened another vue project
JavaScript and TypeScript Nightly plugin was reporting an error, so after I disabled the plugin, everything seemed to work fine

@Nauxscript
Copy link
Author

I think I may have found the problem, I noticed that when I opened another vue project JavaScript and TypeScript Nightly plugin was reporting an error, so after I disabled the plugin, everything seemed to work fine

I dont have this plugin, but it looks like volar will crash if your code have some problems like ts error, syntax error, or even just warning.

@johnsoncodehk
Copy link
Member

@AmelloAster This is another problem, please track #2434 and provide minimal reproduction if possible.

@wufan999888
Copy link

The same problem occurs

@3biubiu
Copy link

3biubiu commented Feb 22, 2023

The same problem occurs

@ApeWhoLovesCode
Copy link

v1.1.6 The same problem occurred after reloading today.

@AmelloAster
Copy link

I think I may have found the problem, I noticed that when I opened another vue project JavaScript and TypeScript Nightly plugin was reporting an error, so after I disabled the plugin, everything seemed to work fine

I dont have this plugin, but it looks like volar will crash if your code have some problems like ts error, syntax error, or even just warning.

I think you are right, I started having this problem again

@Nauxscript
Copy link
Author

I think I may have found the problem, I noticed that when I opened another vue project JavaScript and TypeScript Nightly plugin was reporting an error, so after I disabled the plugin, everything seemed to work fine

I dont have this plugin, but it looks like volar will crash if your code have some problems like ts error, syntax error, or even just warning.

I think you are right, I started having this problem again

In case you didn't already know, v1.1.7 has been released and fixed this problems.

@AmelloAster
Copy link

I think I may have found the problem, I noticed that when I opened another vue project JavaScript and TypeScript Nightly plugin was reporting an error, so after I disabled the plugin, everything seemed to work fine

I dont have this plugin, but it looks like volar will crash if your code have some problems like ts error, syntax error, or even just warning.

I think you are right, I started having this problem again

In case you didn't already know, v1.1.7 has been released and fixed this problems.

thank you

@wilding96
Copy link

I have this problem today, my vue-official version is v2.1.8,now I return to v2.1.6, it is working.

@KazariEX
Copy link
Member

Please open a new issue with codes that throw the error.

@faglyramschie7
Copy link

Hey i have the same problem today. Request textDocument/documentSymbol failed.

@mkchemist
Copy link

mkchemist commented Oct 28, 2024

@wilding96

I have this problem today, my vue-official version is v2.1.8,now I return to v2.1.6, it is working.

"This resolves the issue."

@WangJincheng4869
Copy link

今天更新至 v2.1.8 我遇到了同样的问题。

@daixii83
Copy link

same problem happen when upgrade to v2.1.8

@adnanhyder
Copy link

same problem happened to me Vue - Official v2.1.8

@inkkonito
Copy link

same pb now

@nik-lylo
Copy link

same problem happened to me Vue - Official v2.1.8

@KazariEX
Copy link
Member

This issue was closed 2 years ago. Please consider opening a new issue instead of leaving a comment here.

@yanbin218
Copy link

Request textDocument/documentSymbol failed.

@yanbin218
Copy link

Request textDocument/documentSymbol failed.

Error: selectionRange must be contained in fullRange

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 29, 2024

I can't reproduce this issue. Since this issue is very old, please open a new issue and provide minimal reproduction so we can investigate, thanks.

@vuejs vuejs locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests