Skip to content

Resolve imports relative to file's location #66

@kshchepanovskyi

Description

@kshchepanovskyi

Origin: #65

Many projects are storing proto files in a locations that are not marked as source/resource root.
As a result, imports are highlighted with error "file does not exist", and all imported types are not resolvable.

Plugin can try to resolve imports relative to source file's location using following rules:

  1. If package is not set, try to look in the same folder where source file is.
  2. If package is set, try to look from parent folder.
  3. Parent folder should be computed as source file's folders, with removed corresponding parts of the package.

For example:

/home/user/project/foo/bar/hello.proto:

package foo.bar;
import "baz/import.proto";

Import should be resolved to /home/user/project/baz/import.proto.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions