-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 添加vscode扩展框架 #9
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
Open
textGamex
wants to merge
13
commits into
main
Choose a base branch
from
vscode-extension
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
681f8b0
feat: 添加vscode扩展框架
textGamex ced8ce9
feat: update package.json and pnpm-lock.yaml with additional metadata…
textGamex 4cc06b9
feat: 完善框架, 添加Vue依赖
textGamex 96d34b9
feat: 添加初始 panel
textGamex 2792583
Merge branch 'main' into vscode-extension
textGamex 869487c
feat: 添加包管理器组件及其详细信息展示,更新依赖和配置
textGamex 93a99c9
feat: 添加依赖信息显示
textGamex fa879a9
feat: 将搜索框固定而不随着列表一起滚动
textGamex 6e47a9d
Merge branch 'main' into vscode-extension
textGamex ad2b292
Merge branch 'main' into vscode-extension
textGamex 51a45b0
适配api更新
textGamex 711c3e9
Update src/ParadoxPM.Extension/src/components/PackageDetails.vue
textGamex 80c3fa4
仅在DEBUG中配置policy
textGamex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| dist/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| enable-pre-post-scripts = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| // See http://go.microsoft.com/fwlink/?LinkId=827846 | ||
| // for the documentation about the extensions.json format | ||
| "recommendations": [ | ||
| "dbaeumer.vscode-eslint", | ||
| "vue.volar" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Debug Extension", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "args": ["--extensionDevelopmentPath=${workspaceFolder}"], | ||
| "outFiles": ["${workspaceFolder}/dist/extension/*.js"], | ||
| "preLaunchTask": "pnpm: dev", | ||
|
|
||
| }, | ||
| { | ||
| "name": "Preview Extension", | ||
| "type": "extensionHost", | ||
| "request": "launch", | ||
| "args": ["--extensionDevelopmentPath=${workspaceFolder}"], | ||
| "outFiles": ["${workspaceFolder}/dist/extension/*.js"], | ||
| "preLaunchTask": "pnpm: build" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "type": "shell", | ||
| "command": "pnpm", | ||
| "args": ["run", "dev"], | ||
| "problemMatcher": { | ||
| "owner": "typescript", | ||
| "fileLocation": "relative", | ||
| "pattern": { | ||
| "regexp": "^([a-zA-Z]\\:/?([\\w\\-]/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$", | ||
| "file": 1, | ||
| "line": 3, | ||
| "column": 4, | ||
| "code": 5, | ||
| "message": 6 | ||
| }, | ||
| "background": { | ||
| "activeOnStart": true, | ||
| "beginsPattern": "^.*extension build start*$", | ||
| "endsPattern": "^.*extension (build|rebuild) success.*$" | ||
| } | ||
| }, | ||
| "isBackground": true, | ||
| "presentation": { | ||
| "reveal": "never" | ||
| }, | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": true | ||
| }, | ||
| "label": "pnpm: dev" | ||
| }, | ||
| { | ||
| "type": "shell", | ||
| "command": "pnpm", | ||
| "args": ["run", "build"], | ||
| "group": { | ||
| "kind": "build", | ||
| "isDefault": false | ||
| }, | ||
| "problemMatcher": [], | ||
| "label": "pnpm: build" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| .vscode/** | ||
| .vscode-test/** | ||
| out/** | ||
| node_modules/** | ||
| src/** | ||
| .gitignore | ||
| .yarnrc | ||
| esbuild.js | ||
| vsc-extension-quickstart.md | ||
| **/tsconfig.json | ||
| **/eslint.config.mjs | ||
| **/*.map | ||
| **/*.ts | ||
| **/.vscode-test.* |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # ParadoxPM-Server README | ||
|
|
||
| This is the README for your extension "ParadoxPM-Server". After writing up a brief description, we recommend including the following sections. | ||
|
|
||
| ## Features | ||
|
|
||
| Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. | ||
|
|
||
| For example if there is an image subfolder under your extension project workspace: | ||
|
|
||
| \!\[feature X\]\(images/feature-x.png\) | ||
|
|
||
| > Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. | ||
|
|
||
| ## Requirements | ||
|
|
||
| If you have any requirements or dependencies, add a section describing those and how to install and configure them. | ||
|
|
||
| ## Extension Settings | ||
|
|
||
| Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. | ||
|
|
||
| For example: | ||
|
|
||
| This extension contributes the following settings: | ||
|
|
||
| * `myExtension.enable`: Enable/disable this extension. | ||
| * `myExtension.thing`: Set to `blah` to do something. | ||
|
|
||
| ## Known Issues | ||
|
|
||
| Calling out known issues can help limit users opening duplicate issues against your extension. | ||
|
|
||
| ## Release Notes | ||
|
|
||
| Users appreciate release notes as you update your extension. | ||
|
|
||
| ### 1.0.0 | ||
|
|
||
| Initial release of ... | ||
|
|
||
| ### 1.0.1 | ||
|
|
||
| Fixed issue #. | ||
|
|
||
| ### 1.1.0 | ||
|
|
||
| Added features X, Y, and Z. | ||
|
|
||
| --- | ||
|
|
||
| ## Following extension guidelines | ||
|
|
||
| Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension. | ||
|
|
||
| * [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines) | ||
|
|
||
| ## Working with Markdown | ||
|
|
||
| You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: | ||
|
|
||
| * Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux). | ||
| * Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux). | ||
| * Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets. | ||
|
|
||
| ## For more information | ||
|
|
||
| * [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) | ||
| * [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) | ||
|
|
||
| **Enjoy!** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
| import tsParser from "@typescript-eslint/parser"; | ||
|
|
||
| export default [{ | ||
| files: ["**/*.ts"], | ||
| }, { | ||
| plugins: { | ||
| "@typescript-eslint": typescriptEslint, | ||
| }, | ||
|
|
||
| languageOptions: { | ||
| parser: tsParser, | ||
| ecmaVersion: 2022, | ||
| sourceType: "module", | ||
| }, | ||
|
|
||
| rules: { | ||
| "@typescript-eslint/naming-convention": ["warn", { | ||
| selector: "import", | ||
| format: ["camelCase", "PascalCase"], | ||
| }], | ||
|
|
||
| curly: "warn", | ||
| eqeqeq: "warn", | ||
| "no-throw-literal": "warn", | ||
| semi: "warn", | ||
| }, | ||
| }]; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { ExtensionContext, Webview } from "vscode"; | ||
|
|
||
| export class WebviewHelpers { | ||
| static getHtml(webview: Webview, context: ExtensionContext, input: string) { | ||
| return __getWebviewHtml__({ | ||
| serverUrl: `${process.env.VITE_DEV_SERVER_URL}src/html/${input}.html`, | ||
| webview, | ||
| context, | ||
| inputName: input, | ||
| }); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /// <reference types="@tomjs/vite-plugin-vscode/env" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import * as vscode from "vscode"; | ||
| import { PackagesManagerViewProvider } from "./packagesManagerViewProvider.js"; | ||
|
|
||
| export function activate(context: vscode.ExtensionContext) { | ||
| console.log('Congratulations, your extension "ParadoxPM-Server" is now active!'); | ||
|
|
||
| const provider = new PackagesManagerViewProvider(context); | ||
|
|
||
| context.subscriptions.push( | ||
| vscode.window.registerWebviewViewProvider(PackagesManagerViewProvider.viewType, provider) | ||
| ); | ||
| } | ||
|
|
||
| export function deactivate() {} |
30 changes: 30 additions & 0 deletions
30
src/ParadoxPM.Extension/extension/packagesManagerViewProvider.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import * as vscode from "vscode"; | ||
| import { WebviewHelpers } from "./WebviewHelpers.js"; | ||
|
|
||
| export class PackagesManagerViewProvider implements vscode.WebviewViewProvider { | ||
| public static readonly viewType = "packages-manager"; | ||
|
|
||
| private _view?: vscode.WebviewView; | ||
| private _context: vscode.ExtensionContext; | ||
|
|
||
| public constructor(context: vscode.ExtensionContext) { | ||
| this._context = context; | ||
| } | ||
|
|
||
| resolveWebviewView( | ||
| webviewView: vscode.WebviewView, | ||
| context: vscode.WebviewViewResolveContext, | ||
| token: vscode.CancellationToken | ||
| ): Thenable<void> | void { | ||
| webviewView.webview.options = { | ||
| enableScripts: true, | ||
| }; | ||
| this._view = webviewView; | ||
|
|
||
| webviewView.webview.html = WebviewHelpers.getHtml( | ||
| webviewView.webview, | ||
| this._context, | ||
| "packageManager" | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| { | ||
| "name": "paradoxpm", | ||
| "displayName": "ParadoxPM", | ||
| "description": "", | ||
| "version": "0.0.1", | ||
| "license": "Apache-2.0", | ||
| "engines": { | ||
| "vscode": "^1.90.0" | ||
| }, | ||
| "author": "Paradox Developer Foundation", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Paradox-Developer-Foundation/PackageManager" | ||
| }, | ||
| "preview": true, | ||
| "type": "module", | ||
| "categories": [ | ||
| "Other" | ||
| ], | ||
| "activationEvents": [], | ||
| "main": "./dist/extension/extension.js", | ||
| "contributes": { | ||
| "commands": [ | ||
| { | ||
| "command": "ParadoxPM-Server.helloWorld", | ||
| "title": "Hello World" | ||
| } | ||
| ], | ||
| "viewsContainers": { | ||
| "panel": [ | ||
| { | ||
| "id": "packages-manager", | ||
| "title": "Packages Manager", | ||
| "icon": "$(search-editor-label-icon)" | ||
| } | ||
| ] | ||
| }, | ||
| "views": { | ||
| "packages-manager": [ | ||
| { | ||
| "id": "packages-manager", | ||
| "name": "Packages Manager", | ||
| "icon": "$(package)", | ||
| "type": "webview" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "vscode:prepublish": "pnpm run build", | ||
| "dev": "vite", | ||
| "build": "vue-tsc --noEmit && vite build", | ||
| "pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint", | ||
| "lint": "eslint src" | ||
| }, | ||
| "devDependencies": { | ||
| "@tomjs/vite-plugin-vscode": "^4.2.1", | ||
| "@types/mocha": "^10.0.10", | ||
| "@types/node": "~20.19.4", | ||
| "@types/vscode": "^1.90.0", | ||
| "@typescript-eslint/eslint-plugin": "^8.35.1", | ||
| "@typescript-eslint/parser": "^8.35.1", | ||
| "@vitejs/plugin-vue": "^6.0.0", | ||
| "eslint": "^9.30.1", | ||
| "typescript": "^5.8.3", | ||
| "vite": "npm:rolldown-vite@latest", | ||
| "vue-tsc": "^3.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "@vscode-elements/elements": "^1.17.0", | ||
| "@vscode/codicons": "^0.0.36", | ||
| "vue": "^3.5.17" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint configuration targets only
.tsfiles; consider adding rules or overrides for.vuefiles to ensure consistent linting across components.