---
title: language | CodeWeaver Docs
description: API reference for codeweaver.core.language
url: "https://docs.knitli.com/api/core/language"
type: static
generatedAt: "2026-04-17T17:21:08.038Z"
---

# language
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/core/language.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F&text=language)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F&text=language)[Share on Bluesky](https://bsky.app/intent/compose?text=language%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F&title=language)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F&t=language)[Share on Email](mailto:?subject=language&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F)[Share on WhatsApp](https://wa.me/?text=language%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Flanguage%2F&text=language)
# `codeweaver.core.language`
[Section titled “codeweaver.core.language”](#codeweavercorelanguage)
Classes and functions for handling languages and their configuration files in the CodeWeaver project.

## Class: `ConfigLanguage`
[Section titled “Class: ConfigLanguage”](#class-configlanguage)
Enum representing common configuration languages.

### Method: `all_extensions`
[Section titled “Method: all_extensions”](#method-all_extensions)

**

```
all_extensions()
```

Returns all file extensions for all configuration languages.

### Method: `from_extension`
[Section titled “Method: from_extension”](#method-from_extension)

**

```
from_extension()
```

Returns the ConfigLanguage associated with the given file extension.

## Class: `LanguageConfigFile`
[Section titled “Class: LanguageConfigFile”](#class-languageconfigfile)
Represents a language configuration file with its name, path, and language type.

### Method: `exists`
[Section titled “Method: exists”](#method-exists)

**

```
exists()
```

Checks if the configuration file exists at the specified path.

## Class: `RepoConventions`
[Section titled “Class: RepoConventions”](#class-repoconventions)
A TypedDict representing common repository conventions for a language.

## Class: `SemanticSearchLanguage`
[Section titled “Class: SemanticSearchLanguage”](#class-semanticsearchlanguage)
Enum representing supported languages for semantic (AST) search.

Note: This is the list of built-in languages supported by ast-grep. Ast-grep supports dynamic languages using pre-compiled tree-sitter grammars. We haven’t added support for those yet.

### Method: `all_config_paths`
[Section titled “Method: all_config_paths”](#method-all_config_paths)

**

```
all_config_paths()
```

Returns all configuration file paths for all languages.

### Method: `all_extensions`
[Section titled “Method: all_extensions”](#method-all_extensions-1)

**

```
all_extensions()
```

Returns all file extensions for all languages.

### Method: `code_extensions`
[Section titled “Method: code_extensions”](#method-code_extensions)

**

```
code_extensions()
```

Returns all file extensions associated with programming languages (excluding configuration languages).

### Method: `config_language_exts`
[Section titled “Method: config_language_exts”](#method-config_language_exts)

**

```
config_language_exts()
```

Returns all file extensions associated with the configuration languages.

### Method: `config_languages`
[Section titled “Method: config_languages”](#method-config_languages)

**

```
config_languages()
```

Returns all SemanticSearchLanguages that are also configuration languages.

### Method: `config_pairs`
[Section titled “Method: config_pairs”](#method-config_pairs)

**

```
config_pairs()
```

Returns a tuple mapping of all config file paths to their corresponding LanguageConfigFile.

### Method: `ext_pairs`
[Section titled “Method: ext_pairs”](#method-ext_pairs)

**

```
ext_pairs()
```

Returns a frozenset of tuples containing file extensions and their corresponding SemanticSearchLanguage.

### Method: `extension_map`
[Section titled “Method: extension_map”](#method-extension_map)

**

```
extension_map()
```

Returns a mapping of file extensions to their corresponding SemanticSearchLanguage. This is used to quickly look up the language based on file extension.

### Method: `filename_pairs`
[Section titled “Method: filename_pairs”](#method-filename_pairs)

**

```
filename_pairs()
```

Returns a frozenset of tuples containing file names and their corresponding SemanticSearchLanguage.

### Method: `from_extension`
[Section titled “Method: from_extension”](#method-from_extension-1)

**

```
from_extension()
```

Returns the SemanticSearchLanguage associated with the given file extension.

### Method: `injection_languages`
[Section titled “Method: injection_languages”](#method-injection_languages)

**

```
injection_languages()
```

Returns supported languages that commonly contain embedded code snippets from other languages.

### Method: `lang_from_ext`
[Section titled “Method: lang_from_ext”](#method-lang_from_ext)

**

```
lang_from_ext()
```

Returns the SemanticSearchLanguage for a given file extension.

Args: ext: The file extension to look up.

Returns: The corresponding SemanticSearchLanguage, or None if not found.

## Function: `find_config_paths`
[Section titled “Function: find_config_paths”](#function-find_config_paths)

**

```
find_config_paths()
```

Finds all configuration files in the project root directory.

Returns: A tuple of Path objects representing the configuration files, or None if no config files are found.

## Function: `get_ext_lang_pairs_generator`
[Section titled “Function: get_ext_lang_pairs_generator”](#function-get_ext_lang_pairs_generator)

**

```
get_ext_lang_pairs_generator()
```

Helper to lazily get ext lang pairs.

## Function: `has_semantic_extension`
[Section titled “Function: has_semantic_extension”](#function-has_semantic_extension)

**

```
has_semantic_extension()
```

Check if the given extension is a semantic search language.

## Function: `is_semantic_config_ext`
[Section titled “Function: is_semantic_config_ext”](#function-is_semantic_config_ext)

**

```
is_semantic_config_ext()
```

Check if the given extension is a semantic config file.

## Function: `language_from_config_file`
[Section titled “Function: language_from_config_file”](#function-language_from_config_file)

**

```
language_from_config_file()
```

Returns the SemanticSearchLanguage for a given configuration file path.

Args: config_file: The path to the configuration file.

Returns: The corresponding SemanticSearchLanguage, or None if not found.

## Function: `language_from_path`
[Section titled “Function: language_from_path”](#function-language_from_path)

**

```
language_from_path()
```

Returns the SemanticSearchLanguage for a given file path based on its extension.

Args: file_path: The path to the file.

## Function: `languages_present_from_configs`
[Section titled “Function: languages_present_from_configs”](#function-languages_present_from_configs)

**

```
languages_present_from_configs()
```

Returns a tuple of SemanticSearchLanguage for all languages present in the configuration files.

Returns: A tuple of SemanticSearchLanguage objects.