CodeEditApp / CodeEditApp/CodeEditSourceEditor

✨ Placeholder Support

未关闭
#287 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Swift
星标
719
派生
160
PR 合并指标
30 天内没有已合并 PR

描述

### Description

Implement support for placeholders in CodeEdit, similar to Xcode’s `<#placeholder#>` feature. This would allow developers to insert and cycle through editable placeholders in their code, improving productivity and code clarity during development.

### Use Case

This feature would be particularly useful for defining temporary or template-like code constructs, such as:
```swift
let <#name#> = <#value#>
```

Placeholders would:
1. Be highlighted visually.
2. Be navigable (e.g., via Tab key).
3. Allow inline editing to replace the placeholder text.

### Expected Behavior

- When a placeholder is inserted (e.g., `<#placeholder#>`), it should:
- Appear visually distinct (e.g., highlighted with a subtle background color or outline).
- Be editable directly in the code editor.
- Allow navigation between placeholders using keyboard shortcuts like Tab and Shift+Tab.
- Placeholders should support nested constructs (e.g., `let <#name#> = <#type#>(<#arguments#>)`).

### Technical Notes

- Integrate placeholder handling with the current text editing features.
- Consider compatibility with existing syntax highlighting and LSP integration.

### Steps to Implement

1. Define a syntax for placeholders (e.g., `<#placeholder#>`).
2. Update the text editor to recognize and render placeholders.
3. Add keyboard navigation support for placeholders.
4. Ensure placeholder edits are reflected in the editor state.

### Additional Context

This feature would align CodeEdit with Xcode’s behavior, making it a more familiar and seamless experience for developers who work on macOS. It also complements other code editing enhancements, such as autocompletion and LSP support.

### Screenshots

image

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。