Skip to content

Bug: URI in comment after shebang is syntax-highlighted until its argument. #23

Open

Description

@beedell-roke

What type of issues are you dealing with?

Incorrect highlighting

What happened?

Image

This applies even if the comment isn't indented.

Which text editors are you seeing the problem on?

VSCode

Include a code snippet

#!/usr/bin/env xdg-open
	# https://learn.microsoft.com/en-us/search/?scope=Minecraft&view=minecraft-bedrock-stable&terms=shebang
effect give @e minecraft:speed 99999 255 true
	# Gives all entities speed 255 for 99 999s.

Activity

  1. beedell-roke commented on Mar 6, 2025

    @beedell-roke
    Author

    #23 (comment)

    It appears to reproduce on GitHub, too!

    Image

  2. rx-dev commented on Mar 6, 2025

    @rx-dev
    Collaborator

    Ah, this is due to #! being considered for block comments.. A space between the first and second lines would break the block. I haven't seen #! bang comments being used for mcfunction, interesting

  3. rx-dev commented on Mar 6, 2025

    @rx-dev
    Collaborator

    This might be Won't Fix but wondering if there are stronger opinions

  4. beedell-roke commented on Mar 7, 2025

    @beedell-roke
    Author

    #23 (comment)

    @ritikshah, for a script file to be correctly interpretable as such in Linux-based OSes, especially when executable (chmod +x), it requires a shebang at the start of the file, denoted with the #! syntax. ECMAScript nowadays supports this, 1 and Python has always supported it, so it's not uncommon. Having xdg-open set as the default invoker allows it to be executable, but still be set to the OS or DE's default file-to-application association.

    Footnotes

    1. github.com/tc39/proposal-hashbang ↩

  5. rx-dev commented on Apr 4, 2026

    @rx-dev
    Collaborator

    #23 (comment)

    @ritikshah, for a script file to be correctly interpretable as such in Linux-based OSes, especially when executable (chmod +x), it requires a shebang at the start of the file, denoted with the #! syntax. ECMAScript nowadays supports this, 1 and Python has always supported it, so it's not uncommon. Having xdg-open set as the default invoker allows it to be executable, but still be set to the OS or DE's default file-to-application association.

    there's nothing to execute though?

    Footnotes

    1. github.com/tc39/proposal-hashbang ↩

  6. beedell-roke commented on Apr 4, 2026

    @beedell-roke
    Author

    @rx-dev, with enable-rcon=true, it should be trivial to send to an active MC instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions