Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
edecd8bc
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
edecd8bc
编写于
7月 21, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adopt css to language-configuration
上级
f4a8c7a5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
95 addition
and
55 deletion
+95
-55
extensions/css/client/src/cssMain.ts
extensions/css/client/src/cssMain.ts
+3
-46
extensions/css/language-configuration.json
extensions/css/language-configuration.json
+24
-0
extensions/css/package.json
extensions/css/package.json
+2
-1
extensions/less/language-configuration.json
extensions/less/language-configuration.json
+27
-0
extensions/less/package.json
extensions/less/package.json
+2
-1
extensions/scss/language-configuration.json
extensions/scss/language-configuration.json
+27
-0
extensions/scss/package.json
extensions/scss/package.json
+2
-1
src/vs/editor/node/languageConfiguration.ts
src/vs/editor/node/languageConfiguration.ts
+8
-6
未找到文件。
extensions/css/client/src/cssMain.ts
浏览文件 @
edecd8bc
...
@@ -54,58 +54,15 @@ export function activate(context: ExtensionContext) {
...
@@ -54,58 +54,15 @@ export function activate(context: ExtensionContext) {
context
.
subscriptions
.
push
(
disposable
);
context
.
subscriptions
.
push
(
disposable
);
languages
.
setLanguageConfiguration
(
'
css
'
,
{
languages
.
setLanguageConfiguration
(
'
css
'
,
{
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
*
(?=[^
,{;
]
*
[
,{
]))
|
(([
@#.!
])?[\w
-?
]
+%
?
|
[
@#!.
])
/g
,
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
*
(?=[^
,{;
]
*
[
,{
]))
|
(([
@#.!
])?[\w
-?
]
+%
?
|
[
@#!.
])
/g
comments
:
{
blockComment
:
[
'
/*
'
,
'
*/
'
]
},
brackets
:
[[
'
{
'
,
'
}
'
],
[
'
[
'
,
'
]
'
],
[
'
(
'
,
'
)
'
]],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
{
'
,
close
:
'
}
'
},
{
open
:
'
[
'
,
close
:
'
]
'
},
{
open
:
'
(
'
,
close
:
'
)
'
},
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
]
}
]
}
});
});
languages
.
setLanguageConfiguration
(
'
less
'
,
{
languages
.
setLanguageConfiguration
(
'
less
'
,
{
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
+
(?=[^
,{;
]
*
[
,{
]))
|
(([
@#.!
])?[\w
-?
]
+%
?
|
[
@#!.
])
/g
,
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
+
(?=[^
,{;
]
*
[
,{
]))
|
(([
@#.!
])?[\w
-?
]
+%
?
|
[
@#!.
])
/g
comments
:
{
blockComment
:
[
'
/*
'
,
'
*/
'
],
lineComment
:
'
//
'
},
brackets
:
[[
'
{
'
,
'
}
'
],
[
'
[
'
,
'
]
'
],
[
'
(
'
,
'
)
'
],
[
'
<
'
,
'
>
'
]],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
(
'
,
close
:
'
)
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
<
'
,
close
:
'
>
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
]
}
});
});
languages
.
setLanguageConfiguration
(
'
scss
'
,
{
languages
.
setLanguageConfiguration
(
'
scss
'
,
{
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
*
(?=[^
,{;
]
*
[
,{
]))
|
(([
@$#.!
])?[\w
-?
]
+%
?
|
[
@#!$.
])
/g
,
wordPattern
:
/
(
#
?
-
?\d
*
\.\d\w
*%
?)
|
(
::
?[\w
-
]
*
(?=[^
,{;
]
*
[
,{
]))
|
(([
@$#.!
])?[\w
-?
]
+%
?
|
[
@#!$.
])
/g
comments
:
{
blockComment
:
[
'
/*
'
,
'
*/
'
],
lineComment
:
'
//
'
},
brackets
:
[[
'
{
'
,
'
}
'
],
[
'
[
'
,
'
]
'
],
[
'
(
'
,
'
)
'
],
[
'
<
'
,
'
>
'
]],
__characterPairSupport
:
{
autoClosingPairs
:
[
{
open
:
'
"
'
,
close
:
'
"
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
\'
'
,
close
:
'
\'
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
{
'
,
close
:
'
}
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
[
'
,
close
:
'
]
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
(
'
,
close
:
'
)
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
{
open
:
'
<
'
,
close
:
'
>
'
,
notIn
:
[
'
string
'
,
'
comment
'
]
},
]
}
});
});
commands
.
registerCommand
(
'
_css.applyCodeAction
'
,
applyCodeAction
);
commands
.
registerCommand
(
'
_css.applyCodeAction
'
,
applyCodeAction
);
...
...
extensions/css/language-configuration.json
0 → 100644
浏览文件 @
edecd8bc
{
"comments"
:
{
"blockComment"
:
[
"/*"
,
"*/"
]
},
"brackets"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
]
],
"autoClosingPairs"
:
[
{
"open"
:
"{"
,
"close"
:
"}"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"["
,
"close"
:
"]"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"("
,
"close"
:
")"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"
\"
"
,
"close"
:
"
\"
"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"'"
,
"close"
:
"'"
,
"notIn"
:
[
"string"
,
"comment"
]
}
],
"surroundingPairs"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
],
[
"
\"
"
,
"
\"
"
],
[
"'"
,
"'"
]
]
}
\ No newline at end of file
extensions/css/package.json
浏览文件 @
edecd8bc
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
"id"
:
"css"
,
"id"
:
"css"
,
"aliases"
:
[
"CSS"
,
"css"
],
"aliases"
:
[
"CSS"
,
"css"
],
"extensions"
:
[
".css"
],
"extensions"
:
[
".css"
],
"mimetypes"
:
[
"text/css"
]
"mimetypes"
:
[
"text/css"
],
"configuration"
:
"./language-configuration.json"
}],
}],
"grammars"
:
[{
"grammars"
:
[{
"language"
:
"css"
,
"language"
:
"css"
,
...
...
extensions/less/language-configuration.json
0 → 100644
浏览文件 @
edecd8bc
{
"comments"
:
{
"blockComment"
:
[
"/*"
,
"*/"
],
"lineComment"
:
"//"
},
"brackets"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
],
[
"<"
,
">"
]
],
"autoClosingPairs"
:
[
{
"open"
:
"{"
,
"close"
:
"}"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"["
,
"close"
:
"]"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"("
,
"close"
:
")"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"
\"
"
,
"close"
:
"
\"
"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"'"
,
"close"
:
"'"
,
"notIn"
:
[
"string"
,
"comment"
]
}
],
"surroundingPairs"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
],
[
"
\"
"
,
"
\"
"
],
[
"'"
,
"'"
],
[
"<"
,
">"
]
]
}
\ No newline at end of file
extensions/less/package.json
浏览文件 @
edecd8bc
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
"id"
:
"less"
,
"id"
:
"less"
,
"aliases"
:
[
"Less"
,
"less"
],
"aliases"
:
[
"Less"
,
"less"
],
"extensions"
:
[
".less"
],
"extensions"
:
[
".less"
],
"mimetypes"
:
[
"text/x-less"
,
"text/less"
]
"mimetypes"
:
[
"text/x-less"
,
"text/less"
],
"configuration"
:
"./language-configuration.json"
}],
}],
"grammars"
:
[{
"grammars"
:
[{
"language"
:
"less"
,
"language"
:
"less"
,
...
...
extensions/scss/language-configuration.json
0 → 100644
浏览文件 @
edecd8bc
{
"comments"
:
{
"blockComment"
:
[
"/*"
,
"*/"
],
"lineComment"
:
"//"
},
"brackets"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
],
[
"<"
,
">"
]
],
"autoClosingPairs"
:
[
{
"open"
:
"{"
,
"close"
:
"}"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"["
,
"close"
:
"]"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"("
,
"close"
:
")"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"
\"
"
,
"close"
:
"
\"
"
,
"notIn"
:
[
"string"
,
"comment"
]
},
{
"open"
:
"'"
,
"close"
:
"'"
,
"notIn"
:
[
"string"
,
"comment"
]
}
],
"surroundingPairs"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
],
[
"
\"
"
,
"
\"
"
],
[
"'"
,
"'"
],
[
"<"
,
">"
]
]
}
\ No newline at end of file
extensions/scss/package.json
浏览文件 @
edecd8bc
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
"id"
:
"scss"
,
"id"
:
"scss"
,
"aliases"
:
[
"Sass"
,
"scss"
],
"aliases"
:
[
"Sass"
,
"scss"
],
"extensions"
:
[
".scss"
],
"extensions"
:
[
".scss"
],
"mimetypes"
:
[
"text/x-scss"
,
"text/scss"
]
"mimetypes"
:
[
"text/x-scss"
,
"text/scss"
],
"configuration"
:
"./language-configuration.json"
}],
}],
"grammars"
:
[{
"grammars"
:
[{
"language"
:
"scss"
,
"language"
:
"scss"
,
...
...
src/vs/editor/node/languageConfiguration.ts
浏览文件 @
edecd8bc
...
@@ -9,7 +9,7 @@ import {parse} from 'vs/base/common/json';
...
@@ -9,7 +9,7 @@ import {parse} from 'vs/base/common/json';
import
{
readFile
}
from
'
vs/base/node/pfs
'
;
import
{
readFile
}
from
'
vs/base/node/pfs
'
;
import
{
LanguageConfiguration
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
import
{
LanguageConfiguration
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IAutoClosingPair
}
from
'
vs/editor/common/modes
'
;
import
{
IAutoClosingPair
,
IAutoClosingPairConditional
}
from
'
vs/editor/common/modes
'
;
import
{
LanguageConfigurationRegistry
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
import
{
LanguageConfigurationRegistry
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
type
CharacterPair
=
[
string
,
string
];
type
CharacterPair
=
[
string
,
string
];
...
@@ -22,8 +22,8 @@ interface ICommentRule {
...
@@ -22,8 +22,8 @@ interface ICommentRule {
interface
ILanguageConfiguration
{
interface
ILanguageConfiguration
{
comments
?:
ICommentRule
;
comments
?:
ICommentRule
;
brackets
?:
CharacterPair
[];
brackets
?:
CharacterPair
[];
autoClosingPairs
?:
CharacterPair
[];
autoClosingPairs
?:
(
CharacterPair
|
IAutoClosingPairConditional
)
[];
surroundingPairs
?:
CharacterPair
[];
surroundingPairs
?:
(
CharacterPair
|
IAutoClosingPair
)
[];
}
}
export
class
LanguageConfigurationFileHandler
{
export
class
LanguageConfigurationFileHandler
{
...
@@ -92,10 +92,12 @@ export class LanguageConfigurationFileHandler {
...
@@ -92,10 +92,12 @@ export class LanguageConfigurationFileHandler {
LanguageConfigurationRegistry
.
register
(
modeId
,
richEditConfig
);
LanguageConfigurationRegistry
.
register
(
modeId
,
richEditConfig
);
}
}
private
_mapCharacterPairs
(
pairs
:
CharacterPair
[]):
IAutoClosingPair
[]
{
private
_mapCharacterPairs
(
pairs
:
(
CharacterPair
|
IAutoClosingPairConditional
)[]):
IAutoClosingPairConditional
[]
{
return
pairs
.
map
(
pair
=>
{
return
pairs
.
map
(
pair
=>
{
let
[
open
,
close
]
=
pair
;
if
(
Array
.
isArray
(
pair
))
{
return
{
open
:
open
,
close
:
close
};
return
{
open
:
pair
[
0
],
close
:
pair
[
1
]
};
}
return
<
IAutoClosingPairConditional
>
pair
;
});
});
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录