我不确定我是否理解intellisense如何为Microsoft的新vsCode文本编辑器工作.在"Great Code Editing Experience"标题下的文档中,它在节点全局变量下显示警告,并提供灯泡建议以添加对d.ts文件的引用,以便您可以获取节点的智能感知:__dir
我有两个问题:
1 - 如何直接导入DefinitelyTyped文件(d.ts)(没有编辑器建议)或者我是否必须从github源复制它们并将它们放在typings目录中?
2 - 我可以获得任何具有打字稿定义的库的智能感知吗?我尝试了以下,但是当我输入express.或者when.,我没有得到任何intellisense.但是,我确实得到了节点intellisense.
/// <reference path="../typings/node/node.d.ts"/>
/// <reference path="../typings/express/express.d.ts" />
var when = require('when')
, express = require('express')
, gulp = require('gulp')
Run Code Online (Sandbox Code Playgroud) 您好我问的是如何在Windows上的最后一次更新中在Visual Studio代码中格式化代码.
我试过ctrl k+ Ctrl d不行..我也试过了Shift + Alt + F.它也没用.所以请帮助我,它不重复,因为我尝试了以下解决方案:
如何在Visual Studio代码(VSCode)中格式化代码
我正在使用Visual Studio Code并且具有相当常见的项目结构:
??? client/
? ??? tsconfig.json
??? shared/
??? server/
? ??? tsconfig.json
??? project.json
Run Code Online (Sandbox Code Playgroud)
这两个tsconfig文件具有不同的设置(例如,client/目标ES5 下的设置,server/目标ES6下的设置).
问题是我希望共享目录包含在两个项目中.我不能使用tsconfig这样做,因为该exclude选项不允许我包含一个比tsconfig.json更高的目录中的文件夹,并且使用files我必须不断保持文件列表是最新的,因为它不支持全球.
请注意,我可以通过将共享文件夹添加到tsc中来编译,我想要的是Visual Studio Code IDE识别intellisense的共享代码等.
是等待filesGlob的唯一选择吗?
如何ctrl + click在 mac OS 的 Visual Studio 代码编辑器中进行定义?现在是 F12,它使用我的 mac 来显示桌面。
/home今天早上,我收到多用户远程 SSH 开发环境服务器上的磁盘空间警报。
运行时partition -$xdev -type f -ls | sort -k 7 -r -n | head -20我发现最大的目录.vscode-server空间接近 1GB。
974M .\n10:06:16 my_user@my_server .vscode-server \xe2\x86\x92 pwd\n/home/my_user/.vscode-server\n10:08:06 my_user@my_server .vscode-server \xe2\x86\x92 \nRun Code Online (Sandbox Code Playgroud)\n\n29459 38028 -rwxr-xr-x 1 my_user my_user 38940504 Aug 15 11:17 ./my_user/.vscode-server/bin/some_hash/node\n26270 38028 -rwxr-xr-x 1 my_user my_user 38940504 Sep 3 16:51 ./my_user/.vscode-server/bin/some_other_hash/node\n24078 38028 -rwxr-xr-x 1 my_user my_user 38940504 Oct 15 10:34 ./my_user/.vscode-server/bin/yet_another_hash/node\n2387 38028 -rwxr-xr-x 1 my_user my_user 38940504 Oct 9 01:58 /home/my_user/.vscode-server/bin/last_hash/node\nRun Code Online (Sandbox Code Playgroud)\n\n查看目录,看起来这是远程服务器上大量 VsCode …
这是一个类似的情况我已经遇到过了几个月前使用pylint的事先pylance:
我的python 3.9x- 脚本(使用VS Codeon Ubuntu 20.04 LTS)从以下自定义“工具”导入开始:
import sys
sys.path.append(
'/home/andylu/Dokumente/Allgemeines_material/Sonstiges/Programming/Python/Scripts/'
)
import General.Misc.general_tools as tools
Run Code Online (Sandbox Code Playgroud)
现在,Pylance声明:
Import "General.Misc.general_tools" could not be resolvedPylance (reportMissingImports)
Run Code Online (Sandbox Code Playgroud)
即使在程序执行期间模块被完美地导入,也会发生这种情况。
因此,为了确保Pylance理解这是一个现有的模块路径,除了sys.path.append(..)- 方法之外,我在settings.json- 文件中添加了以下内容:
{
...
// Possible values: "Jedi", "Pylance", "Microsoft", "None".
"python.languageServer": "Pylance",
// NOTE on changing from microsoft to pylance language server: python.autoComplete.extraPaths --> python.analysis.extraPaths
// Docs: https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings
"python.analysis.extraPaths": [
"/home/andylu/Dokumente/Allgemeines_material/Sonstiges/Programming/Python/Scripts"
],
... …Run Code Online (Sandbox Code Playgroud) python-import python-3.x visual-studio-code vscode-settings pylance
经常Saving Getting code actions from使用 VSCode。
VSCode 冻结,文件未保存。Prettier、Eslint、React 插件等很多插件似乎都会发生这种情况。这种情况以前不会发生,但知道这种情况经常发生。
有办法阻止这种情况发生吗?
每次在 VSCode 上启动终端时,都会收到以下提示。Terminal.app 上不会发生这种情况。
/usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34:
SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip
and other standards-based tools.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我在 VS Code 中使用 Prettier。我注意到在保存时使用格式时,Prettier 每次都会在对象的最后一行添加尾随逗号。
例如,假设我有一个这样的 JS 对象:
obj = {
hello: 'hello',
world: 'world'
}
Run Code Online (Sandbox Code Playgroud)
Prettier 把它变成了这样:
obj = {
hello: 'hello',
world: 'world',
}
Run Code Online (Sandbox Code Playgroud)
注意后面的额外逗号
'world'
在设置中没有找到解决此问题的选项。
express ×1
javascript ×1
node.js ×1
plantuml ×1
prettier ×1
pylance ×1
python ×1
python-3.x ×1
tsconfig ×1
typescript ×1