SIGN IN SIGN UP

feat(components): add missing languages to Code Text Splitter (#6290)

* feat(components): add missing languages to Code Text Splitter

The Code Text Splitter only exposed 16 languages natively supported
by @langchain/textsplitters. The Python LangChain library supports
many more. This adds 9 additional languages (c, csharp, cobol,
elixir, haskell, kotlin, lua, powershell, ts) with custom separators
ported from Python LangChain, while keeping existing languages on
the native fromLanguage() path.

* fix: address review feedback on language separators

C: replace class with struct/union/enum (C has no class keyword).
C#: remove implements (C# uses :), add namespace and struct.
Elixir: remove while (not a keyword in Elixir).
Kotlin: remove case (Kotlin uses when).
Fallback: return default splitter instead of calling fromLanguage
with an unsupported language.

* style: fix prettier formatting in CodeTextSplitter
D
Deepak Bhagat committed
88eb71b11a6bdc6fe31c62e42d146ca7a3bf6307
Parent: 2df597f
Committed by GitHub <noreply@github.com> on 4/30/2026, 11:43:04 PM