Skip to content

Conversation

@Soyuz0
Copy link

@Soyuz0 Soyuz0 commented Jan 31, 2026

Hi I'm not sure if you are taking pr substitutions but I reallllllyyyyy liked the idea of the project and wanted to try using it
But I'm a data scientist so we do python, so i wanted to contribute my + cluade's implementation to support python

local prompts = {
role = function()
return [[ You are a software engineering assistant mean to create robust and conanical code ]]
return [[ You are a software engineering assistant meant to create robust and canonical code following the language's best practices and idioms. ]]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seemed to be better as a base prompt to understand that it need to follow basic idioms (like in python not having var names as all caps lol)

This refactor makes language-specific prompts modular and adds import
context gathering for AI prompts.

Language Module Enhancements:
- lua/99/language/init.lua: Added get_prompt_context(file_type) and
  is_stdlib(file_type, module_name) functions for dynamic language lookup
- lua/99/language/python.lua: Added prompt_context() with Python-specific
  AI instructions (indentation, naming conventions) and comprehensive
  stdlib_modules list (~100 modules from docs.python.org) with is_stdlib()

Prompt System Refactor:
- lua/99/prompt-settings.lua: Replaced hardcoded Python if-statement with
  dynamic Languages.get_prompt_context(file_type) lookup, making it easy
  to add prompt context for other languages

Import Context System (NEW):
- lua/99/context/imports.lua: New module that parses imports using
  tree-sitter queries and formats them for AI prompts as <IMPORTS> block
  - Separates stdlib vs non-stdlib imports using is_stdlib()
  - Supports async LSP hover resolution (scaffolded for future use)
- lua/99/request-context.lua: Integrated import context into finalize()

Python Tree-sitter Queries (NEW):
- queries/python/99-imports.scm: Detects import statements including
  'import foo', 'from foo import bar', aliased imports, relative imports
- queries/python/99-fn-call.scm: Detects function/method calls
- queries/python/99-scope.scm: Detects scope boundaries (class, function,
  lambda, with, for, while, try, match)

All 47 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant