Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Support/PowershellSyntax.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
</dict>
Copy link
Member

Choose a reason for hiding this comment

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

Also, this is not a master file. xml is generated from YAML. For details check out http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/extensibility/syntaxdefs.html

Copy link
Member

Choose a reason for hiding this comment

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

True, but it does not really matter if the XML is edited directly. We should nevertheless add some contributing guidelines so collaborators now there are more convenient tools.

Copy link
Member

Choose a reason for hiding this comment

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

In fact, we need to delete the YAML file. That one should be generated each time it's needed at dev time, then deleted and not committed.

Copy link
Member

Choose a reason for hiding this comment

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

That's an interesting approach. Is YAML guaranteed to be the same (preserve comments for instance)?
Anyway, Contribute section in README.md is needed for sure.

Copy link
Member

Choose a reason for hiding this comment

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

@FichteFoll is the expert here. I believe so.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I can move my change to the YAML if you prefer.

Copy link
Member

Choose a reason for hiding this comment

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

@william-voyek No need to. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Comments are only preserved if they are part of the data object (i.e. comment: Comment here), but not if they are language comments.

I generally prefer to only edit the YAML and put a few language comments next to my stuff. I also indent multi-line expressions in a certain way and I'm actually not sure if they are preserved. But of course, if you'd like to keep things together for potential other conversions, following that convention is fine too.

<dict>
<key>begin</key>
<string>@"$</string>
<string>^@"\n</string>
Copy link
Member

Choose a reason for hiding this comment

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

This would not work here:

$someVar = @"
hello
"@

Copy link
Member

Choose a reason for hiding this comment

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

Also, I think a lookahead would be preferable:

@"(?=\n)

Copy link
Author

Choose a reason for hiding this comment

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

I believe that it works properly. With my change:
__desktop_serversetup_ps1 2

Without change:
__desktop_serversetup_ps1

Also using the lookahead gives the same result as the unmodified syntax file.

<key>end</key>
<string>^"@</string>
<key>name</key>
Expand Down Expand Up @@ -205,9 +205,9 @@
</dict>
<dict>
<key>begin</key>
<string>@'$</string>
<string>@'\n</string>
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I forgot to mention to do the same as above. Let's add a lookahead here too for consistency.

<key>end</key>
<string>^'@</string>
<string>^'@$</string>
<key>name</key>
<string>string.quoted.single.heredoc.powershell</string>
<key>patterns</key>
Expand Down