-
Notifications
You must be signed in to change notification settings - Fork 6
Allow configuring cairo-path
from a toml
file
#29
Comments
@kasperski95 I think the following enhancements to Cairo-LS should work for this scenario. Let me know what you think.
Can you elaborate on what you mean by "scopes" above? How do you expect that to differ from just reading the |
I think this extension should be independent of Protostar if possible. If we rename Protostar ships with asserts that are meant to be used only in test files. The scope functionality would show an error in VS Code, if the user tried to import asserts in non-test files. However, this is a rare use case, therefore it might be not worth supporting it. The structure of {
"cairols.cairoPathConfigurations": {
"and": [
{
"or": [
"./protostar.toml::protostar.build::cairo_path",
"./protostar.toml::protostar.shared_command_configs::cairo_path"
]
},
{
"or": [
"./protostar.toml::protostar.test::cairo_path",
"./protostar.toml::protostar.shared_command_configs::cairo_path"
]
}
]
}
} I think the simplest support would cover most use cases. (The user probably won't use {
"cairols.cairoPathConfigurations": [
"./protostar.toml::protostar.shared_command_configs::cairo_path",
]
} |
I would like to work on this one as it's important for us as a protostar team to let users use protostar with cairo-ls. In my opinion for now enough would be to let users to extra cairo-path by hand. Protostar's system is a bit more complicated and I don't think it's necessary to support it right now. I would like to add an configuration filed
and let user to enter extra cairo paths and pass it to the compiler. |
@MaksymilianDemitraszek That sounds good to me. Thanks for taking this on. Let me know if anything needs further discussion when you look at this. Part of the effort would be to ensure the additional paths are used for both compilation and for go-to-definitions. The relevant parts of code should be Line 785 in def650e
Line 1380 in def650e
|
Resolved by #41 which implements this suggestion. |
As a Protostar user, I want Cairo-LS read cairo-path from
protostar.toml
so that this VS Code extension show invalid imports correctly.The text was updated successfully, but these errors were encountered: