liiked / vs-code-extension-doc-zh Goto Github PK
View Code? Open in Web Editor NEWVS Code插件开发文档-中文版
Home Page: https://liiked.github.io/VS-Code-Extension-Doc-ZH/
License: MIT License
VS Code插件开发文档-中文版
Home Page: https://liiked.github.io/VS-Code-Extension-Doc-ZH/
License: MIT License
我想开发一款插件,用户按下tab则提示,但是如果没有匹配到我的规则,会出现影响正常tab的功能,比如缩减,代码自动提示这些功能,我该如何解决呢?
公司在开发一款基于VsCode的IDE,在开发项目的时候,有一个这样的需求:我们已经获取到了某个插件的源码,并做了修改。然后希望把修改后的插件的源码嵌入到我们自己的vscode源码中,然后进行编译打包。以便最终得到的IDE就是默认安装了修改后插件的IDE。
想问一下,如何把插件的源码嵌入VsCode源码中?
开发插件的时候,可以往其中嵌入编译环境嘛?例如嵌入gcc的编译环境?
如果不能的话,可以在用户安装插件的同时,安装gcc的编译环境到用户电脑上嘛?
什么是'Language Client'
一节的代码注释中:
// 当文件变动为'.clientrc'中那样时,**服务器
**
应为通知
吧。
Originally posted by @wyt2000 in #77 (comment)
如果我们忽略了这个信息,那就只能提供同样的代码补全项了。
建议译为
在这个示例中我们忽略了这个信息,总是提供相同的补全选项
Originally posted by @Martin730913 in #77 (comment)
我不知道我这个思路是否可行,如果可行
有个cdn加速的js文件失效了
API: activation-events
RT
建议将文档中较大的图适当缩小,比如树视图中的第一张图片显得格外大:
我使用的chrome,版本号是:87.0.4280.88(正式版本) (64 位)
模板字符串示例
◼️预备知识=>认识Typescript-变量和类型=>类型=>字符串中有这样一段说明:
你还可以使用模版字符串,它可以定义多行文本和内嵌表达式。 这种字符串是被反引号包围( `),并且以${ expr }
这种形式嵌入表达式
let name: string = `Gene`;
let age: number = 37;
let sentence: string = `Hello, my name is ${ name }.
I'll be ${ age + 1 } years old next month.`;
这与下面定义sentence
的方式效果相同:
let sentence: string = "Hello, my name is " + name + ".\n\n" +
"I'll be " + (age + 1) + " years old next month.";
而实际结果并不相同(似乎是因该段说明中的第二段代码中多加了一个换行符)。
以下为我的测试:
let aName: string = `Gene`;
let age: number = 37;
let sentence1: string = `Hello, my name is ${ aName }.
I'll be ${ age + 1 } years old next month.`;
console.log(sentence1);
let sentence2: string = "Hello, my name is " + aName + ".\n\n" +
"I'll be " + (age + 1) + " years old next month.";
console.log(sentence2);
Hello, my name is Gene.
I'll be 38 years old next month.
Hello, my name is Gene.
I'll be 38 years old next month.
随着 VS Code 不断迭代和生态日益壮大,我们已经正式推出了 本文档的 1.0 版本。
你也可以随时从本项目的 README 入口进入中文版翻译。
本文档纯属个人兴趣爱好,维护文档的工作也是在日常工作中抽空去做的,如有任何建议请不吝赐教,当然如果你对本项目owner 和所在公司或者行业感兴趣,也欢迎邮件咨询 iaserrlin at 163.com。
承蒙大家的厚爱,随着中文文档内容的不断充实,目前 star 数量也在日益增长,我们也深知自己的能力和精力都非常有限,在翻译工作中难免有所疏忽,如果你对我们的翻译内容有更好的意见,或是找到了我们工作中的错误,请在issue 中指出我们的错误, 甚至为我们提供 PR。
Stack Overflow
中 VS Code 相关问题标签、Gitter 频道 和 VS Code Dev Slack 讨论区。由于原文档过于追求平白易懂,平添了许多反复解释和略显啰嗦的句子和语法,翻译者需要注意,本项目更追求易懂和流畅,不要求逐字翻译,与原文出入最低做到70%即可,但不可扭曲其原本的意思,任何翻译中的困难可在issue中探讨。
及时更新术语表
禁止机器翻译
约定用法
如Promise通常不做翻译,若有必要或遇到困难的词语,请使用“中文(English)”的方式来显示,如:异步请求(promise)
,在有参考资料后得出的翻译结果,需要在术语表释义后面注明词汇出现来源或释义链接。
避免冗余
By implementing a `WebviewPanelSerializer`, your webviews can be automatically restored
when VS Code restarts. Serialization builds on `getState` and `setState`, and is only
enabled if your extension registers a `WebviewPanelSerializer` for your webviews.
后一句and is only enabled if your extension registers a WebviewPanelSerializer for your webviews
再翻译出来显得多余,可以不翻译。
平白易懂
Consider using a helper library to construct your HTML strings, or at least
ensure that all content from the user's workspace is properly sanitized.
虽然这里HTML 字符串贴合HTML strings
的表述,但是适当的加工则更有利于阅读,最终可考虑翻译为“尝试使用辅助库构建你的HTML模板,或者确保所有来自用户工作区的内容都通过了审查”。
兼收并蓄
在多人合作翻译中,个人风格可能与已提交翻译不匹配,但这种情况下不建议修改现有的翻译成果。
术语翻译优先参考github的开源翻译项目
本项目依赖nodejs,npm,docsify和官方文档。另外对新手不太友好(萌新等级警告
*
用于表示列表,而是使用-
等其他符号help translate
告知项目owner,通过后创建分支如“fix/chapter_testing_extensions”,修改文件,提交pr到“branch/docs”// 本地启动开发
npm i docsify-cli -g
docsify serve docs
主题色彩
文档选择器
hello hello, 最近开发 vscode插件,有个问题非常困扰我,就是如何 监听到 一个 task 的成功或失败
一般我都是运行一系列 任务(task),如果其中一个失败了,后面就不应该运行了,但是我现在监听不到, 比如这样
vscode.tasks.executeTask(
new vscode.Task(
{ type: 'try' },
vscode.TaskScope.Workspace,
'try',
'ext',
new vscode.ShellExecution('ll'),
),
)
vscode.tasks.onDidEndTask(console.log) // 这里面也看不出来是成功了 还是失败了。。
◼️开发插件=>测试插件=>概述=>测试入口下的 测试入口(src/test/runTest.ts))使用了vscode-testAPI,简化了下载...
中多了一个右括号()
)。
审阅插件指南
文档打开后,左边链接点击无效。
是不是 VuePress 的问题。
创建的webview页面,如何给页面Tab 添加类似favicon图标?
命令
审阅语言插件
插件功能
认识Typescript-类 -> 修饰符 -> static
中的代码演示
class Router {
static baseRoute = '/basePath';
calculateRoute(path: string) {
return this.baseRoute + this.commonPrefix + path; // 应该是 Router.baseRoute
}
constructor (public commonPrefix: number) { } // 应该是 string
}
let route1 = new Router('/api'); // 一级路径为/api
let route2 = new Router('/page'); // 一级路径为/page
console.log(route1.calculateRoute('/main'); // 最终路径/basePath/api/main 少了 )
console.log(route2.calculateRoute('/user'); // 最终路径/basePath/page/user 少了 )
https://liiked.github.io/VS-Code-Extension-Doc-ZH/references/_navbar.md 404
资源咋全部404了老板,这个还在维护吗
edge,谷歌,火狐都试过了,点击其他页面没有反应
如何请求自有的webapi接口呢?
比如请求https://www.baidu.com/,接收返回的string字符串
求指导
激活事件(references/activation events)
文本选择
问题如下
docsify s docs
切换页面会没有反应如题
docsify貌似没有生成静态页面,在路由跳转中经常会出现找不到内容和延迟加载渲染的问题。
试着fork的一份用我熟悉的vuepress静态化方式改了一点,基本能解决这个问题。
https://github.com/Rackar/VS-Code-Extension-Doc-ZH
但是fork的版本无法使用github action来自动部署页面。所以又单独开了项目:
https://github.com/Rackar/vscode-ext-doccn
由于navbar和sidebar目前都是自动提取的,章节和导航比较乱。
如果这套方案可以接受的话,以后逐步改善一下然后pr回来。
好像特别慢网页打开
只是翻译就按官方来,无关内容再多也只是堆砌并且阅读起来很不方便和影响
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.