* Localization support end to end plus a few instances of strings. More strings to be reviewed and localized later.

* Temporary add 'localization' branch besides 'main' in translation script, hoping to help with running the pipeline on the 'localization' branch.

* Add missing quote

* Add missing package.nls.json

* Address first round of PR feedback.

* More PR feedback

* Change suggested by crsuzuki for loc work item 541630

* Avoid adding a new line ourselves for each chunk of text coming into stdout/stderr

* More localization in package.json and add one dependency reported by the locBuild pipeline.

* Quick baseline update

* More dependencies requested by locBuild pipeline

* Try one more small baseline update

* Avoid appending even an empty string when in test mode.

* One more baseline update required by the latest change

* One more baseline update required by the latest change

* Update windows baseline as well since latest change doesn't impact only linux

* Localize settings description strings. Move various punctuation inside the substitution strings.

* Remove localization branch reference from script since we're merging all localization functionality into main
This commit is contained in:
Andreea Isac 2022-01-26 12:57:02 -08:00 коммит произвёл GitHub
Родитель 06376f154d
Коммит 9e1f4d7a73
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
94 изменённых файлов: 2245 добавлений и 688 удалений

17
.gitignore поставляемый
Просмотреть файл

@ -1,5 +1,12 @@
out
node_modules
.vscode-test/
*.log
*.vsix
out
node_modules
.vscode-test/
*.log
*.vsix
vscode-extensions-localization-export/
vscode-translations-import/
jobs/loc/LCL
OneLocBuild
**/nls.*.json
**/*.nls.json
**/package.nls.*.json

Просмотреть файл

@ -1,19 +1,30 @@
# Files/Folders to ignore when packaging the extension
# ignore vscode settings for extension development
.vscode/**
# ignore GitHub actions
.github/**
# ignore source files
src/**
out/src/test/**
# ignore development files
.gitignore
.vscodeignore
tsconfig.json
tslint.json
*.log
*.vsix
# Files/Folders to ignore when packaging the extension
# ignore vscode settings for extension development
.vscode/**
# ignore GitHub actions
.github/**
# ignore source files
src/**
out/src/test/**
# ignore development files
.gitignore
.vscodeignore
tsconfig.json
tslint.json
*.log
*.vsix
translations_auto_pr.js
gulpfile.js
vscode-extensions-localization-export/
vscode-translations-import/
i18n/
jobs/
build/
docs/
node_modules/
out/
scripts/

Просмотреть файл

@ -1,32 +1,46 @@
# How to Contribute Changes
## Contribution Steps
* Clone the repository: git clone https://github.com/microsoft/vscode-makefile-tools.git.
* Install [node](https://nodejs.org) and [yarn](https://yarnpkg.com).
* Run the following commands, in a terminal, from the Makefile Tools extension code base root folder:
* `yarn install` will install the dependencies needed to build the extension.
* **(optional)** `yarn global add vsce` will install `vsce` globally to create a VSIX package that you can install.
* To compile source changes, run from terminal: 'yarn compile'.
* This is also done automatically by VSCode when requesting to debug the extension via F5.
* Localize strings: to be implemented.
* To build a vsix with your changes, run from terminal: 'vsce package'.
* File an [issue](https://github.com/microsoft/vscode-makefile-tools/issues) and a [pull request](https://github.com/microsoft/vscode-makefile-tools/pulls) with the change and we will review it.
* If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](CHANGELOG.md).
* Adding and running tests: infrastructure to be finalized.
## About the Code
* [**configuration.ts**](src/configuration.ts) read/update/process settings.
* [**cpptools.ts**](src/cpptools.ts) integration with CppTools VSCode extension.
* [**extension.ts**](src/extension.ts) extension activation, commands, functionality entry-points.
* [**launch.ts**](src/launch.ts) debugging and running in terminal.
* [**logger.ts**](src/logger.ts) logging.
* [**make.ts**](src/make.ts) make invocations for various features: building, (pre)configuring.
* [**parser.ts**](src/parser.ts) regular expressions and parsing functionality.
* [**state.ts**](src/state.ts) reading/setting state variables.
* [**telemetry.ts**](src/telemetry.ts) telemetry functionality.
* [**tree.ts**](src/tree.ts) tree UI for the Makefile Tools side panel.
* [**ui.ts**](src/ui.ts) deprecated support for status bar buttons.
* [**util.ts**](src/util.ts) various util helpers for file system operations, paths/strings processing, threads management.
# How to Contribute Changes
## Contribution Steps
* Clone the repository: git clone https://github.com/microsoft/vscode-makefile-tools.git.
* Install [node](https://nodejs.org) and [yarn](https://yarnpkg.com).
* Run the following commands, in a terminal, from the Makefile Tools extension code base root folder:
* `yarn install` will install the dependencies needed to build the extension.
* **(optional)** `yarn global add vsce` will install `vsce` globally to create a VSIX package that you can install.
* To compile source changes, run from terminal: 'yarn compile'.
* This is also done automatically by VSCode when requesting to debug the extension via F5.
* To build a vsix with your changes, run from terminal: 'vsce package'.
* File an [issue](https://github.com/microsoft/vscode-makefile-tools/issues) and a [pull request](https://github.com/microsoft/vscode-makefile-tools/pulls) with the change and we will review it.
* If the change affects functionality, add a line describing the change to [**CHANGELOG.md**](CHANGELOG.md).
* Adding and running tests: infrastructure to be finalized.
## String Localization
* [vscode-nls](https://github.com/microsoft/vscode-nls) is used to localize strings in TypeScript code. To use [vscode-nls](https://github.com/microsoft/vscode-nls), the source file must contain:
```typescript
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
```
* For each user-facing string, wrap the string in a call to localize:
```typescript
const readmeMessage: string = localize("refer.read.me", "Please refer to {0} for troubleshooting information. Issues can be created at {1}", readmePath, "https://github.com/Microsoft/vscode-makefile-tools/issues");
```
* The first parameter to localize should be a unique key for that string, not used by any other call to localize() in the file unless representing the same string. The second parameter is the string to localize. Both of these parameters must be string literals. Tokens such as {0} and {1} are supported in the localizable string, with replacement values passed as additional parameters to localize().
## About the Code
* [**configuration.ts**](src/configuration.ts) read/update/process settings.
* [**cpptools.ts**](src/cpptools.ts) integration with CppTools VSCode extension.
* [**extension.ts**](src/extension.ts) extension activation, commands, functionality entry-points.
* [**launch.ts**](src/launch.ts) debugging and running in terminal.
* [**logger.ts**](src/logger.ts) logging.
* [**make.ts**](src/make.ts) make invocations for various features: building, (pre)configuring.
* [**parser.ts**](src/parser.ts) regular expressions and parsing functionality.
* [**state.ts**](src/state.ts) reading/setting state variables.
* [**telemetry.ts**](src/telemetry.ts) telemetry functionality.
* [**tree.ts**](src/tree.ts) tree UI for the Makefile Tools side panel.
* [**ui.ts**](src/ui.ts) deprecated support for status bar buttons.
* [**util.ts**](src/util.ts) various util helpers for file system operations, paths/strings processing, threads management.

306
gulpfile.js Normal file
Просмотреть файл

@ -0,0 +1,306 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const fs = require('fs');
const nls = require('vscode-nls-dev');
const path = require('path');
const minimist = require('minimist');
const es = require('event-stream');
const sourcemaps = require('gulp-sourcemaps');
const ts = require('gulp-typescript');
const typescript = require('typescript');
const tsProject = ts.createProject('./tsconfig.json', { typescript });
const filter = require('gulp-filter');
const vinyl = require('vinyl');
const jsonc = require('jsonc-parser');
// Patterns to find schema files
const jsonSchemaFilesPatterns = [
"*/*-schema.json"
];
const languages = [
{ id: "zh-TW", folderName: "cht", transifexId: "zh-hant" },
{ id: "zh-CN", folderName: "chs", transifexId: "zh-hans" },
{ id: "fr", folderName: "fra" },
{ id: "de", folderName: "deu" },
{ id: "it", folderName: "ita" },
{ id: "es", folderName: "esn" },
{ id: "ja", folderName: "jpn" },
{ id: "ko", folderName: "kor" },
{ id: "ru", folderName: "rus" },
//{ id: "bg", folderName: "bul" }, // VS Code supports Bulgarian, but loc team is not currently generating it
//{ id: "hu", folderName: "hun" }, // VS Code supports Hungarian, but loc team is not currently generating it
{ id: "pt-br", folderName: "ptb", transifexId: "pt-BR" },
{ id: "tr", folderName: "trk" },
{ id: "cs", folderName: "csy" },
{ id: "pl", folderName: "plk" }
];
// ****************************
// Command: translations-export
// The following is used to export and XLF file containing english strings for translations.
// The result will be written to: ./vscode-extensions-localization-export/ms-vscode/
// ****************************
const translationProjectName = "vscode-extensions";
const translationExtensionName = "vscode-makefile-tools";
function removePathPrefix(path, prefix) {
if (!prefix) {
return path;
}
if (!path.startsWith(prefix)) {
return path;
}
if (path === prefix) {
return "";
}
let ch = prefix.charAt(prefix.length - 1);
if (ch === '/' || ch === '\\') {
return path.substr(prefix.length);
}
ch = path.charAt(prefix.length);
if (ch === '/' || ch === '\\') {
return path.substr(prefix.length + 1);
}
return path;
}
// descriptionCallback(path, value, parent) is invoked for attribtues
const traverseJson = (jsonTree, descriptionCallback, prefixPath) => {
for (let fieldName in jsonTree) {
if (jsonTree[fieldName] !== null) {
if (typeof(jsonTree[fieldName]) == "string" && fieldName === "description") {
descriptionCallback(prefixPath, jsonTree[fieldName], jsonTree);
} else if (typeof(jsonTree[fieldName]) == "object") {
let path = prefixPath;
if (path !== "")
path = path + ".";
path = path + fieldName;
traverseJson(jsonTree[fieldName], descriptionCallback, path);
}
}
}
};
// Traverses schema json files looking for "description" fields to localized.
// The path to the "description" field is used to create a localization key.
const processJsonSchemaFiles = () => {
return es.through(function (file) {
let jsonTree = JSON.parse(file.contents.toString());
let localizationJsonContents = {};
let filePath = removePathPrefix(file.path, file.cwd);
filePath = filePath.replace(/\\/g, '/')
let localizationMetadataContents = {
messages: [],
keys: [],
filePath: filePath
};
let descriptionCallback = (path, value, parent) => {
let locId = filePath + "." + path;
localizationJsonContents[locId] = value;
localizationMetadataContents.keys.push(locId);
localizationMetadataContents.messages.push(value);
};
traverseJson(jsonTree, descriptionCallback, "");
this.queue(new vinyl({
path: path.join(file.path + '.nls.json'),
contents: Buffer.from(JSON.stringify(localizationJsonContents, null, '\t'), 'utf8')
}));
this.queue(new vinyl({
path: path.join(file.path + '.nls.metadata.json'),
contents: Buffer.from(JSON.stringify(localizationMetadataContents, null, '\t'), 'utf8')
}));
});
};
gulp.task("translations-export", (done) => {
// Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize.
let jsStream = tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject()).js
.pipe(nls.createMetaDataFiles());
// Scan schema files
let jsonSchemaStream = gulp.src(jsonSchemaFilesPatterns)
.pipe(processJsonSchemaFiles());
// Merge files from all source streams
es.merge(jsStream, jsonSchemaStream)
// Filter down to only the files we need
.pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json']))
// Consoldate them into nls.metadata.json, which the xlf is built from.
.pipe(nls.bundleMetaDataFiles('ms-vscode.makefile-tools', '.'))
// filter down to just the resulting metadata files
.pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json']))
// Add package.nls.json, used to localized package.json
.pipe(gulp.src(["package.nls.json"]))
// package.nls.json and nls.metadata.json are used to generate the xlf file
// Does not re-queue any files to the stream. Outputs only the XLF file
.pipe(nls.createXlfFiles(translationProjectName, translationExtensionName))
.pipe(gulp.dest(path.join(`${translationProjectName}-localization-export`)))
.pipe(es.wait(() => {
done();
}));
});
// ****************************
// Command: translations-import
// The following is used to import an XLF file containing all language strings.
// This results in a i18n directory, which should be checked in.
// ****************************
// Imports translations from raw localized MLCP strings to VS Code .i18n.json files
gulp.task("translations-import", (done) => {
let options = minimist(process.argv.slice(2), {
string: "location",
default: {
location: "./vscode-translations-import"
}
});
es.merge(languages.map((language) => {
let id = language.transifexId || language.id;
return gulp.src(path.join(options.location, id, translationProjectName, `${translationExtensionName}.xlf`))
.pipe(nls.prepareJsonFiles())
.pipe(gulp.dest(path.join("./i18n", language.folderName)));
}))
.pipe(es.wait(() => {
done();
}));
});
// ****************************
// Command: translations-generate
// The following is used to import an i18n directory structure and generate files used at runtime.
// ****************************
// Generate package.nls.*.json files from: ./i18n/*/package.i18n.json
// Outputs to root path, as these nls files need to be along side package.json
const generatedAdditionalLocFiles = () => {
return gulp.src(['package.nls.json'])
.pipe(nls.createAdditionalLanguageFiles(languages, 'i18n'))
.pipe(gulp.dest('.'));
};
// Generates ./dist/nls.bundle.<language_id>.json from files in ./i18n/** *//<src_path>/<filename>.i18n.json
// Localized strings are read from these files at runtime.
const generatedSrcLocBundle = () => {
// Transpile the TS to JS, and let vscode-nls-dev scan the files for calls to localize.
return tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject()).js
.pipe(nls.createMetaDataFiles())
.pipe(nls.createAdditionalLanguageFiles(languages, "i18n"))
.pipe(nls.bundleMetaDataFiles('ms-vscode.makefile-tools', 'dist'))
.pipe(nls.bundleLanguageFiles())
.pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json']))
.pipe(gulp.dest('dist'));
};
const generateLocalizedJsonSchemaFiles = () => {
return es.through(function (file) {
let jsonTree = JSON.parse(file.contents.toString());
languages.map((language) => {
let stringTable = {};
// Try to open i18n file for this file
let relativePath = removePathPrefix(file.path, file.cwd);
let locFile = path.join("./i18n", language.folderName, relativePath + ".i18n.json");
if (fs.existsSync(locFile)) {
stringTable = jsonc.parse(fs.readFileSync(locFile).toString());
}
// Entire file is scanned and modified, then serialized for that language.
// Even if no translations are available, we still write new files to dist/schema/...
let keyPrefix = relativePath + ".";
keyPrefix = keyPrefix.replace(/\\/g, "/");
let descriptionCallback = (path, value, parent) => {
if (stringTable[keyPrefix + path]) {
parent.description = stringTable[keyPrefix + path];
}
};
traverseJson(jsonTree, descriptionCallback, "");
let newContent = JSON.stringify(jsonTree, null, '\t');
this.queue(new vinyl({
path: path.join("schema", language.id, relativePath),
contents: Buffer.from(newContent, 'utf8')
}));
});
});
};
// Generate localized versions of JSON schema files
// Check for cooresponding localized json file in i18n
// Generate new version of the JSON schema file in dist/schema/<language_id>/<path>
const generateJsonSchemaLoc = () => {
return gulp.src(jsonSchemaFilesPatterns)
.pipe(generateLocalizedJsonSchemaFiles())
.pipe(gulp.dest('dist'));
};
gulp.task('translations-generate', gulp.series(generatedSrcLocBundle, generatedAdditionalLocFiles, generateJsonSchemaLoc));
const allTypeScript = [
'src/**/*.ts',
'test/**/*.ts',
'!**/*.d.ts',
'!**/typings**'
];
// Prints file path and line number in the same line. Easier to ctrl + left click in VS Code.
const lintReporter = results => {
const messages = [];
let errorCount = 0;
let warningCount = 0;
let fixableErrorCount = 0;
let fixableWarningCount = 0;
results.forEach(result => {
if (result.errorCount || result.warningCount) {
const filePath = result.filePath.replace(/\\/g, '/');
errorCount += result.errorCount;
warningCount += result.warningCount;
fixableErrorCount += result.fixableErrorCount;
fixableWarningCount += result.fixableWarningCount;
result.messages.forEach(message => {
messages.push(`[lint] ${filePath}:${message.line}:${message.column}: ${message.message} [${message.ruleId}]`);
});
messages.push('');
}
});
if (errorCount || warningCount) {
messages.push('\x1b[31m' + ` ${errorCount + warningCount} Problems (${errorCount} Errors, ${warningCount} Warnings)` + '\x1b[39m');
messages.push('\x1b[31m' + ` ${fixableErrorCount} Errors, ${fixableWarningCount} Warnings potentially fixable with \`--fix\` option.` + '\x1b[39m');
messages.push('', '');
}
return messages.join('\n');
};
gulp.task('lint', function () {
// Un-comment these parts for applying auto-fix.
return gulp.src(allTypeScript)
.pipe(eslint({ configFile: ".eslintrc.js" /*, fix: true */}))
.pipe(eslint.format(lintReporter, process.stderr))
//.pipe(gulp.dest(file => file.base))
.pipe(eslint.failAfterError());
});

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool"
}

Просмотреть файл

@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"make.not.found": "{0} not found",
"makefile.entry.point.not.found": "{0} entry point not found"
}

Просмотреть файл

@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"extension.deactivated": "The extension 'vscode-makefile-tools' is de-activated."
}

Просмотреть файл

@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"yes": "Yes",
"no": "No",
"build.failed.continue.anyway": "Build failed. Do you want to continue anyway?",
"cannot.op.no.launch.config.targets": "Cannot '{0}' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
"cannot.op.choose.launch.config": "Cannot '{0}' because there is no launch configuration set. Choose one from the quick pick.",
"cannot.op.without.launch.config": "Cannot '{0}' until you select an active launch configuration."
}

Просмотреть файл

@ -0,0 +1,11 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"Yes": "Yes",
"No": "No",
"project.configuring.background.op.may.run.on.out.of.date.input": "The project is configuring in the background and {0} may run on out-of-date input.",
"cannot.op.because.project.already.doing": "Cannot '{0}' because the project is already doing a '{1}'."
}

Просмотреть файл

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"tree.build.target": "Build target: [{0}]",
"tree.launch.target": "Launch target: [{0}]",
"tree.configuration": "Configuration: [{0}]",
"Unset": "Unset",
"makefile.target.currently.selected.for.build": "The makefile target currently selected for build.",
"issue.rendering.item": "There was an issue rendering this item",
"launch.target.currently.selected.for.debug.run.in.terminal": "The launch target currently selected for debug and run in terminal"
}

14
jobs/loc/LocProject.json Normal file
Просмотреть файл

@ -0,0 +1,14 @@
{
"Projects": [
{
"LanguangeSet": "VS_Main_Languages",
"LocItems": [
{
"SourceFile": "vscode-extensions-localization-export\\vscode-extensions\\vscode-makefile-tools.xlf",
"Languages": "cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant",
"LclFile": "jobs\\loc\\LCL\\{Lang}\\vscode-makefile-tools.xlf.lcl"
}
]
}
]
}

Просмотреть файл

@ -0,0 +1,54 @@
# ==================================================================================
# Pipeline for VsCodeExtension-Localization build definition
# Runs OneLocBuild task to localize xlf file
# ==================================================================================
resources:
repositories:
- repository: self
clean: true
trigger: none
pr: none
schedules:
- cron: "0 7 * * *"
displayName: Daily 7 AM
branches:
include:
- main
always: true
pool:
vmImage: 'windows-latest'
steps:
- task: CmdLine@2
inputs:
script: 'yarn install'
- task: CmdLine@2
inputs:
script: 'yarn run translations-export'
- task: OneLocBuild@2
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
locProj: 'jobs/loc/LocProject.json'
outDir: '$(Build.ArtifactStagingDirectory)'
isCreatePrSelected: false
prSourceBranchPrefix: 'locfiles'
packageSourceAuth: 'patAuth'
patVariable: '$(OneLocBuildPat)'
LclSource: lclFilesInRepo
lsBuildXLocPackageVersion: '7.0.30510'
- task: CmdLine@2
inputs:
script: 'node ./translations_auto_pr.js microsoft vscode-makefile-tools csigs $(csigsPat) csigs csigs@users.noreply.github.com "$(Build.ArtifactStagingDirectory)/loc" vscode-extensions-localization-export/vscode-extensions'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

Просмотреть файл

@ -77,55 +77,55 @@
"commands": [
{
"command": "makefile.buildTarget",
"title": "Makefile: Build the current target"
"title": "%makefile-tools.command.makefile.buildTarget.title%"
},
{
"command": "makefile.buildCleanTarget",
"title": "Makefile: Build clean the current target"
"title": "%makefile-tools.command.makefile.buildCleanTarget.title%"
},
{
"command": "makefile.buildAll",
"title": "Makefile: Build the target ALL"
"title": "%makefile-tools.command.makefile.buildAll.title%"
},
{
"command": "makefile.buildCleanAll",
"title": "Makefile: Build clean the target ALL"
"title": "%makefile-tools.command.makefile.buildCleanAll.title%"
},
{
"command": "makefile.launchDebug",
"title": "Makefile: Debug the selected binary target"
"title": "%makefile-tools.command.makefile.launchDebug.title%"
},
{
"command": "makefile.launchRun",
"title": "Makefile: Run the selected binary target in the terminal"
"title": "%makefile-tools.command.makefile.launchRun.title%"
},
{
"command": "makefile.setBuildConfiguration",
"title": "Makefile: Set the current build configuration"
"title": "%makefile-tools.command.makefile.setBuildConfiguration.title%"
},
{
"command": "makefile.setBuildTarget",
"title": "Makefile: Set the target to be built by make"
"title": "%makefile-tools.command.makefile.setBuildTarget.title%"
},
{
"command": "makefile.setLaunchConfiguration",
"title": "Makefile: Set the make launch configuration"
"title": "%makefile-tools.command.makefile.setLaunchConfiguration.title%"
},
{
"command": "makefile.configure",
"title": "Makefile: Configure"
"title": "%makefile-tools.command.makefile.configure.title%"
},
{
"command": "makefile.cleanConfigure",
"title": "Makefile: Clean configure"
"title": "%makefile-tools.command.makefile.cleanConfigure.title%"
},
{
"command": "makefile.preConfigure",
"title": "Makefile: Pre-Configure"
"title": "%makefile-tools.command.makefile.preConfigure.title%"
},
{
"command": "makefile.outline.buildTarget",
"title": "Build",
"title": "%makefile-tools.command.makefile.buildTarget.title%",
"icon": {
"light": "res/light/build.svg",
"dark": "res/dark/build.svg"
@ -133,11 +133,11 @@
},
{
"command": "makefile.outline.buildCleanTarget",
"title": "Build clean"
"title": "%makefile-tools.command.makefile.buildCleanTarget.title%"
},
{
"command": "makefile.outline.launchDebug",
"title": "Debug",
"title": "%makefile-tools.command.makefile.launchDebug.title%",
"icon": {
"light": "res/light/debug.svg",
"dark": "res/dark/debug.svg"
@ -145,7 +145,7 @@
},
{
"command": "makefile.outline.launchRun",
"title": "Run in terminal",
"title": "%makefile-tools.command.makefile.launchRun.title%",
"icon": {
"light": "res/light/run.svg",
"dark": "res/dark/run.svg"
@ -153,7 +153,7 @@
},
{
"command": "makefile.outline.setBuildConfiguration",
"title": "Change build configuration",
"title": "%makefile-tools.command.makefile.setBuildConfiguration.title%",
"icon": {
"light": "res/light/edit.svg",
"dark": "res/dark/edit.svg"
@ -161,7 +161,7 @@
},
{
"command": "makefile.outline.setBuildTarget",
"title": "Change build target",
"title": "%makefile-tools.command.makefile.setBuildTarget.title%",
"icon": {
"light": "res/light/edit.svg",
"dark": "res/dark/edit.svg"
@ -169,7 +169,7 @@
},
{
"command": "makefile.outline.setLaunchConfiguration",
"title": "Change launch configuration",
"title": "%makefile-tools.command.makefile.setLaunchConfiguration.title%",
"icon": {
"light": "res/light/edit.svg",
"dark": "res/dark/edit.svg"
@ -177,7 +177,7 @@
},
{
"command": "makefile.outline.configure",
"title": "Configure",
"title": "%makefile-tools.command.makefile.configure.title%",
"icon": {
"light": "res/light/configure.svg",
"dark": "res/dark/configure.svg"
@ -185,15 +185,15 @@
},
{
"command": "makefile.outline.cleanConfigure",
"title": "Clean configure"
"title": "%makefile-tools.command.makefile.cleanConfigure.title%"
},
{
"command": "makefile.outline.preConfigure",
"title": "Pre-Configure"
"title": "%makefile-tools.command.makefile.preConfigure.title%"
},
{
"command": "makefile.resetState",
"title": "Makefile: Reset the Makefile Tools Extension workspace state (For troubleshooting)"
"title": "%makefile-tools.command.makefile.resetState.title%"
}
],
"problemMatchers": [
@ -232,30 +232,30 @@
"makefile.configurations": {
"type": "array",
"default": [],
"description": "The user defined makefile configurations",
"description": "%makefile-tools.configuration.makefile.configurations.description%",
"items": {
"type": "object",
"default": null,
"properties": {
"name": {
"type": "string",
"description": "The name of the makefile configuration"
"description": "%makefile-tools.configuration.makefile.configurations.name.description%"
},
"makefilePath": {
"type": "string",
"description": "File path to the makefile"
"description": "%makefile-tools.configuration.makefile.configurations.makefilePath.description%"
},
"makePath": {
"type": "string",
"description": "File path to the make command"
"description": "%makefile-tools.configuration.makefile.configurations.makePath.description%"
},
"makeDirectory": {
"type": "string",
"description": "Folder path passed to make via the -C switch"
"description": "%makefile-tools.configuration.makefile.configurations.makeDirectory.description%"
},
"makeArgs": {
"type": "array",
"description": "Arguments to pass to the make command",
"description": "%makefile-tools.configuration.makefile.configurations.makeArgs.description%",
"items": {
"type": "string"
},
@ -267,11 +267,11 @@
"type": "string"
},
"default": ["$gcc", "$msvc"],
"description": "Problem matcher names to use when building the current target"
"description": "%makefile-tools.configuration.makefile.configurations.problemMatchers.description%"
},
"buildLog": {
"type": "string",
"description": "File path to the build log used instead of dry-run output"
"description": "%makefile-tools.configuration.makefile.configurations.buildLog.description%"
}
}
},
@ -280,11 +280,11 @@
"makefile.defaultLaunchConfiguration": {
"type": "object",
"default": null,
"description": "Various global debugger settings",
"description": "%makefile-tools.configuration.makefile.defaultLaunchConfiguration.description%",
"properties": {
"MIMode": {
"type": "string",
"description": "The non VS debugger type: gdb or lldb",
"description": "%makefile-tools.configuration.makefile.defaultLaunchConfiguration.MIMode.description%",
"enum": [
"gdb",
"lldb"
@ -292,16 +292,16 @@
},
"miDebuggerPath": {
"type": "string",
"description": "Path to the non VS debugger (gdb or lldb)"
"description": "%makefile-tools.configuration.makefile.defaultLaunchConfiguration.miDebuggerPath.description%"
},
"stopAtEntry": {
"type": "boolean",
"description": "Stop at the entry point of the target",
"description": "%makefile-tools.configuration.makefile.defaultLaunchConfiguration.stopAtEntry.description%",
"default": false
},
"symbolSearchPath": {
"type": "string",
"description": "The path to the symbols"
"description": "%makefile-tools.configuration.makefile.defaultLaunchConfiguration.symbolSearchPath.description%"
}
},
"scope": "resource"
@ -309,18 +309,18 @@
"makefile.launchConfigurations": {
"type": "array",
"default": [],
"description": "The user defined launch (debug/run) configurations",
"description": "%makefile-tools.configuration.makefile.launchConfigurations.description%",
"items": {
"type": "object",
"default": null,
"properties": {
"binaryPath": {
"type": "string",
"description": "The full path to the binary to run or debug"
"description": "%makefile-tools.configuration.makefile.launchConfigurations.binaryPath.description%"
},
"binaryArgs": {
"type": "array",
"description": "Arguments to pass to program command line",
"description": "%makefile-tools.configuration.makefile.launchConfigurations.binaryArgs.description%",
"items": {
"type": "string"
},
@ -328,11 +328,11 @@
},
"cwd": {
"type": "string",
"description": "Set the working directory for the program"
"description": "%makefile-tools.configuration.makefile.launchConfigurations.cwd.description%"
},
"MIMode": {
"type": "string",
"description": "The non VS debugger type: gdb or lldb",
"description": "%makefile-tools.configuration.makefile.launchConfigurations.MIMode.description%",
"enum": [
"gdb",
"lldb"
@ -340,16 +340,16 @@
},
"miDebuggerPath": {
"type": "string",
"description": "Path to the non VS debugger (gdb or lldb)"
"description": "%makefile-tools.configuration.makefile.launchConfigurations.miDebuggerPath.description%"
},
"stopAtEntry": {
"type": "boolean",
"description": "Stop at the entry point of the target",
"description": "%makefile-tools.configuration.makefile.launchConfigurations.stopAtEntry.description%",
"default": false
},
"symbolSearchPath": {
"type": "string",
"description": "The path to the symbols"
"description": "%makefile-tools.configuration.makefile.launchConfigurations.symbolSearchPath.description%"
}
}
},
@ -363,46 +363,46 @@
"Debug"
],
"default": "Normal",
"description": "The logging level for the makefile tools extension",
"description": "%makefile-tools.configuration.makefile.loggingLevel.description%",
"scope": "resource"
},
"makefile.makePath": {
"type": "string",
"default": "make",
"description": "The path to the make tool",
"description": "%makefile-tools.configuration.makefile.makePath.description%",
"scope": "resource"
},
"makefile.makeDirectory": {
"type": "string",
"description": "The folder path to be passed to make via the switch -C",
"description": "%makefile-tools.configuration.makefile.makeDirectory.description%",
"scope": "resource"
},
"makefile.makefilePath": {
"type": "string",
"description": "The path to the makefile of the project",
"description": "%makefile-tools.configuration.makefile.makefilePath.description%",
"scope": "resource"
},
"makefile.buildLog": {
"type": "string",
"description": "The path to the build log that is read to bypass a dry-run",
"description": "%makefile-tools.configuration.makefile.buildLog.description%",
"default": null,
"scope": "resource"
},
"makefile.extensionOutputFolder": {
"type": "string",
"description": "The path to various output files produced by the extension",
"description": "%makefile-tools.configuration.makefile.extensionOutputFolder.description%",
"default": "./.vscode",
"scope": "resource"
},
"makefile.extensionLog": {
"type": "string",
"description": "The path to an output file storing all content from the Makefile output channel",
"description": "%makefile-tools.configuration.makefile.extensionLog.description%",
"default": null,
"scope": "resource"
},
"makefile.configurationCachePath": {
"type": "string",
"description": "The path to a cache file storing the output of the last dry-run make command",
"description": "%makefile-tools.configuration.makefile.configurationCachePath.description%",
"default": ".vscode/configurationCache.log",
"scope": "resource"
},
@ -413,7 +413,7 @@
"--keep-going",
"--print-directory"
],
"description": "Arguments to pass to the dry-run make invocation",
"description": "%makefile-tools.configuration.makefile.dryrunSwitches.description%",
"items": {
"type": "string"
},
@ -422,7 +422,7 @@
"makefile.additionalCompilerNames": {
"type": "array",
"default": [],
"description": "Names of compiler tools to be added to the extension known list",
"description": "%makefile-tools.configuration.makefile.additionalCompilerNames.description%",
"items": {
"type": "string"
},
@ -431,7 +431,7 @@
"makefile.excludeCompilerNames": {
"type": "array",
"default": [],
"description": "Names of compiler tools to be excluded from the extension known list",
"description": "%makefile-tools.configuration.makefile.excludeCompilerNames.description%",
"items": {
"type": "string"
},
@ -440,67 +440,67 @@
"makefile.configureOnOpen": {
"type": "boolean",
"default": true,
"description": "Automatically configure Makefile project directories when they are opened",
"description": "%makefile-tools.configuration.makefile.configureOnOpen.description%",
"scope": "resource"
},
"makefile.configureOnEdit": {
"type": "boolean",
"default": true,
"description": "Automatically configure Makefile project directories when any relevant makefiles and/or settings are changed",
"description": "%makefile-tools.configuration.makefile.configureOnEdit.description%",
"scope": "resource"
},
"makefile.configureAfterCommand": {
"type": "boolean",
"default": true,
"description": "Automatically configure Makefile project directories after relevant operations, like change build configuration or makefile target",
"description": "%makefile-tools.configuration.makefile.configureAfterCommand.description%",
"scope": "resource"
},
"makefile.preConfigureScript": {
"type": "string",
"description": "The path to the script that needs to be run at least once before configure",
"description": "%makefile-tools.configuration.makefile.preConfigureScript.description%",
"default": null,
"scope": "resource"
},
"makefile.alwaysPreConfigure": {
"type": "boolean",
"description": "Always run the pre-configure script before configure",
"description": "%makefile-tools.configuration.makefile.alwaysPreConfigure.description%",
"default": false,
"scope": "resource"
},
"makefile.ignoreDirectoryCommands": {
"type": "boolean",
"description": "Don't analyze directory changing commands like cd, push, pop.",
"description": "%makefile-tools.configuration.makefile.ignoreDirectoryCommands.description%",
"default": true,
"scope": "resource"
},
"makefile.phonyOnlyTargets": {
"type": "boolean",
"default": false,
"description": "Display only the phony targets",
"description": "%makefile-tools.configuration.makefile.phonyOnlyTargets.description%",
"scope": "resource"
},
"makefile.saveBeforeBuildOrConfigure": {
"type": "boolean",
"default": true,
"description": "Save opened files before building or configuring",
"description": "%makefile-tools.configuration.makefile.saveBeforeBuildOrConfigure.description%",
"scope": "resource"
},
"makefile.buildBeforeLaunch": {
"type": "boolean",
"default": true,
"description": "Build the current target before launch (debug/run)",
"description": "%makefile-tools.configuration.makefile.buildBeforeLaunch.description%",
"scope": "resource"
},
"makefile.clearOutputBeforeBuild": {
"type": "boolean",
"default": true,
"description": "Clear the output channel at the beginning of a build",
"description": "%makefile-tools.configuration.makefile.clearOutputBeforeBuild.description%",
"scope": "resource"
},
"makefile.compileCommandsPath": {
"type": "string",
"default": null,
"description": "The path to the compilation database file",
"description": "%makefile-tools.configuration.makefile.compileCommandsPath.description%",
"scope": "resource"
}
}
@ -520,7 +520,7 @@
{
"id": "makefile.outline",
"when": "makefile:fullFeatureSet",
"name": ""
"name": "%makefile-tools.configuration.views.makefile.outline.description.description%"
}
]
},
@ -688,6 +688,10 @@
"scripts": {
"vscode:prepublish": "yarn compile",
"compile": "yarn install && tsc -p ./",
"compile-production": "yarn install && yarn run translations-generate && yarn run compile",
"translations-export": "gulp translations-export",
"translations-generate": "gulp translations-generate",
"translations-import": "gulp translations-import",
"watch": "tsc -watch -p ./",
"package": "vsce package --yarn -o makefile-tools.vsix",
"pretest": "yarn compile",
@ -709,6 +713,17 @@
"vsce": "^1.95.0",
"vrsource-tslint-rules": "^6.0.0",
"vscode": "^1.1.36",
"vscode-nls-dev": "^3.3.2",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-filter": "^6.0.0",
"gulp-mocha": "^8.0.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-typescript": "^5.0.1",
"fs-extra": "^9.1.0",
"@octokit/rest": "^18.1.1",
"parse-git-config": "^3.0.0",
"jsonc-parser": "^3.0.0",
"vscode-test": "^0.4.1"
},
"dependencies": {
@ -716,6 +731,7 @@
"glob": "^7.1.6",
"module-alias": "^2.2.2",
"vscode-cpptools": "^5.0.0",
"vscode-nls": "^5.0.0",
"vscode-extension-telemetry": "^0.1.2",
"vscode-jsonrpc": "^3.6.2"
},

59
package.nls.json Normal file
Просмотреть файл

@ -0,0 +1,59 @@
{
"makefile-tools.command.makefile.buildTarget.title": "Makefile: Build the current target",
"makefile-tools.command.makefile.buildCleanTarget.title": "Makefile: Build clean the current target",
"makefile-tools.command.makefile.buildAll.title": "Makefile: Build the target ALL",
"makefile-tools.command.makefile.buildCleanAll.title": "Makefile: Build clean the target ALL",
"makefile-tools.command.makefile.launchDebug.title": "Makefile: Debug the selected binary target",
"makefile-tools.command.makefile.launchRun.title": "Makefile: Run the selected binary target in the terminal",
"makefile-tools.command.makefile.setBuildConfiguration.title": "Makefile: Set the current build configuration",
"makefile-tools.command.makefile.setBuildTarget.title": "Makefile: Set the target to be built by make",
"makefile-tools.command.makefile.setLaunchConfiguration.title": "Makefile: Set the make launch configuration",
"makefile-tools.command.makefile.configure.title": "Makefile: Configure",
"makefile-tools.command.makefile.cleanConfigure.title": "Makefile: Clean Configure",
"makefile-tools.command.makefile.preConfigure.title": "Makefile: Pre-Configure",
"makefile-tools.command.makefile.resetState.title": "Makefile: Reset the Makefile Tools Extension workspace state (For troubleshooting)",
"makefile-tools.configuration.views.makefile.outline.description": "Project Outline",
"makefile-tools.configuration.makefile.makePath.description": "The path to the make tool",
"makefile-tools.configuration.makefile.configurations.description": "The user defined makefile configurations",
"makefile-tools.configuration.makefile.configurations.name.description": "The name of the makefile configuration",
"makefile-tools.configuration.makefile.configurations.makefilePath.description": "File path to the makefile",
"makefile-tools.configuration.makefile.configurations.makePath.description": "File path to the make command",
"makefile-tools.configuration.makefile.configurations.makeDirectory.description": "Folder path passed to make via the -C switch",
"makefile-tools.configuration.makefile.configurations.makeArgs.description": "Arguments to pass to the make command",
"makefile-tools.configuration.makefile.configurations.problemMatchers.description": "Problem matcher names to use when building the current target",
"makefile-tools.configuration.makefile.configurations.buildLog.description": "File path to the build log used instead of dry-run output",
"makefile-tools.configuration.makefile.defaultLaunchConfiguration.description": "Various global debugger settings",
"makefile-tools.configuration.makefile.defaultLaunchConfiguration.MIMode.description": "The non VS debugger type: gdb or lldb",
"makefile-tools.configuration.makefile.defaultLaunchConfiguration.miDebuggerPath.description": "Path to the non VS debugger (gdb or lldb)",
"makefile-tools.configuration.makefile.defaultLaunchConfiguration.stopAtEntry.description": "Stop at the entry point of the target",
"makefile-tools.configuration.makefile.defaultLaunchConfiguration.symbolSearchPath.description": "The path to the symbols",
"makefile-tools.configuration.makefile.launchConfigurations.description": "The user defined launch (debug/run) configurations",
"makefile-tools.configuration.makefile.launchConfigurations.binaryPath.description": "The full path to the binary to run or debug",
"makefile-tools.configuration.makefile.launchConfigurations.binaryArgs.description": "Arguments to pass to program command line",
"makefile-tools.configuration.makefile.launchConfigurations.cwd.description": "Set the working directory for the program",
"makefile-tools.configuration.makefile.launchConfigurations.MIMode.description": "The non VS debugger type: gdb or lldb",
"makefile-tools.configuration.makefile.launchConfigurations.miDebuggerPath.description": "Path to the non VS debugger (gdb or lldb)",
"makefile-tools.configuration.makefile.launchConfigurations.stopAtEntry.description": "Stop at the entry point of the target",
"makefile-tools.configuration.makefile.launchConfigurations.symbolSearchPath.description": "The path to the symbols",
"makefile-tools.configuration.makefile.loggingLevel.description": "The logging level for the makefile tools extension",
"makefile-tools.configuration.makefile.makeDirectory.description": "The folder path to be passed to make via the switch -C",
"makefile-tools.configuration.makefile.makefilePath.description": "The path to the makefile of the project",
"makefile-tools.configuration.makefile.buildLog.description": "The path to the build log that is read to bypass a dry-run",
"makefile-tools.configuration.makefile.extensionOutputFolder.description": "The path to various output files produced by the extension",
"makefile-tools.configuration.makefile.extensionLog.description": "The path to an output file storing all content from the Makefile output channel",
"makefile-tools.configuration.makefile.configurationCachePath.description": "The path to a cache file storing the output of the last dry-run make command",
"makefile-tools.configuration.makefile.dryrunSwitches.description": "Arguments to pass to the dry-run make invocation",
"makefile-tools.configuration.makefile.additionalCompilerNames.description": "Names of compiler tools to be added to the extension known list",
"makefile-tools.configuration.makefile.excludeCompilerNames.description": "Names of compiler tools to be excluded from the extension known list",
"makefile-tools.configuration.makefile.configureOnOpen.description": "Automatically configure Makefile project directories when they are opened",
"makefile-tools.configuration.makefile.configureOnEdit.description": "Automatically configure Makefile project directories when any relevant makefiles and/or settings are changed",
"makefile-tools.configuration.makefile.configureAfterCommand.description": "Automatically configure Makefile project directories after relevant operations, like change build configuration or makefile target",
"makefile-tools.configuration.makefile.preConfigureScript.description": "The path to the script that needs to be run at least once before configure",
"makefile-tools.configuration.makefile.alwaysPreConfigure.description": "Always run the pre-configure script before configure",
"makefile-tools.configuration.makefile.ignoreDirectoryCommands.description": "Don't analyze directory changing commands like cd, push, pop.",
"makefile-tools.configuration.makefile.phonyOnlyTargets.description": "Display only the phony targets",
"makefile-tools.configuration.makefile.saveBeforeBuildOrConfigure.description": "Save opened files before building or configuring",
"makefile-tools.configuration.makefile.buildBeforeLaunch.description": "Build the current target before launch (debug/run)",
"makefile-tools.configuration.makefile.clearOutputBeforeBuild.description": "Clear the output channel at the beginning of a build",
"makefile-tools.configuration.makefile.compileCommandsPath.description": "The path to the compilation database file"
}

Просмотреть файл

@ -12,6 +12,10 @@ import * as vscode from 'vscode';
import * as path from 'path';
import * as telemetry from './telemetry';
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
let statusBar: ui.UI = ui.getUI();
// Each different scenario of building the same makefile, in the same environment, represents a configuration.
@ -627,9 +631,10 @@ export function getCommandForConfiguration(configuration: string | undefined): v
// If configuration command has a path (absolute or relative), check if it exists on disk and error if not.
// If no path is given to the make tool, search all paths in the environment and error if make is not on the path.
const makeNotFoundStr: string = localize("make.not.found", "{0} not found.", "Make");
if (configurationCommandPath !== "") {
if (!util.checkFileExistsSync(configurationMakeCommand)) {
vscode.window.showErrorMessage("Make not found.");
vscode.window.showErrorMessage(makeNotFoundStr);
logger.message("Make was not found on disk at the location provided via makefile.makePath or makefile.configurations[].makePath.");
// How often location settings don't work (maybe because not yet expanding variables)?
@ -640,8 +645,8 @@ export function getCommandForConfiguration(configuration: string | undefined): v
}
} else {
if (!util.toolPathInEnv(path.parse(configurationMakeCommand).base)) {
vscode.window.showErrorMessage("Make not found.");
logger.message("Make was not given any path in settings and is also not found on the environment path.");
vscode.window.showErrorMessage(makeNotFoundStr);
logger.message("Make was not given any path in settings and is also not found on the environment path.");
// Do the users need an environment automatically set by the extension?
// With a kits feature or expanding on the pre-configure script.
@ -669,7 +674,7 @@ export function getCommandForConfiguration(configuration: string | undefined): v
}
if (!util.checkFileExistsSync(makefileUsed)) {
vscode.window.showErrorMessage("Makefile entry point not found.");
vscode.window.showErrorMessage(localize("makefile.entry.point.not.found", "{0} entry point not found", "Makefile"));
logger.message("The makefile entry point was not found. " +
"Make sure it exists at the location defined by makefile.makefilePath, makefile.configurations[].makefilePath, " +
"makefile.makeDirectory, makefile.configurations[].makeDirectory" +

Просмотреть файл

@ -19,6 +19,10 @@ import * as util from './util';
import * as vscode from 'vscode';
import * as cpp from 'vscode-cpptools';
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
let statusBar: ui.UI = ui.getUI();
let launcher: launch.Launcher = launch.getLauncher();
@ -373,7 +377,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}
export async function deactivate(): Promise<void> {
vscode.window.showInformationMessage('The extension "vscode-makefile-tools" is de-activated');
vscode.window.showInformationMessage(localize("extension.deactivated", "The extension {0} is de-activated.", "'vscode-makefile-tools'"));
await telemetry.deactivate();

Просмотреть файл

@ -1,360 +1,362 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Launch support: debug and run in terminal
import * as configuration from './configuration';
import * as extension from './extension';
import * as logger from './logger';
import * as make from './make';
import * as path from 'path';
import * as telemetry from './telemetry';
import * as util from './util';
import * as vscode from 'vscode';
export enum LaunchStatuses {
success = "success",
blocked = "blocked by (pre)configure or build",
noLaunchConfigurationSet = "no launch configuration set by the user",
launchTargetsListEmpty = "launch targets list empty",
buildFailed = "build failed",
}
let launcher: Launcher;
export class Launcher implements vscode.Disposable {
// Command property accessible from launch.json:
// the full path of the target binary currently set for launch
public getLaunchTargetPath(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.binaryPath;
} else {
return "";
}
}
// Command property accessible from launch.json:
// calls getLaunchTargetPath after triggering a build of the current target,
// if makefile.buildBeforeLaunch allows it.
public async launchTargetPath(): Promise<string> {
if (configuration.getBuildBeforeLaunch()) {
await make.buildTarget(make.TriggeredBy.launch, configuration.getCurrentTarget() || "");
}
return this.getLaunchTargetPath();
}
// Command property accessible from launch.json:
// the full path from where the target binary is to be launched
public getLaunchTargetDirectory(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.cwd;
} else {
return util.getWorkspaceRoot();
}
}
// Command property accessible from launch.json:
// the file name of the current target binary, without path or extension.
public getLaunchTargetFileName(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return path.parse(launchConfiguration.binaryPath).name;
} else {
return "";
}
}
// Command property accessible from launch.json:
// calls getLaunchTargetFileName after triggering a build of the current target,
// if makefile.buildBeforeLaunch allows it.
public async launchTargetFileName(): Promise<string> {
if (configuration.getBuildBeforeLaunch()) {
await make.buildTarget(make.TriggeredBy.launch, configuration.getCurrentTarget() || "");
}
return this.getLaunchTargetFileName();
}
// Command property accessible from launch.json:
// the arguments sent to the target binary, returned as array of string
// This is used by the debug/terminal VS Code APIs.
public getLaunchTargetArgs(): string[] {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.binaryArgs;
} else {
return [];
}
}
// Command property accessible from launch.json:
// the arguments sent to the target binary, returned as one simple string
// This is an alternative to define the arguments in launch.json,
// since the string array syntax is not working.
// This is not a perfect solution, it all depends on how the main entry point
// is parsing its given arguments.
// Example: for [CWD>tool arg1 arg2 arg3], the tool will receive
// 2 arguments: tool and "arg1 arg2 arg3"
// As opposed to the above case when the tool will receive
// 4 arguments: tool, arg1, arg2, arg3
// TODO: investigate how we can define string array arguments
// for the target binary in launch.json
public getLaunchTargetArgsConcat(): string {
return this.getLaunchTargetArgs().join(" ");
}
// Invoke a VS Code debugging session passing it all the information
// from the current launch configuration.
// Debugger (imperfect) guess logic:
// - VS for msvc toolset, lldb for clang toolset, gdb for anything else.
// - debugger path is assumed to be the same as the compiler path.
// Exceptions for miMode:
// - if the above logic results in a debugger that is missing, try the other one.
// This is needed either because the system might not be equipped
// with the preffered debugger that corresponds to the toolset in use,
// but also because there might be a compiler alias that is not properly identified
// (example: "cc" alias that points to clang but is not identified as clang,
// therefore requesting a gdb debugger which may be missing
// because there is no gcc toolset installed).
// TODO: implement proper detection of aliases and their commands.
// Exceptions for miDebuggerPath:
// - for MacOS, point to the lldb-mi debugger that is installed by CppTools
// - if CppTools extension is not installed, intentionally do not provide a miDebuggerPath On MAC,
// because the debugger knows how to find automatically the right lldb-mi when miMode is lldb and miDebuggerPath is undefined
// (this is true for systems older than Catalina).
// Additionally, cppvsdbg ignores miMode and miDebuggerPath.
public prepareDebugCurrentTarget(currentLaunchConfiguration: configuration.LaunchConfiguration): vscode.DebugConfiguration {
let args: string[] = this.getLaunchTargetArgs();
let compilerPath : string | undefined = extension.extension.getCompilerFullPath();
let parsedObjPath : path.ParsedPath | undefined = compilerPath ? path.parse(compilerPath) : undefined;
let isClangCompiler : boolean | undefined = parsedObjPath?.name.startsWith("clang");
let isMsvcCompiler : boolean | undefined = !isClangCompiler && parsedObjPath?.name.startsWith("cl");
let dbg: string = (isMsvcCompiler) ? "cppvsdbg" : "cppdbg";
// Initial debugger guess
let guessMiDebuggerPath : string | undefined = (!isMsvcCompiler && parsedObjPath) ? parsedObjPath.dir : undefined;
let guessMiMode: string | undefined;
if (parsedObjPath?.name.startsWith("clang")) {
guessMiMode = "lldb";
} else if (!parsedObjPath?.name.startsWith("cl")) {
guessMiMode = "gdb";
}
// If the first chosen debugger is not installed, try the other one.
if (guessMiDebuggerPath && guessMiMode) {
let debuggerPath: string = path.join(guessMiDebuggerPath, guessMiMode);
if (process.platform === "win32") {
// On mingw a file is not found if the extension is not part of the path
debuggerPath = debuggerPath + ".exe";
}
if (!util.checkFileExistsSync(debuggerPath)) {
guessMiMode = (guessMiMode === "gdb") ? "lldb" : "gdb";
}
}
// Properties defined by makefile.launchConfigurations override makefile.defaultLaunchConfiguration
// and they both override the guessed values.
let defaultLaunchConfiguration: configuration.DefaultLaunchConfiguration | undefined = configuration.getDefaultLaunchConfiguration();
let miMode: string | undefined = currentLaunchConfiguration.MIMode || defaultLaunchConfiguration?.MIMode || guessMiMode;
let miDebuggerPath: string | undefined = currentLaunchConfiguration.miDebuggerPath || defaultLaunchConfiguration?.miDebuggerPath || guessMiDebuggerPath;
// Exception for MAC-lldb, point to the lldb-mi installed by CppTools or set debugger path to undefined
// (more details in the comment at the beginning of this function).
if (miMode === "lldb" && process.platform === "darwin") {
const cpptoolsExtension: vscode.Extension<any> | undefined = vscode.extensions.getExtension('ms-vscode.cpptools');
miDebuggerPath = cpptoolsExtension ? path.join(cpptoolsExtension.extensionPath, "debugAdapters", "lldb-mi", "bin", "lldb-mi") : undefined;
} else if (miDebuggerPath && miMode) {
miDebuggerPath = path.join(miDebuggerPath, miMode);
if (process.platform === "win32") {
miDebuggerPath = miDebuggerPath + ".exe";
}
}
let debugConfig: vscode.DebugConfiguration = {
type: dbg,
name: `Debug My Program`,
request: 'launch',
cwd: this.getLaunchTargetDirectory(),
args,
program: this.getLaunchTargetPath(),
MIMode: miMode,
miDebuggerPath: miDebuggerPath,
console: "internalConsole",
internalConsoleOptions: "openOnSessionStart",
stopAtEntry: currentLaunchConfiguration.stopAtEntry || defaultLaunchConfiguration?.stopAtEntry,
symbolSearchPath: currentLaunchConfiguration.symbolSearchPath || defaultLaunchConfiguration?.symbolSearchPath
};
logger.message("Created the following debug config:\n type = " + debugConfig.type +
"\n cwd = " + debugConfig.cwd + " (= " + this.getLaunchTargetDirectory() + ")" +
"\n args = " + args.join(" ") +
"\n program = " + debugConfig.program + " (= " + this.getLaunchTargetPath() + ")" +
"\n MIMode = " + debugConfig.MIMode +
"\n miDebuggerPath = " + debugConfig.miDebuggerPath +
"\n stopAtEntry = " + debugConfig.stopAtEntry +
"\n symbolSearchPath = " + debugConfig.symbolSearchPath);
return debugConfig;
}
async validateLaunchConfiguration(op: make.Operations): Promise<string> {
// Cannot debug the project if it is currently building or (pre-)configuring.
if (make.blockedByOp(op)) {
return LaunchStatuses.blocked;
}
if (configuration.getBuildBeforeLaunch()) {
let currentBuildTarget: string = configuration.getCurrentTarget() || "";
logger.message(`Building current target before launch: "${currentBuildTarget}"`);
let buildSuccess: boolean = (await make.buildTarget(make.TriggeredBy.buildTarget, currentBuildTarget, false)) === make.ConfigureBuildReturnCodeTypes.success;
if (!buildSuccess) {
logger.message(`Building target "${currentBuildTarget}" failed.`);
let noButton: string = "No";
let yesButton: string = "Yes";
const chosen: vscode.MessageItem | undefined = await vscode.window.showErrorMessage<vscode.MessageItem>("Build failed. Do you want to continue anyway?",
{
title: yesButton,
isCloseAffordance: false,
},
{
title: noButton,
isCloseAffordance: true
});
if (chosen === undefined || chosen.title === noButton) {
return LaunchStatuses.buildFailed;
}
}
}
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (!currentLaunchConfiguration) {
// If no launch configuration is set, give the user a chance to select one now from the quick pick
// (unless we know it's going to be empty).
if (configuration.getLaunchTargets().length === 0) {
vscode.window.showErrorMessage(`Cannot ${op} because there is no launch configuration set` +
" and the list of launch targets is empty. Double check the makefile configuration and the build target.");
return LaunchStatuses.launchTargetsListEmpty;
} else {
vscode.window.showErrorMessage(`Cannot ${op} because there is no launch configuration set. Choose one from the quick pick.`);
await configuration.selectLaunchConfiguration();
// Read again the current launch configuration. If a current launch configuration is stil not set
// (the user cancelled the quick pick or the parser found zero launch targets) message and fail.
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
if (!currentLaunchConfiguration) {
vscode.window.showErrorMessage(`Cannot ${op} until you select an active launch configuration.`);
return LaunchStatuses.noLaunchConfigurationSet;
}
}
}
return LaunchStatuses.success;
}
public async debugCurrentTarget(): Promise<vscode.DebugSession | undefined> {
let status: string = await this.validateLaunchConfiguration(make.Operations.debug);
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined;
if (status === LaunchStatuses.success) {
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
}
if (currentLaunchConfiguration) {
let debugConfig: vscode.DebugConfiguration = this.prepareDebugCurrentTarget(currentLaunchConfiguration);
let startFolder: vscode.WorkspaceFolder;
if (vscode.workspace.workspaceFolders) {
startFolder = vscode.workspace.workspaceFolders[0];
await vscode.debug.startDebugging(startFolder, debugConfig);
} else {
await vscode.debug.startDebugging(undefined, debugConfig);
}
if (!vscode.debug.activeDebugSession) {
status = "failed";
}
}
let telemetryProperties: telemetry.Properties = {
status: status
};
telemetry.logEvent("debug", telemetryProperties);
return vscode.debug.activeDebugSession;
}
private launchTerminal: vscode.Terminal | undefined;
// Watch for the user closing our terminal
private readonly onTerminalClose = vscode.window.onDidCloseTerminal(term => {
if (term === this.launchTerminal) {
this.launchTerminal = undefined;
}
});
// Invoke a VS Code running terminal passing it all the information
// from the current launch configuration
public prepareRunCurrentTarget(): string {
// Add a pair of quotes just in case there is a space in the binary path
let terminalCommand: string = '"' + this.getLaunchTargetPath() + '" ';
terminalCommand += this.getLaunchTargetArgs().join(" ");
// Log the message for high verbosity only because the output channel will become visible over the terminal,
// even if the terminal show() is called after the logger show().
logger.message("Running command '" + terminalCommand + "' in the terminal from location '" + this.getLaunchTargetDirectory() + "'", "Debug");
return terminalCommand;
}
public async runCurrentTarget(): Promise<vscode.Terminal> {
const terminalOptions: vscode.TerminalOptions = {
name: 'Make/Launch',
};
// Use cmd.exe on Windows
if (process.platform === 'win32') {
terminalOptions.shellPath = 'C:\\Windows\\System32\\cmd.exe';
}
terminalOptions.cwd = this.getLaunchTargetDirectory();
if (!this.launchTerminal) {
this.launchTerminal = vscode.window.createTerminal(terminalOptions);
}
let status: string = await this.validateLaunchConfiguration(make.Operations.run);
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined;
if (status === LaunchStatuses.success) {
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
let terminalCommand: string = this.prepareRunCurrentTarget();
this.launchTerminal.sendText(terminalCommand);
let telemetryProperties: telemetry.Properties = {
status: status
};
telemetry.logEvent("run", telemetryProperties);
this.launchTerminal.show();
}
return this.launchTerminal;
}
public dispose(): void {
if (this.launchTerminal) {
this.launchTerminal.dispose();
}
this.onTerminalClose.dispose();
}
}
export function getLauncher(): Launcher {
if (launcher === undefined) {
launcher = new Launcher();
}
return launcher;
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Launch support: debug and run in terminal
import * as configuration from './configuration';
import * as extension from './extension';
import * as logger from './logger';
import * as make from './make';
import * as path from 'path';
import * as telemetry from './telemetry';
import * as util from './util';
import * as vscode from 'vscode';
import { localize } from 'vscode-nls';
export enum LaunchStatuses {
success = "success",
blocked = "blocked by (pre)configure or build",
noLaunchConfigurationSet = "no launch configuration set by the user",
launchTargetsListEmpty = "launch targets list empty",
buildFailed = "build failed",
}
let launcher: Launcher;
export class Launcher implements vscode.Disposable {
// Command property accessible from launch.json:
// the full path of the target binary currently set for launch
public getLaunchTargetPath(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.binaryPath;
} else {
return "";
}
}
// Command property accessible from launch.json:
// calls getLaunchTargetPath after triggering a build of the current target,
// if makefile.buildBeforeLaunch allows it.
public async launchTargetPath(): Promise<string> {
if (configuration.getBuildBeforeLaunch()) {
await make.buildTarget(make.TriggeredBy.launch, configuration.getCurrentTarget() || "");
}
return this.getLaunchTargetPath();
}
// Command property accessible from launch.json:
// the full path from where the target binary is to be launched
public getLaunchTargetDirectory(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.cwd;
} else {
return util.getWorkspaceRoot();
}
}
// Command property accessible from launch.json:
// the file name of the current target binary, without path or extension.
public getLaunchTargetFileName(): string {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return path.parse(launchConfiguration.binaryPath).name;
} else {
return "";
}
}
// Command property accessible from launch.json:
// calls getLaunchTargetFileName after triggering a build of the current target,
// if makefile.buildBeforeLaunch allows it.
public async launchTargetFileName(): Promise<string> {
if (configuration.getBuildBeforeLaunch()) {
await make.buildTarget(make.TriggeredBy.launch, configuration.getCurrentTarget() || "");
}
return this.getLaunchTargetFileName();
}
// Command property accessible from launch.json:
// the arguments sent to the target binary, returned as array of string
// This is used by the debug/terminal VS Code APIs.
public getLaunchTargetArgs(): string[] {
let launchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (launchConfiguration) {
return launchConfiguration.binaryArgs;
} else {
return [];
}
}
// Command property accessible from launch.json:
// the arguments sent to the target binary, returned as one simple string
// This is an alternative to define the arguments in launch.json,
// since the string array syntax is not working.
// This is not a perfect solution, it all depends on how the main entry point
// is parsing its given arguments.
// Example: for [CWD>tool arg1 arg2 arg3], the tool will receive
// 2 arguments: tool and "arg1 arg2 arg3"
// As opposed to the above case when the tool will receive
// 4 arguments: tool, arg1, arg2, arg3
// TODO: investigate how we can define string array arguments
// for the target binary in launch.json
public getLaunchTargetArgsConcat(): string {
return this.getLaunchTargetArgs().join(" ");
}
// Invoke a VS Code debugging session passing it all the information
// from the current launch configuration.
// Debugger (imperfect) guess logic:
// - VS for msvc toolset, lldb for clang toolset, gdb for anything else.
// - debugger path is assumed to be the same as the compiler path.
// Exceptions for miMode:
// - if the above logic results in a debugger that is missing, try the other one.
// This is needed either because the system might not be equipped
// with the preffered debugger that corresponds to the toolset in use,
// but also because there might be a compiler alias that is not properly identified
// (example: "cc" alias that points to clang but is not identified as clang,
// therefore requesting a gdb debugger which may be missing
// because there is no gcc toolset installed).
// TODO: implement proper detection of aliases and their commands.
// Exceptions for miDebuggerPath:
// - for MacOS, point to the lldb-mi debugger that is installed by CppTools
// - if CppTools extension is not installed, intentionally do not provide a miDebuggerPath On MAC,
// because the debugger knows how to find automatically the right lldb-mi when miMode is lldb and miDebuggerPath is undefined
// (this is true for systems older than Catalina).
// Additionally, cppvsdbg ignores miMode and miDebuggerPath.
public prepareDebugCurrentTarget(currentLaunchConfiguration: configuration.LaunchConfiguration): vscode.DebugConfiguration {
let args: string[] = this.getLaunchTargetArgs();
let compilerPath : string | undefined = extension.extension.getCompilerFullPath();
let parsedObjPath : path.ParsedPath | undefined = compilerPath ? path.parse(compilerPath) : undefined;
let isClangCompiler : boolean | undefined = parsedObjPath?.name.startsWith("clang");
let isMsvcCompiler : boolean | undefined = !isClangCompiler && parsedObjPath?.name.startsWith("cl");
let dbg: string = (isMsvcCompiler) ? "cppvsdbg" : "cppdbg";
// Initial debugger guess
let guessMiDebuggerPath : string | undefined = (!isMsvcCompiler && parsedObjPath) ? parsedObjPath.dir : undefined;
let guessMiMode: string | undefined;
if (parsedObjPath?.name.startsWith("clang")) {
guessMiMode = "lldb";
} else if (!parsedObjPath?.name.startsWith("cl")) {
guessMiMode = "gdb";
}
// If the first chosen debugger is not installed, try the other one.
if (guessMiDebuggerPath && guessMiMode) {
let debuggerPath: string = path.join(guessMiDebuggerPath, guessMiMode);
if (process.platform === "win32") {
// On mingw a file is not found if the extension is not part of the path
debuggerPath = debuggerPath + ".exe";
}
if (!util.checkFileExistsSync(debuggerPath)) {
guessMiMode = (guessMiMode === "gdb") ? "lldb" : "gdb";
}
}
// Properties defined by makefile.launchConfigurations override makefile.defaultLaunchConfiguration
// and they both override the guessed values.
let defaultLaunchConfiguration: configuration.DefaultLaunchConfiguration | undefined = configuration.getDefaultLaunchConfiguration();
let miMode: string | undefined = currentLaunchConfiguration.MIMode || defaultLaunchConfiguration?.MIMode || guessMiMode;
let miDebuggerPath: string | undefined = currentLaunchConfiguration.miDebuggerPath || defaultLaunchConfiguration?.miDebuggerPath || guessMiDebuggerPath;
// Exception for MAC-lldb, point to the lldb-mi installed by CppTools or set debugger path to undefined
// (more details in the comment at the beginning of this function).
if (miMode === "lldb" && process.platform === "darwin") {
const cpptoolsExtension: vscode.Extension<any> | undefined = vscode.extensions.getExtension('ms-vscode.cpptools');
miDebuggerPath = cpptoolsExtension ? path.join(cpptoolsExtension.extensionPath, "debugAdapters", "lldb-mi", "bin", "lldb-mi") : undefined;
} else if (miDebuggerPath && miMode) {
miDebuggerPath = path.join(miDebuggerPath, miMode);
if (process.platform === "win32") {
miDebuggerPath = miDebuggerPath + ".exe";
}
}
let debugConfig: vscode.DebugConfiguration = {
type: dbg,
name: `Debug My Program`,
request: 'launch',
cwd: this.getLaunchTargetDirectory(),
args,
program: this.getLaunchTargetPath(),
MIMode: miMode,
miDebuggerPath: miDebuggerPath,
console: "internalConsole",
internalConsoleOptions: "openOnSessionStart",
stopAtEntry: currentLaunchConfiguration.stopAtEntry || defaultLaunchConfiguration?.stopAtEntry,
symbolSearchPath: currentLaunchConfiguration.symbolSearchPath || defaultLaunchConfiguration?.symbolSearchPath
};
logger.message("Created the following debug config:\n type = " + debugConfig.type +
"\n cwd = " + debugConfig.cwd + " (= " + this.getLaunchTargetDirectory() + ")" +
"\n args = " + args.join(" ") +
"\n program = " + debugConfig.program + " (= " + this.getLaunchTargetPath() + ")" +
"\n MIMode = " + debugConfig.MIMode +
"\n miDebuggerPath = " + debugConfig.miDebuggerPath +
"\n stopAtEntry = " + debugConfig.stopAtEntry +
"\n symbolSearchPath = " + debugConfig.symbolSearchPath);
return debugConfig;
}
async validateLaunchConfiguration(op: make.Operations): Promise<string> {
// Cannot debug the project if it is currently building or (pre-)configuring.
if (make.blockedByOp(op)) {
return LaunchStatuses.blocked;
}
if (configuration.getBuildBeforeLaunch()) {
let currentBuildTarget: string = configuration.getCurrentTarget() || "";
logger.message(`Building current target before launch: "${currentBuildTarget}"`);
let buildSuccess: boolean = (await make.buildTarget(make.TriggeredBy.buildTarget, currentBuildTarget, false)) === make.ConfigureBuildReturnCodeTypes.success;
if (!buildSuccess) {
logger.message(`Building target "${currentBuildTarget}" failed.`);
let noButton: string = localize("no", "No");
let yesButton: string = localize("yes", "Yes");
const message: string = localize("build.failed.continue.anyway", "Build failed. Do you want to continue anyway?");
const chosen: vscode.MessageItem | undefined = await vscode.window.showErrorMessage<vscode.MessageItem>(message,
{
title: yesButton,
isCloseAffordance: false,
},
{
title: noButton,
isCloseAffordance: true
});
if (chosen === undefined || chosen.title === noButton) {
return LaunchStatuses.buildFailed;
}
}
}
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined = configuration.getCurrentLaunchConfiguration();
if (!currentLaunchConfiguration) {
// If no launch configuration is set, give the user a chance to select one now from the quick pick
// (unless we know it's going to be empty).
if (configuration.getLaunchTargets().length === 0) {
vscode.window.showErrorMessage(localize("cannot.op.no.launch.config.targets",
"Cannot {0} because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.", `'${op}'`));
return LaunchStatuses.launchTargetsListEmpty;
} else {
vscode.window.showErrorMessage(localize("cannot.op.choose.launch.config", "Cannot {0} because there is no launch configuration set. Choose one from the quick pick.", `'${op}'`));
await configuration.selectLaunchConfiguration();
// Read again the current launch configuration. If a current launch configuration is stil not set
// (the user cancelled the quick pick or the parser found zero launch targets) message and fail.
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
if (!currentLaunchConfiguration) {
vscode.window.showErrorMessage(localize("cannot.op.without.launch.config", "Cannot {0} until you select an active launch configuration.", `'${op}'`));
return LaunchStatuses.noLaunchConfigurationSet;
}
}
}
return LaunchStatuses.success;
}
public async debugCurrentTarget(): Promise<vscode.DebugSession | undefined> {
let status: string = await this.validateLaunchConfiguration(make.Operations.debug);
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined;
if (status === LaunchStatuses.success) {
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
}
if (currentLaunchConfiguration) {
let debugConfig: vscode.DebugConfiguration = this.prepareDebugCurrentTarget(currentLaunchConfiguration);
let startFolder: vscode.WorkspaceFolder;
if (vscode.workspace.workspaceFolders) {
startFolder = vscode.workspace.workspaceFolders[0];
await vscode.debug.startDebugging(startFolder, debugConfig);
} else {
await vscode.debug.startDebugging(undefined, debugConfig);
}
if (!vscode.debug.activeDebugSession) {
status = "failed";
}
}
let telemetryProperties: telemetry.Properties = {
status: status
};
telemetry.logEvent("debug", telemetryProperties);
return vscode.debug.activeDebugSession;
}
private launchTerminal: vscode.Terminal | undefined;
// Watch for the user closing our terminal
private readonly onTerminalClose = vscode.window.onDidCloseTerminal(term => {
if (term === this.launchTerminal) {
this.launchTerminal = undefined;
}
});
// Invoke a VS Code running terminal passing it all the information
// from the current launch configuration
public prepareRunCurrentTarget(): string {
// Add a pair of quotes just in case there is a space in the binary path
let terminalCommand: string = '"' + this.getLaunchTargetPath() + '" ';
terminalCommand += this.getLaunchTargetArgs().join(" ");
// Log the message for high verbosity only because the output channel will become visible over the terminal,
// even if the terminal show() is called after the logger show().
logger.message("Running command '" + terminalCommand + "' in the terminal from location '" + this.getLaunchTargetDirectory() + "'", "Debug");
return terminalCommand;
}
public async runCurrentTarget(): Promise<vscode.Terminal> {
const terminalOptions: vscode.TerminalOptions = {
name: 'Make/Launch',
};
// Use cmd.exe on Windows
if (process.platform === 'win32') {
terminalOptions.shellPath = 'C:\\Windows\\System32\\cmd.exe';
}
terminalOptions.cwd = this.getLaunchTargetDirectory();
if (!this.launchTerminal) {
this.launchTerminal = vscode.window.createTerminal(terminalOptions);
}
let status: string = await this.validateLaunchConfiguration(make.Operations.run);
let currentLaunchConfiguration: configuration.LaunchConfiguration | undefined;
if (status === LaunchStatuses.success) {
currentLaunchConfiguration = configuration.getCurrentLaunchConfiguration();
let terminalCommand: string = this.prepareRunCurrentTarget();
this.launchTerminal.sendText(terminalCommand);
let telemetryProperties: telemetry.Properties = {
status: status
};
telemetry.logEvent("run", telemetryProperties);
this.launchTerminal.show();
}
return this.launchTerminal;
}
public dispose(): void {
if (this.launchTerminal) {
this.launchTerminal.dispose();
}
this.onTerminalClose.dispose();
}
}
export function getLauncher(): Launcher {
if (launcher === undefined) {
launcher = new Launcher();
}
return launcher;
}

Просмотреть файл

@ -15,6 +15,10 @@ import * as util from './util';
import * as telemetry from './telemetry';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
let isBuilding: boolean = false;
export function getIsBuilding(): boolean { return isBuilding; }
export function setIsBuilding(building: boolean): void {
@ -115,7 +119,8 @@ export function blockedByOp(op: Operations, showPopup: boolean = true): Operatio
if (getIsConfiguring()) {
// A configure in the background shouldn't block anything except another configure
if (getConfigureIsInBackground() && op !== Operations.configure) {
vscode.window.showInformationMessage(`The project is configuring in the background and ${op} may run on out-of-date input.`);
vscode.window.showInformationMessage(localize("project.configuring.background.op.may.run.on.out.of.date.input",
"The project is configuring in the background and {0} may run on out-of-date input.", op));
} else {
blocker = Operations.configure;
}
@ -126,7 +131,7 @@ export function blockedByOp(op: Operations, showPopup: boolean = true): Operatio
}
if (blocker && showPopup) {
vscode.window.showErrorMessage(`Cannot "${op}" because the project is already doing a ${blocker}.`);
vscode.window.showErrorMessage(localize("cannot.op.because.project.already.doing", "Cannot {0} because the project is already doing a '{1}'.", `'${op}'`, blocker));
}
return blocker;
@ -140,8 +145,8 @@ async function saveAll(): Promise<boolean> {
return true;
} else {
logger.message("Saving opened files failed.");
let yesButton: string = "Yes";
let noButton: string = "No";
let yesButton: string = localize("yes", "Yes");
let noButton: string = localize("no", "No");
const chosen: vscode.MessageItem | undefined = await vscode.window.showErrorMessage<vscode.MessageItem>("Saving opened files failed. Do you want to continue anyway?",
{
title: yesButton,
@ -477,7 +482,9 @@ export async function generateParseContent(progress: vscode.Progress<{}>,
}
dryrunFile = util.resolvePathToRoot(dryrunFile);
logger.message(`Writing the dry-run output: ${dryrunFile}`);
const lineEnding: string = (process.platform === "win32" && process.env.MSYSTEM === undefined) ? "\r\n" : "\n";
util.writeFile(dryrunFile, `${configuration.getConfigurationMakeCommand()} ${makeArgs.join(" ")}${lineEnding}`);
let completeOutput: string = "";
@ -497,7 +504,14 @@ export async function generateParseContent(progress: vscode.Progress<{}>,
};
let stderr: any = (result: string): void => {
const appendStr: string = `${result} ${lineEnding}`;
// We need this lineEnding to see more clearly the output coming from all these compilers and tools.
// But there is some unpredictability regarding how much these tools fragment their output, on various
// OSes and systems. To compare easily against a fix baseline, don't use lineEnding while running tests.
// So far this has been seen for stderr and not for stdout.
let appendStr: string = result;
if (process.env['MAKEFILE_TOOLS_TESTING'] !== '1') {
appendStr += lineEnding;
}
fs.appendFileSync(dryrunFile, appendStr);
stderrStr += appendStr;

Просмотреть файл

@ -17,7 +17,6 @@ Generating dry-run elapsed time: 0
The make dry-run command failed.
IntelliSense may work only partially or not at all.
/bin/sh: 1: doesnt/exist/make: not found
You can see the detailed dry-run output at {REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros/.vscode/dryrun.log
Make sure that the extension is invoking the same make command as in your development prompt environment.

Просмотреть файл

@ -17,7 +17,6 @@ Generating dry-run elapsed time: 0
The make dry-run command failed.
IntelliSense may work only partially or not at all.
The system cannot find the path specified.
You can see the detailed dry-run output at {REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros\.vscode\dryrun.log
Make sure that the extension is invoking the same make command as in your development prompt environment.

Просмотреть файл

@ -1,193 +1,199 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Tree.ts
import * as configuration from './configuration';
import * as util from './util';
import * as vscode from 'vscode';
interface NamedItem {
name: string;
}
abstract class BaseNode {
constructor(public readonly id: string) { }
abstract getTreeItem(): vscode.TreeItem;
abstract getChildren(): BaseNode[];
}
export class BuildTargetNode extends BaseNode {
constructor(targetName: string) {
super(`buildTarget:${targetName}`);
this._name = targetName;
}
_name: string;
update(targetName: string): void {
this._name = `Build target: [${targetName}]`;
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = "The makefile target currently selected for build.";
item.contextValue = [
`nodeType=buildTarget`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(`${this._name} (There was an issue rendering this item.)`);
}
}
}
export class LaunchTargetNode extends BaseNode {
_name: string;
_toolTip: string;
// Keep the tree node label as short as possible.
// The binary path is the most important component of a launch target.
async getShortLaunchTargetName(completeLaunchTargetName: string): Promise<string> {
let launchConfiguration: configuration.LaunchConfiguration | undefined = await configuration.stringToLaunchConfiguration(completeLaunchTargetName);
let shortName: string;
if (!launchConfiguration) {
shortName = "Unset";
} else {
if (vscode.workspace.workspaceFolders) {
// In a complete launch target string, the binary path is relative to cwd.
// In here, since we don't show cwd, make it relative to current workspace folder.
shortName = util.makeRelPath(launchConfiguration.binaryPath, vscode.workspace.workspaceFolders[0].uri.fsPath);
} else {
// Just in case, if for some reason we don't have a workspace folder, return full binary path.
shortName = launchConfiguration.binaryPath;
}
}
return `Launch target: [${shortName}]`;
}
constructor(targetName: string) {
super(`launchTarget:${targetName}`);
// Show the complete launch target name as tooltip and the short name as label
this._name = targetName;
this._toolTip = targetName;
}
async update(targetName: string): Promise<void> {
// Show the complete launch target name as tooltip and the short name as label
this._name = await this.getShortLaunchTargetName(targetName);
this._toolTip = targetName;
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = `The launch target currently selected for debug and run in terminal.\n${this._toolTip}`;
item.contextValue = [
`nodeType=launchTarget`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(`${this._name} (There was an issue rendering this item.)`);
}
}
}
export class ConfigurationNode extends BaseNode {
constructor(configurationName: string) {
super(`configuration:${configurationName}`);
this._name = configurationName;
}
_name: string;
update(configurationName: string): void {
this._name = `Configuration: [${configurationName}]`;
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = "The makefile configuration currently selected from settings ('makefile.configurations').";
item.contextValue = [
`nodeType=configuration`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(`${this._name} (There was an issue rendering this item.)`);
}
}
}
export class ProjectOutlineProvider implements vscode.TreeDataProvider<BaseNode> {
private readonly _changeEvent = new vscode.EventEmitter<BaseNode | null>();
constructor() {
this._currentConfigurationItem = new ConfigurationNode("Unset");
this._currentBuildTargetItem = new BuildTargetNode("Unset");
this._currentLaunchTargetItem = new LaunchTargetNode("Unset");
}
private _currentConfigurationItem: ConfigurationNode;
private _currentBuildTargetItem: BuildTargetNode;
private _currentLaunchTargetItem: LaunchTargetNode;
get onDidChangeTreeData(): any {
return this._changeEvent.event;
}
async getTreeItem(node: BaseNode): Promise<vscode.TreeItem> {
return node.getTreeItem();
}
getChildren(node?: BaseNode): BaseNode[] {
if (node) {
return node.getChildren();
}
return [this._currentConfigurationItem, this._currentBuildTargetItem, this._currentLaunchTargetItem];
}
async update(configuration: string, buildTarget: string, launchTarget: string): Promise<void> {
this._currentConfigurationItem.update(configuration);
this._currentBuildTargetItem.update(buildTarget);
await this._currentLaunchTargetItem.update(launchTarget);
this._changeEvent.fire(null);
}
updateConfiguration(configuration: string): void {
this._currentConfigurationItem.update(configuration);
this._changeEvent.fire(null);
}
updateBuildTarget(buildTarget: string): void {
this._currentBuildTargetItem.update(buildTarget);
this._changeEvent.fire(null);
}
async updateLaunchTarget(launchTarget: string): Promise<void> {
await this._currentLaunchTargetItem.update(launchTarget);
this._changeEvent.fire(null);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Tree.ts
import * as configuration from './configuration';
import * as util from './util';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
interface NamedItem {
name: string;
}
abstract class BaseNode {
constructor(public readonly id: string) { }
abstract getTreeItem(): vscode.TreeItem;
abstract getChildren(): BaseNode[];
}
export class BuildTargetNode extends BaseNode {
constructor(targetName: string) {
super(`buildTarget:${targetName}`);
this._name = targetName;
}
_name: string;
update(targetName: string): void {
this._name = localize("tree.build.target", "Build target: {0}", `[${targetName}]`);
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = localize("makefile.target.currently.selected.for.build", "The makefile target currently selected for build.");
item.contextValue = [
`nodeType=buildTarget`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(localize("issue.rendering.item", "{0} (there was an issue rendering this item)", this._name));
}
}
}
export class LaunchTargetNode extends BaseNode {
_name: string;
_toolTip: string;
// Keep the tree node label as short as possible.
// The binary path is the most important component of a launch target.
async getShortLaunchTargetName(completeLaunchTargetName: string): Promise<string> {
let launchConfiguration: configuration.LaunchConfiguration | undefined = await configuration.stringToLaunchConfiguration(completeLaunchTargetName);
let shortName: string;
if (!launchConfiguration) {
shortName = "Unset";
} else {
if (vscode.workspace.workspaceFolders) {
// In a complete launch target string, the binary path is relative to cwd.
// In here, since we don't show cwd, make it relative to current workspace folder.
shortName = util.makeRelPath(launchConfiguration.binaryPath, vscode.workspace.workspaceFolders[0].uri.fsPath);
} else {
// Just in case, if for some reason we don't have a workspace folder, return full binary path.
shortName = launchConfiguration.binaryPath;
}
}
return localize("tree.launch.target", "Launch target: {0}", `[${shortName}]`);
}
constructor(targetName: string) {
super(`launchTarget:${targetName}`);
// Show the complete launch target name as tooltip and the short name as label
this._name = targetName;
this._toolTip = targetName;
}
async update(targetName: string): Promise<void> {
// Show the complete launch target name as tooltip and the short name as label
this._name = await this.getShortLaunchTargetName(targetName);
this._toolTip = targetName;
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = localize("launch.target.currently.selected.for.debug.run.in.terminal",
"The launch target currently selected for debug and run in terminal.\n{0}", this._toolTip);
item.contextValue = [
`nodeType=launchTarget`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(localize("issue.rendering.item", "{0} (there was an issue rendering this item)", this._name));
}
}
}
export class ConfigurationNode extends BaseNode {
constructor(configurationName: string) {
super(`configuration:${configurationName}`);
this._name = configurationName;
}
_name: string;
update(configurationName: string): void {
this._name = localize("tree.configuration", "Configuration: {0}", `[${configurationName}]`);
}
getChildren(): BaseNode[] {
return [];
}
getTreeItem(): vscode.TreeItem {
try {
const item: vscode.TreeItem = new vscode.TreeItem(this._name);
item.collapsibleState = vscode.TreeItemCollapsibleState.None;
item.tooltip = "The makefile configuration currently selected from settings ('makefile.configurations').";
item.contextValue = [
`nodeType=configuration`,
].join(',');
return item;
} catch (e) {
return new vscode.TreeItem(localize("issue.rendering.item", "{0} (there was an issue rendering this item)", this._name));
}
}
}
export class ProjectOutlineProvider implements vscode.TreeDataProvider<BaseNode> {
private readonly _changeEvent = new vscode.EventEmitter<BaseNode | null>();
constructor() {
const unsetString: string = localize("Unset", "Unset");
this._currentConfigurationItem = new ConfigurationNode(unsetString);
this._currentBuildTargetItem = new BuildTargetNode(unsetString);
this._currentLaunchTargetItem = new LaunchTargetNode(unsetString);
}
private _currentConfigurationItem: ConfigurationNode;
private _currentBuildTargetItem: BuildTargetNode;
private _currentLaunchTargetItem: LaunchTargetNode;
get onDidChangeTreeData(): any {
return this._changeEvent.event;
}
async getTreeItem(node: BaseNode): Promise<vscode.TreeItem> {
return node.getTreeItem();
}
getChildren(node?: BaseNode): BaseNode[] {
if (node) {
return node.getChildren();
}
return [this._currentConfigurationItem, this._currentBuildTargetItem, this._currentLaunchTargetItem];
}
async update(configuration: string, buildTarget: string, launchTarget: string): Promise<void> {
this._currentConfigurationItem.update(configuration);
this._currentBuildTargetItem.update(buildTarget);
await this._currentLaunchTargetItem.update(launchTarget);
this._changeEvent.fire(null);
}
updateConfiguration(configuration: string): void {
this._currentConfigurationItem.update(configuration);
this._changeEvent.fire(null);
}
updateBuildTarget(buildTarget: string): void {
this._currentBuildTargetItem.update(buildTarget);
this._changeEvent.fire(null);
}
async updateLaunchTarget(launchTarget: string): Promise<void> {
await this._currentLaunchTargetItem.update(launchTarget);
this._changeEvent.fire(null);
}
}

215
translations_auto_pr.js Normal file
Просмотреть файл

@ -0,0 +1,215 @@
'use strict'
const fs = require("fs-extra");
const cp = require("child_process");
const Octokit = require('@octokit/rest')
const path = require('path');
const parseGitConfig = require('parse-git-config');
const branchName = 'localization';
const mergeTo = 'main';
const commitComment = 'Localization - Translated Strings';
const pullRequestTitle = '[Auto] Localization - Translated Strings';
let repoOwner = process.argv[2];
let repoName = process.argv[3];
let authUser = process.argv[4];
let authToken = process.argv[5];
let userFullName = process.argv[6];
let userEmail = process.argv[7];
let locRootPath = process.argv[8];
let locSubPath = process.argv[9];
if (!repoOwner || !repoName || !authUser || !authToken || !userFullName || !userEmail || !locRootPath || !locSubPath) {
console.error(`ERROR: Usage: ${path.parse(process.argv[0]).base} ${path.parse(process.argv[1]).base} repo_owner repo_name auth_token user_full_name user_email loc_root_path loc_sub_path`);
console.error(` repo_owner - The owner of the repo on GitHub. i.e. microsoft`);
console.error(` repo_name - The name of the repo on GitHub. i.e. vscode-makefile-tools`);
console.error(` auth_user - User account wiith permission to post a pull request against the GitHub repo.`);
console.error(` auth_token - A PAT associated with auth_user.`);
console.error(` user_full_name - A full name to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`);
console.error(` user_email - An email to associate with a git commit. (This is replaced by the PR account if commit is squashed.)`);
console.error(` loc_root_path - The path to the folder with language-specific directories (containing localized xlf files).`);
console.error(` loc_sub_path - A sub-path after the language-specific directory, where the xlf to import is located. This should not include the name of the xlf file to import.)`);
return;
}
console.log(`repoOwner=${repoOwner}`);
console.log(`repoName=${repoName}`);
console.log(`authUser=${authUser}`);
console.log(`userFullName=${userFullName}`);
console.log(`userEmail=${userEmail}`);
console.log(`locRootPath=${locRootPath}`);
console.log(`locSubPath=${locSubPath}`);
function hasBranch(branchName) {
console.log(`Checking for existence of branch "${branchName}" (git branch --list ${branchName})`);
let output = cp.execSync(`git branch --list ${branchName}`);
let lines = output.toString().split("\n");
let found = false;
lines.forEach(line => {
found = found || (line === ` ${branchName}`);
});
return found;
}
function hasAnyChanges() {
console.log("Checking if any files have changed (git status --porcelain)");
let output = cp.execSync('git status --porcelain');
let lines = output.toString().split("\n");
let anyChanges = false;
lines.forEach(line => {
if (line != '') {
console.log("Change detected: " + line);
anyChanges = true;
}
});
return anyChanges;
}
// When invoked on build server, we should already be in a repo freshly synced to the mergeTo branch
if (hasAnyChanges()) {
console.log(`Changes already present in this repo! This script is intended to be run against a freshly synced ${mergeTo} branch!`);
return;
}
function sleep(ms) {
var unixtime_ms = new Date().getTime();
while(new Date().getTime() < unixtime_ms + ms) {}
}
console.log("This script is potentially DESTRUCTIVE! Cancel now, or it will proceed in 10 seconds.");
sleep(10000);
let directories = [ "cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-Hans", "zh-Hant" ];
directories.forEach(languageId => {
let sourcePath = `${locRootPath}\\${languageId}\\${locSubPath}\\${repoName}.${languageId}.xlf`;
let destinationPath = `./vscode-translations-import/${languageId}/vscode-extensions/${repoName}.xlf`;
console.log(`Copying "${sourcePath}" to "${destinationPath}"`);
fs.copySync(sourcePath, destinationPath);
});
console.log("Import translations into i18n directory");
cp.execSync("npm run translations-import");
if (!hasAnyChanges()) {
console.log("No changes detected");
return;
}
console.log("Changes detected");
console.log(`Ensure main ref is up to date locally (git fetch)`);
cp.execSync('git fetch');
// Remove old localization branch, if any
if (hasBranch("localization")) {
console.log(`Remove old localization branch, if any (git branch -D localization)`);
cp.execSync('git branch -D localization');
}
// Check out local branch
console.log(`Creating local branch for changes (git checkout -b ${branchName})`);
cp.execSync('git checkout -b localization');
// Add changed files.
console.log("Adding changed file (git add .)");
cp.execSync('git add .');
// git add may have resolves CR/LF's and there may not be anything to commit
if (!hasAnyChanges()) {
console.log("No changes detected. The only changes must have been due to CR/LF's, and have been corrected.");
return;
}
// Set up user and permissions
// Save existing user name and email, in case already set.
var existingUserName;
var existingUserEmail;
var gitConfigPath = path.resolve(process.cwd(), './.git/config');
var config = parseGitConfig.sync({ path: gitConfigPath });
if (typeof config === 'object' && config.hasOwnProperty('user')) {
existingUserName = config.user.name;
existingUserEmail = config.user.email;
}
if (existingUserName === undefined) {
console.log(`Existing user name: undefined`);
} else {
console.log(`Existing user name: "${existingUserName}"`);
cp.execSync(`git config --local --unset user.name`);
}
if (existingUserEmail === undefined) {
console.log(`Existing user email: undefined`);
} else {
console.log(`Existing user email: "${existingUserEmail}"`);
cp.execSync(`git config --local --unset user.email`);
}
console.log(`Setting local user name to: "${userFullName}"`);
cp.execSync(`git config --local user.name "${userFullName}"`);
console.log(`Setting local user email to: "${userEmail}"`);
cp.execSync(`git config --local user.email "${userEmail}"`);
console.log(`Configuring git with permission to push and to create pull requests (git remote remove origin && git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`);
cp.execSync('git remote remove origin');
cp.execSync(`git remote add origin https://${authUser}:${authToken}@github.com/${repoOwner}/${repoName}.git`);
// Commit changed files.
console.log(`Commiting changes (git commit -m "${commitComment}")`);
cp.execSync(`git commit -m "${commitComment}"`);
if (existingUserName === undefined) {
console.log(`Restoring original user name: undefined`);
cp.execSync(`git config --local --unset user.name`);
} else {
console.log(`Restoring original user name: "${existingUserName}"`);
cp.execSync(`git config --local user.name "${existingUserName}"`);
}
if (existingUserEmail === undefined) {
console.log(`Restoring original user email: undefined`);
cp.execSync(`git config --local --unset user.email`);
} else {
console.log(`Restoring original user email: "${existingUserEmail}"`);
cp.execSync(`git config --local user.email "${existingUserEmail}"`);
}
console.log(`pushing to remove branch (git push -f origin ${branchName})`);
cp.execSync(`git push -f origin ${branchName}`);
console.log("Checking if there is already a pull request...");
const octokit = new Octokit.Octokit({auth: authToken});
octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
let alreadyHasPullRequest = false;
if (data) {
data.forEach((pr) => {
alreadyHasPullRequest = alreadyHasPullRequest || (pr.title === pullRequestTitle);
});
}
// If not already present, create a PR against our remote branch.
if (!alreadyHasPullRequest) {
console.log("There is not already a pull request. Creating one.");
octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
} else {
console.log("There is already a pull request.");
}
console.log(`Restoring default git permissions`);
cp.execSync('git remote remove origin');
cp.execSync(`git remote add origin https://github.com/${repoOwner}/${repoName}.git`);
console.log(`Run 'git fetch' against updated remote`);
cp.execSync('git fetch');
console.log(`Switching back to ${mergeTo} (git checkout ${mergeTo})`);
cp.execSync(`git checkout ${mergeTo}`);
console.log(`Remove localization branch (git branch -D localization)`);
cp.execSync('git branch -D localization');
});