Enable code autocompletion in ACE editor

This commit is contained in:
Kristóf Tóth 2018-05-11 14:04:15 +02:00
parent 93e892561e
commit e351cbacc0
2 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,7 @@
[(text)]="code"
[mode]="language"
[theme]="theme"
[options]="options"
class="tfw-ace-editor"
>
</div>

View File

@ -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';