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

Custom data for HTML not working #67544

Closed
dbaeumer opened this issue Jan 30, 2019 · 8 comments
Closed

Custom data for HTML not working #67544

dbaeumer opened this issue Jan 30, 2019 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues

Comments

@dbaeumer
Copy link
Member

Testing #67306

Steps to reproduce:

  • new workspace
  • settings.json
{
	"html.experimental.customData": [
		{
			"version": 1,
			"tags": [
				{
					"name": "my-button",
					"description": "My button",
					"attributes": [
						{
							"name": "type",
							"description": "My button type",
							"values": [
								{
									"name": "alert"
								}
							]
						}
					]
				}
			]
		}
	]
}
  • reload VSCode
  • open a html file
  • you get the following exceptions in the console
extensionService.ts:786 Activating extension 'vscode.html-language-features' failed: The "path" argument must be of type string. Received type object.
t._logMessageInConsole @ extensionService.ts:786
t._logOrShowMessage @ extensionService.ts:800
e.$localShowMessage @ mainThreadExtensionService.ts:32
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
console.ts:134 [Extension Host] Activating extension 'vscode.html-language-features' failed: The "path" argument must be of type string. Received type object. (at Object.showMessage (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:735:501))
t.log @ console.ts:134
e.$logExtensionHostMessage @ mainThreadConsole.ts:39
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
console.ts:134 [Extension Host] Activating extension `vscode.html-language-features` failed:  The "path" argument must be of type string. Received type object (at c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:331:101)
t.log @ console.ts:134
e.$logExtensionHostMessage @ mainThreadConsole.ts:39
t._doInvokeHandler @ rpcProtocol.ts:390
t._invokeHandler @ rpcProtocol.ts:375
t._receiveRequest @ rpcProtocol.ts:295
t._receiveOneMessage @ rpcProtocol.ts:225
(anonymous) @ rpcProtocol.ts:100
e.fire @ event.ts:567
s @ ipc.net.ts:295
(anonymous) @ ipc.net.ts:302
e.fire @ event.ts:567
a @ ipc.net.ts:103
_socketDataListener @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
console.ts:134 [Extension Host] Here is the error stack:  TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
	at assertPath (path.js:39:11)
	at Object.resolve (path.js:168:7)
	at t.getCustomDataPathsInAllWorkspaces.e.forEach.n.workspaceFolderValue.n.workspaceFolderValue.experimental.n.workspaceFolderValue.experimental.customData.n.workspaceFolderValue.experimental.customData.forEach.n (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\html-language-features\client\dist\htmlMain.js:53:44216)
	at Array.forEach (<anonymous>)
	at t.getCustomDataPathsInAllWorkspaces.e.forEach.e (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\html-language-features\client\dist\htmlMain.js:53:44195)
	at Array.forEach (<anonymous>)
	at Object.t.getCustomDataPathsInAllWorkspaces (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\html-language-features\client\dist\htmlMain.js:53:43957)
	at t.activate (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\html-language-features\client\dist\htmlMain.js:1:117753)
	at Function.t._callActivateOptional (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:741:354)
	at Function.t._callActivate (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:741:25)
	at c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:740:206 (at c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:331:183)

After that the HTML extension is dead. No code complete anymore

@vscodebot vscodebot bot added the typescript Typescript support issues label Jan 30, 2019
@dbaeumer
Copy link
Member Author

The HTML extension works fine with an emopty setting file

@dbaeumer dbaeumer assigned octref and unassigned mjbvz Jan 30, 2019
@dbaeumer dbaeumer removed the typescript Typescript support issues label Jan 30, 2019
@dbaeumer
Copy link
Member Author

@aeschli FYI

@dbaeumer
Copy link
Member Author

Same happens for CSS:

extensionService.ts:786 Activating extension 'vscode.css-language-features' failed: The "path" argument must be of type string. Received type object.
t._logMessageInConsole @ extensionService.ts:786
console.ts:134 [Extension Host] Activating extension 'vscode.css-language-features' failed: The "path" argument must be of type string. Received type object. (at Object.showMessage (c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:735:501))
t.log @ console.ts:134
console.ts:134 [Extension Host] Activating extension `vscode.css-language-features` failed:  The "path" argument must be of type string. Received type object (at c:\Users\dirkb\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:331:101)

@octref
Copy link
Contributor

octref commented Jan 30, 2019

// A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read.

This setting only takes paths, not JSON data.

@octref octref added the *as-designed Described behavior is as designed label Jan 30, 2019
@vscodebot
Copy link

vscodebot bot commented Jan 30, 2019

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jan 30, 2019
@octref
Copy link
Contributor

octref commented Jan 30, 2019

Maybe I could have done better at the docs for explaining it...

@aeschli
Copy link
Contributor

aeschli commented Jan 30, 2019

@octref You can change the configuration schema like that, so @dbaeumer would have gotten a warning:

{
"html.experimental.customData": {
  "type": "array",
  "description": "A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read.",
  "default": [],
  "item": {
    "type": "string"
  },
 "scope": "resource"
}
}

Note that the HTML extension fails to start because of the unexpected setting value. I suggest add code to protect from this.

@octref
Copy link
Contributor

octref commented Jan 30, 2019

Sorry Dirk. Added schema to guard against this:

image

And now the HTML/CSS server would start fine for malformed customData.

@octref octref closed this as completed Jan 30, 2019
@octref octref added bug Issue identified by VS Code Team member as probable bug html HTML support issues and removed *as-designed Described behavior is as designed labels Jan 30, 2019
octref added a commit that referenced this issue Jan 30, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues
Projects
None yet
Development

No branches or pull requests

4 participants