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

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

Open
RokeJulianLockhart opened this issue Mar 6, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Mar 6, 2025

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.
@RokeJulianLockhart RokeJulianLockhart added the bug Something isn't working label Mar 6, 2025
@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Mar 6, 2025

#23 (comment)

It appears to reproduce on GitHub, too!

Image

@rx-dev
Copy link
Collaborator

rx-dev commented Mar 6, 2025

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

@rx-dev
Copy link
Collaborator

rx-dev commented Mar 6, 2025

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

@RokeJulianLockhart
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants