简体   繁体   English

在 PhpStorm 中禁用快捷方式的代码完成

[英]Disable code completion for a shortcut in PhpStorm

I stumbled across this, when I tried solving this: Searching for Live Template in PhpStorm, from abbreviation (wrong expansion?) .当我尝试解决这个问题时,我偶然发现了这个: Searching for Live Template in PhpStorm, from abbreviation (wrong expansion?)

TL;DR TL;博士

In PhpStorm, in a markdown-file, when I write 3 back-ticks and press enter, it expands to this:在 PhpStorm 的 markdown 文件中,当我写 3 个反引号并按 Enter 键时,它会扩展为:

```angular2html

```

And I would like PhpStorm to stop helping me here, and just type what I typed:我希望 PhpStorm 停止在这里帮助我,只需输入我输入的内容:

```

```

Detailed description and solution attempts详细描述和解决尝试

In a Markdown-file ( readme.md ), I use it often to write a code block with three ticks:在 Markdown 文件 ( readme.md ) 中,我经常使用它来编写带有三个刻度的代码块:

```

But when I do so, PhpStorm suggest a bunch of stuff:但是当我这样做时,PhpStorm 建议了一堆东西:

反引号在 PhpStorm 中扩展 - angular2html

So if I press Enter here, then it expands to:因此,如果我在此处按Enter ,则它会扩展为:

```angular2html

```

So how do I change this behaviour?那么我该如何改变这种行为呢?


Solution attempt 1: Deactivate the bundled Angular-plugin解决方案尝试 1:停用捆绑的 Angular 插件

There is a (bundled) plugin called: 'Angular and AngularJS'.有一个(捆绑的)插件叫做:'Angular and AngularJS'。 If I deactivate that, then it looks like this:如果我停用它,那么它看起来像这样:

反引号在 PhpStorm 中扩展 - apacheconf

and expands to this:并扩展到:

```apacheconf

```

Solution attempt 2: Ensure Markdown is supported解决方案尝试 2:确保支持 Markdown

I'm really baffled why this happens.我真的很困惑为什么会发生这种情况。 Does PhpStorm not realize that I'm in an .md -file? PhpStorm 是否没有意识到我在.md文件中? And/or is this the usual desired behaviour, when people write three backticks in a and .md -file?和/或当人们在一个和.md文件中写三个反引号时,这是通常想要的行为吗?

I can confirm that I have an active (bundled) plugin called: 'Markdown' (version 222.3739.61).我可以确认我有一个名为“Markdown”(版本 222.3739.61)的活动(捆绑)插件。

Solution attempt 3: Add a new Live Template解决方案尝试 3:添加新的实时模板

This actually works, by making a new Live Template, to be this:通过制作一个新的实时模板,这实际上是有效的:

```
$END$

Remember the blank line underneath.记住下面的空行。 This is since I would like to press Enter , and that replaces the first 3 ticks with this, but not the ones PhpStorm automatically adds dues to auto-closing of brackets and backticks.这是因为我想按Enter ,并用它替换前 3 个刻度,但不是那些 PhpStorm 自动添加费用以自动关闭括号和反引号。

This solution attempt seems quite hacky, though.不过,这种解决方案尝试似乎很老套。 :-/ :-/

From https://youtrack.jetbrains.com/issue/IDEA-266239来自https://youtrack.jetbrains.com/issue/IDEA-266239

The pop up was created to make specification of code fence language easier and to enable automatic code injection.创建弹出窗口是为了使代码围栏语言的规范更容易并启用自动代码注入。 We can't disable it since it would affect a lot of users using it for fast code injection.我们不能禁用它,因为它会影响许多使用它进行快速代码注入的用户。

angular2html is the first entry in your case. angular2html是您案例中的第一个条目。 Somebody else may have another language ID (eg aidl ).其他人可能有另一个语言 ID(例如aidl )。

Right now it cannot be disabled or customized.现在它不能被禁用或自定义。 So you will have to either use your own workaround (with Live Template) or press Esc before hitting Enter .因此,您必须使用自己的解决方法(使用 Live Template)或在按Enter之前按Esc

Other than that: watch that IDEA-266239 ticket (star/vote/comment) to get notified with any progress.除此之外:观看IDEA-266239 票(星号/投票/评论)以获取任何进展通知。 No better suggestions right now.目前没有更好的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM