From c7d2c7f9e704afe11a1592afc8721394eb14487d Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:23:20 +0000 Subject: [PATCH 1/6] Add entry to language.yml and grammar --- .gitmodules | 3 ++ grammars.yml | 2 ++ lib/linguist/languages.yml | 12 +++++++ vendor/README.md | 1 + vendor/grammars/iCalendar-sublime | 1 + .../git_submodule/iCalendar-sublime.dep.yml | 33 +++++++++++++++++++ 6 files changed, 52 insertions(+) create mode 160000 vendor/grammars/iCalendar-sublime create mode 100644 vendor/licenses/git_submodule/iCalendar-sublime.dep.yml diff --git a/.gitmodules b/.gitmodules index 05a2491880..19f34147ee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -533,6 +533,9 @@ [submodule "vendor/grammars/hoon-grammar"] path = vendor/grammars/hoon-grammar url = https://github.com/pkova/hoon-grammar.git +[submodule "vendor/grammars/iCalendar-sublime"] + path = vendor/grammars/iCalendar-sublime + url = https://github.com/kimsey0/iCalendar-sublime.git [submodule "vendor/grammars/ide-tools"] path = vendor/grammars/ide-tools url = https://github.com/toitware/ide-tools.git diff --git a/grammars.yml b/grammars.yml index 23c95ad2f7..6116ac88ca 100644 --- a/grammars.yml +++ b/grammars.yml @@ -444,6 +444,8 @@ vendor/grammars/holyc.tmbundle: - source.hc vendor/grammars/hoon-grammar: - source.hoon +vendor/grammars/iCalendar-sublime: +- source.iCalendar vendor/grammars/ide-tools: - source.toit vendor/grammars/idl.tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index aae547bd83..1c954eb479 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3160,6 +3160,18 @@ Isabelle ROOT: tm_scope: source.isabelle.root ace_mode: text language_id: 171 +iCalendar: + type: data + color: "#ec564c" + extensions: + - ".ics" + - ".ical" + tm_scope: source.iCalendar + aliases: + - iCal + ace_mode: text + codemirror_mode: properties + codemirror_mime_type: text/calendar J: type: programming color: "#9EEDFF" diff --git a/vendor/README.md b/vendor/README.md index bb42a892d3..54b0d15dc2 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -659,6 +659,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **edn:** [atom/language-clojure](https://github.com/atom/language-clojure) - **fish:** [l15n/fish-tmbundle](https://github.com/l15n/fish-tmbundle) - **hoon:** [pkova/hoon-grammar](https://github.com/pkova/hoon-grammar) +- **iCalendar:** [kimsey0/iCalendar-sublime](https://github.com/kimsey0/iCalendar-sublime) - **jq:** [wader/language-jq](https://github.com/wader/language-jq) - **kvlang:** [p0lygun/kivy-language-grammer](https://github.com/p0lygun/kivy-language-grammer) - **mIRC Script:** [gen-angry/language-msl](https://github.com/gen-angry/language-msl) diff --git a/vendor/grammars/iCalendar-sublime b/vendor/grammars/iCalendar-sublime new file mode 160000 index 0000000000..ee1aaa8a96 --- /dev/null +++ b/vendor/grammars/iCalendar-sublime @@ -0,0 +1 @@ +Subproject commit ee1aaa8a96cc72c45be5dbbb02ec8f994a414e23 diff --git a/vendor/licenses/git_submodule/iCalendar-sublime.dep.yml b/vendor/licenses/git_submodule/iCalendar-sublime.dep.yml new file mode 100644 index 0000000000..c1e684f575 --- /dev/null +++ b/vendor/licenses/git_submodule/iCalendar-sublime.dep.yml @@ -0,0 +1,33 @@ +--- +name: iCalendar-sublime +version: ee1aaa8a96cc72c45be5dbbb02ec8f994a414e23 +type: git_submodule +homepage: https://github.com/kimsey0/iCalendar-sublime.git +license: mit +licenses: +- sources: LICENSE + text: |+ + The MIT License (MIT) + + Copyright (c) 2015 kimsey0 + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +notices: [] +... From 2d11f1e69d66930ef1dc237c9fe9a7d1f2c4498a Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:37:10 +0000 Subject: [PATCH 2/6] Add samples --- samples/iCalendar/2024.ics | 121 ++++++++++++++++++++++++++++++++++ samples/iCalendar/todo-2.ical | 17 +++++ 2 files changed, 138 insertions(+) create mode 100644 samples/iCalendar/2024.ics create mode 100644 samples/iCalendar/todo-2.ical diff --git a/samples/iCalendar/2024.ics b/samples/iCalendar/2024.ics new file mode 100644 index 0000000000..c5b081137d --- /dev/null +++ b/samples/iCalendar/2024.ics @@ -0,0 +1,121 @@ +BEGIN:VCALENDAR +VERSION:2.0 +METHOD:PUBLISH +CLASS:PUBLIC +X-WR-CALDESC:中国法定节假日数据,自动每日抓取国务院公 + 告。 +X-WR-CALNAME:中国法定节假日 +BEGIN:VTIMEZONE +TZID:Asia/Shanghai +BEGIN:STANDARD +DTSTART;VALUE=DATE-TIME:19700101T000000 +TZOFFSETFROM:+0800 +TZOFFSETTO:+0800 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +SUMMARY:元旦假期 +DTSTART;VALUE=DATE:20240101 +DTEND;VALUE=DATE:20240102 +DTSTAMP;VALUE=DATE:20240101 +UID:2024-01-01/2024-01-02/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补春节假期) +DTSTART;VALUE=DATE:20240204 +DTEND;VALUE=DATE:20240205 +DTSTAMP;VALUE=DATE:20240204 +UID:2024-02-04/2024-02-05/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:春节假期 +DTSTART;VALUE=DATE:20240210 +DTEND;VALUE=DATE:20240218 +DTSTAMP;VALUE=DATE:20240210 +UID:2024-02-10/2024-02-18/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补春节假期) +DTSTART;VALUE=DATE:20240218 +DTEND;VALUE=DATE:20240219 +DTSTAMP;VALUE=DATE:20240218 +UID:2024-02-18/2024-02-19/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:清明节假期 +DTSTART;VALUE=DATE:20240404 +DTEND;VALUE=DATE:20240407 +DTSTAMP;VALUE=DATE:20240404 +UID:2024-04-04/2024-04-07/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补清明节假期) +DTSTART;VALUE=DATE:20240407 +DTEND;VALUE=DATE:20240408 +DTSTAMP;VALUE=DATE:20240407 +UID:2024-04-07/2024-04-08/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补劳动节假期) +DTSTART;VALUE=DATE:20240428 +DTEND;VALUE=DATE:20240429 +DTSTAMP;VALUE=DATE:20240428 +UID:2024-04-28/2024-04-29/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:劳动节假期 +DTSTART;VALUE=DATE:20240501 +DTEND;VALUE=DATE:20240506 +DTSTAMP;VALUE=DATE:20240501 +UID:2024-05-01/2024-05-06/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补劳动节假期) +DTSTART;VALUE=DATE:20240511 +DTEND;VALUE=DATE:20240512 +DTSTAMP;VALUE=DATE:20240511 +UID:2024-05-11/2024-05-12/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:端午节假期 +DTSTART;VALUE=DATE:20240610 +DTEND;VALUE=DATE:20240611 +DTSTAMP;VALUE=DATE:20240610 +UID:2024-06-10/2024-06-11/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补中秋节假期) +DTSTART;VALUE=DATE:20240914 +DTEND;VALUE=DATE:20240915 +DTSTAMP;VALUE=DATE:20240914 +UID:2024-09-14/2024-09-15/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:中秋节假期 +DTSTART;VALUE=DATE:20240915 +DTEND;VALUE=DATE:20240918 +DTSTAMP;VALUE=DATE:20240915 +UID:2024-09-15/2024-09-18/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补国庆节假期) +DTSTART;VALUE=DATE:20240929 +DTEND;VALUE=DATE:20240930 +DTSTAMP;VALUE=DATE:20240929 +UID:2024-09-29/2024-09-30/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:国庆节假期 +DTSTART;VALUE=DATE:20241001 +DTEND;VALUE=DATE:20241008 +DTSTAMP;VALUE=DATE:20241001 +UID:2024-10-01/2024-10-08/NateScarlet/holiday-cn +END:VEVENT +BEGIN:VEVENT +SUMMARY:上班(补国庆节假期) +DTSTART;VALUE=DATE:20241012 +DTEND;VALUE=DATE:20241013 +DTSTAMP;VALUE=DATE:20241012 +UID:2024-10-12/2024-10-13/NateScarlet/holiday-cn +END:VEVENT +END:VCALENDAR \ No newline at end of file diff --git a/samples/iCalendar/todo-2.ical b/samples/iCalendar/todo-2.ical new file mode 100644 index 0000000000..7478862144 --- /dev/null +++ b/samples/iCalendar/todo-2.ical @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//K Desktop Environment//NONSGML KOrganizer 5.18.2 (21.08.2)//EN +VERSION:2.0 +X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0 +BEGIN:VTODO +ORGANIZER;CN=Stable:MAILTO:gjDitchfield@acm.org +DTSTAMP:20210922T202815Z +CREATED:20210922T202800Z +UID:c962d358-f448-43fc-ac2f-4a629625a7a9 +SEQUENCE:1 +LAST-MODIFIED:20210922T202815Z +SUMMARY:completed to-do +COMPLETED:20210922T202815Z +PERCENT-COMPLETE:100 +STATUS:COMPLETED +END:VTODO +END:VCALENDAR \ No newline at end of file From 5ff0df1ece9e131108acef2774e9f9496f1c934d Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:41:58 +0000 Subject: [PATCH 3/6] Run script/update-ids --- lib/linguist/languages.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 1c954eb479..f35d297b29 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -943,11 +943,11 @@ Caddyfile: type: data color: "#22b638" aliases: - - Caddy + - Caddy extensions: - - ".caddyfile" + - ".caddyfile" filenames: - - Caddyfile + - Caddyfile ace_mode: text tm_scope: source.Caddyfile language_id: 615465151 @@ -3172,6 +3172,7 @@ iCalendar: ace_mode: text codemirror_mode: properties codemirror_mime_type: text/calendar + language_id: 98384424 J: type: programming color: "#9EEDFF" @@ -5371,7 +5372,7 @@ Pkl: extensions: - ".pkl" interpreters: - - pkl + - pkl tm_scope: source.pkl ace_mode: text language_id: 288822799 From ad175e5310cc7096390ef525dc9dc29818f2723a Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 25 Jun 2024 01:54:51 +0000 Subject: [PATCH 4/6] Fix iCalendar's language.yml entry --- lib/linguist/languages.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index f35d297b29..f2a9a69d02 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3160,19 +3160,6 @@ Isabelle ROOT: tm_scope: source.isabelle.root ace_mode: text language_id: 171 -iCalendar: - type: data - color: "#ec564c" - extensions: - - ".ics" - - ".ical" - tm_scope: source.iCalendar - aliases: - - iCal - ace_mode: text - codemirror_mode: properties - codemirror_mime_type: text/calendar - language_id: 98384424 J: type: programming color: "#9EEDFF" @@ -8375,6 +8362,19 @@ hoon: extensions: - ".hoon" language_id: 560883276 +iCalendar: + type: data + color: "#ec564c" + extensions: + - ".ics" + - ".ical" + tm_scope: source.iCalendar + aliases: + - iCal + ace_mode: text + codemirror_mode: properties + codemirror_mime_type: text/x-properties + language_id: 98384424 jq: color: "#c7254e" ace_mode: text From 780f480fb9d23fc161e125339dee2c0bedddb887 Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Tue, 25 Jun 2024 03:16:04 +0000 Subject: [PATCH 5/6] Add missing trailing newlines --- samples/iCalendar/2024.ics | 2 +- samples/iCalendar/todo-2.ical | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/iCalendar/2024.ics b/samples/iCalendar/2024.ics index c5b081137d..051b70e45c 100644 --- a/samples/iCalendar/2024.ics +++ b/samples/iCalendar/2024.ics @@ -118,4 +118,4 @@ DTEND;VALUE=DATE:20241013 DTSTAMP;VALUE=DATE:20241012 UID:2024-10-12/2024-10-13/NateScarlet/holiday-cn END:VEVENT -END:VCALENDAR \ No newline at end of file +END:VCALENDAR diff --git a/samples/iCalendar/todo-2.ical b/samples/iCalendar/todo-2.ical index 7478862144..349841e977 100644 --- a/samples/iCalendar/todo-2.ical +++ b/samples/iCalendar/todo-2.ical @@ -14,4 +14,4 @@ COMPLETED:20210922T202815Z PERCENT-COMPLETE:100 STATUS:COMPLETED END:VTODO -END:VCALENDAR \ No newline at end of file +END:VCALENDAR From 3f668aa56503a01a55983ad49354e83804e85dd9 Mon Sep 17 00:00:00 2001 From: Martin Leduc <31558169+DecimalTurn@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:17:52 -0400 Subject: [PATCH 6/6] Update lib/linguist/languages.yml Co-authored-by: John Gardner --- lib/linguist/languages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index f2a9a69d02..c78a9c4750 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -8371,7 +8371,7 @@ iCalendar: tm_scope: source.iCalendar aliases: - iCal - ace_mode: text + ace_mode: properties codemirror_mode: properties codemirror_mime_type: text/x-properties language_id: 98384424