Add support of comment syntax for more languages for code generation
We're currently support these languages for code generation/completion.
# https://cloud.google.com/vertex-ai/docs/generative-ai/code/code-models-overview
SUPPORTED_LANGUAGES = {
"C" => %w[c],
"C++" => %w[cc cpp],
"C#" => %w[cs],
"Clojure" => %w[clj cljs cljc],
"Dart" => %w[dart],
"Elixir" => %w[ex],
"Erlang" => %w[erl],
"Fortran" => %w[f],
"Go" => %w[go],
"GoogleSQL" => %w[sql],
"Groovy" => %w[groovy],
"Haskell" => %w[hs],
"HTML" => %w[html],
"Java" => %w[java],
"JavaScript" => %w[js],
"Kotlin" => %w[kt kts],
"Lean (proof assistant)" => %w[lean],
"Objective-C" => %w[m],
"OCaml" => %w[ml],
"Perl" => %w[pl],
"PHP" => %w[php],
"Python" => %w[py],
"Ruby" => %w[rb],
"Rust" => %w[rs],
"Scala" => %w[scala],
"Shell script" => %w[sh],
"Solidity" => %w[sol],
"Swift" => %w[swift],
"TypeScript" => %w[ts],
"Verilog" => %w[v]
}.freeze
But we only extract instructions from comments: #
, //
, and --
. Which is only some subset of these languages.
There is the list of comment syntax for these languages:
-
//
: C, C++, C#, Go, Java, JavaScript, Kotlin, Objective-C, Rust, Scala, Swift, Groovy, PHP, Solidity, TypeScript, Verilog -
#
: Ruby, Python -
;
: Lisp, Scheme, Clojure -
--
: SQL, Haskell -
REM
: Visual Basic -
'
: Visual Basic Scripting Edition (VBScript), Fortran -
!--
: HTML/XML -
//=
: PowerShell
And block comments:
-
/* ... */
: C, C++, C#, Dart, Go, Java, JavaScript, Kotlin, Objective-C, Rust, Scala, Swift, GoogleSQL, Groovy, PHP, Solidity, Verilog -
#_ ...
: Clojure -
# ... #
: Elixir -
% ...
: Erlang -
! ... !
: Fortran -
' ... '
: Shell script -
{- ... -}
: Haskell -
<!-- ... -->
: HTML -
/* ... */
(Alternative Syntax): OCaml -
''' ... '''
or""" ... """
: Python -
=begin ... =end
: Ruby
Goal
Provide support for more languages