Skip to content

Commit 396d342

Browse files
committed
chore: delete unused code
1 parent 9a130b1 commit 396d342

File tree

6 files changed

+7
-58
lines changed

6 files changed

+7
-58
lines changed

packages/language-services/src/language-feature.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import {
1919
Variable,
2020
VariableDeclaration,
2121
URI,
22+
Utils,
2223
} from "./language-services-types";
23-
import { joinPath } from "./utils/resources";
2424
import { asDollarlessVariable } from "./utils/sass";
2525

2626
export type LanguageFeatureInternal = {
@@ -93,7 +93,9 @@ export abstract class LanguageFeature {
9393
*/
9494
resolveReference: (ref: string, base: string) => {
9595
if (ref.startsWith("/") && this.configuration.workspaceRoot) {
96-
return joinPath(this.configuration.workspaceRoot.toString(), ref);
96+
return Utils.joinPath(this.configuration.workspaceRoot, ref).toString(
97+
true,
98+
);
9799
}
98100
try {
99101
return resolve(base, ref);

packages/language-services/src/utils/resources.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/vscode-css-languageservice/src/parser/cssNodes.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55
"use strict";
66

7-
import { trim } from "../utils/strings";
8-
97
/// <summary>
108
/// Nodes for the css 2.1 specification. See for reference:
119
/// http://www.w3.org/TR/CSS21/grammar.html#grammar
@@ -701,7 +699,7 @@ export class Property extends Node {
701699
}
702700

703701
public getName(): string {
704-
return trim(this.getText(), /[_\+]+$/); /* +_: less merge */
702+
return this.getText();
705703
}
706704

707705
public isCustomProperty(): boolean {

packages/vscode-css-languageservice/src/test/util.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/vscode-css-languageservice/src/utils/strings.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,6 @@ export function getLimitedString(str: string, ellipsis = true): string {
8383
return str.slice(0, 140) + (ellipsis ? "\u2026" : "");
8484
}
8585

86-
/**
87-
* Limit of string length.
88-
*/
89-
export function trim(str: string, regexp: RegExp): string {
90-
const m = regexp.exec(str);
91-
if (m && m[0].length) {
92-
return str.substr(0, str.length - m[0].length);
93-
}
94-
return str;
95-
}
96-
97-
export function repeat(value: string, count: number) {
98-
let s = "";
99-
while (count > 0) {
100-
if ((count & 1) === 1) {
101-
s += value;
102-
}
103-
value += value;
104-
count = count >>> 1;
105-
}
106-
return s;
107-
}
108-
10986
export function convertSimple2RegExpPattern(pattern: string): string {
11087
return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&").replace(/[\*]/g, ".*");
11188
}

packages/vscode-css-languageservice/vitest.config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export default defineConfig({
77
coverage: {
88
provider: "v8",
99
reporter: ["text", "json", "html"],
10+
include: ["src/"],
11+
exclude: ["src/test/"],
1012
},
1113
},
1214
});

0 commit comments

Comments
 (0)