Skip to content

Commit 075cc07

Browse files
Fix path type for configPath
1 parent 08ffe40 commit 075cc07

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/lsp.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,17 @@ export async function activate(context: ExtensionContext) {
153153

154154
// Resolve workspace folder
155155
let resolvedConfigPath = configPathRaw;
156-
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
156+
if (
157+
vscode.workspace.workspaceFolders &&
158+
vscode.workspace.workspaceFolders.length > 0
159+
) {
157160
const workspaceRoot = vscode.workspace.workspaceFolders[0].uri.fsPath;
158161

159162
if (configPathRaw.includes("${workspaceFolder}")) {
160-
resolvedConfigPath = configPathRaw.replace(/\$\{workspaceFolder\}/g, workspaceRoot);
163+
resolvedConfigPath = configPathRaw.replace(
164+
/\$\{workspaceFolder\}/g,
165+
workspaceRoot
166+
);
161167
} else if (
162168
configPathRaw.startsWith("./") ||
163169
(!path.isAbsolute(configPathRaw) && configPathRaw.length > 0)
@@ -167,7 +173,7 @@ export async function activate(context: ExtensionContext) {
167173
}
168174

169175
let valeConfig: Record<valeConfigOptions, valeArgs> = {
170-
configPath: { value: resolvedConfigPath } as valeArgs,
176+
configPath: resolvedConfigPath as unknown as valeArgs,
171177
syncOnStartup: configuration.get("vale.valeCLI.syncOnStartup") as valeArgs,
172178
filter: valeFilter as unknown as valeArgs,
173179
// TODO: Build into proper onboarding

0 commit comments

Comments
 (0)