Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor IntelliJ IDEA 14不识别空格键模板_Meteor_Intellij Idea_Syntax Highlighting_Handlebars.js_Spacebars - Fatal编程技术网

Meteor IntelliJ IDEA 14不识别空格键模板

Meteor IntelliJ IDEA 14不识别空格键模板,meteor,intellij-idea,syntax-highlighting,handlebars.js,spacebars,Meteor,Intellij Idea,Syntax Highlighting,Handlebars.js,Spacebars,我正在写一篇文章,发现安装并启用Meteor和Handlebar插件的IntelliJ IDEA 14.1.4无法识别空格键模板: 在谷歌搜索之后,我尝试了文件>无效缓存/重新启动,但没有成功 我还发现,当我运行代码>重新格式化代码时,产生的缩进是不正确的。我想这两个问题都是相关的 下面是一个更简单的问题说明: 如何调试它?最后,我在IntelliJ IDEA 14中发现了一个非常棘手的语法错误。 主要的问题是{{和or/之间的空间。 {{if currentUser}}在语法上是正确的,但{{

我正在写一篇文章,发现安装并启用Meteor和Handlebar插件的IntelliJ IDEA 14.1.4无法识别空格键模板:

在谷歌搜索之后,我尝试了文件>无效缓存/重新启动,但没有成功

我还发现,当我运行代码>重新格式化代码时,产生的缩进是不正确的。我想这两个问题都是相关的

下面是一个更简单的问题说明:


如何调试它?

最后,我在IntelliJ IDEA 14中发现了一个非常棘手的语法错误。 主要的问题是{{和or/之间的空间。 {{if currentUser}}在语法上是正确的,但{{if currentUser}是错误的。 同样,用户{{/if}}而不是{/if}。 所以这里空格键的使用非常严格。实际上,不应该有额外的空格

<template name="home">
    {{#if currentUser}}
        <div class="template-home">
            <div class="well">
                <form class="form-inline syllabus-chooser">
                    <div class="form-group">
                        <select name="syllabusChooser" id="syllabusChooser" class="form-control">
                            <option value="0">(Select a syllabus to edit)</option>
                            {{#each syllabusSelectors}}
                                <option value="{{ value }}">{{ label }}</option>
                            {{/each}}
                        </select>
                    </div>
                    <button type="submit" id="syllabusChooserButton" class="btn btn-default">Edit</button>
                </form>
            </div>

            {{#if displayID}}
                <div class="well">
                    {{#autoForm collection="Syllabuses" doc=selectedSyllabusDoc id="insertSyllabusForm" type="update"}}
                        <fieldset>
                            <div class="row">
                                <div class="col-sm-2">{{> afQuickField name='alphaNumber' placeholder="ICS 101"}}</div>
                                <div class="col-sm-2">{{> afQuickField name='creditHours' placeholder="3"}}</div>
                                <div class="col-sm-2">{{> afQuickField name='prerequisites' placeholder="311 or consent"}}</div>
                                <div class="col-sm-6">{{> afQuickField name='title' placeholder="Course title"}}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">{{> afQuickField name='instructor' rows=2 placeholder="Name\noffice address, email"}}</div>
                                <div class="col-sm-6">{{> afQuickField name='textbooks' rows=2 placeholder= "Textbook title and author, or 'none'"}}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">{{> afQuickField name='objectives' rows=4 placeholder='* Students have ...\n* Students can ...\n* Students can ....'}}</div>
                                <div class="col-sm-6">{{> afQuickField name='policies' rows=4 placeholder="Can be 'none'."}}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">{{> afQuickField name='description' rows=4 placeholder='Insert course catalog description: http://www.catalog.hawaii.edu/courses/departments/ics.htm'}}</div>
                                <div class="col-sm-6">{{> afQuickField name='grading' rows=4 placeholder="5 homework assignments (10% each)\n1 midterm (15%)\n1 final exam (15%)\n1 final project (20%)"}}</div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">{{> afFormGroup name='learningOutcomes' type="select-checkbox"}}</div>
                                <div class="col-sm-6">
                                    {{> afQuickField name='courseLearningOutcomes' rows=12 placeholder="* Learning Outcome 1\n* Learning outcome 2"}}
                                    {{> afQuickField name='schedule' rows=12 placeholder="Week 1: ...\nWeek 2: ...\nWeek 3: ..."}}
                                </div>
                            </div>
                        </fieldset>
                        <button type="submit" class="btn btn-default btn-success btn-block">Save</button>
                    {{/autoForm}}
                </div>
            {{/if}}
        </div>

        <div class="well" style="padding: 0; max-height: 100px; overflow-y: auto">
            <ul>
                {{#each editStatusList}}
                    <li>Started editing {{ syllabusName }} {{ editTimestamp }}  {{#if editFinished}} ... finished. {{/if}} </li>
                {{/each}}
            </ul>
        </div>
    {{/if}}
</template>

根据您的屏幕截图,if块未正确关闭。{{if currentUser}}…{{/if}我没有在屏幕截图中显示整个文件,但我相信if块确实已正确关闭。下面是。请注意,屏幕截图还显示了一个由IntelliJ标记为错误的每个块,但明显向下关闭了两行。我仔细扫描了源代码,发现每个空格键{…}错过缩进。我将发布一个答案以更清楚地显示它。谢谢你的建议。当我将你的代码粘贴到我的应用程序中的新文件中时:a我仍然得到相同的突出显示错误,b缩进变错了!让我问你:如果你将我的原始源代码放入IntelliJ中,并执行代码>重新格式化代码,这是否是restore缩进是否正确?或者我的原始源代码是否也有错误?我刚刚在原始问题中添加了一个新的屏幕图像,以显示一个包含突出显示错误的更简单的文件。@PhilipJohnson,很抱歉我回复得太晚。我在IntelliJ中尝试了该代码,发现了真正的错误所在。请参阅我的新编辑和修改粘贴代码。祝你好运。天才!修复!谢谢!