From 07309fc9a6026e5228e496b65f1f11989798696d Mon Sep 17 00:00:00 2001 From: Varun Saini <61795485+vrn-sn@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:46:35 -0700 Subject: [PATCH] Add autocomplete details to (1c) --- docs/amended-alias-resolution.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/amended-alias-resolution.md b/docs/amended-alias-resolution.md index 3c291f1..6a58981 100644 --- a/docs/amended-alias-resolution.md +++ b/docs/amended-alias-resolution.md @@ -91,7 +91,12 @@ require("./libs/dependency") require("@libs/dependency") ``` -The main drawback of this approach is that it is not backwards compatible with any existing code that uses unprefixed require statements. +A benefit of this approach is that the role of autocomplete becomes fairly well-defined. +When `require("` is typed, autocomplete has only three options to display: the `@`, `./`, and `../` prefixes. +After a prefix has been typed, autocomplete will either display defined aliases or local modules, depending on the prefix. +Approaches (1a) and (1b) would be less clear about this, as `require("` could be followed by a string component or one of the three prefixes. + +The main drawback of this approach is that it is not backwards compatible with any existing code that uses unprefixed require statements and may result in code that looks cluttered. ### (2) Strongly recommend explicit prefixes