提交 cfd69327 编写于 作者: B Benjamin Pasero

remove unused code

上级 006361a6
......@@ -9,8 +9,8 @@ import dom = require('vs/base/browser/dom');
import uri from 'vs/base/common/uri';
import paths = require('vs/base/common/paths');
import types = require('vs/base/common/types');
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IMatch } from 'vs/base/common/filters';
import {HighlightedLabel} from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import {IMatch} from 'vs/base/common/filters';
import {IWorkspaceProvider, getPathLabel} from 'vs/base/common/labels';
export class FileLabel {
......@@ -71,43 +71,4 @@ function getPath(arg1: uri | string | IWorkspaceProvider): string {
}
return (<uri>arg1).fsPath;
}
export function getFileIconClasses(arg1?: uri | string, getLanguageId?: (path: string) => string, isFolder?: boolean): string[] {
let path: string;
if (typeof arg1 === 'string') {
path = arg1;
} else if (arg1) {
path = arg1.fsPath;
}
const classes = isFolder ? ['folder-icon'] : ['file-icon'];
if (path) {
const basename = paths.basename(path);
const dotSegments = basename.split('.');
const name = dotSegments[0]; // file.txt => "file", .dockerfile => "", file.some.txt => "file"
if (name) {
classes.push(`${cssEscape(name.toLowerCase())}-name-file-icon`);
}
const extensions = dotSegments.splice(1);
if (extensions.length > 0) {
for (let i = 0; i < extensions.length; i++) {
classes.push(`${cssEscape(extensions.slice(i).join('.').toLowerCase())}-ext-file-icon`); // add each combination of all found extensions if more than one
}
}
const langId = getLanguageId(path);
if (langId) {
classes.push(`${cssEscape(langId)}-lang-file-icon`);
}
}
return classes;
}
function cssEscape(val: string): string {
return val.replace(/\s/g, '\\$&'); // make sure to not introduce CSS classes from files that contain whitespace
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册