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

Error: Request textDocument/documentSymbol failed. #2438

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

Error: Request textDocument/documentSymbol failed. #2438

Nauxscript opened this issue Feb 22, 2023 · 17 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants