-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Description
Currently, this project supports most of the VSCode API and development capabilities.
Expect support for scaffolding commands (similar to cobra in Golang), and support for structuring extensions such as Extension, Command, Views, etc. independently. Realize framework development.
Scaffold generation for Extension, Command
Provide a command-line capability to add the generation of Extension
, Command
, View
scaffold code.
reactive-vscode command add xxx
reactive-vscode extension add xxx
reactive-vscode view add xxx
Automatic registration
By engineering structuring. Supports directory structures such as src/commands
, src/extensions
, src/views
, etc., by encapsulating corresponding code snippets, simplifying the complexity of packages.json
and extensions.ts
code, and improving readability.
Coordinates with CLI tools for use, it will greatly enhance the VSCode extension developer experience (DX).
The following is an imaginative engineering structure scenario:
➜ tree -L 3 .
├── package.json
├── ...
├── src
+ │ ├── commands
+ │ │ ├── HelloWorld.ts
+ │ │ └── Test.ts
+ │ ├── views
+ │ ├── ...
│ ├── configs.ts
│ ├── extension.ts
│ └── utils.ts
├── ...
└── tsup.config.ts
- import { defineExtension, useCommand, useIsDarkTheme, watchEffect } from 'reactive-vscode'
+ import { defineExtension, useIsDarkTheme, watchEffect } from 'reactive-vscode'
import { window } from 'vscode'
import { message } from './configs'
import { logger } from './utils'
+ import { useHelloWorldCommand, useTestCommand } from './commands'
export = defineExtension(() => {
logger.info('Extension Activated')
+ // It is only necessary to introduce through methods (or automatic registration)
+ // From the perspective of development experience, explicit declaration of the project will have better readability.
- // useCommand('gitee-chatcode.helloWorld', () => {
- // window.showInformationMessage(message.value + "dasdas")
- // })
+ useHelloWorldCommand() // Improved
- // useCommand('gitee-chatcode.test', () => {
- // window.showInformationMessage("test")
- // })
+ useTestCommand() // Improved
const isDark = useIsDarkTheme()
watchEffect(() => {
logger.info('Is Dark Theme:', isDark.value)
})
})