<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual Studio Code &#8211; 编程技术记录</title>
	<atom:link href="https://blog.z6z8.cn/tag/visual-studio-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.z6z8.cn</link>
	<description>世界你好!</description>
	<lastBuildDate>Thu, 07 Jan 2021 08:36:53 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>VSCode插件开发&#8211;一些API</title>
		<link>https://blog.z6z8.cn/2021/01/07/vscode%e6%8f%92%e4%bb%b6%e5%bc%80%e5%8f%91-%e6%89%93%e5%bc%80%e6%9c%ac%e5%9c%b0%e7%9b%ae%e5%bd%95%ef%bc%88openfolder%ef%bc%89/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Thu, 07 Jan 2021 08:36:53 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=951</guid>

					<description><![CDATA[VSCode 打开本地目录或工作空间 命令ID vscode.openFolder ,打开一个目录或者工作空间 [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>VSCode</h1>
<h2>打开本地目录或工作空间</h2>
<p>命令ID <code>vscode.openFolder</code> ,打开一个目录或者工作空间。可以在当前窗口打开，或者新建窗口打开。<br />
参数</p>
<ul>
<li><code>uri</code> ，Uri类型，可选，目录（工作空间）路径。如果不提供，那么将会弹出一个原生的目录选择对话框</li>
<li><code>newWindow</code>，可选，是否打开一个新的窗口</li>
</ul>
<pre><code class="language-javascript">// 在新窗口打开/some/path/to/folder
let uri = vscode.Uri.file("/some/path/to/folder");
vscode.commands.executeCommand("vscode.openFolder",uri,true);</code></pre>
<h2>当前活动的Terminal（Shell终端）</h2>
<p>内置方法<code>vscode.window.activeTerminal</code></p>
<h2>创建Terminal（Shell终端）</h2>
<p>使用内置方法<code>vscode.window.createTerminal</code>，它有三个重载函数, 返回值均为<code>vscode.Terminal</code></p>
<ul>
<li>createTerminal(name?: string, shellPath?: string, shellArgs?: string[] | string): Terminal</li>
</ul>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>可选 ，终端创建后显示在UI上的名字</td>
</tr>
<tr>
<td>shellPath</td>
<td>可选，自定义shell终端的执行路径</td>
</tr>
<tr>
<td>shellArgs</td>
<td>可选 ，传递给自定义终端的执行参数。<br />只对Windows生效</td>
</tr>
</tbody>
</table>
<p>shellArgs 详细格式参见https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6 </p>
<ul>
<li>createTerminal(options: TerminalOptions): Terminal</li>
</ul>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>options</td>
<td>必选 ，TerminalOptions配置参数</td>
</tr>
</tbody>
</table>
<p><code>TerminalOptions</code>可用的值</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>占位占位占位占位占位占位占位占位占位占位占位占位占位</td>
<td></td>
</tr>
<tr>
<td>cwd</td>
<td>可选 ，string 或 Uri ，终端的工作目录</td>
</tr>
<tr>
<td>env</td>
<td>可选 ，object ，添加到终端中的环境变量</td>
</tr>
<tr>
<td>hideFromUser</td>
<td>可选 ，boolean ，如果设置为true，终端将正常运行，但直到调用Terminal.show时，才会对用户公开。 通常的用法是在需要运行可能需要交互性，但只想在需要交互时对用户公开</td>
</tr>
<tr>
<td>name</td>
<td>可选 ，string ，终端创建后显示在UI上的名字</td>
</tr>
<tr>
<td>shellArgs</td>
<td>可选 ， string[] 或 string  ，传递给自定义终端的执行参数<br />只对Windows生效</td>
</tr>
<tr>
<td>shellPath</td>
<td>可选 ， string  ，自定义shell终端的执行路径</td>
</tr>
<tr>
<td>strictEnv</td>
<td>可选 ， boolean  ，终端环境是否应完全与TerminalOptions.env中提供的一致。 如果为false（默认），则环境将基于窗口的环境，并且还会在顶部应用配置的平台设置，例如terminal.integrated.windows.env。 如果true，则必须提供完整的环境。</td>
</tr>
</tbody>
</table>
<ul>
<li>createTerminal(options: ExtensionTerminalOptions): Terminal<br />
此方法将创建一个由插件（扩展）控制输入输出的终端环境</li>
</ul>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>options</td>
<td>必选 ，ExtensionTerminalOptions配置参数</td>
</tr>
</tbody>
</table>
<p><code>ExtensionTerminalOptions</code>可用的值</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>必选 ，string ，终端创建后显示在UI上的名字</td>
</tr>
<tr>
<td>pty</td>
<td>必选 ， Pseudoterminal 配置参数</td>
</tr>
</tbody>
</table>
<p><code>Pseudoterminal</code>可用的值</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>解释</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>必选 ，string ，终端创建后显示在UI上的名字</td>
</tr>
<tr>
<td>pty</td>
<td>必选 ， Pseudoterminal 配置参数</td>
</tr>
</tbody>
</table>
<p>Pseudoterminal 参见https://code.visualstudio.com/api/references/vscode-api#Pseudoterminal </p>
<p>参考<br />
<a href="https://code.visualstudio.com/api/references/commands">https://code.visualstudio.com/api/references/commands</a><br />
<a href="https://code.visualstudio.com/api/references/vscode-api">https://code.visualstudio.com/api/references/vscode-api</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>typescript 聚合多个文件的多个类到一个命名空间</title>
		<link>https://blog.z6z8.cn/2020/01/21/typescript-%e8%81%9a%e5%90%88%e5%a4%9a%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e5%a4%9a%e4%b8%aa%e7%b1%bb%e5%88%b0%e4%b8%80%e4%b8%aa%e5%91%bd%e5%90%8d%e7%a9%ba%e9%97%b4/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Tue, 21 Jan 2020 02:56:17 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[namesapce]]></category>
		<category><![CDATA[typescript]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=777</guid>

					<description><![CDATA[最近调研VSCode的插件开发，选择typescript语言，看了typescript的官方的指导手册关于na [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>最近调研VSCode的插件开发，选择typescript语言，看了typescript的官方的指导手册关于<a href="http://www.typescriptlang.org/docs/handbook/namespaces.html" title="namespace">namespace</a>的使用方式，我尝试类官方给出的一个文件和多个文件场景下使用namespace 。<br />
结果一个文件使用namesapce没有问题，但是多个文件共享namespace，VSCode的语法提示总是提示找不到xxxx。<br />
重点说明下，插件工程使用<code>yo code</code>创建的，namespace的示例也是官方的，官方的多个文件共享一个命名空间的方法是使用<code>/// &lt;reference path = &quot;xxxx.ts&quot; /&gt;</code>指令。</p>
<p>百思不解，百度依然不解。幸好与多年的c++经验，借鉴c++的namespace中导入符号的方法，我找到类一条可行的路----综合利用<code>nameapce</code> , <code>import as</code> , <code>extends</code>，示意如下:</p>
<p>a.ts内容</p>
<pre><code class="language-typescript">//a.ts
export class A {
}</code></pre>
<p>b.ts内容</p>
<pre><code class="language-typescript">//b.ts
export class B {
}</code></pre>
<p>c.ts内容</p>
<pre><code class="language-typescript">//c.ts
export class C {
}</code></pre>
<p>然后创建一个聚合的ts文件，将 a,b,c的符号以子类继承方式聚合<br />
my.ts</p>
<pre><code class="language-typescript">//my.ts
import * as _a from 'a';
import * as _b from 'b';
import * as _c from 'c';

expport namespace  my {
    export class A extends _a.A {}
    export class B extends _b.B {}
    export class C extends _c.C {}
}
</code></pre>
<p>使用示意：</p>
<pre><code class="language-typescript">import {my} from 'my';

let tmp = new my.A();</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Windows10：配置Visual Studio Code 以SSH方式访问远程主机</title>
		<link>https://blog.z6z8.cn/2019/09/21/windows10%ef%bc%9a%e9%85%8d%e7%bd%aevisual-studio-code-%e4%bb%a5ssh%e6%96%b9%e5%bc%8f%e8%ae%bf%e9%97%ae%e8%bf%9c%e7%a8%8b%e4%b8%bb%e6%9c%ba/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Sat, 21 Sep 2019 02:49:16 +0000</pubDate>
				<category><![CDATA[安全运维]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://139.155.43.7:8000/?p=348</guid>

					<description><![CDATA[Windows10上遇到过ssh的坑，记录下过程 参考 https://code.visualstudio.c [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Windows10上遇到过ssh的坑，记录下过程</p>
<p>参考 <a href="https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client">https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client</a></p>
<h1>环境和知识准备</h1>
<ul>
<li>远程主机，并开启ssh-server服务（通常端口22）</li>
<li>Windows环境（本文Windwos10家庭版）</li>
<li>Visual Studio Code</li>
<li>公钥加密算法，对SSH，通常为RSA</li>
<li>已经生成好的ssh公钥文件和私有文件</li>
</ul>
<h1>步骤</h1>
<h2>安装ssh-client</h2>
<p>对于Windows10的一些版本，可以通过<code>设置--系统--应用和功能--管理可选功能--添加功能</code>来开启ssh-client，奈何本穷的Windows10不支持。</p>
<p>还有两种方法来安装ssh-client</p>
<p>通过PowerShell安装，以管理员方式启动PowerShell，具体参考<a href="https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse" title="这里">这里</a>，反正本穷是没有成功。</p>
<p>于是，只有通过安装Git for Windows来安装ssh-client了，<a href="https://git-scm.com/download/win" title="下载地址">下载地址</a></p>
<h2>安装RemoteSSH</h2>
<p>这里需要给Visual Studio Code 安装扩展包，以支持RemoteSSH。<code>Visual Studio Code -- 查看 --扩展</code>,在扩展中搜索<code>Remote Development</code>，然后安装这个扩展包，会自动安装相关依赖包。</p>
<h2>配置Vistual Studio Code SSH</h2>
<p><code>Visual Studio Code -- 设置</code>，搜索SSH，在结果列表中找到<code>扩展--Remote-SSH -- Remote.SSH:Config File</code>，自定义RemoteSSH的配置文件路径，然后创建这个配置文件，内容如下:</p>
<pre><code>Host 自定义别名
    User 远程主机ssh登陆的用户名
    HostName 远程主机名字，可以是ip地址
    Port 远程主机ssh端口号，一般是22
    IdentityFile 身份验证文件路径，即ssh私钥文件路径</code></pre>
<h2>访问</h2>
<p>Vistual Studio Code -- 查看 --命令面板 --Remote-SSH：Connect ToHost</p>
<p>选择配置文件中配置好的主机即可。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
