Conversation
…/dpp Co-authored-by: Shougo <41495+Shougo@users.noreply.github.com> Agent-Logs-Url: https://github.com/Shougo/dpp.vim/sessions/28cbde31-3f33-4f7d-b795-88fffd3d45af
Copilot
AI
changed the title
[WIP] Fix unnecessary return await in denops/dpp implementation
perf: remove unnecessary Mar 24, 2026
return await and cache import maps in denops/dpp
This was referenced Mar 24, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two small performance improvements to reduce microtask overhead and redundant I/O on repeated plugin loads.
Remove unnecessary
return awaitIn
dpp.tsandapp.ts, several async methods simply delegate to another async function and return its result directly — outside of any try/catch — makingawaitredundant.Affected:
DppImpl.extAction/getExt/getProtocols, thecheckIfinner function (dpp.ts), and the dispatcher'sextAction/getExt/getProtocols(app.ts).Cache import maps and
ImportMapImporter(utils.ts)tryLoadImportMappreviously scanned and read import map files on every call;importPlugincreated a newImportMapImporterinstance each time. Added two module-scope Maps keyed by parent directory so both the I/O and instance allocation happen at most once per directory per process lifetime.tryLoadImportMapchecksimportMapCachebefore touching disk, storingnullfor directories with no import map.importPluginreuses the cachedImportMapImporterrather than constructing a new one. External API is unchanged.Original prompt
目的
return awaitの削除」と「import-map 読み込みのプロセス内キャッシュ化(ImportMapImporter の再利用)」です。既にテストが追加されているため、小さなリファクタは安全に検証できます。変更内容(要約)
不要な
return awaitの削除return await foo()は通常不要で、余計な microtask とわずかなオーバーヘッドを発生させます。try/catch 内で例外スタックを保持する必要がある箇所を除き、return foo()に置換します。returnに変更する。テスト実行で差異を検証する。import-map / ImportMapImporter のキャッシュ化
追加の安全対策
テスト手順(PR レビュー向け)
PR タイトル案
perf: remove unnecessary
return awaitand cache import maps in denops/dpp作業内容の詳細(差分の予定)
denops/dpp/dpp.ts
return await extAction(...)→return extAction(...)return await getExt(...)→return getExt(...)denops/dpp/app.ts
return await ...をreturn ...に置換denops/dpp/utils.ts
${url}#${suffix})注意点
PR の作成先
お願い(自動化)
この PR を作成して、変更の差分と PR URL を返してください。テストが自動で実行できるように、必要なら CI workflow の追加は別 PR を提案します。
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @Shougo/dpp.vim こちらを改善する作業をしてください
Assistant: I'll run a quick repository audit on Shougo/dpp.vim to identify concrete improvement areas (code, docs, CI, tests, packaging, and common issues). I'll fetch repository metadata and file list now.
Assistant: 直接の推奨:まずリポジトリを監査して改善優先度を決めました。低摩擦で価値が高い順に着手できます — どれを私に実装(PR作成)させましょうか?(実装してPRを作る場合は「PR作成して」と一言ください。すぐに作業します。)
何をやったか(私の作業)
主要な改善候補(優先度付き)
CIの追加(高優先、低摩擦)
テスト整備(高優先)
ドキュメント改善(高→中優先)
Lint / Formatter の導入(中優先)
make fmt,make lint追加。パッケージング & 配布(中優先)
リファクタと型の強化(低→中優先)
テレメトリ・例外ハンドリング強化(低優先)
This pull request was created from Copilot chat.
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.