module import() behavior where the module only supports specific environments
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- vim
- Domain
- tooling
Research direction
Start with the linked pull request #513 and its referenced comments, then review how ConcurrentProcess exposes is_available() for unsupported environments. Compare that behavior with the proposed import() exception approach and document or implement the agreed project-wide policy once a decision is reached.
Written by the indexing model from the issue text.
Description
https://github.com/vim-jp/vital.vim/pull/513#issuecomment-302925402 から派生。
要約
特定環境でのみ動くモジュールを import() した時、vital のモジュール全般においてどのような挙動にするべきかを話し合いたいです。
今出ている案は以下の通りです。
- import() 時に例外を投げる
- import() 時には例外を投げず、ユーザにチェック用メソッドを呼んでもらってチェックしてもらう
本文
#513 のモジュールの様に Vim 8 か NeoVim でしか動かないモジュールの場合、
サポートされない環境で import() した時に Vim 8 or NeoVim is required みたいな例外を投げたい場合もあるかと思いました。
しかし ujihisa さん曰く、ConcurrentProcess ではそのようになっていません(ユーザに is_available() でチェックしてもらう API になっている)。
インターフェースが統一されてるといいかと思ったので、vital ではどのようにすべきかを相談したいです。
- import() 時に例外を投げる
- メリット:チェック用メソッドを呼び忘れることがない
- デメリット:(2 の案のメリットの反対)import() をトップレベルで無条件に行うことができない
- import() 時には例外を投げず、ユーザにチェック用メソッドを呼んでもらってチェックしてもらう
- メリット:import() をトップレベルで無条件に行うことができる(catch する必要がない)
- デメリット:(1 の案のメリットの反対)チェック用メソッドを呼び忘れてしまう可能性がある
- Dominant language
- Vim Script
- Stars
- 586
- Forks
- 64
- Avg merge
- 9h 24m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vim-jp/vital.vim
-
Web.HTTP の非同期実行を行いたいPossibly taken @mikoto2000 claimed this 313 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Fix and feature: Add python setup in Github workflowMay be free again @tsuyoshicho claimed this 909 days ago, and no pull request is open. Open
-
Vim9.x: support change Vim 8.2/9.0 to Vim 9.0/9.1May be free again @tsuyoshicho claimed this 959 days ago, and no pull request is open. Open
-
feat: Bitwise.vim: bitwise shift operatorMay be free again @tsuyoshicho claimed this 1583 days ago, and no pull request is open. Open
-
Data.List: Deprecate function in string formMay be free again @ujihisa claimed this 2142 days ago, and no pull request is open. Open
All issues in vim-jp/vital.vim
Similar issues
-
b:minor bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/argent#1698 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
feimacode/open-design-agent-kit#66 ·
Maintainers usually reply within 1 day
-
infra
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
pending:code-area pending:issue-category to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
xojs/eslint-config-xo#134 ·