question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add snippets manually without brace?

See original GitHub issue

Hi, I want to add my own snippets to AceEditor. I found this: https://github.com/denvash/react-json-snippet-editor . But, I’ve read, that Brace is no longer supported for React Ace. How should I add them now?

My component

<AceEditor
        placeholder="Type here..."
        mode="json"
        theme="monokai"
        id="blah2"
        onChange={this.onTextChange}
        fontSize={14}
        showPrintMargin={true}
        showGutter={true}
        highlightActiveLine={true}
        value={this.state.text}
        editorProps={{ $blockScrolling: true }}
        enableBasicAutocompletion={true}
        enableLiveAutocompletion={true}
        enableSnippets={true}
/>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:41

github_iconTop GitHub Comments

14reactions
mohsinxx365commented, Jun 24, 2020

Done . This is the link to the codesandbox with the demo and some documentation : https://codesandbox.io/s/react-acesnippets-sk2uq?file=/src/App.js

4reactions
fkoehler42commented, Nov 9, 2020

@danilafrolov @piotrkochan using the implementation described above you can use placeholders like this (example of lua function):

{
    caption: 'function',
    snippet: 'function ${1:name}(${2:arguments})\n\t${3:body}\nend\n',
    meta: 'snippet', //display the keyword "snippet" next to your snippet title in the editor pop-up
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ace Editor manually adding snippets - Stack Overflow
Use ace.define(...) for adding your snippet. The snippets are written in ...
Read more >
Adding a Snippet to a Template - Iterable Support Center
Use triple curly braces to reference the snippet: · Place the snippet in an HTML block, which will wrap your snippet's content in...
Read more >
Snippets in Visual Studio Code
There is also support for tab-completion: Enable it with "editor.tabCompletion": "on" , type a snippet prefix (trigger text), and press Tab to insert...
Read more >
Share and Use Code Snippets - Oracle Help Center
Open the snippet. Scroll down and after the snippet's files, click Add File. In the header, enter the file name with extension ...
Read more >
LilyPond — Snippets
Snippets are grouped by tags; tags listed in the table of contents match a section of LilyPond notation manual. Snippets may have several...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found