Skip to content

Commit

Permalink
初始化 VSCode 插件项目 #658
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Apr 25, 2024
1 parent 4f14095 commit ae6dbe6
Show file tree
Hide file tree
Showing 26 changed files with 4,637 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ yarn.lock
/app/jestCD
/app/out
/app/dist-electron
**/node_modules
18 changes: 11 additions & 7 deletions .vscode/Sillot.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"path": "../_sili", // 列出子文件夹,在父文件夹的 setting.json 添加隐藏(排除)
"name": "司丽🤍/_sili 🗂️"
},
{
"path": "../_vscode_plugin", // 列出子文件夹,在父文件夹的 setting.json 添加隐藏(排除)
"name": "汐洛 VSC 插件🤍/_vscode_plugin 🗂️"
},
{
"path": "../docs", // 列出子文件夹,在父文件夹的 setting.json 添加隐藏(排除)
"name": "汐洛宝典🤍/docs 🗂️"
Expand All @@ -30,9 +34,9 @@
}
],
"settings": {
"files.associations": {
"*.sy": "json"
},
// "files.associations": {
// "*.sy": "json"
// },
"workbench.editor.wrapTabs": true,
"search.exclude": {
"**/.history": true
Expand All @@ -47,17 +51,17 @@
// Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code
"ms-ceintl.vscode-language-pack-zh-hans", // VSCode官方汉化
// Material Icon Theme
"PKief.material-icon-theme", // Material Design Icons 文件图标主题
"PKief.material-icon-theme", // Material Design Icons 文件图标主题,支持 .sy 文件显示思源笔记图标
// vscode-icons
"vscode-icons-team.vscode-icons", // 很全的官方文件图标主题
"vscode-icons-team.vscode-icons", // 很全的官方文件图标主题,支持 .sy 文件显示思源笔记图标
// VSCode Great Icons
"emmanuelbeziat.vscode-great-icons", // 很不错的一款文件图标主题
// Fluent Icons
"miguelsolorio.fluent-icons", // 现代扁平风的一款文件图标主题,捆绑了产品图标主题(还可以)
// Gruvbox Material Icon Theme
"JonathanHarty.gruvbox-material-icon-theme", // 蛮有意思的一款文件图标主题
// Atom Material Icons
"atommaterial.a-file-icon-vscode", // 很全的一款文件图标主题,捆绑了产品图标主题(还可以)。区分了 index.ts 非常好用。
// Atom Material Icons ~当前默认文件图标主题
"atommaterial.a-file-icon-vscode", // 很全的一款文件图标主题,捆绑了产品图标主题(还可以),支持 .sy 文件显示思源笔记图标。区分了 index.ts 非常好用。
// GitHub Theme
"GitHub.github-vscode-theme", // 不错的一款颜色主题,[GitHub Dark Dimmed] [GitHub Dark Colorblind] 提供了不错的视觉观感
// Winter is Coming Theme
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"deno.enable": false,
"files.exclude": {
"_sili": true,
"_vscode_plugin": true,
"docs": true,
"kernel": true,
"app/appearance": true
Expand Down
3 changes: 3 additions & 0 deletions _vscode_plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/dist/
**.vsix
**/protected.txt
30 changes: 30 additions & 0 deletions _vscode_plugin/Sillot/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
1 change: 1 addition & 0 deletions _vscode_plugin/Sillot/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts = true
5 changes: 5 additions & 0 deletions _vscode_plugin/Sillot/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
5 changes: 5 additions & 0 deletions _vscode_plugin/Sillot/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
}
21 changes: 21 additions & 0 deletions _vscode_plugin/Sillot/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
13 changes: 13 additions & 0 deletions _vscode_plugin/Sillot/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
40 changes: 40 additions & 0 deletions _vscode_plugin/Sillot/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
}
]
}
14 changes: 14 additions & 0 deletions _vscode_plugin/Sillot/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
9 changes: 9 additions & 0 deletions _vscode_plugin/Sillot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

Check notice on line 1 in _vscode_plugin/Sillot/CHANGELOG.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

_vscode_plugin/Sillot/CHANGELOG.md#L1

Expected: [None]; Actual: # Change Log

All notable changes to the "Sillot" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

Check notice on line 5 in _vscode_plugin/Sillot/CHANGELOG.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

_vscode_plugin/Sillot/CHANGELOG.md#L5

Expected: 80; Actual: 103

## [Unreleased]

- Initial release
42 changes: 42 additions & 0 deletions _vscode_plugin/Sillot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Sillot README

Check notice on line 1 in _vscode_plugin/Sillot/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

_vscode_plugin/Sillot/README.md#L1

Expected: [None]; Actual: # Sillot README

这是您的扩展“Sillot”的README。在编写简要描述后,我们建议包括以下部分。

## 功能

描述您的扩展的具体功能,包括您的扩展正在运行的屏幕截图。图像路径是相对于这个README文件。
例如,如果在扩展项目工作空间下有一个图像子文件夹:
![功能X](images/feature-x.png)

> 提示:许多流行的扩展使用动画。这是展示您的扩展的绝佳方式!我们推荐简短、专注的动画,易于跟随。

## 要求

如果您有任何要求或依赖,请添加一个部分来描述这些要求以及如何安装和配置它们。

## 扩展设置

如果您的扩展通过 `contributes.configuration` 扩展点添加了任何VS Code设置,请包括在内。
例如:
这个扩展贡献了以下设置:

* `myExtension.enable`:启用/禁用这个扩展。
* `myExtension.thing`:设置为 `blah` 以执行某些操作。

## 已知问题

指出已知问题可以帮助限制用户针对您的扩展提出重复问题。

## 发行说明

用户会感激您在更新扩展时提供发行说明。

### 1.0.0

...的初始版本。

## 遵循扩展指南

确保您已阅读扩展指南,并遵循创建扩展的最佳实践。

* [扩展指南](https://code.visualstudio.com/api/references/extension-guidelines)
92 changes: 92 additions & 0 deletions _vscode_plugin/Sillot/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"name": "sillot",
"displayName": "汐洛 Sillot",
"description": "汐洛官方插件",
"version": "0.1.1010",
"repository": "/~https://github.com/Hi-Windom/Sillot",
"engines": {
"vscode": "^1.88.0"
},
"categories": ["Programming Languages", "Snippets"],
"activationEvents": [
"onDidChangeTextDocument",
"onLanguage:plaintext",
"onLanguage:json",
"onLanguage:go",
"onLanguage:javascript",
"onLanguage:typescript",
"onLanguage:yaml",
"onLanguage:markdown",
"onLanguage:astro",
"onLanguage:csharp",
"onLanguage:kotlin",
"onLanguage:css",
"onLanguage:less",
"onLanguage:scss",
"onLanguage:python",
"workspaceContains:**/.editorconfig"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "sillot.helloWorld",
"title": "Hello World",
"category": "Sillot"
}
],
"languages": [
{
"id": "dosc",
"aliases": ["csod", "ds"],
"extensions": [".dosc"],
"configuration": "./src/_dosc.language-configuration.json"
},
{
"id": "sy",
"aliases": ["SY", "sy"],
"extensions": [".sy"],
"configuration": "./src/_sy.language-configuration.json"
}
],
"grammars": [
{
"language": "sy",
"scopeName": "source.sy",
"path": "./src/sy.tmLanguage.json"
}
]
},
"vsce": {
"baseImagesUrl": "https://my.custom/base/images/url",
"dependencies": false,
"yarn": false
},
"scripts": {
"vscode:prepublish": "pnpm run package",
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"vsce:package": "pnpm vsce package",
"compile-tests": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint",
"lint": "eslint src --ext ts",
"test": "vscode-test"
},
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "18.x",
"@types/vscode": "^1.88.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vscode/test-cli": "^0.0.8",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.26.0",
"eslint": "^8.57.0",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
}
}
Loading

0 comments on commit ae6dbe6

Please sign in to comment.