如何将OmniPascal安装到vscode中 [英] How do install OmniPascal into vscode

查看:503
本文介绍了如何将OmniPascal安装到vscode中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Visual Studio市场上的OmniPascal页面:

如何安装

  • 安装 Visual Studio代码并打开它.
  • 打开View -> Command Palette...并键入ext install OmniPascal
  • 重新启动Visual Studio代码并打开File -> Preferences -> User Settings
  • 将密钥"objectpascal.delphiInstallationPath"添加到正确的编辑器,并将其值设置为Delphi安装路径.不要忘记逃脱反斜杠!示例:

How to install

  • Install Visual Studio Code and open it.
  • Open View -> Command Palette... and type ext install OmniPascal
  • Restart Visual Studio Code and open File -> Preferences -> User Settings
  • Add the key "objectpascal.delphiInstallationPath" to the right editor and set its value to the Delphi installation path. Don't forget to escape the backslashes! Example:

"objectpascal.delphiInstallationPath" = "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0",

除了那似乎是错误的;它抱怨说它不应该是 = (等于),而是 : (冒号):

Except that seems to be wrong; it complains that it shouldn't be an = (equals), but a : (colon):

我认为这是一个错字,应该是一个冒号:

I assume that's a typo, and it should be a colon:

页面上的示例路径为:

C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0

但是动画安装会粘贴到通往子文件夹 source 的路径中:

But the animated installation pastes in a path leading to the subfolder source:

是哪个?我之所以只问是因为这两种方法似乎都无法提出建议:

Which is it? I only ask because neither path seems to enable suggestions:

推荐答案

除了那似乎是错误的;它抱怨说它不应该是=(等于),而应该是:(冒号)

Except that seems to be wrong; it complains that it shouldn't be an = (equals), but a : (colon)

哦,显然文档中有错误.此问题将在下一个版本中修复.谢谢. 当然,它应该是一个冒号,因为它是JSON文件中的一个条目.

Oh, obviously there's an error in the documentation. This will be fixed with the next release. Thanks. Of course it should be a colon since it is an entry in a JSON file.

但是路径应该是什么?

条目objectpascal.delphiInstallationPath应该指向Delphi的安装路径.是否定义source子目录都没有关系.该路径在内部用于递归查找Delphi单元.由于所有.pas文件都位于source文件夹中,因此当该条目看起来像这样时,查找会稍微快一些:

The entry objectpascal.delphiInstallationPath should point to the path where Delphi is installed. It doesn't matter whether you define the source subdirectory or not. The path is internally used to find Delphi units recursively. As all .pas files are located in the source folder the lookup is slightly faster when the entry looks like this:

"objectpascal.delphiInstallationPath": "C:\\Program Files (x86)\\Embarcadero\\Studio\\16.0\\Source"

免费的Pascal用户应指向FPC目录

示例:

"objectpascal.delphiInstallationPath": "C:\\lazarus\\fpc"

我之所以只问是因为这两个路径似乎都无法提出建议

I only ask because neither path seems to enable suggestions

您的屏幕快照中突出显示的语法似乎来自另一个用于Visual Studio代码的Pascal插件.当.pas文件中的OmniPascal插件处于活动状态时,当前文件类型为"ObjectPascal".您会在微笑的反馈按钮旁边的右下角看到它:

The syntax highlighting in your screenshot seems to come from another Pascal plugin for Visual Studio Code. When the OmniPascal plugin is active in a .pas file then the current file type is "ObjectPascal". You see it in the bottom right corner next to the smiling feedback button:

当当前文件类型为"Pascal"或其他任何文件时,说明错误的插件处于活动状态.单击文件类型,然后将其更改为"ObjectPascal".现在,您应该获得代码完成,快速信息等.

When the current file type is "Pascal" or anything else then the wrong plugin is active. Click on the file type and change it to "ObjectPascal". Now you should get code completion, quick infos and more.

这篇关于如何将OmniPascal安装到vscode中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆