Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1017589
Add 'ASPNETCORE_ENVIRONMENT' to default ASP.NET launch options
gregg-miskelly May 3, 2016
baf6202
Merge branch 'dev' of https://github.com/OmniSharp/omnisharp-vscode i…
DustinCampbell May 17, 2016
4c07ddb
Update coreclr-debug packages for post rc2 work
chuckries May 20, 2016
54c0cc8
Merge pull request #357 from chuckries/dev
chuckries May 20, 2016
ce34735
Creating launch for web or console.
rajkumar42 May 20, 2016
2699034
Merge pull request #360 from rajkumar42/rajkumar42/launchchangessquashed
chuckries May 20, 2016
09c5dd0
Merge pull request #274 from gregg-miskelly/EnvLaunchOption
gregg-miskelly May 20, 2016
0e22244
Merge branch 'dev' of https://github.com/OmniSharp/omnisharp-vscode i…
DustinCampbell May 23, 2016
10bfc89
Merge branch 'master' into merge-master-into-dev
DustinCampbell May 23, 2016
90dca20
Merge pull request #368 from DustinCampbell/merge-master-into-dev
DustinCampbell May 23, 2016
b92e0b6
Add dotnet-test discovery and execution
troydai May 25, 2016
7193f18
split arguments to prevent long argument issue
troydai May 26, 2016
fe2e7a4
test result feedback
troydai May 26, 2016
0302243
move dotnet test logic to its own file
troydai May 26, 2016
1efd3b4
move code from codelens provider to dotnetTest
troydai May 26, 2016
60e9de7
disable debug trigger if startDebug command doesn't exist
troydai May 26, 2016
ca485c8
Update endpoint names for test scenarios
troydai May 27, 2016
7de8408
Schema for pipe transport options. (#376)
rajkumar42 May 27, 2016
bc3222c
Move isDebugEnable switch into OmniSharpServer
troydai May 28, 2016
5c9ee8e
Add test output channel
troydai May 28, 2016
62b9fe2
Address review comments
troydai May 31, 2016
969188d
Merge pull request #382 from troydai/troy-test
DustinCampbell May 31, 2016
c44f3c3
Update decompress module to 4.0.0
DustinCampbell May 31, 2016
a952fdb
Merge pull request #386 from DustinCampbell/update-decompress
DustinCampbell May 31, 2016
10eccb9
Update OmniSharp to 1.9-beta4
DustinCampbell May 31, 2016
b8b4e11
Merge pull request #387 from DustinCampbell/update-omnisharp
DustinCampbell May 31, 2016
5999b8e
Merge branch 'master' into merge-master-into-dev
DustinCampbell May 31, 2016
a3e17db
Merge pull request #388 from DustinCampbell/merge-master-into-dev
DustinCampbell May 31, 2016
42cc77d
Update version to 1.1.1
DustinCampbell May 31, 2016
b0d4ac7
Merge pull request #389 from DustinCampbell/update-version
DustinCampbell May 31, 2016
4c5911a
Add 'externalConsole' launch option (#390)
gregg-miskelly May 31, 2016
bbb2b3b
Update namespace of test endpoints to V2
troydai May 31, 2016
5ffff21
Fix OmniSharp download and improve logging
DustinCampbell May 31, 2016
56abbd6
Merge pull request #391 from OmniSharp/troy-endpoint-update
DustinCampbell May 31, 2016
e38e1a6
Merge pull request #392 from DustinCampbell/improve-omnisharp-logging
DustinCampbell May 31, 2016
2f99338
Update version to 1.1.2 (#395)
gregg-miskelly Jun 1, 2016
019520c
Add "What's new" section and update debugger docs with new features (…
gregg-miskelly Jun 2, 2016
b595056
Improve error handling for 'isOnPath'
chuckries Jun 2, 2016
ddb5c09
Merge pull request #399 from chuckries/dev
chuckries Jun 2, 2016
49c3e37
Debugger changes for 1.1.4 (#407)
gregg-miskelly Jun 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ Please file any issues at https://github.com/OmniSharp/omnisharp-vscode/issues.
### Debugging
The C# extension now supports basic debugging capabilities! See http://aka.ms/vscclrdebugger for details.

### What's new in C# extension version 1.1

* Preliminary support for `dotnet test`
* Fix for OmniSharp installation problems on networks with an http proxy
* Debugger support for an external console
* Debugger support for environment variables
* Support for debugging .NET Core 1.0.0 post RC2 builds
* Automatic web vs. console debugger configuration detection
* Detach support
* Fix expression evaluation errors when referencing assemblies which aren't currently loaded
* Fix expression evaluation on Windows 7

### Development

First install:
Expand Down
2 changes: 2 additions & 0 deletions coreclr-debug/NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<!-- This dependency can be commented out once we push packages to nuget for a real release -->
<add key="coreclrdebug" value="https://www.myget.org/F/coreclr-debug/api/v3/index.json" />
</packageSources>
</configuration>
14 changes: 13 additions & 1 deletion debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,21 @@ You can optionally configure a file by file mapping by providing map following t

"sourceFileMap": {
"C:\foo":"/home/me/foo"
}
}

#####Symbol Path
You can optionally provide paths to symbols following this schema:

"symbolPath":"[ \"/Volumes/symbols\"]"

#####Environment variables
Environment variables may be passed to your program using this schema:

"env": {
"myVariableName":"theValueGoesHere"
}

#####External console (terminal) window
The target process can optionally launch into a seperate console window. You will want this if your console app takes console input (ex: Console.ReadLine). This can be enabled with:

"externalConsole": true
113 changes: 110 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "csharp",
"publisher": "ms-vscode",
"version": "1.0.12",
"version": "1.1.4",
"description": "C# for Visual Studio Code (powered by OmniSharp).",
"displayName": "C#",
"author": "Microsoft Corporation",
Expand All @@ -22,7 +22,7 @@
"postinstall": "tsc"
},
"dependencies": {
"decompress": "^3.0.0",
"decompress": "^4.0.0",
"del": "^2.0.2",
"fs-extra-promise": "^0.3.1",
"http-proxy-agent": "^1.0.0",
Expand Down Expand Up @@ -263,6 +263,17 @@
}
}
},
"env": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Environment variables passed to the program.",
"default": { }
},
"externalConsole": {
"type": "boolean",
"description": "If 'true' the debugger should launch the target application into a new external console.",
"default": false
},
"sourceFileMap": {
"type": "object",
"description": "Optional source file mappings passed to the debug engine. Example: '{ \"C:\\foo\":\"/home/user/foo\" }'",
Expand All @@ -282,6 +293,98 @@
"type": "string"
},
"default": []
},
"pipeTransport": {
"type": "object",
"description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the .NET Core debugger backend executable (clrdbg).",
"default": {
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
"pipeArgs": []
},
"properties" : {
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
"default": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'"
},
"pipeArgs": {
"type": "array",
"description": "Command line arguments passed to the pipe program.",
"items": {
"type": "string"
},
"default": []
},
"windows": {
"type": "object",
"description": "Windows-specific pipe launch configuration options",
"default": {
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
"pipeArgs": []
},
"properties": {
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
"default": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'"
},
"pipeArgs": {
"type": "array",
"description": "Command line arguments passed to the pipe program.",
"items": {
"type": "string"
},
"default": []
}
}
},
"osx": {
"type": "object",
"description": "OSX-specific pipe launch configuration options",
"default": {
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
"pipeArgs": []
},
"properties": {
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
"default": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'"
},
"pipeArgs": {
"type": "array",
"description": "Command line arguments passed to the pipe program.",
"items": {
"type": "string"
},
"default": []
}
}
},
"linux": {
"type": "object",
"description": "Linux-specific pipe launch configuration options",
"default": {
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
"pipeArgs": []
},
"properties": {
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
"default": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'"
},
"pipeArgs": {
"type": "array",
"description": "Command line arguments passed to the pipe program.",
"items": {
"type": "string"
},
"default": []
}
}
}
}
}
}
},
Expand Down Expand Up @@ -330,7 +433,8 @@
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false
"stopAtEntry": false,
"externalConsole": false
},
{
"name": ".NET Core Launch (web)",
Expand All @@ -354,6 +458,9 @@
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
Expand Down
58 changes: 46 additions & 12 deletions src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ interface ConsoleLaunchConfiguration extends DebugConfiguration {
program: string,
args: string[],
cwd: string,
stopAtEntry: boolean
stopAtEntry: boolean,
env?: any,
externalConsole?: boolean
}

interface CommandLine {
Expand Down Expand Up @@ -137,6 +139,7 @@ function createLaunchConfiguration(targetFramework: string, executableName: stri
program: '${workspaceRoot}/bin/Debug/' + targetFramework + '/'+ executableName,
args: [],
cwd: '${workspaceRoot}',
externalConsole: false,
stopAtEntry: false
}
}
Expand Down Expand Up @@ -164,6 +167,9 @@ function createWebLaunchConfiguration(targetFramework: string, executableName: s
linux: {
command: 'xdg-open'
}
},
env: {
ASPNETCORE_ENVIRONMENT: "Development"
}
}
}
Expand All @@ -177,14 +183,25 @@ function createAttachConfiguration(): AttachConfiguration {
}
}

function createLaunchJson(targetFramework: string, executableName: string): any {
return {
version: '0.2.0',
configurations: [
createLaunchConfiguration(targetFramework, executableName),
createWebLaunchConfiguration(targetFramework, executableName),
createAttachConfiguration()
]
function createLaunchJson(targetFramework: string, executableName: string, isWebProject: boolean): any {
let version = '0.2.0';
if (!isWebProject) {
return {
version: version,
configurations: [
createLaunchConfiguration(targetFramework, executableName),
createAttachConfiguration()
]
}
}
else {
return {
version: version,
configurations: [
createWebLaunchConfiguration(targetFramework, executableName),
createAttachConfiguration()
]
}
}
}

Expand Down Expand Up @@ -220,7 +237,24 @@ function addTasksJsonIfNecessary(info: protocol.DotNetWorkspaceInformation, path
});
}

function addLaunchJsonIfNecessary(info: protocol.DotNetWorkspaceInformation, paths: Paths, operations: Operations) {
function hasWebServerDependency(projectJsonPath: string) {
let projectJson = fs.readFileSync(projectJsonPath, 'utf8');
let projectJsonObject = JSON.parse(projectJson);

if (projectJsonObject == null) {
return false;
}

for (var key in projectJsonObject.dependencies) {
if (key.toLowerCase().startsWith("microsoft.aspnetcore.server")) {
return true;
}
}

return false;
}

function addLaunchJsonIfNecessary(info: protocol.DotNetWorkspaceInformation, paths: Paths, operations: Operations, projectJsonPath: string) {
return new Promise<void>((resolve, reject) => {
if (!operations.addLaunchJson) {
return resolve();
Expand Down Expand Up @@ -248,7 +282,7 @@ function addLaunchJsonIfNecessary(info: protocol.DotNetWorkspaceInformation, pat
}
}

const launchJson = createLaunchJson(targetFramework, executableName);
const launchJson = createLaunchJson(targetFramework, executableName, hasWebServerDependency(projectJsonPath));
const launchJsonText = JSON.stringify(launchJson, null, ' ');

return fs.writeFileAsync(paths.launchJsonPath, launchJsonText);
Expand Down Expand Up @@ -284,7 +318,7 @@ export function addAssetsIfNecessary(server: OmnisharpServer) {
return fs.ensureDirAsync(paths.vscodeFolder).then(() => {
return Promise.all([
addTasksJsonIfNecessary(info.DotNet, paths, operations),
addLaunchJsonIfNecessary(info.DotNet, paths, operations)
addLaunchJsonIfNecessary(info.DotNet, paths, operations, projectJsonPath)
]);
});
});
Expand Down
26 changes: 15 additions & 11 deletions src/coreclr-debug/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,29 @@ function isOnPath(command : string) : boolean {
return false;
}
let fileName = command;
let seperatorChar = ':';
if (process.platform == 'win32') {
// on Windows, add a '.exe', and the path is semi-colon seperatode
fileName = fileName + ".exe";
seperatorChar = ';';
}
let pathSegments: string[] = pathValue.split(seperatorChar);

let pathSegments: string[] = pathValue.split(path.delimiter);
for (let segment of pathSegments) {
if (segment.length === 0 || !path.isAbsolute(segment)) {
continue;
}

const segmentPath = path.join(segment, fileName);
if (CoreClrDebugUtil.existsSync(segmentPath)) {
return true;

try {
if (CoreClrDebugUtil.existsSync(segmentPath)) {
return true;
}
} catch (err) {
// any error from existsSync can be treated as the command not being on the path
continue;
}
}

return false;
}

Expand Down Expand Up @@ -332,9 +336,9 @@ function createProjectJson(targetRuntime: string): any
emitEntryPoint: true
},
dependencies: {
"Microsoft.VisualStudio.clrdbg": "14.0.25229-preview-2963841",
"Microsoft.VisualStudio.clrdbg.MIEngine": "14.0.30401-preview-1",
"Microsoft.VisualStudio.OpenDebugAD7": "1.0.20405-preview-1",
"Microsoft.VisualStudio.clrdbg": "14.0.25406-preview-3044032",
"Microsoft.VisualStudio.clrdbg.MIEngine": "14.0.30606-preview-1",
"Microsoft.VisualStudio.OpenDebugAD7": "1.0.20527-preview-1",
"NETStandard.Library": "1.5.0-rc2-24027",
"Newtonsoft.Json": "7.0.1",
"Microsoft.VisualStudio.Debugger.Interop.Portable": "1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr-debug/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class CoreClrDebugUtil
fs.accessSync(path, fs.F_OK);
return true;
} catch (err) {
if (err.code === 'ENOENT') {
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') {
return false;
} else {
throw Error(err.code);
Expand Down
Loading