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

HTML editor not working fully #64993

Closed
pedro-w opened this issue Dec 13, 2018 · 7 comments
Closed

HTML editor not working fully #64993

pedro-w opened this issue Dec 13, 2018 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release html HTML support issues

Comments

@pedro-w
Copy link

pedro-w commented Dec 13, 2018

  • VSCode Version: Version: 1.30.0 (user setup)
  • Commit: c6e592b
  • Date: 2018-12-11T22:29:11.253Z
  • OS Version: Windows_NT x64 10.0.17134

Steps to Reproduce:

  1. Open HTML file
  2. The HTML syntax is colored as expected
  3. But, some features do not work, e.g. suggestions and color previews (see below)

example
In the attached picture you can see that there is no color prevew and the intellisense suggestions are not 'useful' (i.e context sensitive) they are just words from the body of the file.

This seems to have started in 1.30; prior to the update (today) it was working as expected.

Does this issue occur when all extensions are disabled?: Yes

@Edger
Copy link

Edger commented Dec 13, 2018

I also encountered this situation. Just reinstalled 1.29.1, everything is OK. These must be bugs in 1.30.

@octref
Copy link
Contributor

octref commented Dec 13, 2018

It's working for me though:

image

Can you give me a small repro case (like a HTML file content)?

@octref octref added info-needed Issue requires more information from poster and removed new release labels Dec 13, 2018
@pedro-w
Copy link
Author

pedro-w commented Dec 14, 2018

This small HTML file doesn't work for me.

<!DOCTYPE html>
<html>
<head><title>Example</title></head>
<body>
<div style="color:red;">Some Text</div>
</body>
</html>

I see this:
vscode

The cursor was just after the semicolon in color:red; and the intellisense suggestions are just words from the text. Also there is no color preview. I believe this was different in 1.29.

@pedro-w
Copy link
Author

pedro-w commented Dec 14, 2018

Also I repeated this with --disable-extensions and the result was the same.

@pedro-w
Copy link
Author

pedro-w commented Dec 14, 2018

OK I had a look in the Console of the Developer Tools and I saw this, which has some errors that may be pertinent.

/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:5724 [ms-python.python]: Command `python.datascience.exportoutputasnotebook` appears multiple times in the `commands` section.
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1504  INFO no standard startup: not the explorer viewlet
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:3269 [Extension Host] debugger listening on port 62784
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:3267 Extension Host
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:3267 Debugger listening on ws://127.0.0.1:62784/14f6938f-c11e-47b5-a293-4d7f303b3cd3
For help see https://nodejs.org/en/docs/inspector

/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Activating extension 'vscode.html-language-features' failed: Cannot read property '0' of undefined.
t.log @ /C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Activating extension `vscode.html-language-features` failed:  Cannot read property '0' of undefined
t.log @ /C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Here is the error stack:  TypeError: Cannot read property '0' of undefined
	at t.activate (c:\Users\p\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\html-language-features\client\dist\htmlMain.js:1:117061)
	at Function.t._callActivateOptional (c:\Users\p\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:759:329)
	at Function.t._callActivate (c:\Users\p\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:759:6)
	at c:\Users\p\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:758:173
	at <anonymous>
/C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:5724 Activating extension 'vscode.html-language-features' failed: Cannot read property '0' of undefined.
t._logMessageInConsole @ /C:/Users/p/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:5724

@pedro-w
Copy link
Author

pedro-w commented Dec 14, 2018

Alright might have made some progress on this.
It seems that if you open an HTML file without a folder open, the problem occurs. If you have a folder open, it works as it should. Now, in this code (added recently in 2f51c4e):
https://github.com/Microsoft/vscode/blob/2e783e0e971ccfb06b918d8ecd5d0aaa94185884/extensions/html-language-features/client/src/htmlMain.ts#L55-L60
The docs tell me that workspace.workspaceFolders returns an array or undefined if there is no folders open. I'm not a TS expert but I believe you can't just use type-assertion on workspaceFolders if it might be undefined.
https://github.com/Microsoft/vscode/blob/2808feeaf6b24feaaa6ba49fb91ea165c4d5fb06/src/vs/vscode.d.ts#L7333-L7339
Hope that helps.

@octref octref added bug Issue identified by VS Code Team member as probable bug html HTML support issues and removed info-needed Issue requires more information from poster labels Dec 14, 2018
@octref
Copy link
Contributor

octref commented Dec 14, 2018

I see. This only happens for HTML files opened on no workspace.

@octref octref added the candidate Issue identified as probable candidate for fixing in the next release label Dec 14, 2018
@octref octref added this to the November 2018 Recovery milestone Dec 14, 2018
@octref octref closed this as completed in 9b5795b Dec 14, 2018
octref added a commit that referenced this issue Dec 14, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 28, 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 candidate Issue identified as probable candidate for fixing in the next release html HTML support issues
Projects
None yet
Development

No branches or pull requests

4 participants