Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1408721
adding standard std version to clang_format_style
Apr 22, 2020
2236841
add new cppBuildTaskProvider
Jun 3, 2020
ffc0b68
add Sean's changes to tasks
Jun 4, 2020
e8eecd9
draft
Jun 10, 2020
e8d58aa
draft 2
Jun 12, 2020
d3c898a
draft 3 - working
Jun 12, 2020
4b34f16
windows version
Jun 16, 2020
d8403f1
fix cwd path
Jun 16, 2020
8b93a05
fix cwd
Jun 17, 2020
5e2da4e
change header and source file set
Jun 22, 2020
9f29e3d
minor changes
Jun 22, 2020
95284c6
make new instance
Jun 22, 2020
ecc01a1
create new instance
Jun 22, 2020
f73ad8f
remove compilerPath input
Jun 23, 2020
142105c
review changes
Jun 23, 2020
b2823b2
solving the error due to space in file name
Jun 23, 2020
62ff459
showing the error message
Jun 23, 2020
ded59df
Merge branch 'master' into elrashed/3674_2
Jul 2, 2020
4b2b34f
fix lint
Jul 2, 2020
ce1b647
add set timeout and setinterval from timers
Jul 5, 2020
9ebe692
Rename cppbuildTaskProvider.ts to cppBuildTaskProvider.ts
Jul 6, 2020
8abef50
fire the events with zero
Jul 8, 2020
1a5a301
Merge branch 'elrashed/3674_2' of https://github.com/microsoft/vscode…
Jul 8, 2020
95258cb
delete filewatcher
Jul 14, 2020
ea4c6b9
Merge branch 'master' into elrashed/3674_2
sean-mcmanus Jul 14, 2020
1182bb2
localize strings
Jul 14, 2020
96fea95
Merge branch 'elrashed/3674_2' of https://github.com/microsoft/vscode…
Jul 14, 2020
fa075fb
change changelog.md
Jul 14, 2020
334b9e2
changelog
Jul 14, 2020
4045b90
changelog
Jul 14, 2020
73b64c1
change format
Jul 15, 2020
e3703cb
wait dobuild
Jul 15, 2020
752b0b6
use checkFileExists
Jul 15, 2020
d30ce91
after test
Jul 15, 2020
0e91565
after test2
Jul 15, 2020
4e6f53d
add properties
Jul 15, 2020
4b1fbf5
change the doBuild
Jul 15, 2020
c0026f9
this.closeEmitter.fire(result);
Jul 15, 2020
66644da
change doBuild
Jul 15, 2020
7ac3a29
very minor change
Jul 15, 2020
caf5e80
Merge branch 'master' into elrashed/3674_2
sean-mcmanus Jul 21, 2020
6d6931a
Merge branch 'master' into elrashed/3674_2
sean-mcmanus Jul 23, 2020
bc9a05a
label vs name resolved
Aug 6, 2020
805412b
draft
Aug 10, 2020
4ae2bd4
draft for Sean
Aug 10, 2020
3a785e5
before cleaning the code
Aug 11, 2020
fae08d0
Stable, Clean, Before API proposal
Aug 11, 2020
4b940c5
adding details to the tasks menue
Aug 18, 2020
d4c5312
add TODO
Aug 19, 2020
7e8885e
remove extra ",remove description,merge from local
Aug 21, 2020
d2d10d4
remove task rename in this versoin
Aug 21, 2020
a4841f3
remove TODOs
Aug 24, 2020
f78ec14
merge the "default" stuff
Aug 24, 2020
3406b5f
remove some parts of proposals
Aug 24, 2020
4552894
fix linter errors
Aug 24, 2020
e9cf813
Merge branch 'master' into elrashed/3674_2
Aug 24, 2020
4d883b6
Merge branch 'master' into elrashed/3674_2
Aug 24, 2020
c9b612e
add import * as which from 'which';
Aug 24, 2020
d1bf0d8
Merge branch 'master' into elrashed/3674_2
Sep 10, 2020
3363b14
clean up the code after version 1.0.0
Sep 10, 2020
4e106cf
add new line
Sep 10, 2020
1d8183e
adapt to the new Vs Code API
Sep 11, 2020
16b07b8
Merge branch 'master' into elrashed/3674_2
Sep 16, 2020
b14b33d
linter error
Sep 21, 2020
2cb0b47
revert changelog
Sep 22, 2020
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
39 changes: 38 additions & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"license": "SEE LICENSE IN LICENSE.txt",
"engines": {
"vscode": "^1.44.0"
"vscode": "^1.49.0"
},
"bugs": {
"url": "https://github.com/Microsoft/vscode-cpptools/issues",
Expand Down Expand Up @@ -42,6 +42,43 @@
],
"main": "./dist/main",
"contributes": {
"taskDefinitions": [
{
"type": "cppbuild",
"required": [
"command",
"label"
],
"properties": {
"label": {
"type": "string",
"description": "%c_cpp.taskDefinitions.name.description%"
},
"command": {
"type": "string",
"description": "%c_cpp.taskDefinitions.command.description%"
},
"args": {
"type": "array",
"description": "%c_cpp.taskDefinitions.args.description%"
},
"options": {
Comment thread
elahehrashedi marked this conversation as resolved.
"type": "object",
"description": "%c_cpp.taskDefinitions.options.description%",
"properties": {
"cwd": {
"type": "string",
"description": "%c_cpp.taskDefinitions.options.cwd.description%"
}
}
},
"detail": {
"type": "string",
"description": "%c_cpp.taskDefinitions.detail.description%"
}
}
}
],
"views": {
"references-view": [
{
Expand Down
10 changes: 8 additions & 2 deletions Extension/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,11 @@
"c_cpp.debuggers.symbolLoadInfo.description": "Explicit control of symbol loading.",
"c_cpp.debuggers.symbolLoadInfo.loadAll.description": "If true, symbols for all libs will be loaded, otherwise no solib symbols will be loaded. Default value is true.",
"c_cpp.debuggers.symbolLoadInfo.exceptionList.description": "List of filenames (wildcards allowed) separated by semicolons ';'. Modifies behavior of LoadAll. If LoadAll is true then don't load symbols for libs that match any name in the list. Otherwise only load symbols for libs that match. Example: \"foo.so;bar.so\"",
"c_cpp.debuggers.requireExactSource.description": "Optional flag to require current source code to match the pdb."
}
"c_cpp.debuggers.requireExactSource.description": "Optional flag to require current source code to match the pdb.",
"c_cpp.taskDefinitions.name.description": "The name of the task",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these periods have remained?

"c_cpp.taskDefinitions.command.description": "The path to either a compiler or script that performs compilation",
"c_cpp.taskDefinitions.args.description": "Additional arguments to pass to the compiler or compilation script",
"c_cpp.taskDefinitions.options.description": "Additional command options",
"c_cpp.taskDefinitions.options.cwd.description": "The current working directory of the executed program or script. If omitted Code's current workspace root is used.",
"c_cpp.taskDefinitions.detail.description": "Additional details of the task"
}
15 changes: 8 additions & 7 deletions Extension/src/Debugger/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import * as debugUtils from './utils';
import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import { getBuildTasks, BuildTaskDefinition } from '../LanguageServer/extension';
import { CppBuildTaskDefinition} from '../LanguageServer/cppBuildTaskProvider';
import * as util from '../common';
import * as fs from 'fs';
import * as Telemetry from '../telemetry';
import { buildAndDebugActiveFileStr } from './extension';
import { cppBuildTaskProvider} from '../LanguageServer/extension';
import * as logger from '../logger';
import * as nls from 'vscode-nls';

Expand Down Expand Up @@ -77,7 +78,7 @@ export class QuickPickConfigurationProvider implements vscode.DebugConfiguration
}
if (selection.label.indexOf(buildAndDebugActiveFileStr()) !== -1 && selection.configuration.preLaunchTask) {
try {
await util.ensureBuildTaskExists(selection.configuration.preLaunchTask);
await cppBuildTaskProvider.ensureBuildTaskExists(selection.configuration.preLaunchTask);
await vscode.debug.startDebugging(folder, selection.configuration);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "true" });
} catch (e) {
Expand Down Expand Up @@ -105,7 +106,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
* Returns a list of initial debug configurations based on contextual information, e.g. package.json or folder.
*/
async provideDebugConfigurations(folder?: vscode.WorkspaceFolder, token?: vscode.CancellationToken): Promise<vscode.DebugConfiguration[]> {
let buildTasks: vscode.Task[] = await getBuildTasks(true, true);
let buildTasks: vscode.Task[] = await cppBuildTaskProvider.getTasks(true);
if (buildTasks.length === 0) {
return Promise.resolve(this.provider.getInitialConfigurations(this.type));
}
Expand Down Expand Up @@ -133,9 +134,9 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
// Generate new configurations for each build task.
// Generating a task is async, therefore we must *await* *all* map(task => config) Promises to resolve.
const configs: vscode.DebugConfiguration[] = await Promise.all(buildTasks.map<Promise<vscode.DebugConfiguration>>(async task => {
const definition: BuildTaskDefinition = task.definition as BuildTaskDefinition;
const compilerName: string = path.basename(definition.compilerPath);

const definition: CppBuildTaskDefinition = task.definition as CppBuildTaskDefinition;
const compilerPath: string = definition.command;
const compilerName: string = path.basename(compilerPath);
const newConfig: vscode.DebugConfiguration = {...defaultConfig}; // Copy enumerables and properties

newConfig.name = compilerName + buildAndDebugActiveFileStr();
Expand Down Expand Up @@ -166,7 +167,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
debuggerName += ".exe";
}

const compilerDirname: string = path.dirname(definition.compilerPath);
const compilerDirname: string = path.dirname(compilerPath);
const debuggerPath: string = path.join(compilerDirname, debuggerName);
fs.stat(debuggerPath, (err, stats: fs.Stats) => {
if (!err && stats && stats.isFile) {
Expand Down
9 changes: 5 additions & 4 deletions Extension/src/Debugger/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CppdbgDebugAdapterDescriptorFactory, CppvsdbgDebugAdapterDescriptorFact
import * as util from '../common';
import * as Telemetry from '../telemetry';
import * as nls from 'vscode-nls';
import { cppBuildTaskProvider } from '../LanguageServer/extension';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
Expand Down Expand Up @@ -88,11 +89,11 @@ export function initialize(context: vscode.ExtensionContext): void {
if (selection.configuration.preLaunchTask) {
if (folder) {
try {
await util.ensureBuildTaskExists(selection.configuration.preLaunchTask);
await cppBuildTaskProvider.ensureBuildTaskExists(selection.configuration.preLaunchTask);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "false" });
} catch (e) {
if (e && e.message === util.failedToParseTasksJson) {
vscode.window.showErrorMessage(util.failedToParseTasksJson);
if (e && e.message === util.failedToParseJson) {
vscode.window.showErrorMessage(util.failedToParseJson);
}
return Promise.resolve();
}
Expand All @@ -108,7 +109,7 @@ export function initialize(context: vscode.ExtensionContext): void {

// Attempt to use the user's (possibly) modified configuration before using the generated one.
try {
await util.ensureDebugConfigExists(selection.configuration.name);
await cppBuildTaskProvider.ensureDebugConfigExists(selection.configuration.name);
try {
await vscode.debug.startDebugging(folder, selection.configuration.name);
Telemetry.logDebuggerEvent("buildAndDebug", { "success": "true" });
Expand Down
3 changes: 2 additions & 1 deletion Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import * as os from 'os';
import escapeStringRegExp = require('escape-string-regexp');
import * as jsonc from 'comment-json';
import * as nls from 'vscode-nls';
import which = require('which');
import { setTimeout } from 'timers';
import * as which from 'which';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
Expand Down
Loading