Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary Fix the `def` command producing no results when used with certain import syntaxes and styles. * multiple-module-imports: definitions are now reported for all module names (e.g., `z` in `import x/[y, z]`), not only the first one * import-as: definitions are now reported for the alias name (e.g., `z` in `import x/[y as z]`) * definitions are now reported for single-module imports that use the bracket syntax (`x/[y]`) where the module name is on a different line than the opening bracket The `def` command is usually used for goto-definition support in IDEs, meaning that goto-definition on module names in import statements now work for the above cases. ## Details Instead of passing the source position of the transformed node to `onSymImport`, the source position of the original node is passed to it. So that the original source position can be passed to `onSymImport`, `myImportModule` and `impMod` now take an additional `info: TLineInfo` parameter. For `import x as y`, a `def` of `x` is only reported on `y` right now (and nothing is reported on `x`). Eventually, a proper `def` should be reported on either both `x` and `y` or only on `x`. --------- Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
- Loading branch information