Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-months-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@arkts/language-server": minor
---

fix: remove composite: true in default tsconfig, fix #267
1 change: 0 additions & 1 deletion packages/language-server/src/classes/config-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export class LanguageServerConfigManager implements LanguageServerConfigurator {
strict: true,
strictPropertyInitialization: false,
incremental: true,
composite: true,
moduleDetection: ets.ModuleDetectionKind.Force,
moduleResolution: ets.ModuleResolutionKind.NodeNext,
module: ets.ModuleKind.ESNext,
Expand Down
12 changes: 8 additions & 4 deletions packages/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

这是一个基于[Volar](https://volarjs.dev)开发的ArkTS VSCode扩展。🌹为似乎到现在还没有支持VSCode,现有的VSCode市场中的ArkTS扩展大都非常简陋,所以决定自己写一个。

## 使用方法和常见问题 📖

详情请先阅读 [Arkcode 组织文档](https://arkcode.dev/arkts/install)。

## Features

- 🌹 1.x版本开始具备完整的`ArkTS`语言支持,全量支持所有`ArkTS`语法。
Expand All @@ -41,10 +45,10 @@
- 🍞 1.1.8+ 版本开始支持 `module.json5` 文件路径补全和跳转、引用表达式错误诊断、`requestPermissions` 权限补全等一系列 new feature ✨
- 🌾 1.2.10+ 版本增加 hvigor 资源管理器面板,支持资源限定符文件夹创建、资源引用索引等功能
- 🎨 1.2.12+ 版本增加 [oxk](https://github.com/ohos-rs/oxc-ark) 代码格式化支持

## 食用方法 📖

详情请见 [Arkcode 组织文档](https://arkcode.dev/arkts/install)
- 🚀 1.3.0+ 版本开始支持任务 `tasks`,支持以下任务:
- `hdc-install-hap`: 通过 `hdc` 命令安装 `hap` 包到设备上;
- `hdc-run-ability`: 通过 `hdc` 命令运行设备上已安装应用的 `ability`;
- `hvigor-assemble-hap`: 通过 `hvigor` 命令编译并组装 `hap` 包

## VSCode 文件图标主题 🖼️

Expand Down
13 changes: 7 additions & 6 deletions packages/vscode/src/tasks/hvigor-assemble-hap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class HvigorAssembleHapTaskProvider extends TaskContext implements TaskPr
'--mode module',
`-p module=${task?.moduleName}@${task?.productName}`,
`-p product=${task?.productName}`,
`-p requiredDeviceType=${task?.requiredDeviceType ?? deviceType}`,
(task?.requiredDeviceType || deviceType) ? `-p requiredDeviceType=${task?.requiredDeviceType ?? deviceType}` : '',
'assembleHap',
`--analyze=${task?.analyze ?? 'normal'}`,
task?.parallel === true || task?.parallel === undefined ? '--parallel' : '',
Expand Down Expand Up @@ -59,14 +59,15 @@ export class HvigorAssembleHapTaskProvider extends TaskContext implements TaskPr
if (!hvigorPath) return this.createExitTask(task, this.translator.t('tasks.error.hvigorNotFoundInSystemEnvironmentVariables'))

const currentConnectKey = this.hdcManager.getCurrentConnectKey()
let deviceType = ''

if (currentConnectKey === 0) return this.createExitTask(task, this.translator.t('tasks.error.deviceNotSelected'))
if (currentConnectKey === -1) return this.createExitTask(task, this.translator.t('tasks.error.deviceNotConnected'))

const deviceType = child_process.execSync(`${hdcPath} -t ${currentConnectKey} shell param get "const.product.devicetype"`, { encoding: 'utf-8' }).trim()
if (deviceType.includes('Fail')) return this.createExitTask(task, this.translator.t('tasks.error.deviceNotConnected'))
if (typeof currentConnectKey !== 'number') {
deviceType = child_process.execSync(`${hdcPath} -t ${currentConnectKey} shell param get "const.product.devicetype"`, { encoding: 'utf-8' }).trim()
if (deviceType.includes('Fail')) deviceType = ''
}

typeAssert<HvigorAssembleHapTaskDefinition>(task.definition)

return new vscode.Task(
task.definition,
vscode.TaskScope.Workspace,
Expand Down
Loading