mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Merge remote-tracking branch 'upstream/master' into fix-71570
* upstream/master: (34 commits) Fix markdown.styled regression caused by Uri.parse changes Process explorer refactoring fix compile error fix open workspace uri from cli Delete deprecated search provider stub test dependenices are devDependencies Fix default uri when scheme is file disable flaky test, #71801 use `readonly T[]` instead of `ReadonlyArray<T>` simplify protocol check Let enablment service handles local workspace extensions in remote window debt - make ext host init data more complete Fix colorization tests fixes #71671 Update grammars Add yes-no choice for overwriting existing file for save as update distro ExtensionEnablementService: - Remove getDisabledExtensions and instead use isEnabled or getEnablementState methods Simplify reload action and fix test Update distro hash ...
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
"git": {
|
||||
"name": "jeff-hykin/cpp-textmate-grammar",
|
||||
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
|
||||
"commitHash": "d57808aa3db2242f1f2be1aec19649a852aaa52e"
|
||||
"commitHash": "47f33650b7eee1cc3d5c9e72a85ac415797a08db"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "1.4.5",
|
||||
"version": "1.6.7",
|
||||
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@
|
||||
},
|
||||
{
|
||||
"c": "fprintf",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -67,7 +67,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -78,7 +78,7 @@
|
||||
},
|
||||
{
|
||||
"c": "stderr",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -89,7 +89,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -100,7 +100,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -111,7 +111,7 @@
|
||||
},
|
||||
{
|
||||
"c": "num_candidate_ret=",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -122,7 +122,7 @@
|
||||
},
|
||||
{
|
||||
"c": "%d",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -133,7 +133,7 @@
|
||||
},
|
||||
{
|
||||
"c": ":",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -144,7 +144,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -155,7 +155,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -166,7 +166,7 @@
|
||||
},
|
||||
{
|
||||
"c": " num_candidate",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -177,7 +177,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -221,7 +221,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp punctuation.section.parens.begin.bracket.round.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp punctuation.section.parens.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -232,7 +232,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -243,7 +243,7 @@
|
||||
},
|
||||
{
|
||||
"c": " i",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -254,7 +254,7 @@
|
||||
},
|
||||
{
|
||||
"c": "=",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp keyword.operator.assignment.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp keyword.operator.assignment.cpp",
|
||||
"r": {
|
||||
"dark_plus": "keyword.operator: #D4D4D4",
|
||||
"light_plus": "keyword.operator: #000000",
|
||||
@@ -265,7 +265,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp constant.numeric.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp constant.numeric.decimal.cpp",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -276,7 +276,7 @@
|
||||
},
|
||||
{
|
||||
"c": ";",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp punctuation.terminator.statement.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp punctuation.terminator.statement.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -287,7 +287,7 @@
|
||||
},
|
||||
{
|
||||
"c": "i",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -298,7 +298,7 @@
|
||||
},
|
||||
{
|
||||
"c": "<",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp keyword.operator.comparison.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp keyword.operator.comparison.cpp",
|
||||
"r": {
|
||||
"dark_plus": "keyword.operator: #D4D4D4",
|
||||
"light_plus": "keyword.operator: #000000",
|
||||
@@ -309,7 +309,7 @@
|
||||
},
|
||||
{
|
||||
"c": "num_candidate",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -320,7 +320,7 @@
|
||||
},
|
||||
{
|
||||
"c": ";",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp punctuation.terminator.statement.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp punctuation.terminator.statement.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -331,7 +331,7 @@
|
||||
},
|
||||
{
|
||||
"c": "++",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp keyword.operator.increment.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp keyword.operator.increment.cpp",
|
||||
"r": {
|
||||
"dark_plus": "keyword.operator: #D4D4D4",
|
||||
"light_plus": "keyword.operator: #000000",
|
||||
@@ -342,7 +342,7 @@
|
||||
},
|
||||
{
|
||||
"c": "i",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -353,7 +353,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp punctuation.section.parens-c\b.cpp punctuation.section.parens.end.bracket.round.cpp",
|
||||
"t": "source.cpp punctuation.section.parens-c.cpp punctuation.section.parens.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -375,7 +375,7 @@
|
||||
},
|
||||
{
|
||||
"c": "fprintf",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -386,7 +386,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -397,7 +397,7 @@
|
||||
},
|
||||
{
|
||||
"c": "stderr",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -408,7 +408,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -419,7 +419,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -430,7 +430,7 @@
|
||||
},
|
||||
{
|
||||
"c": "%d",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp constant.other.placeholder.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -441,7 +441,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -452,7 +452,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -463,7 +463,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -474,7 +474,7 @@
|
||||
},
|
||||
{
|
||||
"c": "user_candidate",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp variable.object.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp variable.other.object.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -485,7 +485,7 @@
|
||||
},
|
||||
{
|
||||
"c": "[",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.begin.bracket.square.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -496,7 +496,7 @@
|
||||
},
|
||||
{
|
||||
"c": "i",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -507,7 +507,7 @@
|
||||
},
|
||||
{
|
||||
"c": "]",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp meta.bracket.square.access.cpp punctuation.definition.end.bracket.square.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -518,7 +518,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -551,7 +551,7 @@
|
||||
},
|
||||
{
|
||||
"c": "fprintf",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -562,7 +562,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -573,7 +573,7 @@
|
||||
},
|
||||
{
|
||||
"c": "stderr",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -584,7 +584,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -595,7 +595,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.begin.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -606,7 +606,7 @@
|
||||
},
|
||||
{
|
||||
"c": ";",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -617,7 +617,7 @@
|
||||
},
|
||||
{
|
||||
"c": "\"",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp string.quoted.double.cpp punctuation.definition.string.end.cpp",
|
||||
"r": {
|
||||
"dark_plus": "string: #CE9178",
|
||||
"light_plus": "string: #A31515",
|
||||
@@ -628,7 +628,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -683,7 +683,7 @@
|
||||
},
|
||||
{
|
||||
"c": "void",
|
||||
"t": "source.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -705,7 +705,7 @@
|
||||
},
|
||||
{
|
||||
"c": "main",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -716,7 +716,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -727,7 +727,7 @@
|
||||
},
|
||||
{
|
||||
"c": "O ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -738,7 +738,7 @@
|
||||
},
|
||||
{
|
||||
"c": "obj",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.probably.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -749,7 +749,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1002,7 +1002,7 @@
|
||||
},
|
||||
{
|
||||
"c": "obj",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp variable.object.access.cpp variable.object.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.object.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -1013,18 +1013,18 @@
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp variable.object.access.cpp punctuation.separator.dot-access.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.separator.dot-access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "x",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp variable.object.access.cpp variable.other.member.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp variable.other.member.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -1178,7 +1178,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.block.cpp punctuation.separator.namespace.access.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.scope-resolution.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1189,7 +1189,7 @@
|
||||
},
|
||||
{
|
||||
"c": "std",
|
||||
"t": "source.cpp meta.block.cpp punctuation.separator.namespace.access.cpp entity.scope.name.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.scope-resolution.cpp entity.name.namespace.scope-resolution.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1200,7 +1200,7 @@
|
||||
},
|
||||
{
|
||||
"c": "::",
|
||||
"t": "source.cpp meta.block.cpp punctuation.separator.namespace.access.cpp punctuation.separator.namespace.access.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1507,7 +1507,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " ...",
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
@@ -1517,6 +1517,17 @@
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "...",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.vararg-ellipses.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.cpp punctuation.section.arguments.end.bracket.round.cpp",
|
||||
@@ -1552,7 +1563,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -1574,7 +1585,7 @@
|
||||
},
|
||||
{
|
||||
"c": "main2",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -1585,7 +1596,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1596,7 +1607,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
|
||||
@@ -111,13 +111,13 @@
|
||||
},
|
||||
{
|
||||
"c": "namespace",
|
||||
"t": "source.cpp meta.using-namespace-declaration.cpp keyword.other.namespace.directive.cpp",
|
||||
"t": "source.cpp meta.using-namespace-declaration.cpp keyword.other.namespace.directive storage.type.namespace.directive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "keyword: #569CD6",
|
||||
"light_plus": "keyword: #0000FF",
|
||||
"dark_vs": "keyword: #569CD6",
|
||||
"light_vs": "keyword: #0000FF",
|
||||
"hc_black": "keyword: #569CD6"
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
"dark_vs": "storage.type: #569CD6",
|
||||
"light_vs": "storage.type: #0000FF",
|
||||
"hc_black": "storage.type: #569CD6"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -133,13 +133,13 @@
|
||||
},
|
||||
{
|
||||
"c": "std",
|
||||
"t": "source.cpp meta.using-namespace-declaration.cpp entity.name.type.namespace.cpp",
|
||||
"t": "source.cpp meta.using-namespace-declaration.cpp entity.name.namespace.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.type: #4EC9B0",
|
||||
"light_plus": "entity.name.type: #267F99",
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "entity.name.type: #4EC9B0"
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -177,7 +177,7 @@
|
||||
},
|
||||
{
|
||||
"c": "Rectangle",
|
||||
"t": "source.cpp meta.class-struct-block.cpp entity.name.type.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp entity.name.type.class Rectangle.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.type: #4EC9B0",
|
||||
"light_plus": "entity.name.type: #267F99",
|
||||
@@ -221,7 +221,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -287,7 +287,7 @@
|
||||
},
|
||||
{
|
||||
"c": "public:",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.modifier.access.control.public.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.modifier.access.control.public:.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -309,7 +309,7 @@
|
||||
},
|
||||
{
|
||||
"c": "void",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -331,7 +331,7 @@
|
||||
},
|
||||
{
|
||||
"c": "set_values",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -342,7 +342,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -353,7 +353,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -364,7 +364,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -375,7 +375,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -386,7 +386,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -397,7 +397,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -430,7 +430,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -452,7 +452,7 @@
|
||||
},
|
||||
{
|
||||
"c": "area",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -463,7 +463,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -474,7 +474,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.class-struct-block.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -595,7 +595,7 @@
|
||||
},
|
||||
{
|
||||
"c": "void",
|
||||
"t": "source.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -606,7 +606,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp punctuation.separator.namespace.access.cpp",
|
||||
"t": "source.cpp meta.scope-resolution.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -617,7 +617,7 @@
|
||||
},
|
||||
{
|
||||
"c": "Rectangle",
|
||||
"t": "source.cpp punctuation.separator.namespace.access.cpp entity.scope.name.cpp",
|
||||
"t": "source.cpp meta.scope-resolution.cpp entity.name.namespace.scope-resolution.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -628,7 +628,7 @@
|
||||
},
|
||||
{
|
||||
"c": "::",
|
||||
"t": "source.cpp punctuation.separator.namespace.access.cpp punctuation.separator.namespace.access.cpp",
|
||||
"t": "source.cpp meta.scope-resolution.cpp punctuation.separator.namespace.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -639,7 +639,7 @@
|
||||
},
|
||||
{
|
||||
"c": "set_values",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -650,7 +650,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -661,7 +661,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -672,7 +672,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -683,7 +683,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -694,7 +694,7 @@
|
||||
},
|
||||
{
|
||||
"c": "x",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.probably.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -705,7 +705,7 @@
|
||||
},
|
||||
{
|
||||
"c": ",",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.separator.delimiter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -716,7 +716,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -727,7 +727,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -738,7 +738,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -749,7 +749,7 @@
|
||||
},
|
||||
{
|
||||
"c": "y",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp variable.parameter.probably.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp variable.parameter.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -760,7 +760,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -892,7 +892,7 @@
|
||||
},
|
||||
{
|
||||
"c": "int",
|
||||
"t": "source.cpp storage.type.language.primitive.cpp",
|
||||
"t": "source.cpp storage.type.primitive.cpp",
|
||||
"r": {
|
||||
"dark_plus": "storage.type: #569CD6",
|
||||
"light_plus": "storage.type: #0000FF",
|
||||
@@ -914,7 +914,7 @@
|
||||
},
|
||||
{
|
||||
"c": "main",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp entity.name.function.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -925,7 +925,7 @@
|
||||
},
|
||||
{
|
||||
"c": " ",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -936,7 +936,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.begin.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -947,7 +947,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.function.definition.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"t": "source.cpp meta.function.definition.parameters.cpp meta.function.definition.parameters.cpp punctuation.section.parameters.end.bracket.round.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1013,7 +1013,7 @@
|
||||
},
|
||||
{
|
||||
"c": "rect",
|
||||
"t": "source.cpp meta.block.cpp variable.object.access.cpp variable.object.cpp",
|
||||
"t": "source.cpp meta.block.cpp variable.other.object.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -1024,18 +1024,18 @@
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.cpp meta.block.cpp variable.object.access.cpp punctuation.separator.dot-access.cpp",
|
||||
"t": "source.cpp meta.block.cpp punctuation.separator.dot-access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "variable: #9CDCFE"
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "set_values",
|
||||
"t": "source.cpp meta.block.cpp variable.object.access.cpp variable.other.member.cpp",
|
||||
"t": "source.cpp meta.block.cpp variable.other.member.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -1068,7 +1068,7 @@
|
||||
},
|
||||
{
|
||||
"c": "3",
|
||||
"t": "source.cpp meta.block.cpp meta.block.parens.cpp constant.numeric.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.block.parens.cpp constant.numeric.decimal.cpp",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1090,7 +1090,7 @@
|
||||
},
|
||||
{
|
||||
"c": "4",
|
||||
"t": "source.cpp meta.block.cpp meta.block.parens.cpp constant.numeric.cpp",
|
||||
"t": "source.cpp meta.block.cpp meta.block.parens.cpp constant.numeric.decimal.cpp",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
@@ -1222,7 +1222,7 @@
|
||||
},
|
||||
{
|
||||
"c": "rect",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.member.cpp variable.object.cpp",
|
||||
"t": "source.cpp meta.block.cpp variable.other.object.access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "variable: #9CDCFE",
|
||||
"light_plus": "variable: #001080",
|
||||
@@ -1233,7 +1233,7 @@
|
||||
},
|
||||
{
|
||||
"c": ".",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.member.cpp punctuation.separator.dot-access.cpp",
|
||||
"t": "source.cpp meta.block.cpp punctuation.separator.dot-access.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1244,7 +1244,7 @@
|
||||
},
|
||||
{
|
||||
"c": "area",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.member.cpp entity.name.function.member.cpp",
|
||||
"t": "source.cpp meta.block.cpp entity.name.function.member.cpp",
|
||||
"r": {
|
||||
"dark_plus": "entity.name.function: #DCDCAA",
|
||||
"light_plus": "entity.name.function: #795E26",
|
||||
@@ -1255,7 +1255,7 @@
|
||||
},
|
||||
{
|
||||
"c": "(",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.member.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp",
|
||||
"t": "source.cpp meta.block.cpp punctuation.section.arguments.begin.bracket.round.function.member.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1266,7 +1266,7 @@
|
||||
},
|
||||
{
|
||||
"c": ")",
|
||||
"t": "source.cpp meta.block.cpp meta.function-call.member.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp",
|
||||
"t": "source.cpp meta.block.cpp punctuation.section.arguments.end.bracket.round.function.member.cpp",
|
||||
"r": {
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
@@ -1321,7 +1321,7 @@
|
||||
},
|
||||
{
|
||||
"c": "0",
|
||||
"t": "source.cpp meta.block.cpp constant.numeric.cpp",
|
||||
"t": "source.cpp meta.block.cpp constant.numeric.decimal.cpp",
|
||||
"r": {
|
||||
"dark_plus": "constant.numeric: #B5CEA8",
|
||||
"light_plus": "constant.numeric: #09885A",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"description": "The file syntaxes/css.tmLanguage.json was derived from https://github.com/octref/language-css which was derived from the Atom package https://github.com/atom/language-css which was originally converted from the TextMate bundle https://github.com/textmate/css.tmbundle.",
|
||||
"version": "0.0.0"
|
||||
"version": "0.42.11"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "atom/language-java",
|
||||
"repositoryUrl": "https://github.com/atom/language-java",
|
||||
"commitHash": "f6d349a5ca698be25d3f48511888fe62d158e42c"
|
||||
"commitHash": "a91b17906a2142bc61c06c6f214f135a2e3cdc96"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/atom/language-java/commit/f6d349a5ca698be25d3f48511888fe62d158e42c",
|
||||
"version": "https://github.com/atom/language-java/commit/a91b17906a2142bc61c06c6f214f135a2e3cdc96",
|
||||
"name": "Java",
|
||||
"scopeName": "source.java",
|
||||
"patterns": [
|
||||
@@ -124,15 +124,15 @@
|
||||
"annotations": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "((@)[^\\s(]+)(\\()",
|
||||
"begin": "((@)\\s*([^\\s(]+))(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.annotation.java"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.annotation.java"
|
||||
},
|
||||
"3": {
|
||||
"name": "storage.type.annotation.java"
|
||||
},
|
||||
"4": {
|
||||
"name": "punctuation.definition.annotation-arguments.begin.bracket.round.java"
|
||||
}
|
||||
},
|
||||
@@ -161,7 +161,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": "(@)(interface)\\s+(\\w*)|((@)\\w*)",
|
||||
"match": "(@)(interface)\\s+(\\w*)|((@)\\s*(\\w+))",
|
||||
"name": "meta.declaration.annotation.java",
|
||||
"captures": {
|
||||
"1": {
|
||||
@@ -173,11 +173,11 @@
|
||||
"3": {
|
||||
"name": "storage.type.annotation.java"
|
||||
},
|
||||
"4": {
|
||||
"name": "storage.type.annotation.java"
|
||||
},
|
||||
"5": {
|
||||
"name": "punctuation.definition.annotation.java"
|
||||
},
|
||||
"6": {
|
||||
"name": "storage.type.annotation.java"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1068,13 +1068,13 @@
|
||||
},
|
||||
{
|
||||
"c": "@",
|
||||
"t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java punctuation.definition.annotation.java",
|
||||
"t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation.java",
|
||||
"r": {
|
||||
"dark_plus": "storage.type.annotation.java: #4EC9B0",
|
||||
"light_plus": "storage.type.annotation.java: #267F99",
|
||||
"dark_vs": "storage.type: #569CD6",
|
||||
"light_vs": "storage.type: #0000FF",
|
||||
"hc_black": "storage.type.annotation.java: #4EC9B0"
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1871,13 +1871,13 @@
|
||||
},
|
||||
{
|
||||
"c": "@",
|
||||
"t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java storage.type.annotation.java punctuation.definition.annotation.java",
|
||||
"t": "source.java meta.class.java meta.class.body.java meta.declaration.annotation.java punctuation.definition.annotation.java",
|
||||
"r": {
|
||||
"dark_plus": "storage.type.annotation.java: #4EC9B0",
|
||||
"light_plus": "storage.type.annotation.java: #267F99",
|
||||
"dark_vs": "storage.type: #569CD6",
|
||||
"light_vs": "storage.type: #0000FF",
|
||||
"hc_black": "storage.type.annotation.java: #4EC9B0"
|
||||
"dark_plus": "default: #D4D4D4",
|
||||
"light_plus": "default: #000000",
|
||||
"dark_vs": "default: #D4D4D4",
|
||||
"light_vs": "default: #000000",
|
||||
"hc_black": "default: #FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -113,21 +113,19 @@ export class MarkdownContentProvider {
|
||||
return href;
|
||||
}
|
||||
|
||||
// Use href if it is already an URL
|
||||
const hrefUri = vscode.Uri.parse(href);
|
||||
if (['http', 'https'].indexOf(hrefUri.scheme) >= 0) {
|
||||
return hrefUri.toString(true);
|
||||
if (href.startsWith('http:') || href.startsWith('https:') || href.startsWith('file:')) {
|
||||
return href;
|
||||
}
|
||||
|
||||
// Use href as file URI if it is absolute
|
||||
if (path.isAbsolute(href) || hrefUri.scheme === 'file') {
|
||||
// Assume it must be a local file
|
||||
if (path.isAbsolute(href)) {
|
||||
return vscode.Uri.file(href)
|
||||
.with({ scheme: 'vscode-resource' })
|
||||
.toString();
|
||||
}
|
||||
|
||||
// Use a workspace relative path if there is a workspace
|
||||
let root = vscode.workspace.getWorkspaceFolder(resource);
|
||||
const root = vscode.workspace.getWorkspaceFolder(resource);
|
||||
if (root) {
|
||||
return vscode.Uri.file(path.join(root.uri.fsPath, href))
|
||||
.with({ scheme: 'vscode-resource' })
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "MagicStack/MagicPython",
|
||||
"repositoryUrl": "https://github.com/MagicStack/MagicPython",
|
||||
"commitHash": "8ff35b3e5fcde471fae62a57ea1ae1c7cd34c9fc"
|
||||
"commitHash": "38422d302fe0b3e7716d26ce8cd7d0b9685f3a38"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/MagicStack/MagicPython/commit/8ff35b3e5fcde471fae62a57ea1ae1c7cd34c9fc",
|
||||
"version": "https://github.com/MagicStack/MagicPython/commit/38422d302fe0b3e7716d26ce8cd7d0b9685f3a38",
|
||||
"name": "MagicPython",
|
||||
"scopeName": "source.python",
|
||||
"patterns": [
|
||||
@@ -827,7 +827,7 @@
|
||||
]
|
||||
},
|
||||
"f-expression": {
|
||||
"comment": "All valid Python expressions, except comments and line cont",
|
||||
"comment": "All valid Python expressions, except comments and line continuation",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression-bare"
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.34.0",
|
||||
"distro": "c856c01e7cce9a2ee9e56755baccc31f4bd21a90",
|
||||
"distro": "6090273b078fc388879843b055c49e4178cdf877",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
||||
@@ -274,7 +274,7 @@ export class BreadcrumbsWidget {
|
||||
this._onDidSelectItem.fire({ type: 'select', item: this._items[this._selectedItemIdx], node: this._nodes[this._selectedItemIdx], payload });
|
||||
}
|
||||
|
||||
getItems(): ReadonlyArray<BreadcrumbsItem> {
|
||||
getItems(): readonly BreadcrumbsItem[] {
|
||||
return this._items;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#646465" d="M6 4v8l4-4-4-4zm1 2.414L8.586 8 7 9.586V6.414z"/></svg>
|
||||
|
After Width: | Height: | Size: 139 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#646465" d="M11 10H5.344L11 4.414V10z"/></svg>
|
||||
|
After Width: | Height: | Size: 118 B |
@@ -88,3 +88,12 @@ td {
|
||||
tbody > tr:hover {
|
||||
background-color: #2A2D2E;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/processExplorer';
|
||||
import { listProcesses } from 'vs/base/node/ps';
|
||||
import { webFrame, ipcRenderer, clipboard } from 'electron';
|
||||
import { repeat } from 'vs/base/common/strings';
|
||||
import { totalmem } from 'os';
|
||||
@@ -16,31 +15,45 @@ import * as platform from 'vs/base/common/platform';
|
||||
import { IContextMenuItem } from 'vs/base/parts/contextmenu/common/contextmenu';
|
||||
import { popup } from 'vs/base/parts/contextmenu/electron-browser/contextmenu';
|
||||
import { ProcessItem } from 'vs/base/common/processes';
|
||||
import { addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
|
||||
let processList: any[];
|
||||
let mapPidToWindowTitle = new Map<number, string>();
|
||||
|
||||
const DEBUG_FLAGS_PATTERN = /\s--(inspect|debug)(-brk|port)?=(\d+)?/;
|
||||
const DEBUG_PORT_PATTERN = /\s--(inspect|debug)-port=(\d+)/;
|
||||
const listeners: IDisposable[] = [];
|
||||
const collapsedStateCache: Map<string, boolean> = new Map<string, boolean>();
|
||||
let lastRequestTime: number;
|
||||
|
||||
function getProcessList(rootProcess: ProcessItem) {
|
||||
const processes: any[] = [];
|
||||
interface FormattedProcessItem {
|
||||
cpu: string;
|
||||
memory: string;
|
||||
pid: string;
|
||||
name: string;
|
||||
formattedName: string;
|
||||
cmd: string;
|
||||
}
|
||||
|
||||
function getProcessList(rootProcess: ProcessItem, isLocal: boolean): FormattedProcessItem[] {
|
||||
const processes: FormattedProcessItem[] = [];
|
||||
|
||||
if (rootProcess) {
|
||||
getProcessItem(processes, rootProcess, 0);
|
||||
getProcessItem(processes, rootProcess, 0, isLocal);
|
||||
}
|
||||
|
||||
return processes;
|
||||
}
|
||||
|
||||
function getProcessItem(processes: any[], item: ProcessItem, indent: number): void {
|
||||
function getProcessItem(processes: FormattedProcessItem[], item: ProcessItem, indent: number, isLocal: boolean): void {
|
||||
const isRoot = (indent === 0);
|
||||
|
||||
const MB = 1024 * 1024;
|
||||
|
||||
let name = item.name;
|
||||
if (isRoot) {
|
||||
name = `${product.applicationName} main`;
|
||||
name = isLocal ? `${product.applicationName} main` : 'remote agent';
|
||||
}
|
||||
|
||||
if (name === 'window') {
|
||||
@@ -52,9 +65,9 @@ function getProcessItem(processes: any[], item: ProcessItem, indent: number): vo
|
||||
const formattedName = isRoot ? name : `${repeat(' ', indent)} ${name}`;
|
||||
const memory = process.platform === 'win32' ? item.mem : (totalmem() * (item.mem / 100));
|
||||
processes.push({
|
||||
cpu: Number(item.load.toFixed(0)),
|
||||
memory: Number((memory / MB).toFixed(0)),
|
||||
pid: Number((item.pid).toFixed(0)),
|
||||
cpu: item.load.toFixed(0),
|
||||
memory: (memory / MB).toFixed(0),
|
||||
pid: item.pid.toFixed(0),
|
||||
name,
|
||||
formattedName,
|
||||
cmd: item.cmd
|
||||
@@ -62,7 +75,7 @@ function getProcessItem(processes: any[], item: ProcessItem, indent: number): vo
|
||||
|
||||
// Recurse into children if any
|
||||
if (Array.isArray(item.children)) {
|
||||
item.children.forEach(child => getProcessItem(processes, child, indent + 1));
|
||||
item.children.forEach(child => getProcessItem(processes, child, indent + 1, isLocal));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +84,7 @@ function isDebuggable(cmd: string): boolean {
|
||||
return (matches && matches.length >= 2) || cmd.indexOf('node ') >= 0 || cmd.indexOf('node.exe') >= 0;
|
||||
}
|
||||
|
||||
function attachTo(item: ProcessItem) {
|
||||
function attachTo(item: FormattedProcessItem) {
|
||||
const config: any = {
|
||||
type: 'node',
|
||||
request: 'attach',
|
||||
@@ -113,35 +126,57 @@ function getProcessIdWithHighestProperty(processList: any[], propertyName: strin
|
||||
return maxProcessId;
|
||||
}
|
||||
|
||||
function updateProcessInfo(processList: any[]): void {
|
||||
function updateSectionCollapsedState(shouldExpand: boolean, body: HTMLElement, twistie: HTMLImageElement, sectionName: string) {
|
||||
if (shouldExpand) {
|
||||
body.classList.remove('hidden');
|
||||
collapsedStateCache.set(sectionName, false);
|
||||
twistie.src = './media/expanded.svg';
|
||||
} else {
|
||||
body.classList.add('hidden');
|
||||
collapsedStateCache.set(sectionName, true);
|
||||
twistie.src = './media/collapsed.svg';
|
||||
}
|
||||
}
|
||||
|
||||
function renderTableSection(sectionName: string, processList: FormattedProcessItem[], renderManySections: boolean, sectionIsLocal: boolean): void {
|
||||
const container = document.getElementById('process-list');
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
|
||||
container.innerHTML = '';
|
||||
const highestCPUProcess = getProcessIdWithHighestProperty(processList, 'cpu');
|
||||
const highestMemoryProcess = getProcessIdWithHighestProperty(processList, 'memory');
|
||||
|
||||
const tableHead = document.createElement('thead');
|
||||
tableHead.innerHTML = `<tr>
|
||||
<th scope="col" class="cpu">${localize('cpu', "CPU %")}</th>
|
||||
<th scope="col" class="memory">${localize('memory', "Memory (MB)")}</th>
|
||||
<th scope="col" class="pid">${localize('pid', "pid")}</th>
|
||||
<th scope="col" class="nameLabel">${localize('name', "Name")}</th>
|
||||
</tr>`;
|
||||
const body = document.createElement('tbody');
|
||||
|
||||
const tableBody = document.createElement('tbody');
|
||||
if (renderManySections) {
|
||||
const headerRow = document.createElement('tr');
|
||||
const data = document.createElement('td');
|
||||
data.textContent = sectionName;
|
||||
data.colSpan = 4;
|
||||
headerRow.appendChild(data);
|
||||
|
||||
const twistie = document.createElement('img');
|
||||
updateSectionCollapsedState(!collapsedStateCache.get(sectionName), body, twistie, sectionName);
|
||||
data.prepend(twistie);
|
||||
|
||||
listeners.push(addDisposableListener(data, 'click', (e) => {
|
||||
const isHidden = body.classList.contains('hidden');
|
||||
updateSectionCollapsedState(isHidden, body, twistie, sectionName);
|
||||
}));
|
||||
|
||||
container.appendChild(headerRow);
|
||||
}
|
||||
|
||||
processList.forEach(p => {
|
||||
const row = document.createElement('tr');
|
||||
row.id = p.pid;
|
||||
row.id = p.pid.toString();
|
||||
|
||||
const cpu = document.createElement('td');
|
||||
p.pid === highestCPUProcess
|
||||
? cpu.classList.add('centered', 'highest')
|
||||
: cpu.classList.add('centered');
|
||||
cpu.textContent = p.cpu;
|
||||
cpu.textContent = p.cpu.toString();
|
||||
|
||||
const memory = document.createElement('td');
|
||||
p.pid === highestMemoryProcess
|
||||
@@ -160,10 +195,41 @@ function updateProcessInfo(processList: any[]): void {
|
||||
name.textContent = p.formattedName;
|
||||
|
||||
row.append(cpu, memory, pid, name);
|
||||
tableBody.appendChild(row);
|
||||
|
||||
listeners.push(addDisposableListener(row, 'contextmenu', (e) => {
|
||||
showContextMenu(e, p, sectionIsLocal);
|
||||
}));
|
||||
|
||||
body.appendChild(row);
|
||||
});
|
||||
|
||||
container.append(tableHead, tableBody);
|
||||
container.appendChild(body);
|
||||
}
|
||||
|
||||
function updateProcessInfo(processLists: { [key: string]: ProcessItem }): void {
|
||||
const container = document.getElementById('process-list');
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
|
||||
container.innerHTML = '';
|
||||
listeners.forEach(l => l.dispose());
|
||||
|
||||
const tableHead = document.createElement('thead');
|
||||
tableHead.innerHTML = `<tr>
|
||||
<th scope="col" class="cpu">${localize('cpu', "CPU %")}</th>
|
||||
<th scope="col" class="memory">${localize('memory', "Memory (MB)")}</th>
|
||||
<th scope="col" class="pid">${localize('pid', "pid")}</th>
|
||||
<th scope="col" class="nameLabel">${localize('name', "Name")}</th>
|
||||
</tr>`;
|
||||
|
||||
container.append(tableHead);
|
||||
|
||||
const hasMultipleMachines = Object.keys(processLists).length > 1;
|
||||
Object.keys(processLists).forEach((key, i) => {
|
||||
const isLocal = i === 0;
|
||||
renderTableSection(key, getProcessList(processLists[key], isLocal), hasMultipleMachines, isLocal);
|
||||
});
|
||||
}
|
||||
|
||||
function applyStyles(styles: ProcessExplorerStyles): void {
|
||||
@@ -171,11 +237,11 @@ function applyStyles(styles: ProcessExplorerStyles): void {
|
||||
const content: string[] = [];
|
||||
|
||||
if (styles.hoverBackground) {
|
||||
content.push(`tbody > tr:hover { background-color: ${styles.hoverBackground}; }`);
|
||||
content.push(`tbody > tr:hover, table > tr:hover { background-color: ${styles.hoverBackground}; }`);
|
||||
}
|
||||
|
||||
if (styles.hoverForeground) {
|
||||
content.push(`tbody > tr:hover{ color: ${styles.hoverForeground}; }`);
|
||||
content.push(`tbody > tr:hover, table > tr:hover { color: ${styles.hoverForeground}; }`);
|
||||
}
|
||||
|
||||
if (styles.highlightForeground) {
|
||||
@@ -200,13 +266,13 @@ function applyZoom(zoomLevel: number): void {
|
||||
browser.setZoomLevel(webFrame.getZoomLevel(), /*isTrusted*/false);
|
||||
}
|
||||
|
||||
function showContextMenu(e: MouseEvent) {
|
||||
function showContextMenu(e: MouseEvent, item: FormattedProcessItem, isLocal: boolean) {
|
||||
e.preventDefault();
|
||||
|
||||
const items: IContextMenuItem[] = [];
|
||||
const pid = Number(item.pid);
|
||||
|
||||
const pid = parseInt((e.currentTarget as HTMLElement).id);
|
||||
if (pid && typeof pid === 'number') {
|
||||
if (isLocal) {
|
||||
items.push({
|
||||
label: localize('killProcess', "Kill Process"),
|
||||
click() {
|
||||
@@ -224,48 +290,37 @@ function showContextMenu(e: MouseEvent) {
|
||||
items.push({
|
||||
type: 'separator'
|
||||
});
|
||||
}
|
||||
|
||||
items.push({
|
||||
label: localize('copy', "Copy"),
|
||||
click() {
|
||||
const row = document.getElementById(pid.toString());
|
||||
if (row) {
|
||||
clipboard.writeText(row.innerText);
|
||||
}
|
||||
items.push({
|
||||
label: localize('copy', "Copy"),
|
||||
click() {
|
||||
const row = document.getElementById(pid.toString());
|
||||
if (row) {
|
||||
clipboard.writeText(row.innerText);
|
||||
}
|
||||
});
|
||||
|
||||
items.push({
|
||||
label: localize('copyAll', "Copy All"),
|
||||
click() {
|
||||
const processList = document.getElementById('process-list');
|
||||
if (processList) {
|
||||
clipboard.writeText(processList.innerText);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const item = processList.filter(process => process.pid === pid)[0];
|
||||
if (item && isDebuggable(item.cmd)) {
|
||||
items.push({
|
||||
type: 'separator'
|
||||
});
|
||||
|
||||
items.push({
|
||||
label: localize('debug', "Debug"),
|
||||
click() {
|
||||
attachTo(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
});
|
||||
|
||||
items.push({
|
||||
label: localize('copyAll', "Copy All"),
|
||||
click() {
|
||||
const processList = document.getElementById('process-list');
|
||||
if (processList) {
|
||||
clipboard.writeText(processList.innerText);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (item && isLocal && isDebuggable(item.cmd)) {
|
||||
items.push({
|
||||
label: localize('copyAll', "Copy All"),
|
||||
type: 'separator'
|
||||
});
|
||||
|
||||
items.push({
|
||||
label: localize('debug', "Debug"),
|
||||
click() {
|
||||
const processList = document.getElementById('process-list');
|
||||
if (processList) {
|
||||
clipboard.writeText(processList.innerText);
|
||||
}
|
||||
attachTo(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -273,6 +328,22 @@ function showContextMenu(e: MouseEvent) {
|
||||
popup(items);
|
||||
}
|
||||
|
||||
function requestProcessList(totalWaitTime: number): void {
|
||||
setTimeout(() => {
|
||||
const nextRequestTime = Date.now();
|
||||
const waited = totalWaitTime + nextRequestTime - lastRequestTime;
|
||||
lastRequestTime = nextRequestTime;
|
||||
|
||||
// Wait at least a second between requests.
|
||||
if (waited > 1000) {
|
||||
ipcRenderer.send('windowsInfoRequest');
|
||||
ipcRenderer.send('vscode:listProcesses');
|
||||
} else {
|
||||
requestProcessList(waited);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
|
||||
export function startup(data: ProcessExplorerData): void {
|
||||
applyStyles(data.styles);
|
||||
applyZoom(data.zoomLevel);
|
||||
@@ -283,23 +354,14 @@ export function startup(data: ProcessExplorerData): void {
|
||||
windows.forEach(window => mapPidToWindowTitle.set(window.pid, window.title));
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
ipcRenderer.send('windowsInfoRequest');
|
||||
|
||||
listProcesses(data.pid).then(processes => {
|
||||
processList = getProcessList(processes);
|
||||
updateProcessInfo(processList);
|
||||
|
||||
const tableRows = document.getElementsByTagName('tr');
|
||||
for (let i = 0; i < tableRows.length; i++) {
|
||||
const tableRow = tableRows[i];
|
||||
tableRow.addEventListener('contextmenu', (e) => {
|
||||
showContextMenu(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1200);
|
||||
ipcRenderer.on('vscode:listProcessesResponse', (_event: Event, processRoots: { [key: string]: ProcessItem }) => {
|
||||
updateProcessInfo(processRoots);
|
||||
requestProcessList(0);
|
||||
});
|
||||
|
||||
lastRequestTime = Date.now();
|
||||
ipcRenderer.send('windowsInfoRequest');
|
||||
ipcRenderer.send('vscode:listProcesses');
|
||||
|
||||
document.onkeydown = (e: KeyboardEvent) => {
|
||||
const cmdOrCtrlKey = platform.isMacintosh ? e.metaKey : e.ctrlKey;
|
||||
|
||||
@@ -26,7 +26,7 @@ import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/
|
||||
import { IWindowsMainService, IOpenConfiguration, IWindowsCountChangedEvent, ICodeWindow, IWindowState as ISingleWindowState, WindowMode } from 'vs/platform/windows/electron-main/windows';
|
||||
import { IHistoryMainService, IRecent } from 'vs/platform/history/common/history';
|
||||
import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform';
|
||||
import { IWorkspacesMainService, IWorkspaceIdentifier, WORKSPACE_FILTER, isSingleFolderWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IWorkspacesMainService, IWorkspaceIdentifier, WORKSPACE_FILTER, isSingleFolderWorkspaceIdentifier, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
@@ -899,7 +899,7 @@ export class WindowsManager implements IWindowsMainService {
|
||||
for (let f of fileUris) {
|
||||
const fileUri = this.argToUri(f);
|
||||
if (fileUri) {
|
||||
const path = this.parseUri({ fileUri }, parseOptions);
|
||||
const path = this.parseUri(hasWorkspaceFileExtension(f) ? { workspaceUri: fileUri } : { fileUri }, parseOptions);
|
||||
if (path) {
|
||||
pathsToOpen.push(path);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class CodeActionSet {
|
||||
}
|
||||
}
|
||||
|
||||
public readonly actions: ReadonlyArray<CodeAction>;
|
||||
public readonly actions: readonly CodeAction[];
|
||||
|
||||
public constructor(actions: CodeAction[]) {
|
||||
this.actions = mergeSort(actions, CodeActionSet.codeActionsComparator);
|
||||
|
||||
@@ -306,13 +306,13 @@ export class DiagnosticsService implements IDiagnosticsService {
|
||||
output.push('CPU %\tMem MB\t PID\tProcess');
|
||||
|
||||
if (rootProcess) {
|
||||
this.formatProcessItem(mapPidToWindowTitle, output, rootProcess, 0);
|
||||
this.formatProcessItem(info.mainPID, mapPidToWindowTitle, output, rootProcess, 0);
|
||||
}
|
||||
|
||||
return output.join('\n');
|
||||
}
|
||||
|
||||
private formatProcessItem(mapPidToWindowTitle: Map<number, string>, output: string[], item: ProcessItem, indent: number): void {
|
||||
private formatProcessItem(mainPid: number, mapPidToWindowTitle: Map<number, string>, output: string[], item: ProcessItem, indent: number): void {
|
||||
const isRoot = (indent === 0);
|
||||
|
||||
const MB = 1024 * 1024;
|
||||
@@ -320,7 +320,7 @@ export class DiagnosticsService implements IDiagnosticsService {
|
||||
// Format name with indent
|
||||
let name: string;
|
||||
if (isRoot) {
|
||||
name = `${product.applicationName} main`;
|
||||
name = item.pid === mainPid ? `${product.applicationName} main` : 'remote agent';
|
||||
} else {
|
||||
name = `${repeat(' ', indent)} ${item.name}`;
|
||||
|
||||
@@ -333,7 +333,7 @@ export class DiagnosticsService implements IDiagnosticsService {
|
||||
|
||||
// Recurse into children if any
|
||||
if (Array.isArray(item.children)) {
|
||||
item.children.forEach(child => this.formatProcessItem(mapPidToWindowTitle, output, child, indent + 1));
|
||||
item.children.forEach(child => this.formatProcessItem(mainPid, mapPidToWindowTitle, output, child, indent + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,12 +241,6 @@ export interface IExtensionEnablementService {
|
||||
*/
|
||||
onEnablementChanged: Event<IExtension[]>;
|
||||
|
||||
/**
|
||||
* Returns all disabled extension identifiers for current workspace
|
||||
* Returns an empty array if none exist
|
||||
*/
|
||||
getDisabledExtensions(): Promise<IExtensionIdentifier[]>;
|
||||
|
||||
/**
|
||||
* Returns the enablement state for the given extension
|
||||
*/
|
||||
|
||||
@@ -15,6 +15,8 @@ import { isMacintosh, IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IWindowState } from 'vs/platform/windows/electron-main/windows';
|
||||
import { listProcesses } from 'vs/base/node/ps';
|
||||
import { ProcessItem } from 'vs/base/common/processes';
|
||||
|
||||
const DEFAULT_BACKGROUND_COLOR = '#1E1E1E';
|
||||
|
||||
@@ -44,6 +46,16 @@ export class IssueService implements IIssueService {
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:listProcesses', async (event: Event) => {
|
||||
const mainPid = await this.launchService.getMainProcessId();
|
||||
const rootProcess = await listProcesses(mainPid);
|
||||
const remoteProcesses = (await this.launchService.getRemoteDiagnostics({ includeProcesses: true }))
|
||||
.map(data => data.processes)
|
||||
.filter((x): x is ProcessItem => !!x);
|
||||
|
||||
event.sender.send('vscode:listProcessesResponse', [rootProcess, ...remoteProcesses]);
|
||||
});
|
||||
|
||||
ipcMain.on('vscode:issuePerformanceInfoRequest', (event: Event) => {
|
||||
this.getPerformanceInfo().then(msg => {
|
||||
event.sender.send('vscode:issuePerformanceInfoResponse', msg);
|
||||
|
||||
@@ -63,7 +63,6 @@ export interface IRemoteExtensionHostStartParams {
|
||||
debugId?: string;
|
||||
break?: boolean;
|
||||
port?: number | null;
|
||||
updatePort?: boolean;
|
||||
}
|
||||
|
||||
interface IExtensionHostConnectionResult {
|
||||
|
||||
@@ -11,8 +11,6 @@ export interface ResolvedAuthority {
|
||||
readonly authority: string;
|
||||
readonly host: string;
|
||||
readonly port: number;
|
||||
readonly debugListenPort?: number;
|
||||
readonly debugConnectPort?: number;
|
||||
}
|
||||
|
||||
export interface IRemoteAuthorityResolverService {
|
||||
|
||||
Vendored
-7
@@ -75,8 +75,6 @@ declare module 'vscode' {
|
||||
export class ResolvedAuthority {
|
||||
readonly host: string;
|
||||
readonly port: number;
|
||||
debugListenPort?: number;
|
||||
debugConnectPort?: number;
|
||||
|
||||
constructor(host: string, port: number);
|
||||
}
|
||||
@@ -473,11 +471,6 @@ declare module 'vscode' {
|
||||
}
|
||||
|
||||
export namespace workspace {
|
||||
/**
|
||||
* DEPRECATED
|
||||
*/
|
||||
export function registerSearchProvider(): Disposable;
|
||||
|
||||
/**
|
||||
* Register a search provider.
|
||||
*
|
||||
|
||||
@@ -306,7 +306,7 @@ class CodeActionOnSaveParticipant implements ISaveParticipant {
|
||||
}
|
||||
}
|
||||
|
||||
private async applyCodeActions(actionsToRun: ReadonlyArray<CodeAction>) {
|
||||
private async applyCodeActions(actionsToRun: readonly CodeAction[]) {
|
||||
for (const action of actionsToRun) {
|
||||
await applyCodeAction(action, this._bulkEditService, this._commandService);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,10 @@ import { IRemoteConsoleLog } from 'vs/base/common/console';
|
||||
|
||||
export interface IEnvironment {
|
||||
isExtensionDevelopmentDebug: boolean;
|
||||
appName: string;
|
||||
appRoot?: URI;
|
||||
appLanguage: string;
|
||||
appUriScheme: string;
|
||||
appSettingsHome?: URI;
|
||||
extensionDevelopmentLocationURI?: URI | URI[];
|
||||
extensionTestsLocationURI?: URI;
|
||||
@@ -68,6 +71,7 @@ export interface IWorkspaceData extends IStaticWorkspaceData {
|
||||
}
|
||||
|
||||
export interface IInitData {
|
||||
version: string;
|
||||
commit?: string;
|
||||
parentPid: number;
|
||||
environment: IEnvironment;
|
||||
@@ -311,8 +315,8 @@ export interface ISerializedDocumentFilter {
|
||||
}
|
||||
|
||||
export interface ISerializedSignatureHelpProviderMetadata {
|
||||
readonly triggerCharacters: ReadonlyArray<string>;
|
||||
readonly retriggerCharacters: ReadonlyArray<string>;
|
||||
readonly triggerCharacters: readonly string[];
|
||||
readonly retriggerCharacters: readonly string[];
|
||||
}
|
||||
|
||||
export interface MainThreadLanguageFeaturesShape extends IDisposable {
|
||||
|
||||
@@ -9,7 +9,6 @@ import * as errors from 'vs/base/common/errors';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { TernarySearchTree } from 'vs/base/common/map';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
|
||||
@@ -17,8 +16,6 @@ import { OverviewRulerLane } from 'vs/editor/common/model';
|
||||
import * as languageConfiguration from 'vs/editor/common/modes/languageConfiguration';
|
||||
import { score } from 'vs/editor/common/modes/languageSelector';
|
||||
import * as files from 'vs/platform/files/common/files';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { ExtHostContext, IInitData, IMainContext, MainContext, MainThreadKeytarShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ExtHostApiCommands } from 'vs/workbench/api/node/extHostApiCommands';
|
||||
import { ExtHostClipboard } from 'vs/workbench/api/node/extHostClipboard';
|
||||
@@ -67,6 +64,7 @@ import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensio
|
||||
import { originalFSPath } from 'vs/base/common/resources';
|
||||
import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
|
||||
export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||
@@ -132,7 +130,7 @@ export function createApiFactory(
|
||||
}
|
||||
|
||||
// Check that no named customers are missing
|
||||
const expected: ProxyIdentifier<any>[] = Object.keys(ExtHostContext).map((key) => (<any>ExtHostContext)[key]);
|
||||
const expected: ProxyIdentifier<any>[] = values(ExtHostContext);
|
||||
rpcProtocol.assertRegistered(expected);
|
||||
|
||||
// Other instances
|
||||
@@ -232,10 +230,10 @@ export function createApiFactory(
|
||||
const env: typeof vscode.env = Object.freeze({
|
||||
get machineId() { return initData.telemetryInfo.machineId; },
|
||||
get sessionId() { return initData.telemetryInfo.sessionId; },
|
||||
get language() { return platform.language!; },
|
||||
get appName() { return product.nameLong; },
|
||||
get language() { return initData.environment.appLanguage; },
|
||||
get appName() { return initData.environment.appName; },
|
||||
get appRoot() { return initData.environment.appRoot!.fsPath; },
|
||||
get uriScheme() { return product.urlProtocol; },
|
||||
get uriScheme() { return initData.environment.appUriScheme; },
|
||||
get logLevel() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return typeConverters.LogLevel.to(extHostLogService.getLevel());
|
||||
@@ -623,10 +621,6 @@ export function createApiFactory(
|
||||
registerFileSearchProvider: proposedApiFunction(extension, (scheme: string, provider: vscode.FileSearchProvider) => {
|
||||
return extHostSearch.registerFileSearchProvider(scheme, provider);
|
||||
}),
|
||||
registerSearchProvider: proposedApiFunction(extension, () => {
|
||||
// Temp for live share in Insiders
|
||||
return { dispose: () => { } };
|
||||
}),
|
||||
registerTextSearchProvider: proposedApiFunction(extension, (scheme: string, provider: vscode.TextSearchProvider) => {
|
||||
return extHostSearch.registerTextSearchProvider(scheme, provider);
|
||||
}),
|
||||
@@ -740,7 +734,7 @@ export function createApiFactory(
|
||||
};
|
||||
|
||||
return <typeof vscode>{
|
||||
version: pkg.version,
|
||||
version: initData.version,
|
||||
// namespaces
|
||||
commands,
|
||||
debug,
|
||||
|
||||
@@ -700,8 +700,6 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
|
||||
authority: remoteAuthority,
|
||||
host: result.host,
|
||||
port: result.port,
|
||||
debugListenPort: result.debugListenPort,
|
||||
debugConnectPort: result.debugConnectPort,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -432,8 +432,6 @@ export class Selection extends Range {
|
||||
export class ResolvedAuthority {
|
||||
readonly host: string;
|
||||
readonly port: number;
|
||||
debugListenPort?: number;
|
||||
debugConnectPort?: number;
|
||||
|
||||
constructor(host: string, port: number) {
|
||||
if (typeof host !== 'string' || host.length === 0) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as resources from 'vs/base/common/resources';
|
||||
import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { toResource, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { toResource, IEditorInput, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -332,7 +332,7 @@ class ResourceLabelWidget extends IconLabel {
|
||||
|
||||
setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void {
|
||||
this.setResource({
|
||||
resource: withNullAsUndefined(toResource(editor, { supportSideBySide: true })),
|
||||
resource: withNullAsUndefined(toResource(editor, { supportSideBySide: SideBySideEditor.MASTER })),
|
||||
name: withNullAsUndefined(editor.getName()),
|
||||
description: withNullAsUndefined(editor.getDescription())
|
||||
}, options);
|
||||
|
||||
@@ -18,9 +18,9 @@ import { SimpleConfigurationService as StandaloneEditorConfigurationService, Sta
|
||||
import { IDownloadService } from 'vs/platform/download/common/download';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IEnvironmentService, IExtensionHostDebugParams, IDebugParams } from 'vs/platform/environment/common/environment';
|
||||
import { IExtensionGalleryService, IQueryOptions, IGalleryExtension, InstallOperation, StatisticType, ITranslation, IGalleryExtensionVersion, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionGalleryService, IQueryOptions, IGalleryExtension, InstallOperation, StatisticType, ITranslation, IGalleryExtensionVersion, IExtensionIdentifier, IReportedExtension, IExtensionManagementService, ILocalExtension, IGalleryMetadata, IExtensionTipsService, ExtensionRecommendationReason, IExtensionRecommendation, IExtensionEnablementService, EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IPager } from 'vs/base/common/paging';
|
||||
import { IExtensionManifest, ExtensionType, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IExtensionManifest, ExtensionType, ExtensionIdentifier, IExtension } from 'vs/platform/extensions/common/extensions';
|
||||
import { NullExtensionService, IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IURLHandler, IURLService } from 'vs/platform/url/common/url';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -354,6 +354,38 @@ registerSingleton(IExtensionGalleryService, SimpleExtensionGalleryService, true)
|
||||
|
||||
//#region Extension Management
|
||||
|
||||
//#region Extension Enablement
|
||||
|
||||
export class SimpleExtensionEnablementService implements IExtensionEnablementService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
readonly onEnablementChanged = Event.None;
|
||||
|
||||
readonly allUserExtensionsDisabled = true;
|
||||
|
||||
getEnablementState(extension: IExtension): EnablementState {
|
||||
return EnablementState.Disabled;
|
||||
}
|
||||
|
||||
canChangeEnablement(extension: IExtension): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
setEnablement(extensions: IExtension[], newState: EnablementState): Promise<boolean[]> {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
isEnabled(extension: IExtension): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
registerSingleton(IExtensionEnablementService, SimpleExtensionEnablementService, true);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Extension Tips
|
||||
|
||||
export class SimpleExtensionTipsService implements IExtensionTipsService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { QuickOpenHandler } from 'vs/workbench/browser/quickopen';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorGroupsService, IEditorGroup, EditorsOrder, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { EditorInput, toResource } from 'vs/workbench/common/editor';
|
||||
import { EditorInput, toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
@@ -50,7 +50,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
|
||||
}
|
||||
|
||||
getResource() {
|
||||
return toResource(this.editor, { supportSideBySide: true });
|
||||
return toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
}
|
||||
|
||||
getAriaLabel(): string {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { Language } from 'vs/base/common/platform';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import { IFileEditorInput, EncodingMode, IEncodingSupport, toResource, SideBySideEditorInput, IEditor as IBaseEditor, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IFileEditorInput, EncodingMode, IEncodingSupport, toResource, SideBySideEditorInput, IEditor as IBaseEditor, IEditorInput, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IDisposable, combinedDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
@@ -769,7 +769,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
private onResourceEncodingChange(resource: URI): void {
|
||||
const activeControl = this.editorService.activeControl;
|
||||
if (activeControl) {
|
||||
const activeResource = toResource(activeControl.input, { supportSideBySide: true });
|
||||
const activeResource = toResource(activeControl.input, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (activeResource && activeResource.toString() === resource.toString()) {
|
||||
return this.onEncodingChange(<IBaseEditor>activeControl); // only update if the encoding changed for the active resource
|
||||
}
|
||||
@@ -847,7 +847,7 @@ export class ChangeModeAction extends Action {
|
||||
}
|
||||
|
||||
const textModel = activeTextEditorWidget.getModel();
|
||||
const resource = this.editorService.activeEditor ? toResource(this.editorService.activeEditor, { supportSideBySide: true }) : null;
|
||||
const resource = this.editorService.activeEditor ? toResource(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER }) : null;
|
||||
|
||||
let hasLanguageSupport = !!resource;
|
||||
if (resource && resource.scheme === Schemas.untitled && !this.untitledEditorService.hasAssociatedFilePath(resource)) {
|
||||
@@ -971,7 +971,7 @@ export class ChangeModeAction extends Action {
|
||||
let languageSelection: ILanguageSelection | undefined;
|
||||
if (pick === autoDetectMode) {
|
||||
if (textModel) {
|
||||
const resource = toResource(activeEditor, { supportSideBySide: true });
|
||||
const resource = toResource(activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
languageSelection = this.modeService.createByFilepathOrFirstLine(resource.fsPath, textModel.getLineContent(1));
|
||||
}
|
||||
@@ -1187,7 +1187,7 @@ export class ChangeEncodingAction extends Action {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const resource = toResource(activeControl!.input, { supportSideBySide: true });
|
||||
const resource = toResource(activeControl!.input, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
|
||||
return timeout(50 /* quick open is sensitive to being opened so soon after another */)
|
||||
.then(() => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/notabstitlecontrol';
|
||||
import { toResource, Verbosity, IEditorInput, IEditorPartOptions } from 'vs/workbench/common/editor';
|
||||
import { toResource, Verbosity, IEditorInput, IEditorPartOptions, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { TitleControl, IToolbarActions } from 'vs/workbench/browser/parts/editor/titleControl';
|
||||
import { ResourceLabel, IResourceLabel } from 'vs/workbench/browser/labels';
|
||||
import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
@@ -237,7 +237,7 @@ export class NoTabsTitleControl extends TitleControl {
|
||||
this.updateEditorDirty(editor);
|
||||
|
||||
// Editor Label
|
||||
const resource = toResource(editor, { supportSideBySide: true });
|
||||
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
const name = editor.getName() || '';
|
||||
|
||||
const { labelFormat } = this.accessor.partOptions;
|
||||
|
||||
@@ -21,6 +21,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
export class SideBySideEditor extends BaseEditor {
|
||||
|
||||
static readonly ID: string = 'workbench.editor.sidebysideEditor';
|
||||
static MASTER: SideBySideEditor | undefined;
|
||||
|
||||
get minimumMasterWidth() { return this.masterEditor ? this.masterEditor.minimumWidth : 0; }
|
||||
get maximumMasterWidth() { return this.masterEditor ? this.masterEditor.maximumWidth : Number.POSITIVE_INFINITY; }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/tabstitlecontrol';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { shorten } from 'vs/base/common/labels';
|
||||
import { toResource, GroupIdentifier, IEditorInput, Verbosity, EditorCommandsContextActionRunner, IEditorPartOptions } from 'vs/workbench/common/editor';
|
||||
import { toResource, GroupIdentifier, IEditorInput, Verbosity, EditorCommandsContextActionRunner, IEditorPartOptions, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { EventType as TouchEventType, GestureEvent, Gesture } from 'vs/base/browser/touch';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
@@ -597,7 +597,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
e.dataTransfer!.effectAllowed = 'copyMove';
|
||||
|
||||
// Apply some datatransfer types to allow for dragging the element outside of the application
|
||||
const resource = toResource(editor, { supportSideBySide: true });
|
||||
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
this.instantiationService.invokeFunction(fillResourceDataTransfers, [resource], e);
|
||||
}
|
||||
@@ -877,7 +877,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
tabContainer.title = title;
|
||||
|
||||
// Label
|
||||
tabLabelWidget.setResource({ name, description, resource: toResource(editor, { supportSideBySide: true }) || undefined }, { title, extraClasses: ['tab-label'], italic: !this.group.isPinned(editor) });
|
||||
tabLabelWidget.setResource({ name, description, resource: toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }) || undefined }, { title, extraClasses: ['tab-label'], italic: !this.group.isPinned(editor) });
|
||||
}
|
||||
|
||||
private redrawEditorActiveAndDirty(isGroupActive: boolean, editor: IEditorInput, tabContainer: HTMLElement, tabLabelWidget: IResourceLabel): void {
|
||||
|
||||
@@ -33,7 +33,7 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { BreadcrumbsConfig } from 'vs/workbench/browser/parts/editor/breadcrumbs';
|
||||
import { BreadcrumbsControl, IBreadcrumbsControlOptions } from 'vs/workbench/browser/parts/editor/breadcrumbsControl';
|
||||
import { EDITOR_TITLE_HEIGHT, IEditorGroupsAccessor, IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor';
|
||||
import { EditorCommandsContextActionRunner, IEditorCommandsContext, IEditorInput, toResource, IEditorPartOptions } from 'vs/workbench/common/editor';
|
||||
import { EditorCommandsContextActionRunner, IEditorCommandsContext, IEditorInput, toResource, IEditorPartOptions, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { ResourceContextKey } from 'vs/workbench/common/resources';
|
||||
import { Themable } from 'vs/workbench/common/theme';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
@@ -218,7 +218,7 @@ export abstract class TitleControl extends Themable {
|
||||
this.editorToolBarMenuDisposables = dispose(this.editorToolBarMenuDisposables);
|
||||
|
||||
// Update the resource context
|
||||
this.resourceContext.set(this.group.activeEditor ? toResource(this.group.activeEditor, { supportSideBySide: true }) : null);
|
||||
this.resourceContext.set(this.group.activeEditor ? toResource(this.group.activeEditor, { supportSideBySide: SideBySideEditor.MASTER }) : null);
|
||||
|
||||
// Editor actions require the editor control to be there, so we retrieve it via service
|
||||
const activeControl = this.group.activeControl;
|
||||
@@ -258,7 +258,7 @@ export abstract class TitleControl extends Themable {
|
||||
|
||||
// If tabs are disabled, treat dragging as if an editor tab was dragged
|
||||
if (!this.accessor.partOptions.showTabs) {
|
||||
const resource = this.group.activeEditor ? toResource(this.group.activeEditor, { supportSideBySide: true }) : null;
|
||||
const resource = this.group.activeEditor ? toResource(this.group.activeEditor, { supportSideBySide: SideBySideEditor.MASTER }) : null;
|
||||
if (resource) {
|
||||
this.instantiationService.invokeFunction(fillResourceDataTransfers, [resource], e);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ export abstract class TitleControl extends Themable {
|
||||
|
||||
// Update the resource context
|
||||
const currentContext = this.resourceContext.get();
|
||||
this.resourceContext.set(toResource(editor, { supportSideBySide: true }));
|
||||
this.resourceContext.set(toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }));
|
||||
|
||||
// Find target anchor
|
||||
let anchor: HTMLElement | { x: number, y: number } = node;
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/co
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import * as nls from 'vs/nls';
|
||||
import { EditorInput, toResource, Verbosity } from 'vs/workbench/common/editor';
|
||||
import { EditorInput, toResource, Verbosity, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
@@ -179,7 +179,7 @@ export class TitlebarPart extends Part implements ITitleService {
|
||||
}
|
||||
|
||||
private updateRepresentedFilename(): void {
|
||||
const file = toResource(this.editorService.activeEditor, { supportSideBySide: true, filter: 'file' });
|
||||
const file = toResource(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER, filterByScheme: 'file' });
|
||||
const path = file ? file.fsPath : '';
|
||||
|
||||
// Apply to window
|
||||
@@ -282,7 +282,7 @@ export class TitlebarPart extends Part implements ITitleService {
|
||||
// Compute folder resource
|
||||
// Single Root Workspace: always the root single workspace in this case
|
||||
// Otherwise: root folder of the currently active file if any
|
||||
const folder = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER ? workspace.folders[0] : this.contextService.getWorkspaceFolder(toResource(editor, { supportSideBySide: true })!);
|
||||
const folder = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER ? workspace.folders[0] : this.contextService.getWorkspaceFolder(toResource(editor, { supportSideBySide: SideBySideEditor.MASTER })!);
|
||||
|
||||
// Variables
|
||||
const activeEditorShort = editor ? editor.getTitle(Verbosity.SHORT) : '';
|
||||
|
||||
@@ -198,8 +198,7 @@ export class Workbench extends Layout {
|
||||
|
||||
// TODO@Sandeep debt around cyclic dependencies
|
||||
const configurationService = accessor.get(IConfigurationService) as any;
|
||||
if (typeof configurationService.acquireFileService === 'function') {
|
||||
configurationService.acquireFileService(fileService);
|
||||
if (typeof configurationService.acquireInstantiationService === 'function') {
|
||||
configurationService.acquireInstantiationService(instantiationService);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { isUndefinedOrNull, withUndefinedAsNull } from 'vs/base/common/types';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IEditor as ICodeEditor, IEditorViewState, ScrollType, IDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
@@ -14,7 +14,6 @@ import { IInstantiationService, IConstructorSignature0, ServicesAccessor } from
|
||||
import { RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { ICompositeControl } from 'vs/workbench/common/composite';
|
||||
import { ActionRunner, IAction } from 'vs/base/common/actions';
|
||||
@@ -571,7 +570,7 @@ export class SideBySideEditorInput extends EditorInput {
|
||||
getTelemetryDescriptor(): object {
|
||||
const descriptor = this.master.getTelemetryDescriptor();
|
||||
|
||||
return objects.assign(descriptor, super.getTelemetryDescriptor());
|
||||
return assign(descriptor, super.getTelemetryDescriptor());
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
@@ -827,7 +826,7 @@ export class TextEditorOptions extends EditorOptions {
|
||||
* Returns if this options object has objects defined for the editor.
|
||||
*/
|
||||
hasOptionsDefined(): boolean {
|
||||
return !!this.editorViewState || (!types.isUndefinedOrNull(this.startLineNumber) && !types.isUndefinedOrNull(this.startColumn));
|
||||
return !!this.editorViewState || (!isUndefinedOrNull(this.startLineNumber) && !isUndefinedOrNull(this.startColumn));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -875,10 +874,10 @@ export class TextEditorOptions extends EditorOptions {
|
||||
}
|
||||
|
||||
// Otherwise check for selection
|
||||
else if (!types.isUndefinedOrNull(this.startLineNumber) && !types.isUndefinedOrNull(this.startColumn)) {
|
||||
else if (!isUndefinedOrNull(this.startLineNumber) && !isUndefinedOrNull(this.startColumn)) {
|
||||
|
||||
// Select
|
||||
if (!types.isUndefinedOrNull(this.endLineNumber) && !types.isUndefinedOrNull(this.endColumn)) {
|
||||
if (!isUndefinedOrNull(this.endLineNumber) && !isUndefinedOrNull(this.endColumn)) {
|
||||
const range = {
|
||||
startLineNumber: this.startLineNumber,
|
||||
startColumn: this.startColumn,
|
||||
@@ -979,9 +978,14 @@ export interface IEditorPartOptions extends IEditorPartConfiguration {
|
||||
iconTheme?: string;
|
||||
}
|
||||
|
||||
export enum SideBySideEditor {
|
||||
MASTER = 1,
|
||||
DETAILS = 2
|
||||
}
|
||||
|
||||
export interface IResourceOptions {
|
||||
supportSideBySide?: boolean;
|
||||
filter?: string | string[];
|
||||
supportSideBySide?: SideBySideEditor;
|
||||
filterByScheme?: string | string[];
|
||||
}
|
||||
|
||||
export function toResource(editor: IEditorInput | null | undefined, options?: IResourceOptions): URI | null {
|
||||
@@ -989,35 +993,20 @@ export function toResource(editor: IEditorInput | null | undefined, options?: IR
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check for side by side if we are asked to
|
||||
if (options && options.supportSideBySide && editor instanceof SideBySideEditorInput) {
|
||||
editor = editor.master;
|
||||
editor = options.supportSideBySide === SideBySideEditor.MASTER ? editor.master : editor.details;
|
||||
}
|
||||
|
||||
const resource = editor.getResource();
|
||||
if (!options || !options.filter) {
|
||||
return types.withUndefinedAsNull(resource); // return early if no filter is specified
|
||||
if (!resource || !options || !options.filterByScheme) {
|
||||
return withUndefinedAsNull(resource);
|
||||
}
|
||||
|
||||
if (!resource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let includeFiles: boolean;
|
||||
let includeUntitled: boolean;
|
||||
if (Array.isArray(options.filter)) {
|
||||
includeFiles = (options.filter.indexOf(Schemas.file) >= 0);
|
||||
includeUntitled = (options.filter.indexOf(Schemas.untitled) >= 0);
|
||||
} else {
|
||||
includeFiles = (options.filter === Schemas.file);
|
||||
includeUntitled = (options.filter === Schemas.untitled);
|
||||
}
|
||||
|
||||
if (includeFiles && resource.scheme === Schemas.file) {
|
||||
if (Array.isArray(options.filterByScheme) && options.filterByScheme.some(scheme => resource.scheme === scheme)) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
if (includeUntitled && resource.scheme === Schemas.untitled) {
|
||||
if (options.filterByScheme === resource.scheme) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Extensions, IEditorInputFactoryRegistry, EditorInput, toResource, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, SideBySideEditorInput, CloseDirection, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { Extensions, IEditorInputFactoryRegistry, EditorInput, toResource, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, SideBySideEditorInput, CloseDirection, IEditorInput, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -151,7 +151,7 @@ export class EditorGroup extends Disposable {
|
||||
}
|
||||
|
||||
for (const editor of this.editors) {
|
||||
const editorResource = toResource(editor, { supportSideBySide: true });
|
||||
const editorResource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (editorResource && editorResource.toString() === resource.toString()) {
|
||||
return editor;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ export class EditorGroup extends Disposable {
|
||||
}
|
||||
|
||||
private updateResourceMap(editor: EditorInput, remove: boolean): void {
|
||||
const resource = toResource(editor, { supportSideBySide: true });
|
||||
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
|
||||
// It is possible to have the same resource opened twice (once as normal input and once as diff input)
|
||||
|
||||
@@ -797,7 +797,7 @@ export class DebugModel implements IDebugModel {
|
||||
// Make sure to de-dupe if a session is re-intialized. In case of EH debugging we are adding a session again after an attach.
|
||||
return false;
|
||||
}
|
||||
if (s.state === State.Inactive && s.getLabel() === session.getLabel()) {
|
||||
if (s.state === State.Inactive && s.configuration.name === session.configuration.name) {
|
||||
// Make sure to remove all inactive sessions that are using the same configuration as the new session
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -783,6 +783,7 @@ export class DebugSession implements IDebugSession {
|
||||
}));
|
||||
|
||||
this.rawListeners.push(this.raw.onDidExitAdapter(event => {
|
||||
this.initialized = true;
|
||||
this._onDidEndAdapter.fire(event);
|
||||
}));
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import {
|
||||
} from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { URLService } from 'vs/platform/url/common/urlService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
+20
-20
@@ -83,30 +83,30 @@ suite('Experimental Prompts', () => {
|
||||
});
|
||||
|
||||
|
||||
test('Show experimental prompt if experiment should be run. Choosing option with link should mark experiment as complete', () => {
|
||||
// test('Show experimental prompt if experiment should be run. Choosing option with link should mark experiment as complete', () => {
|
||||
|
||||
storageData = {
|
||||
enabled: true,
|
||||
state: ExperimentState.Run
|
||||
};
|
||||
// storageData = {
|
||||
// enabled: true,
|
||||
// state: ExperimentState.Run
|
||||
// };
|
||||
|
||||
instantiationService.stub(INotificationService, {
|
||||
prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
|
||||
assert.equal(b, promptText);
|
||||
assert.equal(c.length, 2);
|
||||
c[0].run();
|
||||
return undefined!;
|
||||
}
|
||||
});
|
||||
// instantiationService.stub(INotificationService, {
|
||||
// prompt: (a: Severity, b: string, c: IPromptChoice[], options: IPromptOptions) => {
|
||||
// assert.equal(b, promptText);
|
||||
// assert.equal(c.length, 2);
|
||||
// c[0].run();
|
||||
// return undefined!;
|
||||
// }
|
||||
// });
|
||||
|
||||
experimentalPrompt = instantiationService.createInstance(ExperimentalPrompts);
|
||||
onExperimentEnabledEvent.fire(experiment);
|
||||
// experimentalPrompt = instantiationService.createInstance(ExperimentalPrompts);
|
||||
// onExperimentEnabledEvent.fire(experiment);
|
||||
|
||||
return Promise.resolve(null).then(result => {
|
||||
assert.equal(storageData['state'], ExperimentState.Complete);
|
||||
});
|
||||
// return Promise.resolve(null).then(result => {
|
||||
// assert.equal(storageData['state'], ExperimentState.Complete);
|
||||
// });
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
test('Show experimental prompt if experiment should be run. Choosing negative option should mark experiment as complete', () => {
|
||||
|
||||
@@ -194,4 +194,4 @@ suite('Experimental Prompts', () => {
|
||||
assert.equal(ExperimentalPrompts.getLocalizedText(englishUSTextCase.promptText, 'fr'), englishUSTextCase.promptText['en-us']);
|
||||
assert.equal(!!ExperimentalPrompts.getLocalizedText(noEnglishTextCase.promptText, 'fr'), false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -115,20 +115,16 @@ export function onExtensionChanged(accessor: ServicesAccessor): Event<IExtension
|
||||
});
|
||||
}
|
||||
|
||||
export function getInstalledExtensions(accessor: ServicesAccessor): Promise<IExtensionStatus[]> {
|
||||
export async function getInstalledExtensions(accessor: ServicesAccessor): Promise<IExtensionStatus[]> {
|
||||
const extensionService = accessor.get(IExtensionManagementService);
|
||||
const extensionEnablementService = accessor.get(IExtensionEnablementService);
|
||||
return extensionService.getInstalled().then(extensions => {
|
||||
return extensionEnablementService.getDisabledExtensions()
|
||||
.then(disabledExtensions => {
|
||||
return extensions.map(extension => {
|
||||
return {
|
||||
identifier: extension.identifier,
|
||||
local: extension,
|
||||
globallyEnabled: disabledExtensions.every(disabled => !areSameExtensions(disabled, extension.identifier))
|
||||
};
|
||||
});
|
||||
});
|
||||
const extensions = await extensionService.getInstalled();
|
||||
return extensions.map(extension => {
|
||||
return {
|
||||
identifier: extension.identifier,
|
||||
local: extension,
|
||||
globallyEnabled: extensionEnablementService.isEnabled(extension)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/extensionActions';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { Throttler, Delayer } from 'vs/base/common/async';
|
||||
import { Delayer } from 'vs/base/common/async';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import * as json from 'vs/base/common/json';
|
||||
@@ -1022,9 +1022,10 @@ export class ReloadAction extends ExtensionAction {
|
||||
private static readonly EnabledClass = 'extension-action reload';
|
||||
private static readonly DisabledClass = `${ReloadAction.EnabledClass} disabled`;
|
||||
|
||||
// Use delayer to wait for more updates
|
||||
private throttler: Throttler;
|
||||
private disposables: IDisposable[] = [];
|
||||
private _runningExtensions: IExtensionDescription[] = [];
|
||||
private get runningExtensions(): IExtensionDescription[] { return this._runningExtensions; }
|
||||
private set runningExtensions(runningExtensions: IExtensionDescription[]) { this._runningExtensions = runningExtensions; this.update(); }
|
||||
|
||||
constructor(
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@@ -1033,39 +1034,38 @@ export class ReloadAction extends ExtensionAction {
|
||||
@IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService
|
||||
) {
|
||||
super('extensions.reload', localize('reloadAction', "Reload"), ReloadAction.DisabledClass, false);
|
||||
this.throttler = new Throttler();
|
||||
this.extensionService.onDidChangeExtensions(this.update, this, this.disposables);
|
||||
this.update();
|
||||
this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this, this.disposables);
|
||||
this.updateRunningExtensions();
|
||||
}
|
||||
|
||||
update(): Promise<void> {
|
||||
return this.throttler.queue(() => {
|
||||
this.enabled = false;
|
||||
this.tooltip = '';
|
||||
if (!this.extension) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
const state = this.extension.state;
|
||||
if (state === ExtensionState.Installing || state === ExtensionState.Uninstalling) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
const installed = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier))[0];
|
||||
const local = this.extension.local || (installed && installed.local);
|
||||
if (local && local.manifest && local.manifest.contributes && local.manifest.contributes.localizations && local.manifest.contributes.localizations.length > 0) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
return this.extensionService.getExtensions()
|
||||
.then(runningExtensions => this.computeReloadState(runningExtensions, installed));
|
||||
}).then(() => {
|
||||
this.class = this.enabled ? ReloadAction.EnabledClass : ReloadAction.DisabledClass;
|
||||
});
|
||||
private updateRunningExtensions(): void {
|
||||
this.extensionService.getExtensions().then(runningExtensions => this.runningExtensions = runningExtensions);
|
||||
}
|
||||
|
||||
private computeReloadState(runningExtensions: IExtensionDescription[], installed: IExtension): void {
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.tooltip = '';
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
const state = this.extension.state;
|
||||
if (state === ExtensionState.Installing || state === ExtensionState.Uninstalling) {
|
||||
return;
|
||||
}
|
||||
const installed = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier))[0];
|
||||
const local = this.extension.local || (installed && installed.local);
|
||||
if (local && local.manifest && local.manifest.contributes && local.manifest.contributes.localizations && local.manifest.contributes.localizations.length > 0) {
|
||||
return;
|
||||
}
|
||||
this.computeReloadState(installed);
|
||||
this.class = this.enabled ? ReloadAction.EnabledClass : ReloadAction.DisabledClass;
|
||||
}
|
||||
|
||||
private computeReloadState(installed: IExtension): void {
|
||||
const isUninstalled = this.extension.state === ExtensionState.Uninstalled;
|
||||
const isDisabled = this.extension.local ? !this.extensionEnablementService.isEnabled(this.extension.local) : false;
|
||||
const isEnabled = this.extension.local ? this.extensionEnablementService.isEnabled(this.extension.local) : false;
|
||||
const runningExtension = runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value }, this.extension.identifier))[0];
|
||||
const runningExtension = this.runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value }, this.extension.identifier))[0];
|
||||
|
||||
if (installed && installed.local) {
|
||||
if (runningExtension) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
@@ -1199,7 +1199,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
const gallery = aGalleryExtension('a', { identifier: local.identifier, version: '1.0.2' });
|
||||
installEvent.fire({ identifier: gallery.identifier, gallery });
|
||||
didInstallEvent.fire({ identifier: gallery.identifier, gallery, operation: InstallOperation.Install, local: aLocalExtension('a', gallery, gallery) });
|
||||
didInstallEvent.fire({ identifier: gallery.identifier, gallery, operation: InstallOperation.Update, local: aLocalExtension('a', gallery, gallery) });
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/ex
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import {
|
||||
import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
|
||||
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
|
||||
import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { TestExtensionEnablementService } from 'vs/workbench/services/extensionManagement/test/electron-browser/extensionEnablementService.test';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
import { IEditorViewState } from 'vs/editor/common/editorCommon';
|
||||
import { toResource, SideBySideEditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
|
||||
import { toResource, SideBySideEditorInput, IWorkbenchEditorConfiguration, SideBySideEditor as SideBySideEditorChoice } from 'vs/workbench/common/editor';
|
||||
import { ITextFileService, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
||||
@@ -91,7 +91,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
|
||||
distinct(
|
||||
coalesce(this.editorService.visibleEditors
|
||||
.map(editorInput => {
|
||||
const resource = toResource(editorInput, { supportSideBySide: true });
|
||||
const resource = toResource(editorInput, { supportSideBySide: SideBySideEditorChoice.MASTER });
|
||||
return resource ? this.textFileService.models.get(resource) : undefined;
|
||||
}))
|
||||
.filter(model => !model.isDirty()),
|
||||
@@ -317,7 +317,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
|
||||
private handleUpdatesToVisibleBinaryEditors(e: FileChangesEvent): void {
|
||||
const editors = this.editorService.visibleControls;
|
||||
editors.forEach(editor => {
|
||||
const resource = editor.input ? toResource(editor.input, { supportSideBySide: true }) : undefined;
|
||||
const resource = editor.input ? toResource(editor.input, { supportSideBySide: SideBySideEditorChoice.MASTER }) : undefined;
|
||||
|
||||
// Support side-by-side binary editors too
|
||||
let isBinaryEditor = false;
|
||||
@@ -338,7 +338,7 @@ export class FileEditorTracker extends Disposable implements IWorkbenchContribut
|
||||
private handleOutOfWorkspaceWatchers(): void {
|
||||
const visibleOutOfWorkspacePaths = new ResourceMap<URI>();
|
||||
coalesce(this.editorService.visibleEditors.map(editorInput => {
|
||||
return toResource(editorInput, { supportSideBySide: true });
|
||||
return toResource(editorInput, { supportSideBySide: SideBySideEditorChoice.MASTER });
|
||||
})).filter(resource => {
|
||||
return this.fileService.canHandleResource(resource) && !this.contextService.isInsideWorkspace(resource);
|
||||
}).forEach(resource => {
|
||||
|
||||
@@ -17,7 +17,7 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { VIEWLET_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IFileService, AutoSaveConfiguration } from 'vs/platform/files/common/files';
|
||||
import { toResource, ITextEditor } from 'vs/workbench/common/editor';
|
||||
import { toResource, ITextEditor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { ExplorerViewlet } from 'vs/workbench/contrib/files/browser/explorerViewlet';
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
@@ -712,7 +712,7 @@ export class ShowActiveFileInExplorer extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
const resource = toResource(this.editorService.activeEditor, { supportSideBySide: true });
|
||||
const resource = toResource(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
this.commandService.executeCommand(REVEAL_IN_EXPLORER_COMMAND_ID, resource);
|
||||
} else {
|
||||
@@ -784,7 +784,7 @@ export class ShowOpenedFileInNewWindow extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
const fileResource = toResource(this.editorService.activeEditor, { supportSideBySide: true });
|
||||
const fileResource = toResource(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (fileResource) {
|
||||
if (this.fileService.canHandleResource(fileResource)) {
|
||||
this.windowService.openWindow([{ fileUri: fileResource }], { forceNewWindow: true });
|
||||
@@ -887,7 +887,7 @@ export class CompareWithClipboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
const resource = toResource(this.editorService.activeEditor, { supportSideBySide: true });
|
||||
const resource = toResource(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource && (this.fileService.canHandleResource(resource) || resource.scheme === Schemas.untitled)) {
|
||||
if (!this.registrationDisposal) {
|
||||
const provider = this.instantiationService.createInstance(ClipboardContentProvider);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { toResource, IEditorCommandsContext } from 'vs/workbench/common/editor';
|
||||
import { toResource, IEditorCommandsContext, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IWindowsService, IWindowService, IURIToOpen, IOpenSettings, INewWindowOptions } from 'vs/platform/windows/common/windows';
|
||||
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
@@ -39,6 +39,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
|
||||
// Commands
|
||||
|
||||
@@ -124,7 +125,7 @@ function save(
|
||||
let viewStateOfSource: IEditorViewState | null;
|
||||
const activeTextEditorWidget = getCodeEditor(editorService.activeTextEditorWidget);
|
||||
if (activeTextEditorWidget) {
|
||||
const activeResource = toResource(editorService.activeEditor, { supportSideBySide: true });
|
||||
const activeResource = toResource(editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (activeResource && (fileService.canHandleResource(activeResource) || resource.scheme === Schemas.untitled) && activeResource.toString() === resource.toString()) {
|
||||
viewStateOfSource = activeTextEditorWidget.saveViewState();
|
||||
}
|
||||
@@ -284,28 +285,46 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
});
|
||||
|
||||
const COMPARE_WITH_SAVED_SCHEMA = 'showModifications';
|
||||
let provider: FileOnDiskContentProvider;
|
||||
let providerDisposables: IDisposable[] = [];
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
id: COMPARE_WITH_SAVED_COMMAND_ID,
|
||||
when: undefined,
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_D),
|
||||
handler: (accessor, resource: URI | object) => {
|
||||
if (!provider) {
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const textModelService = accessor.get(ITextModelService);
|
||||
provider = instantiationService.createInstance(FileOnDiskContentProvider);
|
||||
textModelService.registerTextModelContentProvider(COMPARE_WITH_SAVED_SCHEMA, provider);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
const textModelService = accessor.get(ITextModelService);
|
||||
const editorService = accessor.get(IEditorService);
|
||||
|
||||
// Register provider at first as needed
|
||||
let registerEditorListener = false;
|
||||
if (providerDisposables.length === 0) {
|
||||
registerEditorListener = true;
|
||||
|
||||
const provider = instantiationService.createInstance(FileOnDiskContentProvider);
|
||||
providerDisposables.push(provider);
|
||||
providerDisposables.push(textModelService.registerTextModelContentProvider(COMPARE_WITH_SAVED_SCHEMA, provider));
|
||||
}
|
||||
|
||||
const editorService = accessor.get(IEditorService);
|
||||
// Open editor (only files supported)
|
||||
const uri = getResourceForCommand(resource, accessor.get(IListService), editorService);
|
||||
|
||||
if (uri && uri.scheme === Schemas.file /* only files on disk supported for now */) {
|
||||
const name = basename(uri);
|
||||
const editorLabel = nls.localize('modifiedLabel', "{0} (on disk) ↔ {1}", name, name);
|
||||
|
||||
return editorService.openEditor({ leftResource: uri.with({ scheme: COMPARE_WITH_SAVED_SCHEMA }), rightResource: uri, label: editorLabel }).then(() => undefined);
|
||||
editorService.openEditor({ leftResource: uri.with({ scheme: COMPARE_WITH_SAVED_SCHEMA }), rightResource: uri, label: editorLabel }).then(() => {
|
||||
|
||||
// Dispose once no more diff editor is opened with the scheme
|
||||
if (registerEditorListener) {
|
||||
providerDisposables.push(editorService.onDidVisibleEditorsChange(() => {
|
||||
if (!editorService.editors.some(editor => !!toResource(editor, { supportSideBySide: SideBySideEditor.DETAILS, filterByScheme: COMPARE_WITH_SAVED_SCHEMA }))) {
|
||||
providerDisposables = dispose(providerDisposables);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}, error => {
|
||||
providerDisposables = dispose(providerDisposables);
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(true);
|
||||
@@ -522,7 +541,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
handler: accessor => {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
|
||||
const resource = toResource(editorService.activeEditor, { supportSideBySide: true });
|
||||
const resource = toResource(editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
return save(resource, false, { skipSaveParticipants: true }, editorService, accessor.get(IFileService), accessor.get(IUntitledEditorService), accessor.get(ITextFileService), accessor.get(IEditorGroupsService));
|
||||
}
|
||||
@@ -553,7 +572,7 @@ CommandsRegistry.registerCommand({
|
||||
const editorGroup = editorGroupService.getGroup(context.groupId);
|
||||
if (editorGroup) {
|
||||
editorGroup.editors.forEach(editor => {
|
||||
const resource = toResource(editor, { supportSideBySide: true });
|
||||
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource && (resource.scheme === Schemas.untitled || fileService.canHandleResource(resource))) {
|
||||
saveAllArg.push(resource);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IListService, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
import { OpenEditor } from 'vs/workbench/contrib/files/common/files';
|
||||
import { toResource } from 'vs/workbench/common/editor';
|
||||
import { toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel';
|
||||
@@ -41,7 +41,7 @@ export function getResourceForCommand(resource: URI | object | undefined, listSe
|
||||
}
|
||||
}
|
||||
|
||||
return editorService.activeEditor ? toResource(editorService.activeEditor, { supportSideBySide: true }) : null;
|
||||
return editorService.activeEditor ? toResource(editorService.activeEditor, { supportSideBySide: SideBySideEditor.MASTER }) : null;
|
||||
}
|
||||
|
||||
export function getMultiSelectedResources(resource: URI | object | undefined, listService: IListService, editorService: IEditorService): Array<URI> {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Action, IAction } from 'vs/base/common/actions';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, IExplorerService, ExplorerResourceCut, ExplorerResourceMoveableToTrash } from 'vs/workbench/contrib/files/common/files';
|
||||
import { NewFolderAction, NewFileAction, FileCopiedContext, RefreshExplorerView } from 'vs/workbench/contrib/files/browser/fileActions';
|
||||
import { toResource } from 'vs/workbench/common/editor';
|
||||
import { toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { CollapseAction } from 'vs/workbench/browser/viewlet';
|
||||
@@ -503,7 +503,7 @@ export class ExplorerView extends ViewletPanel {
|
||||
}
|
||||
|
||||
// check for files
|
||||
return withNullAsUndefined(toResource(input, { supportSideBySide: true }));
|
||||
return withNullAsUndefined(toResource(input, { supportSideBySide: SideBySideEditor.MASTER }));
|
||||
}
|
||||
|
||||
private async onSelectResource(resource: URI | undefined, reveal = this.autoReveal): Promise<void> {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { IWorkbenchEditorConfiguration, IEditorIdentifier, IEditorInput, toResource } from 'vs/workbench/common/editor';
|
||||
import { IWorkbenchEditorConfiguration, IEditorIdentifier, IEditorInput, toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IFilesConfiguration, FileChangeType, IFileService } from 'vs/platform/files/common/files';
|
||||
import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ITextModelContentProvider } from 'vs/editor/common/services/resolverService';
|
||||
@@ -231,7 +231,7 @@ export class OpenEditor implements IEditorIdentifier {
|
||||
}
|
||||
|
||||
public isUntitled(): boolean {
|
||||
return !!toResource(this.editor, { supportSideBySide: true, filter: Schemas.untitled });
|
||||
return !!toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER, filterByScheme: Schemas.untitled });
|
||||
}
|
||||
|
||||
public isDirty(): boolean {
|
||||
@@ -239,6 +239,6 @@ export class OpenEditor implements IEditorIdentifier {
|
||||
}
|
||||
|
||||
public getResource(): URI | null {
|
||||
return toResource(this.editor, { supportSideBySide: true });
|
||||
return toResource(this.editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ISearchConfiguration, ISearchConfigurationProperties } from 'vs/workben
|
||||
import { SymbolKind, Location, ProviderResult } from 'vs/editor/common/modes';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { toResource } from 'vs/workbench/common/editor';
|
||||
import { toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
@@ -85,7 +85,7 @@ export function getOutOfWorkspaceEditorResources(editorService: IEditorService,
|
||||
const resources: URI[] = [];
|
||||
|
||||
editorService.editors.forEach(editor => {
|
||||
const resource = toResource(editor, { supportSideBySide: true });
|
||||
const resource = toResource(editor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource && !contextService.isInsideWorkspace(resource)) {
|
||||
resources.push(resource);
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ CommandsRegistry.registerCommand('_workbench.captureSyntaxTokens', function (acc
|
||||
|
||||
if (!resource) {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const file = editorService.activeEditor ? toResource(editorService.activeEditor, { filter: 'file' }) : null;
|
||||
const file = editorService.activeEditor ? toResource(editorService.activeEditor, { filterByScheme: 'file' }) : null;
|
||||
if (file) {
|
||||
process(file).then(result => {
|
||||
console.log(result);
|
||||
|
||||
@@ -210,7 +210,7 @@ class CodeRendererMain extends Disposable {
|
||||
}
|
||||
|
||||
return this.resolveWorkspaceInitializationPayload(environmentService).then(payload => Promise.all([
|
||||
this.createWorkspaceService(payload, environmentService, remoteAgentService, logService).then(service => {
|
||||
this.createWorkspaceService(payload, environmentService, fileService, remoteAgentService, logService).then(service => {
|
||||
|
||||
// Workspace
|
||||
serviceCollection.set(IWorkspaceContextService, service);
|
||||
@@ -301,8 +301,11 @@ class CodeRendererMain extends Disposable {
|
||||
}, error => onUnexpectedError(error));
|
||||
}
|
||||
|
||||
private createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IEnvironmentService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache(environmentService) }, new ConfigurationFileService(), remoteAgentService);
|
||||
private createWorkspaceService(payload: IWorkspaceInitializationPayload, environmentService: IEnvironmentService, fileService: FileService2, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
|
||||
const configurationFileService = new ConfigurationFileService();
|
||||
fileService.whenReady.then(() => configurationFileService.fileService = fileService);
|
||||
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), remoteAuthority: this.configuration.remoteAuthority, configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);
|
||||
|
||||
return workspaceService.initialize(payload).then(() => workspaceService, error => {
|
||||
onUnexpectedError(error);
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { toResource, IUntitledResourceInput } from 'vs/workbench/common/editor';
|
||||
import { toResource, IUntitledResourceInput, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IWindowsService, IWindowService, IWindowSettings, IOpenFileRequest, IWindowsConfiguration, IAddFoldersRequest, IRunActionInWindowRequest, IPathData, IRunKeybindingInWindowRequest } from 'vs/platform/windows/common/windows';
|
||||
@@ -122,7 +122,7 @@ export class ElectronWindow extends Disposable {
|
||||
if (request.from === 'touchbar') {
|
||||
const activeEditor = this.editorService.activeEditor;
|
||||
if (activeEditor) {
|
||||
const resource = toResource(activeEditor, { supportSideBySide: true });
|
||||
const resource = toResource(activeEditor, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (resource) {
|
||||
args.push(resource);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export class RemoteUserConfiguration extends Disposable {
|
||||
this._userConfigurationDisposable.dispose();
|
||||
this._userConfiguration = this._register(new UserConfiguration(environment.appSettingsPath, this._configurationFileService));
|
||||
this._userConfigurationDisposable = this._register(this._userConfiguration.onDidChangeConfiguration(configurationModel => this.onDidUserConfigurationChange(configurationModel)));
|
||||
this._userConfiguration.initialize().then(configurationModel => this._onDidChangeConfiguration.fire(configurationModel));
|
||||
this._userConfiguration.initialize().then(configurationModel => this.onDidUserConfigurationChange(configurationModel));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { Queue, Barrier } from 'vs/base/common/async';
|
||||
import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
||||
import { IWorkspaceContextService, Workspace, WorkbenchState, IWorkspaceFolder, toWorkspaceFolders, IWorkspaceFoldersChangeEvent, WorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
import { isLinux } from 'vs/base/common/platform';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { ConfigurationChangeEvent, ConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/configurationModels';
|
||||
import { IConfigurationChangeEvent, ConfigurationTarget, IConfigurationOverrides, keyFromOverrideIdentifier, isConfigurationOverrides, IConfigurationData, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Configuration, WorkspaceConfigurationChangeEvent, AllKeysConfigurationChangeEvent } from 'vs/workbench/services/configuration/common/configurationModels';
|
||||
@@ -290,10 +289,6 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
|
||||
});
|
||||
}
|
||||
|
||||
acquireFileService(fileService: IFileService): void {
|
||||
this.configurationFileService.fileService = fileService;
|
||||
}
|
||||
|
||||
acquireInstantiationService(instantiationService: IInstantiationService): void {
|
||||
this.configurationEditingService = instantiationService.createInstance(ConfigurationEditingService);
|
||||
this.jsonEditingService = instantiationService.createInstance(JSONEditingService);
|
||||
|
||||
+16
-12
@@ -219,14 +219,16 @@ suite('WorkspaceContextService - Workspace Editing', () => {
|
||||
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, path.join(parentDir, 'settings.json'));
|
||||
const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {});
|
||||
instantiationService.stub(IRemoteAgentService, remoteAgentService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, new ConfigurationFileService(), remoteAgentService);
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
const configurationFileService = new ConfigurationFileService();
|
||||
fileService.whenReady.then(() => configurationFileService.fileService = fileService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);
|
||||
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceService);
|
||||
instantiationService.stub(IConfigurationService, workspaceService);
|
||||
instantiationService.stub(IEnvironmentService, environmentService);
|
||||
|
||||
return workspaceService.initialize(getWorkspaceIdentifier(configPath)).then(() => {
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService()));
|
||||
fileService.setLegacyService(new LegacyFileService(
|
||||
fileService,
|
||||
@@ -238,7 +240,6 @@ suite('WorkspaceContextService - Workspace Editing', () => {
|
||||
instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
workspaceService.acquireInstantiationService(instantiationService);
|
||||
workspaceService.acquireFileService(fileService);
|
||||
|
||||
testObject = workspaceService;
|
||||
});
|
||||
@@ -485,13 +486,15 @@ suite('WorkspaceService - Initialization', () => {
|
||||
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
|
||||
const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {});
|
||||
instantiationService.stub(IRemoteAgentService, remoteAgentService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, new ConfigurationFileService(), remoteAgentService);
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
const configurationFileService = new ConfigurationFileService();
|
||||
fileService.whenReady.then(() => configurationFileService.fileService = fileService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceService);
|
||||
instantiationService.stub(IConfigurationService, workspaceService);
|
||||
instantiationService.stub(IEnvironmentService, environmentService);
|
||||
|
||||
return workspaceService.initialize({ id: '' }).then(() => {
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService()));
|
||||
fileService.setLegacyService(new LegacyFileService(
|
||||
fileService,
|
||||
@@ -503,7 +506,6 @@ suite('WorkspaceService - Initialization', () => {
|
||||
instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
workspaceService.acquireInstantiationService(instantiationService);
|
||||
workspaceService.acquireFileService(fileService);
|
||||
testObject = workspaceService;
|
||||
});
|
||||
});
|
||||
@@ -749,13 +751,15 @@ suite('WorkspaceConfigurationService - Folder', () => {
|
||||
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
|
||||
const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {});
|
||||
instantiationService.stub(IRemoteAgentService, remoteAgentService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, new ConfigurationFileService(), remoteAgentService);
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
const configurationFileService = new ConfigurationFileService();
|
||||
fileService.whenReady.then(() => configurationFileService.fileService = fileService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceService);
|
||||
instantiationService.stub(IConfigurationService, workspaceService);
|
||||
instantiationService.stub(IEnvironmentService, environmentService);
|
||||
|
||||
return workspaceService.initialize(convertToWorkspacePayload(URI.file(folderDir))).then(() => {
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService()));
|
||||
fileService.setLegacyService(new LegacyFileService(
|
||||
fileService,
|
||||
@@ -767,7 +771,6 @@ suite('WorkspaceConfigurationService - Folder', () => {
|
||||
instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
workspaceService.acquireInstantiationService(instantiationService);
|
||||
workspaceService.acquireFileService(fileService);
|
||||
testObject = workspaceService;
|
||||
});
|
||||
});
|
||||
@@ -1046,14 +1049,16 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
|
||||
environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, path.join(parentDir, 'settings.json'));
|
||||
const remoteAgentService = instantiationService.createInstance(RemoteAgentService, {});
|
||||
instantiationService.stub(IRemoteAgentService, remoteAgentService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, new ConfigurationFileService(), remoteAgentService);
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
const configurationFileService = new ConfigurationFileService();
|
||||
fileService.whenReady.then(() => configurationFileService.fileService = fileService);
|
||||
const workspaceService = new WorkspaceService({ userSettingsResource: URI.file(environmentService.appSettingsPath), configurationCache: new ConfigurationCache(environmentService) }, configurationFileService, remoteAgentService);
|
||||
|
||||
instantiationService.stub(IWorkspaceContextService, workspaceService);
|
||||
instantiationService.stub(IConfigurationService, workspaceService);
|
||||
instantiationService.stub(IEnvironmentService, environmentService);
|
||||
|
||||
return workspaceService.initialize(getWorkspaceIdentifier(configPath)).then(() => {
|
||||
const fileService = new FileService2(new NullLogService());
|
||||
fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(new NullLogService()));
|
||||
fileService.setLegacyService(new LegacyFileService(
|
||||
fileService,
|
||||
@@ -1065,7 +1070,6 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
|
||||
instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService));
|
||||
instantiationService.stub(ITextModelService, <ITextModelService>instantiationService.createInstance(TextModelResolverService));
|
||||
workspaceService.acquireInstantiationService(instantiationService);
|
||||
workspaceService.acquireFileService(fileService);
|
||||
|
||||
workspaceContextService = workspaceService;
|
||||
jsonEditingServce = instantiationService.createInstance(JSONEditingService);
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ export class ConfigurationResolverService extends AbstractVariableResolverServic
|
||||
if (activeEditor instanceof DiffEditorInput) {
|
||||
activeEditor = activeEditor.modifiedInput;
|
||||
}
|
||||
const fileResource = toResource(activeEditor, { filter: Schemas.file });
|
||||
const fileResource = toResource(activeEditor, { filterByScheme: Schemas.file });
|
||||
if (!fileResource) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export class FileDialogService implements IFileDialogService {
|
||||
return this.pickRemoteResource({ canSelectFiles: true, canSelectFolders: true, canSelectMany: false, defaultUri: options.defaultUri, title, availableFileSystems }).then(uri => {
|
||||
if (uri) {
|
||||
return (this.fileService.resolve(uri)).then(stat => {
|
||||
const toOpen: IURIToOpen = stat.isDirectory ? { fileUri: uri } : { folderUri: uri };
|
||||
const toOpen: IURIToOpen = stat.isDirectory ? { folderUri: uri } : { fileUri: uri };
|
||||
return this.windowService.openWindow([toOpen], { forceNewWindow: options.forceNewWindow });
|
||||
});
|
||||
}
|
||||
@@ -210,7 +210,7 @@ export class FileDialogService implements IFileDialogService {
|
||||
|
||||
showOpenDialog(options: IOpenDialogOptions): Promise<URI[] | undefined> {
|
||||
const schema = this.getFileSystemSchema(options);
|
||||
if (schema !== Schemas.file) {
|
||||
if (this.shouldUseSimplified(schema)) {
|
||||
if (!options.availableFileSystems) {
|
||||
options.availableFileSystems = [schema]; // by default only allow loading in the own file system
|
||||
}
|
||||
|
||||
@@ -110,10 +110,13 @@ export class RemoteFileDialog {
|
||||
let defaultUri = options.defaultUri;
|
||||
const filename = (defaultUri && isSave && (resources.dirname(defaultUri).path === '/')) ? resources.basename(defaultUri) : undefined;
|
||||
if (!defaultUri || filename) {
|
||||
const env = await this.remoteAgentService.getEnvironment();
|
||||
if (env) {
|
||||
defaultUri = env.userHome;
|
||||
} else {
|
||||
if (this.scheme !== Schemas.file) {
|
||||
const env = await this.remoteAgentService.getEnvironment();
|
||||
if (env) {
|
||||
defaultUri = env.userHome;
|
||||
}
|
||||
}
|
||||
if (!defaultUri) {
|
||||
defaultUri = URI.from({ scheme: this.scheme, path: this.environmentService.userHome });
|
||||
}
|
||||
if (filename) {
|
||||
@@ -192,7 +195,7 @@ export class RemoteFileDialog {
|
||||
if (validated) {
|
||||
isResolving = true;
|
||||
this.filePickBox.hide();
|
||||
resolve(resolveValue);
|
||||
doResolve(this, resolveValue);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -200,6 +203,13 @@ export class RemoteFileDialog {
|
||||
this.filePickBox.title = this.options.title;
|
||||
this.filePickBox.value = this.pathFromUri(this.currentFolder);
|
||||
this.filePickBox.items = [];
|
||||
|
||||
function doResolve(dialog: RemoteFileDialog, uri: URI | undefined) {
|
||||
resolve(uri);
|
||||
dialog.contextKey.set(false);
|
||||
dialog.filePickBox.dispose();
|
||||
}
|
||||
|
||||
this.filePickBox.onDidAccept(_ => {
|
||||
if (isAcceptHandled || this.filePickBox.busy) {
|
||||
return;
|
||||
@@ -210,9 +220,9 @@ export class RemoteFileDialog {
|
||||
this.onDidAccept().then(resolveValue => {
|
||||
if (resolveValue) {
|
||||
this.filePickBox.hide();
|
||||
resolve(resolveValue);
|
||||
doResolve(this, resolveValue);
|
||||
} else if (this.hidden) {
|
||||
resolve(undefined);
|
||||
doResolve(this, undefined);
|
||||
} else {
|
||||
isResolving = false;
|
||||
isAcceptHandled = false;
|
||||
@@ -221,6 +231,10 @@ export class RemoteFileDialog {
|
||||
});
|
||||
this.filePickBox.onDidChangeActive(i => {
|
||||
isAcceptHandled = false;
|
||||
// update input box to match the first selected item
|
||||
if (i.length === 1) {
|
||||
this.setAutoComplete(this.userValue, resources.basename(this.remoteUriFrom(this.userValue)), i[0], true);
|
||||
}
|
||||
});
|
||||
|
||||
this.filePickBox.onDidChangeValue(async value => {
|
||||
@@ -229,13 +243,11 @@ export class RemoteFileDialog {
|
||||
if (value !== this.userValue) {
|
||||
this.filePickBox.validationMessage = undefined;
|
||||
this.shouldOverwriteFile = false;
|
||||
const trimmedPickBoxValue = ((this.filePickBox.value.length > 1) && this.endsWithSlash(this.filePickBox.value)) ? this.filePickBox.value.substr(0, this.filePickBox.value.length - 1) : this.filePickBox.value;
|
||||
const valueUri = this.remoteUriFrom(trimmedPickBoxValue);
|
||||
if (!resources.isEqual(this.currentFolder, valueUri, true)) {
|
||||
const valueUri = this.remoteUriFrom(this.trimTrailingSlash(this.filePickBox.value));
|
||||
if (!resources.isEqual(this.remoteUriFrom(this.trimTrailingSlash(this.pathFromUri(this.currentFolder))), valueUri, true)) {
|
||||
await this.tryUpdateItems(value, this.remoteUriFrom(this.filePickBox.value));
|
||||
}
|
||||
this.setActiveItems(value);
|
||||
this.userValue = value;
|
||||
} else {
|
||||
this.filePickBox.activeItems = [];
|
||||
}
|
||||
@@ -244,10 +256,8 @@ export class RemoteFileDialog {
|
||||
this.filePickBox.onDidHide(() => {
|
||||
this.hidden = true;
|
||||
if (!isResolving) {
|
||||
resolve(undefined);
|
||||
doResolve(this, undefined);
|
||||
}
|
||||
this.contextKey.set(false);
|
||||
this.filePickBox.dispose();
|
||||
});
|
||||
|
||||
this.filePickBox.show();
|
||||
@@ -361,15 +371,8 @@ export class RemoteFileDialog {
|
||||
let hasMatch = false;
|
||||
for (let i = 0; i < this.filePickBox.items.length; i++) {
|
||||
const item = <FileQuickPickItem>this.filePickBox.items[i];
|
||||
const itemBasename = (item.label === '..') ? item.label : resources.basename(item.uri);
|
||||
if ((itemBasename.length >= inputBasename.length) && (itemBasename.substr(0, inputBasename.length).toLowerCase() === inputBasename.toLowerCase())) {
|
||||
if (this.setAutoComplete(value, inputBasename, item)) {
|
||||
this.filePickBox.activeItems = [item];
|
||||
const insertValue = itemBasename.substr(inputBasename.length);
|
||||
this.autoComplete = value + insertValue;
|
||||
if (this.filePickBox.inputHasFocus()) {
|
||||
document.execCommand('insertText', false, insertValue);
|
||||
this.filePickBox.valueSelection = [value.length, this.filePickBox.value.length];
|
||||
}
|
||||
hasMatch = true;
|
||||
break;
|
||||
}
|
||||
@@ -377,6 +380,44 @@ export class RemoteFileDialog {
|
||||
if (!hasMatch) {
|
||||
this.filePickBox.activeItems = [];
|
||||
}
|
||||
} else {
|
||||
this.userValue = value;
|
||||
this.autoComplete = '';
|
||||
}
|
||||
}
|
||||
|
||||
private setAutoComplete(startingValue: string, startingBasename: string, quickPickItem: FileQuickPickItem, force: boolean = false): boolean {
|
||||
const itemBasename = (quickPickItem.label === '..') ? quickPickItem.label : resources.basename(quickPickItem.uri);
|
||||
const itemPathLabel = (itemBasename === '..') ? this.pathAppend(this.currentFolder, itemBasename) : this.pathFromUri(quickPickItem.uri);
|
||||
if (this.trimTrailingSlash(this.filePickBox.value) !== itemPathLabel) {
|
||||
// Either foce the autocomplete, or the old value should be one smaller than the new value and match the new value.
|
||||
if (!force && (itemBasename.length >= startingBasename.length) && (itemBasename.substr(0, startingBasename.length).toLowerCase() === startingBasename.toLowerCase())) {
|
||||
this.userValue = startingValue;
|
||||
const autoCompleteValue = itemBasename.substr(startingBasename.length);
|
||||
this.autoComplete = startingValue + autoCompleteValue;
|
||||
this.insertText(this.autoComplete, autoCompleteValue);
|
||||
this.filePickBox.valueSelection = [startingValue.length, this.filePickBox.value.length];
|
||||
return true;
|
||||
} else if (force) {
|
||||
this.userValue = this.pathFromUri(this.currentFolder, true);
|
||||
this.autoComplete = this.pathAppend(this.currentFolder, itemBasename);
|
||||
this.filePickBox.valueSelection = [this.userValue.length, this.filePickBox.value.length];
|
||||
// use insert text to preserve undo buffer
|
||||
this.insertText(this.autoComplete, itemBasename);
|
||||
this.filePickBox.valueSelection = [this.filePickBox.value.length - itemBasename.length, this.filePickBox.value.length];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
this.userValue = startingValue;
|
||||
this.autoComplete = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
private insertText(wholeValue: string, insertText: string) {
|
||||
if (this.filePickBox.inputHasFocus()) {
|
||||
document.execCommand('insertText', false, insertText);
|
||||
} else {
|
||||
this.filePickBox.value = wholeValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,6 +447,39 @@ export class RemoteFileDialog {
|
||||
return result;
|
||||
}
|
||||
|
||||
private trimTrailingSlash(path: string): string {
|
||||
return ((path.length > 1) && this.endsWithSlash(path)) ? path.substr(0, path.length - 1) : path;
|
||||
}
|
||||
|
||||
private yesNoPrompt(message: string): Promise<boolean> {
|
||||
interface YesNoItem extends IQuickPickItem {
|
||||
value: boolean;
|
||||
}
|
||||
const prompt = this.quickInputService.createQuickPick<YesNoItem>();
|
||||
const no = nls.localize('remoteFileDialog.no', 'No');
|
||||
prompt.items = [{ label: no, value: false }, { label: nls.localize('remoteFileDialog.yes', 'Yes'), value: true }];
|
||||
prompt.title = message;
|
||||
prompt.placeholder = no;
|
||||
let isResolving = false;
|
||||
return new Promise<boolean>(resolve => {
|
||||
prompt.onDidAccept(() => {
|
||||
isResolving = true;
|
||||
prompt.hide();
|
||||
resolve(prompt.selectedItems ? prompt.selectedItems[0].value : false);
|
||||
});
|
||||
prompt.onDidHide(() => {
|
||||
if (!isResolving) {
|
||||
resolve(false);
|
||||
}
|
||||
this.filePickBox.show();
|
||||
this.hidden = false;
|
||||
this.filePickBox.items = this.filePickBox.items;
|
||||
prompt.dispose();
|
||||
});
|
||||
prompt.show();
|
||||
});
|
||||
}
|
||||
|
||||
private async validate(uri: URI): Promise<boolean> {
|
||||
let stat: IFileStat | undefined;
|
||||
let statDirname: IFileStat | undefined;
|
||||
@@ -424,8 +498,9 @@ export class RemoteFileDialog {
|
||||
} else if (stat && !this.shouldOverwriteFile) {
|
||||
// Replacing a file.
|
||||
this.shouldOverwriteFile = true;
|
||||
this.filePickBox.validationMessage = nls.localize('remoteFileDialog.validateExisting', '{0} already exists. Are you sure you want to overwrite it?', resources.basename(uri));
|
||||
return Promise.resolve(false);
|
||||
// Show a yes/no prompt
|
||||
const message = nls.localize('remoteFileDialog.validateExisting', '{0} already exists. Are you sure you want to overwrite it?', resources.basename(uri));
|
||||
return this.yesNoPrompt(message);
|
||||
} else if (!this.isValidBaseName(resources.basename(uri))) {
|
||||
// Filename not allowed
|
||||
this.filePickBox.validationMessage = nls.localize('remoteFileDialog.validateBadFilename', 'Please enter a valid file name.');
|
||||
@@ -455,7 +530,11 @@ export class RemoteFileDialog {
|
||||
|
||||
private updateItems(newFolder: URI, trailing?: string) {
|
||||
this.currentFolder = newFolder;
|
||||
this.filePickBox.value = trailing ? this.pathFromUri(resources.joinPath(newFolder, trailing)) : this.pathFromUri(newFolder, true);
|
||||
this.userValue = this.pathFromUri(newFolder);
|
||||
this.autoComplete = '';
|
||||
this.filePickBox.valueSelection = [0, this.filePickBox.value.length];
|
||||
const newValue = trailing ? this.pathFromUri(resources.joinPath(newFolder, trailing)) : this.pathFromUri(newFolder, true);
|
||||
this.insertText(newValue, newValue);
|
||||
this.filePickBox.busy = true;
|
||||
this.createItems(this.currentFolder).then(items => {
|
||||
this.filePickBox.items = items;
|
||||
@@ -480,6 +559,14 @@ export class RemoteFileDialog {
|
||||
return result;
|
||||
}
|
||||
|
||||
private pathAppend(uri: URI, additional: string): string {
|
||||
if (additional === '..') {
|
||||
return this.pathFromUri(uri) + this.labelService.getSeparator(uri.scheme, uri.authority) + additional;
|
||||
} else {
|
||||
return this.pathFromUri(resources.joinPath(uri, additional));
|
||||
}
|
||||
}
|
||||
|
||||
private isValidBaseName(name: string): boolean {
|
||||
if (!name || name.length === 0 || /^\s+$/.test(name)) {
|
||||
return false; // require a name that is not just whitespace
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IResourceInput, ITextEditorOptions, IEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorInput, IEditor, GroupIdentifier, IFileEditorInput, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInputFactoryRegistry, Extensions as EditorExtensions, IFileInputFactory, EditorInput, SideBySideEditorInput, IEditorInputWithOptions, isEditorInputWithOptions, EditorOptions, TextEditorOptions, IEditorIdentifier, IEditorCloseEvent, ITextEditor, ITextDiffEditor, ITextSideBySideEditor, toResource } from 'vs/workbench/common/editor';
|
||||
import { IEditorInput, IEditor, GroupIdentifier, IFileEditorInput, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInputFactoryRegistry, Extensions as EditorExtensions, IFileInputFactory, EditorInput, SideBySideEditorInput, IEditorInputWithOptions, isEditorInputWithOptions, EditorOptions, TextEditorOptions, IEditorIdentifier, IEditorCloseEvent, ITextEditor, ITextDiffEditor, ITextSideBySideEditor, toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
|
||||
import { DataUriEditorInput } from 'vs/workbench/common/editor/dataUriEditorInput';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -416,7 +416,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
|
||||
// Resource editor
|
||||
else {
|
||||
for (const editorInGroup of group.editors) {
|
||||
const resource = toResource(editorInGroup, { supportSideBySide: true });
|
||||
const resource = toResource(editorInGroup, { supportSideBySide: SideBySideEditor.MASTER });
|
||||
if (!resource) {
|
||||
continue; // need a resource to compare with
|
||||
}
|
||||
|
||||
+20
-37
@@ -6,13 +6,17 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionIdentifier, EnablementState, DidInstallExtensionEvent, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionEnablementService, IExtensionIdentifier, EnablementState, DidInstallExtensionEvent, InstallOperation, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IStorageService, StorageScope, IWorkspaceStorageChangeEvent } from 'vs/platform/storage/common/storage';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { ExtensionType, IExtension } from 'vs/platform/extensions/common/extensions';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { isUIExtension } from 'vs/workbench/services/extensions/node/extensionsUtil';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
|
||||
const DISABLED_EXTENSIONS_STORAGE_PATH = 'extensionsIdentifiers/disabled';
|
||||
const ENABLED_EXTENSIONS_STORAGE_PATH = 'extensionsIdentifiers/enabled';
|
||||
@@ -30,7 +34,10 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService
|
||||
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
|
||||
@IWindowService private readonly windowService: IWindowService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
) {
|
||||
super();
|
||||
this.storageManger = this._register(new StorageManager(storageService));
|
||||
@@ -47,38 +54,8 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
return this.environmentService.disableExtensions === true;
|
||||
}
|
||||
|
||||
async getDisabledExtensions(): Promise<IExtensionIdentifier[]> {
|
||||
|
||||
let result = this._getDisabledExtensions(StorageScope.GLOBAL);
|
||||
|
||||
if (this.hasWorkspace) {
|
||||
for (const e of this._getDisabledExtensions(StorageScope.WORKSPACE)) {
|
||||
if (!result.some(r => areSameExtensions(r, e))) {
|
||||
result.push(e);
|
||||
}
|
||||
}
|
||||
const workspaceEnabledExtensions = this._getEnabledExtensions(StorageScope.WORKSPACE);
|
||||
if (workspaceEnabledExtensions.length) {
|
||||
result = result.filter(r => !workspaceEnabledExtensions.some(e => areSameExtensions(e, r)));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.environmentService.disableExtensions) {
|
||||
const allInstalledExtensions = await this.extensionManagementService.getInstalled();
|
||||
for (const installedExtension of allInstalledExtensions) {
|
||||
if (this._isExtensionDisabledInEnvironment(installedExtension)) {
|
||||
if (!result.some(r => areSameExtensions(r, installedExtension.identifier))) {
|
||||
result.push(installedExtension.identifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
getEnablementState(extension: IExtension): EnablementState {
|
||||
if (this._isExtensionDisabledInEnvironment(extension)) {
|
||||
if (this._isSystemDisabled(extension)) {
|
||||
return EnablementState.Disabled;
|
||||
}
|
||||
const identifier = extension.identifier;
|
||||
@@ -101,7 +78,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
if (extension.manifest && extension.manifest.contributes && extension.manifest.contributes.localizations && extension.manifest.contributes.localizations.length) {
|
||||
return false;
|
||||
}
|
||||
if (extension.type === ExtensionType.User && this.environmentService.disableExtensions) {
|
||||
if (this._isSystemDisabled(extension)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -153,7 +130,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
return enablementState === EnablementState.WorkspaceEnabled || enablementState === EnablementState.Enabled;
|
||||
}
|
||||
|
||||
private _isExtensionDisabledInEnvironment(extension: IExtension): boolean {
|
||||
private _isSystemDisabled(extension: IExtension): boolean {
|
||||
if (this.allUserExtensionsDisabled) {
|
||||
return extension.type === ExtensionType.User;
|
||||
}
|
||||
@@ -161,6 +138,10 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
if (Array.isArray(disabledExtensions)) {
|
||||
return disabledExtensions.some(id => areSameExtensions({ id }, extension.identifier));
|
||||
}
|
||||
if (this.windowService.getConfiguration().remoteAuthority) {
|
||||
const server = isUIExtension(extension.manifest, this.configurationService) ? this.extensionManagementServerService.localExtensionManagementServer : this.extensionManagementServerService.remoteExtensionManagementServer;
|
||||
return this.extensionManagementServerService.getExtensionManagementServer(extension.location) !== server;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -260,7 +241,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
return false;
|
||||
}
|
||||
|
||||
private _getEnabledExtensions(scope: StorageScope): IExtensionIdentifier[] {
|
||||
protected _getEnabledExtensions(scope: StorageScope): IExtensionIdentifier[] {
|
||||
return this._getExtensions(ENABLED_EXTENSIONS_STORAGE_PATH, scope);
|
||||
}
|
||||
|
||||
@@ -268,7 +249,7 @@ export class ExtensionEnablementService extends Disposable implements IExtension
|
||||
this._setExtensions(ENABLED_EXTENSIONS_STORAGE_PATH, enabledExtensions, scope);
|
||||
}
|
||||
|
||||
private _getDisabledExtensions(scope: StorageScope): IExtensionIdentifier[] {
|
||||
protected _getDisabledExtensions(scope: StorageScope): IExtensionIdentifier[] {
|
||||
return this._getExtensions(DISABLED_EXTENSIONS_STORAGE_PATH, scope);
|
||||
}
|
||||
|
||||
@@ -386,3 +367,5 @@ class StorageManager extends Disposable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IExtensionEnablementService, ExtensionEnablementService, true);
|
||||
+92
-81
@@ -4,15 +4,19 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import * as sinon from 'sinon';
|
||||
import { IExtensionManagementService, IExtensionEnablementService, DidUninstallExtensionEvent, EnablementState, ILocalExtension, DidInstallExtensionEvent, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
import { IExtensionManagementService, IExtensionEnablementService, DidUninstallExtensionEvent, EnablementState, ILocalExtension, DidInstallExtensionEvent, InstallOperation, IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionEnablementService } from 'vs/workbench/services/extensionManagement/node/extensionEnablementService';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IStorageService, InMemoryStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IExtensionContributions, ExtensionType, IExtension } from 'vs/platform/extensions/common/extensions';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { TestWindowService } from 'vs/workbench/test/workbenchTestServices';
|
||||
|
||||
function storageService(instantiationService: TestInstantiationService): IStorageService {
|
||||
let service = instantiationService.get(IStorageService);
|
||||
@@ -33,11 +37,22 @@ export class TestExtensionEnablementService extends ExtensionEnablementService {
|
||||
super(storageService(instantiationService), instantiationService.get(IWorkspaceContextService),
|
||||
instantiationService.get(IEnvironmentService) || instantiationService.stub(IEnvironmentService, {} as IEnvironmentService),
|
||||
instantiationService.get(IExtensionManagementService) || instantiationService.stub(IExtensionManagementService,
|
||||
{ onDidInstallExtension: new Emitter<DidInstallExtensionEvent>().event, onDidUninstallExtension: new Emitter<DidUninstallExtensionEvent>().event } as IExtensionManagementService));
|
||||
{ onDidInstallExtension: new Emitter<DidInstallExtensionEvent>().event, onDidUninstallExtension: new Emitter<DidUninstallExtensionEvent>().event } as IExtensionManagementService),
|
||||
instantiationService.stub(IWindowService, new TestWindowService()), instantiationService.get(IConfigurationService), instantiationService.get(IExtensionManagementServerService));
|
||||
}
|
||||
|
||||
public async reset(): Promise<void> {
|
||||
return this.getDisabledExtensions().then(extensions => extensions.forEach(d => this.setEnablement([aLocalExtension(d.id)], EnablementState.Enabled)));
|
||||
public reset(): void {
|
||||
let extensions = this._getDisabledExtensions(StorageScope.GLOBAL);
|
||||
for (const e of this._getDisabledExtensions(StorageScope.WORKSPACE)) {
|
||||
if (!extensions.some(r => areSameExtensions(r, e))) {
|
||||
extensions.push(e);
|
||||
}
|
||||
}
|
||||
const workspaceEnabledExtensions = this._getEnabledExtensions(StorageScope.WORKSPACE);
|
||||
if (workspaceEnabledExtensions.length) {
|
||||
extensions = extensions.filter(r => !workspaceEnabledExtensions.some(e => areSameExtensions(e, r)));
|
||||
}
|
||||
extensions.forEach(d => this.setEnablement([aLocalExtension(d.id)], EnablementState.Enabled));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,22 +74,11 @@ suite('ExtensionEnablementService Test', () => {
|
||||
(<ExtensionEnablementService>testObject).dispose();
|
||||
});
|
||||
|
||||
test('test when no extensions are disabled', () => {
|
||||
return testObject.getDisabledExtensions().then(extensions => assert.deepEqual([], extensions));
|
||||
});
|
||||
|
||||
test('test when no extensions are disabled for workspace when there is no workspace', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => {
|
||||
instantiationService.stub(IWorkspaceContextService, 'getWorkbenchState', WorkbenchState.EMPTY);
|
||||
return testObject.getDisabledExtensions().then(extensions => assert.deepEqual([], extensions));
|
||||
});
|
||||
});
|
||||
|
||||
test('test disable an extension globally', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([{ id: 'pub.a' }], extensions));
|
||||
test('test disable an extension globally', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
assert.ok(!testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.Disabled);
|
||||
});
|
||||
|
||||
test('test disable an extension globally should return truthy promise', () => {
|
||||
@@ -109,10 +113,11 @@ suite('ExtensionEnablementService Test', () => {
|
||||
.then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Enabled));
|
||||
});
|
||||
|
||||
test('test disable an extension for workspace', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([{ id: 'pub.a' }], extensions));
|
||||
test('test disable an extension for workspace', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
assert.ok(!testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceDisabled);
|
||||
});
|
||||
|
||||
test('test disable an extension for workspace returns a truthy promise', () => {
|
||||
@@ -183,11 +188,12 @@ suite('ExtensionEnablementService Test', () => {
|
||||
.then(() => assert.equal(testObject.getEnablementState(aLocalExtension('pub.a')), EnablementState.Enabled));
|
||||
});
|
||||
|
||||
test('test disable an extension for workspace and then globally', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([{ id: 'pub.a' }], extensions));
|
||||
test('test disable an extension for workspace and then globally', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
assert.ok(!testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.Disabled);
|
||||
});
|
||||
|
||||
test('test disable an extension for workspace and then globally return a truthy promise', () => {
|
||||
@@ -207,11 +213,12 @@ suite('ExtensionEnablementService Test', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('test disable an extension globally and then for workspace', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([{ id: 'pub.a' }], extensions));
|
||||
test('test disable an extension globally and then for workspace', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
assert.ok(!testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceDisabled);
|
||||
});
|
||||
|
||||
test('test disable an extension globally and then for workspace return a truthy promise', () => {
|
||||
@@ -237,11 +244,12 @@ suite('ExtensionEnablementService Test', () => {
|
||||
.then(() => assert.fail('should throw an error'), error => assert.ok(error));
|
||||
});
|
||||
|
||||
test('test enable an extension globally', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([], extensions));
|
||||
test('test enable an extension globally', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Enabled);
|
||||
assert.ok(testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled);
|
||||
});
|
||||
|
||||
test('test enable an extension globally return truthy promise', () => {
|
||||
@@ -266,11 +274,12 @@ suite('ExtensionEnablementService Test', () => {
|
||||
.then(value => assert.ok(!value[0]));
|
||||
});
|
||||
|
||||
test('test enable an extension for workspace', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([], extensions));
|
||||
test('test enable an extension for workspace', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled);
|
||||
assert.ok(testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceEnabled);
|
||||
});
|
||||
|
||||
test('test enable an extension for workspace return truthy promise', () => {
|
||||
@@ -295,36 +304,39 @@ suite('ExtensionEnablementService Test', () => {
|
||||
.then(value => assert.ok(value));
|
||||
});
|
||||
|
||||
test('test enable an extension for workspace when disabled in workspace and gloablly', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled))
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceEnabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([], extensions));
|
||||
test('test enable an extension for workspace when disabled in workspace and gloablly', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled);
|
||||
assert.ok(testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.WorkspaceEnabled);
|
||||
});
|
||||
|
||||
test('test enable an extension globally when disabled in workspace and gloablly', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled))
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Enabled))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([], extensions));
|
||||
test('test enable an extension globally when disabled in workspace and gloablly', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceEnabled);
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Enabled);
|
||||
assert.ok(testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled);
|
||||
});
|
||||
|
||||
test('test installing an extension re-eanbles it when disabled globally', async () => {
|
||||
const local = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([local], EnablementState.Disabled);
|
||||
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
|
||||
const extensions = await testObject.getDisabledExtensions();
|
||||
assert.deepEqual([], extensions);
|
||||
assert.ok(testObject.isEnabled(local));
|
||||
assert.equal(testObject.getEnablementState(local), EnablementState.Enabled);
|
||||
});
|
||||
|
||||
test('test updating an extension does not re-eanbles it when disabled globally', async () => {
|
||||
const local = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([local], EnablementState.Disabled);
|
||||
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
|
||||
const extensions = await testObject.getDisabledExtensions();
|
||||
assert.deepEqual([{ id: 'pub.a' }], extensions);
|
||||
assert.ok(!testObject.isEnabled(local));
|
||||
assert.equal(testObject.getEnablementState(local), EnablementState.Disabled);
|
||||
});
|
||||
|
||||
test('test installing an extension fires enablement change event when disabled globally', async () => {
|
||||
@@ -353,16 +365,16 @@ suite('ExtensionEnablementService Test', () => {
|
||||
const local = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([local], EnablementState.WorkspaceDisabled);
|
||||
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
|
||||
const extensions = await testObject.getDisabledExtensions();
|
||||
assert.deepEqual([], extensions);
|
||||
assert.ok(testObject.isEnabled(local));
|
||||
assert.equal(testObject.getEnablementState(local), EnablementState.Enabled);
|
||||
});
|
||||
|
||||
test('test updating an extension does not re-eanbles it when workspace disabled', async () => {
|
||||
const local = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([local], EnablementState.WorkspaceDisabled);
|
||||
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
|
||||
const extensions = await testObject.getDisabledExtensions();
|
||||
assert.deepEqual([{ id: 'pub.a' }], extensions);
|
||||
assert.ok(!testObject.isEnabled(local));
|
||||
assert.equal(testObject.getEnablementState(local), EnablementState.WorkspaceDisabled);
|
||||
});
|
||||
|
||||
test('test installing an extension fires enablement change event when workspace disabled', async () => {
|
||||
@@ -395,12 +407,13 @@ suite('ExtensionEnablementService Test', () => {
|
||||
assert.ok(!target.called);
|
||||
});
|
||||
|
||||
test('test remove an extension from disablement list when uninstalled', () => {
|
||||
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.WorkspaceDisabled)
|
||||
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.Disabled))
|
||||
.then(() => didUninstallEvent.fire({ identifier: { id: 'pub.a' } }))
|
||||
.then(() => testObject.getDisabledExtensions())
|
||||
.then(extensions => assert.deepEqual([], extensions));
|
||||
test('test remove an extension from disablement list when uninstalled', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
await testObject.setEnablement([extension], EnablementState.WorkspaceDisabled);
|
||||
await testObject.setEnablement([extension], EnablementState.Disabled);
|
||||
didUninstallEvent.fire({ identifier: { id: 'pub.a' } });
|
||||
assert.ok(testObject.isEnabled(extension));
|
||||
assert.equal(testObject.getEnablementState(extension), EnablementState.Enabled);
|
||||
});
|
||||
|
||||
test('test isEnabled return false extension is disabled globally', () => {
|
||||
@@ -442,22 +455,20 @@ suite('ExtensionEnablementService Test', () => {
|
||||
assert.equal(testObject.canChangeEnablement(extension), true);
|
||||
});
|
||||
|
||||
test('test canChangeEnablement return false for system extensions when extension is disabled in environment', () => {
|
||||
test('test canChangeEnablement return false for system extension when extension is disabled in environment', () => {
|
||||
instantiationService.stub(IEnvironmentService, { disableExtensions: ['pub.a'] } as IEnvironmentService);
|
||||
testObject = new TestExtensionEnablementService(instantiationService);
|
||||
const extension = aLocalExtension('pub.a', undefined, ExtensionType.System);
|
||||
assert.equal(testObject.canChangeEnablement(extension), true);
|
||||
assert.ok(!testObject.canChangeEnablement(extension));
|
||||
});
|
||||
|
||||
test('test getDisabledExtensions include extensions disabled in enviroment', () => {
|
||||
test('test extension is disabled when disabled in enviroment', async () => {
|
||||
const extension = aLocalExtension('pub.a');
|
||||
instantiationService.stub(IEnvironmentService, { disableExtensions: ['pub.a'] } as IEnvironmentService);
|
||||
instantiationService.stub(IExtensionManagementService, { onDidUninstallExtension: didUninstallEvent.event, onDidInstallExtension: didInstallEvent.event, getInstalled: () => Promise.resolve([aLocalExtension('pub.a'), aLocalExtension('pub.b')]) } as IExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementService, { onDidUninstallExtension: didUninstallEvent.event, onDidInstallExtension: didInstallEvent.event, getInstalled: () => Promise.resolve([extension, aLocalExtension('pub.b')]) } as IExtensionManagementService);
|
||||
testObject = new TestExtensionEnablementService(instantiationService);
|
||||
return testObject.getDisabledExtensions()
|
||||
.then(actual => {
|
||||
assert.equal(actual.length, 1);
|
||||
assert.equal(actual[0].id, 'pub.a');
|
||||
});
|
||||
assert.ok(!testObject.isEnabled(extension));
|
||||
assert.deepEqual(testObject.getEnablementState(extension), EnablementState.Disabled);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -13,8 +13,9 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { isWindows } from 'vs/base/common/platform';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import pkg from 'vs/platform/product/node/package';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IRemoteConsoleLog, log, parse } from 'vs/base/common/console';
|
||||
import { findFreePort, randomPort } from 'vs/base/node/ports';
|
||||
@@ -160,7 +161,7 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
||||
// and detach under Linux and Mac create another process group.
|
||||
// We detach because we have noticed that when the renderer exits, its child processes
|
||||
// (i.e. extension host) are taken down in a brutal fashion by the OS
|
||||
detached: !!isWindows,
|
||||
detached: !!platform.isWindows,
|
||||
execArgv: undefined as string[] | undefined,
|
||||
silent: true
|
||||
};
|
||||
@@ -401,11 +402,15 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
||||
const workspace = this._contextService.getWorkspace();
|
||||
const r: IInitData = {
|
||||
commit: product.commit,
|
||||
version: pkg.version,
|
||||
parentPid: process.pid,
|
||||
environment: {
|
||||
isExtensionDevelopmentDebug: this._isExtensionDevDebug,
|
||||
appRoot: this._environmentService.appRoot ? URI.file(this._environmentService.appRoot) : undefined,
|
||||
appSettingsHome: this._environmentService.appSettingsHome ? URI.file(this._environmentService.appSettingsHome) : undefined,
|
||||
appName: product.nameLong,
|
||||
appUriScheme: product.urlProtocol,
|
||||
appLanguage: platform.language,
|
||||
extensionDevelopmentLocationURI: this._environmentService.extensionDevelopmentLocationURI,
|
||||
extensionTestsLocationURI: this._environmentService.extensionTestsLocationURI,
|
||||
globalStorageHome: URI.file(this._environmentService.globalStorageHome),
|
||||
|
||||
@@ -662,70 +662,67 @@ export class ExtensionService extends Disposable implements IExtensionService {
|
||||
return false;
|
||||
}
|
||||
|
||||
private _getRuntimeExtensions(allExtensions: IExtensionDescription[]): Promise<IExtensionDescription[]> {
|
||||
return this._extensionEnablementService.getDisabledExtensions()
|
||||
.then(disabledExtensions => {
|
||||
private async _getRuntimeExtensions(allExtensions: IExtensionDescription[]): Promise<IExtensionDescription[]> {
|
||||
|
||||
const runtimeExtensions: IExtensionDescription[] = [];
|
||||
const extensionsToDisable: IExtensionDescription[] = [];
|
||||
const userMigratedSystemExtensions: IExtensionIdentifier[] = [{ id: BetterMergeId }];
|
||||
const runtimeExtensions: IExtensionDescription[] = [];
|
||||
const extensionsToDisable: IExtensionDescription[] = [];
|
||||
const userMigratedSystemExtensions: IExtensionIdentifier[] = [{ id: BetterMergeId }];
|
||||
|
||||
let enableProposedApiFor: string | string[] = this._environmentService.args['enable-proposed-api'] || [];
|
||||
let enableProposedApiFor: string | string[] = this._environmentService.args['enable-proposed-api'] || [];
|
||||
|
||||
const notFound = (id: string) => nls.localize('notFound', "Extension \`{0}\` cannot use PROPOSED API as it cannot be found", id);
|
||||
const notFound = (id: string) => nls.localize('notFound', "Extension \`{0}\` cannot use PROPOSED API as it cannot be found", id);
|
||||
|
||||
if (enableProposedApiFor.length) {
|
||||
let allProposed = (enableProposedApiFor instanceof Array ? enableProposedApiFor : [enableProposedApiFor]);
|
||||
allProposed.forEach(id => {
|
||||
if (!allExtensions.some(description => ExtensionIdentifier.equals(description.identifier, id))) {
|
||||
console.error(notFound(id));
|
||||
}
|
||||
});
|
||||
// Make enabled proposed API be lowercase for case insensitive comparison
|
||||
if (Array.isArray(enableProposedApiFor)) {
|
||||
enableProposedApiFor = enableProposedApiFor.map(id => id.toLowerCase());
|
||||
} else {
|
||||
enableProposedApiFor = enableProposedApiFor.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
const enableProposedApiForAll = !this._environmentService.isBuilt ||
|
||||
(!!this._environmentService.extensionDevelopmentLocationURI && product.nameLong !== 'Visual Studio Code') ||
|
||||
(enableProposedApiFor.length === 0 && 'enable-proposed-api' in this._environmentService.args);
|
||||
|
||||
|
||||
for (const extension of allExtensions) {
|
||||
|
||||
// Do not disable extensions under development
|
||||
if (!this.isExtensionUnderDevelopment(extension)) {
|
||||
if (disabledExtensions.some(disabled => areSameExtensions(disabled, { id: extension.identifier.value }))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!extension.isBuiltin) {
|
||||
// Check if the extension is changed to system extension
|
||||
const userMigratedSystemExtension = userMigratedSystemExtensions.filter(userMigratedSystemExtension => areSameExtensions(userMigratedSystemExtension, { id: extension.identifier.value }))[0];
|
||||
if (userMigratedSystemExtension) {
|
||||
extensionsToDisable.push(extension);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
runtimeExtensions.push(this._updateEnableProposedApi(extension, enableProposedApiForAll, enableProposedApiFor));
|
||||
}
|
||||
|
||||
this._telemetryService.publicLog('extensionsScanned', {
|
||||
totalCount: runtimeExtensions.length,
|
||||
disabledCount: disabledExtensions.length
|
||||
});
|
||||
|
||||
if (extensionsToDisable.length) {
|
||||
return this._extensionEnablementService.setEnablement(extensionsToDisable.map(e => toExtension(e)), EnablementState.Disabled)
|
||||
.then(() => runtimeExtensions);
|
||||
} else {
|
||||
return runtimeExtensions;
|
||||
if (enableProposedApiFor.length) {
|
||||
let allProposed = (enableProposedApiFor instanceof Array ? enableProposedApiFor : [enableProposedApiFor]);
|
||||
allProposed.forEach(id => {
|
||||
if (!allExtensions.some(description => ExtensionIdentifier.equals(description.identifier, id))) {
|
||||
console.error(notFound(id));
|
||||
}
|
||||
});
|
||||
// Make enabled proposed API be lowercase for case insensitive comparison
|
||||
if (Array.isArray(enableProposedApiFor)) {
|
||||
enableProposedApiFor = enableProposedApiFor.map(id => id.toLowerCase());
|
||||
} else {
|
||||
enableProposedApiFor = enableProposedApiFor.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
const enableProposedApiForAll = !this._environmentService.isBuilt ||
|
||||
(!!this._environmentService.extensionDevelopmentLocationURI && product.nameLong !== 'Visual Studio Code') ||
|
||||
(enableProposedApiFor.length === 0 && 'enable-proposed-api' in this._environmentService.args);
|
||||
|
||||
|
||||
for (const extension of allExtensions) {
|
||||
|
||||
// Do not disable extensions under development
|
||||
if (!this.isExtensionUnderDevelopment(extension)) {
|
||||
if (!this._extensionEnablementService.isEnabled(toExtension(extension))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!extension.isBuiltin) {
|
||||
// Check if the extension is changed to system extension
|
||||
const userMigratedSystemExtension = userMigratedSystemExtensions.filter(userMigratedSystemExtension => areSameExtensions(userMigratedSystemExtension, { id: extension.identifier.value }))[0];
|
||||
if (userMigratedSystemExtension) {
|
||||
extensionsToDisable.push(extension);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
runtimeExtensions.push(this._updateEnableProposedApi(extension, enableProposedApiForAll, enableProposedApiFor));
|
||||
}
|
||||
|
||||
this._telemetryService.publicLog('extensionsScanned', {
|
||||
totalCount: runtimeExtensions.length,
|
||||
disabledCount: allExtensions.length - runtimeExtensions.length
|
||||
});
|
||||
|
||||
if (extensionsToDisable.length) {
|
||||
return this._extensionEnablementService.setEnablement(extensionsToDisable.map(e => toExtension(e)), EnablementState.Disabled)
|
||||
.then(() => runtimeExtensions);
|
||||
} else {
|
||||
return runtimeExtensions;
|
||||
}
|
||||
}
|
||||
|
||||
private _updateEnableProposedApi(extension: IExtensionDescription, enableProposedApiForAll: boolean, enableProposedApiFor: string | string[]): IExtensionDescription {
|
||||
|
||||
@@ -24,6 +24,8 @@ export class FileService2 extends Disposable implements IFileService {
|
||||
private joinOnLegacy: Promise<ILegacyFileService>;
|
||||
private joinOnImplResolve: (service: ILegacyFileService) => void;
|
||||
|
||||
get whenReady(): Promise<void> { return this.joinOnLegacy.then(() => undefined); }
|
||||
|
||||
setLegacyService(legacy: ILegacyFileService): void {
|
||||
this._legacy = this._register(legacy);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { getPathFromAmdModule } from 'vs/base/common/amd';
|
||||
import { copy, rimraf, symlink, RimRafMode, rimrafSync } from 'vs/base/node/pfs';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { existsSync, statSync, readdirSync, readFileSync, writeFileSync, renameSync, unlinkSync, mkdirSync } from 'fs';
|
||||
import { FileOperation, FileOperationEvent, IFileStat, FileOperationResult, FileSystemProviderCapabilities, FileChangeType, IFileChange } from 'vs/platform/files/common/files';
|
||||
import { FileOperation, FileOperationEvent, IFileStat, FileOperationResult, FileSystemProviderCapabilities, FileChangeType, IFileChange, FileChangesEvent } from 'vs/platform/files/common/files';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { isLinux, isWindows } from 'vs/base/common/platform';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
@@ -934,6 +934,10 @@ suite('Disk File Service', () => {
|
||||
});
|
||||
|
||||
test('watch - folder (non recursive) - rename file', done => {
|
||||
if (!isLinux) {
|
||||
return done(); // not happy
|
||||
}
|
||||
|
||||
const watchDir = URI.file(join(testDir, 'watch8'));
|
||||
mkdirSync(watchDir.fsPath);
|
||||
|
||||
@@ -976,19 +980,23 @@ suite('Disk File Service', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function printEvents(event: FileChangesEvent): string {
|
||||
return event.changes.map(change => `Change: type ${toString(change.type)} path ${change.resource.toString()}`).join('\n');
|
||||
}
|
||||
|
||||
const listenerDisposable = service.onFileChanges(event => {
|
||||
watcherDisposable.dispose();
|
||||
listenerDisposable.dispose();
|
||||
|
||||
try {
|
||||
assert.equal(event.changes.length, expected.length);
|
||||
assert.equal(event.changes.length, expected.length, `Expected ${expected.length} events, but got ${event.changes.length}. Details (${printEvents(event)})`);
|
||||
|
||||
if (expected.length === 1) {
|
||||
assert.equal(event.changes[0].type, expected[0][0], `Expected ${toString(expected[0][0])} but got ${toString(event.changes[0].type)}`);
|
||||
assert.equal(event.changes[0].type, expected[0][0], `Expected ${toString(expected[0][0])} but got ${toString(event.changes[0].type)}. Details (${printEvents(event)})`);
|
||||
assert.equal(event.changes[0].resource.fsPath, expected[0][1].fsPath);
|
||||
} else {
|
||||
for (const expect of expected) {
|
||||
assert.equal(hasChange(event.changes, expect[0], expect[1]), true, `Unable to find ${toString(expect[0])} for ${expect[1].fsPath}`);
|
||||
assert.equal(hasChange(event.changes, expect[0], expect[1]), true, `Unable to find ${toString(expect[0])} for ${expect[1].fsPath}. Details (${printEvents(event)})`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -955,17 +955,17 @@ export class HistoryService extends Disposable implements IHistoryService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getLastActiveFile(schemeFilter: string): URI | undefined {
|
||||
getLastActiveFile(filterByScheme: string): URI | undefined {
|
||||
const history = this.getHistory();
|
||||
for (const input of history) {
|
||||
let resource: URI | null;
|
||||
if (input instanceof EditorInput) {
|
||||
resource = toResource(input, { filter: schemeFilter });
|
||||
resource = toResource(input, { filterByScheme });
|
||||
} else {
|
||||
resource = (input as IResourceInput).resource;
|
||||
}
|
||||
|
||||
if (resource && resource.scheme === schemeFilter) {
|
||||
if (resource && resource.scheme === filterByScheme) {
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { EditorInput, toResource } from 'vs/workbench/common/editor';
|
||||
import { EditorInput, toResource, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
@@ -60,27 +60,26 @@ suite('Workbench editor', () => {
|
||||
const untitled = service.createOrGet();
|
||||
|
||||
assert.equal(toResource(untitled)!.toString(), untitled.getResource().toString());
|
||||
assert.equal(toResource(untitled, { supportSideBySide: true })!.toString(), untitled.getResource().toString());
|
||||
assert.equal(toResource(untitled, { filter: Schemas.untitled })!.toString(), untitled.getResource().toString());
|
||||
assert.equal(toResource(untitled, { filter: [Schemas.file, Schemas.untitled] })!.toString(), untitled.getResource().toString());
|
||||
assert.ok(!toResource(untitled, { filter: Schemas.file }));
|
||||
assert.equal(toResource(untitled, { supportSideBySide: SideBySideEditor.MASTER })!.toString(), untitled.getResource().toString());
|
||||
assert.equal(toResource(untitled, { filterByScheme: Schemas.untitled })!.toString(), untitled.getResource().toString());
|
||||
assert.equal(toResource(untitled, { filterByScheme: [Schemas.file, Schemas.untitled] })!.toString(), untitled.getResource().toString());
|
||||
assert.ok(!toResource(untitled, { filterByScheme: Schemas.file }));
|
||||
|
||||
const file = new FileEditorInput(URI.file('/some/path.txt'));
|
||||
|
||||
assert.equal(toResource(file)!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: true })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { filter: Schemas.file })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { filter: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString());
|
||||
assert.ok(!toResource(file, { filter: Schemas.untitled }));
|
||||
assert.equal(toResource(file, { supportSideBySide: SideBySideEditor.MASTER })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { filterByScheme: Schemas.file })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { filterByScheme: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString());
|
||||
assert.ok(!toResource(file, { filterByScheme: Schemas.untitled }));
|
||||
|
||||
const diffEditorInput = new DiffEditorInput('name', 'description', untitled, file);
|
||||
|
||||
assert.ok(!toResource(diffEditorInput));
|
||||
assert.ok(!toResource(diffEditorInput, { filter: Schemas.file }));
|
||||
assert.ok(!toResource(diffEditorInput, { supportSideBySide: false }));
|
||||
assert.ok(!toResource(diffEditorInput, { filterByScheme: Schemas.file }));
|
||||
|
||||
assert.equal(toResource(file, { supportSideBySide: true })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: true, filter: Schemas.file })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: true, filter: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: SideBySideEditor.MASTER })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: SideBySideEditor.MASTER, filterByScheme: Schemas.file })!.toString(), file.getResource().toString());
|
||||
assert.equal(toResource(file, { supportSideBySide: SideBySideEditor.MASTER, filterByScheme: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString());
|
||||
});
|
||||
});
|
||||
@@ -62,8 +62,7 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res
|
||||
import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { AccessibilityService } from 'vs/platform/accessibility/node/accessibilityService';
|
||||
import { IExtensionEnablementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
|
||||
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
|
||||
@@ -123,6 +122,7 @@ import 'vs/workbench/services/textfile/node/textResourcePropertiesService';
|
||||
import 'vs/workbench/services/mode/common/workbenchModeService';
|
||||
import 'vs/workbench/services/commands/common/commandService';
|
||||
import 'vs/workbench/services/themes/browser/workbenchThemeService';
|
||||
import 'vs/workbench/services/extensionManagement/node/extensionEnablementService';
|
||||
import 'vs/workbench/services/extensions/electron-browser/extensionService';
|
||||
import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService';
|
||||
import 'vs/workbench/services/extensions/node/multiExtensionManagement';
|
||||
@@ -144,7 +144,6 @@ registerSingleton(IContextKeyService, ContextKeyService);
|
||||
registerSingleton(IModelService, ModelServiceImpl, true);
|
||||
registerSingleton(ITextResourceConfigurationService, TextResourceConfigurationService);
|
||||
registerSingleton(IAccessibilityService, AccessibilityService, true);
|
||||
registerSingleton(IExtensionEnablementService, ExtensionEnablementService, true);
|
||||
registerSingleton(IContextViewService, ContextViewService, true);
|
||||
registerSingleton(IExtensionGalleryService, ExtensionGalleryService, true);
|
||||
registerSingleton(IRequestService, RequestService, true);
|
||||
|
||||
@@ -62,8 +62,6 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res
|
||||
import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { BrowserAccessibilityService } from 'vs/platform/accessibility/common/accessibilityService';
|
||||
import { IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService';
|
||||
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
|
||||
@@ -103,7 +101,6 @@ import 'vs/platform/dialogs/browser/dialogService';
|
||||
import 'vs/workbench/services/bulkEdit/browser/bulkEditService';
|
||||
// import 'vs/workbench/services/integrity/node/integrityService';
|
||||
import 'vs/workbench/services/keybinding/common/keybindingEditing';
|
||||
import 'vs/workbench/services/hash/common/hashService';
|
||||
// import 'vs/workbench/services/textMate/electron-browser/textMateService';
|
||||
import 'vs/workbench/services/configurationResolver/browser/configurationResolverService';
|
||||
// import 'vs/workbench/services/workspace/electron-browser/workspaceEditingService';
|
||||
@@ -132,6 +129,7 @@ import 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import 'vs/workbench/services/mode/common/workbenchModeService';
|
||||
import 'vs/workbench/services/commands/common/commandService';
|
||||
import 'vs/workbench/services/themes/browser/workbenchThemeService';
|
||||
// import 'vs/workbench/services/extensionManagement/node/extensionEnablementService';
|
||||
// import 'vs/workbench/services/extensions/electron-browser/extensionService';
|
||||
// import 'vs/workbench/services/contextmenu/electron-browser/contextmenuService';
|
||||
// import 'vs/workbench/services/extensionManagement/node/multiExtensionManagement';
|
||||
@@ -154,7 +152,6 @@ registerSingleton(IContextKeyService, ContextKeyService);
|
||||
registerSingleton(IModelService, ModelServiceImpl, true);
|
||||
registerSingleton(ITextResourceConfigurationService, TextResourceConfigurationService);
|
||||
registerSingleton(IAccessibilityService, BrowserAccessibilityService, true);
|
||||
registerSingleton(IExtensionEnablementService, ExtensionEnablementService, true);
|
||||
registerSingleton(IContextViewService, ContextViewService, true);
|
||||
// registerSingleton(IExtensionGalleryService, ExtensionGalleryService, true);
|
||||
// registerSingleton(IRequestService, RequestService, true);
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"devDependencies": {
|
||||
"koa": "^2.5.1",
|
||||
"koa-mount": "^3.0.0",
|
||||
"koa-route": "^3.2.0",
|
||||
"koa-static": "^5.0.0",
|
||||
"mz": "^2.7.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user