{"id":297948,"date":"2020-01-30T15:00:12","date_gmt":"2020-01-30T15:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297948"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297948","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 Ace Editor"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/avanpost\/blog\/486240\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/storage2\/6b9\/0aa\/331\/6b90aa33171a923892823dbacfbd3d65.png\"><\/div>\n<p>  <\/p>\n<p><strong>Ace<\/strong> (Ajax.org Cloud9 Editor) \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043f\u043b\u044e\u0441\u044b, \u0442\u0430\u043a \u0438 \u043c\u0438\u043d\u0443\u0441\u044b. \u041e\u0434\u043d\u043e \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f. \u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u043c \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c.<\/p>\n<p>  <\/p>\n<p><a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Ace \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 Python, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u0437 \u0434\u0432\u0438\u0436\u043a\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043e <a href=\"https:\/\/habr.com\/ru\/company\/avanpost\/blog\/475902\/\">\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0432\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0431\u043e\u0440\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0442\u0440\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430: Ace, Monaco, CodeMirror. \u0421 CodeMirror \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0431\u044b\u043b \u043e\u043f\u044b\u0442, \u0438 \u043e\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c. Monaco, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0440\u0443\u0442, \u043d\u043e \u0410ce \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 Ace \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u0435\u0441\u043b\u0438 \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u042d\u0442\u043e \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 (\u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a <i>if-else, try-except, class, def,<\/i> etc). \u042d\u0442\u043e \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043a\u0430\u043a \u0441\u043e\u043e\u0431\u0449\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e \u043f\u0440\u043e\u0447\u0438\u0445 \u0442\u0438\u043f\u0430\u0445, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430? \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f (<s>\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u0442<\/s>). \u041d\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u0421\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u2014 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0430\u043d\u0438\u0435, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440.<\/p>\n<p>  <\/p>\n<h2>\u0420\u0435\u0446\u0435\u043f\u0442<\/h2>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Ace \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u043d\u0430 Angular, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c <i>ng2-ace-editor<\/i> \u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">npm install --save ng2-ace-editor brace ace-builds<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>  <\/p>\n<p>Editor.component.html<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;ace-editor   id=&quot;editor&quot;   #scriptEditor   [options]=&quot;options&quot;   [autoUpdateContent]=&quot;true&quot;   [mode]=&quot;'python'&quot;   [theme]=&quot;'github'&quot;   [(text)]=&quot;script&quot;   [style.height.px]=&quot;600&quot; &gt;&lt;\/ace-editor&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>editor.component.ts<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { Component } from '@angular\/core'; import * as ace from 'brace'; \/\/ \u0434\u043b\u044f \u043f\u043e\u0441\u0432\u0435\u0442\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 import 'brace\/mode\/python'; \/\/ \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a import 'brace\/snippets\/python'; \/\/ \u0446\u0432\u0435\u0442\u043e\u0432\u0430\u044f \u0442\u0435\u043c\u0430 import 'brace\/theme\/github'; import 'brace\/ext\/language_tools';  @Component({   selector: 'app-editor',   templateUrl: '.\/editor.component.html',   styleUrls: ['.\/editor.component.css'] }) export class EditorComponent {   script = 'import sys\\n\\nprint(&quot;test&quot;)';   options = {     enableBasicAutocompletion: true,     enableLiveAutocompletion: true,     enableSnippets: true   };    constructor() { } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/ajaxorg\/ace\/wiki\/Configuring-Ace\">ace<\/a> \u0438 <a href=\"https:\/\/github.com\/MarcusCalidus\/ng2-ace-editor\">ng2-ace-editor<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c\u0441\u044f, \u0432\u0435\u0434\u044c \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e\u0431 ace editor, \u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e <a href=\"https:\/\/github.com\/thlorenz\/brace\">brace<\/a>. \u0412\u0441\u0435 \u0442\u0430\u043a, brace \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0435\u0439 ace. \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0440\u0438\u0434\u043c\u0438, \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0434\u0430\u0431\u044b \u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0431\u0430\u043d\u0434\u043b \u0438 \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 ace.<\/p>\n<p>  <\/p>\n<h2>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438<\/h2>\n<p>  <\/p>\n<p><i>\u201cenableSnippets\u201d<\/i> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import 'brace\/snippets\/python'<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ei\/yi\/0l\/eiyi0lxc_vuc6eavxum_oukzwds.png\"><\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u0436\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438 \u0441\u043b\u043e\u0432\u0430 \u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a, \u043a\u0440\u043e\u043c\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430 <a href=\"http:\/\/plnkr.co\/edit\/6MVntVmXYUbjR0DI82Cr?p=preview\">plunker<\/a>, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u043e\u043b\u044f: <i>name, value, score, meta<\/i>. \u041d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e. \u0414\u0430 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">getCompletions: function(editor, session, pos, prefix, callback)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 \u0432 <i>callback<\/i> \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a. <i>Editor<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u043c \u0432\u0441\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. <i>Session<\/i> \u2014 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044f. <i>Pos<\/i> \u2014 \u0432\u0438\u0434\u0438\u043c\u043e, \u043f\u043e\u0437\u0438\u0446\u0438\u044f, \u0433\u0434\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u0430 \u0438 <i>prefix<\/i> \u2014 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u044b <i>ace\/ext\/language_tools.js<\/i>. \u0418 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">getDocTooltip: function(item)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044f <i>innerHTML<\/i> \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0442\u0443\u043b\u0442\u0438\u043f\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export interface ICompleter {    getCompletions(     editor: ace.Editor,     session: ace.IEditSession,     pos: ace.Position,     prefix: string,     callback: (data: any | null, completions: CompletionModel[]) =&gt; void   ): void;    getTooltip(item: CompletionModel): void;  }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e <i>callback<\/i>: \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <i>completions<\/i> \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0410 \u0432\u043e\u0442 \u0447\u0442\u043e \u0435\u0441\u0442\u044c <i>data<\/i> \u2014 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c, \u0438\u0431\u043e \u0432\u0435\u0437\u0434\u0435 \u0442\u0430\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f <i>null<\/i>. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a, \u0432\u0438\u0434\u0438\u043c\u043e, \u043d\u0430\u043c \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0435\u0431\u0430\u0433\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0434\u0432\u0438\u0436\u043e\u043a \u0438\u0449\u0435\u0442 \u043f\u043e \u043f\u043e\u043b\u044e caption. \u0410 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e\u043b\u044f <i>Name<\/i> \u0438 <i>Meta<\/i>. \u0423 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u0435 snippet, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u0430\u043a \u0441\u043d\u0438\u043f\u043f\u0435\u0442, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442. \u041e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0438\u0445 \u0442\u0430\u043a\u043e\u0432: <i>\u201c{1:variable}\u201d<\/i>. \u0413\u0434\u0435 <i>1<\/i> \u2014 \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 (\u0434\u0430, \u043e\u0442\u0441\u0447\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 1), \u0430 <i>variable<\/i> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export interface CompletionModel {   caption: string;   description?: string;   snippet?: string;   meta: string;   type: string;   value?: string;   parent?: string;   docHTML?: string;   \/\/ \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0413\u0434\u0435 \u043a\u043b\u044e\u0447 - \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0442\u0438\u043f   inputParameters?: { [name: string]: string }; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0442\u0443\u043b\u0442\u0438\u043f\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u043b\u0435 <i>InputParameters<\/i>. \u042d\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u0430\u043a \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043a\u043e\u0434\u0430 \ud83d\ude42<\/p>\n<p>  <\/p>\n<h2>\u041c\u043e\u0434\u0435\u043b\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export interface MetaInfoModel {   \/\/ \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438   Name: string;   \/\/ \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435   Description: string;   \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f   Type: string;   \/\/ \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432   Children: MetaInfoModel[];   \/\/ \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434   InputParameters?: { [name: string]: string }; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u0435\u0440\u0435\u0432\u043e, \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u0430\u043f\u043f\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0420\u0430\u0437\u043b\u043e\u0436\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435:<\/p>\n<p>  <\/p>\n<ol>\n<li><i>completions: { [name: string]: CompletionModel[] }<\/i> \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435: \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u043a \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0442\u0435\u0440\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430. \u041f\u0440\u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e.<\/li>\n<li><i>completionsTree: { [name: string]: string[] }<\/i> \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c: \u0434\u0435\u0442\u0438. \u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0432 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0438\u0441\u043a\u0430.<\/li>\n<li><i>roots: string[]<\/i> \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0443\u0442\u043e\u0432\u044b\u0445 \u043d\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u043e\u0432\u043e\u043c \u0432\u0432\u043e\u0434\u0435.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043c\u0435\u0442\u043e\u0434 <i>getCompletions<\/i> \u0432\u044b\u043f\u043b\u0435\u0432\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442, \u0430 \u0434\u0432\u0438\u0436\u043e\u043a \u0443\u0436\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u043f\u043e caption. \u041d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u0432\u0441\u0435\u0445 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u0440\u0438 \u043f\u043e\u043a\u0430\u0437\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0412\u0421\u0415 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <i>WebApi<\/i>, \u0430 \u0443 \u043d\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <i>GetRoleById<\/i>. \u0422\u043e\u0433\u0434\u0430 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <i>GetRoleById<\/i>, \u0447\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c (\u0442.\u0435. <i>WebApi.GetRoleById<\/i>, \u0432\u043c\u0435\u0441\u0442\u043e <i>GetRoleById<\/i>)<\/li>\n<li>\u041d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043d\u043e\u0434\u044b, \u043f\u043e\u043a\u0430 \u0434\u043e \u043d\u0438\u0445 \u043d\u0435 \u0434\u043e\u0439\u0434\u0435\u0442.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043d\u0430\u0434\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043c\u043f\u043b\u0435\u0442\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430\u043c\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443 \u043a <i>WebApi<\/i> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0438\u0437 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <i>if<\/i>. ). \u0418 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0447\u0442\u043e \u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0432\u043e\u0434 \u043d\u043e\u0432\u044b\u043c (\u043d\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443):<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0415\u0441\u043b\u0438 <b>\u0434\u0430<\/b> \u2014 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/li>\n<li>\u0415\u0441\u043b\u0438 <b>\u043d\u0435\u0442<\/b>, \u0438\u0449\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u043e \u043d\u0438\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c + \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438.<\/li>\n<li>\u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 <b>\u043d\u0435\u0442<\/b>, \u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0443\u0436\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f, \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0435\u0432\u0430 \u0442\u043e\u0447\u043a\u0443 \u0438 \u043e\u0442 \u043d\u0435\u0435 \u0432\u043b\u0435\u0432\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u043e \u0434\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f (\u043f\u0440\u043e\u0431\u0435\u043b, \u0442\u043e\u0447\u043a\u0430, \u0441\u043a\u043e\u0431\u043a\u0430).<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0442\u0443\u043b\u0442\u0438\u043f\u0430 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c, \u043d\u043e \u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043a\u0430\u043a \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0414\u0432\u0438\u0436\u043e\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0440 \u0434\u043b\u044f \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438 \u043e\u0433\u0440\u043e\u043c\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434 <i>getDocTooltip<\/i> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <i>completion<\/i>. \u0423 \u043d\u0430\u0441 \u0432 \u043d\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c) \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0432:<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0442\u0438\u043f\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e <i>snippet<\/i> \u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d <i>docHTML<\/i>, \u0442\u043e\u0433\u0434\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 (\u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e, \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u0438 \u0442.\u0434.) \u0438 \u0437\u0430\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u043d \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">  item.docHTML = [           '&lt;b&gt;',           item.caption,           '&lt;\/b&gt;',           '&lt;hr&gt;&lt;\/hr&gt;',           item.snippet         ].join('');<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u043e \u0443\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041d\u0430\u0434\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c HTML.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b       let signature = Object.keys(item.inputParameters)         .map(x =&gt; `${x} ${item.inputParameters[x]}`)         .join(', ');        if (signature) {         signature = `(${signature})`;       }        const path = [];       \/\/ \u0421\u043e\u0431\u0435\u0440\u0451\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430       if (item.parent) {         let parentId = item.parent;         while (parentId) {           path.push(parentId);           parentId = this.completions[parentId][0].parent;         }       }       const displayName =         [...path.reverse(), item.caption].join('.') + signature;       let type = item.type;       if (item.meta === 'class') {         type = 'class';       }        const description = item.description || '';       let html = `&lt;b&gt;${type} ${displayName}&lt;\/b&gt;&lt;hr&gt;`;       if (description) {         html += `&lt;p style=&quot;max-width: 400px; white-space: normal;&quot;&gt;${description}&lt;\/p&gt;`;       }       item.docHTML = html;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mj\/xw\/n-\/mjxwn-ok76rcui9naiccako10ke.png\"><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043d\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vs\/b7\/vq\/vsb7vq8yb4apcalyrna1_pwkdzs.png\"><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0443 \u043d\u0430\u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <i>WebApi<\/i>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u0447\u043a\u0443<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r2\/nm\/2t\/r2nm2trl8r87hmojcpvzv5pz5ja.png\"><\/p>\n<p>  \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f\u0445 \u0431\u0435\u0437 \u043c\u0443\u0447\u0435\u043d\u0438\u0439 \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/stackblitz.com\/edit\/avanpost-ace-code-completion\">\u0442\u0443\u0442<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/avanpost\/blog\/486240\/\"> https:\/\/habr.com\/ru\/company\/avanpost\/blog\/486240\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/avanpost\/blog\/486240\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/storage2\/6b9\/0aa\/331\/6b90aa33171a923892823dbacfbd3d65.png\"><\/div>\n<p>  <\/p>\n<p><strong>Ace<\/strong> (Ajax.org Cloud9 Editor) \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u043a \u043f\u043b\u044e\u0441\u044b, \u0442\u0430\u043a \u0438 \u043c\u0438\u043d\u0443\u0441\u044b. \u041e\u0434\u043d\u043e \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0441\u043d\u0438\u043f\u043f\u0435\u0442\u043e\u0432 \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f. \u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u043c \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297948","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297948","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297948"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297948\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}