Skip to content

Commit 137b788

Browse files
committed
Use dotnet dnx to run dotnet tools
1 parent 017404a commit 137b788

7 files changed

Lines changed: 149 additions & 235 deletions

File tree

l10n/bundle.l10n.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -190,26 +190,6 @@
190190
]
191191
},
192192
"You can modify the default arguments if needed": "You can modify the default arguments if needed",
193-
"Install": "Install",
194-
"{0} not found, run \"{1}\" to install it?/{0} is the tool name and should not be localized{1} is the install command": {
195-
"message": "{0} not found, run \"{1}\" to install it?",
196-
"comment": [
197-
"{0} is the tool name and should not be localized",
198-
"{1} is the install command"
199-
]
200-
},
201-
"Installing {0}.../{0} is the tool name and should not be localized": {
202-
"message": "Installing {0}...",
203-
"comment": [
204-
"{0} is the tool name and should not be localized"
205-
]
206-
},
207-
"Failed to install {0}, it may need to be manually installed. See C# output for details./{0} is the tool name and should not be localized": {
208-
"message": "Failed to install {0}, it may need to be manually installed. See C# output for details.",
209-
"comment": [
210-
"{0} is the tool name and should not be localized"
211-
]
212-
},
213193
"Language server process not found, ensure the server is running.": "Language server process not found, ensure the server is running.",
214194
"Failed to collect logs: {0}/{0} is the error message": {
215195
"message": "Failed to collect logs: {0}",
@@ -229,24 +209,6 @@
229209
"Captures managed heap information for investigating memory issues.": "Captures managed heap information for investigating memory issues.",
230210
"Collect C# Logs": "Collect C# Logs",
231211
"Select additional logging to collect": "Select additional logging to collect",
232-
"Verifying dotnet-trace.../dotnet-trace is a command name and should not be localized": {
233-
"message": "Verifying dotnet-trace...",
234-
"comment": [
235-
"dotnet-trace is a command name and should not be localized"
236-
]
237-
},
238-
"Verifying dotnet-dump.../dotnet-dump is a command name and should not be localized": {
239-
"message": "Verifying dotnet-dump...",
240-
"comment": [
241-
"dotnet-dump is a command name and should not be localized"
242-
]
243-
},
244-
"Verifying dotnet-gcdump.../dotnet-gcdump is a command name and should not be localized": {
245-
"message": "Verifying dotnet-gcdump...",
246-
"comment": [
247-
"dotnet-gcdump is a command name and should not be localized"
248-
]
249-
},
250212
"Save Logs": "Save Logs",
251213
"Output folder {0} does not exist/{0} is the folder path": {
252214
"message": "Output folder {0} does not exist",

src/common.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,29 @@ ${stderr}`)
7878
});
7979
}
8080

81+
export async function execFileChildProcess(
82+
file: string,
83+
args: string[],
84+
workingDirectory: string | undefined,
85+
env: NodeJS.ProcessEnv
86+
): Promise<string> {
87+
return new Promise<string>((resolve, reject) => {
88+
cp.execFile(file, args, { cwd: workingDirectory, maxBuffer: 500 * 1024, env: env }, (error, stdout, stderr) => {
89+
if (error) {
90+
reject(
91+
new Error(`${error}
92+
${stdout}
93+
${stderr}`)
94+
);
95+
} else if (stderr && !stderr.includes('screen size is bogus')) {
96+
reject(new Error(stderr));
97+
} else {
98+
resolve(stdout);
99+
}
100+
});
101+
});
102+
}
103+
81104
export async function getUnixChildProcessIds(pid: number): Promise<number[]> {
82105
return new Promise<number[]>((resolve, reject) => {
83106
cp.exec('ps -A -o ppid,pid', (error, stdout, stderr) => {

src/lsptoolshost/commands.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,12 @@ function registerExtensionCommands(
9292
context.subscriptions.push(
9393
vscode.commands.registerCommand('csharp.showOutputWindow', async () => outputChannel.show())
9494
);
95-
registerCollectLogsCommand(context, languageServer, outputChannel, csharpTraceChannel, razorLogger);
95+
registerCollectLogsCommand(
96+
context,
97+
languageServer,
98+
hostExecutableResolver,
99+
outputChannel,
100+
csharpTraceChannel,
101+
razorLogger
102+
);
96103
}

src/lsptoolshost/dotnetRuntime/dotnetRuntimeExtensionResolver.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
6666
};
6767

6868
if (usingDevkit) {
69-
const toolingRuntimeHostInfo = await this.tryGetToolingRuntimeHostInfo({
70-
...findPathRequest,
71-
rejectPreviews: false,
72-
});
69+
const toolingRuntimeHostInfo = await this.tryGetToolingRuntimeHostInfo();
7370
if (toolingRuntimeHostInfo) {
7471
this.hostInfo = toolingRuntimeHostInfo;
7572
return toolingRuntimeHostInfo;
@@ -98,9 +95,7 @@ export class DotnetRuntimeExtensionResolver implements IHostExecutableResolver {
9895
return hostInfo;
9996
}
10097

101-
private async tryGetToolingRuntimeHostInfo(
102-
findPathRequest: IDotnetFindPathContext
103-
): Promise<HostExecutableInformation | undefined> {
98+
private async tryGetToolingRuntimeHostInfo(): Promise<HostExecutableInformation | undefined> {
10499
// get vscode setting value for dotnet.toolingRuntimePath
105100
const toolingRuntimePath = languageServerOptions.toolingRuntimePath;
106101
if (toolingRuntimePath.length === 0) {

0 commit comments

Comments
 (0)