Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2470fe43
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,发现更多精彩内容 >>
提交
2470fe43
编写于
6月 30, 2016
作者:
K
kieferrm
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:Microsoft/vscode
上级
a1f6aadf
e8dafafc
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
48 addition
and
60 deletion
+48
-60
src/vs/workbench/parts/emmet/node/actions/base64.ts
src/vs/workbench/parts/emmet/node/actions/base64.ts
+21
-7
src/vs/workbench/parts/emmet/node/actions/updateTag.ts
src/vs/workbench/parts/emmet/node/actions/updateTag.ts
+3
-2
src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts
...orkbench/parts/emmet/node/actions/wrapWithAbbreviation.ts
+3
-2
src/vs/workbench/parts/emmet/node/emmet.d.ts
src/vs/workbench/parts/emmet/node/emmet.d.ts
+16
-2
src/vs/workbench/parts/emmet/node/emmetActions.ts
src/vs/workbench/parts/emmet/node/emmetActions.ts
+4
-6
src/vs/workbench/parts/emmet/node/fileAccessor.ts
src/vs/workbench/parts/emmet/node/fileAccessor.ts
+0
-27
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
.../parts/terminal/electron-browser/terminal.contribution.ts
+0
-8
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
+1
-2
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
...h/parts/terminal/electron-browser/terminalConfigHelper.ts
+0
-1
src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts
...orkbench/parts/terminal/test/terminalConfigHelper.test.ts
+0
-3
未找到文件。
src/vs/workbench/parts/emmet/node/actions/base64.ts
浏览文件 @
2470fe43
...
...
@@ -7,9 +7,11 @@
import
nls
=
require
(
'
vs/nls
'
);
import
*
as
Paths
from
'
vs/base/common/paths
'
;
import
*
as
emmet
from
'
emmet
'
;
import
{
fileExists
}
from
'
vs/base/node/pfs
'
;
import
{
createPath
}
from
'
vs/workbench/parts/emmet/node/fileAccessor
'
;
import
fs
=
require
(
'
fs
'
);
import
{
dirname
,
join
,
normalize
,
isValidBasename
}
from
'
vs/base/common/paths
'
;
import
{
EmmetEditorAction
}
from
'
vs/workbench/parts/emmet/node/emmetActions
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
...
...
@@ -19,6 +21,8 @@ import {IConfigurationService} from 'vs/platform/configuration/common/configurat
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IQuickOpenService
,
IInputOptions
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
class
EncodeDecodeDataUrlAction
extends
EmmetEditorAction
{
...
...
@@ -29,11 +33,21 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction {
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IWorkspaceContextService
private
workspaceContext
:
IWorkspaceContextService
,
@
IQuickOpenService
private
quickOpenService
:
IQuickOpenService
,
@
IMessageService
private
messageService
:
IMessageService
)
{
@
IMessageService
private
messageService
:
IMessageService
,
@
IFileService
private
fileService
:
IFileService
)
{
super
(
descriptor
,
editor
,
configurationService
);
}
public
runEmmetAction
(
_emmet
)
{
private
createPath
(
parent
:
string
,
fileName
:
string
):
string
{
// TO DO replace with IFileService
var
stat
=
fs
.
statSync
(
parent
);
if
(
stat
&&
!
stat
.
isDirectory
())
{
parent
=
dirname
(
parent
);
}
return
join
(
parent
,
fileName
);
};
public
runEmmetAction
(
_emmet
:
typeof
emmet
)
{
const
currentLine
=
this
.
editorAccessor
.
getCurrentLine
();
if
(
!
this
.
isDataURI
(
currentLine
))
{
this
.
encodeDecode
(
_emmet
);
...
...
@@ -58,7 +72,7 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction {
}
this
.
imageFilePath
=
path
;
const
fullpath
=
createPath
(
this
.
editorAccessor
.
getFilePath
(),
path
);
const
fullpath
=
this
.
createPath
(
this
.
editorAccessor
.
getFilePath
(),
path
);
return
fileExists
(
fullpath
);
})
.
then
(
status
=>
{
...
...
@@ -97,12 +111,12 @@ class EncodeDecodeDataUrlAction extends EmmetEditorAction {
// Validate all segments of path without absolute and empty segments
// Valid: `images/test.png`, `./test.png`, `../images/test.png`, `\images\test.png`
let
isValidFilePath
=
true
;
const
filePathSegments
=
Paths
.
normalize
(
input
).
split
(
'
/
'
).
filter
(
segment
=>
{
const
filePathSegments
=
normalize
(
input
).
split
(
'
/
'
).
filter
(
segment
=>
{
return
segment
.
length
!==
0
&&
segment
!==
'
..
'
;
});
for
(
let
i
=
0
;
i
<
filePathSegments
.
length
;
i
++
)
{
if
(
!
Paths
.
isValidBasename
(
filePathSegments
[
i
]))
{
if
(
!
isValidBasename
(
filePathSegments
[
i
]))
{
isValidFilePath
=
false
;
break
;
}
...
...
src/vs/workbench/parts/emmet/node/actions/updateTag.ts
浏览文件 @
2470fe43
...
...
@@ -7,6 +7,7 @@
import
nls
=
require
(
'
vs/nls
'
);
import
{
EmmetEditorAction
}
from
'
vs/workbench/parts/emmet/node/emmetActions
'
;
import
*
as
emmet
from
'
emmet
'
;
import
{
CommonEditorRegistry
,
EditorActionDescriptor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IEditorActionDescriptorData
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -23,7 +24,7 @@ class UpdateTagAction extends EmmetEditorAction {
super
(
descriptor
,
editor
,
configurationService
);
}
public
runEmmetAction
(
_emmet
)
{
public
runEmmetAction
(
_emmet
:
typeof
emmet
)
{
let
options
:
IInputOptions
=
{
prompt
:
nls
.
localize
(
'
enterTag
'
,
'
Enter Tag
'
),
placeHolder
:
nls
.
localize
(
'
tag
'
,
'
Tag
'
)
...
...
@@ -33,7 +34,7 @@ class UpdateTagAction extends EmmetEditorAction {
});
}
private
wrapAbbreviation
(
_emmet
:
any
,
tag
)
{
private
wrapAbbreviation
(
_emmet
:
typeof
emmet
,
tag
)
{
if
(
tag
&&
!
_emmet
.
run
(
'
update_tag
'
,
this
.
editorAccessor
,
tag
))
{
this
.
noExpansionOccurred
();
}
...
...
src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts
浏览文件 @
2470fe43
...
...
@@ -7,6 +7,7 @@
import
nls
=
require
(
'
vs/nls
'
);
import
{
EmmetEditorAction
}
from
'
vs/workbench/parts/emmet/node/emmetActions
'
;
import
*
as
emmet
from
'
emmet
'
;
import
{
CommonEditorRegistry
,
EditorActionDescriptor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IEditorActionDescriptorData
,
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
...
...
@@ -23,7 +24,7 @@ class WrapWithAbbreviationAction extends EmmetEditorAction {
super
(
descriptor
,
editor
,
configurationService
);
}
public
runEmmetAction
(
_emmet
)
{
public
runEmmetAction
(
_emmet
:
typeof
emmet
)
{
let
options
:
IInputOptions
=
{
prompt
:
nls
.
localize
(
'
enterAbbreviation
'
,
"
Enter Abbreviation
"
),
placeHolder
:
nls
.
localize
(
'
abbreviation
'
,
"
Abbreviation
"
)
...
...
@@ -33,7 +34,7 @@ class WrapWithAbbreviationAction extends EmmetEditorAction {
});
}
private
wrapAbbreviation
(
_emmet
:
any
,
abbreviation
)
{
private
wrapAbbreviation
(
_emmet
:
typeof
emmet
,
abbreviation
)
{
if
(
abbreviation
&&
!
_emmet
.
run
(
'
wrap_with_abbreviation
'
,
this
.
editorAccessor
,
abbreviation
))
{
this
.
noExpansionOccurred
();
}
...
...
src/vs/workbench/parts/emmet/node/emmet.d.ts
浏览文件 @
2470fe43
...
...
@@ -10,6 +10,16 @@ declare module 'emmet' {
end
:
number
;
}
export
interface
Preferences
{
set
(
key
:
string
,
value
:
string
);
define
(
key
:
string
,
value
:
string
);
remove
(
key
:
string
);
}
export
interface
Profiles
{
reset
();
}
export
interface
Editor
{
/**
* Returns character indexes of selected text: object with <code>start</code>
...
...
@@ -134,7 +144,11 @@ declare module 'emmet' {
* @param {IEmmetEditor} editor Editor instance
* @return {Boolean} Returns true if action was performed successfully
*/
export
function
run
(
action
:
string
,
editor
:
Editor
):
boolean
;
export
function
run
(
action
:
string
,
editor
:
Editor
,
arg
?:
string
):
boolean
;
export
var
preferences
:
Preferences
;
export
var
profile
:
Profiles
;
export
function
file
(
fileAccessor
:
any
):
void
;
export
function
loadProfiles
(
profiles
:
any
)
;
}
src/vs/workbench/parts/emmet/node/emmetActions.ts
浏览文件 @
2470fe43
...
...
@@ -11,7 +11,6 @@ import {EditorAction} from 'vs/editor/common/editorAction';
import
{
Behaviour
}
from
'
vs/editor/common/editorActionEnablement
'
;
import
{
EditorAccessor
}
from
'
vs/workbench/parts/emmet/node/editorAccessor
'
;
import
*
as
fileAccessor
from
'
vs/workbench/parts/emmet/node/fileAccessor
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
*
as
emmet
from
'
emmet
'
;
...
...
@@ -34,7 +33,7 @@ export abstract class EmmetEditorAction extends EditorAction {
this
.
configurationService
=
configurationService
;
}
private
updateEmmetPreferences
(
_emmet
:
any
)
{
private
updateEmmetPreferences
(
_emmet
:
typeof
emmet
)
{
let
preferences
=
this
.
configurationService
.
getConfiguration
<
IEmmetConfiguration
>
().
emmet
.
preferences
;
for
(
let
key
in
preferences
)
{
try
{
...
...
@@ -50,7 +49,7 @@ export abstract class EmmetEditorAction extends EditorAction {
}
}
private
resetEmmetPreferences
(
_emmet
:
any
)
{
private
resetEmmetPreferences
(
_emmet
:
typeof
emmet
)
{
let
preferences
=
this
.
configurationService
.
getConfiguration
<
IEmmetConfiguration
>
().
emmet
.
preferences
;
for
(
let
key
in
preferences
)
{
try
{
...
...
@@ -60,7 +59,7 @@ export abstract class EmmetEditorAction extends EditorAction {
}
}
abstract
runEmmetAction
(
_emmet
:
any
);
abstract
runEmmetAction
(
_emmet
:
typeof
emmet
);
protected
noExpansionOccurred
()
{
// default do nothing
...
...
@@ -73,7 +72,6 @@ export abstract class EmmetEditorAction extends EditorAction {
}
return
this
.
_withEmmet
().
then
((
_emmet
)
=>
{
_emmet
.
file
(
fileAccessor
);
this
.
_withEmmetPreferences
(
_emmet
,
()
=>
{
this
.
editorAccessor
.
onBeforeEmmetAction
();
this
.
runEmmetAction
(
_emmet
);
...
...
@@ -110,7 +108,7 @@ export class BasicEmmetEditorAction extends EmmetEditorAction {
this
.
emmetActionName
=
actionName
;
}
public
runEmmetAction
(
_emmet
)
{
public
runEmmetAction
(
_emmet
:
typeof
emmet
)
{
if
(
!
_emmet
.
run
(
this
.
emmetActionName
,
this
.
editorAccessor
))
{
this
.
noExpansionOccurred
();
}
...
...
src/vs/workbench/parts/emmet/node/fileAccessor.ts
已删除
100644 → 0
浏览文件 @
a1f6aadf
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
fs
=
require
(
'
fs
'
);
import
{
dirname
,
join
}
from
'
vs/base/common/paths
'
;
import
{
mkdirp
,
writeFile
}
from
'
vs/base/node/pfs
'
;
export
function
createPath
(
parent
:
string
,
fileName
:
string
):
string
{
var
stat
=
fs
.
statSync
(
parent
);
if
(
stat
&&
!
stat
.
isDirectory
())
{
parent
=
dirname
(
parent
);
}
return
join
(
parent
,
fileName
);
};
export
function
save
(
file
:
string
,
content
:
string
):
any
{
mkdirp
(
dirname
(
file
)).
then
(()
=>
{
return
writeFile
(
file
,
content
,
'
ascii
'
);
},
err
=>
{
//
});
}
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
浏览文件 @
2470fe43
...
...
@@ -55,14 +55,6 @@ configurationRegistry.registerConfiguration({
'
type
'
:
'
string
'
,
'
default
'
:
TERMINAL_DEFAULT_SHELL_WINDOWS
},
'
terminal.integrated.shellArgs.windows
'
:
{
'
description
'
:
nls
.
localize
(
'
terminal.integrated.shellArgs.windows
'
,
"
The command line arguments to use when on the Windows terminal.
"
),
'
type
'
:
'
array
'
,
'
items
'
:
{
'
type
'
:
'
string
'
},
'
default
'
:
[]
},
'
terminal.integrated.fontFamily
'
:
{
'
description
'
:
nls
.
localize
(
'
terminal.integrated.fontFamily
'
,
"
Controls the font family of the terminal, this defaults to editor.fontFamily's value.
"
),
'
type
'
:
'
string
'
...
...
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
浏览文件 @
2470fe43
...
...
@@ -32,8 +32,7 @@ export interface ITerminalConfiguration {
},
shellArgs
:
{
linux
:
string
[],
osx
:
string
[],
windows
:
string
[]
osx
:
string
[]
},
fontFamily
:
string
,
fontSize
:
number
,
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
浏览文件 @
2470fe43
...
...
@@ -150,7 +150,6 @@ export class TerminalConfigHelper {
};
if
(
this
.
platform
===
Platform
.
Windows
)
{
shell
.
executable
=
config
.
terminal
.
integrated
.
shell
.
windows
;
shell
.
args
=
config
.
terminal
.
integrated
.
shellArgs
.
windows
;
}
else
if
(
this
.
platform
===
Platform
.
Mac
)
{
shell
.
executable
=
config
.
terminal
.
integrated
.
shell
.
osx
;
shell
.
args
=
config
.
terminal
.
integrated
.
shellArgs
.
osx
;
...
...
src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts
浏览文件 @
2470fe43
...
...
@@ -164,9 +164,6 @@ suite('Workbench - TerminalConfigHelper', () => {
integrated
:
{
shell
:
{
windows
:
'
foo
'
},
shellArgs
:
{
windows
:
[]
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录