Xcode 4 不保存项目文件的语法高亮显示?! (并且不能自动识别JS文件?!)

发布于 2024-11-30 03:49:51 字数 284 浏览 1 评论 0原文

你在开玩笑吧?

这不仅太糟糕了,我还必须选择 Editor >语法着色>对于项目中的每个 JS 文件,每当我重新启动 Xcode 4 时,为每个文件设置的所有语法着色首选项都会消失。这不应该保存在项目中的某个地方吗?

  1. 为什么 .js 文件不会自动检测为 javascript 语法?

  2. 为什么 Xcode 不在项目级别保存此首选项,或者至少为您选择它的文件保存此首选项?

请告诉我有更好的方法。

You're kidding, right?

Not only is it bad enough that I have to select Editor > Syntax Coloring > Javascript for every JS file in my project, whenever I restart Xcode 4, all the Syntax Coloring preferences set up disappear for each file. Shouldn't this be saved in the project somewhere?

  1. Why don't .js files automatically get detected as javascript syntax?

  2. And why doesn't Xcode save this preference at the project level or at the very least, for the files on which you've selected it?

Please tell me there's a better way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

身边 2024-12-07 03:49:51

JavaScript 的语法突出显示在 Xcode 4.3.2 中对我来说工作得很好(而且我在早期版本中没有注意到任何问题)。 Xcode 非常不稳定 - 您应该尝试按照 jayboston 的建议删除派生数据 - 我经常必须这样做并多次重新启动 Xcode 才能使其正常工作。

如果这不能解决问题,那么您的 xcodeproj 文件可能有点损坏,或者至少系统难以理解。尝试创建一个新的项目文件,然后将所有旧内容导入其中(手动 - 不要从旧项目文件复制),看看是否修复了任何问题。

Syntax highlighting for JavaScript works fine for me in Xcode 4.3.2 (plus I haven't noticed any issues in earlier versions). Xcode is very temperamental - you should try deleting the derived data as jayboston suggests - I often have to do this and restart Xcode a number of times to have it work properly.

If that doesn't solve it then there's a chance your xcodeproj file might be a little corrupted or at least hard for the system to understand. Try creating a new project file and then importing all your old contents into it (manually - don't copy from the old project file) to see if that fixes anything.

一张白纸 2024-12-07 03:49:51

我无法具体回答您关于“为什么”没有自动检测等问题,但也许重建项目索引将消除在启动 Xcode 时选择语法突出显示首选项的手动过程的需要。

如果您打开管理器并选择“项目”选项卡,您将看到派生数据位置。如果您使用右侧的按钮删除它,这将强制 Xcode 重建您的项目索引,其中包括语法突出显示信息。

我特别没有在我的 xcode 项目中使用过 Javascript,但我也遇到过类似的语法突出显示问题,这已经解决了。

不管这是否有效——APPl 对此给予一些关注将是一件好事。

I can't specifically answer your questions as to "why" there's not autodetection and such, but perhaps rebuilding your project index will eliminate the need for the manual process of selecting the syntax highlighting preference ea time you start Xcode.

If you open up Organizer and select the "Projects" tab you'll see the Derived Data location. If you Delete it with the button to the right that will force Xcode to rebuild your project index which includes the syntax highlighting information.

I specifically haven't used Javascript in my xcode projects, but I've had similar syntax highlighting issues which this resolved.

Regardless of whether this works or not - some attention from APPl on this one would be great.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文