sea-orm icon indicating copy to clipboard operation
sea-orm copied to clipboard

Add more workspace setup information

Open sungvzer opened this issue 3 years ago • 2 comments

Motivation

As a newcomer, I found it difficult to make VSCode understand the code written in the migration folder.

It is because the migration is not imported in the main crate.

Proposed Solutions

  1. Add functionality to sea-orm-cli to automatically add the following lines to the main Cargo.toml:
[dependencies]
sea-orm = {
    # ...
}

migration = { path = "/path/to/migration/crate" }

  1. If 1 is not feasible, add some information about this in the documentation, preferably under the Installation & Configuration section.

Additional Information

The solution enables rust-analyzer to correctly identify the crate, while also providing auto-completion and code-checking.

sungvzer avatar Aug 07 '22 21:08 sungvzer

I found the reference here, would be cool if it was highlighted a little more.

sungvzer avatar Aug 07 '22 21:08 sungvzer

Hey @sungvzer, welcome!

As a newcomer, I found it difficult to make VSCode understand the code written in the migration folder.

Do you mean VScode didn't provide any linting for symbols inside migration crate?

it is because the migration is not imported in the main crate.

I wonder which example are you referring to? Because all of the examples are with migration crate imported into the root carate - except for the basic example as it doesn't have migration crate in it.

I found the reference here, would be cool if it was highlighted a little more.

Do you have any thoughts on this? How should we highlight it and where? hahaa

billy1624 avatar Aug 08 '22 08:08 billy1624