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: auto-completion for config editing #8584

Merged
merged 4 commits into from Feb 15, 2023

Conversation

andelf
Copy link
Collaborator

@andelf andelf commented Feb 12, 2023

  • Add auto-completion for editing config.edn
    • triggered by "ctrl+space" or ":"
    • config key completion
    • nested config key completion(max level 2)
    • boolean/enum value completion
  • rename cm to CodeMirror in code.cljs according to the same naming rule of JavaScript

Known Issues:

  • duplicated keys are detected by regexp over the whole document(ugly but works)
  • cursor position is at the end of "", {}, [] after completion, should be in the middle of the enclosure
  • maili has some bug in fetching the current schema(I can not fetch some info by mu/properties, mu/type-properties, .... )
  • enabled by edn mode, not depending on config file names/paths
  • CSS of Auto-completion UI is copied from codemirror, not changing according to the current theme setting
  • syntax errors are ignored(Better add some error checking)
Screen.Recording.2023-02-12.at.8.05.39.AM.mov

@github-actions github-actions bot added the :type/feature New feature label Feb 12, 2023
@andelf andelf force-pushed the feat/autocompletion-for-config-editing branch from 5b1aa73 to 9a399a2 Compare February 12, 2023 00:53
Copy link
Collaborator

@cnrpman cnrpman left a comment

Choose a reason for hiding this comment

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

LGTM

TODO: Screen out existing keys in the current edn

@andelf
Copy link
Collaborator Author

andelf commented Feb 13, 2023

TODO: Screen out existing keys in the current end

Fixed by regexp over the whole document. ugly but works.

@andelf andelf merged commit 71b5fa3 into master Feb 15, 2023
@andelf andelf deleted the feat/autocompletion-for-config-editing branch February 15, 2023 09:56
@logseq-cldwalker
Copy link
Collaborator

@andelf Great to see a feature by being built off malli schemas! 😎

@Bad3r Bad3r added this to the 0.8.18 milestone Feb 24, 2023
sallto pushed a commit to sallto/logseq that referenced this pull request Feb 25, 2023
* feat(editor): add auto-completion for config editing
* enhance: filter keys already in file when autocompletion
sallto pushed a commit to sallto/logseq that referenced this pull request Feb 25, 2023
* feat(editor): add auto-completion for config editing
* enhance: filter keys already in file when autocompletion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:type/feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants