Skip to content

Commit

Permalink
Add option for "use custom path" to vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Feb 9, 2025
1 parent 8c74112 commit 8151abc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
6 changes: 4 additions & 2 deletions Src/CSharpier.VSCode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [2.0.4]
- Set working directory for CSharpier Server to the directory that contains CSharpier. Fixes an issue with a recursive file watch being run on the project root.
## 2.0.5
- Add option for "use custom path"

## 2.0.4
- Set working directory for CSharpier Server to the directory that contains CSharpier. Fixes an issue with a recursive file watch being run on the project root.

## 2.0.3
- Get things working with the alpha version of 1.0.0
Expand Down
37 changes: 19 additions & 18 deletions Src/CSharpier.VSCode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Src/CSharpier.VSCode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "csharpier-vscode",
"displayName": "CSharpier - Code formatter",
"description": "Code formatter using csharpier",
"version": "2.0.4",
"version": "2.0.5",
"publisher": "csharpier",
"author": "CSharpier",
"homepage": "https://marketplace.visualstudio.com/items?itemName=csharpier.csharpier-vscode",
Expand Down Expand Up @@ -72,10 +72,16 @@
"description": "Enable diagnostics that highlight code that is not formatted with CSharpier."
},
"csharpier.dev.customPath": {
"title": "blah",
"type": "string",
"default": "",
"description": "Path to directory containing dotnet-csharpier - used for testing the extension with new versions of csharpier."
},
"csharpier.dev.useCustomPath": {
"type": "boolean",
"default": false,
"description": "Path to directory containing dotnet-csharpier - used for testing the extension with new versions of csharpier."
},
"csharpier.dev.disableCSharpierServer": {
"type": "boolean",
"default": false,
Expand All @@ -101,7 +107,7 @@
"@types/prettier-linter-helpers": "^1.0.4",
"@types/semver": "7.3.9",
"@types/vscode": "1.60.0",
"@vscode/vsce": "3.2.1",
"@vscode/vsce": "3.2.2",
"prettier": "2.4.1",
"rimraf": "3.0.2",
"semver": "7.6.0",
Expand Down
10 changes: 6 additions & 4 deletions Src/CSharpier.VSCode/src/CustomPathInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import { execSync } from "child_process";
import * as semver from "semver";

export class CustomPathInstaller {
logger: Logger;
customPath: string;
private readonly logger: Logger;
private readonly customPath: string = "";

constructor(logger: Logger) {
this.logger = logger;
this.customPath =
workspace.getConfiguration("csharpier").get<string>("dev.customPath") ?? "";
if (workspace.getConfiguration("csharpier").get<boolean>("dev.useCustomPath")) {
this.customPath =
workspace.getConfiguration("csharpier").get<string>("dev.customPath") ?? "";
}
}

public ensureVersionInstalled(version: string, directory: string): boolean {
Expand Down

0 comments on commit 8151abc

Please sign in to comment.