Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point to vale binary outside, but relative to workspace #33

Closed
hangie opened this issue Apr 4, 2024 · 2 comments
Closed

Point to vale binary outside, but relative to workspace #33

hangie opened this issue Apr 4, 2024 · 2 comments

Comments

@hangie
Copy link

hangie commented Apr 4, 2024

The binary path doesn't allow paths outside of the workspace. We typically have venv a level up as we use multi folder workspaces. I want to point there for vale, but currently that is blocked.

@hangie
Copy link
Author

hangie commented Apr 4, 2024

The bug is caused in this:

function replaceWorkspaceFolder(
logger: vscode.OutputChannel,
customPath: string,
file: vscode.TextDocument
): string | null {
customPath = path.normalize(customPath);
const workspaceFolder = vscode.workspace.getWorkspaceFolder(file.uri);
if (workspaceFolder) {
return customPath.replace("${workspaceFolder}", workspaceFolder.uri.fsPath);
}
logger.appendLine(
`Not running Vale on file '${file.uri}' as it is not contained within the workspace`
);
return null;
}

This line:

customPath = path.normalize(customPath);

should be run on the result of this line:

return customPath.replace("${workspaceFolder}", workspaceFolder.uri.fsPath);

hangie added a commit to hangie/vale-vscode that referenced this issue Apr 4, 2024
ChrisChinchilla pushed a commit that referenced this issue Apr 7, 2024
* Fix for issue #33

* Handle multi-root workspace variable - issue #10
@hangie
Copy link
Author

hangie commented Apr 20, 2024

Released in v0.19.0

@hangie hangie closed this as completed Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant