Re: [vim/vim] Add typst filetype (PR #12363)

253 views
Skip to first unread message

Gaétan Lepage

unread,
May 9, 2023, 2:42:27 AM5/9/23
to vim/vim, Push

@GaetanLepage pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/push/13569661610@github.com>

Gaétan Lepage

unread,
May 9, 2023, 5:07:39 AM5/9/23
to vim/vim, Push

@GaetanLepage pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/push/13571090579@github.com>

Gaétan Lepage

unread,
May 9, 2023, 5:24:13 AM5/9/23
to vim/vim, Subscribed

This adds the typst filetype for typst documents (.typ extension)


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/12363

Commit Summary

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363@github.com>

zeertzjq

unread,
May 9, 2023, 5:24:35 AM5/9/23
to vim/vim, Subscribed

This PR doesn't actually work, because .typ files are recognized as SQL in a previous autocommand.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1539578694@github.com>

Gaétan Lepage

unread,
May 9, 2023, 5:39:38 AM5/9/23
to vim/vim, Subscribed

This PR doesn't actually work, because .typ files are recognized as SQL in a previous autocommand.

Indeed ! I tried to copy what is being done for "conflicting filetypes".


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1539717022@github.com>

Bram Moolenaar

unread,
May 9, 2023, 8:28:37 AM5/9/23
to vim/vim, Subscribed


> This adds the `typst` filetype for [typst](https://typst.app)
> documents (`.typ` extension)

Please add a test for this in src/testdir/test_filetype.vim.
Also fix the expectance for "file.typ".


--
Q: What is the difference between open-source and commercial software?
A: If you have a problem with commercial software you can call a phone
number and they will tell you it might be solved in a future version.
For open-source software there isn't a phone number to call, but you
get the solution within a day.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1540028668@github.com>

Gaétan Lepage

unread,
May 10, 2023, 3:46:12 AM5/10/23
to vim/vim, Subscribed

I am not able to find any reference to the fact that the .typ extension can be used for SQL files.
But I guess that we cannot take the liberty to remove completely the .typ - sql association, can we ?

If so, I would modify the PR to directly associate .typ files to the typst filetype.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1541511042@github.com>

Bram Moolenaar

unread,
May 10, 2023, 1:16:01 PM5/10/23
to vim/vim, Subscribed


> I am not able to find any reference to the fact that the `.typ`
> extension can be used for SQL files.
> But I guess that we cannot take the liberty to remove completely the
> `.typ` - `sql` association, can we ?
>
> If so, I would modify the PR to directly associate `.typ` files to the
> `typst` filetype.

The comment mentions "SQL for Oracle Designer". That's the only hint I
can find. Perhaps someone knows if ".typ" files are actually in use and
deserved to be recognized as "sql"?

Otherwise, recognizing the filetype by the contents is the usual
approach. Sql and typst are hopefully different enough to tell the
difference from the first few lines.


--
How To Keep A Healthy Level Of Insanity:
6. In the memo field of all your checks, write "for sexual favors".


/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1542549538@github.com>

Gaétan Lepage

unread,
May 10, 2023, 4:38:03 PM5/10/23
to vim/vim, Push

@GaetanLepage pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/push/13592921700@github.com>

Gaétan Lepage

unread,
May 10, 2023, 4:39:39 PM5/10/23
to vim/vim, Subscribed

I was able to find documentation about those sql .typ files: https://docs.oracle.com/cd/A58617_01/server.804/a58234/ott.htm

I rewrote the detection code and the test.
Now it tries to find the typical content of an sql type definition file and, if it is not able to do so, it affects the typst filetype.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/c1542779466@github.com>

Gaétan Lepage

unread,
May 10, 2023, 4:41:49 PM5/10/23
to vim/vim, Push

@GaetanLepage pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/push/13592956658@github.com>

Gaétan Lepage

unread,
May 10, 2023, 4:59:42 PM5/10/23
to vim/vim, Push

@GaetanLepage pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/push/13593112408@github.com>

Bram Moolenaar

unread,
May 10, 2023, 5:02:40 PM5/10/23
to vim/vim, Subscribed

Closed #12363 via 4ce1bda.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12363/issue_event/9215525484@github.com>

Reply all
Reply to author
Forward
0 new messages