Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode插件开发笔记 Atom插件开发笔记 #34

Open
abeet opened this issue Sep 5, 2018 · 0 comments
Open

VSCode插件开发笔记 Atom插件开发笔记 #34

abeet opened this issue Sep 5, 2018 · 0 comments

Comments

@abeet
Copy link
Owner

abeet commented Sep 5, 2018

插件都在目录
C:\Users\abeet\.vscode\extensions
下,
找到vetur插件目录,在目录下搜索
vue中v-for属性的说明
Renders the element or template block
在文件这两个文件中有这两文件
C:\Users\abeet\.vscode\extensions\octref.vetur-0.12.6\server\src\modes\template\tagProviders\vueTags.ts
C:\Users\abeet\.vscode\extensions\octref.vetur-0.12.6\server\dist\modes\template\tagProviders\vueTags.js

发现目录中带有server字样
server目录下的package.json里找找依赖
发现vscode-languageserver
感觉这是与语言服务有关,
发现vscode-emmet-helper
可能与emmet有关,
在代码里搜索这两个库的使用,没有得到很特别的东西,换个插件看看
看一下minapp-vscode插件
这个插件的注释是中文的,看到可能
自动补全相关的是

vscode_1.languages.registerCompletionItemProvider('wxml', autoCompletionWxml, '<', ' ', ':', '@', '.', '-', '"', '\'')

与之相关的js
C:\Users\abeet\.vscode\extensions\qiu8310.minapp-vscode-1.7.2\dist\plugin\AutoCompletion.js

然后从网上再找到另外一个插件
https://github.com/ElemeFE/vscode-element-helper
可能更有帮助
测试语法提示正常,然后在插件目录里搜索
Displays the location of the current page
在这个文件找到
C:\Users\abeet\.vscode\extensions\elemefe.vscode-element-helper-0.5.3\node_modules\element-helper-json\element-tags.json
再看哪此文件有读取这个json,
找到
C:\Users\abeet\.vscode\extensions\elemefe.vscode-element-helper-0.5.3\out\src\app.js
参考这个基本上就可以实现一个语法提示插件了

再到 简书和掘金上搜索一下“VSCode插件开发”,应该会找到一些VSCode插件开发相关文章

https://www.jianshu.com/p/9a2a346b10dc
https://www.jianshu.com/p/b5adc1f94182

https://code.visualstudio.com/docs/extensions/example-hello-world

根据文中的提示初始化一个工程,
期间还要登录到
https://app.vsaex.visualstudio.com/me
添加一个组织,用来标记插件的开发者
我登录邮箱是 abeet@outlook.com
组织是zving

然后按F5直接调试工程, 弹出
Press Ctrl+Shift+P and run the command named Hello World.
成功!

发布VSCode插件时需要填写
Personal Access Token

需要手工进入页面
https://zving.visualstudio.com/_details/security/tokens
这次我们配置好的Token是
dksmiehj3gujnynl35qbxcxe_vy4kt4rtc_6lj7sey4gkjkvdi7q
mkgv56dlxhy44u53zinhab6e_dl7kaeox2vq546ymbymqwjlq5ga
t6covuk_qx_f45e43h7dzotrqxr56_h2cxtueg2_wsiugg3filra
不知道什么原因,连续创建了好几个Token,才成功连上
终于 vsce create-publisher zving
成功

Atom插件开发的文章更少,直接参考
element-helper
注意要翻墙才能下载Atom插件。
在参考着写完插件后,还有问题,再找找找资料,计有
https://github.com/atom/autocomplete-plus/wiki/Provider-API

https://zhuanlan.zhihu.com/p/27913291

https://github.com/atom/autocomplete-html

关于怎么发布Atom扩展,找了好久,才找到
https://flight-manual.atom.io/hacking-atom/sections/publishing/

注意一下,在执行

apm publish patch

总是报错

fatal: AggregateException encountered.
could not read Username for 'https://github.com': No error

查了好久资料,终于是升级git到最新版解决问题!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant