For code, I feel you don't want to split the code into chunks where lines are cut off.
The default text splitter does this. It works fine for normal text, but for code, my intuition tells me that might be causing issue, and something smarter can probably be done
You can use any text splitter from langchain. There's a list of splitters here:
https://langchain.readthedocs.io/en/latest/reference/modules/text_splitter.htmlThen when you construct your index, you can pass it in with
text_splitter=MyTextSplitter()
or something like that