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 Dockerfile highlighting #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add Dockerfile highlighting #56

wants to merge 2 commits into from

Conversation

Sobak
Copy link
Collaborator

@Sobak Sobak commented Feb 3, 2024

Remaining:

  • keywords are highlighted even mid-sentence (see line 19 in token snapshot)
  • integers should not be highlighted in some contexts (see e.g. first line in token snapshot)
  • failing tests in this PR?

As for 0.10.0, I propose to merge this PR to master (eventually), then to branch off with 0.9.x and then we can continue 0.10.x development on master.

I can even take care of porting changes back and forth, if that ever becomes a necessity because I feel like 0.9.x would be getting just bugfixes and/or new languages, not the bigger changes anyways.

@Sobak Sobak requested a review from kadet1090 February 3, 2024 14:33
@Sobak Sobak force-pushed the feature/lang-dockerfile branch 2 times, most recently from 3888dc8 to d6bc835 Compare February 4, 2024 00:14
];

$this->rules->add('keyword', new Rule(
new RegexMatcher('/^\s*\b(' . implode('|', $keywords) . ')\b/mi'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if that \b is required since it must be first word of a line? The same goes for the last one - it should probably be \s as I don't think that syntax like RUN["test"] is a valid one? Not sure however.

{
return [
'name' => ['dockerfile'],
'extension' => ['Dockerfile'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use also other common formats like *.Dockerfile, *-Dockerfile, Dockerfile-*.

Comment on lines 20 to 22
private $_languageOverrides = [
'*.Dockerfile' => 'dockerfile',
];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only ensures me that it should be simply in extensions metadata because it just feels hacky.

@Sobak Sobak requested a review from kadet1090 February 10, 2024 22:41
@Sobak Sobak marked this pull request as ready for review February 11, 2024 09:06
@Sobak Sobak mentioned this pull request Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants