add inline annotations in language files #958
-
Beta Was this translation helpful? Give feedback.
Replies: 23 comments 2 replies
-
I would show this inline annotation in a line above and not after the text. It will make it hard to read if it is a longer text. How do you know if the file you have opened is a Resource file? I'm currently investigating #646 and @samuelstroschein suggested to create a proxy to retrieve that information: #646 (comment) |
Beta Was this translation helpful? Give feedback.
-
@ivanhofer how to find out if the file is a resource -> from the inlang config plugin json pathPattern, or, as you said, from another plugin pathPattern (yaml) |
Beta Was this translation helpful? Give feedback.
-
@felixhaeberle an application doesn't know what a plugin sets. You can't retrieve the pathPattern (which btw doesn't exist for many plugins) from the application. @jannesblobel had the same logic mistake yesterday :D You could track |
Beta Was this translation helpful? Give feedback.
-
@samuelstroschein I do not have that logical mistake, but in reality, we need this information provided somewhere. at best in a plugin (for now). we can detect multiple points to retrieve that information. if no information is provided, this feature (and others) will not work 😄 |
Beta Was this translation helpful? Give feedback.
-
This is a logical mistake. You want to access scoped data from plugins which is not possible. Furthermore, the pathPattern isn't even used by all plugins. Jannes made the same logical mistake yesterday by thinking scoped plugin data can be accessed. The only way you can retrieve relevant files is by proxying |
Beta Was this translation helpful? Give feedback.
-
@samuelstroschein I do not disagree but want to say one thing: A lot of functionalities in the inlang architecture are exactly bound to specific plugin behavior. Otherwise it will not work. For example the editor, and also the IDE extension, if this data isn't provided by a plugin, no background magic will resolve this (atm, future plans not included). Of course it's really modular, but at the end, we are currently architecting with a inlang.config.js approach and functions which a derived from the plugins within. So you are right: an application has no idea about the data from a plugin will be there, but it also doesn't work if it's not there. Or does any of the inlang product work without a config file? And especially: does it retrieve value without plugins? If we want to ship this feature now, we can set this information by a plugin. If not, it's a alive end (opposite of dead end) of a feature, not existing, but also not breaking the rest of the behavior. |
Beta Was this translation helpful? Give feedback.
-
A plugin could expose a |
Beta Was this translation helpful? Give feedback.
-
@felixhaeberle I don't understand your points. Seems like my explanation is unclear. The knowledge of what files are used by inlang is a common request as laid out in #726 (comment). This request can be fulfilled by not touching plugins but modifying/proxying the inlang environment. The ability to "control" plugins is exactly why host applications expose the inlang environment to plugins. Adjusting plugins to expose what files are used moves the burden of tracking what files are used from the host application to plugins and relying on the correct implementation of external developers. This would be a bad design choice. Besides, the information on what files are used is a common need for apps. Thus, the inlang environment should automatically expose this information. Automatic exposure can be achieved by extending |
Beta Was this translation helpful? Give feedback.
-
@samuelstroschein We're on the same page! 😄 It's only a question about when we want to implement it and how. You say it would be best in |
Beta Was this translation helpful? Give feedback.
-
I'm not sure how you would distinguish calls to Perhaps we could have a set of general use bits in the stat information, then the value of the bits can be set by specifying an option to |
Beta Was this translation helpful? Give feedback.
-
Will isomorphic-git touch every file? If we implement lazy loading of files/lazy cloning, isomorphic-git should only clone/touch files that are "used' by the host application. Otherwise, isomorphic git would clone entire repos. |
Beta Was this translation helpful? Give feedback.
-
For lazy loading we would still need to create a "fake" version of every file in the root directory so that the user knows which files exist, at least that's how I envisioned it working, although I'm not entirely clear on how the git-sdk is going to be used in vscode. |
Beta Was this translation helpful? Give feedback.
-
Yeah true but what exists and what does not is unrelated to "reading the contents of a file". Tbh I am excited about the solution we will come up with. Its an interesting engineering challenge |
Beta Was this translation helpful? Give feedback.
-
Hmm true I guess that would (hopefully) only involve calls to |
Beta Was this translation helpful? Give feedback.
-
For entire repos. If we control the environment, as in the editor, we can ensure that every "component" uses our provided |
Beta Was this translation helpful? Give feedback.
-
In that case then, wouldn't |
Beta Was this translation helpful? Give feedback.
-
An app would call |
Beta Was this translation helpful? Give feedback.
-
Right, that makes sense. Then I guess my original question applies of how do we distinguish a call to |
Beta Was this translation helpful? Give feedback.
-
Indeed. That's the question. I just realized that the approach of passing a proxied fs to plugins might not be a workaround but the only solution, even if inlang-git/fs tracks internal filesystem calls. |
Beta Was this translation helpful? Give feedback.
-
@ivanhofer: @felixhaeberle: Estimate: 2h |
Beta Was this translation helpful? Give feedback.
-
@openscript from your experience, is this a must-have feature? If not, I propose to transfer this to "Feature Requests" in discussions and let users vote. |
Beta Was this translation helpful? Give feedback.
-
We don't use or need this feature, because other tools offer a context tool tip, which is convenient enough. |
Beta Was this translation helpful? Give feedback.
-
@samuelstroschein Are we still considering this with the new storage layer? |
Beta Was this translation helpful? Give feedback.
nope introducing a non-readable storage format