Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agent): format indentation if not match with editor config. #911

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

icycodes
Copy link
Member

Complete TAB-315

This PR try to post-process completion by formatting the indentation.

If there is alreay some indentation in context, the server output should have learned from it, so we just process the case of when:

  • there is no indentation in context (including prefix and suffix)
  • and we can get the specified indentation type from current editor
  • and there is any indentation in the completion text, but it is not matched with current editor config

then we reindent the completion text with the current editor config.

The indentation dectection in this PR supports for dectecting tab, 2 spaces or 4 spaces.

@wsxiaoys wsxiaoys merged commit c049f23 into TabbyML:main Nov 28, 2023
2 checks passed
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.

2 participants