vscode-code-outline icon indicating copy to clipboard operation
vscode-code-outline copied to clipboard

Code outline with EJS files

Open rfossella opened this issue 7 years ago • 5 comments

Hello, Running Vscode w/Code Outline - thanks for a great extension.

I'm having an issue when editing EJS files with warning message "Cannot read property 'toLowerCase' of undefined".

When I collapse Code Outline (or disable the extension) the warning disappears.

Is there an update or setting for this? Is there something more I can send to help diagnose?

Thanks. Rob

rfossella avatar Dec 18 '17 07:12 rfossella

I'll investigate. Could you provide a short file that reproduces this and does not contain any sensitive information?

patrys avatar Dec 18 '17 11:12 patrys

Hi. The following code will trigger the warning message. It uses a few variables and displays a list of users in an html table. Please see the comment below that reads: the block below is suspect with code outline.
When I remove the for() block the warning disappears. Please let me know if this is enough for you. Thanks!

<html>
	<head>
		<title><%= title %></title>
		<link rel='stylesheet' href='/stylesheets/style.css' />
	</head>
	<body>
		<h1>USERS <%= heading %></h1>
			<table border width="60%">
			<tr align="left">
				<th>NAME</th>
				<th>ID</th>
			</tr>
			<!-- the block below is suspect with code outline -->
			<% for(var i=0; i < myUsers.length; i++) { %>
			<tr>
				<td><%= myUsers[i].name %></td>
				<td><%= myUsers[i].id %></td>
			</tr>
			<% } %>
			</table>
	</body>
</html>

rfossella avatar Dec 18 '17 22:12 rfossella

Hi. Just a quick ping regarding ejs parsing. Thanks.

rfossella avatar Dec 30 '17 01:12 rfossella

ping

rfossella avatar Jan 15 '18 09:01 rfossella

Sorry, I'll get around to it eventually but it's unfortunately not my daily job. The source code is public so maybe you could start investigating on your own?

patrys avatar Jan 15 '18 11:01 patrys