-
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
base: main
Are you sure you want to change the base?
Conversation
… and dependencies
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.
Pull Request Overview
This PR introduces a VS Code extension framework alongside backend tweaks to support a Vue-based UI, enhance logging, and enable cross‐origin requests.
- Backend: Configures console logging format, bumps development log level to Debug, adds a CORS policy for the Vue app, and inserts a debug log in
PackageController. - Extension scaffold: Sets up a Vite + Vue build, defines TypeScript types, implements a webview with
PackageManager.vue,PackageDetails.vue, and a reusableListBox.vue. - Tooling & docs: Adds
tsconfig.json, ESLint rules, VS Code tasks/launch configs, a placeholder README, and the extension manifest.
Reviewed Changes
Copilot reviewed 26 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ParadoxPM.Server/appsettings.json | Added JSON console logger configuration |
| src/ParadoxPM.Server/appsettings.Development.json | Changed default log level from Information to Debug |
| src/ParadoxPM.Server/Program.cs | Registered CORS policy "AllowVueApp" and applied it |
| src/ParadoxPM.Server/Controllers/PackageController.cs | Inserted a debug log for incoming package requests |
| src/ParadoxPM.Extension/vite.config.ts | Configured Vite plugins for Vue and VSCode extension |
| src/ParadoxPM.Extension/tsconfig.json | Established TypeScript compiler settings |
| src/ParadoxPM.Extension/src/types/packageInfo.ts | Introduced PackageInfo, Version, Dependency |
| src/ParadoxPM.Extension/src/types/apiResponse.ts | Introduced generic ApiResponse<T> |
| src/ParadoxPM.Extension/src/html/packageManager.html | Added HTML template for the webview |
| src/ParadoxPM.Extension/src/entry/packageManager.ts | Mounts Vue app to the webview container |
| src/ParadoxPM.Extension/src/components/PackageManager.vue | Implements the main package-list UI |
| src/ParadoxPM.Extension/src/components/PackageDetails.vue | Implements the package-detail UI |
| src/ParadoxPM.Extension/src/components/ListBox.vue | Provides a generic list box with tooltip support |
| src/ParadoxPM.Extension/package.json | Defines the VSCode extension manifest |
| src/ParadoxPM.Extension/extension/packagesManagerViewProvider.ts | Registers the packages-manager view provider |
| src/ParadoxPM.Extension/extension/extension.ts | Activates the extension |
| src/ParadoxPM.Extension/extension/WebviewHelpers.ts | Supplies HTML for the webview |
| src/ParadoxPM.Extension/eslint.config.mjs | Adds ESLint plugin/parser rules for TypeScript |
| src/ParadoxPM.Extension/README.md | Placeholder README for the extension |
| src/ParadoxPM.Extension/.vscodeignore | Specifies files to exclude in the packaged extension |
| src/ParadoxPM.Extension/.vscode/tasks.json | Defines dev/build tasks |
| src/ParadoxPM.Extension/.vscode/settings.json | Workspace settings overrides |
| src/ParadoxPM.Extension/.vscode/launch.json | Debug configurations for extension development |
| src/ParadoxPM.Extension/.vscode/extensions.json | Recommends VSCode extensions for editing |
| src/ParadoxPM.Extension/.npmrc | Enables pre/post npm scripts |
| src/ParadoxPM.Extension/.gitignore | Ignores dist/ builds |
Comments suppressed due to low confidence (5)
src/ParadoxPM.Extension/src/html/packageManager.html:8
- [nitpick] The page title "Traits" is misleading for a package manager view; consider updating it to something like "Package Manager".
<title>Traits</title>
src/ParadoxPM.Extension/package.json:20
- No activation events are specified, so the webview view provider may not be activated; add an entry like
"onView:packages-manager"to ensure the extension loads when the view is opened.
"activationEvents": [],
src/ParadoxPM.Extension/extension/extension.ts:5
- [nitpick] The log message reference "ParadoxPM-Server" does not match the extension's display name
ParadoxPM; update the string to avoid confusion.
console.log('Congratulations, your extension "ParadoxPM-Server" is now active!');
src/ParadoxPM.Extension/extension/WebviewHelpers.ts:6
getHtmlusesVITE_DEV_SERVER_URLwithout fallback for production builds; consider adding logic to load local asset HTML when the development server URL is undefined.
serverUrl: `${process.env.VITE_DEV_SERVER_URL}src/html/${input}.html`,
src/ParadoxPM.Extension/README.md:1
- README contains placeholder template content; update it to include actual project description, features, and usage instructions.
# ParadoxPM-Server README
| [HttpGet("query/{packageId:int}/meta")] | ||
| public async Task<ActionResult<ApiResponse<Package>>> GetPackage(int packageId) | ||
| { | ||
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包"); |
Copilot
AI
Jul 10, 2025
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.
The debug log message says "请求获取所有包" (fetch all packages), but this endpoint returns a single package by ID; update the message to reflect the correct action.
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取所有包"); | |
| _logger.ZLogDebug($"ip: {HttpContext.Connection.RemoteIpAddress} 请求获取指定的包, Id: {packageId}"); |
| <div class="container"> | ||
| <div class="left-panel"> | ||
| <div class="search-header"> | ||
| <vscode-textfield class="search-box" placeholder="搜索包..." v-model="searchKeyword" @input="fetchPackages"> |
Copilot
AI
Jul 10, 2025
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.
Calling fetchPackages on every input event may trigger excessive API requests; consider debouncing the input handler.
| import { ref } from 'vue'; | ||
| import type { PackageInfo } from '../types/packageInfo'; | ||
| const selectedIndex = ref(0); | ||
| defineProps<{ | ||
| package: PackageInfo | null | ||
| }>() | ||
Copilot
AI
Jul 10, 2025
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.
When the package prop changes, selectedIndex is not reset to 0, which can cause outdated or invalid version selections; add a watcher to reset selectedIndex when package updates.
| import { ref } from 'vue'; | |
| import type { PackageInfo } from '../types/packageInfo'; | |
| const selectedIndex = ref(0); | |
| defineProps<{ | |
| package: PackageInfo | null | |
| }>() | |
| import { ref, watch } from 'vue'; | |
| import type { PackageInfo } from '../types/packageInfo'; | |
| const selectedIndex = ref(0); | |
| defineProps<{ | |
| package: PackageInfo | null | |
| }>(); | |
| watch(() => package, () => { | |
| selectedIndex.value = 0; | |
| }); |
| import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
| import tsParser from "@typescript-eslint/parser"; | ||
|
|
||
| export default [{ |
Copilot
AI
Jul 10, 2025
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 .ts files; consider adding rules or overrides for .vue files to ensure consistent linting across components.
Co-authored-by: Copilot <[email protected]>
No description provided.