xcode Xcode拼写检查
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2697044/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode spell checking
提问by Mihai Damian
Just wondering if there is a way to enable spell checking in Xcode. Maybe an add-on or something...
只是想知道是否有办法在 Xcode 中启用拼写检查。也许是附加组件或其他东西...
采纳答案by Williham Totland
You turn on spelling from the Edit menu (right at the bottom).
您可以从“编辑”菜单(底部右侧)打开拼写。
Edit:For code files, there's always the compiler, although that won't check comments, and won't stop you from spelling things wrong; it'll only stop you from spelling things inconsistently.
编辑:对于代码文件,总是有编译器,虽然它不会检查注释,也不会阻止你拼写错误;它只会阻止你拼写不一致。
Reedit:In the 4 yearssince this was posted, the spell checker has moved a little: It is now under Edit > Format > Spelling and Grammar. Format is near, but not atthe bottom.
重新编辑:自发布以来的4 年里,拼写检查器发生了一些变化:它现在位于“编辑”>“格式”>“拼写和语法”下。格式近了,但不是在底部。
回答by Ramis
In Xcode 4.5 you need to choose: Edit -> Format -> Spelling and Grammar -> Check Document Now (cmd+ ;)
在 Xcode 4.5 中,您需要选择:Edit -> Format -> Spelling and Grammar -> Check Document Now ( cmd+ ;)
回答by mOp
Put the cursor infront of your comment and press cmd ;this will jump to the next misspelt word.
将光标放在您的评论前面,然后按cmd ;这将跳转到下一个拼写错误的单词。
回答by Vladimir Horwitz
You can also do: Edit > Format > Spelling and Grammar > Check Spelling While Typing. (Xcode 4.6.3)
您还可以执行以下操作:“编辑”>“格式”>“拼写和语法”>“键入时检查拼写”。(Xcode 4.6.3)
回答by ZevsVU
Spell checking was broken in Xcode 9 and 10. It's now fixed in Xcode 11.0.
(Edit ? Format ? Spelling and Grammar ? Check Document Now)
拼写检查在 Xcode 9 和 10 中被破坏。它现在在 Xcode 11.0 中得到修复。
(编辑?格式?拼写和语法?立即检查文档)
Original answer below:
原答案如下:
Unfortunately it doesn't work in Xcode 9 and 10. I posted a bug to Apple using "Bug Report". And it was marked as a dupe of a bug with number "32062963". And I found it here.
不幸的是,它在 Xcode 9 和 10 中不起作用。我使用"Bug Report"向 Apple 发布了一个错误。它被标记为一个编号为“32062963”的错误的欺骗。我在这里找到了它。
So if you want it works, PLEASE, POST A BUG! here.
所以如果你想让它工作,请发布一个错误!在这里。
Apple uses this to gauge how serious a bug is.
Apple 使用它来衡量错误的严重程度。
As it was mentioned hereby Donarb.
正如Donarb在这里提到的那样。
回答by dlemex
As of Xcode 11 (tested in 11.3.1), if you turn on "Check spelling while you type", found in the Edit->Format->Spelling and Grammar menu, Xcode will display the red word spelled wrong indicator for comments as they are spelled wrong. It will also spell check camel case identifiers (much to my surprise). I am only just now using this so I don't know the sharp corners but it is exciting. As someone that is bilingual, I find myself mangling words. You can also set the preferred language using the "Show spelling and Grammar" option.
从 Xcode 11(在 11.3.1 中测试)开始,如果您在 Edit->Format->Spelling and Grammar 菜单中打开“Check Spelling while you type”,Xcode 将显示红色单词拼写错误指示符作为注释他们拼写错误。它还会拼写检查驼峰式标识符(令我惊讶)。我只是现在才使用它,所以我不知道尖角,但它很令人兴奋。作为一个双语者,我发现自己在乱写单词。您还可以使用“显示拼写和语法”选项设置首选语言。
回答by Oz Solomon
The Scribe plugincan do that (among other things). It's smart enough not to spell check code so you don't get a lot of false positives, and you can also right-click to get spelling suggestions.
该抄写插件可以做到这一点(除其他事项外)。不拼写检查代码足够聪明,因此您不会得到很多误报,并且您还可以右键单击以获取拼写建议。
Full disclosure: I'm the author of the plugin.
完全披露:我是插件的作者。