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

Add semantic highlighting support for Dockerfiles #1840

Closed
rcjsuen opened this issue Apr 9, 2020 · 17 comments
Closed

Add semantic highlighting support for Dockerfiles #1840

rcjsuen opened this issue Apr 9, 2020 · 17 comments

Comments

@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 9, 2020

With the finalization of the semantic highlighting API in Visual Studio Code 1.44, the Docker extension can now look to resolving long standing bug reports about malformed syntax highlighting in Dockerfiles using code instead of a TextMate grammar. I have tried to do a sweep of the GitHub issues that have been opened in the past to capture the various requests and bug reports about syntax highlighting in Dockerfiles.

Open question:
The extension currently depends on Visual Studio Code 1.41 which was released in December 2019.

vscode-docker/package.json

Lines 2439 to 2441 in 95fb889

"engines": {
"vscode": "^1.41.0"
},

Adding semantic highlighting support will change this dependency to 1.44. Not sure to me how many users would be affected by this. Does Microsoft have telemetry information about this to know what percentage of this extension's users are on which release of Visual Studio Code?

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Apr 9, 2020

I took a look at the last 24 hours, here's the numbers we have for Docker extension v1.0.0 users:

Version Machine Count
1.44.0 31491
1.43.2 76223
1.43.1 3789
1.43.0 3316
1.42.1 3604
1.42.0 733
1.41.1 2469
1.41.0 306

These count the highest version a machine reported in the last 24 hours, i.e. people who have upgraded will only show up in 1.44.0.

The fact that the overwhelming majority of the numbers are in 1.43.2 or 1.44.0 tells me that nearly everyone stays up to date. I'll keep an eye on these numbers throughout the week, it hasn't even been 24 hours since 1.44.0 released so it can be expected to get even higher.

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 9, 2020

@bwateratmsft The vscode.Terminal interface changed in 1.42 so the test/TestTerminalProvider.ts must be updated.

class TestTerminal implements vscode.Terminal {

@bwateratmsft
Copy link
Collaborator

Incidentally TerminalProvider is on its way out the door, #251

@dbreshears
Copy link
Member

dbreshears commented Apr 14, 2020

Let's monitor telemetry and wait for adoption of 1.44 to get closer to 80 to 90% and discuss before completed

@dbreshears dbreshears added the P2 label Apr 14, 2020
@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Apr 15, 2020

We're nearly there already. This is among our extension version 1.0.0 users, last 24 hours:

Version Count % of Total
1.44.1 33316 25.6
1.44.0 64414 49.5
1.43.2 20371 15.7
1.43.1 2752 2.1
1.43.0 2695 2.1
1.42.1 3221 2.5
1.42.0 687 .5
1.41.1 2357 1.8
1.41.0 310 .2

1.44 already accounts for ~75%.

It's been ~5 weeks since 1.43.0 released, currently ~95% are >= 1.43.0. Our tentative plan for 1.2.0 release puts it at ~5 weeks after 1.44.0. So in theory that means when we release, we'll be at 95% upgraded.

@bwateratmsft
Copy link
Collaborator

@rcjsuen If you're ready, go ahead and prep a PR so we can get the change into the release as early as possible in the cycle. Thanks again!

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 17, 2020

@bwateratmsft Sorry, perhaps I should have been more clear when I commented earlier.

Can someone fix these compiler errors first (which can be observed simply by changing the dependency to 1.42)?

image

@bwateratmsft
Copy link
Collaborator

Ah, yes, I'll be getting that fixed when I merge https://github.com/microsoft/vscode-docker/tree/bmw/terminals which should be soon, probably early-mid next week.

This was referenced Apr 20, 2020
@bwateratmsft
Copy link
Collaborator

@rcjsuen You should now be unblocked. I upgraded the engine to 1.44 and fixed the bug (#1891); (though not by removing ITerminalProvider as originally planned, which ended up being nightmarishly complicated due to shell quoting issues).

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 21, 2020

@bwateratmsft Thanks! I'll submit a pull request later today or tomorrow to enable semantic highlighting.

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 21, 2020

@bwateratmsft I have opened #1899.

@bwateratmsft
Copy link
Collaborator

@rcjsuen We can close this now that #1899 is submitted, right?

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 23, 2020

@rcjsuen We can close this now that #1899 is submitted, right?

@bwateratmsft I think we are good for the most part. Should I open a separate issue regarding the configuration of custom colours or should we just forget about it?

To everyone else, I'll reiterate what was posted in #1899 as a reference for toggling this with the JSON settings editor.

  1. How do I enable/disable semantic highlighting?

    "editor.semanticHighlighting.enabled": true
  2. How do I enable/disable semantic highlighting only for Dockerfiles?

    "[dockerfile]": {
        "editor.semanticHighlighting.enabled": true
    }

@bwateratmsft
Copy link
Collaborator

Should I open a separate issue regarding the configuration of custom colours or should we just forget about it?

@rcjsuen Yeah, I think that can be separate from this.

@rcjsuen
Copy link
Contributor Author

rcjsuen commented Apr 23, 2020

Should I open a separate issue regarding the configuration of custom colours or should we just forget about it?

@rcjsuen Yeah, I think that can be separate from this.

@bwateratmsft OK. Let me do some research and then open an issue when I have something to share. I think we can close this then.

Thanks for your support and for answering the various questions I've been asking of you all!

@bwateratmsft
Copy link
Collaborator

Thank you for the language server!

@bwateratmsft
Copy link
Collaborator

This feature is now available in version 1.2.0 of the Docker extension.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants