kaiwk / leetcode.el

An Emacs LeetCode client.
GNU General Public License v3.0
418 stars 76 forks source link

feature request: additional language support? #91

Closed dmitrym0 closed 3 years ago

dmitrym0 commented 3 years ago

Hello, thanks for the module!

What's the process of adding additional languages? I'd like to see typescript available.

Thanks,

Dmitry

tongjie-chen commented 3 years ago

I have tried this. @kaiwk did a really good job to make this extensible. You just need to add the language to the list in the leetcode.el and recompile the el or delete the leetcode.elc:

(defconst leetcode--lang-suffixes
  '(("c" . ".c") ("cpp" . ".cpp") ("csharp" . ".cs")
    ("golang" . ".go") ("java" . ".java") ("javascript" . ".js")
    ("kotlin" . ".kt") ("php" . ".php") ("python" . ".py")
    ("python3" . ".py") ("ruby" . ".rb") ("rust" . ".rs")
    ("scala" . ".scala") ("swift" . ".swift") ("typescript" . ".ts")
    ("mysql" . ".sql") ("mssql" . ".sql") ("oraclesql" . ".sql"))
  "LeetCode programming language suffixes.
c, cpp, csharp, golang, java, javascript, kotlin, php, python,
python3, ruby, rust, scala, swift, mysql, mssql, oraclesql.")

Make sure you have the corresponding major mode installed, or auto-mode-alist inside function leetcode--start-coding will run to problems that will not generate debug information.

kaiwk commented 3 years ago

see: #94