Skip to content

Commit 05d1af7

Browse files
committed
Add Kotlin support
#19
1 parent 4b9ea68 commit 05d1af7

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ You can experiment with your own sentence transformer models with the `--model`
188188
## Bugs and limitations
189189
190190
- Currently, the `.embeddings` index is not updated when repository files change. As a temporary workaround, `sem embed` can be re-ran occasionally.
191-
- Supported languages: `{ 'python', 'javascript', 'typescript', 'ruby', 'go', 'rust', 'java', 'c', 'c++' }`
191+
- Supported languages: `{ 'python', 'javascript', 'typescript', 'ruby', 'go', 'rust', 'java', 'c', 'c++', 'kotlin' }`
192192
- Supported text editors for opening results in: `{ 'vscode', 'vim' }`
193193
194194
## License

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='semantic-code-search',
8-
version='0.3.0',
8+
version='0.4.0',
99
author='Kiril Videlov',
1010
author_email='kiril@codeball.ai',
1111
description='Search your codebase with natural language.',

src/semantic_code_search/embed.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def _supported_file_extensions():
2323
'.h': 'c',
2424
'.cpp': 'cpp',
2525
'.hpp': 'cpp',
26+
'.kt': 'kotlin',
27+
'.kts': 'kotlin',
28+
'.ktm': 'kotlin',
2629
}
2730

2831

src/semantic_code_search/prompt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _syntax_highlighting(text, file):
4646
lexer = TypeScriptLexer
4747
elif file.endswith('java'):
4848
lexer = JavaLexer
49-
elif file.endswith('kt'):
49+
elif file.endswith('kt') or file.endswith('kts') or file.endswith('ktm'):
5050
lexer = KotlinLexer
5151
elif file.endswith('rb'):
5252
lexer = RubyLexer

0 commit comments

Comments
 (0)