-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResourcesItem
specification might be incomplete
#181
Comments
URIs ending with
My understanding is that files should get added directly to the runtime classpath, without getting relativized by a directory. I'm not sure what effect that has however, I'm unable to load up a resource file that was added directly to the classpath.
|
The |
Well yes that should work but it would be better if made explicit in the data structure and specification of Also I think the client might need to know if a resource is generated or not for the same reason as a /** Indicates if this source is automatically generated by the build and is not
* intended to be manually edited by the user. */ So I think it is worth aligning the export interface ResourcesItem {
target: BuildTargetIdentifer;
/** The resource files or and directories that belong to this build target. */
resources: ResourceItem[];
}
export interface ResourceItem {
/** Either a file or a directory.
* A directory entry must end with a forward slash "/".
* A directory entry implies that every nested file within the
* directory belongs to this resource item.
*/
uri: Uri;
/** Type of file of the source item, such as whether it is file or directory.
*/
kind: ResourceItemKind;
/** Indicates if this resource is automatically generated by the build and is not
* intended to be manually edited by the user. */
generated: Boolean;
}
export namespace ResourceItemKind {
/** The resource item references a normal file. */
export const File: Int = 1;
/** The resource item references a directory. */
export const Directory: Int = 2;
} |
Yes, not fixing this was an oversight that I've been procrastinating on fixing ever since I noticed it after we changed The problem now is that changing |
Yes it's indeed a breaking change, a new request will probably be a good solution. It still remains to find a relevant name for this new request ! |
Or we can mix the old spec with the new spec so that all the old and new clients/servers can talk to each other: export interface ResourcesItem {
target: BuildTargetIdentifer;
/** The resource files or and directories that belong to this build target. */
resourceItems: ResourceItem[]
/** Deprecated version of the resourceItems field
* Servers should provide it to maintain the compatibility with older clients
* Clients should try to read resourceItems first and fallback to resources if
* resourceItems is not defined.
*/
resources: Uri[];
} |
Yup, I was thinking that, though it would duplicate some data. But it would keep the implementations simpler. |
Related to sbt/sbt#6550 and sbt/sbt#6552
According to the specification, the
ResourcesItem
containsI think this is incomplete because the build client might want to know for each resource URI if it is a file or a directory. In the case it is a file, it does not know the relative path of the file to be copied to the target directory.
@jastice Is this part already implemented in IntelliJ and how? Do you think it is worth improving this part of the spec?
As a comparison the content of a
SourcesItem
is:The text was updated successfully, but these errors were encountered: