Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a42976ec
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a42976ec
编写于
5月 27, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into ben/stacks
上级
30f5a203
2833eb9d
变更
38
展开全部
隐藏空白更改
内联
并排
Showing
38 changed file
with
1305 addition
and
405 deletion
+1305
-405
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+5
-5
build/lib/util.js
build/lib/util.js
+4
-3
extensions/css/test/colorize-fixtures/test-variables.css
extensions/css/test/colorize-fixtures/test-variables.css
+7
-0
extensions/css/test/colorize-results/test-variables_css.json
extensions/css/test/colorize-results/test-variables_css.json
+453
-0
extensions/less/test/colorize-fixtures/test-cssvariables.less
...nsions/less/test/colorize-fixtures/test-cssvariables.less
+7
-0
extensions/less/test/colorize-results/test-cssvariables_less.json
...ns/less/test/colorize-results/test-cssvariables_less.json
+147
-345
extensions/node-debug/node-debug.azure.json
extensions/node-debug/node-debug.azure.json
+1
-1
extensions/typescript/src/features/formattingProvider.ts
extensions/typescript/src/features/formattingProvider.ts
+20
-1
extensions/typescript/syntaxes/TypeScript.tmLanguage
extensions/typescript/syntaxes/TypeScript.tmLanguage
+1
-1
extensions/typescript/syntaxes/TypeScriptReact.tmLanguage
extensions/typescript/syntaxes/TypeScriptReact.tmLanguage
+1
-1
extensions/typescript/test/colorize-fixtures/test-issue6916.ts
...sions/typescript/test/colorize-fixtures/test-issue6916.ts
+0
-2
extensions/typescript/test/colorize-fixtures/test-issue6916.tsx
...ions/typescript/test/colorize-fixtures/test-issue6916.tsx
+0
-2
extensions/vscode-colorize-tests/test/colorize-fixtures/test-cssvariables.scss
...orize-tests/test/colorize-fixtures/test-cssvariables.scss
+7
-0
extensions/vscode-colorize-tests/test/colorize-results/test-cssvariables_scss.json
...e-tests/test/colorize-results/test-cssvariables_scss.json
+453
-0
src/vs/base/common/async.ts
src/vs/base/common/async.ts
+10
-0
src/vs/base/node/zip.ts
src/vs/base/node/zip.ts
+5
-4
src/vs/base/test/common/glob.test.ts
src/vs/base/test/common/glob.test.ts
+13
-0
src/vs/code/node/cliProcessMain.ts
src/vs/code/node/cliProcessMain.ts
+2
-1
src/vs/editor/browser/standalone/standaloneLanguages.ts
src/vs/editor/browser/standalone/standaloneLanguages.ts
+1
-0
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+4
-0
src/vs/editor/common/model/editableTextModel.ts
src/vs/editor/common/model/editableTextModel.ts
+55
-32
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+2
-0
src/vs/editor/common/modes/supports/suggestSupport.ts
src/vs/editor/common/modes/supports/suggestSupport.ts
+4
-0
src/vs/editor/contrib/suggest/browser/suggest.ts
src/vs/editor/contrib/suggest/browser/suggest.ts
+4
-0
src/vs/editor/contrib/suggest/browser/suggestModel.ts
src/vs/editor/contrib/suggest/browser/suggestModel.ts
+1
-1
src/vs/editor/test/common/controller/cursor.test.ts
src/vs/editor/test/common/controller/cursor.test.ts
+48
-1
src/vs/languages/css/common/css.ts
src/vs/languages/css/common/css.ts
+1
-0
src/vs/languages/handlebars/common/handlebars.ts
src/vs/languages/handlebars/common/handlebars.ts
+1
-0
src/vs/languages/html/common/html.ts
src/vs/languages/html/common/html.ts
+1
-0
src/vs/languages/json/common/json.ts
src/vs/languages/json/common/json.ts
+1
-0
src/vs/languages/less/common/less.ts
src/vs/languages/less/common/less.ts
+1
-0
src/vs/languages/markdown/common/markdown.ts
src/vs/languages/markdown/common/markdown.ts
+8
-4
src/vs/languages/razor/common/razor.ts
src/vs/languages/razor/common/razor.ts
+1
-0
src/vs/languages/sass/common/sass.ts
src/vs/languages/sass/common/sass.ts
+1
-0
src/vs/languages/typescript/common/languageFeatures.ts
src/vs/languages/typescript/common/languageFeatures.ts
+4
-0
src/vs/platform/keybinding/common/keybindingResolver.ts
src/vs/platform/keybinding/common/keybindingResolver.ts
+3
-1
src/vs/platform/keybinding/test/common/keybindingService.test.ts
...platform/keybinding/test/common/keybindingService.test.ts
+27
-0
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+1
-0
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
a42976ec
...
...
@@ -6,7 +6,6 @@
var
gulp
=
require
(
'
gulp
'
);
var
fs
=
require
(
'
fs
'
);
var
path
=
require
(
'
path
'
);
var
os
=
require
(
'
os
'
);
var
es
=
require
(
'
event-stream
'
);
var
azure
=
require
(
'
gulp-azure-storage
'
);
var
electron
=
require
(
'
gulp-atom-electron
'
);
...
...
@@ -202,10 +201,11 @@ function packageTask(platform, arch, opts) {
.
map
(
function
(
d
)
{
return
[
'
node_modules/
'
+
d
+
'
/**
'
,
'
!node_modules/
'
+
d
+
'
/**/{test,tests}/**
'
];
}));
var
deps
=
gulp
.
src
(
depsSrc
,
{
base
:
'
.
'
,
dot
:
true
})
.
pipe
(
util
.
cleanNodeModule
(
'
fsevents
'
,
[
'
binding.gyp
'
,
'
fsevents.cc
'
,
'
build/**
'
,
'
src/**
'
,
'
test/**
'
],
true
))
.
pipe
(
util
.
cleanNodeModule
(
'
oniguruma
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
true
))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-mutex
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
true
))
.
pipe
(
util
.
cleanNodeModule
(
'
native-keymap
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
true
));
.
pipe
(
util
.
cleanNodeModule
(
'
fsevents
'
,
[
'
binding.gyp
'
,
'
fsevents.cc
'
,
'
build/**
'
,
'
src/**
'
,
'
test/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
oniguruma
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-mutex
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
native-keymap
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
pty.js
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/**
'
]));
var
all
=
es
.
merge
(
api
,
...
...
build/lib/util.js
浏览文件 @
a42976ec
...
...
@@ -183,7 +183,7 @@ exports.skipDirectories = function () {
});
};
exports
.
cleanNodeModule
=
function
(
name
,
excludes
,
i
sNative
)
{
exports
.
cleanNodeModule
=
function
(
name
,
excludes
,
i
ncludes
)
{
var
glob
=
function
(
path
)
{
return
'
**/node_modules/
'
+
name
+
(
path
?
'
/
'
+
path
:
''
);
};
var
negate
=
function
(
str
)
{
return
'
!
'
+
str
;
};
...
...
@@ -194,8 +194,9 @@ exports.cleanNodeModule = function (name, excludes, isNative) {
var
nodeModuleInput
=
input
.
pipe
(
allFilter
);
var
output
=
nodeModuleInput
.
pipe
(
filter
(
globs
));
if
(
isNative
)
{
output
=
es
.
merge
(
output
,
nodeModuleInput
.
pipe
(
filter
(
glob
(
'
**/*.node
'
))));
if
(
includes
)
{
var
includeGlobs
=
includes
.
map
(
glob
);
output
=
es
.
merge
(
output
,
nodeModuleInput
.
pipe
(
filter
(
includeGlobs
)));
}
output
=
output
.
pipe
(
allFilter
.
restore
);
...
...
extensions/css/test/colorize-fixtures/test-variables.css
0 → 100644
浏览文件 @
a42976ec
:root
{
--spacing-unit
:
6px
;
--cell-padding
:
(
4
*
var
(
--spacing-unit
));
}
body
{
padding-left
:
calc
(
4
*
var
(
--spacing-unit
,
5px
));
}
\ No newline at end of file
extensions/css/test/colorize-results/test-variables_css.json
0 → 100644
浏览文件 @
a42976ec
[
{
"c"
:
":"
,
"t"
:
"attribute-name.css.definition.entity.meta.other.pseudo-class.punctuation.selector"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.other.attribute-name.css rgb(128, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.other.attribute-name.css rgb(128, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
}
},
{
"c"
:
"root"
,
"t"
:
"attribute-name.css.entity.meta.other.pseudo-class.selector"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.other.attribute-name.css rgb(128, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.other.attribute-name.css rgb(128, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.other.attribute-name.css rgb(215, 186, 125)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.selector"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.selector rgb(215, 186, 125)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.selector rgb(128, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.selector rgb(215, 186, 125)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.selector rgb(128, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.selector rgb(215, 186, 125)"
}
},
{
"c"
:
"{"
,
"t"
:
"begin.css.meta.property-list.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.property-list"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"--spacing-unit"
,
"t"
:
"css.meta.property-list.property-name.support.type.variable"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.support.type.property-name rgb(212, 212, 212)"
}
},
{
"c"
:
":"
,
"t"
:
"css.key-value.meta.property-list.property-value.punctuation.separator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"6"
,
"t"
:
"constant.css.meta.numeric.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.constant.numeric rgb(9, 136, 90)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.constant.numeric rgb(9, 136, 90)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.constant.numeric rgb(181, 206, 168)"
}
},
{
"c"
:
"px"
,
"t"
:
"constant.css.keyword.meta.numeric.other.property-list.property-value.unit"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.keyword.other.unit rgb(181, 206, 168)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.keyword.other.unit rgb(9, 136, 90)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.keyword.other.unit rgb(181, 206, 168)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.keyword.other.unit rgb(9, 136, 90)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.keyword.other.unit rgb(181, 206, 168)"
}
},
{
"c"
:
";"
,
"t"
:
"css.meta.property-list.property-value.punctuation.rule.terminator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.property-list"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"--cell-padding"
,
"t"
:
"css.meta.property-list.property-name.support.type.variable"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.support.type.property-name rgb(212, 212, 212)"
}
},
{
"c"
:
":"
,
"t"
:
"css.key-value.meta.property-list.property-value.punctuation.separator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" ("
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"4"
,
"t"
:
"constant.css.meta.numeric.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.constant.numeric rgb(9, 136, 90)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.constant.numeric rgb(9, 136, 90)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.constant.numeric rgb(181, 206, 168)"
}
},
{
"c"
:
" * "
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"var"
,
"t"
:
"css.function.meta.misc.property-list.property-value.support"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.property-value rgb(206, 145, 120)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.property-value rgb(4, 81, 165)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.property-value rgb(4, 81, 165)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"("
,
"t"
:
"css.function.meta.property-list.property-value.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"--spacing-unit"
,
"t"
:
"css.meta.property-list.property-name.property-value.support.type.variable"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.support.type.property-name rgb(212, 212, 212)"
}
},
{
"c"
:
")"
,
"t"
:
"css.function.meta.property-list.property-value.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
")"
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
";"
,
"t"
:
"css.meta.property-list.property-value.punctuation.rule.terminator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"}"
,
"t"
:
"css.end.meta.property-list.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"body"
,
"t"
:
"css.entity.meta.name.selector.tag"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.entity.name.selector rgb(215, 186, 125)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.entity.name.selector rgb(128, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.entity.name.selector rgb(215, 186, 125)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.entity.name.selector rgb(128, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.entity.name.selector rgb(215, 186, 125)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.selector"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.meta.selector rgb(215, 186, 125)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.meta.selector rgb(128, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.meta.selector rgb(215, 186, 125)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.meta.selector rgb(128, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.meta.selector rgb(215, 186, 125)"
}
},
{
"c"
:
"{"
,
"t"
:
"begin.css.meta.property-list.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" "
,
"t"
:
"css.meta.property-list"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"padding-left"
,
"t"
:
"css.meta.property-list.property-name.support.type"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.support.type.property-name rgb(212, 212, 212)"
}
},
{
"c"
:
":"
,
"t"
:
"css.key-value.meta.property-list.property-value.punctuation.separator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
" calc("
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"4"
,
"t"
:
"constant.css.meta.numeric.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.constant.numeric rgb(9, 136, 90)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.constant.numeric rgb(181, 206, 168)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.constant.numeric rgb(9, 136, 90)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.constant.numeric rgb(181, 206, 168)"
}
},
{
"c"
:
" * "
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"var"
,
"t"
:
"css.function.meta.misc.property-list.property-value.support"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.property-value rgb(206, 145, 120)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.property-value rgb(4, 81, 165)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.property-value rgb(4, 81, 165)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"("
,
"t"
:
"css.function.meta.property-list.property-value.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"--spacing-unit"
,
"t"
:
"css.meta.property-list.property-name.property-value.support.type.variable"
,
"r"
:
{
"dark_plus"
:
".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_plus"
:
".vs.vscode-theme-defaults-themes-light_plus-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"dark_vs"
:
".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.support.type.property-name rgb(156, 220, 254)"
,
"light_vs"
:
".vs.vscode-theme-defaults-themes-light_vs-json .token.support.type.property-name.css rgb(255, 0, 0)"
,
"hc_black"
:
".hc-black.vscode-theme-defaults-themes-hc_black-json .token.support.type.property-name rgb(212, 212, 212)"
}
},
{
"c"
:
", 5px"
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
")"
,
"t"
:
"css.function.meta.property-list.property-value.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
")"
,
"t"
:
"css.meta.property-list.property-value"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
";"
,
"t"
:
"css.meta.property-list.property-value.punctuation.rule.terminator"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
},
{
"c"
:
"}"
,
"t"
:
"css.end.meta.property-list.punctuation.section"
,
"r"
:
{
"dark_plus"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_plus"
:
".vs .token rgb(0, 0, 0)"
,
"dark_vs"
:
".vs-dark .token rgb(212, 212, 212)"
,
"light_vs"
:
".vs .token rgb(0, 0, 0)"
,
"hc_black"
:
".hc-black .token rgb(255, 255, 255)"
}
}
]
\ No newline at end of file
extensions/less/test/colorize-fixtures/test-cssvariables.less
0 → 100644
浏览文件 @
a42976ec
:root {
--spacing-unit: 6px;
--cell-padding: (4 * var(--spacing-unit));
}
body {
padding-left: calc(4 * var(--spacing-unit, 5px));
}
\ No newline at end of file
extensions/
typescript/test/colorize-results/test-issue6916_t
s.json
→
extensions/
less/test/colorize-results/test-cssvariables_les
s.json
浏览文件 @
a42976ec
此差异已折叠。
点击以展开。
extensions/node-debug/node-debug.azure.json
浏览文件 @
a42976ec
{
"account"
:
"monacobuild"
,
"container"
:
"debuggers"
,
"zip"
:
"
73e045
6/node-debug.zip"
,
"zip"
:
"
407a8b
6/node-debug.zip"
,
"output"
:
""
}
extensions/typescript/src/features/formattingProvider.ts
浏览文件 @
a42976ec
...
...
@@ -128,7 +128,26 @@ export default class TypeScriptFormattingProvider implements DocumentRangeFormat
return
this
.
ensureFormatOptions
(
document
,
options
,
token
).
then
(()
=>
{
return
this
.
client
.
execute
(
'
formatonkey
'
,
args
,
token
).
then
((
response
):
TextEdit
[]
=>
{
return
response
.
body
.
map
(
this
.
codeEdit2SingleEditOperation
);
let
edits
=
response
.
body
;
let
result
:
TextEdit
[]
=
[];
for
(
let
edit
of
edits
)
{
let
textEdit
=
this
.
codeEdit2SingleEditOperation
(
edit
);
let
range
=
textEdit
.
range
;
// Work around for https://github.com/Microsoft/TypeScript/issues/6700.
// Check if we have an edit at the beginning of the line which only removes white spaces and leaves
// an empty line. Drop those edits
if
(
range
.
start
.
character
===
0
&&
range
.
start
.
line
===
range
.
end
.
line
&&
textEdit
.
newText
===
''
)
{
let
lText
=
document
.
lineAt
(
range
.
start
.
line
).
text
;
// If the edit leaves something on the line keep the edit (note that the end character is exclusive).
// Keep it also if it removes something else than whitespace
if
(
lText
.
trim
().
length
>
0
||
lText
.
length
>
range
.
end
.
character
)
{
result
.
push
(
textEdit
);
}
}
else
{
result
.
push
(
textEdit
);
}
}
return
result
;
},
(
err
:
any
)
=>
{
return
[];
});
...
...
extensions/typescript/syntaxes/TypeScript.tmLanguage
浏览文件 @
a42976ec
...
...
@@ -1659,7 +1659,7 @@
<key>
type-parameters
</key>
<dict>
<key>
begin
</key>
<string>
([a-zA-Z_$][\w$]*)?(
<
)
(?=(([a-zA-Z_$][\w$.]*)(
<
([a-zA-Z_$][\w$.,\s]+)
>
)?[,\s]*)+
>
)
</string>
<string>
([a-zA-Z_$][\w$]*)?(
<
)
</string>
<key>
beginCaptures
</key>
<dict>
<key>
1
</key>
...
...
extensions/typescript/syntaxes/TypeScriptReact.tmLanguage
浏览文件 @
a42976ec
...
...
@@ -2025,7 +2025,7 @@
<key>
type-parameters
</key>
<dict>
<key>
begin
</key>
<string>
([a-zA-Z_$][\w$]*)?(
<
)
(?=(([a-zA-Z_$][\w$.]*)(
<
([a-zA-Z_$][\w$.,\s]+)
>
)?[,\s]*)+
>
)
</string>
<string>
([a-zA-Z_$][\w$]*)?(
<
)
</string>
<key>
beginCaptures
</key>
<dict>
<key>
1
</key>
...
...
extensions/typescript/test/colorize-fixtures/test-issue6916.ts
已删除
100644 → 0
浏览文件 @
30f5a203
for
(
var
i
=
0
;
i
<
9
;
i
++
){
for
(
var
j
;
i
>
j
;
j
++
){
if
(
j
+
i
<
3
)
console
.
log
(
i
>
j
);}}
let
x
:
Thenable
<
void
>
=
new
Promise
<
A
<
E
,
e
.
F
>>
();
\ No newline at end of file
extensions/typescript/test/colorize-fixtures/test-issue6916.tsx
已删除
100644 → 0
浏览文件 @
30f5a203
for
(
var
i
=
0
;
i
<
9
;
i
++
){
for
(
var
j
;
i
>
j
;
j
++
){
if
(
j
+
i
<
3
)
console
.
log
(
i
>
j
);}}
let
x
:
Thenable
<
void
>
=
new
Promise
<
A
<
E
,
e
.
F
>>
();
\ No newline at end of file
extensions/vscode-colorize-tests/test/colorize-fixtures/test-cssvariables.scss
0 → 100644
浏览文件 @
a42976ec
:root
{
--spacing-unit
:
6px
;
--cell-padding
:
(
4
*
var
(
--
spacing-unit
));
}
body
{
padding-left
:
calc
(
4
*
var
(
--
spacing-unit
,
5px
));
}
\ No newline at end of file
extensions/
typescript/test/colorize-results/test-issue6916_tsx
.json
→
extensions/
vscode-colorize-tests/test/colorize-results/test-cssvariables_scss
.json
浏览文件 @
a42976ec
此差异已折叠。
点击以展开。
src/vs/base/common/async.ts
浏览文件 @
a42976ec
...
...
@@ -131,6 +131,16 @@ export class Throttler {
}
}
// TODO@Joao: can the previous throttler be replaced with this?
export
class
SimpleThrottler
{
private
current
=
TPromise
.
as
(
null
);
queue
<
T
>
(
promiseTask
:
ITask
<
TPromise
<
T
>>
):
TPromise
<
T
>
{
return
this
.
current
=
this
.
current
.
then
(()
=>
promiseTask
());
}
}
/**
* A helper to delay execution of a task that is being requested often.
*
...
...
src/vs/base/node/zip.ts
浏览文件 @
a42976ec
...
...
@@ -7,7 +7,7 @@ import nls = require('vs/nls');
import
*
as
path
from
'
path
'
;
import
{
createWriteStream
}
from
'
fs
'
;
import
{
Readable
}
from
'
stream
'
;
import
{
nfcall
,
ninvoke
,
sequence
}
from
'
vs/base/common/async
'
;
import
{
nfcall
,
ninvoke
,
SimpleThrottler
}
from
'
vs/base/common/async
'
;
import
{
mkdirp
,
rimraf
}
from
'
vs/base/node/pfs
'
;
import
{
Promise
,
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
open
as
openZip
,
Entry
,
ZipFile
}
from
'
yauzl
'
;
...
...
@@ -50,10 +50,11 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa
function
extractZip
(
zipfile
:
ZipFile
,
targetPath
:
string
,
options
:
IOptions
):
Promise
{
return
new
Promise
((
c
,
e
)
=>
{
const
promiseFactory
:
{
():
Promise
;
}[]
=
[];
const
throttler
=
new
SimpleThrottler
();
let
last
=
TPromise
.
as
(
null
);
zipfile
.
once
(
'
error
'
,
e
);
zipfile
.
once
(
'
close
'
,
()
=>
sequence
(
promiseFactory
)
.
then
(
c
,
e
));
zipfile
.
once
(
'
close
'
,
()
=>
last
.
then
(
c
,
e
));
zipfile
.
on
(
'
entry
'
,
(
entry
:
Entry
)
=>
{
if
(
!
options
.
sourcePathRegex
.
test
(
entry
.
fileName
))
{
return
;
...
...
@@ -63,7 +64,7 @@ function extractZip(zipfile: ZipFile, targetPath: string, options: IOptions): Pr
const
fileName
=
entry
.
fileName
.
replace
(
options
.
sourcePathRegex
,
''
);
const
mode
=
modeFromEntry
(
entry
);
promiseFactory
.
push
(()
=>
stream
.
then
(
stream
=>
extractEntry
(
stream
,
fileName
,
mode
,
targetPath
,
options
)));
last
=
throttler
.
queue
(()
=>
stream
.
then
(
stream
=>
extractEntry
(
stream
,
fileName
,
mode
,
targetPath
,
options
)));
});
});
}
...
...
src/vs/base/test/common/glob.test.ts
浏览文件 @
a42976ec
...
...
@@ -210,6 +210,19 @@ suite('Glob', () => {
assert
(
!
glob
.
match
(
p
,
'
/some.js/test
'
));
assert
(
!
glob
.
match
(
p
,
'
\\
some.js
\\
test
'
));
p
=
'
**/project.json
'
;
assert
(
glob
.
match
(
p
,
'
project.json
'
));
assert
(
glob
.
match
(
p
,
'
/project.json
'
));
assert
(
glob
.
match
(
p
,
'
some/folder/project.json
'
));
assert
(
!
glob
.
match
(
p
,
'
some/folder/file_project.json
'
));
assert
(
!
glob
.
match
(
p
,
'
some/folder/fileproject.json
'
));
assert
(
!
glob
.
match
(
p
,
'
/rrproject.json
'
));
assert
(
!
glob
.
match
(
p
,
'
some/rrproject.json
'
));
assert
(
!
glob
.
match
(
p
,
'
rrproject.json
'
));
assert
(
!
glob
.
match
(
p
,
'
\\
rrproject.json
'
));
assert
(
!
glob
.
match
(
p
,
'
some
\\
rrproject.json
'
));
p
=
'
test/**
'
;
assert
(
glob
.
match
(
p
,
'
test
'
));
assert
(
glob
.
match
(
p
,
'
test/foo.js
'
));
...
...
src/vs/code/node/cliProcessMain.ts
浏览文件 @
a42976ec
...
...
@@ -64,7 +64,8 @@ class Main {
const
isInstalled
=
installed
.
some
(
e
=>
getExtensionId
(
e
)
===
id
);
if
(
isInstalled
)
{
return
TPromise
.
wrapError
(
localize
(
'
alreadyInstalled
'
,
"
Extension '{0}' is already installed.
"
,
id
));
console
.
log
(
localize
(
'
alreadyInstalled
'
,
"
Extension '{0}' is already installed.
"
,
id
));
return
TPromise
.
as
(
null
);
}
return
this
.
extensionGalleryService
.
query
({
ids
:
[
id
]
})
...
...
src/vs/editor/browser/standalone/standaloneLanguages.ts
浏览文件 @
a42976ec
...
...
@@ -88,6 +88,7 @@ export function registerCompletionItemProvider(languageId:string, provider:Compl
let
adapter
=
new
SuggestAdapter
(
provider
);
return
modes
.
SuggestRegistry
.
register
(
languageId
,
{
triggerCharacters
:
provider
.
triggerCharacters
,
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
:
editorCommon
.
IReadOnlyModel
,
position
:
Position
,
token
:
CancellationToken
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
adapter
.
provideCompletionItems
(
model
,
position
,
token
);
},
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
a42976ec
...
...
@@ -851,6 +851,10 @@ export abstract class CommonCodeEditor extends EventEmitter implements IActionPr
this
.
emit
(
editorCommon
.
EventType
.
ModelRawContentChanged
,
e
);
break
;
case
editorCommon
.
EventType
.
ModelContentChanged2
:
this
.
emit
(
editorCommon
.
EventType
.
ModelContentChanged2
,
e
);
break
;
case
editorCommon
.
EventType
.
ModelOptionsChanged
:
this
.
emit
(
editorCommon
.
EventType
.
ModelOptionsChanged
,
e
);
break
;
...
...
src/vs/editor/common/model/editableTextModel.ts
浏览文件 @
a42976ec
...
...
@@ -97,46 +97,69 @@ export class EditableTextModel extends TextModelWithDecorations implements edito
};
});
for
(
let
i
=
0
,
len
=
this
.
_trimAutoWhitespaceLines
.
length
;
i
<
len
;
i
++
)
{
let
trimLineNumber
=
this
.
_trimAutoWhitespaceLines
[
i
];
let
maxLineColumn
=
this
.
getLineMaxColumn
(
trimLineNumber
);
let
allowTrimLine
=
true
;
// Sometimes, auto-formatters change ranges automatically which can cause undesired auto whitespace trimming near the cursor
// We'll use the following heuristic: if the edits occur near the cursor, then it's ok to trim auto whitespace
let
editsAreNearCursors
=
true
;
for
(
let
i
=
0
,
len
=
beforeCursorState
.
length
;
i
<
len
;
i
++
)
{
let
sel
=
beforeCursorState
[
i
];
let
foundEditNearSel
=
false
;
for
(
let
j
=
0
,
lenJ
=
incomingEdits
.
length
;
j
<
lenJ
;
j
++
)
{
let
editRange
=
incomingEdits
[
j
].
range
;
let
editText
=
incomingEdits
[
j
].
text
;
if
(
trimLineNumber
<
editRange
.
startLineNumber
||
trimLineNumber
>
editRange
.
endLineNumber
)
{
// `trimLine` is completely outside this edit
continue
;
let
selIsAbove
=
editRange
.
startLineNumber
>
sel
.
endLineNumber
;
let
selIsBelow
=
sel
.
startLineNumber
>
editRange
.
endLineNumber
;
if
(
!
selIsAbove
&&
!
selIsBelow
)
{
foundEditNearSel
=
true
;
break
;
}
}
if
(
!
foundEditNearSel
)
{
editsAreNearCursors
=
false
;
break
;
}
}
// At this point:
// editRange.startLineNumber <= trimLine <= editRange.endLineNumber
if
(
trimLineNumber
===
editRange
.
startLineNumber
&&
editRange
.
startColumn
===
maxLineColumn
&&
editRange
.
isEmpty
()
&&
editText
&&
editText
.
length
>
0
&&
editText
.
charAt
(
0
)
===
'
\n
'
)
{
// This edit inserts a new line (and maybe other text) after `trimLine`
continue
;
if
(
editsAreNearCursors
)
{
for
(
let
i
=
0
,
len
=
this
.
_trimAutoWhitespaceLines
.
length
;
i
<
len
;
i
++
)
{
let
trimLineNumber
=
this
.
_trimAutoWhitespaceLines
[
i
];
let
maxLineColumn
=
this
.
getLineMaxColumn
(
trimLineNumber
);
let
allowTrimLine
=
true
;
for
(
let
j
=
0
,
lenJ
=
incomingEdits
.
length
;
j
<
lenJ
;
j
++
)
{
let
editRange
=
incomingEdits
[
j
].
range
;
let
editText
=
incomingEdits
[
j
].
text
;
if
(
trimLineNumber
<
editRange
.
startLineNumber
||
trimLineNumber
>
editRange
.
endLineNumber
)
{
// `trimLine` is completely outside this edit
continue
;
}
// At this point:
// editRange.startLineNumber <= trimLine <= editRange.endLineNumber
if
(
trimLineNumber
===
editRange
.
startLineNumber
&&
editRange
.
startColumn
===
maxLineColumn
&&
editRange
.
isEmpty
()
&&
editText
&&
editText
.
length
>
0
&&
editText
.
charAt
(
0
)
===
'
\n
'
)
{
// This edit inserts a new line (and maybe other text) after `trimLine`
continue
;
}
// Looks like we can't trim this line as it would interfere with an incoming edit
allowTrimLine
=
false
;
break
;
}
// Looks like we can't trim this line as it would interfere with an incoming edit
allowTrimLine
=
false
;
break
;
}
if
(
allowTrimLine
)
{
editOperations
.
push
({
identifier
:
null
,
range
:
new
Range
(
trimLineNumber
,
1
,
trimLineNumber
,
maxLineColumn
),
text
:
null
,
forceMoveMarkers
:
false
,
isAutoWhitespaceEdit
:
false
});
}
if
(
allowTrimLine
)
{
editOperations
.
push
({
identifier
:
null
,
range
:
new
Range
(
trimLineNumber
,
1
,
trimLineNumber
,
maxLineColumn
),
text
:
null
,
forceMoveMarkers
:
false
,
isAutoWhitespaceEdit
:
false
});
}
}
this
.
_trimAutoWhitespaceLines
=
null
;
...
...
src/vs/editor/common/modes.ts
浏览文件 @
a42976ec
...
...
@@ -391,6 +391,8 @@ export interface ISuggestSupport {
triggerCharacters
:
string
[];
shouldAutotriggerSuggest
:
boolean
;
filter
?:
IFilter
;
provideCompletionItems
(
model
:
editorCommon
.
IReadOnlyModel
,
position
:
Position
,
token
:
CancellationToken
):
ISuggestResult
[]
|
Thenable
<
ISuggestResult
[]
>
;
...
...
src/vs/editor/common/modes/supports/suggestSupport.ts
浏览文件 @
a42976ec
...
...
@@ -35,6 +35,10 @@ export class TextualSuggestSupport implements ISuggestSupport {
return
[];
}
public
get
shouldAutotriggerSuggest
():
boolean
{
return
true
;
}
public
get
filter
():
IFilter
{
return
matchesStrictPrefix
;
}
...
...
src/vs/editor/contrib/suggest/browser/suggest.ts
浏览文件 @
a42976ec
...
...
@@ -129,6 +129,10 @@ export class SuggestController implements IEditorContribution {
}
private
triggerCharacterHandler
(
character
:
string
,
groups
:
ISuggestSupport
[][]):
void
{
groups
=
groups
.
map
(
supports
=>
{
return
supports
.
filter
(
support
=>
support
.
shouldAutotriggerSuggest
);
});
if
(
groups
.
length
>
0
)
{
this
.
triggerSuggest
(
character
,
groups
).
done
(
null
,
onUnexpectedError
);
}
...
...
src/vs/editor/contrib/suggest/browser/suggestModel.ts
浏览文件 @
a42976ec
...
...
@@ -82,7 +82,7 @@ class Context {
}
const
supports
=
SuggestRegistry
.
all
(
model
);
this
.
isAutoTriggerEnabled
=
(
supports
.
length
>
0
);
this
.
isAutoTriggerEnabled
=
supports
.
some
(
s
=>
s
.
shouldAutotriggerSuggest
);
}
public
shouldAutoTrigger
():
boolean
{
...
...
src/vs/editor/test/common/controller/cursor.test.ts
浏览文件 @
a42976ec
...
...
@@ -10,7 +10,11 @@ import {EditOperation} from 'vs/editor/common/core/editOperation';
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
EndOfLinePreference
,
EventType
,
Handler
,
IPosition
,
ISelection
,
IEditorOptions
,
DefaultEndOfLine
,
ITextModelCreationOptions
}
from
'
vs/editor/common/editorCommon
'
;
import
{
EndOfLinePreference
,
EventType
,
Handler
,
IPosition
,
ISelection
,
IEditorOptions
,
DefaultEndOfLine
,
ITextModelCreationOptions
,
ICommand
,
ITokenizedModel
,
IEditOperationBuilder
,
ICursorStateComputerData
}
from
'
vs/editor/common/editorCommon
'
;
import
{
Model
}
from
'
vs/editor/common/model/model
'
;
import
{
IMode
,
IRichEditSupport
,
IndentAction
}
from
'
vs/editor/common/modes
'
;
import
{
RichEditSupport
}
from
'
vs/editor/common/modes/supports/richEditSupport
'
;
...
...
@@ -2184,6 +2188,49 @@ suite('Editor Controller - Cursor Configuration', () => {
});
});
test
(
'
issue #6862: Editor removes auto inserted indentation when formatting on type
'
,
()
=>
{
usingCursor
({
text
:
[
'
function foo (params: string) {}
'
],
modelOpts
:
{
insertSpaces
:
true
,
tabSize
:
4
,
detectIndentation
:
false
,
defaultEOL
:
DefaultEndOfLine
.
LF
,
trimAutoWhitespace
:
true
},
mode
:
new
OnEnterMode
(
IndentAction
.
IndentOutdent
),
},
(
model
,
cursor
)
=>
{
moveTo
(
cursor
,
1
,
32
);
cursorCommand
(
cursor
,
H
.
Type
,
{
text
:
'
\n
'
},
'
keyboard
'
);
assert
.
equal
(
model
.
getLineContent
(
1
),
'
function foo (params: string) {
'
);
assert
.
equal
(
model
.
getLineContent
(
2
),
'
'
);
assert
.
equal
(
model
.
getLineContent
(
3
),
'
}
'
);
class
TestCommand
implements
ICommand
{
private
_selectionId
:
string
=
null
;
public
getEditOperations
(
model
:
ITokenizedModel
,
builder
:
IEditOperationBuilder
):
void
{
builder
.
addEditOperation
(
new
Range
(
1
,
13
,
1
,
14
),
''
);
this
.
_selectionId
=
builder
.
trackSelection
(
cursor
.
getSelection
());
}
public
computeCursorState
(
model
:
ITokenizedModel
,
helper
:
ICursorStateComputerData
):
Selection
{
return
helper
.
getTrackedSelection
(
this
.
_selectionId
);
}
}
cursor
.
trigger
(
'
autoFormat
'
,
Handler
.
ExecuteCommand
,
new
TestCommand
());
assert
.
equal
(
model
.
getLineContent
(
1
),
'
function foo(params: string) {
'
);
assert
.
equal
(
model
.
getLineContent
(
2
),
'
'
);
assert
.
equal
(
model
.
getLineContent
(
3
),
'
}
'
);
});
});
test
(
'
removeAutoWhitespace on: removes only whitespace the cursor added 2
'
,
()
=>
{
usingCursor
({
text
:
[
...
...
src/vs/languages/css/common/css.ts
浏览文件 @
a42976ec
...
...
@@ -359,6 +359,7 @@ export class CSSMode extends AbstractMode {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[
'
'
,
'
:
'
],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/handlebars/common/handlebars.ts
浏览文件 @
a42976ec
...
...
@@ -131,6 +131,7 @@ export class HandlebarsMode extends htmlMode.HTMLMode<htmlWorker.HTMLWorker> {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[
'
.
'
,
'
:
'
,
'
<
'
,
'
"
'
,
'
=
'
,
'
/
'
],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/html/common/html.ts
浏览文件 @
a42976ec
...
...
@@ -339,6 +339,7 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[
'
.
'
,
'
:
'
,
'
<
'
,
'
"
'
,
'
=
'
,
'
/
'
],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/json/common/json.ts
浏览文件 @
a42976ec
...
...
@@ -94,6 +94,7 @@ export class JSONMode extends AbstractMode {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/less/common/less.ts
浏览文件 @
a42976ec
...
...
@@ -233,6 +233,7 @@ export class LESSMode extends AbstractMode {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/markdown/common/markdown.ts
浏览文件 @
a42976ec
...
...
@@ -22,7 +22,7 @@ import {AbstractMode, ModeWorkerManager} from 'vs/editor/common/modes/abstractMo
import
{
createRichEditSupport
}
from
'
vs/editor/common/modes/monarch/monarchDefinition
'
;
import
{
createTokenizationSupport
}
from
'
vs/editor/common/modes/monarch/monarchLexer
'
;
import
{
RichEditSupport
}
from
'
vs/editor/common/modes/supports/richEditSupport
'
;
import
{
TextualSuggestSupport
}
from
'
vs/editor/common/modes/supports/suggestSupport
'
;
import
{
wireCancellationToken
}
from
'
vs/base/common/async
'
;
export
const
language
=
<
Types
.
ILanguage
>
{
...
...
@@ -235,9 +235,13 @@ export class MarkdownMode extends AbstractMode implements Modes.IEmitOutputSuppo
this
.
richEditSupport
=
new
RichEditSupport
(
this
.
getId
(),
null
,
createRichEditSupport
(
lexer
));
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
new
TextualSuggestSupport
(
editorWorkerService
,
configurationService
),
true
);
Modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
shouldAutotriggerSuggest
:
false
,
provideCompletionItems
:
(
model
,
position
,
token
)
=>
{
return
wireCancellationToken
(
token
,
editorWorkerService
.
textualSuggest
(
model
.
uri
,
position
));
}
},
true
);
}
private
_worker
<
T
>
(
runner
:(
worker
:
MarkdownWorker
.
MarkdownWorker
)
=>
WinJS
.
TPromise
<
T
>
):
WinJS
.
TPromise
<
T
>
{
...
...
src/vs/languages/razor/common/razor.ts
浏览文件 @
a42976ec
...
...
@@ -80,6 +80,7 @@ export class RAZORMode extends htmlMode.HTMLMode<RAZORWorker> {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[
'
.
'
,
'
:
'
,
'
<
'
,
'
"
'
,
'
=
'
,
'
/
'
],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/sass/common/sass.ts
浏览文件 @
a42976ec
...
...
@@ -334,6 +334,7 @@ export class SASSMode extends AbstractMode {
modes
.
SuggestRegistry
.
register
(
this
.
getId
(),
{
triggerCharacters
:
[],
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
,
position
,
token
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_provideCompletionItems
(
model
.
uri
,
position
));
}
...
...
src/vs/languages/typescript/common/languageFeatures.ts
浏览文件 @
a42976ec
...
...
@@ -172,6 +172,10 @@ class SuggestAdapter extends Adapter implements modes.ISuggestSupport {
return
[
'
.
'
];
}
public
get
shouldAutotriggerSuggest
():
boolean
{
return
true
;
}
provideCompletionItems
(
model
:
editorCommon
.
IReadOnlyModel
,
position
:
Position
,
token
:
CancellationToken
):
Thenable
<
modes
.
ISuggestResult
[]
>
{
const
wordInfo
=
model
.
getWordUntilPosition
(
position
);
const
resource
=
model
.
uri
;
...
...
src/vs/platform/keybinding/common/keybindingResolver.ts
浏览文件 @
a42976ec
...
...
@@ -36,6 +36,7 @@ export class NormalizedKeybindingItem {
command
:
string
;
when
:
KbExpr
;
isDefault
:
boolean
;
actualCommand
:
string
;
public
static
fromKeybindingItem
(
source
:
IKeybindingItem
,
isDefault
:
boolean
):
NormalizedKeybindingItem
{
let
when
:
KbExpr
=
null
;
...
...
@@ -48,6 +49,7 @@ export class NormalizedKeybindingItem {
constructor
(
keybinding
:
number
,
command
:
string
,
when
:
KbExpr
,
isDefault
:
boolean
)
{
this
.
keybinding
=
keybinding
;
this
.
command
=
command
;
this
.
actualCommand
=
this
.
command
?
this
.
command
.
replace
(
/^
\^
/
,
''
)
:
this
.
command
;
this
.
when
=
when
;
this
.
isDefault
=
isDefault
;
}
...
...
@@ -115,7 +117,7 @@ export class KeybindingResolver {
}
private
static
_isTargetedForRemoval
(
defaultKb
:
NormalizedKeybindingItem
,
keybinding
:
number
,
command
:
string
,
when
:
KbExpr
):
boolean
{
if
(
defaultKb
.
c
ommand
!==
command
)
{
if
(
defaultKb
.
actualC
ommand
!==
command
)
{
return
false
;
}
if
(
keybinding
)
{
...
...
src/vs/platform/keybinding/test/common/keybindingService.test.ts
浏览文件 @
a42976ec
...
...
@@ -271,6 +271,33 @@ suite('Keybinding Service', () => {
]);
});
test
(
'
issue #612#issuecomment-222109084 cannot remove keybindings for commands with ^
'
,
function
()
{
let
defaults
:
IKeybindingItem
[]
=
[{
command
:
'
^yes1
'
,
when
:
KbExpr
.
equals
(
'
1
'
,
'
a
'
),
keybinding
:
KeyCode
.
KEY_A
,
weight1
:
0
,
weight2
:
0
},
{
command
:
'
yes2
'
,
when
:
KbExpr
.
equals
(
'
2
'
,
'
b
'
),
keybinding
:
KeyCode
.
KEY_B
,
weight1
:
0
,
weight2
:
0
}];
let
overrides
:
IKeybindingItem
[]
=
[{
command
:
'
-yes1
'
,
when
:
null
,
keybinding
:
KeyCode
.
KEY_A
,
weight1
:
0
,
weight2
:
0
}];
let
actual
=
KeybindingResolver
.
combine
(
defaults
,
overrides
);
assert
.
deepEqual
(
actual
,
[
new
NormalizedKeybindingItem
(
KeyCode
.
KEY_B
,
'
yes2
'
,
KbExpr
.
equals
(
'
2
'
,
'
b
'
),
true
)
]);
});
test
(
'
normalizeRule
'
,
function
()
{
let
key1IsTrue
=
KbExpr
.
equals
(
'
key1
'
,
true
);
let
key1IsNotFalse
=
KbExpr
.
notEquals
(
'
key1
'
,
false
);
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
a42976ec
...
...
@@ -976,6 +976,7 @@ export class MainThreadLanguageFeatures {
$registerSuggestSupport
(
handle
:
number
,
selector
:
vscode
.
DocumentSelector
,
triggerCharacters
:
string
[]):
TPromise
<
any
>
{
this
.
_registrations
[
handle
]
=
modes
.
SuggestRegistry
.
register
(
selector
,
<
modes
.
ISuggestSupport
>
{
triggerCharacters
:
triggerCharacters
,
shouldAutotriggerSuggest
:
true
,
provideCompletionItems
:
(
model
:
IReadOnlyModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
ISuggestResult
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideCompletionItems
(
handle
,
model
.
uri
,
position
));
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录