pulsar-edit / pulsar

A Community-led Hyper-Hackable Text Editor
https://pulsar-edit.dev
Other
3.33k stars 140 forks source link

[language-clojure] Stop detecting `.org` files as `language-clojure` #980

Closed confused-Techie closed 7 months ago

confused-Techie commented 7 months ago

Resolves #934

According to Mauricio there's no case where an .org extension would be a Clojure file, yet the various types of clojure grammars detect it as such.

So seems we can simply remove that extension from these lists to solve the issue.

DeeDeeG commented 7 months ago

Huh, I traced the inclusion of .org mode in the language-clojure package to this PR: https://github.com/atom/language-clojure/pull/47

In which it is acknowledged to be the "org-mode" format, albeit a different name than #934 calls them ("organized files"??), and the atom/language-clojure PR acknowledged that labeling these files as clojure might have some conflicts with other uses of org-mode files, but apparently some clojure-based project they link to as an example to justify it had some org-mode files checked in to their repo... Said repo has since changed its default branch to feature/no-org and deprectaed all their "org-mode" files...?

So, if you want to scratch your head a bunch, not being very familiar with Clojure or org-mode files, this issue/PR/breadcrumb trail seems like a great opportunity to get some head-scratching in!

DeeDeeG commented 7 months ago

Hmm, okay, sorry for all the noise, but I think I finally understand how we got here. it seems like there was a single repo where there were a lot of org-mode files (which are a markup language like markdown or rst), and that repo's .org (org-mode) files have lots of inline code blocks of clojure code in them... And the person's solution for that in https://github.com/atom/language-clojure/pull/47 was to mark any and all org-mode files as clojure...???

If I'm understanding right, that's like saying "I know of a repo that has some markdown files with a lot of JS code blocks in it. Can we highlight every markdown file as if it were JS so those code blocks are nicely highlighted?" i.e. totally not the right way to do this.

If anything it should have been set up as one of those things where an org-mode file can have a segment detected as a block of clojure and switch to highlighting as clojure only inside of the code block, then resume highlighting as org-mode outside of the code blocks. ... Right? I think so.

confused-Techie commented 7 months ago

Wow @DeeDeeG thanks for tracking this down, but that truly seems like such a bizarre choice to have been allowed as a commit. So seems like absolutely the best thing to do is remove this, especially since the originally justification no longer exists.

Thanks for the review, I'll go ahead and merge this one