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

Missing JavaScript syntax highlight in HTML #83541

Closed
ProviceUnify opened this issue Oct 29, 2019 · 9 comments
Closed

Missing JavaScript syntax highlight in HTML #83541

ProviceUnify opened this issue Oct 29, 2019 · 9 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 regression Something that used to work is now broken tokenization Text tokenization verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@ProviceUnify
Copy link

ProviceUnify commented Oct 29, 2019

After last update (~29.10.2019) JavaScript syntax not highlight in HTML between tags <script> (InteliSense yet works)
UPD: Issue has only on VSCode Insider
image

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>History Random Date Selector</title>
</head>

<body>


    <script>

        function shuffle() {
            $("#text").text('');
            // var arrOneDate = ['862-879', '882', '988', '1019-1054', '1116', '1147', '1223', '1237-1240', '1240', '1242', '1380', '1425-1462', '1462-1505', '1497', '1530-1584', '1550', '1565-1572', '1598-1613', '1610-1612', '4 ноя. 1612'];

            // var arrTwoDate = ['1613-1645', '1645-1676', '1649', '1672-1725', '1700-1721', '1709', '1714', '1720', '1725-1762', '1762-1796'];

            var arrOne = [
                // 'Княжение Рюрика в Новгороде', 'Объединение Руси по властью Олега, образование Киевской Руси', 'Крещение Руси (Владимир)', 'Правление Ярослава Мудрого', 'Летопись "Повесть Временных лет"', '1-ое упоминание Москвы (Долгорукий)', 'Битва на р. Калка', 'Походы Батыя на Русь', 'Невская битва', 'Ледовое побоище', 'Куликовская битва', 'Княжение Василия II-Тёмного', 'Княжение Ивана III', 'Судебник Ивана III', 'Годы жизни Ивана Грозного', 'Судебник Ивана Грозного', 'Период опричнины', 'Смутное время', 'Окупация Москвы польскими войсками', 'Освобождение Москвы от интервентов'
            ];

            var arrTwo = ['Период царствования Михаила Романова', 'Царствование Алексея Михайловича', 'Соборное уложение Алексея Михайловича', 'Годы жизни Петра I', 'Северная война'/*, 'Полтавская битва', 'Победа русского флота при мысе Гангут', 'Победа русского флота у о. Гернгам', 'Дворцовые перевороты', 'Царствование Екатеринаы II'*/];

            console.log(arrOne.length);
            console.log(arrTwo.length);




            var arr = arrOne.concat(arrTwo);

            console.log(arr.length);

            var j, temp;
            for (var i = arr.length - 1; i >= 0; i--) {
                console.log(i);
                
                j = Math.floor(Math.random() * (i + 1));
                temp = arr[j];
                arr[j] = arr[i];
                arr[i] = temp;
                // document.write(arr[i] + "<br>");
                $("#text").append(arr[i] + "<br><br>");
            }
            // return arr;
            // document.write(arr);
        }
    // shuffle();
    </script>

    <input type="button" onclick="shuffle()" value="press for date">
    <br>
    <br>
    <br>
    <div id="text">

    </div>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</body>

</html>
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 29, 2019

Please share the text of the code along with screenshots

@aeschli aeschli assigned alexr00 and unassigned aeschli Oct 30, 2019
@alexr00
Copy link
Member

alexr00 commented Oct 30, 2019

Also, does this reproduce if you disable all extensions?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Oct 30, 2019
@ProviceUnify
Copy link
Author

ProviceUnify commented Oct 30, 2019

Please share the text of the code along with screenshots

Just a random selector of events Russian history from array. Private use

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>History Random Date Selector</title>
</head>

<body>


    <script>

        function shuffle() {
            $("#text").text('');
            // var arrOneDate = ['862-879', '882', '988', '1019-1054', '1116', '1147', '1223', '1237-1240', '1240', '1242', '1380', '1425-1462', '1462-1505', '1497', '1530-1584', '1550', '1565-1572', '1598-1613', '1610-1612', '4 ноя. 1612'];

            // var arrTwoDate = ['1613-1645', '1645-1676', '1649', '1672-1725', '1700-1721', '1709', '1714', '1720', '1725-1762', '1762-1796'];

            var arrOne = [
                // 'Княжение Рюрика в Новгороде', 'Объединение Руси по властью Олега, образование Киевской Руси', 'Крещение Руси (Владимир)', 'Правление Ярослава Мудрого', 'Летопись "Повесть Временных лет"', '1-ое упоминание Москвы (Долгорукий)', 'Битва на р. Калка', 'Походы Батыя на Русь', 'Невская битва', 'Ледовое побоище', 'Куликовская битва', 'Княжение Василия II-Тёмного', 'Княжение Ивана III', 'Судебник Ивана III', 'Годы жизни Ивана Грозного', 'Судебник Ивана Грозного', 'Период опричнины', 'Смутное время', 'Окупация Москвы польскими войсками', 'Освобождение Москвы от интервентов'
            ];

            var arrTwo = ['Период царствования Михаила Романова', 'Царствование Алексея Михайловича', 'Соборное уложение Алексея Михайловича', 'Годы жизни Петра I', 'Северная война'/*, 'Полтавская битва', 'Победа русского флота при мысе Гангут', 'Победа русского флота у о. Гернгам', 'Дворцовые перевороты', 'Царствование Екатеринаы II'*/];

            console.log(arrOne.length);
            console.log(arrTwo.length);




            var arr = arrOne.concat(arrTwo);

            console.log(arr.length);

            var j, temp;
            for (var i = arr.length - 1; i >= 0; i--) {
                console.log(i);
                
                j = Math.floor(Math.random() * (i + 1));
                temp = arr[j];
                arr[j] = arr[i];
                arr[i] = temp;
                // document.write(arr[i] + "<br>");
                $("#text").append(arr[i] + "<br><br>");
            }
            // return arr;
            // document.write(arr);
        }
    // shuffle();
    </script>

    <input type="button" onclick="shuffle()" value="press for date">
    <br>
    <br>
    <br>
    <div id="text">

    </div>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
</body>

</html>

@ProviceUnify
Copy link
Author

Also, does this reproduce if you disable all extensions?

By disabling all extensions nothing happened. But accidentally, when touching extension which has affect on editor, syntax highlight can randomly turning on. After restarting Visual Code syntax highlight again disappeared

@alexr00
Copy link
Member

alexr00 commented Oct 30, 2019

Looks like this is extension related then. I can't reproduce with the example. Did you reload after disabling the extensions so that the disable took effect?

@ProviceUnify
Copy link
Author

ProviceUnify commented Oct 30, 2019

Looks like this is extension related then. I can't reproduce with the example. Did you reload after disabling the extensions so that the disable took effect?

Yes, I disable all extentions and reload. No JS syntax in HTML

@ProviceUnify
Copy link
Author

Looks like this is extension related then. I can't reproduce with the example. Did you reload after disabling the extensions so that the disable took effect?

Also I forgot notice, that issue caused only on VSCode Insider version. Sorry

@dragz
Copy link

dragz commented Nov 5, 2019

I have the same issue with the latest Insiders. See screenshot with VS Code Insiders to the left and VS Code to the right. Both are reloaded with extensions disabled.

The code is trivial.

image

@alexr00
Copy link
Member

alexr00 commented Nov 6, 2019

simple copy pastable example:

<html>
	<body>
		<h1>testing</h1>
		Just a hightlight test.
		<script>
			const avar = 1.0;
		</script>
	</body>
</html>

Issue is that the contents of <script> are not being highlighted. Only occurs when you don't first open a ts/js file. Simple exact steps:

  1. Open VS Code
  2. Close all files
  3. Reload
  4. Open or create a file with the above html and set the language to html for it

@mjbvz could this be related to the injection work you've done?

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug languages-basic Basic language support issues candidate Issue identified as probable candidate for fixing in the next release and removed info-needed Issue requires more information from poster labels Nov 6, 2019
@alexr00 alexr00 added this to the October 2019 milestone Nov 6, 2019
@alexdima alexdima assigned alexdima and unassigned alexr00 Nov 6, 2019
@alexdima alexdima added tokenization Text tokenization regression Something that used to work is now broken and removed languages-basic Basic language support issues labels Nov 6, 2019
@alexdima alexdima closed this as completed Nov 6, 2019
@alexdima alexdima added the verification-needed Verification of issue is requested label Nov 6, 2019
@mjbvz mjbvz added the verified Verification succeeded label Nov 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 21, 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 regression Something that used to work is now broken tokenization Text tokenization verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants