mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge branch 'master' into electron-4.0.x
This commit is contained in:
commit
a46d25c9ea
|
@ -5,70 +5,108 @@ Do Not Translate or Localize
|
|||
|
||||
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
|
||||
1. atom/language-clojure version 0.22.6 (https://github.com/atom/language-clojure)
|
||||
2. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script)
|
||||
3. atom/language-java version 0.31.1 (https://github.com/atom/language-java)
|
||||
4. atom/language-objective-c version 0.15.0 (https://github.com/atom/language-objective-c)
|
||||
5. atom/language-sass version 0.61.4 (https://github.com/atom/language-sass)
|
||||
6. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript)
|
||||
7. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml)
|
||||
8. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
|
||||
9. daaain/Handlebars version 1.7.1 (https://github.com/daaain/Handlebars)
|
||||
10. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle)
|
||||
11. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped)
|
||||
12. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml)
|
||||
13. Document Object Model version 4.0.0 (https://www.w3.org/DOM/)
|
||||
14. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage)
|
||||
15. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation)
|
||||
16. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle)
|
||||
17. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift)
|
||||
18. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
|
||||
19. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R)
|
||||
20. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site)
|
||||
21. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
|
||||
22. jeff-hykin/cpp-textmate-grammar version 1.8.8 (https://github.com/jeff-hykin/cpp-textmate-grammar)
|
||||
23. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
|
||||
24. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
|
||||
25. language-docker (https://github.com/moby/moby)
|
||||
26. language-go version 0.44.3 (https://github.com/atom/language-go)
|
||||
27. language-less version 0.34.2 (https://github.com/atom/language-less)
|
||||
28. language-php version 0.44.1 (https://github.com/atom/language-php)
|
||||
29. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust)
|
||||
30. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython)
|
||||
31. marked version 0.6.2 (https://github.com/markedjs/marked)
|
||||
32. mdn-data version 1.1.12 (https://github.com/mdn/data)
|
||||
33. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
34. Microsoft/vscode-JSON.tmLanguage (https://github.com/Microsoft/vscode-JSON.tmLanguage)
|
||||
35. Microsoft/vscode-mssql version 1.4.0 (https://github.com/Microsoft/vscode-mssql)
|
||||
36. mmims/language-batchfile version 0.7.5 (https://github.com/mmims/language-batchfile)
|
||||
37. octicons version 8.3.0 (https://github.com/primer/octicons)
|
||||
38. octref/language-css version 0.42.11 (https://github.com/octref/language-css)
|
||||
39. PowerShell/EditorSyntax (https://github.com/powershell/editorsyntax)
|
||||
40. promise-polyfill version 8.0.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||
41. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
|
||||
42. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
|
||||
43. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
|
||||
44. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
|
||||
45. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
|
||||
46. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
|
||||
47. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
|
||||
48. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
|
||||
49. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
|
||||
50. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
|
||||
51. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
|
||||
52. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
|
||||
53. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
|
||||
54. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
|
||||
55. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
|
||||
56. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
57. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
58. Unicode version 12.0.0 (http://www.unicode.org/)
|
||||
59. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
60. vscode-octicons-font version 1.1.0 (https://github.com/Microsoft/vscode-octicons-font)
|
||||
61. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
62. Web Background Synchronization (https://github.com/WICG/BackgroundSync)
|
||||
1. atom/language-c version 0.58.1 (https://github.com/atom/language-c)
|
||||
2. atom/language-clojure version 0.22.7 (https://github.com/atom/language-clojure)
|
||||
3. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script)
|
||||
4. atom/language-java version 0.31.2 (https://github.com/atom/language-java)
|
||||
5. atom/language-objective-c version 0.15.0 (https://github.com/atom/language-objective-c)
|
||||
6. atom/language-sass version 0.61.4 (https://github.com/atom/language-sass)
|
||||
7. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript)
|
||||
8. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml)
|
||||
9. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
|
||||
10. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars)
|
||||
11. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle)
|
||||
12. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped)
|
||||
13. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml)
|
||||
14. Document Object Model version 4.0.0 (https://www.w3.org/DOM/)
|
||||
15. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage)
|
||||
16. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation)
|
||||
17. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle)
|
||||
18. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift)
|
||||
19. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
|
||||
20. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R)
|
||||
21. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site)
|
||||
22. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
|
||||
23. jeff-hykin/cpp-textmate-grammar version 1.8.15 (https://github.com/jeff-hykin/cpp-textmate-grammar)
|
||||
24. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
|
||||
25. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
|
||||
26. language-docker (https://github.com/moby/moby)
|
||||
27. language-go version 0.44.3 (https://github.com/atom/language-go)
|
||||
28. language-less version 0.34.2 (https://github.com/atom/language-less)
|
||||
29. language-php version 0.44.1 (https://github.com/atom/language-php)
|
||||
30. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust)
|
||||
31. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython)
|
||||
32. marked version 0.6.2 (https://github.com/markedjs/marked)
|
||||
33. mdn-data version 1.1.12 (https://github.com/mdn/data)
|
||||
34. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
35. Microsoft/vscode-JSON.tmLanguage (https://github.com/Microsoft/vscode-JSON.tmLanguage)
|
||||
36. Microsoft/vscode-mssql version 1.4.0 (https://github.com/Microsoft/vscode-mssql)
|
||||
37. mmims/language-batchfile version 0.7.5 (https://github.com/mmims/language-batchfile)
|
||||
38. octicons version 8.3.0 (https://github.com/primer/octicons)
|
||||
39. octref/language-css version 0.42.11 (https://github.com/octref/language-css)
|
||||
40. PowerShell/EditorSyntax (https://github.com/powershell/editorsyntax)
|
||||
41. promise-polyfill version 8.0.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||
42. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
|
||||
43. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
|
||||
44. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
|
||||
45. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
|
||||
46. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
|
||||
47. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
|
||||
48. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
|
||||
49. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
|
||||
50. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
|
||||
51. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
|
||||
52. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
|
||||
53. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
|
||||
54. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
|
||||
55. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
|
||||
56. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
|
||||
57. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
58. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
59. Unicode version 12.0.0 (http://www.unicode.org/)
|
||||
60. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
61. vscode-octicons-font version 1.2.0 (https://github.com/Microsoft/vscode-octicons-font)
|
||||
62. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
63. Web Background Synchronization (https://github.com/WICG/BackgroundSync)
|
||||
|
||||
|
||||
%% atom/language-c NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
This package was derived from a TextMate bundle located at
|
||||
https://github.com/textmate/c.tmbundle and distributed under the following
|
||||
license, located in `README.mdown`:
|
||||
|
||||
Permission to copy, use, modify, sell and distribute this
|
||||
software is granted. This software is provided "as is" without
|
||||
express or implied warranty, and with no claim as to its
|
||||
suitability for any purpose.
|
||||
=========================================
|
||||
END OF atom/language-c NOTICES AND INFORMATION
|
||||
|
||||
%% atom/language-clojure NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) 2014 GitHub Inc.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[
|
||||
{
|
||||
"name": "ms-vscode.node-debug",
|
||||
"version": "1.33.3",
|
||||
"version": "1.35.2",
|
||||
"repo": "https://github.com/Microsoft/vscode-node-debug",
|
||||
"metadata": {
|
||||
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
|
||||
|
|
|
@ -123,6 +123,11 @@
|
|||
"Below"
|
||||
],
|
||||
"description": "%config.diffViewPosition%",
|
||||
"enumDescriptions": [
|
||||
"%config.diffViewPosition.current%",
|
||||
"%config.diffViewPosition.beside%",
|
||||
"%config.diffViewPosition.below%"
|
||||
],
|
||||
"default": "Current"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,5 +16,8 @@
|
|||
"config.autoNavigateNextConflictEnabled": "Whether to automatically navigate to the next merge conflict after resolving a merge conflict.",
|
||||
"config.codeLensEnabled": "Create a Code Lens for merge conflict blocks within editor.",
|
||||
"config.decoratorsEnabled": "Create decorators for merge conflict blocks within editor.",
|
||||
"config.diffViewPosition": "Controls where the diff view should be opened when comparing changes in merge conflicts."
|
||||
"config.diffViewPosition": "Controls where the diff view should be opened when comparing changes in merge conflicts.",
|
||||
"config.diffViewPosition.current": "Open the diff view in the current editor group.",
|
||||
"config.diffViewPosition.beside": "Open the diff view next to the current editor group.",
|
||||
"config.diffViewPosition.below": "Open the diff view below the current editor group."
|
||||
}
|
|
@ -12,6 +12,19 @@
|
|||
"license": "MIT",
|
||||
"description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the Atom package https://github.com/atom/language-objective-c which was originally converted from the TextMate bundle https://github.com/textmate/objective-c.tmbundle.",
|
||||
"version": "0.15.0"
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"name": "atom/language-c",
|
||||
"repositoryUrl": "https://github.com/atom/language-c",
|
||||
"commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.58.1",
|
||||
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
|
447
extensions/objective-c/syntaxes/cpp.tmLanguage.json
Normal file
447
extensions/objective-c/syntaxes/cpp.tmLanguage.json
Normal file
|
@ -0,0 +1,447 @@
|
|||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson",
|
||||
"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-c/commit/3a269f88b12e512fb9495dc006a1dabf325d3d7f",
|
||||
"name": "C++",
|
||||
"scopeName": "source.cppold",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#special_block"
|
||||
},
|
||||
{
|
||||
"include": "#strings"
|
||||
},
|
||||
{
|
||||
"match": "\\b(friend|explicit|virtual|override|final|noexcept)\\b",
|
||||
"name": "storage.modifier.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(private:|protected:|public:)",
|
||||
"name": "storage.modifier.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(catch|operator|try|throw|using)\\b",
|
||||
"name": "keyword.control.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\bdelete\\b(\\s*\\[\\])?|\\bnew\\b(?!])",
|
||||
"name": "keyword.control.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(f|m)[A-Z]\\w*\\b",
|
||||
"name": "variable.other.readwrite.member.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\bthis\\b",
|
||||
"name": "variable.language.this.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\bnullptr\\b",
|
||||
"name": "constant.language.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\btemplate\\b\\s*",
|
||||
"name": "storage.type.template.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\\b\\s*",
|
||||
"name": "keyword.operator.cast.cpp"
|
||||
},
|
||||
{
|
||||
"match": "::",
|
||||
"name": "punctuation.separator.namespace.access.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\b",
|
||||
"name": "keyword.operator.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(class|decltype|wchar_t|char16_t|char32_t)\\b",
|
||||
"name": "storage.type.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\b(constexpr|export|mutable|typename|thread_local)\\b",
|
||||
"name": "storage.modifier.cpp"
|
||||
},
|
||||
{
|
||||
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.parameters.begin.c"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.parameters.end.c"
|
||||
}
|
||||
},
|
||||
"name": "meta.function.destructor.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.parameters.begin.c"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.parameters.end.c"
|
||||
}
|
||||
},
|
||||
"name": "meta.function.destructor.prototype.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "source.c"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"angle_brackets": {
|
||||
"begin": "<",
|
||||
"end": ">",
|
||||
"name": "meta.angle-brackets.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#angle_brackets"
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
"block": {
|
||||
"begin": "\\{",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.begin.bracket.curly.c"
|
||||
}
|
||||
},
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.end.bracket.curly.c"
|
||||
}
|
||||
},
|
||||
"name": "meta.block.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "support.function.any-method.c"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.parameters.c"
|
||||
}
|
||||
},
|
||||
"match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket",
|
||||
"name": "meta.function-call.c"
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
"constructor": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.definition.parameters.begin.c"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.parameters.end.c"
|
||||
}
|
||||
},
|
||||
"name": "meta.function.constructor.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.parameters.c"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\{)",
|
||||
"name": "meta.function.constructor.initializer-list.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"special_block": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\b(using)\\b\\s*(namespace)\\b\\s*((?:[_A-Za-z][_A-Za-z0-9]*\\b(::)?)*)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "storage.type.cpp"
|
||||
},
|
||||
"3": {
|
||||
"name": "entity.name.type.cpp"
|
||||
}
|
||||
},
|
||||
"end": "(;)",
|
||||
"name": "meta.using-namespace-declaration.cpp"
|
||||
},
|
||||
{
|
||||
"begin": "\\b(namespace)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.type.cpp"
|
||||
}
|
||||
},
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "keyword.control.namespace.$2"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|(?=(;|,|\\(|\\)|>|\\[|\\]|=))",
|
||||
"name": "meta.namespace-block.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\{",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.scope.cpp"
|
||||
}
|
||||
},
|
||||
"end": "\\}",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.scope.cpp"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#special_block"
|
||||
},
|
||||
{
|
||||
"include": "#constructor"
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\b(class|struct)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.type.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "entity.name.type.cpp"
|
||||
},
|
||||
"4": {
|
||||
"name": "storage.type.modifier.cpp"
|
||||
},
|
||||
"5": {
|
||||
"name": "entity.name.type.inherited.cpp"
|
||||
},
|
||||
"6": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(public|protected|private)",
|
||||
"name": "storage.type.modifier.cpp"
|
||||
},
|
||||
{
|
||||
"match": "[_A-Za-z][_A-Za-z0-9]*",
|
||||
"name": "entity.name.type.inherited.cpp"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|(?=(;|\\(|\\)|>|\\[|\\]|=))",
|
||||
"name": "meta.class-struct-block.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#angle_brackets"
|
||||
},
|
||||
{
|
||||
"begin": "\\{",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.begin.bracket.curly.cpp"
|
||||
}
|
||||
},
|
||||
"end": "(\\})(\\s*\\n)?",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.block.end.bracket.curly.cpp"
|
||||
},
|
||||
"2": {
|
||||
"name": "invalid.illegal.you-forgot-semicolon.cpp"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#special_block"
|
||||
},
|
||||
{
|
||||
"include": "#constructor"
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\b(extern)(?=\\s*\")",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.cpp"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)",
|
||||
"name": "meta.extern-block.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\{",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.begin.bracket.curly.c"
|
||||
}
|
||||
},
|
||||
"end": "\\}|(?=\\s*#\\s*endif\\b)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.section.block.end.bracket.curly.c"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#special_block"
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$base"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"strings": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(u|u8|U|L)?\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.cpp"
|
||||
},
|
||||
"1": {
|
||||
"name": "meta.encoding.cpp"
|
||||
}
|
||||
},
|
||||
"end": "\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.cpp"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.cpp",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\u\\h{4}|\\\\U\\h{8}",
|
||||
"name": "constant.character.escape.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\\\['\"?\\\\abfnrtv]",
|
||||
"name": "constant.character.escape.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\\\[0-7]{1,3}",
|
||||
"name": "constant.character.escape.cpp"
|
||||
},
|
||||
{
|
||||
"match": "\\\\x\\h+",
|
||||
"name": "constant.character.escape.cpp"
|
||||
},
|
||||
{
|
||||
"include": "source.c#string_placeholder"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.begin.cpp"
|
||||
},
|
||||
"1": {
|
||||
"name": "meta.encoding.cpp"
|
||||
},
|
||||
"3": {
|
||||
"name": "invalid.illegal.delimiter-too-long.cpp"
|
||||
}
|
||||
},
|
||||
"end": "\\)\\2(\\3)\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.string.end.cpp"
|
||||
},
|
||||
"1": {
|
||||
"name": "invalid.illegal.delimiter-too-long.cpp"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.raw.cpp"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
"scopeName": "source.objcpp",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "source.cpp"
|
||||
"include": "source.cppold"
|
||||
},
|
||||
{
|
||||
"include": "source.objc"
|
||||
|
|
52
extensions/objective-c/test/colorize-fixtures/test.mm
Normal file
52
extensions/objective-c/test/colorize-fixtures/test.mm
Normal file
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import "UseQuotes.h"
|
||||
#import <Use/GTLT.h>
|
||||
|
||||
/*
|
||||
Multi
|
||||
Line
|
||||
Comments
|
||||
*/
|
||||
@implementation Test
|
||||
|
||||
- (void) applicationWillFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
}
|
||||
|
||||
- (IBAction)onSelectInput:(id)sender
|
||||
{
|
||||
NSString* defaultDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];
|
||||
|
||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||
[panel setAllowedFileTypes:[[NSArray alloc] initWithObjects:@"ipa", @"xcarchive", @"app", nil]];
|
||||
|
||||
[panel beginWithCompletionHandler:^(NSInteger result)
|
||||
{
|
||||
if (result == NSFileHandlingPanelOKButton)
|
||||
[self.inputTextField setStringValue:[panel.URL path]];
|
||||
}];
|
||||
return YES;
|
||||
|
||||
int hex = 0xFEF1F0F;
|
||||
float ing = 3.14;
|
||||
ing = 3.14e0;
|
||||
ing = 31.4e-2;
|
||||
}
|
||||
|
||||
-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager
|
||||
{
|
||||
// add a tap gesture recognizer
|
||||
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
|
||||
NSMutableArray *gestureRecognizers = [NSMutableArray array];
|
||||
[gestureRecognizers addObject:tapGesture];
|
||||
[gestureRecognizers addObjectsFromArray:scnView.gestureRecognizers];
|
||||
scnView.gestureRecognizers = gestureRecognizers;
|
||||
|
||||
return tapGesture;
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
3093
extensions/objective-c/test/colorize-results/test_mm.json
Normal file
3093
extensions/objective-c/test/colorize-results/test_mm.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.1",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "3.5.0-dev.20190522"
|
||||
"typescript": "3.5.0-dev.20190525"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# yarn lockfile v1
|
||||
|
||||
|
||||
typescript@3.5.0-dev.20190522:
|
||||
version "3.5.0-dev.20190522"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.0-dev.20190522.tgz#ade4702c6e599a7e8905d7acaaf416f7e32ba0fc"
|
||||
integrity sha512-V+QsNMtXl8lGwov4O04D+E6vtiL0TWEpz6iDxI2tAZizEn7y8Hh9SXzz3JRWepr7dfdqqxEv9CT3J18zpaZKJQ==
|
||||
typescript@3.5.0-dev.20190525:
|
||||
version "3.5.0-dev.20190525"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.0-dev.20190525.tgz#1f3cd0e35be886b2a837d7efeebdf2fff727ee44"
|
||||
integrity sha512-+EhVvwjYE3bLN3yc5kZHylvyqRB86oqWpO2XrYImi89ErqddhNx28ms50Gt8r3dzK4LUpEUWR9p/bL1I4L8sfw==
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.35.0",
|
||||
"distro": "c4d2c700e910c97e324f3feee5e7da0a8fda3b00",
|
||||
"distro": "22c61a9bf68b1aca53f01d3de0a195c5ea9ca2c4",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
@ -47,13 +47,13 @@
|
|||
"sudo-prompt": "8.2.0",
|
||||
"v8-inspect-profiler": "^0.0.20",
|
||||
"vscode-chokidar": "1.6.5",
|
||||
"vscode-debugprotocol": "1.34.0",
|
||||
"vscode-debugprotocol": "1.35.0",
|
||||
"vscode-nsfw": "1.1.2",
|
||||
"vscode-proxy-agent": "0.4.0",
|
||||
"vscode-ripgrep": "^1.2.5",
|
||||
"vscode-sqlite3": "4.0.7",
|
||||
"vscode-textmate": "^4.1.1",
|
||||
"vscode-xterm": "3.14.0-beta5",
|
||||
"vscode-xterm": "3.14.0-beta6",
|
||||
"yauzl": "^2.9.2",
|
||||
"yazl": "^2.4.3"
|
||||
},
|
||||
|
@ -155,4 +155,4 @@
|
|||
"windows-mutex": "0.2.1",
|
||||
"windows-process-tree": "0.2.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,11 +135,11 @@ export class BreadcrumbsWidget {
|
|||
|
||||
private _updateDimensions(dim: dom.Dimension): IDisposable {
|
||||
const disposables = new DisposableStore();
|
||||
disposables.push(dom.modify(() => {
|
||||
disposables.add(dom.modify(() => {
|
||||
this._dimension = dim;
|
||||
this._domNode.style.width = `${dim.width}px`;
|
||||
this._domNode.style.height = `${dim.height}px`;
|
||||
disposables.push(this._updateScrollbar());
|
||||
disposables.add(this._updateScrollbar());
|
||||
}));
|
||||
return disposables;
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ export class CheckboxActionViewItem extends BaseActionViewItem {
|
|||
isChecked: this._action.checked,
|
||||
title: this._action.label
|
||||
});
|
||||
this.disposables.push(this.checkbox);
|
||||
this.disposables.push(this.checkbox.onChange(() => this._action.checked = this.checkbox.checked, this));
|
||||
this.disposables.add(this.checkbox);
|
||||
this.disposables.add(this.checkbox.onChange(() => this._action.checked = this.checkbox.checked, this));
|
||||
this.element.appendChild(this.checkbox.domNode);
|
||||
}
|
||||
|
||||
|
|
|
@ -131,13 +131,13 @@ export class ContextView extends Disposable {
|
|||
const toDisposeOnSetContainer = new DisposableStore();
|
||||
|
||||
ContextView.BUBBLE_UP_EVENTS.forEach(event => {
|
||||
toDisposeOnSetContainer.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
toDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
this.onDOMEvent(e, false);
|
||||
}));
|
||||
});
|
||||
|
||||
ContextView.BUBBLE_DOWN_EVENTS.forEach(event => {
|
||||
toDisposeOnSetContainer.push(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
toDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, (e: Event) => {
|
||||
this.onDOMEvent(e, true);
|
||||
}, true));
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes';
|
|||
import { addClass, EventType, EventHelper, EventLike, removeTabIndexAndUpdateFocus, isAncestor, hasClass, addDisposableListener, removeClass, append, $, addClasses, removeClasses } from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';
|
||||
|
@ -71,7 +71,7 @@ interface ISubMenuData {
|
|||
|
||||
export class Menu extends ActionBar {
|
||||
private mnemonics: Map<string, Array<BaseMenuActionViewItem>>;
|
||||
private menuDisposables: IDisposable[];
|
||||
private readonly menuDisposables: DisposableStore;
|
||||
private scrollableElement: DomScrollableElement;
|
||||
private menuElement: HTMLElement;
|
||||
private scrollTopHold: number | undefined;
|
||||
|
@ -79,7 +79,6 @@ export class Menu extends ActionBar {
|
|||
private readonly _onScroll: Emitter<void>;
|
||||
|
||||
constructor(container: HTMLElement, actions: IAction[], options: IMenuOptions = {}) {
|
||||
|
||||
addClass(container, 'monaco-menu-container');
|
||||
container.setAttribute('role', 'presentation');
|
||||
const menuElement = document.createElement('div');
|
||||
|
@ -103,7 +102,7 @@ export class Menu extends ActionBar {
|
|||
|
||||
this.actionsList.tabIndex = 0;
|
||||
|
||||
this.menuDisposables = [];
|
||||
this.menuDisposables = this._register(new DisposableStore());
|
||||
|
||||
addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
|
@ -115,7 +114,7 @@ export class Menu extends ActionBar {
|
|||
});
|
||||
|
||||
if (options.enableMnemonics) {
|
||||
this.menuDisposables.push(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => {
|
||||
this.menuDisposables.add(addDisposableListener(menuElement, EventType.KEY_DOWN, (e) => {
|
||||
const key = e.key.toLocaleLowerCase();
|
||||
if (this.mnemonics.has(key)) {
|
||||
EventHelper.stop(e, true);
|
||||
|
@ -217,9 +216,9 @@ export class Menu extends ActionBar {
|
|||
|
||||
menuElement.style.maxHeight = `${Math.max(10, window.innerHeight - container.getBoundingClientRect().top - 30)}px`;
|
||||
|
||||
this.scrollableElement.onScroll(() => {
|
||||
this.menuDisposables.add(this.scrollableElement.onScroll(() => {
|
||||
this._onScroll.fire();
|
||||
}, this, this.menuDisposables);
|
||||
}, this));
|
||||
|
||||
this._register(addDisposableListener(this.menuElement, EventType.SCROLL, (e: ScrollEvent) => {
|
||||
if (this.scrollTopHold !== undefined) {
|
||||
|
@ -575,7 +574,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
private mysubmenu: Menu | null;
|
||||
private submenuContainer: HTMLElement | undefined;
|
||||
private submenuIndicator: HTMLElement;
|
||||
private submenuDisposables: IDisposable[] = [];
|
||||
private readonly submenuDisposables = this._register(new DisposableStore());
|
||||
private mouseOver: boolean;
|
||||
private showScheduler: RunOnceScheduler;
|
||||
private hideScheduler: RunOnceScheduler;
|
||||
|
@ -675,7 +674,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
this.parentData.submenu = undefined;
|
||||
|
||||
if (this.submenuContainer) {
|
||||
this.submenuDisposables = dispose(this.submenuDisposables);
|
||||
this.submenuDisposables.clear();
|
||||
this.submenuContainer = undefined;
|
||||
}
|
||||
}
|
||||
|
@ -708,7 +707,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
this.submenuContainer.style.top = `${this.element.offsetTop - this.parentData.parent.scrollOffset - paddingTop}px`;
|
||||
}
|
||||
|
||||
this.submenuDisposables.push(addDisposableListener(this.submenuContainer, EventType.KEY_UP, e => {
|
||||
this.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_UP, e => {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
if (event.equals(KeyCode.LeftArrow)) {
|
||||
EventHelper.stop(e, true);
|
||||
|
@ -720,12 +719,12 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
this.parentData.submenu = undefined;
|
||||
}
|
||||
|
||||
this.submenuDisposables = dispose(this.submenuDisposables);
|
||||
this.submenuDisposables.clear();
|
||||
this.submenuContainer = undefined;
|
||||
}
|
||||
}));
|
||||
|
||||
this.submenuDisposables.push(addDisposableListener(this.submenuContainer, EventType.KEY_DOWN, e => {
|
||||
this.submenuDisposables.add(addDisposableListener(this.submenuContainer, EventType.KEY_DOWN, e => {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
if (event.equals(KeyCode.LeftArrow)) {
|
||||
EventHelper.stop(e, true);
|
||||
|
@ -733,7 +732,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
}));
|
||||
|
||||
|
||||
this.submenuDisposables.push(this.parentData.submenu.onDidCancel(() => {
|
||||
this.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => {
|
||||
this.parentData.parent.focus();
|
||||
|
||||
if (this.parentData.submenu) {
|
||||
|
@ -741,7 +740,7 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
this.parentData.submenu = undefined;
|
||||
}
|
||||
|
||||
this.submenuDisposables = dispose(this.submenuDisposables);
|
||||
this.submenuDisposables.clear();
|
||||
this.submenuContainer = undefined;
|
||||
}));
|
||||
|
||||
|
@ -781,7 +780,6 @@ class SubmenuMenuActionViewItem extends BaseMenuActionViewItem {
|
|||
}
|
||||
|
||||
if (this.submenuContainer) {
|
||||
this.submenuDisposables = dispose(this.submenuDisposables);
|
||||
this.submenuContainer = undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -909,7 +909,7 @@ class ModifierKeyEmitter extends Emitter<IModifierKeyStatus> {
|
|||
ctrlKey: false
|
||||
};
|
||||
|
||||
this._subscriptions.push(domEvent(document.body, 'keydown', true)(e => {
|
||||
this._subscriptions.add(domEvent(document.body, 'keydown', true)(e => {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
|
||||
if (e.altKey && !this._keyStatus.altKey) {
|
||||
|
@ -933,7 +933,7 @@ class ModifierKeyEmitter extends Emitter<IModifierKeyStatus> {
|
|||
}
|
||||
}));
|
||||
|
||||
this._subscriptions.push(domEvent(document.body, 'keyup', true)(e => {
|
||||
this._subscriptions.add(domEvent(document.body, 'keyup', true)(e => {
|
||||
if (!e.altKey && this._keyStatus.altKey) {
|
||||
this._keyStatus.lastKeyReleased = 'alt';
|
||||
} else if (!e.ctrlKey && this._keyStatus.ctrlKey) {
|
||||
|
@ -957,21 +957,21 @@ class ModifierKeyEmitter extends Emitter<IModifierKeyStatus> {
|
|||
}
|
||||
}));
|
||||
|
||||
this._subscriptions.push(domEvent(document.body, 'mousedown', true)(e => {
|
||||
this._subscriptions.add(domEvent(document.body, 'mousedown', true)(e => {
|
||||
this._keyStatus.lastKeyPressed = undefined;
|
||||
}));
|
||||
|
||||
this._subscriptions.push(domEvent(document.body, 'mouseup', true)(e => {
|
||||
this._subscriptions.add(domEvent(document.body, 'mouseup', true)(e => {
|
||||
this._keyStatus.lastKeyPressed = undefined;
|
||||
}));
|
||||
|
||||
this._subscriptions.push(domEvent(document.body, 'mousemove', true)(e => {
|
||||
this._subscriptions.add(domEvent(document.body, 'mousemove', true)(e => {
|
||||
if (e.buttons) {
|
||||
this._keyStatus.lastKeyPressed = undefined;
|
||||
}
|
||||
}));
|
||||
|
||||
this._subscriptions.push(domEvent(window, 'blur')(e => {
|
||||
this._subscriptions.add(domEvent(window, 'blur')(e => {
|
||||
this._keyStatus.lastKeyPressed = undefined;
|
||||
this._keyStatus.lastKeyReleased = undefined;
|
||||
this._keyStatus.altKey = false;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./sash';
|
||||
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { isIPad } from 'vs/base/browser/browser';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
@ -95,14 +95,14 @@ export class Sash extends Disposable {
|
|||
|
||||
linkedSash: Sash | undefined = undefined;
|
||||
|
||||
private orthogonalStartSashDisposables: IDisposable[] = [];
|
||||
private readonly orthogonalStartSashDisposables = this._register(new DisposableStore());
|
||||
private _orthogonalStartSash: Sash | undefined;
|
||||
get orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }
|
||||
set orthogonalStartSash(sash: Sash | undefined) {
|
||||
this.orthogonalStartSashDisposables = dispose(this.orthogonalStartSashDisposables);
|
||||
this.orthogonalStartSashDisposables.clear();
|
||||
|
||||
if (sash) {
|
||||
sash.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange, this, this.orthogonalStartSashDisposables);
|
||||
this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange, this));
|
||||
this.onOrthogonalStartSashEnablementChange(sash.state);
|
||||
} else {
|
||||
this.onOrthogonalStartSashEnablementChange(SashState.Disabled);
|
||||
|
@ -111,14 +111,14 @@ export class Sash extends Disposable {
|
|||
this._orthogonalStartSash = sash;
|
||||
}
|
||||
|
||||
private orthogonalEndSashDisposables: IDisposable[] = [];
|
||||
private readonly orthogonalEndSashDisposables = this._register(new DisposableStore());
|
||||
private _orthogonalEndSash: Sash | undefined;
|
||||
get orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }
|
||||
set orthogonalEndSash(sash: Sash | undefined) {
|
||||
this.orthogonalEndSashDisposables = dispose(this.orthogonalEndSashDisposables);
|
||||
this.orthogonalEndSashDisposables.clear();
|
||||
|
||||
if (sash) {
|
||||
sash.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange, this, this.orthogonalEndSashDisposables);
|
||||
this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange, this));
|
||||
this.onOrthogonalEndSashEnablementChange(sash.state);
|
||||
} else {
|
||||
this.onOrthogonalEndSashEnablementChange(SashState.Disabled);
|
||||
|
@ -384,9 +384,6 @@ export class Sash extends Disposable {
|
|||
dispose(): void {
|
||||
super.dispose();
|
||||
|
||||
this.orthogonalStartSashDisposables = dispose(this.orthogonalStartSashDisposables);
|
||||
this.orthogonalEndSashDisposables = dispose(this.orthogonalEndSashDisposables);
|
||||
|
||||
if (this.el && this.el.parentElement) {
|
||||
this.el.parentElement.removeChild(this.el);
|
||||
}
|
||||
|
|
|
@ -108,6 +108,12 @@ export abstract class AbstractScrollbar extends Widget {
|
|||
this._sliderMouseDown(e, () => { /*nothing to do*/ });
|
||||
}
|
||||
});
|
||||
|
||||
this.onclick(this.slider.domNode, e => {
|
||||
if (e.leftButton) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------- Update state
|
||||
|
|
|
@ -191,6 +191,9 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
|||
index: e.target.selectedIndex,
|
||||
selected: e.target.value
|
||||
});
|
||||
if (!!this.options[this.selected] && !!this.options[this.selected].text) {
|
||||
this.selectElement.title = this.options[this.selected].text;
|
||||
}
|
||||
}));
|
||||
|
||||
// Have to implement both keyboard and mouse controllers to handle disabled options
|
||||
|
@ -282,6 +285,9 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
|||
}
|
||||
|
||||
this.selectElement.selectedIndex = this.selected;
|
||||
if (!!this.options[this.selected] && !!this.options[this.selected].text) {
|
||||
this.selectElement.title = this.options[this.selected].text;
|
||||
}
|
||||
}
|
||||
|
||||
public setAriaLabel(label: string): void {
|
||||
|
@ -395,7 +401,7 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
|||
let listBackground = this.styles.selectListBackground ? this.styles.selectListBackground.toString() : background;
|
||||
this.selectDropDownListContainer.style.backgroundColor = listBackground;
|
||||
this.selectionDetailsPane.style.backgroundColor = listBackground;
|
||||
const optionsBorder = this.styles.focusBorder ? this.styles.focusBorder.toString() : null;
|
||||
const optionsBorder = this.styles.focusBorder ? this.styles.focusBorder.toString() : '';
|
||||
this.selectDropDownContainer.style.outlineColor = optionsBorder;
|
||||
this.selectDropDownContainer.style.outlineOffset = '-1px';
|
||||
}
|
||||
|
@ -798,7 +804,11 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
|||
this._onDidSelect.fire({
|
||||
index: this.selectElement.selectedIndex,
|
||||
selected: this.options[this.selected].text
|
||||
|
||||
});
|
||||
if (!!this.options[this.selected] && !!this.options[this.selected].text) {
|
||||
this.selectElement.title = this.options[this.selected].text;
|
||||
}
|
||||
}
|
||||
|
||||
this.hideSelectDropDown(true);
|
||||
|
@ -891,6 +901,9 @@ export class SelectBoxList implements ISelectBoxDelegate, IListVirtualDelegate<I
|
|||
index: this.selectElement.selectedIndex,
|
||||
selected: this.options[this.selected].text
|
||||
});
|
||||
if (!!this.options[this.selected] && !!this.options[this.selected].text) {
|
||||
this.selectElement.title = this.options[this.selected].text;
|
||||
}
|
||||
}
|
||||
|
||||
this.hideSelectDropDown(true);
|
||||
|
|
|
@ -401,9 +401,9 @@ export class PanelView extends Disposable {
|
|||
|
||||
// https://github.com/Microsoft/vscode/issues/59950
|
||||
let shouldAnimate = false;
|
||||
disposables.push(scheduleAtNextAnimationFrame(() => shouldAnimate = true));
|
||||
disposables.add(scheduleAtNextAnimationFrame(() => shouldAnimate = true));
|
||||
|
||||
disposables.push(Event.filter(panel.onDidChange, () => shouldAnimate)
|
||||
disposables.add(Event.filter(panel.onDidChange, () => shouldAnimate)
|
||||
(this.setupAnimation, this));
|
||||
|
||||
const panelItem = { panel, disposable: disposables };
|
||||
|
@ -413,8 +413,8 @@ export class PanelView extends Disposable {
|
|||
|
||||
if (this.dnd) {
|
||||
const draggable = new PanelDraggable(panel, this.dnd, this.dndContext);
|
||||
disposables.push(draggable);
|
||||
disposables.push(draggable.onDidDrop(this._onDidDrop.fire, this._onDidDrop));
|
||||
disposables.add(draggable);
|
||||
disposables.add(draggable.onDidDrop(this._onDidDrop.fire, this._onDidDrop));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -458,14 +458,14 @@ export function parse(arg1: string | IExpression | IRelativePattern, options: IG
|
|||
if (parsedPattern === NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
const resultPattern = function (path: string, basename: string) {
|
||||
const resultPattern: ParsedPattern & { allBasenames?: string[]; allPaths?: string[]; } = function (path: string, basename: string) {
|
||||
return !!parsedPattern(path, basename);
|
||||
};
|
||||
if (parsedPattern.allBasenames) {
|
||||
(<ParsedStringPattern><any>resultPattern).allBasenames = parsedPattern.allBasenames;
|
||||
resultPattern.allBasenames = parsedPattern.allBasenames;
|
||||
}
|
||||
if (parsedPattern.allPaths) {
|
||||
(<ParsedStringPattern><any>resultPattern).allPaths = parsedPattern.allPaths;
|
||||
resultPattern.allPaths = parsedPattern.allPaths;
|
||||
}
|
||||
return resultPattern;
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@ export function toDisposable(fn: () => void): IDisposable {
|
|||
}
|
||||
|
||||
export class DisposableStore implements IDisposable {
|
||||
private _toDispose: IDisposable[] = [];
|
||||
private _toDispose = new Set<IDisposable>();
|
||||
private _isDisposed = false;
|
||||
|
||||
/**
|
||||
* Dispose of all registered disposables and mark this object as disposed.
|
||||
*
|
||||
* Any future disposables added to this object will be disposed of on `push`.
|
||||
* Any future disposables added to this object will be disposed of on `add`.
|
||||
*/
|
||||
public dispose(): void {
|
||||
this._isDisposed = true;
|
||||
|
@ -60,15 +60,16 @@ export class DisposableStore implements IDisposable {
|
|||
* Dispose of all registered disposables but do not mark this object as disposed.
|
||||
*/
|
||||
public clear(): void {
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
this._toDispose.forEach(item => item.dispose());
|
||||
this._toDispose.clear();
|
||||
}
|
||||
|
||||
public push<T extends IDisposable>(t: T): T {
|
||||
public add<T extends IDisposable>(t: T): T {
|
||||
if (this._isDisposed) {
|
||||
console.warn('Registering disposable on object that has already been disposed.');
|
||||
t.dispose();
|
||||
} else {
|
||||
this._toDispose.push(t);
|
||||
this._toDispose.add(t);
|
||||
}
|
||||
|
||||
return t;
|
||||
|
@ -86,7 +87,7 @@ export abstract class Disposable implements IDisposable {
|
|||
}
|
||||
|
||||
protected _register<T extends IDisposable>(t: T): T {
|
||||
return this._store.push(t);
|
||||
return this._store.add(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -384,8 +384,8 @@ export class URI implements UriComponents {
|
|||
return data;
|
||||
} else {
|
||||
const result = new _URI(data);
|
||||
result._fsPath = (<UriState>data).fsPath;
|
||||
result._formatted = (<UriState>data).external;
|
||||
result._fsPath = (<UriState>data)._sep === _pathSepMarker ? (<UriState>data).fsPath : null;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -401,10 +401,12 @@ export interface UriComponents {
|
|||
|
||||
interface UriState extends UriComponents {
|
||||
$mid: number;
|
||||
fsPath: string;
|
||||
external: string;
|
||||
fsPath: string;
|
||||
_sep: 1 | undefined;
|
||||
}
|
||||
|
||||
const _pathSepMarker = isWindows ? 1 : undefined;
|
||||
|
||||
// tslint:disable-next-line:class-name
|
||||
class _URI extends URI {
|
||||
|
@ -438,6 +440,7 @@ class _URI extends URI {
|
|||
// cached state
|
||||
if (this._fsPath) {
|
||||
res.fsPath = this._fsPath;
|
||||
res._sep = _pathSepMarker;
|
||||
}
|
||||
if (this._formatted) {
|
||||
res.external = this._formatted;
|
||||
|
|
|
@ -52,7 +52,7 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
|
|||
|
||||
constructor(private _path: string, private options: IConfigOptions<T> = { defaultConfig: Object.create(null), onError: error => console.error(error) }) {
|
||||
this._onDidUpdateConfiguration = new Emitter<IConfigurationChangeEvent<T>>();
|
||||
this.disposables.push(this._onDidUpdateConfiguration);
|
||||
this.disposables.add(this._onDidUpdateConfiguration);
|
||||
|
||||
this.registerWatcher();
|
||||
this.initAsync();
|
||||
|
@ -141,9 +141,9 @@ export class ConfigWatcher<T> implements IConfigWatcher<T>, IDisposable {
|
|||
}
|
||||
|
||||
if (isFolder) {
|
||||
this.disposables.push(watchFolder(path, (type, path) => path === this._path ? this.onConfigFileChange() : undefined, error => this.options.onError(error)));
|
||||
this.disposables.add(watchFolder(path, (type, path) => path === this._path ? this.onConfigFileChange() : undefined, error => this.options.onError(error)));
|
||||
} else {
|
||||
this.disposables.push(watchFile(path, (type, path) => this.onConfigFileChange(), error => this.options.onError(error)));
|
||||
this.disposables.add(watchFile(path, (type, path) => this.onConfigFileChange(), error => this.options.onError(error)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ class CodeMain {
|
|||
await instantiationService.invokeFunction(async accessor => {
|
||||
const environmentService = accessor.get(IEnvironmentService);
|
||||
const stateService = accessor.get(IStateService);
|
||||
const logService = accessor.get(ILogService);
|
||||
|
||||
// Patch `process.env` with the instance's environment
|
||||
const instanceEnvironment = this.patchEnvironment(environmentService);
|
||||
|
@ -110,7 +111,7 @@ class CodeMain {
|
|||
throw error;
|
||||
}
|
||||
|
||||
const mainIpcServer = await instantiationService.invokeFunction(accessor => this.doStartup(accessor, true));
|
||||
const mainIpcServer = await this.doStartup(logService, environmentService, instantiationService, true);
|
||||
bufferLogService.logger = new SpdLogService('main', environmentService.logsPath, bufferLogService.getLevel());
|
||||
|
||||
return instantiationService.createInstance(CodeApplication, mainIpcServer, instanceEnvironment).startup();
|
||||
|
@ -174,10 +175,7 @@ class CodeMain {
|
|||
return instanceEnvironment;
|
||||
}
|
||||
|
||||
private async doStartup(accessor: ServicesAccessor, retry: boolean): Promise<Server> {
|
||||
const logService = accessor.get(ILogService);
|
||||
const environmentService = accessor.get(IEnvironmentService);
|
||||
const instantiationService = accessor.get(IInstantiationService);
|
||||
private async doStartup(logService: ILogService, environmentService: IEnvironmentService, instantiationService: IInstantiationService, retry: boolean): Promise<Server> {
|
||||
|
||||
// Try to setup a server for running. If that succeeds it means
|
||||
// we are the first instance to startup. Otherwise it is likely
|
||||
|
@ -231,7 +229,7 @@ class CodeMain {
|
|||
throw error;
|
||||
}
|
||||
|
||||
return this.doStartup(accessor, false);
|
||||
return this.doStartup(logService, environmentService, instantiationService, false);
|
||||
}
|
||||
|
||||
// Tests from CLI require to be the only instance currently
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { TextModel } from 'vs/editor/common/model/textModel';
|
||||
|
@ -18,7 +18,7 @@ suite('CodeAction', () => {
|
|||
let langId = new LanguageIdentifier('fooLang', 17);
|
||||
let uri = URI.parse('untitled:path');
|
||||
let model: TextModel;
|
||||
let disposables: IDisposable[] = [];
|
||||
const disposables = new DisposableStore();
|
||||
let testData = {
|
||||
diagnostics: {
|
||||
abc: {
|
||||
|
@ -79,12 +79,13 @@ suite('CodeAction', () => {
|
|||
};
|
||||
|
||||
setup(function () {
|
||||
disposables.clear();
|
||||
model = TextModel.createFromString('test1\ntest2\ntest3', undefined, langId, uri);
|
||||
disposables = [model];
|
||||
disposables.add(model);
|
||||
});
|
||||
|
||||
teardown(function () {
|
||||
dispose(disposables);
|
||||
disposables.clear();
|
||||
});
|
||||
|
||||
test('CodeActions are sorted by type, #38623', async function () {
|
||||
|
@ -102,7 +103,7 @@ suite('CodeAction', () => {
|
|||
}
|
||||
};
|
||||
|
||||
disposables.push(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
disposables.add(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
|
||||
const expected = [
|
||||
// CodeActions with a diagnostics array are shown first ordered by diagnostics.message
|
||||
|
@ -132,7 +133,7 @@ suite('CodeAction', () => {
|
|||
}
|
||||
};
|
||||
|
||||
disposables.push(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
disposables.add(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
|
||||
{
|
||||
const { actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { kind: new CodeActionKind('a') } }, CancellationToken.None);
|
||||
|
@ -162,7 +163,7 @@ suite('CodeAction', () => {
|
|||
}
|
||||
};
|
||||
|
||||
disposables.push(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
disposables.add(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
|
||||
const { actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto', filter: { kind: new CodeActionKind('a') } }, CancellationToken.None);
|
||||
assert.equal(actions.length, 1);
|
||||
|
@ -179,7 +180,7 @@ suite('CodeAction', () => {
|
|||
}
|
||||
};
|
||||
|
||||
disposables.push(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
disposables.add(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
|
||||
{
|
||||
const { actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: 'auto' }, CancellationToken.None);
|
||||
|
@ -205,7 +206,7 @@ suite('CodeAction', () => {
|
|||
providedCodeActionKinds = [CodeActionKind.Refactor.value];
|
||||
};
|
||||
|
||||
disposables.push(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
disposables.add(CodeActionProviderRegistry.register('fooLang', provider));
|
||||
|
||||
const { actions } = await getCodeActions(model, new Range(1, 1, 2, 1), {
|
||||
type: 'auto',
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { Selection } from 'vs/editor/common/core/selection';
|
||||
|
@ -26,10 +26,10 @@ suite('CodeAction', () => {
|
|||
let model: TextModel;
|
||||
let markerService: MarkerService;
|
||||
let editor: ICodeEditor;
|
||||
let disposables: IDisposable[];
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
setup(() => {
|
||||
disposables = [];
|
||||
disposables.clear();
|
||||
markerService = new MarkerService();
|
||||
model = TextModel.createFromString('foobar foo bar\nfarboo far boo', undefined, languageIdentifier, uri);
|
||||
editor = createTestCodeEditor({ model: model });
|
||||
|
@ -37,7 +37,7 @@ suite('CodeAction', () => {
|
|||
});
|
||||
|
||||
teardown(() => {
|
||||
dispose(disposables);
|
||||
disposables.clear();
|
||||
editor.dispose();
|
||||
model.dispose();
|
||||
markerService.dispose();
|
||||
|
@ -45,7 +45,7 @@ suite('CodeAction', () => {
|
|||
|
||||
test('Orcale -> marker added', done => {
|
||||
const reg = CodeActionProviderRegistry.register(languageIdentifier.language, testProvider);
|
||||
disposables.push(reg);
|
||||
disposables.add(reg);
|
||||
|
||||
const oracle = new CodeActionOracle(editor, markerService, (e: CodeActionsState.Triggered) => {
|
||||
assert.equal(e.trigger.type, 'auto');
|
||||
|
@ -71,7 +71,7 @@ suite('CodeAction', () => {
|
|||
|
||||
test('Orcale -> position changed', () => {
|
||||
const reg = CodeActionProviderRegistry.register(languageIdentifier.language, testProvider);
|
||||
disposables.push(reg);
|
||||
disposables.add(reg);
|
||||
|
||||
markerService.changeOne('fake', uri, [{
|
||||
startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 6,
|
||||
|
@ -105,7 +105,7 @@ suite('CodeAction', () => {
|
|||
return [];
|
||||
}
|
||||
});
|
||||
disposables.push(reg);
|
||||
disposables.add(reg);
|
||||
|
||||
editor.getModel()!.setValue('// @ts-check\n2\ncon\n');
|
||||
|
||||
|
@ -139,7 +139,7 @@ suite('CodeAction', () => {
|
|||
|
||||
test('Orcale -> should only auto trigger once for cursor and marker update right after each other', done => {
|
||||
const reg = CodeActionProviderRegistry.register(languageIdentifier.language, testProvider);
|
||||
disposables.push(reg);
|
||||
disposables.add(reg);
|
||||
|
||||
let triggerCount = 0;
|
||||
const oracle = new CodeActionOracle(editor, markerService, (e: CodeActionsState.Triggered) => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import 'vs/css!./dnd';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ICodeEditor, IEditorMouseEvent, IMouseTarget, MouseTargetType } from 'vs/editor/browser/editorBrowser';
|
||||
|
@ -28,12 +28,11 @@ function hasTriggerModifier(e: IKeyboardEvent | IMouseEvent): boolean {
|
|||
}
|
||||
}
|
||||
|
||||
export class DragAndDropController implements editorCommon.IEditorContribution {
|
||||
export class DragAndDropController extends Disposable implements editorCommon.IEditorContribution {
|
||||
|
||||
private static readonly ID = 'editor.contrib.dragAndDrop';
|
||||
|
||||
private readonly _editor: ICodeEditor;
|
||||
private _toUnhook: IDisposable[];
|
||||
private _dragSelection: Selection | null;
|
||||
private _dndDecorationIds: string[];
|
||||
private _mouseDown: boolean;
|
||||
|
@ -45,15 +44,15 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
|
|||
}
|
||||
|
||||
constructor(editor: ICodeEditor) {
|
||||
super();
|
||||
this._editor = editor;
|
||||
this._toUnhook = [];
|
||||
this._toUnhook.push(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
|
||||
this._toUnhook.push(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));
|
||||
this._toUnhook.push(this._editor.onMouseDrag((e: IEditorMouseEvent) => this._onEditorMouseDrag(e)));
|
||||
this._toUnhook.push(this._editor.onMouseDrop((e: IEditorMouseEvent) => this._onEditorMouseDrop(e)));
|
||||
this._toUnhook.push(this._editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e)));
|
||||
this._toUnhook.push(this._editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e)));
|
||||
this._toUnhook.push(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur()));
|
||||
this._register(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
|
||||
this._register(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));
|
||||
this._register(this._editor.onMouseDrag((e: IEditorMouseEvent) => this._onEditorMouseDrag(e)));
|
||||
this._register(this._editor.onMouseDrop((e: IEditorMouseEvent) => this._onEditorMouseDrop(e)));
|
||||
this._register(this._editor.onKeyDown((e: IKeyboardEvent) => this.onEditorKeyDown(e)));
|
||||
this._register(this._editor.onKeyUp((e: IKeyboardEvent) => this.onEditorKeyUp(e)));
|
||||
this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur()));
|
||||
this._dndDecorationIds = [];
|
||||
this._mouseDown = false;
|
||||
this._modifierPressed = false;
|
||||
|
@ -228,7 +227,7 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
|
|||
this._dragSelection = null;
|
||||
this._mouseDown = false;
|
||||
this._modifierPressed = false;
|
||||
this._toUnhook = dispose(this._toUnhook);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,18 +94,18 @@ export class ModesHoverController implements IEditorContribution {
|
|||
this._isHoverEnabled = hoverOpts.enabled;
|
||||
this._isHoverSticky = hoverOpts.sticky;
|
||||
if (this._isHoverEnabled) {
|
||||
this._toUnhook.push(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
|
||||
this._toUnhook.push(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));
|
||||
this._toUnhook.push(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));
|
||||
this._toUnhook.push(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));
|
||||
this._toUnhook.push(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));
|
||||
this._toUnhook.add(this._editor.onMouseDown((e: IEditorMouseEvent) => this._onEditorMouseDown(e)));
|
||||
this._toUnhook.add(this._editor.onMouseUp((e: IEditorMouseEvent) => this._onEditorMouseUp(e)));
|
||||
this._toUnhook.add(this._editor.onMouseMove((e: IEditorMouseEvent) => this._onEditorMouseMove(e)));
|
||||
this._toUnhook.add(this._editor.onKeyDown((e: IKeyboardEvent) => this._onKeyDown(e)));
|
||||
this._toUnhook.add(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged()));
|
||||
} else {
|
||||
this._toUnhook.push(this._editor.onMouseMove(hideWidgetsEventHandler));
|
||||
this._toUnhook.add(this._editor.onMouseMove(hideWidgetsEventHandler));
|
||||
}
|
||||
|
||||
this._toUnhook.push(this._editor.onMouseLeave(hideWidgetsEventHandler));
|
||||
this._toUnhook.push(this._editor.onDidChangeModel(hideWidgetsEventHandler));
|
||||
this._toUnhook.push(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));
|
||||
this._toUnhook.add(this._editor.onMouseLeave(hideWidgetsEventHandler));
|
||||
this._toUnhook.add(this._editor.onDidChangeModel(hideWidgetsEventHandler));
|
||||
this._toUnhook.add(this._editor.onDidScrollChange((e: IScrollEvent) => this._onEditorScrollChanged(e)));
|
||||
}
|
||||
|
||||
private _unhookEvents(): void {
|
||||
|
|
|
@ -528,12 +528,12 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
|
|||
const hoverElement = $('div.hover-row.status-bar');
|
||||
const disposables = new DisposableStore();
|
||||
const actionsElement = dom.append(hoverElement, $('div.actions'));
|
||||
disposables.push(this.renderAction(actionsElement, {
|
||||
disposables.add(this.renderAction(actionsElement, {
|
||||
label: nls.localize('quick fixes', "Quick Fix..."),
|
||||
commandId: QuickFixAction.Id,
|
||||
run: async (target) => {
|
||||
const codeActionsPromise = this.getCodeActions(markerHover.marker);
|
||||
disposables.push(toDisposable(() => codeActionsPromise.cancel()));
|
||||
disposables.add(toDisposable(() => codeActionsPromise.cancel()));
|
||||
const actions = await codeActionsPromise;
|
||||
const elementPosition = dom.getDomNodePagePosition(target);
|
||||
this._contextMenuService.showContextMenu({
|
||||
|
@ -543,7 +543,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget {
|
|||
}
|
||||
}));
|
||||
if (markerHover.marker.severity === MarkerSeverity.Error || markerHover.marker.severity === MarkerSeverity.Warning || markerHover.marker.severity === MarkerSeverity.Info) {
|
||||
disposables.push(this.renderAction(actionsElement, {
|
||||
disposables.add(this.renderAction(actionsElement, {
|
||||
label: nls.localize('peek problem', "Peek Problem"),
|
||||
commandId: NextMarkerAction.ID,
|
||||
run: () => {
|
||||
|
|
|
@ -148,7 +148,14 @@ export function getLinks(model: ITextModel, token: CancellationToken): Promise<L
|
|||
}, onUnexpectedExternalError);
|
||||
});
|
||||
|
||||
return Promise.all(promises).then(() => new LinksList(coalesce(lists)));
|
||||
return Promise.all(promises).then(() => {
|
||||
const result = new LinksList(coalesce(lists));
|
||||
if (!token.isCancellationRequested) {
|
||||
return result;
|
||||
}
|
||||
result.dispose();
|
||||
return new LinksList([]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -172,8 +172,8 @@ export class RenameInputField extends Disposable implements IContentWidget {
|
|||
}
|
||||
};
|
||||
|
||||
disposeOnDone.push(this._editor.onDidChangeCursorSelection(onCursorChanged));
|
||||
disposeOnDone.push(this._editor.onDidBlurEditorWidget(() => this.cancelInput(false)));
|
||||
disposeOnDone.add(this._editor.onDidChangeCursorSelection(onCursorChanged));
|
||||
disposeOnDone.add(this._editor.onDidBlurEditorWidget(() => this.cancelInput(false)));
|
||||
|
||||
this._show();
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
|||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { FuzzyScore } from 'vs/base/common/filters';
|
||||
import { isDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
|
||||
export const Context = {
|
||||
Visible: new RawContextKey<boolean>('suggestWidgetVisible', false),
|
||||
|
@ -121,7 +122,6 @@ export function provideSuggestionItems(
|
|||
token: CancellationToken = CancellationToken.None
|
||||
): Promise<CompletionItem[]> {
|
||||
|
||||
const allSuggestions: CompletionItem[] = [];
|
||||
const wordUntil = model.getWordUntilPosition(position);
|
||||
const defaultRange = new Range(position.lineNumber, wordUntil.startColumn, position.lineNumber, wordUntil.endColumn);
|
||||
|
||||
|
@ -135,9 +135,12 @@ export function provideSuggestionItems(
|
|||
supports.unshift([_snippetSuggestSupport]);
|
||||
}
|
||||
|
||||
const allSuggestions: CompletionItem[] = [];
|
||||
const disposables = new DisposableStore();
|
||||
let hasResult = false;
|
||||
|
||||
// add suggestions from contributed providers - providers are ordered in groups of
|
||||
// equal score and once a group produces a result the process stops
|
||||
let hasResult = false;
|
||||
const factory = supports.map(supports => () => {
|
||||
// for each support in the group ask for suggestions
|
||||
return Promise.all(supports.map(provider => {
|
||||
|
@ -162,6 +165,9 @@ export function provideSuggestionItems(
|
|||
allSuggestions.push(new CompletionItem(position, suggestion, container, provider, model));
|
||||
}
|
||||
}
|
||||
if (isDisposable(container)) {
|
||||
disposables.add(container);
|
||||
}
|
||||
}
|
||||
|
||||
if (len !== allSuggestions.length && provider !== _snippetSuggestSupport) {
|
||||
|
@ -177,6 +183,7 @@ export function provideSuggestionItems(
|
|||
return hasResult || token.isCancellationRequested;
|
||||
}).then(() => {
|
||||
if (token.isCancellationRequested) {
|
||||
disposables.dispose();
|
||||
return Promise.reject<any>(canceled());
|
||||
}
|
||||
return allSuggestions.sort(getSuggestionComparator(options.snippetSortOrder));
|
||||
|
@ -244,29 +251,35 @@ export function getSuggestionComparator(snippetConfig: SnippetSortOrder): (a: Co
|
|||
return _snippetComparators.get(snippetConfig)!;
|
||||
}
|
||||
|
||||
registerDefaultLanguageCommand('_executeCompletionItemProvider', (model, position, args) => {
|
||||
registerDefaultLanguageCommand('_executeCompletionItemProvider', async (model, position, args) => {
|
||||
|
||||
const result: modes.CompletionList = {
|
||||
incomplete: false,
|
||||
suggestions: []
|
||||
};
|
||||
|
||||
let resolving: Promise<any>[] = [];
|
||||
let maxItemsToResolve = args['maxItemsToResolve'] || 0;
|
||||
const disposables = new DisposableStore();
|
||||
const resolving: Promise<any>[] = [];
|
||||
const maxItemsToResolve = args['maxItemsToResolve'] || 0;
|
||||
|
||||
return provideSuggestionItems(model, position).then(items => {
|
||||
for (const item of items) {
|
||||
if (resolving.length < maxItemsToResolve) {
|
||||
resolving.push(item.resolve(CancellationToken.None));
|
||||
}
|
||||
result.incomplete = result.incomplete || item.container.incomplete;
|
||||
result.suggestions.push(item.completion);
|
||||
const items = await provideSuggestionItems(model, position);
|
||||
for (const item of items) {
|
||||
if (resolving.length < maxItemsToResolve) {
|
||||
resolving.push(item.resolve(CancellationToken.None));
|
||||
}
|
||||
}).then(() => {
|
||||
return Promise.all(resolving);
|
||||
}).then(() => {
|
||||
result.incomplete = result.incomplete || item.container.incomplete;
|
||||
result.suggestions.push(item.completion);
|
||||
if (isDisposable(item.container)) {
|
||||
disposables.add(item.container);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await Promise.all(resolving);
|
||||
return result;
|
||||
});
|
||||
} finally {
|
||||
disposables.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
interface SuggestController extends IEditorContribution {
|
||||
|
|
|
@ -301,7 +301,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
|
|||
weight2: 0
|
||||
});
|
||||
|
||||
toDispose.push(toDisposable(() => {
|
||||
toDispose.add(toDisposable(() => {
|
||||
for (let i = 0; i < this._dynamicKeybindings.length; i++) {
|
||||
let kb = this._dynamicKeybindings[i];
|
||||
if (kb.command === commandId) {
|
||||
|
@ -314,7 +314,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService {
|
|||
|
||||
let commandService = this._commandService;
|
||||
if (commandService instanceof StandaloneCommandService) {
|
||||
toDispose.push(commandService.addCommand({
|
||||
toDispose.add(commandService.addCommand({
|
||||
id: commandId,
|
||||
handler: handler
|
||||
}));
|
||||
|
|
|
@ -233,7 +233,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
|||
const uniqueId = this.getId() + ':' + id;
|
||||
|
||||
// Register the command
|
||||
toDispose.push(CommandsRegistry.registerCommand(uniqueId, run));
|
||||
toDispose.add(CommandsRegistry.registerCommand(uniqueId, run));
|
||||
|
||||
// Register the context menu item
|
||||
if (contextMenuGroupId) {
|
||||
|
@ -246,13 +246,13 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
|||
group: contextMenuGroupId,
|
||||
order: contextMenuOrder
|
||||
};
|
||||
toDispose.push(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem));
|
||||
toDispose.add(MenuRegistry.appendMenuItem(MenuId.EditorContext, menuItem));
|
||||
}
|
||||
|
||||
// Register the keybindings
|
||||
if (Array.isArray(keybindings)) {
|
||||
for (const kb of keybindings) {
|
||||
toDispose.push(this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen));
|
||||
toDispose.add(this._standaloneKeybindingService.addDynamicKeybinding(uniqueId, kb, run, keybindingsWhen));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon
|
|||
|
||||
// Store it under the original id, such that trigger with the original id will work
|
||||
this._actions[id] = internalAction;
|
||||
toDispose.push(toDisposable(() => {
|
||||
toDispose.add(toDisposable(() => {
|
||||
delete this._actions[id];
|
||||
}));
|
||||
|
||||
|
|
|
@ -204,12 +204,12 @@ function toWorkbenchListOptions<T>(options: IListOptions<T>, configurationServic
|
|||
if (options.multipleSelectionSupport !== false && !options.multipleSelectionController) {
|
||||
const multipleSelectionController = new MultipleSelectionController(configurationService);
|
||||
result.multipleSelectionController = multipleSelectionController;
|
||||
disposables.push(multipleSelectionController);
|
||||
disposables.add(multipleSelectionController);
|
||||
}
|
||||
|
||||
const openController = new WorkbenchOpenController(configurationService, options.openController);
|
||||
result.openController = openController;
|
||||
disposables.push(openController);
|
||||
disposables.add(openController);
|
||||
|
||||
if (options.keyboardNavigationLabelProvider) {
|
||||
const tlp = options.keyboardNavigationLabelProvider;
|
||||
|
@ -350,7 +350,7 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
|
|||
);
|
||||
|
||||
this.disposables = new DisposableStore();
|
||||
this.disposables.push(workbenchListOptionsDisposable);
|
||||
this.disposables.add(workbenchListOptionsDisposable);
|
||||
|
||||
this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
|
||||
this.configurationService = configurationService;
|
||||
|
@ -360,15 +360,15 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
|
|||
|
||||
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService);
|
||||
|
||||
this.disposables.push(this.contextKeyService);
|
||||
this.disposables.push((listService as ListService).register(this));
|
||||
this.disposables.push(attachListStyler(this, themeService));
|
||||
this.disposables.add(this.contextKeyService);
|
||||
this.disposables.add((listService as ListService).register(this));
|
||||
this.disposables.add(attachListStyler(this, themeService));
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => {
|
||||
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
|
||||
this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService);
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ export class WorkbenchTreeController extends DefaultController {
|
|||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => {
|
||||
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration(openModeSettingKey)) {
|
||||
this.setOpenMode(this.getOpenModeSetting());
|
||||
}
|
||||
|
|
20
src/vs/vscode.d.ts
vendored
20
src/vs/vscode.d.ts
vendored
|
@ -6042,15 +6042,19 @@ declare module 'vscode' {
|
|||
export function openExternal(target: Uri): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* The [authority](#Uri.authority)-component. When `undefined`, extensions are
|
||||
* executed in the same context (e.g. operating system or machine) in which the UI
|
||||
* of the editor is executed. If defined, extensions are running in a different
|
||||
* context, for instance a remote machine.
|
||||
* Information about running remotely. When `undefined`, extensions are executed in the same
|
||||
* context (e.g. operating system or machine) in which the UI of the editor is executed.
|
||||
* If defined, extensions are running in a different context, for instance a remote machine.
|
||||
*
|
||||
* *Note* that no assumptions about the actual value should be made as it is defined
|
||||
* by extensions and not by the editor.
|
||||
* A remote [uri](#Uri) adheres to this format: `remote_scheme://auth_prefix+auth_rest/path` where
|
||||
* the `remote_scheme` is defined by the editor, `auth_prefix` and `auth_rest` are defined by extensions,
|
||||
* and `path` is defined by the user.
|
||||
*
|
||||
* Extensions contributing a remote are encouraged to use a stable `auth_prefix`-value,
|
||||
* e.g `remote_scheme://ssh+23/` and `remote_scheme://ssh+42`. Such prefix is exposed
|
||||
* in the `prefix`-property of the returned object.
|
||||
*/
|
||||
export const remoteAuthority: string | undefined;
|
||||
export const remoteAuthority: { prefix: string } | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9162,7 +9166,7 @@ declare module 'vscode' {
|
|||
* @param range The range the comment thread is located within the document.
|
||||
* @param comments The ordered comments of the thread.
|
||||
*/
|
||||
createCommentThread(uri: Uri, range: Range, comments: Comment[]): CommentThread;
|
||||
createCommentThread(resource: Uri, range: Range, comments: Comment[]): CommentThread;
|
||||
|
||||
/**
|
||||
* Dispose this comment controller.
|
||||
|
|
2
src/vs/vscode.proposed.d.ts
vendored
2
src/vs/vscode.proposed.d.ts
vendored
|
@ -1063,7 +1063,7 @@ declare module 'vscode' {
|
|||
* @param range The range the comment thread is located within the document.
|
||||
* @param comments The ordered comments of the thread.
|
||||
*/
|
||||
createCommentThread(id: string, uri: Uri, range: Range, comments: Comment[]): CommentThread;
|
||||
createCommentThread(id: string, resource: Uri, range: Range, comments: Comment[]): CommentThread;
|
||||
|
||||
/**
|
||||
* Optional new comment thread factory.
|
||||
|
|
|
@ -644,6 +644,12 @@ class SuggestAdapter {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
if (token.isCancellationRequested) {
|
||||
// cancelled -> return without further ado, esp no caching
|
||||
// of results as they will leak
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let list = Array.isArray(value) ? new CompletionList(value) : value;
|
||||
let pid: number | undefined;
|
||||
|
||||
|
@ -832,6 +838,12 @@ class LinkProviderAdapter {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
if (token.isCancellationRequested) {
|
||||
// cancelled -> return without further ado, esp no caching
|
||||
// of results as they will leak
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (typeof this._provider.resolveDocumentLink !== 'function') {
|
||||
// no resolve -> no caching
|
||||
return { links: links.map(typeConvert.DocumentLink.from) };
|
||||
|
|
|
@ -236,7 +236,7 @@ export function createApiFactory(
|
|||
};
|
||||
|
||||
// namespace: env
|
||||
const env: typeof vscode.env = Object.freeze({
|
||||
const env: typeof vscode.env = Object.freeze<typeof vscode.env>({
|
||||
get machineId() { return initData.telemetryInfo.machineId; },
|
||||
get sessionId() { return initData.telemetryInfo.sessionId; },
|
||||
get language() { return initData.environment.appLanguage; },
|
||||
|
@ -257,7 +257,21 @@ export function createApiFactory(
|
|||
openExternal(uri: URI) {
|
||||
return extHostWindow.openUri(uri, { allowTunneling: !!initData.remoteAuthority });
|
||||
},
|
||||
get remoteAuthority() { return initData.remoteAuthority || undefined; }
|
||||
get remoteAuthority() {
|
||||
const { remoteAuthority } = initData;
|
||||
if (!remoteAuthority) {
|
||||
return undefined;
|
||||
}
|
||||
const idx = remoteAuthority.indexOf('+');
|
||||
if (idx < 0) {
|
||||
console.warn(`INVALID remote authority: ${remoteAuthority}`);
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
prefix: remoteAuthority.substring(0, idx),
|
||||
toString() { return remoteAuthority; } // compatiblity
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// namespace: extensions
|
||||
|
|
|
@ -181,7 +181,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
|||
this.instantiatedCompositeItems.set(id, { composite, disposable: disposables, localProgressService });
|
||||
|
||||
// Register to title area update events from the composite
|
||||
disposables.push(composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this));
|
||||
disposables.add(composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this));
|
||||
|
||||
return composite;
|
||||
}
|
||||
|
|
|
@ -384,16 +384,16 @@ export class EditorStatus implements IStatusbarItem {
|
|||
this.delayedRender = null;
|
||||
this.toRender = null;
|
||||
|
||||
this.toDispose.push(toDisposable(() => {
|
||||
this.toDispose.add(toDisposable(() => {
|
||||
if (this.delayedRender) {
|
||||
this.delayedRender.dispose();
|
||||
this.delayedRender = null;
|
||||
}
|
||||
}));
|
||||
this.toDispose.push(this.editorService.onDidActiveEditorChange(() => this.updateStatusBar()));
|
||||
this.toDispose.push(this.untitledEditorService.onDidChangeEncoding(r => this.onResourceEncodingChange(r)));
|
||||
this.toDispose.push(this.textFileService.models.onModelEncodingChanged(e => this.onResourceEncodingChange((e.resource))));
|
||||
this.toDispose.push(TabFocus.onDidChangeTabFocus(e => this.onTabFocusModeChange()));
|
||||
this.toDispose.add(this.editorService.onDidActiveEditorChange(() => this.updateStatusBar()));
|
||||
this.toDispose.add(this.untitledEditorService.onDidChangeEncoding(r => this.onResourceEncodingChange(r)));
|
||||
this.toDispose.add(this.textFileService.models.onModelEncodingChanged(e => this.onResourceEncodingChange((e.resource))));
|
||||
this.toDispose.add(TabFocus.onDidChangeTabFocus(e => this.onTabFocusModeChange()));
|
||||
|
||||
return this.toDispose;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,10 @@
|
|||
cursor: zoom-out;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar > .statusbar-item > a.zoom-statusbar-item {
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.monaco-resource-viewer .embedded-link,
|
||||
.monaco-resource-viewer .embedded-link:hover {
|
||||
cursor: pointer;
|
||||
|
|
|
@ -172,7 +172,7 @@ class LargeImageView {
|
|||
link.setAttribute('role', 'button');
|
||||
link.textContent = nls.localize('resourceOpenExternalButton', "Open image using external program?");
|
||||
|
||||
disposables.push(DOM.addDisposableListener(link, DOM.EventType.CLICK, () => openExternal(descriptor.resource)));
|
||||
disposables.add(DOM.addDisposableListener(link, DOM.EventType.CLICK, () => openExternal(descriptor.resource)));
|
||||
}
|
||||
|
||||
return disposables;
|
||||
|
@ -223,7 +223,7 @@ class FileSeemsBinaryFileView {
|
|||
link.setAttribute('role', 'button');
|
||||
link.textContent = nls.localize('openAsText', "Do you want to open it anyway?");
|
||||
|
||||
disposables.push(DOM.addDisposableListener(link, DOM.EventType.CLICK, () => delegate.openInternalClb(descriptor.resource)));
|
||||
disposables.add(DOM.addDisposableListener(link, DOM.EventType.CLICK, () => delegate.openInternalClb(descriptor.resource)));
|
||||
}
|
||||
|
||||
scrollbar.scanDomNode();
|
||||
|
@ -436,7 +436,7 @@ class InlineImageView {
|
|||
updateScale(scale);
|
||||
}
|
||||
|
||||
disposables.push(DOM.addDisposableListener(window, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
disposables.add(DOM.addDisposableListener(window, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ class InlineImageView {
|
|||
}
|
||||
}));
|
||||
|
||||
disposables.push(DOM.addDisposableListener(window, DOM.EventType.KEY_UP, (e: KeyboardEvent) => {
|
||||
disposables.add(DOM.addDisposableListener(window, DOM.EventType.KEY_UP, (e: KeyboardEvent) => {
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
@ -463,7 +463,7 @@ class InlineImageView {
|
|||
}
|
||||
}));
|
||||
|
||||
disposables.push(DOM.addDisposableListener(container, DOM.EventType.CLICK, (e: MouseEvent) => {
|
||||
disposables.add(DOM.addDisposableListener(container, DOM.EventType.CLICK, (e: MouseEvent) => {
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ class InlineImageView {
|
|||
}
|
||||
}));
|
||||
|
||||
disposables.push(DOM.addDisposableListener(container, DOM.EventType.WHEEL, (e: WheelEvent) => {
|
||||
disposables.add(DOM.addDisposableListener(container, DOM.EventType.WHEEL, (e: WheelEvent) => {
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ class InlineImageView {
|
|||
updateScale(scale as number * (1 - delta * InlineImageView.SCALE_PINCH_FACTOR));
|
||||
}));
|
||||
|
||||
disposables.push(DOM.addDisposableListener(container, DOM.EventType.SCROLL, () => {
|
||||
disposables.add(DOM.addDisposableListener(container, DOM.EventType.SCROLL, () => {
|
||||
if (!image || !image.parentElement || scale === 'fit') {
|
||||
return;
|
||||
}
|
||||
|
@ -536,7 +536,7 @@ class InlineImageView {
|
|||
image = DOM.append(container, DOM.$<HTMLImageElement>('img.scale-to-fit'));
|
||||
image.style.visibility = 'hidden';
|
||||
|
||||
disposables.push(DOM.addDisposableListener(image, DOM.EventType.LOAD, e => {
|
||||
disposables.add(DOM.addDisposableListener(image, DOM.EventType.LOAD, e => {
|
||||
if (!image) {
|
||||
return;
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ class InlineImageView {
|
|||
img.src = src;
|
||||
} else {
|
||||
const url = URL.createObjectURL(src);
|
||||
disposables.push(toDisposable(() => URL.revokeObjectURL(url)));
|
||||
disposables.add(toDisposable(() => URL.revokeObjectURL(url)));
|
||||
img.src = url;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -496,16 +496,16 @@ export class TabsTitleControl extends TitleControl {
|
|||
};
|
||||
|
||||
// Open on Click / Touch
|
||||
disposables.push(addDisposableListener(tab, EventType.MOUSE_DOWN, (e: MouseEvent) => handleClickOrTouch(e)));
|
||||
disposables.push(addDisposableListener(tab, TouchEventType.Tap, (e: GestureEvent) => handleClickOrTouch(e)));
|
||||
disposables.add(addDisposableListener(tab, EventType.MOUSE_DOWN, (e: MouseEvent) => handleClickOrTouch(e)));
|
||||
disposables.add(addDisposableListener(tab, TouchEventType.Tap, (e: GestureEvent) => handleClickOrTouch(e)));
|
||||
|
||||
// Touch Scroll Support
|
||||
disposables.push(addDisposableListener(tab, TouchEventType.Change, (e: GestureEvent) => {
|
||||
disposables.add(addDisposableListener(tab, TouchEventType.Change, (e: GestureEvent) => {
|
||||
this.tabsScrollbar.setScrollPosition({ scrollLeft: this.tabsScrollbar.getScrollPosition().scrollLeft - e.translationX });
|
||||
}));
|
||||
|
||||
// Close on mouse middle click
|
||||
disposables.push(addDisposableListener(tab, EventType.MOUSE_UP, (e: MouseEvent) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.MOUSE_UP, (e: MouseEvent) => {
|
||||
EventHelper.stop(e);
|
||||
|
||||
tab.blur();
|
||||
|
@ -519,7 +519,7 @@ export class TabsTitleControl extends TitleControl {
|
|||
}));
|
||||
|
||||
// Context menu on Shift+F10
|
||||
disposables.push(addDisposableListener(tab, EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
if (event.shiftKey && event.keyCode === KeyCode.F10) {
|
||||
showContextMenu(e);
|
||||
|
@ -527,12 +527,12 @@ export class TabsTitleControl extends TitleControl {
|
|||
}));
|
||||
|
||||
// Context menu on touch context menu gesture
|
||||
disposables.push(addDisposableListener(tab, TouchEventType.Contextmenu, (e: GestureEvent) => {
|
||||
disposables.add(addDisposableListener(tab, TouchEventType.Contextmenu, (e: GestureEvent) => {
|
||||
showContextMenu(e);
|
||||
}));
|
||||
|
||||
// Keyboard accessibility
|
||||
disposables.push(addDisposableListener(tab, EventType.KEY_UP, (e: KeyboardEvent) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.KEY_UP, (e: KeyboardEvent) => {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
let handled = false;
|
||||
|
||||
|
@ -577,14 +577,14 @@ export class TabsTitleControl extends TitleControl {
|
|||
}));
|
||||
|
||||
// Pin on double click
|
||||
disposables.push(addDisposableListener(tab, EventType.DBLCLICK, (e: MouseEvent) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.DBLCLICK, (e: MouseEvent) => {
|
||||
EventHelper.stop(e);
|
||||
|
||||
this.group.pinEditor(this.group.getEditor(index) || undefined);
|
||||
}));
|
||||
|
||||
// Context menu
|
||||
disposables.push(addDisposableListener(tab, EventType.CONTEXT_MENU, (e: Event) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.CONTEXT_MENU, (e: Event) => {
|
||||
EventHelper.stop(e, true);
|
||||
|
||||
const input = this.group.getEditor(index);
|
||||
|
@ -594,7 +594,7 @@ export class TabsTitleControl extends TitleControl {
|
|||
}, true /* use capture to fix https://github.com/Microsoft/vscode/issues/19145 */));
|
||||
|
||||
// Drag support
|
||||
disposables.push(addDisposableListener(tab, EventType.DRAG_START, (e: DragEvent) => {
|
||||
disposables.add(addDisposableListener(tab, EventType.DRAG_START, (e: DragEvent) => {
|
||||
const editor = this.group.getEditor(index);
|
||||
if (!editor) {
|
||||
return;
|
||||
|
@ -616,7 +616,7 @@ export class TabsTitleControl extends TitleControl {
|
|||
}));
|
||||
|
||||
// Drop support
|
||||
disposables.push(new DragAndDropObserver(tab, {
|
||||
disposables.add(new DragAndDropObserver(tab, {
|
||||
onDragEnter: e => {
|
||||
|
||||
// Update class to signal drag operation
|
||||
|
|
|
@ -1128,6 +1128,9 @@ export class QuickInputService extends Component implements IQuickInputService {
|
|||
this.hide(true);
|
||||
}
|
||||
}));
|
||||
this._register(dom.addDisposableListener(container, dom.EventType.FOCUS, (e: FocusEvent) => {
|
||||
inputBox.setFocus();
|
||||
}));
|
||||
this._register(dom.addDisposableListener(container, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
const event = new StandardKeyboardEvent(e);
|
||||
switch (event.keyCode) {
|
||||
|
|
|
@ -36,7 +36,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
|
|||
const registrations = new DisposableStore();
|
||||
|
||||
// command
|
||||
registrations.push(CommandsRegistry.registerCommand(descriptor.id, this.createCommandHandler(descriptor)));
|
||||
registrations.add(CommandsRegistry.registerCommand(descriptor.id, this.createCommandHandler(descriptor)));
|
||||
|
||||
// keybinding
|
||||
const weight = (typeof descriptor.keybindingWeight === 'undefined' ? KeybindingWeight.WorkbenchContrib : descriptor.keybindingWeight);
|
||||
|
@ -72,7 +72,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
|
|||
|
||||
MenuRegistry.addCommand(command);
|
||||
|
||||
registrations.push(MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command, when }));
|
||||
registrations.add(MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command, when }));
|
||||
}
|
||||
|
||||
// TODO@alex,joh
|
||||
|
|
|
@ -14,6 +14,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
|||
export class CommentFormActions implements IDisposable {
|
||||
private _buttonElements: HTMLElement[] = [];
|
||||
private readonly _toDispose = new DisposableStore();
|
||||
private _actions: IAction[];
|
||||
|
||||
constructor(
|
||||
private container: HTMLElement,
|
||||
|
@ -30,13 +31,14 @@ export class CommentFormActions implements IDisposable {
|
|||
for (const group of groups) {
|
||||
const [, actions] = group;
|
||||
|
||||
this._actions = actions;
|
||||
actions.forEach(action => {
|
||||
const button = new Button(this.container);
|
||||
this._buttonElements.push(button.element);
|
||||
|
||||
this._toDispose.push(button);
|
||||
this._toDispose.push(attachButtonStyler(button, this.themeService));
|
||||
this._toDispose.push(button.onDidClick(() => this.actionHandler(action)));
|
||||
this._toDispose.add(button);
|
||||
this._toDispose.add(attachButtonStyler(button, this.themeService));
|
||||
this._toDispose.add(button.onDidClick(() => this.actionHandler(action)));
|
||||
|
||||
button.enabled = action.enabled;
|
||||
button.label = action.label;
|
||||
|
@ -44,6 +46,16 @@ export class CommentFormActions implements IDisposable {
|
|||
}
|
||||
}
|
||||
|
||||
triggerDefaultAction() {
|
||||
if (this._actions.length) {
|
||||
let lastAction = this._actions[0];
|
||||
|
||||
if (lastAction.enabled) {
|
||||
this.actionHandler(lastAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._toDispose.dispose();
|
||||
}
|
||||
|
|
|
@ -826,6 +826,8 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
|
|||
|
||||
await this.commandService.executeCommand(commandId, ...args);
|
||||
return;
|
||||
} else if (this._commentFormActions) {
|
||||
this._commentFormActions.triggerDefaultAction();
|
||||
}
|
||||
} else {
|
||||
this.createComment();
|
||||
|
|
|
@ -9,7 +9,7 @@ import { Expression, Variable, ExpressionContainer } from 'vs/workbench/contrib/
|
|||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInputValidationOptions, InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { ITreeRenderer, ITreeNode } from 'vs/base/browser/ui/tree/tree';
|
||||
import { IDisposable, dispose, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
@ -127,7 +127,7 @@ export interface IExpressionTemplateData {
|
|||
value: HTMLSpanElement;
|
||||
inputBoxContainer: HTMLElement;
|
||||
enableInputBox(expression: IExpression, options: IInputBoxOptions): void;
|
||||
readonly toDispose: IDisposable;
|
||||
toDispose: IDisposable[];
|
||||
label: HighlightedLabel;
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer<IExpr
|
|||
const label = new HighlightedLabel(name, false);
|
||||
|
||||
const inputBoxContainer = dom.append(expression, $('.inputBoxContainer'));
|
||||
const toDispose = new DisposableStore();
|
||||
const toDispose: IDisposable[] = [];
|
||||
|
||||
const enableInputBox = (expression: IExpression, options: IInputBoxOptions) => {
|
||||
name.style.display = 'none';
|
||||
|
@ -180,7 +180,7 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer<IExpr
|
|||
name.style.display = 'initial';
|
||||
value.style.display = 'initial';
|
||||
inputBoxContainer.style.display = 'none';
|
||||
toDispose.dispose();
|
||||
dispose(toDispose);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -221,4 +221,4 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer<IExpr
|
|||
disposeTemplate(templateData: IExpressionTemplateData): void {
|
||||
dispose(templateData.toDispose);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -53,6 +53,11 @@ function getThreadAndRun(accessor: ServicesAccessor, thread: IThread | undefined
|
|||
const debugService = accessor.get(IDebugService);
|
||||
if (!(thread instanceof Thread)) {
|
||||
thread = debugService.getViewModel().focusedThread;
|
||||
if (!thread) {
|
||||
const focusedSession = debugService.getViewModel().focusedSession;
|
||||
const threads = focusedSession ? focusedSession.getAllThreads() : undefined;
|
||||
thread = threads && threads.length ? threads[0] : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (thread) {
|
||||
|
|
|
@ -10,17 +10,16 @@ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
|||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { Themable } from 'vs/workbench/common/theme';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { STATUS_BAR_DEBUGGING_FOREGROUND, isStatusbarInDebugMode } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider';
|
||||
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
export class DebugStatus extends Themable implements IStatusbarItem {
|
||||
private container: HTMLElement;
|
||||
private statusBarItem: HTMLElement;
|
||||
private label: HTMLElement;
|
||||
private icon: HTMLElement;
|
||||
private label: OcticonLabel;
|
||||
private showInStatusBar: 'never' | 'always' | 'onFirstSessionStart';
|
||||
|
||||
constructor(
|
||||
|
@ -56,16 +55,6 @@ export class DebugStatus extends Themable implements IStatusbarItem {
|
|||
}));
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
if (this.icon) {
|
||||
if (isStatusbarInDebugMode(this.debugService)) {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_DEBUGGING_FOREGROUND);
|
||||
} else {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public render(container: HTMLElement): IDisposable {
|
||||
this.container = container;
|
||||
if (this.showInStatusBar === 'always') {
|
||||
|
@ -81,8 +70,7 @@ export class DebugStatus extends Themable implements IStatusbarItem {
|
|||
this._register(dom.addDisposableListener(this.statusBarItem, 'click', () => this.quickOpenService.show('debug ')));
|
||||
this.statusBarItem.title = nls.localize('selectAndStartDebug', "Select and start debug configuration");
|
||||
const a = dom.append(this.statusBarItem, $('a'));
|
||||
this.icon = dom.append(a, $('.icon'));
|
||||
this.label = dom.append(a, $('span.label'));
|
||||
this.label = new OcticonLabel(a);
|
||||
this.setLabel();
|
||||
}
|
||||
|
||||
|
@ -96,7 +84,7 @@ export class DebugStatus extends Themable implements IStatusbarItem {
|
|||
const nameAndLaunchPresent = name && manager.selectedConfiguration.launch;
|
||||
dom.toggleClass(this.statusBarItem, 'hidden', this.showInStatusBar === 'never' || !nameAndLaunchPresent);
|
||||
if (nameAndLaunchPresent) {
|
||||
this.label.textContent = manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name;
|
||||
this.label.text = '$(play) ' + (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,24 +111,19 @@
|
|||
}
|
||||
|
||||
/* Debug status */
|
||||
/* A very precise css rule to overwrite the display set in statusbar.css */
|
||||
.monaco-workbench .part.statusbar > .statusbar-item > .debug-statusbar-item > a {
|
||||
display: flex;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar > .statusbar-item > .debug-statusbar-item span.octicon {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar .debug-statusbar-item.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar .debug-statusbar-item .icon {
|
||||
-webkit-mask: url('start.svg') no-repeat 50% 50%;
|
||||
-webkit-mask-size: 16px;
|
||||
display: inline-block;
|
||||
padding-right: 2px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.monaco-workbench .debug-view-content .monaco-list-row .monaco-tl-contents {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
|
|
@ -600,7 +600,7 @@ class ReplExpressionsRenderer implements ITreeRenderer<Expression, FuzzyScore, I
|
|||
const expression = element.element;
|
||||
templateData.label.set(expression.name, createMatches(element.filterData));
|
||||
renderExpressionValue(expression, templateData.value, {
|
||||
preserveWhitespace: true,
|
||||
preserveWhitespace: !expression.hasChildren,
|
||||
showHover: false,
|
||||
colorize: true
|
||||
});
|
||||
|
|
|
@ -339,6 +339,7 @@ export interface IBreakpoint extends IBaseBreakpoint {
|
|||
readonly endColumn?: number;
|
||||
readonly message?: string;
|
||||
readonly adapterData: any;
|
||||
readonly sessionAgnosticData: { lineNumber: number, column: number | undefined };
|
||||
}
|
||||
|
||||
export interface IFunctionBreakpoint extends IBaseBreakpoint {
|
||||
|
|
|
@ -659,6 +659,13 @@ export class Breakpoint extends BaseBreakpoint implements IBreakpoint {
|
|||
return data ? data.endColumn : undefined;
|
||||
}
|
||||
|
||||
get sessionAgnosticData(): { lineNumber: number, column: number | undefined } {
|
||||
return {
|
||||
lineNumber: this._lineNumber,
|
||||
column: this._column
|
||||
};
|
||||
}
|
||||
|
||||
setSessionData(sessionId: string, data: DebugProtocol.Breakpoint): void {
|
||||
super.setSessionData(sessionId, data);
|
||||
if (!this._adapterData) {
|
||||
|
|
|
@ -240,6 +240,8 @@ declare module DebugProtocol {
|
|||
'attachForSuspendedLaunch': A project launcher component has launched a new process in a suspended state and then asked the debugger to attach.
|
||||
*/
|
||||
startMethod?: 'launch' | 'attach' | 'attachForSuspendedLaunch';
|
||||
/** The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display. */
|
||||
pointerSize?: number;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -323,6 +325,8 @@ declare module DebugProtocol {
|
|||
supportsVariablePaging?: boolean;
|
||||
/** Client supports the runInTerminal request. */
|
||||
supportsRunInTerminalRequest?: boolean;
|
||||
/** Client supports memory references. */
|
||||
supportsMemoryReferences?: boolean;
|
||||
}
|
||||
|
||||
/** Response to 'initialize' request. */
|
||||
|
@ -1047,6 +1051,8 @@ declare module DebugProtocol {
|
|||
The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
||||
*/
|
||||
indexedVariables?: number;
|
||||
/** Memory reference to a location appropriate for this result. For pointer type eval results, this is generally a reference to the memory address contained in the pointer. */
|
||||
memoryReference?: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1202,6 +1208,66 @@ declare module DebugProtocol {
|
|||
};
|
||||
}
|
||||
|
||||
/** ReadMemory request; value of command field is 'readMemory'.
|
||||
Reads bytes from memory at the provided location.
|
||||
*/
|
||||
export interface ReadMemoryRequest extends Request {
|
||||
// command: 'readMemory';
|
||||
arguments: ReadMemoryArguments;
|
||||
}
|
||||
|
||||
/** Arguments for 'readMemory' request. */
|
||||
export interface ReadMemoryArguments {
|
||||
/** Memory reference to the base location from which data should be read. */
|
||||
memoryReference: string;
|
||||
/** Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative. */
|
||||
offset?: number;
|
||||
/** Number of bytes to read at the specified location and offset. */
|
||||
count: number;
|
||||
}
|
||||
|
||||
/** Response to 'readMemory' request. */
|
||||
export interface ReadMemoryResponse extends Response {
|
||||
body?: {
|
||||
/** The address of the first byte of data returned. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. */
|
||||
address: string;
|
||||
/** The number of unreadable bytes encountered after the last successfully read byte. This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed. */
|
||||
unreadableBytes?: number;
|
||||
/** The bytes read from memory, encoded using base64. */
|
||||
data?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** Disassemble request; value of command field is 'disassemble'.
|
||||
Disassembles code stored at the provided location.
|
||||
*/
|
||||
export interface DisassembleRequest extends Request {
|
||||
// command: 'disassemble';
|
||||
arguments: DisassembleArguments;
|
||||
}
|
||||
|
||||
/** Arguments for 'disassemble' request. */
|
||||
export interface DisassembleArguments {
|
||||
/** Memory reference to the base location containing the instructions to disassemble. */
|
||||
memoryReference: string;
|
||||
/** Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative. */
|
||||
offset?: number;
|
||||
/** Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. */
|
||||
instructionOffset?: number;
|
||||
/** Number of instructions to disassemble starting at the specified location and offset. An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value. */
|
||||
instructionCount: number;
|
||||
/** If true, the adapter should attempt to resolve memory addresses and other values to symbolic names. */
|
||||
resolveSymbols?: boolean;
|
||||
}
|
||||
|
||||
/** Response to 'disassemble' request. */
|
||||
export interface DisassembleResponse extends Response {
|
||||
body?: {
|
||||
/** The list of disassembled instructions. */
|
||||
instructions: DisassembledInstruction[];
|
||||
};
|
||||
}
|
||||
|
||||
/** Information about the capabilities of a debug adapter. */
|
||||
export interface Capabilities {
|
||||
/** The debug adapter supports the 'configurationDone' request. */
|
||||
|
@ -1258,6 +1324,10 @@ declare module DebugProtocol {
|
|||
supportsTerminateRequest?: boolean;
|
||||
/** The debug adapter supports data breakpoints. */
|
||||
supportsDataBreakpoints?: boolean;
|
||||
/** The debug adapter supports the 'readMemory' request. */
|
||||
supportsReadMemoryRequest?: boolean;
|
||||
/** The debug adapter supports the 'disassemble' request. */
|
||||
supportsDisassembleRequest?: boolean;
|
||||
}
|
||||
|
||||
/** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */
|
||||
|
@ -1393,6 +1463,8 @@ declare module DebugProtocol {
|
|||
endLine?: number;
|
||||
/** An optional end column of the range covered by the stack frame. */
|
||||
endColumn?: number;
|
||||
/** Optional memory reference for the current instruction pointer in this frame. */
|
||||
instructionPointerReference?: string;
|
||||
/** The module associated with this frame, if any. */
|
||||
moduleId?: number | string;
|
||||
/** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. */
|
||||
|
@ -1401,8 +1473,16 @@ declare module DebugProtocol {
|
|||
|
||||
/** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. */
|
||||
export interface Scope {
|
||||
/** Name of the scope such as 'Arguments', 'Locals'. */
|
||||
/** Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. */
|
||||
name: string;
|
||||
/** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
|
||||
Values:
|
||||
'arguments': Scope contains method arguments.
|
||||
'locals': Scope contains local variables.
|
||||
'registers': Scope contains registers. Only a single 'registers' scope should be returned from a 'scopes' request.
|
||||
etc.
|
||||
*/
|
||||
presentationHint?: string;
|
||||
/** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. */
|
||||
variablesReference: number;
|
||||
/** The number of named variables in this scope.
|
||||
|
@ -1455,6 +1535,8 @@ declare module DebugProtocol {
|
|||
The client can use this optional information to present the children in a paged UI and fetch them in chunks.
|
||||
*/
|
||||
indexedVariables?: number;
|
||||
/** Optional memory reference for the variable if the variable represents executable code, such as a function pointer. */
|
||||
memoryReference?: string;
|
||||
}
|
||||
|
||||
/** Optional properties of a variable that can be used to determine how to render the variable in the UI. */
|
||||
|
@ -1576,6 +1658,8 @@ declare module DebugProtocol {
|
|||
endLine?: number;
|
||||
/** An optional end column of the range covered by the goto target. */
|
||||
endColumn?: number;
|
||||
/** Optional memory reference for the instruction pointer value represented by this target. */
|
||||
instructionPointerReference?: string;
|
||||
}
|
||||
|
||||
/** CompletionItems are the suggestions returned from the CompletionsRequest. */
|
||||
|
@ -1673,5 +1757,27 @@ declare module DebugProtocol {
|
|||
/** Details of the exception contained by this exception, if any. */
|
||||
innerException?: ExceptionDetails[];
|
||||
}
|
||||
|
||||
/** Represents a single disassembled instruction. */
|
||||
export interface DisassembledInstruction {
|
||||
/** The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. */
|
||||
address: string;
|
||||
/** Optional raw bytes representing the instruction and its operands, in an implementation-defined format. */
|
||||
instructionBytes?: string;
|
||||
/** Text representing the instruction and its operands, in an implementation-defined format. */
|
||||
instruction: string;
|
||||
/** Name of the symbol that correponds with the location of this instruction, if any. */
|
||||
symbol?: string;
|
||||
/** Source location that corresponds to this instruction, if any. Should always be set (if available) on the first instruction returned, but can be omitted afterwards if this instruction maps to the same source file as the previous instruction. */
|
||||
location?: Source;
|
||||
/** The line within the source location that corresponds to this instruction, if any. */
|
||||
line?: number;
|
||||
/** The column within the line that corresponds to this instruction, if any. */
|
||||
column?: number;
|
||||
/** The end line of the range that corresponds to this instruction, if any. */
|
||||
endLine?: number;
|
||||
/** The end column of the range that corresponds to this instruction, if any. */
|
||||
endColumn?: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -282,8 +282,8 @@ export class DebugSession implements IDebugSession {
|
|||
|
||||
return this.raw.setBreakpoints({
|
||||
source: rawSource,
|
||||
lines: breakpointsToSend.map(bp => bp.lineNumber),
|
||||
breakpoints: breakpointsToSend.map(bp => ({ line: bp.lineNumber, column: bp.column, condition: bp.condition, hitCondition: bp.hitCondition, logMessage: bp.logMessage })),
|
||||
lines: breakpointsToSend.map(bp => bp.sessionAgnosticData.lineNumber),
|
||||
breakpoints: breakpointsToSend.map(bp => ({ line: bp.sessionAgnosticData.lineNumber, column: bp.sessionAgnosticData.column, condition: bp.condition, hitCondition: bp.hitCondition, logMessage: bp.logMessage })),
|
||||
sourceModified
|
||||
}).then(response => {
|
||||
if (response && response.body) {
|
||||
|
|
|
@ -255,7 +255,7 @@ export class ExtensionData implements IExtensionData {
|
|||
toQuery.push(id);
|
||||
}
|
||||
}
|
||||
const galleryResult = await this.extensionsWorkbenchService.queryGallery({ names: this.childrenExtensionIds, pageSize: this.childrenExtensionIds.length }, CancellationToken.None);
|
||||
const galleryResult = await this.extensionsWorkbenchService.queryGallery({ names: toQuery, pageSize: toQuery.length }, CancellationToken.None);
|
||||
result.push(...galleryResult.firstPage);
|
||||
return result.map(extension => new ExtensionData(extension, this, this.getChildrenExtensionIds, this.extensionsWorkbenchService));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as arrays from 'vs/base/common/arrays';
|
|||
import { localize } from 'vs/nls';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService, IExtensionTipsService, IExtensionIdentifier, EnablementState, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
@ -22,9 +22,7 @@ export interface IExtensionStatus {
|
|||
globallyEnabled: boolean;
|
||||
}
|
||||
|
||||
export class KeymapExtensions implements IWorkbenchContribution {
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
export class KeymapExtensions extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
|
@ -34,13 +32,12 @@ export class KeymapExtensions implements IWorkbenchContribution {
|
|||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
) {
|
||||
this.disposables.push(
|
||||
lifecycleService.onShutdown(() => this.dispose()),
|
||||
instantiationService.invokeFunction(onExtensionChanged)((identifiers => {
|
||||
Promise.all(identifiers.map(identifier => this.checkForOtherKeymaps(identifier)))
|
||||
.then(undefined, onUnexpectedError);
|
||||
}))
|
||||
);
|
||||
super();
|
||||
this._register(lifecycleService.onShutdown(() => this.dispose()));
|
||||
this._register(instantiationService.invokeFunction(onExtensionChanged)((identifiers => {
|
||||
Promise.all(identifiers.map(identifier => this.checkForOtherKeymaps(identifier)))
|
||||
.then(undefined, onUnexpectedError);
|
||||
})));
|
||||
}
|
||||
|
||||
private checkForOtherKeymaps(extensionIdentifier: IExtensionIdentifier): Promise<void> {
|
||||
|
@ -87,10 +84,6 @@ export class KeymapExtensions implements IWorkbenchContribution {
|
|||
}]
|
||||
);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
}
|
||||
}
|
||||
|
||||
export function onExtensionChanged(accessor: ServicesAccessor): Event<IExtensionIdentifier[]> {
|
||||
|
|
|
@ -170,7 +170,7 @@ export class InstallAction extends ExtensionAction {
|
|||
) {
|
||||
super(`extensions.install`, InstallAction.INSTALL_LABEL, InstallAction.Class, false);
|
||||
this.update();
|
||||
this.disposables.push(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
}
|
||||
|
||||
update(): void {
|
||||
|
@ -298,7 +298,7 @@ export class RemoteInstallAction extends ExtensionAction {
|
|||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super(`extensions.remoteinstall`, RemoteInstallAction.INSTALL_LABEL, RemoteInstallAction.Class, false);
|
||||
this.disposables.push(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
this.updateLabel();
|
||||
this.update();
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ export class LocalInstallAction extends ExtensionAction {
|
|||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super(`extensions.localinstall`, LocalInstallAction.INSTALL_LABEL, LocalInstallAction.Class, false);
|
||||
this.disposables.push(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
this.disposables.add(this.labelService.onDidChangeFormatters(() => this.updateLabel(), this));
|
||||
this.updateLabel();
|
||||
this.update();
|
||||
}
|
||||
|
@ -510,8 +510,8 @@ export class CombinedInstallAction extends ExtensionAction {
|
|||
) {
|
||||
super('extensions.combinedInstall', '', '', false);
|
||||
|
||||
this.installAction = this.disposables.push(instantiationService.createInstance(InstallAction));
|
||||
this.uninstallAction = this.disposables.push(instantiationService.createInstance(UninstallAction));
|
||||
this.installAction = this.disposables.add(instantiationService.createInstance(InstallAction));
|
||||
this.uninstallAction = this.disposables.add(instantiationService.createInstance(UninstallAction));
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
@ -1203,7 +1203,7 @@ export class UpdateAllAction extends Action {
|
|||
) {
|
||||
super(id, label, '', false);
|
||||
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
this.update();
|
||||
}
|
||||
|
||||
|
@ -1253,7 +1253,7 @@ export class ReloadAction extends ExtensionAction {
|
|||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super('extensions.reload', localize('reloadAction', "Reload"), ReloadAction.DisabledClass, false);
|
||||
this.disposables.push(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.updateRunningExtensions();
|
||||
}
|
||||
|
||||
|
@ -1389,7 +1389,7 @@ export class SetColorThemeAction extends ExtensionAction {
|
|||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super(`extensions.colorTheme`, localize('color theme', "Set Color Theme"), SetColorThemeAction.DisabledClass, false);
|
||||
this.disposables.push(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this));
|
||||
this.disposables.add(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this));
|
||||
this.update();
|
||||
}
|
||||
|
||||
|
@ -1461,7 +1461,7 @@ export class SetFileIconThemeAction extends ExtensionAction {
|
|||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super(`extensions.fileIconTheme`, localize('file icon theme', "Set File Icon Theme"), SetFileIconThemeAction.DisabledClass, false);
|
||||
this.disposables.push(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this));
|
||||
this.disposables.add(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this));
|
||||
this.update();
|
||||
}
|
||||
|
||||
|
@ -1620,7 +1620,7 @@ export class ClearExtensionsInputAction extends Action {
|
|||
) {
|
||||
super(id, label, 'clear-extensions', true);
|
||||
this.onSearchChange(value);
|
||||
this.disposables.push(onSearchChange(this.onSearchChange, this));
|
||||
this.disposables.add(onSearchChange(this.onSearchChange, this));
|
||||
}
|
||||
|
||||
private onSearchChange(value: string): void {
|
||||
|
@ -1987,7 +1987,7 @@ export class ChangeSortAction extends Action {
|
|||
|
||||
this.query = Query.parse('');
|
||||
this.enabled = false;
|
||||
this.disposables.push(onSearchChange(this.onSearchChange, this));
|
||||
this.disposables.add(onSearchChange(this.onSearchChange, this));
|
||||
}
|
||||
|
||||
private onSearchChange(value: string): void {
|
||||
|
@ -2305,7 +2305,7 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi
|
|||
@ITextModelService textModelResolverService: ITextModelService
|
||||
) {
|
||||
super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
|
||||
this.disposables.push(this.contextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this.disposables.add(this.contextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this.update();
|
||||
}
|
||||
|
||||
|
@ -2348,7 +2348,7 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac
|
|||
@ICommandService private readonly commandService: ICommandService
|
||||
) {
|
||||
super(id, label, contextService, fileService, textFileService, editorService, jsonEditingService, textModelResolverService);
|
||||
this.disposables.push(this.contextService.onDidChangeWorkspaceFolders(() => this.update(), this));
|
||||
this.disposables.add(this.contextService.onDidChangeWorkspaceFolders(() => this.update(), this));
|
||||
this.update();
|
||||
}
|
||||
|
||||
|
@ -2669,8 +2669,8 @@ export class DisabledLabelAction extends ExtensionAction {
|
|||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
) {
|
||||
super('extensions.disabledLabel', warningAction.tooltip, `${DisabledLabelAction.Class} hide`, false);
|
||||
this.disposables.push(warningAction.onDidChange(() => this.update(), this));
|
||||
this.disposables.push(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.disposables.add(warningAction.onDidChange(() => this.update(), this));
|
||||
this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.updateRunningExtensions();
|
||||
}
|
||||
|
||||
|
@ -2730,8 +2730,8 @@ export class SystemDisabledWarningAction extends ExtensionAction {
|
|||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
) {
|
||||
super('extensions.install', '', `${SystemDisabledWarningAction.CLASS} hide`, false);
|
||||
this.disposables.push(this.labelService.onDidChangeFormatters(() => this.update(), this));
|
||||
this.disposables.push(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.disposables.add(this.labelService.onDidChangeFormatters(() => this.update(), this));
|
||||
this.disposables.add(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
this.updateRunningExtensions();
|
||||
this.update();
|
||||
}
|
||||
|
@ -2823,7 +2823,7 @@ export class DisableAllAction extends Action {
|
|||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
@ -2854,8 +2854,8 @@ export class DisableAllWorkpsaceAction extends Action {
|
|||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.disposables.push(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update(), this));
|
||||
this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update(), this));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
@ -2886,7 +2886,7 @@ export class EnableAllAction extends Action {
|
|||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update()));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
@ -2918,8 +2918,8 @@ export class EnableAllWorkpsaceAction extends Action {
|
|||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.disposables.push(this.extensionsWorkbenchService.onChange(() => this.update(), this));
|
||||
this.disposables.push(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
this.disposables.add(this.extensionsWorkbenchService.onChange(() => this.update(), this));
|
||||
this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
|
|
@ -19,6 +19,7 @@ import { IAnchor } from 'vs/base/browser/ui/contextview/contextview';
|
|||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
|
||||
export const FEEDBACK_VISIBLE_CONFIG = 'workbench.statusBar.feedback.visible';
|
||||
|
||||
|
@ -71,7 +72,8 @@ export class FeedbackDropdown extends Dropdown {
|
|||
super(container, {
|
||||
contextViewProvider: options.contextViewProvider,
|
||||
labelRenderer: (container: HTMLElement): IDisposable => {
|
||||
dom.addClasses(container, 'send-feedback', 'mask-icon');
|
||||
const label = new OcticonLabel(container);
|
||||
label.text = '$(smile)';
|
||||
|
||||
return Disposable.None;
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ import { FeedbackDropdown, IFeedback, IFeedbackDelegate, FEEDBACK_VISIBLE_CONFIG
|
|||
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { Themable, STATUS_BAR_ITEM_HOVER_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { clearNode, EventHelper, addClass, removeClass, addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { localize } from 'vs/nls';
|
||||
|
@ -85,14 +85,6 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
|
|||
}
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
super.updateStyles();
|
||||
|
||||
if (this.dropdown && this.dropdown.label) {
|
||||
this.dropdown.label.style.backgroundColor = (this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND));
|
||||
}
|
||||
}
|
||||
|
||||
render(element: HTMLElement): IDisposable {
|
||||
this.container = element;
|
||||
|
||||
|
|
|
@ -114,13 +114,14 @@
|
|||
}
|
||||
|
||||
/* Statusbar */
|
||||
.monaco-workbench .statusbar-item > .monaco-dropdown.send-feedback {
|
||||
.monaco-workbench .statusbar > .statusbar-item > .monaco-dropdown.send-feedback {
|
||||
display: inline-block;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.monaco-workbench .statusbar-item > .monaco-dropdown.send-feedback > .dropdown-label.send-feedback {
|
||||
-webkit-mask: url('smiley.svg') no-repeat 50% 50%; /* use mask to be able to change color dynamically */
|
||||
width: 26px;
|
||||
.monaco-workbench .statusbar > .statusbar-item > .monaco-dropdown.send-feedback span.octicon {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Theming */
|
||||
|
@ -128,7 +129,7 @@
|
|||
font-family: inherit;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
|
||||
.vs .monaco-workbench .feedback-form .cancel {
|
||||
background: url('close.svg') center center no-repeat;
|
||||
}
|
||||
|
|
|
@ -664,16 +664,22 @@ export class CollapseExplorerView extends Action {
|
|||
|
||||
public static readonly ID = 'workbench.files.action.collapseExplorerFolders';
|
||||
public static readonly LABEL = nls.localize('collapseExplorerFolders', "Collapse Folders in Explorer");
|
||||
private toDispose: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IViewletService private readonly viewletService: IViewletService
|
||||
@IViewletService private readonly viewletService: IViewletService,
|
||||
@IExplorerService readonly explorerService: IExplorerService
|
||||
) {
|
||||
super(id, label);
|
||||
super(id, label, 'explorer-action collapse-explorer');
|
||||
this.toDispose.push(explorerService.onDidChangeEditable(e => {
|
||||
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||
this.enabled = !elementIsBeingEdited;
|
||||
}));
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
run(): Promise<any> {
|
||||
return this.viewletService.openViewlet(VIEWLET_ID).then((viewlet: ExplorerViewlet) => {
|
||||
const explorerView = viewlet.getExplorerView();
|
||||
if (explorerView) {
|
||||
|
@ -681,6 +687,11 @@ export class CollapseExplorerView extends Action {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
super.dispose();
|
||||
dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
export class RefreshExplorerView extends Action {
|
||||
|
@ -688,7 +699,7 @@ export class RefreshExplorerView extends Action {
|
|||
public static readonly ID = 'workbench.files.action.refreshFilesExplorer';
|
||||
public static readonly LABEL = nls.localize('refreshExplorer', "Refresh Explorer");
|
||||
|
||||
private toDispose: IDisposable[];
|
||||
private toDispose: IDisposable[] = [];
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
|
@ -697,7 +708,6 @@ export class RefreshExplorerView extends Action {
|
|||
@IExplorerService private readonly explorerService: IExplorerService
|
||||
) {
|
||||
super(id, label, 'explorer-action refresh-explorer');
|
||||
this.toDispose = [];
|
||||
this.toDispose.push(explorerService.onDidChangeEditable(e => {
|
||||
const elementIsBeingEdited = explorerService.isEditable(e);
|
||||
this.enabled = !elementIsBeingEdited;
|
||||
|
|
|
@ -9,11 +9,10 @@ import * as perf from 'vs/base/common/performance';
|
|||
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 { NewFolderAction, NewFileAction, FileCopiedContext, RefreshExplorerView, CollapseExplorerView } from 'vs/workbench/contrib/files/browser/fileActions';
|
||||
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';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ExplorerDecorationsProvider } from 'vs/workbench/contrib/files/browser/views/explorerDecorationsProvider';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
|
@ -224,7 +223,7 @@ export class ExplorerView extends ViewletPanel {
|
|||
actions.push(this.instantiationService.createInstance(NewFileAction));
|
||||
actions.push(this.instantiationService.createInstance(NewFolderAction));
|
||||
actions.push(this.instantiationService.createInstance(RefreshExplorerView, RefreshExplorerView.ID, RefreshExplorerView.LABEL));
|
||||
actions.push(this.instantiationService.createInstance(CollapseAction, this.tree, true, 'explorer-action collapse-explorer'));
|
||||
actions.push(this.instantiationService.createInstance(CollapseExplorerView, CollapseExplorerView.ID, CollapseExplorerView.LABEL));
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
|
|
@ -162,7 +162,11 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
|
|||
return;
|
||||
}
|
||||
|
||||
this.tree.getHTMLElement().focus();
|
||||
if (this.isEmpty()) {
|
||||
this.messageBoxContainer.focus();
|
||||
} else {
|
||||
this.tree.getHTMLElement().focus();
|
||||
}
|
||||
}
|
||||
|
||||
public focusFilter(): void {
|
||||
|
@ -470,11 +474,15 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
|
|||
}
|
||||
}
|
||||
|
||||
private isEmpty(): boolean {
|
||||
const { total, filtered } = this.getFilterStats();
|
||||
return total === 0 || filtered === 0;
|
||||
}
|
||||
|
||||
private render(): void {
|
||||
this.cachedFilterStats = undefined;
|
||||
this.tree.setChildren(null, createModelIterator(this.markersWorkbenchService.markersModel));
|
||||
const { total, filtered } = this.getFilterStats();
|
||||
dom.toggleClass(this.treeContainer, 'hidden', total === 0 || filtered === 0);
|
||||
dom.toggleClass(this.treeContainer, 'hidden', this.isEmpty());
|
||||
this.renderMessage();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
|
@ -164,7 +164,7 @@ export class OpenWorkspaceSettingsAction extends Action {
|
|||
static readonly ID = 'workbench.action.openWorkspaceSettings';
|
||||
static readonly LABEL = nls.localize('openWorkspaceSettings', "Open Workspace Settings");
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
private readonly disposables = new DisposableStore();
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
|
@ -174,7 +174,7 @@ export class OpenWorkspaceSettingsAction extends Action {
|
|||
) {
|
||||
super(id, label);
|
||||
this.update();
|
||||
this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this, this.disposables);
|
||||
this.disposables.add(this.workspaceContextService.onDidChangeWorkbenchState(() => this.update(), this));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
@ -186,7 +186,7 @@ export class OpenWorkspaceSettingsAction extends Action {
|
|||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
this.disposables.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { isLinux } from 'vs/base/common/platform';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { endsWith } from 'vs/base/common/strings';
|
||||
|
@ -129,14 +129,14 @@ export class PreferencesContribution implements IWorkbenchContribution {
|
|||
const modelContent = JSON.stringify(schema);
|
||||
const languageSelection = this.modeService.create('jsonc');
|
||||
const model = this.modelService.createModel(modelContent, languageSelection, uri);
|
||||
const disposables: IDisposable[] = [];
|
||||
disposables.push(schemaRegistry.onDidChangeSchema(schemaUri => {
|
||||
const disposables = new DisposableStore();
|
||||
disposables.add(schemaRegistry.onDidChangeSchema(schemaUri => {
|
||||
if (schemaUri === uri.toString()) {
|
||||
schema = schemaRegistry.getSchemaContributions().schemas[uri.toString()];
|
||||
model.setValue(JSON.stringify(schema));
|
||||
}
|
||||
}));
|
||||
disposables.push(model.onWillDispose(() => dispose(disposables)));
|
||||
disposables.add(model.onWillDispose(() => disposables.dispose()));
|
||||
|
||||
return model;
|
||||
}
|
||||
|
|
|
@ -675,11 +675,11 @@ export class DirtyDiffController extends Disposable implements IEditorContributi
|
|||
this.isDirtyDiffVisible.set(true);
|
||||
|
||||
const disposables = new DisposableStore();
|
||||
disposables.push(Event.once(this.widget.onDidClose)(this.close, this));
|
||||
disposables.push(model.onDidChange(this.onDidModelChange, this));
|
||||
disposables.add(Event.once(this.widget.onDidClose)(this.close, this));
|
||||
disposables.add(model.onDidChange(this.onDidModelChange, this));
|
||||
|
||||
disposables.push(this.widget);
|
||||
disposables.push(toDisposable(() => {
|
||||
disposables.add(this.widget);
|
||||
disposables.add(toDisposable(() => {
|
||||
this.model = null;
|
||||
this.widget = null;
|
||||
this.currentIndex = -1;
|
||||
|
@ -993,13 +993,13 @@ export class DirtyDiffModel extends Disposable {
|
|||
const disposables = new DisposableStore();
|
||||
|
||||
this.repositoryDisposables.add(disposables);
|
||||
disposables.push(toDisposable(() => this.repositoryDisposables.delete(disposables)));
|
||||
disposables.add(toDisposable(() => this.repositoryDisposables.delete(disposables)));
|
||||
|
||||
const onDidChange = Event.any(repository.provider.onDidChange, repository.provider.onDidChangeResources);
|
||||
disposables.push(onDidChange(this.triggerDiff, this));
|
||||
disposables.add(onDidChange(this.triggerDiff, this));
|
||||
|
||||
const onDidRemoveThis = Event.filter(this.scmService.onDidRemoveRepository, r => r === repository);
|
||||
disposables.push(onDidRemoveThis(() => dispose(disposables), null));
|
||||
disposables.add(onDidRemoveThis(() => dispose(disposables), null));
|
||||
|
||||
this.triggerDiff();
|
||||
}
|
||||
|
@ -1070,8 +1070,8 @@ export class DirtyDiffModel extends Disposable {
|
|||
this._originalModel = ref.object.textEditorModel;
|
||||
|
||||
this.originalModelDisposables.clear();
|
||||
this.originalModelDisposables.push(ref);
|
||||
this.originalModelDisposables.push(ref.object.textEditorModel.onDidChangeContent(() => this.triggerDiff()));
|
||||
this.originalModelDisposables.add(ref);
|
||||
this.originalModelDisposables.add(ref.object.textEditorModel.onDidChangeContent(() => this.triggerDiff()));
|
||||
|
||||
return originalUri;
|
||||
});
|
||||
|
|
|
@ -189,7 +189,7 @@ export class StatusBarController implements IWorkbenchContribution {
|
|||
|
||||
const disposables = new DisposableStore();
|
||||
for (const c of commands) {
|
||||
disposables.push(this.statusbarService.addEntry({
|
||||
disposables.add(this.statusbarService.addEntry({
|
||||
text: c.title,
|
||||
tooltip: `${label} - ${c.tooltip}`,
|
||||
command: c.id,
|
||||
|
|
|
@ -181,7 +181,7 @@ class ProviderRenderer implements IListRenderer<ISCMRepository, RepositoryTempla
|
|||
|
||||
const actions: IAction[] = [];
|
||||
const disposeActions = () => dispose(actions);
|
||||
disposables.push({ dispose: disposeActions });
|
||||
disposables.add({ dispose: disposeActions });
|
||||
|
||||
const update = () => {
|
||||
disposeActions();
|
||||
|
@ -198,7 +198,7 @@ class ProviderRenderer implements IListRenderer<ISCMRepository, RepositoryTempla
|
|||
this._onDidRenderElement.fire(repository);
|
||||
};
|
||||
|
||||
disposables.push(repository.provider.onDidChange(update, null));
|
||||
disposables.add(repository.provider.onDidChange(update, null));
|
||||
update();
|
||||
|
||||
templateData.disposable = disposables;
|
||||
|
@ -397,10 +397,10 @@ class ResourceGroupRenderer implements IListRenderer<ISCMResourceGroup, Resource
|
|||
template.actionBar.context = group;
|
||||
|
||||
const disposables = new DisposableStore();
|
||||
disposables.push(connectPrimaryMenuToInlineActionBar(this.menus.getResourceGroupMenu(group), template.actionBar));
|
||||
disposables.add(connectPrimaryMenuToInlineActionBar(this.menus.getResourceGroupMenu(group), template.actionBar));
|
||||
|
||||
const updateCount = () => template.count.setCount(group.elements.length);
|
||||
disposables.push(group.onDidSplice(updateCount, null));
|
||||
disposables.add(group.onDidSplice(updateCount, null));
|
||||
updateCount();
|
||||
|
||||
template.elementDisposable = disposables;
|
||||
|
@ -490,7 +490,7 @@ class ResourceRenderer implements IListRenderer<ISCMResource, ResourceTemplate>
|
|||
template.actionBar.context = resource;
|
||||
|
||||
const disposables = new DisposableStore();
|
||||
disposables.push(connectPrimaryMenuToInlineActionBar(this.menus.getResourceMenu(resource.resourceGroup), template.actionBar));
|
||||
disposables.add(connectPrimaryMenuToInlineActionBar(this.menus.getResourceMenu(resource.resourceGroup), template.actionBar));
|
||||
|
||||
toggleClass(template.name, 'strike-through', resource.decorations.strikeThrough);
|
||||
toggleClass(template.element, 'faded', resource.decorations.faded);
|
||||
|
|
|
@ -304,7 +304,7 @@ class SnippetsService implements ISnippetsService {
|
|||
}
|
||||
return this._fileService.resolve(folder).then(stat => {
|
||||
for (const entry of stat.children || []) {
|
||||
disposables.push(this._addSnippetFile(entry.resource, source));
|
||||
disposables.add(this._addSnippetFile(entry.resource, source));
|
||||
}
|
||||
}, err => {
|
||||
this._logService.error(`Failed snippets from folder '${folder.toString()}'`, err);
|
||||
|
|
|
@ -422,7 +422,7 @@ taskDescription.default = {
|
|||
problemMatcher: []
|
||||
};
|
||||
definitions.showOutputType.deprecationMessage = nls.localize(
|
||||
'JsonSchema.tasks.showOputput.deprecated',
|
||||
'JsonSchema.tasks.showOutput.deprecated',
|
||||
'The property showOutput is deprecated. Use the reveal property inside the presentation property instead. See also the 1.14 release notes.'
|
||||
);
|
||||
taskDescriptionProperties.echoCommand.deprecationMessage = nls.localize(
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M6.5 0C2.91 0 0 2.91 0 6.5S2.91 13 6.5 13 13 10.09 13 6.5 10.09 0 6.5 0zm3.9 9.1l-1.3 1.3-2.6-2.6-2.6 2.6-1.3-1.3 2.6-2.635L2.6 3.9l1.3-1.3 2.6 2.6 2.6-2.6 1.3 1.3-2.6 2.565L10.4 9.1z" fill="#fff"/></g></svg>
|
Before Width: | Height: | Size: 335 B |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="-295.5 390.5 13 13"><path fill="#FFF" d="M-289 390.5c-3.6 0-6.5 2.9-6.5 6.5s2.9 6.5 6.5 6.5 6.5-2.9 6.5-6.5-2.9-6.5-6.5-6.5zm.9 11.1h-1.9v-6.5h1.9v6.5zm0-7.4h-1.9v-1.9h1.9v1.9z"/></svg>
|
Before Width: | Height: | Size: 257 B |
|
@ -1 +0,0 @@
|
|||
<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M7.15 0h-1.3L0 11.7 1.3 13h10.4l1.3-1.3L7.15 0zm0 11.7h-1.3v-1.3h1.3v1.3zm0-2.6h-1.3V3.9h1.3v5.2z" fill="#fff"/></g></svg>
|
Before Width: | Height: | Size: 249 B |
|
@ -3,80 +3,6 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.task-statusbar-runningItem {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.task-statusbar-runningItem-label {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.task-statusbar-runningItem-label > .octicon {
|
||||
font-size: 11px;
|
||||
vertical-align: -webkit-baseline-middle;
|
||||
height: 19px;
|
||||
}
|
||||
|
||||
.task-statusbar-item {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.task-statusbar-item-icon {
|
||||
background: url('task.svg') 50% 2px no-repeat;
|
||||
background-size: 18px;
|
||||
cursor: pointer;
|
||||
height: 22px;
|
||||
width: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.task-statusbar-item-building {
|
||||
height: 18px;
|
||||
padding: 0px 2px 0px 2px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-counter {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-error,
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-warning,
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-info {
|
||||
display: inline-block;
|
||||
padding-right: 8px;
|
||||
width: 8px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-error {
|
||||
-webkit-mask: url('status-error.svg') no-repeat 50% 50%;
|
||||
-webkit-mask-size: 11px;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-warning {
|
||||
-webkit-mask: url('status-warning.svg') no-repeat 50% 50%;
|
||||
-webkit-mask-size: 11px;
|
||||
}
|
||||
|
||||
.task-statusbar-item-label > .task-statusbar-item-label-info {
|
||||
-webkit-mask: url('status-info.svg') no-repeat 50% 50%;
|
||||
-webkit-mask-size: 11px;
|
||||
}
|
||||
|
||||
.monaco-workbench .quick-open-task-configure {
|
||||
background-image: url('configure.svg');
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><g fill="#fff"><rect x="9" y="17" width="3" height="3"/><polygon points="22,10.488 22,7.334 18,10.488 18,4 14,4 14,10.488 10,7.334 10,10.488 16,15.218"/><rect x="14" y="17" width="4" height="3"/><rect x="20" y="17" width="3" height="3"/><path d="M25 14v7h-18v-7h-2v12.121c0 .887.641 1.879 1.503 1.879h18.774c.863 0 1.723-.992 1.723-1.879v-12.121h-2zm-11 12h-3v-3h3v3zm7 0h-3v-3h3v3z"/></g></svg>
|
Before Width: | Height: | Size: 458 B |
|
@ -1079,7 +1079,7 @@ namespace CommandConfiguration {
|
|||
value.args = EMPTY_ARRAY;
|
||||
}
|
||||
if (value.suppressTaskName === undefined) {
|
||||
value.suppressTaskName = false;
|
||||
value.suppressTaskName = (context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1711,7 +1711,7 @@ namespace Globals {
|
|||
}
|
||||
CommandConfiguration.fillDefaults(value.command, context);
|
||||
if (value.suppressTaskName === undefined) {
|
||||
value.suppressTaskName = false;
|
||||
value.suppressTaskName = (context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0);
|
||||
}
|
||||
if (value.promptOnClose === undefined) {
|
||||
value.promptOnClose = true;
|
||||
|
|
|
@ -14,8 +14,7 @@ import * as Objects from 'vs/base/common/objects';
|
|||
import { URI } from 'vs/base/common/uri';
|
||||
import { IStringDictionary } from 'vs/base/common/collections';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as Dom from 'vs/base/browser/dom';
|
||||
import { IDisposable, dispose, toDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
@ -25,7 +24,6 @@ import { ValidationStatus, ValidationState } from 'vs/base/common/parsers';
|
|||
import * as UUID from 'vs/base/common/uuid';
|
||||
import * as Platform from 'vs/base/common/platform';
|
||||
import { LinkedMap, Touch } from 'vs/base/common/map';
|
||||
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
@ -52,8 +50,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
|||
import * as jsonContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { IStatusbarItem, IStatusbarRegistry, Extensions as StatusbarExtensions, StatusbarItemDescriptor } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { StatusbarAlignment, IStatusbarService, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
|
||||
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
|
@ -85,13 +82,11 @@ import { TerminalTaskSystem } from './terminalTaskSystem';
|
|||
import { ProcessRunnerDetector } from 'vs/workbench/contrib/tasks/node/processRunnerDetector';
|
||||
import { QuickOpenActionContributor } from '../browser/quickOpen';
|
||||
|
||||
import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IQuickInputService, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
|
||||
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { RunAutomaticTasks, AllowAutomaticTaskRunning, DisallowAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks';
|
||||
|
||||
|
@ -106,247 +101,180 @@ const actionRegistry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.Wo
|
|||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(AllowAutomaticTaskRunning, AllowAutomaticTaskRunning.ID, AllowAutomaticTaskRunning.LABEL), 'Tasks: Allow Automatic Tasks in Folder', tasksCategory);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisallowAutomaticTaskRunning, DisallowAutomaticTaskRunning.ID, DisallowAutomaticTaskRunning.LABEL), 'Tasks: Disallow Automatic Tasks in Folder', tasksCategory);
|
||||
|
||||
|
||||
namespace ConfigureTaskAction {
|
||||
export const ID = 'workbench.action.tasks.configureTaskRunner';
|
||||
export const TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task");
|
||||
}
|
||||
|
||||
class BuildStatusBarItem extends Themable implements IStatusbarItem {
|
||||
private activeCount: number;
|
||||
private icons: HTMLElement[];
|
||||
export class TaskStatusBarContributions extends Disposable implements IWorkbenchContribution {
|
||||
private runningTasksStatusItem: IStatusbarEntryAccessor | undefined;
|
||||
private problemsStatusItem: IStatusbarEntryAccessor;
|
||||
|
||||
private activeTasksCount: number = 0;
|
||||
|
||||
constructor(
|
||||
@IPanelService private readonly panelService: IPanelService,
|
||||
@IMarkerService private readonly markerService: IMarkerService,
|
||||
@ITaskService private readonly taskService: ITaskService,
|
||||
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService
|
||||
@IMarkerService private readonly markerService: IMarkerService,
|
||||
@IStatusbarService private readonly statusbarService: IStatusbarService
|
||||
) {
|
||||
super(themeService);
|
||||
super();
|
||||
|
||||
this.activeCount = 0;
|
||||
this.icons = [];
|
||||
this.problemsStatusItem = this._register(this.statusbarService.addEntry(this.getProblemsItem(), StatusbarAlignment.LEFT, 50 /* Medium Priority */));
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateStyles()));
|
||||
private getProblemsItem(): IStatusbarEntry {
|
||||
const problems = this.markerService.getStatistics();
|
||||
|
||||
return {
|
||||
text: this.getProblemsText(problems),
|
||||
tooltip: this.getProblemsTooltip(problems),
|
||||
command: 'workbench.action.tasks.toggleProblems'
|
||||
};
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
super.updateStyles();
|
||||
|
||||
this.icons.forEach(icon => {
|
||||
icon.style.backgroundColor = this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND);
|
||||
});
|
||||
}
|
||||
|
||||
public render(container: HTMLElement): IDisposable {
|
||||
let callOnDispose: IDisposable[] = [];
|
||||
|
||||
const element = document.createElement('div');
|
||||
const label = document.createElement('a');
|
||||
const errorIcon = document.createElement('div');
|
||||
const warningIcon = document.createElement('div');
|
||||
const infoIcon = document.createElement('div');
|
||||
const error = document.createElement('div');
|
||||
const warning = document.createElement('div');
|
||||
const info = document.createElement('div');
|
||||
const building = document.createElement('div');
|
||||
|
||||
private getProblemsTooltip(stats: MarkerStatistics): string {
|
||||
const errorTitle = (n: number) => nls.localize('totalErrors', "{0} Errors", n);
|
||||
const warningTitle = (n: number) => nls.localize('totalWarnings', "{0} Warnings", n);
|
||||
const infoTitle = (n: number) => nls.localize('totalInfos', "{0} Infos", n);
|
||||
|
||||
Dom.addClass(element, 'task-statusbar-item');
|
||||
element.title = nls.localize('problems', "Problems");
|
||||
const titles: string[] = [];
|
||||
|
||||
Dom.addClass(label, 'task-statusbar-item-label');
|
||||
element.appendChild(label);
|
||||
if (stats.errors > 0) {
|
||||
titles.push(errorTitle(stats.errors));
|
||||
}
|
||||
|
||||
Dom.addClass(errorIcon, 'task-statusbar-item-label-error');
|
||||
Dom.addClass(errorIcon, 'mask-icon');
|
||||
label.appendChild(errorIcon);
|
||||
this.icons.push(errorIcon);
|
||||
if (stats.warnings > 0) {
|
||||
titles.push(warningTitle(stats.warnings));
|
||||
}
|
||||
|
||||
Dom.addClass(error, 'task-statusbar-item-label-counter');
|
||||
error.innerHTML = '0';
|
||||
error.title = errorIcon.title = errorTitle(0);
|
||||
label.appendChild(error);
|
||||
if (stats.infos > 0) {
|
||||
titles.push(infoTitle(stats.infos));
|
||||
}
|
||||
|
||||
Dom.addClass(warningIcon, 'task-statusbar-item-label-warning');
|
||||
Dom.addClass(warningIcon, 'mask-icon');
|
||||
label.appendChild(warningIcon);
|
||||
this.icons.push(warningIcon);
|
||||
if (titles.length === 0) {
|
||||
return nls.localize('noProblems', "No Problems");
|
||||
}
|
||||
|
||||
Dom.addClass(warning, 'task-statusbar-item-label-counter');
|
||||
warning.innerHTML = '0';
|
||||
warning.title = warningIcon.title = warningTitle(0);
|
||||
label.appendChild(warning);
|
||||
return titles.join(', ');
|
||||
}
|
||||
|
||||
Dom.addClass(infoIcon, 'task-statusbar-item-label-info');
|
||||
Dom.addClass(infoIcon, 'mask-icon');
|
||||
label.appendChild(infoIcon);
|
||||
this.icons.push(infoIcon);
|
||||
Dom.hide(infoIcon);
|
||||
private getProblemsText(stats: MarkerStatistics): string {
|
||||
const problemsText: string[] = [];
|
||||
|
||||
Dom.addClass(info, 'task-statusbar-item-label-counter');
|
||||
label.appendChild(info);
|
||||
Dom.hide(info);
|
||||
// Errors
|
||||
problemsText.push('$(error) ' + this.packNumber(stats.errors));
|
||||
|
||||
Dom.addClass(building, 'task-statusbar-item-building');
|
||||
element.appendChild(building);
|
||||
building.innerHTML = nls.localize('building', 'Building...');
|
||||
Dom.hide(building);
|
||||
// Warnings
|
||||
problemsText.push('$(warning) ' + this.packNumber(stats.warnings));
|
||||
|
||||
callOnDispose.push(Dom.addDisposableListener(label, 'click', (e: MouseEvent) => {
|
||||
const panel = this.panelService.getActivePanel();
|
||||
if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) {
|
||||
this.layoutService.setPanelHidden(true);
|
||||
} else {
|
||||
this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true);
|
||||
}
|
||||
}));
|
||||
// Info (only if any)
|
||||
if (stats.infos > 0) {
|
||||
problemsText.push('$(info) ' + this.packNumber(stats.infos));
|
||||
}
|
||||
|
||||
// Building (only if any running tasks)
|
||||
if (this.activeTasksCount > 0) {
|
||||
problemsText.push(nls.localize('building', 'Building...'));
|
||||
}
|
||||
|
||||
return problemsText.join(' ');
|
||||
}
|
||||
|
||||
private packNumber(n: number): string {
|
||||
const manyProblems = nls.localize('manyProblems', "10K+");
|
||||
const packNumber = (n: number) => n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString();
|
||||
let updateLabel = (stats: MarkerStatistics) => {
|
||||
error.innerHTML = packNumber(stats.errors);
|
||||
error.title = errorIcon.title = errorTitle(stats.errors);
|
||||
warning.innerHTML = packNumber(stats.warnings);
|
||||
warning.title = warningIcon.title = warningTitle(stats.warnings);
|
||||
if (stats.infos > 0) {
|
||||
info.innerHTML = packNumber(stats.infos);
|
||||
info.title = infoIcon.title = infoTitle(stats.infos);
|
||||
Dom.show(info);
|
||||
Dom.show(infoIcon);
|
||||
} else {
|
||||
Dom.hide(info);
|
||||
Dom.hide(infoIcon);
|
||||
}
|
||||
};
|
||||
|
||||
this.markerService.onMarkerChanged((changedResources) => {
|
||||
updateLabel(this.markerService.getStatistics());
|
||||
});
|
||||
return n > 9999 ? manyProblems : n > 999 ? n.toString().charAt(0) + 'K' : n.toString();
|
||||
}
|
||||
|
||||
callOnDispose.push(this.taskService.onDidStateChange((event) => {
|
||||
if (this.ignoreEvent(event)) {
|
||||
return;
|
||||
private registerListeners(): void {
|
||||
this.markerService.onMarkerChanged(() => this.updateProblemsStatus());
|
||||
|
||||
this.taskService.onDidStateChange(event => {
|
||||
if (event.kind === TaskEventKind.Changed) {
|
||||
this.updateRunningTasksStatus();
|
||||
}
|
||||
switch (event.kind) {
|
||||
case TaskEventKind.Active:
|
||||
this.activeCount++;
|
||||
if (this.activeCount === 1) {
|
||||
Dom.show(building);
|
||||
}
|
||||
break;
|
||||
case TaskEventKind.Inactive:
|
||||
// Since the exiting of the sub process is communicated async we can't order inactive and terminate events.
|
||||
// So try to treat them accordingly.
|
||||
if (this.activeCount > 0) {
|
||||
this.activeCount--;
|
||||
if (this.activeCount === 0) {
|
||||
Dom.hide(building);
|
||||
|
||||
if (!this.ignoreEventForUpdateRunningTasksCount(event)) {
|
||||
let needsUpdate = false;
|
||||
|
||||
switch (event.kind) {
|
||||
case TaskEventKind.Active:
|
||||
this.activeTasksCount++;
|
||||
if (this.activeTasksCount === 1) {
|
||||
needsUpdate = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TaskEventKind.Terminated:
|
||||
if (this.activeCount !== 0) {
|
||||
Dom.hide(building);
|
||||
this.activeCount = 0;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case TaskEventKind.Inactive:
|
||||
// Since the exiting of the sub process is communicated async we can't order inactive and terminate events.
|
||||
// So try to treat them accordingly.
|
||||
if (this.activeTasksCount > 0) {
|
||||
this.activeTasksCount--;
|
||||
if (this.activeTasksCount === 0) {
|
||||
needsUpdate = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TaskEventKind.Terminated:
|
||||
if (this.activeTasksCount !== 0) {
|
||||
this.activeTasksCount = 0;
|
||||
needsUpdate = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (needsUpdate) {
|
||||
this.updateProblemsStatus();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
container.appendChild(element);
|
||||
|
||||
this.updateStyles();
|
||||
|
||||
return toDisposable(() => {
|
||||
callOnDispose = dispose(callOnDispose);
|
||||
});
|
||||
}
|
||||
|
||||
private ignoreEvent(event: TaskEvent): boolean {
|
||||
private async updateRunningTasksStatus(): Promise<void> {
|
||||
const tasks = await this.taskService.getActiveTasks();
|
||||
if (tasks.length === 0) {
|
||||
if (this.runningTasksStatusItem) {
|
||||
this.runningTasksStatusItem.dispose();
|
||||
this.runningTasksStatusItem = undefined;
|
||||
}
|
||||
} else {
|
||||
const itemProps: IStatusbarEntry = {
|
||||
text: `$(tools) ${tasks.length}`,
|
||||
tooltip: nls.localize('runningTasks', "Show Running Tasks"),
|
||||
command: 'workbench.action.tasks.showTasks',
|
||||
};
|
||||
|
||||
if (!this.runningTasksStatusItem) {
|
||||
this.runningTasksStatusItem = this.statusbarService.addEntry(itemProps, StatusbarAlignment.LEFT, 50 /* Medium Priority */);
|
||||
} else {
|
||||
this.runningTasksStatusItem.update(itemProps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private updateProblemsStatus(): void {
|
||||
this.problemsStatusItem.update(this.getProblemsItem());
|
||||
}
|
||||
|
||||
private ignoreEventForUpdateRunningTasksCount(event: TaskEvent): boolean {
|
||||
if (!this.taskService.inTerminal()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.group !== TaskGroup.Build) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!event.__task) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return event.__task.configurationProperties.problemMatchers === undefined || event.__task.configurationProperties.problemMatchers.length === 0;
|
||||
}
|
||||
}
|
||||
|
||||
class TaskStatusBarItem extends Themable implements IStatusbarItem {
|
||||
|
||||
constructor(
|
||||
@ITaskService private readonly taskService: ITaskService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super(themeService);
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
super.updateStyles();
|
||||
}
|
||||
|
||||
public render(container: HTMLElement): IDisposable {
|
||||
|
||||
let callOnDispose: IDisposable[] = [];
|
||||
const element = document.createElement('a');
|
||||
Dom.addClass(element, 'task-statusbar-runningItem');
|
||||
|
||||
let labelElement = document.createElement('div');
|
||||
Dom.addClass(labelElement, 'task-statusbar-runningItem-label');
|
||||
element.appendChild(labelElement);
|
||||
|
||||
let label = new OcticonLabel(labelElement);
|
||||
label.title = nls.localize('runningTasks', "Show Running Tasks");
|
||||
|
||||
Dom.hide(element);
|
||||
|
||||
callOnDispose.push(Dom.addDisposableListener(labelElement, 'click', (e: MouseEvent) => {
|
||||
(this.taskService as TaskService).runShowTasks();
|
||||
}));
|
||||
|
||||
let updateStatus = (): void => {
|
||||
this.taskService.getActiveTasks().then(tasks => {
|
||||
if (tasks.length === 0) {
|
||||
Dom.hide(element);
|
||||
} else {
|
||||
label.text = `$(tools) ${tasks.length}`;
|
||||
Dom.show(element);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
callOnDispose.push(this.taskService.onDidStateChange((event) => {
|
||||
if (event.kind === TaskEventKind.Changed) {
|
||||
updateStatus();
|
||||
}
|
||||
}));
|
||||
|
||||
container.appendChild(element);
|
||||
|
||||
this.updateStyles();
|
||||
updateStatus();
|
||||
|
||||
return {
|
||||
dispose: () => {
|
||||
callOnDispose = dispose(callOnDispose);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
workbenchRegistry.registerWorkbenchContribution(TaskStatusBarContributions, LifecyclePhase.Restored);
|
||||
|
||||
class ProblemReporter implements TaskConfig.IProblemReporter {
|
||||
|
||||
|
@ -488,7 +416,8 @@ class TaskService extends Disposable implements ITaskService {
|
|||
@IDialogService private readonly dialogService: IDialogService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService
|
||||
) {
|
||||
super();
|
||||
|
||||
|
@ -623,6 +552,15 @@ class TaskService extends Disposable implements ITaskService {
|
|||
CommandsRegistry.registerCommand('workbench.action.tasks.showTasks', () => {
|
||||
this.runShowTasks();
|
||||
});
|
||||
|
||||
CommandsRegistry.registerCommand('workbench.action.tasks.toggleProblems', () => {
|
||||
const panel = this.panelService.getActivePanel();
|
||||
if (panel && panel.getId() === Constants.MARKERS_PANEL_ID) {
|
||||
this.layoutService.setPanelHidden(true);
|
||||
} else {
|
||||
this.panelService.openPanel(Constants.MARKERS_PANEL_ID, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private get workspaceFolders(): IWorkspaceFolder[] {
|
||||
|
@ -1358,7 +1296,7 @@ class TaskService extends Disposable implements ITaskService {
|
|||
this._taskSystem = new TerminalTaskSystem(
|
||||
this.terminalService, this.outputService, this.panelService, this.markerService,
|
||||
this.modelService, this.configurationResolverService, this.telemetryService,
|
||||
this.contextService, this._environmentService,
|
||||
this.contextService, this.environmentService,
|
||||
TaskService.OutputChannelId,
|
||||
(workspaceFolder: IWorkspaceFolder) => {
|
||||
if (!workspaceFolder) {
|
||||
|
@ -2705,11 +2643,6 @@ quickOpenRegistry.registerQuickOpenHandler(
|
|||
const actionBarRegistry = Registry.as<IActionBarRegistry>(ActionBarExtensions.Actionbar);
|
||||
actionBarRegistry.registerActionBarContributor(Scope.VIEWER, QuickOpenActionContributor);
|
||||
|
||||
// Status bar
|
||||
let statusbarRegistry = Registry.as<IStatusbarRegistry>(StatusbarExtensions.Statusbar);
|
||||
statusbarRegistry.registerStatusbarItem(new StatusbarItemDescriptor(BuildStatusBarItem, StatusbarAlignment.LEFT, 50 /* Medium Priority */));
|
||||
statusbarRegistry.registerStatusbarItem(new StatusbarItemDescriptor(TaskStatusBarItem, StatusbarAlignment.LEFT, 50 /* Medium Priority */));
|
||||
|
||||
// tasks.json validation
|
||||
let schemaId = 'vscode://schemas/tasks';
|
||||
let schema: IJSONSchema = {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as nls from 'vs/nls';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/terminalWidgetManager';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
@ -64,7 +64,7 @@ interface IPath {
|
|||
}
|
||||
|
||||
export class TerminalLinkHandler {
|
||||
private _hoverDisposables: IDisposable[] = [];
|
||||
private readonly _hoverDisposables = new DisposableStore();
|
||||
private _mouseMoveDisposable: IDisposable;
|
||||
private _widgetManager: TerminalWidgetManager;
|
||||
private _processCwd: string;
|
||||
|
@ -177,7 +177,8 @@ export class TerminalLinkHandler {
|
|||
|
||||
public dispose(): void {
|
||||
this._xterm = null;
|
||||
this._hoverDisposables = dispose(this._hoverDisposables);
|
||||
|
||||
this._hoverDisposables.dispose();
|
||||
this._mouseMoveDisposable = dispose(this._mouseMoveDisposable);
|
||||
}
|
||||
|
||||
|
|
|
@ -308,10 +308,10 @@ export class WebviewEditor extends BaseEditor {
|
|||
|
||||
// Track focus in webview content
|
||||
const webviewContentFocusTracker = DOM.trackFocus(this._webviewContent!);
|
||||
this._webviewFocusTrackerDisposables.push(webviewContentFocusTracker);
|
||||
this._webviewFocusTrackerDisposables.push(webviewContentFocusTracker.onDidFocus(() => this._onDidFocusWebview.fire()));
|
||||
this._webviewFocusTrackerDisposables.add(webviewContentFocusTracker);
|
||||
this._webviewFocusTrackerDisposables.add(webviewContentFocusTracker.onDidFocus(() => this._onDidFocusWebview.fire()));
|
||||
|
||||
// Track focus in webview element
|
||||
this._webviewFocusTrackerDisposables.push(this._webview!.onDidFocus(() => this._onDidFocusWebview.fire()));
|
||||
this._webviewFocusTrackerDisposables.add(this._webview!.onDidFocus(() => this._onDidFocusWebview.fire()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -661,6 +661,9 @@ export class WebviewElement extends Disposable implements Webview {
|
|||
}
|
||||
|
||||
public layout(): void {
|
||||
if (!this._webview) {
|
||||
return;
|
||||
}
|
||||
const contents = this._webview.getWebContents();
|
||||
if (!contents || contents.isDestroyed()) {
|
||||
return;
|
||||
|
|
|
@ -214,7 +214,7 @@ class WelcomeOverlay extends Disposable {
|
|||
}
|
||||
|
||||
private updateProblemsKey() {
|
||||
const problems = document.querySelector('.task-statusbar-item');
|
||||
const problems = document.querySelector('div[id="workbench.parts.statusbar"] .statusbar-item.left .octicon.octicon-warning');
|
||||
const key = this._overlay.querySelector('.key.problems') as HTMLElement;
|
||||
if (problems instanceof HTMLElement) {
|
||||
const target = problems.getBoundingClientRect();
|
||||
|
|
|
@ -92,13 +92,13 @@ export class WalkThroughPart extends BaseEditor {
|
|||
horizontal: ScrollbarVisibility.Auto,
|
||||
vertical: ScrollbarVisibility.Auto
|
||||
});
|
||||
this.disposables.push(this.scrollbar);
|
||||
this.disposables.add(this.scrollbar);
|
||||
container.appendChild(this.scrollbar.getDomNode());
|
||||
|
||||
this.registerFocusHandlers();
|
||||
this.registerClickHandler();
|
||||
|
||||
this.disposables.push(this.scrollbar.onScroll(e => this.updatedScrollPosition()));
|
||||
this.disposables.add(this.scrollbar.onScroll(e => this.updatedScrollPosition()));
|
||||
}
|
||||
|
||||
private updatedScrollPosition() {
|
||||
|
@ -120,16 +120,16 @@ export class WalkThroughPart extends BaseEditor {
|
|||
}
|
||||
|
||||
private registerFocusHandlers() {
|
||||
this.disposables.push(this.addEventListener(this.content, 'mousedown', e => {
|
||||
this.disposables.add(this.addEventListener(this.content, 'mousedown', e => {
|
||||
this.focus();
|
||||
}));
|
||||
this.disposables.push(this.addEventListener(this.content, 'focus', e => {
|
||||
this.disposables.add(this.addEventListener(this.content, 'focus', e => {
|
||||
this.editorFocus.set(true);
|
||||
}));
|
||||
this.disposables.push(this.addEventListener(this.content, 'blur', e => {
|
||||
this.disposables.add(this.addEventListener(this.content, 'blur', e => {
|
||||
this.editorFocus.reset();
|
||||
}));
|
||||
this.disposables.push(this.addEventListener(this.content, 'focusin', e => {
|
||||
this.disposables.add(this.addEventListener(this.content, 'focusin', e => {
|
||||
// Work around scrolling as side-effect of setting focus on the offscreen zone widget (#18929)
|
||||
if (e.target instanceof HTMLElement && e.target.classList.contains('zone-widget-container')) {
|
||||
const scrollPosition = this.scrollbar.getScrollPosition();
|
||||
|
|
|
@ -28,6 +28,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
|||
import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment';
|
||||
import { isValidBasename } from 'vs/base/common/extpath';
|
||||
import { RemoteFileDialogContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
|
||||
interface FileQuickPickItem extends IQuickPickItem {
|
||||
uri: URI;
|
||||
|
@ -60,6 +62,11 @@ export class RemoteFileDialog {
|
|||
private badPath: string | undefined;
|
||||
private remoteAgentEnvironment: IRemoteAgentEnvironment | null;
|
||||
private separator: string;
|
||||
private onBusyChangeEmitter = new Emitter<boolean>();
|
||||
|
||||
protected disposables: IDisposable[] = [
|
||||
this.onBusyChangeEmitter
|
||||
];
|
||||
|
||||
constructor(
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
|
@ -79,6 +86,17 @@ export class RemoteFileDialog {
|
|||
this.contextKey = RemoteFileDialogContext.bindTo(contextKeyService);
|
||||
}
|
||||
|
||||
set busy(busy: boolean) {
|
||||
if (this.filePickBox.busy !== busy) {
|
||||
this.filePickBox.busy = busy;
|
||||
this.onBusyChangeEmitter.fire(busy);
|
||||
}
|
||||
}
|
||||
|
||||
get busy(): boolean {
|
||||
return this.filePickBox.busy;
|
||||
}
|
||||
|
||||
public async showOpenDialog(options: IOpenDialogOptions = {}): Promise<URI | undefined> {
|
||||
this.scheme = this.getScheme(options.defaultUri, options.availableFileSystems);
|
||||
this.userHome = await this.getUserHome();
|
||||
|
@ -185,7 +203,7 @@ export class RemoteFileDialog {
|
|||
|
||||
return new Promise<URI | undefined>(async (resolve) => {
|
||||
this.filePickBox = this.quickInputService.createQuickPick<FileQuickPickItem>();
|
||||
this.filePickBox.busy = true;
|
||||
this.busy = true;
|
||||
this.filePickBox.matchOnLabel = false;
|
||||
this.filePickBox.autoFocusOnList = false;
|
||||
this.filePickBox.ignoreFocusOut = true;
|
||||
|
@ -203,7 +221,7 @@ export class RemoteFileDialog {
|
|||
}
|
||||
}
|
||||
|
||||
let isResolving = false;
|
||||
let isResolving: number = 0;
|
||||
let isAcceptHandled = false;
|
||||
this.currentFolder = homedir;
|
||||
this.userEnteredPathSegment = '';
|
||||
|
@ -218,15 +236,16 @@ export class RemoteFileDialog {
|
|||
resolve(uri);
|
||||
dialog.contextKey.set(false);
|
||||
dialog.filePickBox.dispose();
|
||||
dispose(dialog.disposables);
|
||||
}
|
||||
|
||||
this.filePickBox.onDidCustom(() => {
|
||||
if (isAcceptHandled || this.filePickBox.busy) {
|
||||
if (isAcceptHandled || this.busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
isAcceptHandled = true;
|
||||
isResolving = true;
|
||||
isResolving++;
|
||||
if (this.options.availableFileSystems && (this.options.availableFileSystems.length > 1)) {
|
||||
this.options.availableFileSystems.shift();
|
||||
}
|
||||
|
@ -243,25 +262,38 @@ export class RemoteFileDialog {
|
|||
}
|
||||
});
|
||||
|
||||
this.filePickBox.onDidAccept(_ => {
|
||||
if (isAcceptHandled || this.filePickBox.busy) {
|
||||
function handleAccept(dialog: RemoteFileDialog) {
|
||||
if (dialog.busy) {
|
||||
// Save the accept until the file picker is not busy.
|
||||
dialog.onBusyChangeEmitter.event((busy: boolean) => {
|
||||
if (!busy) {
|
||||
handleAccept(dialog);
|
||||
}
|
||||
});
|
||||
return;
|
||||
} else if (isAcceptHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
isAcceptHandled = true;
|
||||
isResolving = true;
|
||||
this.onDidAccept().then(resolveValue => {
|
||||
isResolving++;
|
||||
dialog.onDidAccept().then(resolveValue => {
|
||||
if (resolveValue) {
|
||||
this.filePickBox.hide();
|
||||
doResolve(this, resolveValue);
|
||||
} else if (this.hidden) {
|
||||
doResolve(this, undefined);
|
||||
dialog.filePickBox.hide();
|
||||
doResolve(dialog, resolveValue);
|
||||
} else if (dialog.hidden) {
|
||||
doResolve(dialog, undefined);
|
||||
} else {
|
||||
isResolving = false;
|
||||
isResolving--;
|
||||
isAcceptHandled = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.filePickBox.onDidAccept(_ => {
|
||||
handleAccept(this);
|
||||
});
|
||||
|
||||
this.filePickBox.onDidChangeActive(i => {
|
||||
isAcceptHandled = false;
|
||||
// update input box to match the first selected item
|
||||
|
@ -296,7 +328,7 @@ export class RemoteFileDialog {
|
|||
});
|
||||
this.filePickBox.onDidHide(() => {
|
||||
this.hidden = true;
|
||||
if (!isResolving) {
|
||||
if (isResolving === 0) {
|
||||
doResolve(this, undefined);
|
||||
}
|
||||
});
|
||||
|
@ -309,7 +341,7 @@ export class RemoteFileDialog {
|
|||
} else {
|
||||
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
||||
}
|
||||
this.filePickBox.busy = false;
|
||||
this.busy = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -340,14 +372,15 @@ export class RemoteFileDialog {
|
|||
const relativePath = resources.relativePath(currentDisplayUri, directUri);
|
||||
const isSameRoot = (this.filePickBox.value.length > 1 && currentPath.length > 1) ? equalsIgnoreCase(this.filePickBox.value.substr(0, 2), currentPath.substr(0, 2)) : false;
|
||||
if (relativePath && isSameRoot) {
|
||||
return resources.joinPath(this.currentFolder, relativePath);
|
||||
const path = resources.joinPath(this.currentFolder, relativePath);
|
||||
return resources.hasTrailingPathSeparator(directUri) ? resources.addTrailingPathSeparator(path) : path;
|
||||
} else {
|
||||
return directUri;
|
||||
}
|
||||
}
|
||||
|
||||
private async onDidAccept(): Promise<URI | undefined> {
|
||||
this.filePickBox.busy = true;
|
||||
this.busy = true;
|
||||
if (this.filePickBox.activeItems.length === 1) {
|
||||
const item = this.filePickBox.selectedItems[0];
|
||||
if (item.isFolder) {
|
||||
|
@ -357,10 +390,9 @@ export class RemoteFileDialog {
|
|||
// When possible, cause the update to happen by modifying the input box.
|
||||
// This allows all input box updates to happen first, and uses the same code path as the user typing.
|
||||
const newPath = this.pathFromUri(item.uri);
|
||||
if (startsWithIgnoreCase(newPath, this.filePickBox.value)) {
|
||||
const insertValue = newPath.substring(this.filePickBox.value.length, newPath.length);
|
||||
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
||||
this.insertText(newPath, insertValue);
|
||||
if (startsWithIgnoreCase(newPath, this.filePickBox.value) && (equalsIgnoreCase(item.label, resources.basename(item.uri)))) {
|
||||
this.filePickBox.valueSelection = [this.pathFromUri(this.currentFolder).length, this.filePickBox.value.length];
|
||||
this.insertText(newPath, item.label);
|
||||
} else if ((item.label === '..') && startsWithIgnoreCase(this.filePickBox.value, newPath)) {
|
||||
this.filePickBox.valueSelection = [newPath.length, this.filePickBox.value.length];
|
||||
this.insertText(newPath, '');
|
||||
|
@ -368,11 +400,13 @@ export class RemoteFileDialog {
|
|||
await this.updateItems(item.uri, true);
|
||||
}
|
||||
}
|
||||
this.filePickBox.busy = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// If the items have updated, don't try to resolve
|
||||
if ((await this.tryUpdateItems(this.filePickBox.value, this.filePickBoxValue())) !== UpdateResult.NotUpdated) {
|
||||
this.filePickBox.busy = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -388,10 +422,10 @@ export class RemoteFileDialog {
|
|||
resolveValue = this.addPostfix(resolveValue);
|
||||
}
|
||||
if (await this.validate(resolveValue)) {
|
||||
this.filePickBox.busy = false;
|
||||
this.busy = false;
|
||||
return resolveValue;
|
||||
}
|
||||
this.filePickBox.busy = false;
|
||||
this.busy = false;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
@ -470,7 +504,7 @@ export class RemoteFileDialog {
|
|||
}
|
||||
|
||||
private setAutoComplete(startingValue: string, startingBasename: string, quickPickItem: FileQuickPickItem, force: boolean = false): boolean {
|
||||
if (this.filePickBox.busy) {
|
||||
if (this.busy) {
|
||||
// We're in the middle of something else. Doing an auto complete now can result jumbled or incorrect autocompletes.
|
||||
this.userEnteredPathSegment = startingBasename;
|
||||
this.autoCompletePathSegment = '';
|
||||
|
@ -638,7 +672,7 @@ export class RemoteFileDialog {
|
|||
}
|
||||
|
||||
private async updateItems(newFolder: URI, force: boolean = false, trailing?: string) {
|
||||
this.filePickBox.busy = true;
|
||||
this.busy = true;
|
||||
this.userEnteredPathSegment = trailing ? trailing : '';
|
||||
this.autoCompletePathSegment = '';
|
||||
const newValue = trailing ? this.pathFromUri(resources.joinPath(newFolder, trailing)) : this.pathFromUri(newFolder, true);
|
||||
|
@ -660,7 +694,7 @@ export class RemoteFileDialog {
|
|||
// If there is trailing, we don't move the cursor. If there is no trailing, cursor goes at the end.
|
||||
this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length];
|
||||
}
|
||||
this.filePickBox.busy = false;
|
||||
this.busy = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -91,15 +91,15 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
|||
this._extensionHostConnection = null;
|
||||
this._messageProtocol = null;
|
||||
|
||||
this._toDispose.push(this._onExit);
|
||||
this._toDispose.push(this._lifecycleService.onWillShutdown(e => this._onWillShutdown(e)));
|
||||
this._toDispose.push(this._lifecycleService.onShutdown(reason => this.terminate()));
|
||||
this._toDispose.push(this._extensionHostDebugService.onClose(event => {
|
||||
this._toDispose.add(this._onExit);
|
||||
this._toDispose.add(this._lifecycleService.onWillShutdown(e => this._onWillShutdown(e)));
|
||||
this._toDispose.add(this._lifecycleService.onShutdown(reason => this.terminate()));
|
||||
this._toDispose.add(this._extensionHostDebugService.onClose(event => {
|
||||
if (this._isExtensionDevHost && this._environmentService.debugExtensionHost.debugId === event.sessionId) {
|
||||
this._windowService.closeWindow();
|
||||
}
|
||||
}));
|
||||
this._toDispose.push(this._extensionHostDebugService.onReload(event => {
|
||||
this._toDispose.add(this._extensionHostDebugService.onReload(event => {
|
||||
if (this._isExtensionDevHost && this._environmentService.debugExtensionHost.debugId === event.sessionId) {
|
||||
this._windowService.reloadWindow();
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
|
|||
|
||||
const globalExitListener = () => this.terminate();
|
||||
process.once('exit', globalExitListener);
|
||||
this._toDispose.push(toDisposable(() => {
|
||||
this._toDispose.add(toDisposable(() => {
|
||||
process.removeListener('exit', globalExitListener);
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -481,7 +481,14 @@ function readWindowsCaCertificates() {
|
|||
}
|
||||
|
||||
async function readMacCaCertificates() {
|
||||
const stdout = (await promisify(cp.execFile)('/usr/bin/security', ['find-certificate', '-a', '-p'], { encoding: 'utf8', maxBuffer: 1024 * 1024 })).stdout;
|
||||
const stdout = await new Promise<string>((resolve, reject) => {
|
||||
const child = cp.spawn('/usr/bin/security', ['find-certificate', '-a', '-p']);
|
||||
const stdout: string[] = [];
|
||||
child.stdout.setEncoding('utf8');
|
||||
child.stdout.on('data', str => stdout.push(str));
|
||||
child.on('error', reject);
|
||||
child.on('exit', code => code ? reject(code) : resolve(stdout.join('')));
|
||||
});
|
||||
const seen = {};
|
||||
const certs = stdout.split(/(?=-----BEGIN CERTIFICATE-----)/g)
|
||||
.filter(pem => !!pem.length && !seen[pem] && (seen[pem] = true));
|
||||
|
|
|
@ -131,15 +131,15 @@ suite('Disk File Service', () => {
|
|||
const logService = new NullLogService();
|
||||
|
||||
service = new FileService(logService);
|
||||
disposables.push(service);
|
||||
disposables.add(service);
|
||||
|
||||
fileProvider = new TestDiskFileSystemProvider(logService);
|
||||
disposables.push(service.registerProvider(Schemas.file, fileProvider));
|
||||
disposables.push(fileProvider);
|
||||
disposables.add(service.registerProvider(Schemas.file, fileProvider));
|
||||
disposables.add(fileProvider);
|
||||
|
||||
testProvider = new TestDiskFileSystemProvider(logService);
|
||||
disposables.push(service.registerProvider(testSchema, testProvider));
|
||||
disposables.push(testProvider);
|
||||
disposables.add(service.registerProvider(testSchema, testProvider));
|
||||
disposables.add(testProvider);
|
||||
|
||||
const id = generateUuid();
|
||||
testDir = join(parentDir, id);
|
||||
|
@ -156,7 +156,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('createFolder', async () => {
|
||||
let event: FileOperationEvent | undefined;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const parent = await service.resolve(URI.file(testDir));
|
||||
|
||||
|
@ -176,7 +176,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('createFolder: creating multiple folders at once', async function () {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const multiFolderPaths = ['a', 'couple', 'of', 'folders'];
|
||||
const parent = await service.resolve(URI.file(testDir));
|
||||
|
@ -411,7 +411,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('deleteFile', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const resource = URI.file(join(testDir, 'deep', 'conway.js'));
|
||||
const source = await service.resolve(resource);
|
||||
|
@ -426,7 +426,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('deleteFolder (recursive)', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const resource = URI.file(join(testDir, 'deep'));
|
||||
const source = await service.resolve(resource);
|
||||
|
@ -453,7 +453,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = URI.file(join(testDir, 'index.html'));
|
||||
const sourceContents = readFileSync(source.fsPath);
|
||||
|
@ -533,7 +533,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
async function testMoveAcrossProviders(sourceFile = 'index.html'): Promise<void> {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = URI.file(join(testDir, sourceFile));
|
||||
const sourceContents = readFileSync(source.fsPath);
|
||||
|
@ -557,7 +557,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move - multi folder', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const multiFolderPaths = ['a', 'couple', 'of', 'folders'];
|
||||
const renameToPath = join(...multiFolderPaths, 'other.html');
|
||||
|
@ -576,7 +576,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move - directory', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = URI.file(join(testDir, 'deep'));
|
||||
|
||||
|
@ -620,7 +620,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
async function testMoveFolderAcrossProviders(): Promise<void> {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = URI.file(join(testDir, 'deep'));
|
||||
const sourceChildren = readdirSync(source.fsPath);
|
||||
|
@ -645,7 +645,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move - MIX CASE', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = URI.file(join(testDir, 'index.html'));
|
||||
await service.resolve(source);
|
||||
|
@ -662,7 +662,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move - source parent of target', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
await service.resolve(URI.file(join(testDir, 'index.html')));
|
||||
try {
|
||||
|
@ -675,7 +675,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('move - FILE_MOVE_CONFLICT', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = await service.resolve(URI.file(join(testDir, 'index.html')));
|
||||
try {
|
||||
|
@ -690,7 +690,7 @@ suite('Disk File Service', () => {
|
|||
let createEvent: FileOperationEvent;
|
||||
let moveEvent: FileOperationEvent;
|
||||
let deleteEvent: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => {
|
||||
disposables.add(service.onAfterOperation(e => {
|
||||
if (e.operation === FileOperation.CREATE) {
|
||||
createEvent = e;
|
||||
} else if (e.operation === FileOperation.DELETE) {
|
||||
|
@ -754,7 +754,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
async function doTestCopy(sourceName: string = 'index.html') {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const source = await service.resolve(URI.file(join(testDir, sourceName)));
|
||||
const target = URI.file(join(testDir, 'other.html'));
|
||||
|
@ -779,7 +779,7 @@ suite('Disk File Service', () => {
|
|||
let createEvent: FileOperationEvent;
|
||||
let copyEvent: FileOperationEvent;
|
||||
let deleteEvent: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => {
|
||||
disposables.add(service.onAfterOperation(e => {
|
||||
if (e.operation === FileOperation.CREATE) {
|
||||
createEvent = e;
|
||||
} else if (e.operation === FileOperation.DELETE) {
|
||||
|
@ -1168,7 +1168,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('createFile', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const contents = 'Hello World';
|
||||
const resource = URI.file(join(testDir, 'test.txt'));
|
||||
|
@ -1199,7 +1199,7 @@ suite('Disk File Service', () => {
|
|||
|
||||
test('createFile (allows to overwrite existing)', async () => {
|
||||
let event: FileOperationEvent;
|
||||
disposables.push(service.onAfterOperation(e => event = e));
|
||||
disposables.add(service.onAfterOperation(e => event = e));
|
||||
|
||||
const contents = 'Hello World';
|
||||
const resource = URI.file(join(testDir, 'test.txt'));
|
||||
|
|
|
@ -76,7 +76,7 @@ export class NotificationService extends Disposable implements INotificationServ
|
|||
}
|
||||
|
||||
// React to action being clicked
|
||||
toDispose.push(action.onDidRun(() => {
|
||||
toDispose.add(action.onDidRun(() => {
|
||||
choiceClicked = true;
|
||||
|
||||
// Close notification unless we are told to keep open
|
||||
|
@ -85,7 +85,7 @@ export class NotificationService extends Disposable implements INotificationServ
|
|||
}
|
||||
}));
|
||||
|
||||
toDispose.push(action);
|
||||
toDispose.add(action);
|
||||
});
|
||||
|
||||
// Show notification with actions
|
||||
|
|
|
@ -158,7 +158,7 @@ export class ProgressService implements IProgressService {
|
|||
return Promise.resolve(undefined);
|
||||
}
|
||||
};
|
||||
toDispose.push(cancelAction);
|
||||
toDispose.add(cancelAction);
|
||||
|
||||
actions.primary!.push(cancelAction);
|
||||
}
|
||||
|
@ -302,8 +302,8 @@ export class ProgressService implements IProgressService {
|
|||
}
|
||||
);
|
||||
|
||||
disposables.push(dialog);
|
||||
disposables.push(attachDialogStyler(dialog, this._themeService));
|
||||
disposables.add(dialog);
|
||||
disposables.add(attachDialogStyler(dialog, this._themeService));
|
||||
|
||||
dialog.show().then(() => {
|
||||
if (typeof onDidCancel === 'function') {
|
||||
|
|
|
@ -17,7 +17,7 @@ import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
|||
import { Schemas } from 'vs/base/common/network';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { rimraf, RimRafMode, copy, readFile, exists } from 'vs/base/node/pfs';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { FileService } from 'vs/workbench/services/files/common/fileService';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
|
@ -76,7 +76,7 @@ suite('Files - TextFileService i/o', () => {
|
|||
const parentDir = getRandomTestPath(tmpdir(), 'vsctests', 'textfileservice');
|
||||
|
||||
let accessor: ServiceAccessor;
|
||||
let disposables: IDisposable[] = [];
|
||||
const disposables = new DisposableStore();
|
||||
let service: ITextFileService;
|
||||
let testDir: string;
|
||||
|
||||
|
@ -88,8 +88,8 @@ suite('Files - TextFileService i/o', () => {
|
|||
const fileService = new FileService(logService);
|
||||
|
||||
const fileProvider = new DiskFileSystemProvider(logService);
|
||||
disposables.push(fileService.registerProvider(Schemas.file, fileProvider));
|
||||
disposables.push(fileProvider);
|
||||
disposables.add(fileService.registerProvider(Schemas.file, fileProvider));
|
||||
disposables.add(fileProvider);
|
||||
|
||||
const collection = new ServiceCollection();
|
||||
collection.set(IFileService, fileService);
|
||||
|
@ -108,7 +108,7 @@ suite('Files - TextFileService i/o', () => {
|
|||
(<TextFileEditorModelManager>accessor.textFileService.models).dispose();
|
||||
accessor.untitledEditorService.revertAll();
|
||||
|
||||
disposables = dispose(disposables);
|
||||
disposables.clear();
|
||||
|
||||
await rimraf(parentDir, RimRafMode.MOVE);
|
||||
});
|
||||
|
|
|
@ -270,7 +270,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
|
|||
if (devThemes.length) {
|
||||
return this.setFileIconTheme(devThemes[0].id, ConfigurationTarget.MEMORY);
|
||||
} else {
|
||||
return this.setFileIconTheme(theme && theme.id || DEFAULT_ICON_THEME_ID, undefined);
|
||||
return this.setFileIconTheme(theme ? theme.id : DEFAULT_ICON_THEME_ID, undefined);
|
||||
}
|
||||
});
|
||||
}),
|
||||
|
@ -293,7 +293,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
|
|||
let iconThemeSetting = this.configurationService.getValue<string | null>(ICON_THEME_SETTING);
|
||||
if (iconThemeSetting !== this.currentIconTheme.settingsId) {
|
||||
this.iconThemeStore.findThemeBySettingsId(iconThemeSetting).then(theme => {
|
||||
this.setFileIconTheme(theme && theme.id || DEFAULT_ICON_THEME_ID, undefined);
|
||||
this.setFileIconTheme(theme ? theme.id : DEFAULT_ICON_THEME_ID, undefined);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ export interface IMemoryInfo {
|
|||
"version" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"ellapsed" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true },
|
||||
"isLatestVersion": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"isRemoteWindow": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"didUseCachedData": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"windowKind": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"windowCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
|
@ -97,6 +98,11 @@ export interface IStartupMetrics {
|
|||
*/
|
||||
readonly isLatestVersion: boolean;
|
||||
|
||||
/**
|
||||
* Whether this window talks to a remote endpoint.
|
||||
*/
|
||||
readonly isRemoteWindow: boolean;
|
||||
|
||||
/**
|
||||
* Whether we asked for and V8 accepted cached data.
|
||||
*/
|
||||
|
@ -379,6 +385,7 @@ class TimerService implements ITimerService {
|
|||
|
||||
// reflections
|
||||
isLatestVersion: Boolean(await this._updateService.isLatestVersion()),
|
||||
isRemoteWindow: Boolean(this._environmentService.configuration.remoteAuthority),
|
||||
didUseCachedData: didUseCachedData(),
|
||||
windowKind: this._lifecycleService.startupKind,
|
||||
windowCount: await this._windowsService.getWindowCount(),
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||
import { mapArrayOrNot } from 'vs/base/common/arrays';
|
||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import { isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { joinPath } from 'vs/base/common/resources';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
|
@ -21,7 +21,7 @@ import * as vscode from 'vscode';
|
|||
|
||||
let rpcProtocol: TestRPCProtocol;
|
||||
let extHostSearch: ExtHostSearch;
|
||||
let disposables: vscode.Disposable[] = [];
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
let mockMainThreadSearch: MockMainThreadSearch;
|
||||
class MockMainThreadSearch implements MainThreadSearchShape {
|
||||
|
@ -63,12 +63,12 @@ export function extensionResultIsMatch(data: vscode.TextSearchResult): data is v
|
|||
|
||||
suite('ExtHostSearch', () => {
|
||||
async function registerTestTextSearchProvider(provider: vscode.TextSearchProvider, scheme = 'file'): Promise<void> {
|
||||
disposables.push(extHostSearch.registerTextSearchProvider(scheme, provider));
|
||||
disposables.add(extHostSearch.registerTextSearchProvider(scheme, provider));
|
||||
await rpcProtocol.sync();
|
||||
}
|
||||
|
||||
async function registerTestFileSearchProvider(provider: vscode.FileSearchProvider, scheme = 'file'): Promise<void> {
|
||||
disposables.push(extHostSearch.registerFileSearchProvider(scheme, provider));
|
||||
disposables.add(extHostSearch.registerFileSearchProvider(scheme, provider));
|
||||
await rpcProtocol.sync();
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ suite('ExtHostSearch', () => {
|
|||
});
|
||||
|
||||
teardown(() => {
|
||||
dispose(disposables);
|
||||
disposables.clear();
|
||||
return rpcProtocol.sync();
|
||||
});
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ suite('ExtHostTypes', function () {
|
|||
scheme: 'file',
|
||||
path: '/path/test.file',
|
||||
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
|
||||
_sep: isWindows ? 1 : undefined,
|
||||
});
|
||||
|
||||
assert.ok(uri.toString());
|
||||
|
@ -39,6 +40,7 @@ suite('ExtHostTypes', function () {
|
|||
scheme: 'file',
|
||||
path: '/path/test.file',
|
||||
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
|
||||
_sep: isWindows ? 1 : undefined,
|
||||
external: 'file:///path/test.file'
|
||||
});
|
||||
});
|
||||
|
|
|
@ -48,7 +48,7 @@ export class StatusBar {
|
|||
case StatusBarElement.SYNC_STATUS:
|
||||
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-sync`;
|
||||
case StatusBarElement.PROBLEMS_STATUS:
|
||||
return `${this.mainSelector} ${this.leftSelector} .task-statusbar-item[title="Problems"]`;
|
||||
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-error`;
|
||||
case StatusBarElement.SELECTION_STATUS:
|
||||
return `${this.mainSelector} ${this.rightSelector} .editor-status-selection`;
|
||||
case StatusBarElement.INDENTATION_STATUS:
|
||||
|
|
16
yarn.lock
16
yarn.lock
|
@ -9560,10 +9560,10 @@ vscode-chokidar@1.6.5:
|
|||
optionalDependencies:
|
||||
vscode-fsevents "0.3.10"
|
||||
|
||||
vscode-debugprotocol@1.34.0:
|
||||
version "1.34.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.34.0.tgz#aef63274166ccbc6d1d68e68c7d7f6d013802f08"
|
||||
integrity sha512-tcMThtgk9TUtE8zzAIwPvHZfgnEYnVa7cI3YaQk/o54Q9cme+TLd/ao60a6ycj5rCrI/B5r/mAfeK5EKSItm7g==
|
||||
vscode-debugprotocol@1.35.0:
|
||||
version "1.35.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-debugprotocol/-/vscode-debugprotocol-1.35.0.tgz#565140cd42945e30c6c85cafb38c631457d4a46c"
|
||||
integrity sha512-+OMm11R1bGYbpIJ5eQIkwoDGFF4GvBz3Ztl6/VM+/RNNb2Gjk2c0Ku+oMmfhlTmTlPCpgHBsH4JqVCbUYhu5bA==
|
||||
|
||||
vscode-fsevents@0.3.10:
|
||||
version "0.3.10"
|
||||
|
@ -9643,10 +9643,10 @@ vscode-windows-registry@1.0.1:
|
|||
dependencies:
|
||||
nan "^2.12.1"
|
||||
|
||||
vscode-xterm@3.14.0-beta5:
|
||||
version "3.14.0-beta5"
|
||||
resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.14.0-beta5.tgz#53817b035c3dc786efd82f231caa1bdabab7f06f"
|
||||
integrity sha512-gluTw/GjnOAf2EQ+WqFLjmgSe7P7c1HRmJedkC0uvHaMAOsLeSw3G9UrMkIejN4bTWEfKrAOLYG2hOTVd8ejaw==
|
||||
vscode-xterm@3.14.0-beta6:
|
||||
version "3.14.0-beta6"
|
||||
resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.14.0-beta6.tgz#657f5f68d73c53298b53f912a0dea178445c1c54"
|
||||
integrity sha512-4E9ioj78LRZbMruEmxrDDSOeoPt3GX87MkY2HaPIT+PNIWNxCRiTCFDwbwXSWLzZdYLBNV6QEqLtnel5w8+1rA==
|
||||
|
||||
vso-node-api@6.1.2-preview:
|
||||
version "6.1.2-preview"
|
||||
|
|
Loading…
Reference in a new issue