codemirror-extension-inline-suggestion
v0.0.3
Published
This package implements inline suggestions for the CodeMirror code editor.
Downloads
1,870
Readme
codemirror-extension-inline-suggestion
This package implements inline suggestions for the CodeMirror code editor.
Install
npm install codemirror-extension-inline-suggestion --save
Usage
import CodeMirror from '@uiw/react-codemirror';
import { inlineSuggestion } from 'codemirror-extension-inline-suggestion';
const fetchSuggestion = async (state) => {
// or make an async API call here based on editor state
return 'hello';
};
function App() {
return (
<CodeMirror
value=""
height="200px"
extensions={[
fetchSuggestion({
fetchFn: inlineSuggestion,
delay: 1000,
}),
]}
/>
);
}
export default App;
License
MIT