-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 Slice language (.ice) #4243
Conversation
The errors seem unrelated, or maybe I'm mistaken? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request!
Please include a Lightshow example for the grammar as per the template.
Thanks, @pchaigno. I've added that. |
Are these files also Slice? They look like JSON.
|
Looking now. My suspicion is licensed has changed again 😞 |
@lildude Actually, it's Licensee this time. I filled an issue: licensee/licensee#328. |
Yeah, I was just about to confirm this. |
Yeah, most of those are definitely JSON. Some binary files too. |
We'll need to find a way to distinguish JSON and Slice files then. |
Ok, I'll add a heuristic for Slice to |
Ok, so I was going to add:
This should be a good check for Is this okay? |
@externl Could you update your branch with the latest master? It includes a fix for the Travis CI tests.
Would checking for the root object of the JSON document ( |
@pchaigno I've merged in the latest. Maybe the best is to just not check for JSON, leave it non-highlighted? |
Unfortunately, that's not an option our classifier has at the moment. With this pull request all |
What happens to files that don't match the heuristic?
vs
? |
They go to the naïve Bayesian classifier (see How Linguist Works) which assigns a score to each language based on the tokens identified in the file. |
@pchaigno I've rebased my branch on the latest. Do you still want me to look into adding a JSON disambiguations check for these other |
Yep. Don't forget to check for leading whitespace too (either vertical or horizontal). E.g, something like this should be enough: /\A\s*[{[]/ |
@externl Could you implement the above heuristic rule with the corresponding test in |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? In my recent commit I added the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line appears to have been modified, although GitHub's diff-view isn't showing what changed... Strange.
A trailing newline may have been added or removed when you edited the license, but GitHub normally indicates that with an 🚫 icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah my local diff shows that I added a trailing newline
diff --git a/vendor/licenses/grammar/vscode-slice.txt b/vendor/licenses/grammar/vscode-slice.txt
index b1e84f5c..0103ec63 100644
--- a/vendor/licenses/grammar/vscode-slice.txt
+++ b/vendor/licenses/grammar/vscode-slice.txt
@@ -1,6 +1,7 @@
---
type: grammar
name: vscode-slice
+version: 6a28c2125bb442fa6a7f31c995ce423b1c9bbfb7
license: bsd-3-clause
---
BSD 3-Clause License
@@ -31,4 +32,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ah whoops, my bad. Sorry, that expression should have been: /\A\s*[{\[]/ |
Is this correct?
|
Looks fine to me. |
How do I fix:
|
You need to ensure that the SHA in the version is the same as the SHA for the committed grammar submodule. Committed submodule SHA: As you can see, they're not the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @externl for your patience!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm mortified that I didn't think to make an "Ice-ense" pun somewhere, though. 😓
ace_mode: text | ||
extensions: | ||
- ".ice" | ||
language_id: 894641667 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errm, don't you want a colour associated with this language? At the moment it's going to fallback to the default of #cccccc
.
Looking at https://doc.zeroc.com/ice/latest/the-slice-language, it seems blue is the colour of choice so it's probably going to be a PITA to find one that doesn't conflict with one already associated with a language on GitHub.com - blue is really really popular.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, would definitely like a colour. Can we use #477ed0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt it. Various shades of blue are already highly used. Try it. Add the color:
entry and then run bundle exec ruby test/test_color_proximity.rb
(I'm assuming you've already run script/bootstrap
). Rinse and repeat until you find a colour the test likes, then commit your colour and push.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lildude, I found a blue! #003fa2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 nice!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the PR and welcome to the world of Linguist.
Add new language syntax for Slice
Checklist:
According to the contributing guide this was not needed as there are no other languages using
.ice
.