mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 23:09:47 +02:00
Improved autocompletion!
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { completeFromList } from '@codemirror/autocomplete';
|
||||
import { LanguageSupport, LRLanguage } from '@codemirror/language';
|
||||
import { completions } from './completion';
|
||||
import { parser } from './url';
|
||||
|
||||
const urlLanguage = LRLanguage.define({
|
||||
@@ -7,13 +8,8 @@ const urlLanguage = LRLanguage.define({
|
||||
languageData: {},
|
||||
});
|
||||
|
||||
const exampleCompletion = urlLanguage.data.of({
|
||||
autocomplete: completeFromList([
|
||||
{ label: 'http://', type: 'constant' },
|
||||
{ label: 'https://', type: 'constant' },
|
||||
]),
|
||||
});
|
||||
const completion = urlLanguage.data.of({ autocomplete: completions });
|
||||
|
||||
export function url() {
|
||||
return new LanguageSupport(urlLanguage, [exampleCompletion]);
|
||||
return new LanguageSupport(urlLanguage, [completion]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user