←back to thread

310 points brylie | 1 comments | | HN request time: 0.203s | source
Show context
askonomm ◴[] No.43516546[source]
First thing that I don't like is the settings being strings that reference classes. Usually that means that go-to definition does not work (I've seen similar things in Symfony with YAML use). If the config needs to reference a class, or some object, I would like to be able to easily navigate to it as opposed to having to manually search the project for it. If this was an actual object reference as opposed to a string, I could, and I'd also get intellisense for if I typed it right or not, and autocomplete.

Then of course they "solve" it later with a (probably paid) plugin. But why? LSP's support this natively, and for free, just don't use strings.

replies(2): >>43516947 #>>43517164 #
1. mdaniel ◴[] No.43517164[source]
There are strings in Python already that reference classes: type annotations. PyCharm knows how to populate, warn, and navigate to the "interior" types there

I can't think of any reason why it couldn't be taught to behave similarly for a config file. You can do it today field by field via language injection but if there are a lot of them then I think the config file would need a JSON Schema with the x-intellij-language annotations on the relevant fields https://sourcegraph.com/github.com/JetBrains/intellij-commun...