Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

module import() behavior where the module only supports specific environments

Open
#515 12 comments 1 reaction 0 assignees View on GitHub

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 のモジュール全般においてどのような挙動にするべきかを話し合いたいです。
今出ている案は以下の通りです。

  1. import() 時に例外を投げる
  2. import() 時には例外を投げず、ユーザにチェック用メソッドを呼んでもらってチェックしてもらう

本文

#513 のモジュールの様に Vim 8 か NeoVim でしか動かないモジュールの場合、
サポートされない環境で import() した時に Vim 8 or NeoVim is required みたいな例外を投げたい場合もあるかと思いました。
しかし ujihisa さん曰く、ConcurrentProcess ではそのようになっていません(ユーザに is_available() でチェックしてもらう API になっている)。
インターフェースが統一されてるといいかと思ったので、vital ではどのようにすべきかを相談したいです。

  1. import() 時に例外を投げる
    • メリット:チェック用メソッドを呼び忘れることがない
    • デメリット:(2 の案のメリットの反対)import() をトップレベルで無条件に行うことができない
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vim-jp/vital.vim

All issues in vim-jp/vital.vim

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.