mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:31:33 +00:00
Enable code autocompletion in ACE editor
This commit is contained in:
parent
93e892561e
commit
e351cbacc0
@ -39,6 +39,7 @@
|
||||
[(text)]="code"
|
||||
[mode]="language"
|
||||
[theme]="theme"
|
||||
[options]="options"
|
||||
class="tfw-ace-editor"
|
||||
>
|
||||
</div>
|
||||
|
@ -2,6 +2,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
|
||||
import * as brace from 'brace';
|
||||
import 'brace/ext/modelist';
|
||||
import 'brace/ext/language_tools';
|
||||
|
||||
import 'brace/mode/c_cpp';
|
||||
import 'brace/mode/csharp';
|
||||
@ -19,6 +20,8 @@ import { DeploymentNotificationService } from '../services/deployment-notificati
|
||||
import { config } from '../config';
|
||||
|
||||
const modelist = brace.acequire('ace/ext/modelist');
|
||||
const langTools = brace.acequire('ace/ext/language_tools');
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-ide',
|
||||
@ -31,6 +34,9 @@ export class IdeComponent implements OnInit {
|
||||
code: string = config.ide.defaultCode;
|
||||
language: string = config.ide.defaultLanguage;
|
||||
theme = 'cobalt';
|
||||
options: any = {enableBasicAutocompletion: true,
|
||||
enableSnippets: true,
|
||||
enableLiveAutocompletion: true};
|
||||
directory = '';
|
||||
files: string[];
|
||||
codeState = 'SAVED';
|
||||
|
Loading…
Reference in New Issue
Block a user