Interface IEditorMimeTypeService

The mime type service of a code editor.

interface IEditorMimeTypeService {
    getMimeTypeByFilePath(filePath: string): string;
    getMimeTypeByLanguage(info: ILanguageInfoMetadata): string;
}

Implemented by

Methods

  • Get a mime type for the given file path.

    Parameters

    • filePath: string

      The full path to the file.

    Returns string

    A valid mimetype.

    If a mime type cannot be found returns the default mime type text/plain, never null. There may be more than one mime type, but only the first one will be returned. To access all mime types, use IEditorLanguageRegistry instead.

  • Get a mime type for the given language info.

    Parameters

    Returns string

    A valid mimetype.

    If a mime type cannot be found returns the default mime type text/plain, never null. There may be more than one mime type, but only the first one will be returned. To access all mime types, use IEditorLanguageRegistry instead.