Skip to content

Commit

Permalink
Merging codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
headmelted committed May 27, 2017
2 parents 3d3c40a + 944d4f1 commit 2e1cc7b
Show file tree
Hide file tree
Showing 114 changed files with 457 additions and 108 deletions.
9 changes: 9 additions & 0 deletions extensions/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@
"type": "boolean",
"default": true,
"description": "%javascript.nameSuggestions%"
},
"typescript.tsc.autoDetect": {
"type": "string",
"default": "on",
"enum": [
"on",
"off"
],
"description": "%typescript.tsc.autoDetect%"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion extensions/typescript/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"jsDocCompletion.enabled": "Enable/disable auto JSDoc comments",
"javascript.implicitProjectConfig.checkJs": "Enable/disable semantic checking of JavaScript files. Existing jsconfig.json or tsconfig.json files override this setting. Requires TypeScript >=2.3.1.",
"typescript.check.npmIsInstalled": "Check if NPM is installed for automatic typings acquisition",
"javascript.nameSuggestions": "Enable/disable including unique names from the file in JavaScript suggestion lists."
"javascript.nameSuggestions": "Enable/disable including unique names from the file in JavaScript suggestion lists.",
"typescript.tsc.autoDetect": "Controls whether auto detection of tsc tasks is on or off."
}
48 changes: 43 additions & 5 deletions extensions/typescript/src/features/taskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const exists = (file: string): Promise<boolean> =>
});
});

export default class TypeScriptTaskProvider implements vscode.TaskProvider {
/**
* Provides tasks for building `tsconfig.json` files in a project.
*/
class TscTaskProvider implements vscode.TaskProvider {
private readonly tsconfigProvider: TsConfigProvider;

public constructor(
Expand All @@ -45,21 +48,21 @@ export default class TypeScriptTaskProvider implements vscode.TaskProvider {

return projects.map(configFile => {
const configFileName = path.relative(rootPath, configFile);
const buildTask = new vscode.ShellTask(`tsc: build ${configFileName}`, `${command} -p ${configFile}`, '$tsc');
const buildTask = new vscode.ShellTask(`tsc: build ${configFileName}`, `${command} -p "${configFile}"`, '$tsc');
buildTask.group = vscode.TaskGroup.Build;
return buildTask;
});
}

private async getAllTsConfigs(token: vscode.CancellationToken): Promise<string[]> {
const out: string[] = [];
const out = new Set<string>();
const configs = (await this.getTsConfigForActiveFile(token)).concat(await this.getTsConfigsInWorkspace());
for (const config of configs) {
if (await exists(config)) {
out.push(config);
out.add(config);
}
}
return out;
return Array.from(out);
}

private async getTsConfigForActiveFile(token: vscode.CancellationToken): Promise<string[]> {
Expand Down Expand Up @@ -116,4 +119,39 @@ export default class TypeScriptTaskProvider implements vscode.TaskProvider {
}
return null;
}
}

type AutoDetect = 'on' | 'off';

/**
* Manages registrations of TypeScript task provides with VScode.
*/
export default class TypeScriptTaskProviderManager {
private taskProviderSub: vscode.Disposable | undefined = undefined;
private readonly disposables: vscode.Disposable[] = [];

constructor(
private readonly lazyClient: () => TypeScriptServiceClient
) {
vscode.workspace.onDidChangeConfiguration(this.onConfigurationChanged, this, this.disposables);
this.onConfigurationChanged();
}

dispose() {
if (this.taskProviderSub) {
this.taskProviderSub.dispose();
this.taskProviderSub = undefined;
}
this.disposables.forEach(x => x.dispose());
}

private onConfigurationChanged() {
let autoDetect = vscode.workspace.getConfiguration('typescript.tsc').get<AutoDetect>('autoDetect');
if (this.taskProviderSub && autoDetect === 'off') {
this.taskProviderSub.dispose();
this.taskProviderSub = undefined;
} else if (!this.taskProviderSub && autoDetect === 'on') {
this.taskProviderSub = vscode.workspace.registerTaskProvider(new TscTaskProvider(this.lazyClient));
}
}
}
4 changes: 2 additions & 2 deletions extensions/typescript/src/typescriptMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import CodeActionProvider from './features/codeActionProvider';
import ReferenceCodeLensProvider from './features/referencesCodeLensProvider';
import { JsDocCompletionProvider, TryCompleteJsDocCommand } from './features/jsDocCompletionProvider';
import { DirectiveCommentCompletionProvider } from './features/directiveCommentCompletionProvider';
import TypeScriptTaskProvider from './features/taskProvider';
import TypeScriptTaskProviderManager from './features/taskProvider';

import ImplementationCodeLensProvider from './features/implementationsCodeLensProvider';

Expand Down Expand Up @@ -131,7 +131,7 @@ export function activate(context: ExtensionContext): void {
lazyClientHost().serviceClient.restartTsServer();
}));

context.subscriptions.push(workspace.registerTaskProvider(new TypeScriptTaskProvider(() => lazyClientHost().serviceClient)));
context.subscriptions.push(new TypeScriptTaskProviderManager(() => lazyClientHost().serviceClient));

const goToProjectConfig = (isTypeScript: boolean) => {
const editor = window.activeTextEditor;
Expand Down
3 changes: 3 additions & 0 deletions i18n/chs/extensions/git/out/commands.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"provide commit message": "请提供提交消息",
"branch name": "分支名称",
"provide branch name": "请提供分支名称",
"select branch to delete": "选择要删除的分支",
"confirm force delete branch": "“{0}”分支未被完全合并。是否仍要删除?",
"delete branch": "删除分支",
"no remotes to pull": "存储库未配置任何从其中进行拉取的远程存储库。",
"no remotes to push": "存储库未配置任何要推送到的远程存储库。",
"nobranch": "请签出一个分支以推送到远程。",
Expand Down
1 change: 1 addition & 0 deletions i18n/chs/extensions/git/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"command.undoCommit": "撤消上次提交",
"command.checkout": "签出到...",
"command.branch": "创建分支...",
"command.deleteBranch": "删除分支...",
"command.pull": "拉取",
"command.pullRebase": "拉取(变基)",
"command.push": "推送",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"acceptCurrentChange": "采用当前更改"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"cursorNotInConflict": "编辑器光标不在合并冲突内",
"noConflicts": "没有在此文件中找到合并冲突",
"noOtherConflictsInThisFile": "此文件中没有其他合并冲突了"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"currentChange": "(当前更改)"
}
8 changes: 7 additions & 1 deletion i18n/chs/extensions/merge-conflict/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"command.category": "合并冲突",
"command.next": "下一个冲突",
"command.previous": "上一个冲突",
"command.compare": "比较当前冲突",
"config.title": "合并冲突"
}
4 changes: 3 additions & 1 deletion i18n/chs/extensions/npm/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"config.npm.autoDetect": "控制自动检测 npm 脚本是否打开。默认开启。"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"versionMismatch": "版本不匹配! 全局 tsc ({0}) != VS Code 的语言服务({1})。可能出现不一致的编译错误",
"moreInformation": "详细信息",
"doNotCheckAgain": "不要再次检查",
"doNotCheckAgain": "不再检查",
"close": "关闭",
"updateTscCheck": "已将用户设置 \"typescript.check.tscVersion\" 更新为 false"
}
1 change: 1 addition & 0 deletions i18n/chs/extensions/typescript/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"typescript.referencesCodeLens.enabled": "启用/禁用在 TypeScript 文件中引用 CodeLens。要求 TypeScript >= 2.0.6。",
"typescript.implementationsCodeLens.enabled": "启用/禁用实现 CodeLens。要求 TypeScript >= 2.2.0。",
"typescript.openTsServerLog.title": "打开 TS 服务器日志",
"typescript.restartTsServer": "重启 TS 服务器",
"typescript.selectTypeScriptVersion.title": "选择 TypeScript 版本",
"jsDocCompletion.enabled": "启用/禁用自动 JSDoc 注释",
"javascript.implicitProjectConfig.checkJs": "启用/禁用 JavaScript 文件的语义检查。现有的 jsconfig.json 或\n tsconfig.json 文件会覆盖此设置。要求 TypeScript >=2.3.1。",
Expand Down
1 change: 0 additions & 1 deletion i18n/chs/src/vs/code/electron-main/windows.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"ok": "确定",
"pathNotExistTitle": "路径不存在",
"pathNotExistDetail": "磁盘上似乎不再存在路径“{0}”。",
"accessibilityOptionsWindowTitle": "辅助功能选项",
"reopen": "重新打开",
"wait": "保持等待",
"close": "关闭",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"noResultWord": "未找到“{0}”的任何定义",
"generic.noResults": "找不到定义",
"meta.title": " – {0} 定义",
"actions.goToDecl.label": "转到定义",
"actions.goToDeclToSide.label": "打开侧边的定义",
"actions.previewDecl.label": "查看定义",
"goToImplementation.noResultWord": "未找到“{0}”的实现",
"goToImplementation.generic.noResults": "未找到实现",
"meta.implementations.title": "– {0} 个实现",
"actions.goToImplementation.label": "转到实现",
"actions.peekImplementation.label": "速览实现",
"goToTypeDefinition.noResultWord": "未找到“{0}”的类型定义",
"goToTypeDefinition.generic.noResults": "未找到类型定义",
"meta.typeDefinitions.title": " – {0} 个类型定义",
"actions.goToTypeDefinition.label": "转到类型定义",
"actions.peekTypeDefinition.label": "快速查看类型定义"
}
{}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"multipleResults": "单击显示 {0} 个定义。"
}
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* 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.
{}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"disableOtherKeymapsConfirmation": "是否禁用其他键映射以避免键绑定之间的冲突?",
"yes": "",
"no": ""
"no": "",
"uninstall": "卸载",
"later": "稍后"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* 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.
{}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"acceptCurrentChange": "接受當前變更",
"acceptIncomingChange": "接受來源變更",
"acceptBothChanges": "接受兩者變更",
"compareChanges": "比較變更"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"noConflicts": "檔案內找不到需要合併衝突項目",
"noOtherConflictsInThisFile": "此檔案內沒有其他的衝突合併項目"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"currentChange": "(目前變更)",
"incomingChange": "(來源變更)"
}
15 changes: 14 additions & 1 deletion i18n/cht/extensions/merge-conflict/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"command.category": "合併衝突",
"command.accept.all-incoming": "接受所有來源",
"command.accept.all-both": "接受兩者",
"command.accept.current": "接受當前項目",
"command.accept.incoming": "接受來源",
"command.accept.selection": "接受選取項目",
"command.accept.both": "接受兩者",
"command.next": "後一個衝突",
"command.previous": "前一個衝突",
"command.compare": "比較目前衝突",
"config.title": "合併衝突",
"config.codeLensEnabled": "啟用/停用 編輯器CodeLens衝突合併 "
}
4 changes: 3 additions & 1 deletion i18n/cht/extensions/npm/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{}
{
"config.npm.autoDetect": "控制是否自動檢測npm腳本.預設為開啟."
}
1 change: 0 additions & 1 deletion i18n/cht/src/vs/code/electron-main/windows.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"ok": "確定",
"pathNotExistTitle": "路徑不存在",
"pathNotExistDetail": "磁碟上似乎已沒有路徑 '{0}'。",
"accessibilityOptionsWindowTitle": "協助工具選項",
"reopen": "重新開啟",
"wait": "繼續等候",
"close": "關閉",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* 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.
{}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/
// Do not edit this file. It is machine generated.
{
"disableOtherKeymapsConfirmation": "要停用其他按鍵對應,以避免按鍵繫結關係發生衝突嗎?",
"yes": "",
"no": ""
"no": "",
"uninstall": "解除安裝",
"later": "稍後"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*---------------------------------------------------------------------------------------------
* 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.
{}
1 change: 0 additions & 1 deletion i18n/deu/src/vs/code/electron-main/windows.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"ok": "OK",
"pathNotExistTitle": "Der Pfad ist nicht vorhanden.",
"pathNotExistDetail": "Der Pfad \"{0}\" scheint auf dem Datenträger nicht mehr vorhanden zu sein.",
"accessibilityOptionsWindowTitle": "Optionen für erleichterte Bedienung",
"reopen": "Erneut öffnen",
"wait": "Bitte warten.",
"close": "Schließen",
Expand Down
Loading

0 comments on commit 2e1cc7b

Please sign in to comment.