public static final class OutboundMessage.CanonicalizeRequest extends com.google.protobuf.GeneratedMessageV3 implements OutboundMessage.CanonicalizeRequestOrBuilder
A request for a custom importer to convert an imported URL to its canonical format. If the URL is not recognized by this importer, or if no stylesheet is found at that URL, `CanonicalizeResponse.result` must be `null`. Otherwise, the importer must return an absolute URL, including a scheme. > The host's documentation should encourage the use of file importers (via > `CompileRequest.Importer.file_importer_id`, `FileImportRequest`, and > `FileImportResponse`) for any importers that simply refer to files on > disk. This will allow Sass to handle the logic of resolving partials, > file extensions, and index files. If Sass has already loaded a stylesheet with the returned canonical URL, it re-uses the existing parse tree. This means that importers must ensure that the same canonical URL always refers to the same stylesheet, *even across different importers*. Importers must also ensure that any canonicalized URLs they return can be passed back to `CanonicalizeRequest` and will be returned unchanged. If this importer's URL format supports file extensions, it should canonicalize them the same way as the default filesystem importer: * The importer should look for stylesheets by adding the prefix `_` to the URL's basename, and by adding the extensions `.sass` and `.scss` if the URL doesn't already have one of those extensions. For example, if the URL was `foo/bar/baz`, the importer would look for: * `foo/bar/baz.sass` * `foo/bar/baz.scss` * `foo/bar/_baz.sass` * `foo/bar/_baz.scss` If the URL was foo/bar/baz.scss, the importer would just look for: * `foo/bar/baz.scss` * `foo/bar/_baz.scss` If the importer finds a stylesheet at more than one of these URLs, it should respond with a `CanonicalizeResponse.result.error` indicating that the import is ambiguous. Note that if the extension is explicitly specified, a stylesheet with another extension may exist without error. * If none of the possible paths is valid, the importer should perform the same resolution on the URL followed by `/index`. In the example above, it would look for: * `foo/bar/baz/_index.sass` * `foo/bar/baz/index.sass` * `foo/bar/baz/_index.scss` * `foo/bar/baz/index.scss` As above, if the importer finds a stylesheet at more than one of these URLs, it should respond with a `CanonicalizeResponse.result.error` indicating that the import is ambiguous.Protobuf type
sass.embedded_protocol.OutboundMessage.CanonicalizeRequest| Modifier and Type | Class and Description |
|---|---|
static class |
OutboundMessage.CanonicalizeRequest.Builder
A request for a custom importer to convert an imported URL to its canonical
format.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
FROM_IMPORT_FIELD_NUMBER |
static int |
ID_FIELD_NUMBER |
static int |
IMPORTER_ID_FIELD_NUMBER |
static int |
URL_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static OutboundMessage.CanonicalizeRequest |
getDefaultInstance() |
OutboundMessage.CanonicalizeRequest |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
boolean |
getFromImport()
/ Whether this request comes from an `@import` rule.
|
int |
getId()
uint32 id = 1; |
int |
getImporterId()
The unique ID of the importer being invoked.
|
com.google.protobuf.Parser<OutboundMessage.CanonicalizeRequest> |
getParserForType() |
int |
getSerializedSize() |
String |
getUrl()
The URL of the import to be canonicalized.
|
com.google.protobuf.ByteString |
getUrlBytes()
The URL of the import to be canonicalized.
|
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static OutboundMessage.CanonicalizeRequest.Builder |
newBuilder() |
static OutboundMessage.CanonicalizeRequest.Builder |
newBuilder(OutboundMessage.CanonicalizeRequest prototype) |
OutboundMessage.CanonicalizeRequest.Builder |
newBuilderForType() |
protected OutboundMessage.CanonicalizeRequest.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static OutboundMessage.CanonicalizeRequest |
parseDelimitedFrom(InputStream input) |
static OutboundMessage.CanonicalizeRequest |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(byte[] data) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(ByteBuffer data) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(com.google.protobuf.ByteString data) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(com.google.protobuf.CodedInputStream input) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(InputStream input) |
static OutboundMessage.CanonicalizeRequest |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<OutboundMessage.CanonicalizeRequest> |
parser() |
OutboundMessage.CanonicalizeRequest.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int ID_FIELD_NUMBER
public static final int IMPORTER_ID_FIELD_NUMBER
public static final int URL_FIELD_NUMBER
public static final int FROM_IMPORT_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public int getId()
uint32 id = 1;getId in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic int getImporterId()
The unique ID of the importer being invoked. This must match an importer ID passed to this compilation in `CompileRequest.importers` or `CompileRequest.input.string.importer`.
uint32 importer_id = 3;getImporterId in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic String getUrl()
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;getUrl in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic com.google.protobuf.ByteString getUrlBytes()
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;getUrlBytes in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic boolean getFromImport()
/ Whether this request comes from an `@import` rule. / / When evaluating `@import` rules, URLs should canonicalize to an / [import-only file] if one exists for the URL being canonicalized. / Otherwise, canonicalization should be identical for `@import` and `@use` / rules. / / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files
bool from_import = 5;getFromImport in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static OutboundMessage.CanonicalizeRequest parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(InputStream input) throws IOException
IOExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OutboundMessage.CanonicalizeRequest parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static OutboundMessage.CanonicalizeRequest parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static OutboundMessage.CanonicalizeRequest parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic OutboundMessage.CanonicalizeRequest.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static OutboundMessage.CanonicalizeRequest.Builder newBuilder()
public static OutboundMessage.CanonicalizeRequest.Builder newBuilder(OutboundMessage.CanonicalizeRequest prototype)
public OutboundMessage.CanonicalizeRequest.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected OutboundMessage.CanonicalizeRequest.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static OutboundMessage.CanonicalizeRequest getDefaultInstance()
public static com.google.protobuf.Parser<OutboundMessage.CanonicalizeRequest> parser()
public com.google.protobuf.Parser<OutboundMessage.CanonicalizeRequest> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder