BoostNote-Legacy icon indicating copy to clipboard operation
BoostNote-Legacy copied to clipboard

feat: add code autocomplete with Ctrl+Space

Open Somoru opened this issue 2 months ago • 0 comments

Adds autocomplete functionality using CodeMirror's show-hint addon. Press Ctrl+Space to show word suggestions from the current document.

Closes #2567

Description

This PR implements code autocomplete functionality for the editor using CodeMirror's built-in show-hint addon. Users can now press Ctrl+Space to see a dropdown of word suggestions based on the current document content.

Changes made:

  • Added Ctrl+Space keybinding in CodeEditor.js
  • Loaded show-hint and anyword-hint addons in HTML files
  • Works with all content types: code snippets, PlantUML, markdown

How it works:

  • User presses Ctrl+Space while typing
  • Autocomplete dropdown appears with matching words from the document
  • Navigate with arrow keys, select with Enter/Tab, dismiss with Esc

Issue fixed

Closes #2567 - Adds automatic code completion like vim for writing snippets and PlantUML

Type of changes

  • :white_circle: Bug fix (Change that fixed an issue)
  • :white_circle: Breaking change (Change that can cause existing functionality to change)
  • :white_circle: Improvement (Change that improves the code. Maybe performance or development improvement)
  • :radio_button: Feature (Change that adds new functionality)
  • :white_circle: Documentation change (Change that modifies documentation. Maybe typo fixes)

Checklist:

  • :radio_button: My code follows the project code style
  • :white_circle: I have written test for my code and it has been tested
  • :radio_button: All existing tests have been passed
  • :white_circle: I have attached a screenshot/video to visualize my change if possible
  • :radio_button: This PR will modify the UI or affects the UX
  • :radio_button: This PR will add/update/delete a keybinding

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


Somoru avatar Oct 21 '25 03:10 Somoru