Merge remote-tracking branch 'origin/master' into notebook/outputs

This commit is contained in:
rebornix 2021-02-09 09:27:49 -08:00
commit 11b885de68
188 changed files with 6070 additions and 1091 deletions

View file

@ -4,11 +4,11 @@ about: Create a report to help us improve
---
<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version:
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
- VS Code Version:
- OS Version:
Steps to Reproduce:
@ -16,5 +16,8 @@ Steps to Reproduce:
1.
2.
<!-- Launch with `code --disable-extensions` to check. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No
<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported direct to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->

View file

@ -1,3 +1,3 @@
disturl "https://electronjs.org/headers"
target "11.2.2"
target "11.2.3"
runtime "electron"

View file

@ -60,12 +60,12 @@
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "805e442ff873e10735a1ea18021f491597afa885"
"commitHash": "137f45750f7319442c511183c0ad0f3c4fe7e07a"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "11.2.2"
"version": "11.2.3"
},
{
"component": {

View file

@ -9,7 +9,7 @@
"vscode": "^1.52.0"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater mmims/language-batchfile grammars/batchfile.cson ./syntaxes/batchfile.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin mmims/language-batchfile grammars/batchfile.cson ./syntaxes/batchfile.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-clojure grammars/clojure.cson ./syntaxes/clojure.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-clojure grammars/clojure.cson ./syntaxes/clojure.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-coffee-script grammars/coffeescript.cson ./syntaxes/coffeescript.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-coffee-script grammars/coffeescript.cson ./syntaxes/coffeescript.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -19,6 +19,63 @@
"type": "integer"
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
}
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"settings": {
"$ref": "vscode://schemas/settings/machine",
"description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time."

View file

@ -127,6 +127,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -326,6 +384,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -501,6 +617,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -642,6 +816,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -752,6 +984,64 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
},
"additionalProperties": false
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {

View file

@ -33,6 +33,63 @@
"minimum": 0
}
},
"portsAttributes": {
"type": "object",
"patternProperties": {
"^\\d+(\\-\\d+)?$": {
"type": "object",
"description": "A port, or range of ports (ex. \"40000-55000\") that the attributes should apply to",
"properties": {
"onAutoForward": {
"type": "string",
"enum": [
"notify",
"openBrowser",
"openPreview",
"silent",
"ignore"
],
"enumDescriptions": [
"Shows a notification when a port is automatically forwarded.",
"Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
"Opens a preview in the same window when the port is automatically forwarded.",
"Shows no notification and takes no action when this port is automatically forwarded.",
"This port will not be automatically forwarded."
],
"description": "Defines the action that occurs when the port is discovered for automatic forwarding",
"default": "notify"
},
"elevateIfNeeded": {
"type": "boolean",
"description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
"default": false
},
"label": {
"type": "string",
"description": "Label that will be shown in the UI for this port.",
"default": "Labeled Port"
}
},
"default": {
"label": "Labeled Port",
"onAutoForward": "notify"
}
}
},
"markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n}\n```",
"defaultSnippets": [
{
"body": {
"${1:3000}": {
"label": "${2:My Port}",
"onAutoForward": "notify"
}
}
}
],
"errorMessage": "Must be a port number or a range of port numbers",
"additionalProperties": false
},
"remoteEnv": {
"type": "object",
"additionalProperties": {
@ -205,7 +262,7 @@
"$ref": "#/definitions/buildOptions"
}
]
}
}
},
"required": [
"build"

View file

@ -9,7 +9,7 @@
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater dotnet/csharp-tmLanguage grammars/csharp.tmLanguage ./syntaxes/csharp.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin dotnet/csharp-tmLanguage grammars/csharp.tmLanguage ./syntaxes/csharp.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater octref/language-css grammars/css.cson ./syntaxes/css.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin octref/language-css grammars/css.cson ./syntaxes/css.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater moby/moby contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin moby/moby contrib/syntax/textmate/Docker.tmbundle/Syntaxes/Dockerfile.tmLanguage ./syntaxes/docker.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater ionide/ionide-fsgrammar grammars/fsharp.json ./syntaxes/fsharp.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin ionide/ionide-fsgrammar grammars/fsharp.json ./syntaxes/fsharp.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater jeff-hykin/better-go-syntax export/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin jeff-hykin/better-go-syntax export/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/groovy.tmbundle Syntaxes/Groovy.tmLanguage ./syntaxes/groovy.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/groovy.tmbundle Syntaxes/Groovy.tmLanguage ./syntaxes/groovy.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater daaain/Handlebars grammars/Handlebars.json ./syntaxes/Handlebars.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin daaain/Handlebars grammars/Handlebars.json ./syntaxes/Handlebars.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater tgjones/shaders-tmLanguage grammars/hlsl.json ./syntaxes/hlsl.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin tgjones/shaders-tmLanguage grammars/hlsl.json ./syntaxes/hlsl.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/ini.tmbundle Syntaxes/Ini.plist ./syntaxes/ini.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/ini.tmbundle Syntaxes/Ini.plist ./syntaxes/ini.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-java grammars/java.cson ./syntaxes/java.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-java grammars/java.cson ./syntaxes/java.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -0,0 +1,2 @@
build/**
cgmanifest.json

View file

@ -0,0 +1,17 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": " JuliaEditorSupport/atom-language-julia",
"repositoryUrl": "https://github.com/JuliaEditorSupport/atom-language-julia",
"commitHash": "8ae8d9cac742c65ae0bef1a5e2d068e2cae871bc"
}
},
"license": "MIT",
"version": "0.21.0"
}
],
"version": 1
}

View file

@ -0,0 +1,31 @@
{
"comments": {
"lineComment": "#",
"blockComment": [ "#=", "=#" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["`", "`"],
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["`", "`"]
],
"folding": {
"markers": {
"start": "^\\s*#region",
"end": "^\\s*#endregion"
}
}
}

View file

@ -0,0 +1,54 @@
{
"name": "julia",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater JuliaEditorSupport/atom-language-julia grammars/julia_vscode.json ./syntaxes/julia.tmLanguage.json"
},
"contributes": {
"languages": [
{
"id": "julia",
"aliases": [
"Julia",
"julia"
],
"extensions": [
".jl"
],
"firstLine": "^#!\\s*/.*\\bjulia[0-9.-]*\\b",
"configuration": "./language-configuration.json"
},
{
"id": "juliamarkdown",
"aliases": [
"Julia Markdown",
"juliamarkdown"
],
"extensions": [
".jmd"
]
}
],
"grammars": [
{
"language": "julia",
"scopeName": "source.julia",
"path": "./syntaxes/julia.tmLanguage.json",
"embeddedLanguages": {
"meta.embedded.inline.cpp": "cpp",
"meta.embedded.inline.javascript": "javascript",
"meta.embedded.inline.python": "python",
"meta.embedded.inline.r": "r",
"meta.embedded.inline.sql": "sql"
}
}
]
}
}

View file

@ -0,0 +1,4 @@
{
"displayName": "Julia Language Basics",
"description": "Provides syntax highlighting & bracket matching in Julia files."
}

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-less grammars/less.cson ./syntaxes/less.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-less grammars/less.cson ./syntaxes/less.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater emilast/vscode-logfile-highlighter syntaxes/log.tmLanguage ./syntaxes/log.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin emilast/vscode-logfile-highlighter syntaxes/log.tmLanguage ./syntaxes/log.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/lua.tmbundle Syntaxes/Lua.plist ./syntaxes/lua.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/lua.tmbundle Syntaxes/Lua.plist ./syntaxes/lua.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater fadeevab/make.tmbundle Syntaxes/Makefile.plist ./syntaxes/make.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin fadeevab/make.tmbundle Syntaxes/Makefile.plist ./syntaxes/make.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -90,7 +90,7 @@
]
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater microsoft/vscode-markdown-tm-grammar syntaxes/markdown.tmLanguage ./syntaxes/markdown.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin microsoft/vscode-markdown-tm-grammar syntaxes/markdown.tmLanguage ./syntaxes/markdown.tmLanguage.json"
},
"repository": {
"type": "git",

View file

@ -58,7 +58,7 @@ export class MergeConflictParser {
currentConflict.commonAncestors.push(line);
}
// Are we within a conflict block and is this a splitter? =======
else if (currentConflict && !currentConflict.splitter && line.text.startsWith(splitterMarker)) {
else if (currentConflict && !currentConflict.splitter && line.text === splitterMarker) {
currentConflict.splitter = line;
}
// Are we within a conflict block and is this a footer? >>>>>>>

View file

@ -10,6 +10,6 @@
"postinstall": "node ./postinstall"
},
"devDependencies": {
"vscode-grammar-updater": "^1.0.2"
"vscode-grammar-updater": "^1.0.3"
}
}

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/perl.tmbundle Syntaxes/Perl.plist ./syntaxes/perl.tmLanguage.json Syntaxes/Perl%206.tmLanguage ./syntaxes/perl6.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/perl.tmbundle Syntaxes/Perl.plist ./syntaxes/perl.tmLanguage.json Syntaxes/Perl%206.tmLanguage ./syntaxes/perl6.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -44,7 +44,7 @@
]
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater PowerShell/EditorSyntax PowerShellSyntax.tmLanguage ./syntaxes/powershell.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin PowerShell/EditorSyntax PowerShellSyntax.tmLanguage ./syntaxes/powershell.tmLanguage.json"
},
"repository": {
"type": "git",

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater davidrios/pug-tmbundle Syntaxes/Pug.JSON-tmLanguage ./syntaxes/pug.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin davidrios/pug-tmbundle Syntaxes/Pug.JSON-tmLanguage ./syntaxes/pug.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -53,7 +53,7 @@
]
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater MagicStack/MagicPython grammars/MagicPython.tmLanguage ./syntaxes/MagicPython.tmLanguage.json grammars/MagicRegExp.tmLanguage ./syntaxes/MagicRegExp.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin MagicStack/MagicPython grammars/MagicPython.tmLanguage ./syntaxes/MagicPython.tmLanguage.json grammars/MagicRegExp.tmLanguage ./syntaxes/MagicRegExp.tmLanguage.json"
},
"repository": {
"type": "git",

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater Ikuyadeu/vscode-R syntax/r.json ./syntaxes/r.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin Ikuyadeu/vscode-R syntax/r.json ./syntaxes/r.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "0.10.x"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater demyte/language-cshtml grammars/cshtml.json ./syntaxes/cshtml.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin demyte/language-cshtml grammars/cshtml.json ./syntaxes/cshtml.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/ruby.tmbundle Syntaxes/Ruby.plist ./syntaxes/ruby.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/ruby.tmbundle Syntaxes/Ruby.plist ./syntaxes/ruby.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater dustypomerleau/rust-syntax syntaxes/rust.tmLanguage.json ./syntaxes/rust.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin dustypomerleau/rust-syntax syntaxes/rust.tmLanguage.json ./syntaxes/rust.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-sass grammars/scss.cson ./syntaxes/scss.tmLanguage.json grammars/sassdoc.cson ./syntaxes/sassdoc.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-sass grammars/scss.cson ./syntaxes/scss.tmLanguage.json grammars/sassdoc.cson ./syntaxes/sassdoc.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -22,6 +22,7 @@ const mappings = [
['html', 'text.html.basic'],
['ini', 'source.ini'],
['java', 'source.java'],
['jl', 'source.julia'],
['js', 'source.js'],
['json', 'source.json.comments'],
['jsx', 'source.js.jsx'],

View file

@ -141,6 +141,9 @@
{
"include": "#java"
},
{
"include": "#jl"
},
{
"include": "#js"
},
@ -2076,6 +2079,92 @@
}
]
},
"jl": {
"name": "meta.resultBlock.search",
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.jl)(:)$",
"end": "^(?!\\s)",
"beginCaptures": {
"0": {
"name": "string meta.path.search"
},
"1": {
"name": "meta.path.dirname.search"
},
"2": {
"name": "meta.path.basename.search"
},
"3": {
"name": "punctuation.separator"
}
},
"patterns": [
{
"name": "meta.resultLine.search meta.resultLine.multiLine.search",
"begin": "^ (?:\\s*)((\\d+) )",
"while": "^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))",
"beginCaptures": {
"0": {
"name": "constant.numeric.integer meta.resultLinePrefix.search"
},
"1": {
"name": "meta.resultLinePrefix.contextLinePrefix.search"
},
"2": {
"name": "meta.resultLinePrefix.lineNumber.search"
}
},
"whileCaptures": {
"0": {
"name": "constant.numeric.integer meta.resultLinePrefix.search"
},
"1": {
"name": "meta.resultLinePrefix.matchLinePrefix.search"
},
"2": {
"name": "meta.resultLinePrefix.lineNumber.search"
},
"3": {
"name": "punctuation.separator"
},
"4": {
"name": "meta.resultLinePrefix.contextLinePrefix.search"
},
"5": {
"name": "meta.resultLinePrefix.lineNumber.search"
}
},
"patterns": [
{
"include": "source.julia"
}
]
},
{
"begin": "^ (?:\\s*)((\\d+)(:))",
"while": "(?=not)possible",
"name": "meta.resultLine.search meta.resultLine.singleLine.search",
"beginCaptures": {
"0": {
"name": "constant.numeric.integer meta.resultLinePrefix.search"
},
"1": {
"name": "meta.resultLinePrefix.matchLinePrefix.search"
},
"2": {
"name": "meta.resultLinePrefix.lineNumber.search"
},
"3": {
"name": "punctuation.separator"
}
},
"patterns": [
{
"include": "source.julia"
}
]
}
]
},
"js": {
"name": "meta.resultBlock.search",
"begin": "^(?!\\s)(.*?)([^\\\\\\/\\n]*\\.js)(:)$",

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater tgjones/shaders-tmLanguage grammars/shaderlab.json ./syntaxes/shaderlab.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin tgjones/shaders-tmLanguage grammars/shaderlab.json ./syntaxes/shaderlab.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-shellscript grammars/shell-unix-bash.cson ./syntaxes/shell-unix-bash.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-shellscript grammars/shell-unix-bash.cson ./syntaxes/shell-unix-bash.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -0,0 +1,14 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const fs = require('fs');
const path = require('path');
fs.copyFileSync(
path.join('node_modules', 'vscode-codicons', 'dist', 'codicon.css'),
path.join('media', 'codicon.css'));
fs.copyFileSync(
path.join('node_modules', 'vscode-codicons', 'dist', 'codicon.ttf'),
path.join('media', 'codicon.ttf'));

View file

@ -0,0 +1,449 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
@font-face {
font-family: "codicon";
src: url("./codicon.ttf?756fa482df4f1610f1e0548d031e8c29") format("truetype");
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
.codicon-add:before { content: "\ea60" }
.codicon-plus:before { content: "\ea60" }
.codicon-gist-new:before { content: "\ea60" }
.codicon-repo-create:before { content: "\ea60" }
.codicon-lightbulb:before { content: "\ea61" }
.codicon-light-bulb:before { content: "\ea61" }
.codicon-repo:before { content: "\ea62" }
.codicon-repo-delete:before { content: "\ea62" }
.codicon-gist-fork:before { content: "\ea63" }
.codicon-repo-forked:before { content: "\ea63" }
.codicon-git-pull-request:before { content: "\ea64" }
.codicon-git-pull-request-abandoned:before { content: "\ea64" }
.codicon-record-keys:before { content: "\ea65" }
.codicon-keyboard:before { content: "\ea65" }
.codicon-tag:before { content: "\ea66" }
.codicon-tag-add:before { content: "\ea66" }
.codicon-tag-remove:before { content: "\ea66" }
.codicon-person:before { content: "\ea67" }
.codicon-person-add:before { content: "\ea67" }
.codicon-person-follow:before { content: "\ea67" }
.codicon-person-outline:before { content: "\ea67" }
.codicon-person-filled:before { content: "\ea67" }
.codicon-git-branch:before { content: "\ea68" }
.codicon-git-branch-create:before { content: "\ea68" }
.codicon-git-branch-delete:before { content: "\ea68" }
.codicon-source-control:before { content: "\ea68" }
.codicon-mirror:before { content: "\ea69" }
.codicon-mirror-public:before { content: "\ea69" }
.codicon-star:before { content: "\ea6a" }
.codicon-star-add:before { content: "\ea6a" }
.codicon-star-delete:before { content: "\ea6a" }
.codicon-star-empty:before { content: "\ea6a" }
.codicon-comment:before { content: "\ea6b" }
.codicon-comment-add:before { content: "\ea6b" }
.codicon-alert:before { content: "\ea6c" }
.codicon-warning:before { content: "\ea6c" }
.codicon-search:before { content: "\ea6d" }
.codicon-search-save:before { content: "\ea6d" }
.codicon-log-out:before { content: "\ea6e" }
.codicon-sign-out:before { content: "\ea6e" }
.codicon-log-in:before { content: "\ea6f" }
.codicon-sign-in:before { content: "\ea6f" }
.codicon-eye:before { content: "\ea70" }
.codicon-eye-unwatch:before { content: "\ea70" }
.codicon-eye-watch:before { content: "\ea70" }
.codicon-circle-filled:before { content: "\ea71" }
.codicon-primitive-dot:before { content: "\ea71" }
.codicon-close-dirty:before { content: "\ea71" }
.codicon-debug-breakpoint:before { content: "\ea71" }
.codicon-debug-breakpoint-disabled:before { content: "\ea71" }
.codicon-debug-hint:before { content: "\ea71" }
.codicon-primitive-square:before { content: "\ea72" }
.codicon-edit:before { content: "\ea73" }
.codicon-pencil:before { content: "\ea73" }
.codicon-info:before { content: "\ea74" }
.codicon-issue-opened:before { content: "\ea74" }
.codicon-gist-private:before { content: "\ea75" }
.codicon-git-fork-private:before { content: "\ea75" }
.codicon-lock:before { content: "\ea75" }
.codicon-mirror-private:before { content: "\ea75" }
.codicon-close:before { content: "\ea76" }
.codicon-remove-close:before { content: "\ea76" }
.codicon-x:before { content: "\ea76" }
.codicon-repo-sync:before { content: "\ea77" }
.codicon-sync:before { content: "\ea77" }
.codicon-clone:before { content: "\ea78" }
.codicon-desktop-download:before { content: "\ea78" }
.codicon-beaker:before { content: "\ea79" }
.codicon-microscope:before { content: "\ea79" }
.codicon-vm:before { content: "\ea7a" }
.codicon-device-desktop:before { content: "\ea7a" }
.codicon-file:before { content: "\ea7b" }
.codicon-file-text:before { content: "\ea7b" }
.codicon-more:before { content: "\ea7c" }
.codicon-ellipsis:before { content: "\ea7c" }
.codicon-kebab-horizontal:before { content: "\ea7c" }
.codicon-mail-reply:before { content: "\ea7d" }
.codicon-reply:before { content: "\ea7d" }
.codicon-organization:before { content: "\ea7e" }
.codicon-organization-filled:before { content: "\ea7e" }
.codicon-organization-outline:before { content: "\ea7e" }
.codicon-new-file:before { content: "\ea7f" }
.codicon-file-add:before { content: "\ea7f" }
.codicon-new-folder:before { content: "\ea80" }
.codicon-file-directory-create:before { content: "\ea80" }
.codicon-trash:before { content: "\ea81" }
.codicon-trashcan:before { content: "\ea81" }
.codicon-history:before { content: "\ea82" }
.codicon-clock:before { content: "\ea82" }
.codicon-folder:before { content: "\ea83" }
.codicon-file-directory:before { content: "\ea83" }
.codicon-symbol-folder:before { content: "\ea83" }
.codicon-logo-github:before { content: "\ea84" }
.codicon-mark-github:before { content: "\ea84" }
.codicon-github:before { content: "\ea84" }
.codicon-terminal:before { content: "\ea85" }
.codicon-console:before { content: "\ea85" }
.codicon-repl:before { content: "\ea85" }
.codicon-zap:before { content: "\ea86" }
.codicon-symbol-event:before { content: "\ea86" }
.codicon-error:before { content: "\ea87" }
.codicon-stop:before { content: "\ea87" }
.codicon-variable:before { content: "\ea88" }
.codicon-symbol-variable:before { content: "\ea88" }
.codicon-array:before { content: "\ea8a" }
.codicon-symbol-array:before { content: "\ea8a" }
.codicon-symbol-module:before { content: "\ea8b" }
.codicon-symbol-package:before { content: "\ea8b" }
.codicon-symbol-namespace:before { content: "\ea8b" }
.codicon-symbol-object:before { content: "\ea8b" }
.codicon-symbol-method:before { content: "\ea8c" }
.codicon-symbol-function:before { content: "\ea8c" }
.codicon-symbol-constructor:before { content: "\ea8c" }
.codicon-symbol-boolean:before { content: "\ea8f" }
.codicon-symbol-null:before { content: "\ea8f" }
.codicon-symbol-numeric:before { content: "\ea90" }
.codicon-symbol-number:before { content: "\ea90" }
.codicon-symbol-structure:before { content: "\ea91" }
.codicon-symbol-struct:before { content: "\ea91" }
.codicon-symbol-parameter:before { content: "\ea92" }
.codicon-symbol-type-parameter:before { content: "\ea92" }
.codicon-symbol-key:before { content: "\ea93" }
.codicon-symbol-text:before { content: "\ea93" }
.codicon-symbol-reference:before { content: "\ea94" }
.codicon-go-to-file:before { content: "\ea94" }
.codicon-symbol-enum:before { content: "\ea95" }
.codicon-symbol-value:before { content: "\ea95" }
.codicon-symbol-ruler:before { content: "\ea96" }
.codicon-symbol-unit:before { content: "\ea96" }
.codicon-activate-breakpoints:before { content: "\ea97" }
.codicon-archive:before { content: "\ea98" }
.codicon-arrow-both:before { content: "\ea99" }
.codicon-arrow-down:before { content: "\ea9a" }
.codicon-arrow-left:before { content: "\ea9b" }
.codicon-arrow-right:before { content: "\ea9c" }
.codicon-arrow-small-down:before { content: "\ea9d" }
.codicon-arrow-small-left:before { content: "\ea9e" }
.codicon-arrow-small-right:before { content: "\ea9f" }
.codicon-arrow-small-up:before { content: "\eaa0" }
.codicon-arrow-up:before { content: "\eaa1" }
.codicon-bell:before { content: "\eaa2" }
.codicon-bold:before { content: "\eaa3" }
.codicon-book:before { content: "\eaa4" }
.codicon-bookmark:before { content: "\eaa5" }
.codicon-debug-breakpoint-conditional-unverified:before { content: "\eaa6" }
.codicon-debug-breakpoint-conditional:before { content: "\eaa7" }
.codicon-debug-breakpoint-conditional-disabled:before { content: "\eaa7" }
.codicon-debug-breakpoint-data-unverified:before { content: "\eaa8" }
.codicon-debug-breakpoint-data:before { content: "\eaa9" }
.codicon-debug-breakpoint-data-disabled:before { content: "\eaa9" }
.codicon-debug-breakpoint-log-unverified:before { content: "\eaaa" }
.codicon-debug-breakpoint-log:before { content: "\eaab" }
.codicon-debug-breakpoint-log-disabled:before { content: "\eaab" }
.codicon-briefcase:before { content: "\eaac" }
.codicon-broadcast:before { content: "\eaad" }
.codicon-browser:before { content: "\eaae" }
.codicon-bug:before { content: "\eaaf" }
.codicon-calendar:before { content: "\eab0" }
.codicon-case-sensitive:before { content: "\eab1" }
.codicon-check:before { content: "\eab2" }
.codicon-checklist:before { content: "\eab3" }
.codicon-chevron-down:before { content: "\eab4" }
.codicon-chevron-left:before { content: "\eab5" }
.codicon-chevron-right:before { content: "\eab6" }
.codicon-chevron-up:before { content: "\eab7" }
.codicon-chrome-close:before { content: "\eab8" }
.codicon-chrome-maximize:before { content: "\eab9" }
.codicon-chrome-minimize:before { content: "\eaba" }
.codicon-chrome-restore:before { content: "\eabb" }
.codicon-circle-outline:before { content: "\eabc" }
.codicon-debug-breakpoint-unverified:before { content: "\eabc" }
.codicon-circle-slash:before { content: "\eabd" }
.codicon-circuit-board:before { content: "\eabe" }
.codicon-clear-all:before { content: "\eabf" }
.codicon-clippy:before { content: "\eac0" }
.codicon-close-all:before { content: "\eac1" }
.codicon-cloud-download:before { content: "\eac2" }
.codicon-cloud-upload:before { content: "\eac3" }
.codicon-code:before { content: "\eac4" }
.codicon-collapse-all:before { content: "\eac5" }
.codicon-color-mode:before { content: "\eac6" }
.codicon-comment-discussion:before { content: "\eac7" }
.codicon-credit-card:before { content: "\eac9" }
.codicon-dash:before { content: "\eacc" }
.codicon-dashboard:before { content: "\eacd" }
.codicon-database:before { content: "\eace" }
.codicon-debug-continue:before { content: "\eacf" }
.codicon-debug-disconnect:before { content: "\ead0" }
.codicon-debug-pause:before { content: "\ead1" }
.codicon-debug-restart:before { content: "\ead2" }
.codicon-debug-start:before { content: "\ead3" }
.codicon-debug-step-into:before { content: "\ead4" }
.codicon-debug-step-out:before { content: "\ead5" }
.codicon-debug-step-over:before { content: "\ead6" }
.codicon-debug-stop:before { content: "\ead7" }
.codicon-debug:before { content: "\ead8" }
.codicon-device-camera-video:before { content: "\ead9" }
.codicon-device-camera:before { content: "\eada" }
.codicon-device-mobile:before { content: "\eadb" }
.codicon-diff-added:before { content: "\eadc" }
.codicon-diff-ignored:before { content: "\eadd" }
.codicon-diff-modified:before { content: "\eade" }
.codicon-diff-removed:before { content: "\eadf" }
.codicon-diff-renamed:before { content: "\eae0" }
.codicon-diff:before { content: "\eae1" }
.codicon-discard:before { content: "\eae2" }
.codicon-editor-layout:before { content: "\eae3" }
.codicon-empty-window:before { content: "\eae4" }
.codicon-exclude:before { content: "\eae5" }
.codicon-extensions:before { content: "\eae6" }
.codicon-eye-closed:before { content: "\eae7" }
.codicon-file-binary:before { content: "\eae8" }
.codicon-file-code:before { content: "\eae9" }
.codicon-file-media:before { content: "\eaea" }
.codicon-file-pdf:before { content: "\eaeb" }
.codicon-file-submodule:before { content: "\eaec" }
.codicon-file-symlink-directory:before { content: "\eaed" }
.codicon-file-symlink-file:before { content: "\eaee" }
.codicon-file-zip:before { content: "\eaef" }
.codicon-files:before { content: "\eaf0" }
.codicon-filter:before { content: "\eaf1" }
.codicon-flame:before { content: "\eaf2" }
.codicon-fold-down:before { content: "\eaf3" }
.codicon-fold-up:before { content: "\eaf4" }
.codicon-fold:before { content: "\eaf5" }
.codicon-folder-active:before { content: "\eaf6" }
.codicon-folder-opened:before { content: "\eaf7" }
.codicon-gear:before { content: "\eaf8" }
.codicon-gift:before { content: "\eaf9" }
.codicon-gist-secret:before { content: "\eafa" }
.codicon-gist:before { content: "\eafb" }
.codicon-git-commit:before { content: "\eafc" }
.codicon-git-compare:before { content: "\eafd" }
.codicon-compare-changes:before { content: "\eafd" }
.codicon-git-merge:before { content: "\eafe" }
.codicon-github-action:before { content: "\eaff" }
.codicon-github-alt:before { content: "\eb00" }
.codicon-globe:before { content: "\eb01" }
.codicon-grabber:before { content: "\eb02" }
.codicon-graph:before { content: "\eb03" }
.codicon-gripper:before { content: "\eb04" }
.codicon-heart:before { content: "\eb05" }
.codicon-home:before { content: "\eb06" }
.codicon-horizontal-rule:before { content: "\eb07" }
.codicon-hubot:before { content: "\eb08" }
.codicon-inbox:before { content: "\eb09" }
.codicon-issue-closed:before { content: "\eb0a" }
.codicon-issue-reopened:before { content: "\eb0b" }
.codicon-issues:before { content: "\eb0c" }
.codicon-italic:before { content: "\eb0d" }
.codicon-jersey:before { content: "\eb0e" }
.codicon-json:before { content: "\eb0f" }
.codicon-kebab-vertical:before { content: "\eb10" }
.codicon-key:before { content: "\eb11" }
.codicon-law:before { content: "\eb12" }
.codicon-lightbulb-autofix:before { content: "\eb13" }
.codicon-link-external:before { content: "\eb14" }
.codicon-link:before { content: "\eb15" }
.codicon-list-ordered:before { content: "\eb16" }
.codicon-list-unordered:before { content: "\eb17" }
.codicon-live-share:before { content: "\eb18" }
.codicon-loading:before { content: "\eb19" }
.codicon-location:before { content: "\eb1a" }
.codicon-mail-read:before { content: "\eb1b" }
.codicon-mail:before { content: "\eb1c" }
.codicon-markdown:before { content: "\eb1d" }
.codicon-megaphone:before { content: "\eb1e" }
.codicon-mention:before { content: "\eb1f" }
.codicon-milestone:before { content: "\eb20" }
.codicon-mortar-board:before { content: "\eb21" }
.codicon-move:before { content: "\eb22" }
.codicon-multiple-windows:before { content: "\eb23" }
.codicon-mute:before { content: "\eb24" }
.codicon-no-newline:before { content: "\eb25" }
.codicon-note:before { content: "\eb26" }
.codicon-octoface:before { content: "\eb27" }
.codicon-open-preview:before { content: "\eb28" }
.codicon-package:before { content: "\eb29" }
.codicon-paintcan:before { content: "\eb2a" }
.codicon-pin:before { content: "\eb2b" }
.codicon-play:before { content: "\eb2c" }
.codicon-run:before { content: "\eb2c" }
.codicon-plug:before { content: "\eb2d" }
.codicon-preserve-case:before { content: "\eb2e" }
.codicon-preview:before { content: "\eb2f" }
.codicon-project:before { content: "\eb30" }
.codicon-pulse:before { content: "\eb31" }
.codicon-question:before { content: "\eb32" }
.codicon-quote:before { content: "\eb33" }
.codicon-radio-tower:before { content: "\eb34" }
.codicon-reactions:before { content: "\eb35" }
.codicon-references:before { content: "\eb36" }
.codicon-refresh:before { content: "\eb37" }
.codicon-regex:before { content: "\eb38" }
.codicon-remote-explorer:before { content: "\eb39" }
.codicon-remote:before { content: "\eb3a" }
.codicon-remove:before { content: "\eb3b" }
.codicon-replace-all:before { content: "\eb3c" }
.codicon-replace:before { content: "\eb3d" }
.codicon-repo-clone:before { content: "\eb3e" }
.codicon-repo-force-push:before { content: "\eb3f" }
.codicon-repo-pull:before { content: "\eb40" }
.codicon-repo-push:before { content: "\eb41" }
.codicon-report:before { content: "\eb42" }
.codicon-request-changes:before { content: "\eb43" }
.codicon-rocket:before { content: "\eb44" }
.codicon-root-folder-opened:before { content: "\eb45" }
.codicon-root-folder:before { content: "\eb46" }
.codicon-rss:before { content: "\eb47" }
.codicon-ruby:before { content: "\eb48" }
.codicon-save-all:before { content: "\eb49" }
.codicon-save-as:before { content: "\eb4a" }
.codicon-save:before { content: "\eb4b" }
.codicon-screen-full:before { content: "\eb4c" }
.codicon-screen-normal:before { content: "\eb4d" }
.codicon-search-stop:before { content: "\eb4e" }
.codicon-server:before { content: "\eb50" }
.codicon-settings-gear:before { content: "\eb51" }
.codicon-settings:before { content: "\eb52" }
.codicon-shield:before { content: "\eb53" }
.codicon-smiley:before { content: "\eb54" }
.codicon-sort-precedence:before { content: "\eb55" }
.codicon-split-horizontal:before { content: "\eb56" }
.codicon-split-vertical:before { content: "\eb57" }
.codicon-squirrel:before { content: "\eb58" }
.codicon-star-full:before { content: "\eb59" }
.codicon-star-half:before { content: "\eb5a" }
.codicon-symbol-class:before { content: "\eb5b" }
.codicon-symbol-color:before { content: "\eb5c" }
.codicon-symbol-constant:before { content: "\eb5d" }
.codicon-symbol-enum-member:before { content: "\eb5e" }
.codicon-symbol-field:before { content: "\eb5f" }
.codicon-symbol-file:before { content: "\eb60" }
.codicon-symbol-interface:before { content: "\eb61" }
.codicon-symbol-keyword:before { content: "\eb62" }
.codicon-symbol-misc:before { content: "\eb63" }
.codicon-symbol-operator:before { content: "\eb64" }
.codicon-symbol-property:before { content: "\eb65" }
.codicon-wrench:before { content: "\eb65" }
.codicon-wrench-subaction:before { content: "\eb65" }
.codicon-symbol-snippet:before { content: "\eb66" }
.codicon-tasklist:before { content: "\eb67" }
.codicon-telescope:before { content: "\eb68" }
.codicon-text-size:before { content: "\eb69" }
.codicon-three-bars:before { content: "\eb6a" }
.codicon-thumbsdown:before { content: "\eb6b" }
.codicon-thumbsup:before { content: "\eb6c" }
.codicon-tools:before { content: "\eb6d" }
.codicon-triangle-down:before { content: "\eb6e" }
.codicon-triangle-left:before { content: "\eb6f" }
.codicon-triangle-right:before { content: "\eb70" }
.codicon-triangle-up:before { content: "\eb71" }
.codicon-twitter:before { content: "\eb72" }
.codicon-unfold:before { content: "\eb73" }
.codicon-unlock:before { content: "\eb74" }
.codicon-unmute:before { content: "\eb75" }
.codicon-unverified:before { content: "\eb76" }
.codicon-verified:before { content: "\eb77" }
.codicon-versions:before { content: "\eb78" }
.codicon-vm-active:before { content: "\eb79" }
.codicon-vm-outline:before { content: "\eb7a" }
.codicon-vm-running:before { content: "\eb7b" }
.codicon-watch:before { content: "\eb7c" }
.codicon-whitespace:before { content: "\eb7d" }
.codicon-whole-word:before { content: "\eb7e" }
.codicon-window:before { content: "\eb7f" }
.codicon-word-wrap:before { content: "\eb80" }
.codicon-zoom-in:before { content: "\eb81" }
.codicon-zoom-out:before { content: "\eb82" }
.codicon-list-filter:before { content: "\eb83" }
.codicon-list-flat:before { content: "\eb84" }
.codicon-list-selection:before { content: "\eb85" }
.codicon-selection:before { content: "\eb85" }
.codicon-list-tree:before { content: "\eb86" }
.codicon-debug-breakpoint-function-unverified:before { content: "\eb87" }
.codicon-debug-breakpoint-function:before { content: "\eb88" }
.codicon-debug-breakpoint-function-disabled:before { content: "\eb88" }
.codicon-debug-stackframe-active:before { content: "\eb89" }
.codicon-debug-stackframe-dot:before { content: "\eb8a" }
.codicon-debug-stackframe:before { content: "\eb8b" }
.codicon-debug-stackframe-focused:before { content: "\eb8b" }
.codicon-debug-breakpoint-unsupported:before { content: "\eb8c" }
.codicon-symbol-string:before { content: "\eb8d" }
.codicon-debug-reverse-continue:before { content: "\eb8e" }
.codicon-debug-step-back:before { content: "\eb8f" }
.codicon-debug-restart-frame:before { content: "\eb90" }
.codicon-debug-alt:before { content: "\eb91" }
.codicon-call-incoming:before { content: "\eb92" }
.codicon-call-outgoing:before { content: "\eb93" }
.codicon-menu:before { content: "\eb94" }
.codicon-expand-all:before { content: "\eb95" }
.codicon-feedback:before { content: "\eb96" }
.codicon-group-by-ref-type:before { content: "\eb97" }
.codicon-ungroup-by-ref-type:before { content: "\eb98" }
.codicon-account:before { content: "\eb99" }
.codicon-bell-dot:before { content: "\eb9a" }
.codicon-debug-console:before { content: "\eb9b" }
.codicon-library:before { content: "\eb9c" }
.codicon-output:before { content: "\eb9d" }
.codicon-run-all:before { content: "\eb9e" }
.codicon-sync-ignored:before { content: "\eb9f" }
.codicon-pinned:before { content: "\eba0" }
.codicon-github-inverted:before { content: "\eba1" }
.codicon-server-process:before { content: "\eba2" }
.codicon-server-environment:before { content: "\eba3" }
.codicon-pass:before { content: "\eba4" }
.codicon-stop-circle:before { content: "\eba5" }
.codicon-play-circle:before { content: "\eba6" }
.codicon-record:before { content: "\eba7" }
.codicon-debug-alt-small:before { content: "\eba8" }
.codicon-vm-connect:before { content: "\eba9" }
.codicon-cloud:before { content: "\ebaa" }
.codicon-merge:before { content: "\ebab" }
.codicon-export:before { content: "\ebac" }
.codicon-graph-left:before { content: "\ebad" }
.codicon-magnet:before { content: "\ebae" }
.codicon-notebook:before { content: "\ebaf" }
.codicon-redo:before { content: "\ebb0" }
.codicon-check-all:before { content: "\ebb1" }
.codicon-pinned-dirty:before { content: "\ebb2" }
.codicon-pass-filled:before { content: "\ebb3" }
.codicon-circle-large-filled:before { content: "\ebb4" }
.codicon-circle-large-outline:before { content: "\ebb5" }
.codicon-combine:before { content: "\ebb6" }
.codicon-gather:before { content: "\ebb6" }

Binary file not shown.

View file

@ -194,9 +194,19 @@ events_1.onceDocumentLoaded(() => {
iframe.src = input.value;
});
navigateTo(settings.url);
input.value = settings.url;
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
function navigateTo(url) {
iframe.src = url;
function navigateTo(rawUrl) {
try {
const url = new URL(rawUrl);
// Try to bust the cache for the iframe
// There does not appear to be any way to reliably do this except modifying the url
url.searchParams.append('vscodeBrowserReqId', Date.now().toString());
iframe.src = url.toString();
}
catch (_a) {
iframe.src = rawUrl;
}
}
});
function toggleFocusLockIndicatorEnabled(enabled) {

File diff suppressed because one or more lines are too long

View file

@ -93,6 +93,7 @@ iframe {
width: 100%;
height: 100%;
border: none;
background: white; /* Browsers default to a white background */
}
.iframe-focused-alert {

View file

@ -16,6 +16,11 @@
"categories": [
"Other"
],
"extensionKind": [
"ui",
"workspace",
"web"
],
"activationEvents": [
"onCommand:simpleBrowser.show",
"onCommand:simpleBrowser.api.open",
@ -52,14 +57,15 @@
"build-preview": "webpack --mode development",
"build-preview-production": "webpack --mode production",
"compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none",
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose",
"postinstall": "node ./build/copy"
},
"dependencies": {
"vscode-codicons": "^0.0.12",
"vscode-extension-telemetry": "0.1.1",
"vscode-nls": "^4.0.0"
},
"devDependencies": {
"vscode-codicons": "^0.0.14",
"@types/node": "^12.11.7",
"ts-loader": "^6.2.1",
"typescript": "^3.7.3",

View file

@ -84,10 +84,22 @@ onceDocumentLoaded(() => {
});
navigateTo(settings.url);
input.value = settings.url;
toggleFocusLockIndicatorEnabled(settings.focusLockIndicatorEnabled);
function navigateTo(url: string): void {
iframe.src = url;
function navigateTo(rawUrl: string): void {
try {
const url = new URL(rawUrl);
// Try to bust the cache for the iframe
// There does not appear to be any way to reliably do this except modifying the url
url.searchParams.append('vscodeBrowserReqId', Date.now().toString());
iframe.src = url.toString();
} catch {
iframe.src = rawUrl;
}
}
});

View file

@ -37,6 +37,9 @@ export class SimpleBrowserView extends Disposable {
}, {
enableScripts: true,
retainContextWhenHidden: true,
localResourceRoots: [
vscode.Uri.joinPath(extensionUri, 'media')
]
}));
this._register(this._webviewPanel.webview.onDidReceiveMessage(e => {
@ -86,8 +89,8 @@ export class SimpleBrowserView extends Disposable {
const mainJs = this.extensionResourceUrl('media', 'index.js');
const mainCss = this.extensionResourceUrl('media', 'main.css');
const codiconsUri = this.extensionResourceUrl('node_modules', 'vscode-codicons', 'dist', 'codicon.css');
const codiconsFontUri = this.extensionResourceUrl('node_modules', 'vscode-codicons', 'dist', 'codicon.ttf');
const codiconsUri = this.extensionResourceUrl('media', 'codicon.css');
const codiconsFontUri = this.extensionResourceUrl('media', 'codicon.ttf');
return /* html */ `<!DOCTYPE html>
<html>
@ -126,7 +129,7 @@ export class SimpleBrowserView extends Disposable {
class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
</nav>
<input class="url-input" type="text" value=${url}>
<input class="url-input" type="text">
<nav class="controls">
<button

View file

@ -2565,10 +2565,10 @@ vm-browserify@^1.0.1:
resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==
vscode-codicons@^0.0.12:
version "0.0.12"
resolved "https://registry.yarnpkg.com/vscode-codicons/-/vscode-codicons-0.0.12.tgz#94b867156f3e3a6a4cf7661e9bf2bd0060042390"
integrity sha512-CyGFDf3OmQhtBql/BFheUAlvEZ1MKAgvyCrGktGXEsqYvK5m9456kckDTNvnEAGG8gYjE2ds5O1cle82sMgmAg==
vscode-codicons@^0.0.14:
version "0.0.14"
resolved "https://registry.yarnpkg.com/vscode-codicons/-/vscode-codicons-0.0.14.tgz#e0d05418e2e195564ff6f6a2199d70415911c18f"
integrity sha512-6CEH5KT9ct5WMw7n5dlX7rB8ya4CUI2FSq1Wk36XaW+c5RglFtAanUV0T+gvZVVFhl/WxfjTvFHq06Hz9c1SLA==
vscode-extension-telemetry@0.1.1:
version "0.1.1"

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/swift.tmbundle Syntaxes/Swift.tmLanguage ./syntaxes/swift.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/swift.tmbundle Syntaxes/Swift.tmLanguage ./syntaxes/swift.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/asp.vb.net.tmbundle Syntaxes/ASP%20VB.net.plist ./syntaxes/asp-vb-net.tmlanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/asp.vb.net.tmbundle Syntaxes/ASP%20VB.net.plist ./syntaxes/asp-vb-net.tmlanguage.json"
},
"contributes": {
"languages": [

View file

@ -42,6 +42,7 @@
"remote": [
{
"id": "test.treeId",
"name": "test-tree",
"when": "never"
}
]

View file

@ -0,0 +1,26 @@
# n-queens (nqueens) solver, for nsquaresx-by-nsquaresy board
struct Queen
x::Int
y::Int
end
hitshorz(queena, queenb) = queena.x == queenb.x
hitsvert(queena, queenb) = queena.y == queenb.y
hitsdiag(queena, queenb) = abs(queena.x - queenb.x) == abs(queena.y - queenb.y)
hitshvd(qa, qb) = hitshorz(qa, qb) || hitsvert(qa, qb) || hitsdiag(qa, qb)
hitsany(testqueen, queens) = any(q -> hitshvd(testqueen, q), queens)
function trysolve(nsquaresx, nsquaresy, nqueens, presqueens = ())
nqueens == 0 && return presqueens
for xsquare in 1:nsquaresx
for ysquare in 1:nsquaresy
testqueen = Queen(xsquare, ysquare)
if !hitsany(testqueen, presqueens)
tryqueens = (presqueens..., testqueen)
maybesol = trysolve(nsquaresx, nsquaresy, nqueens - 1, tryqueens)
maybesol !== nothing && return maybesol
end
end
end
return nothing
end

File diff suppressed because it is too large Load diff

View file

@ -108,7 +108,7 @@
]
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater atom/language-xml grammars/xml.cson ./syntaxes/xml.tmLanguage.json grammars/xsl.cson ./syntaxes/xsl.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin atom/language-xml grammars/xml.cson ./syntaxes/xml.tmLanguage.json grammars/xsl.cson ./syntaxes/xsl.tmLanguage.json"
},
"repository": {
"type": "git",

View file

@ -9,7 +9,7 @@
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../node_modules/.bin/vscode-grammar-updater textmate/yaml.tmbundle Syntaxes/YAML.tmLanguage ./syntaxes/yaml.tmLanguage.json"
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin textmate/yaml.tmbundle Syntaxes/YAML.tmLanguage ./syntaxes/yaml.tmLanguage.json"
},
"contributes": {
"languages": [

View file

@ -24,10 +24,10 @@ typescript@^4.2.0-dev.20210201:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.0-dev.20210201.tgz#3d8ae7214cd4b23d3ae400f84d1afe5679f3e2f0"
integrity sha512-By8G30ZYs+b/8084cSnjP7ILd8ExUBC4Qi9FY2iRlBApHu/A08ExLlCRnYkHN1PgxcNs4rTaozJsgXHJ6cg92g==
vscode-grammar-updater@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/vscode-grammar-updater/-/vscode-grammar-updater-1.0.2.tgz#ad4eba5f69c02ec8bf8143517d736a587e059657"
integrity sha512-gzJ9QQhtcYznm7WaY473hU/wWq7mWhEJJdcJPLZNwL3v0+FlWwXU/oIe7Z/k/DFR8g5dFOhqgQAiX22cneG5VA==
vscode-grammar-updater@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/vscode-grammar-updater/-/vscode-grammar-updater-1.0.3.tgz#695ccaf0567c6a000005a969cd87ecc3b5c25018"
integrity sha512-V/OnMGyAk7Ldv5NC2p+NovidsAghdfbFFnimEzQ7F/TYIqDLJCVe28RcvaU2gywCSCtxNfS5MYe0egiaRIWNEw==
dependencies:
cson-parser "^1.3.3"
fast-plist "0.1.2"

View file

@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.54.0",
"distro": "e555ce6c25c9e08034b3ba25b24e32bc1b0815fb",
"distro": "1bc28dd86603be17b5bf6ffa9370864f58e0ef77",
"author": {
"name": "Microsoft Corporation"
},
@ -46,7 +46,7 @@
"compile-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-web",
"watch-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js watch-web",
"eslint": "node build/eslint",
"electron-rebuild": "electron-rebuild --arch=arm64 --force --version=11.2.2",
"electron-rebuild": "electron-rebuild --arch=arm64 --force --version=11.2.3",
"playwright-install": "node build/azure-pipelines/common/installPlaywright.js",
"compile-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-build",
"compile-extensions-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-extensions-build",
@ -125,7 +125,7 @@
"cssnano": "^4.1.10",
"debounce": "^1.0.0",
"deemon": "^1.4.0",
"electron": "11.2.2",
"electron": "11.2.3",
"electron-rebuild": "2.0.3",
"eslint": "6.8.0",
"eslint-plugin-jsdoc": "^19.1.0",
@ -135,7 +135,7 @@
"file-loader": "^4.2.0",
"glob": "^5.0.13",
"gulp": "^4.0.0",
"gulp-atom-electron": "1.22.0",
"gulp-atom-electron": "^1.30.1",
"gulp-azure-storage": "^0.11.1",
"gulp-bom": "^3.0.0",
"gulp-buffer": "0.0.2",
@ -222,4 +222,4 @@
"elliptic": "^6.5.3",
"nwmatcher": "^1.4.4"
}
}
}

View file

@ -91,7 +91,7 @@
},
{
"name": "ms-vscode.js-debug",
"version": "1.54.0",
"version": "1.54.1",
"repo": "https://github.com/microsoft/vscode-js-debug",
"metadata": {
"id": "25629058-ddac-4e17-abba-74678e126c5d",

View file

@ -14,6 +14,10 @@ AutoReq: 0
%description
Visual Studio Code is a new choice of tool that combines the simplicity of a code editor with what developers need for the core edit-build-debug cycle. See https://code.visualstudio.com/docs/setup/linux for installation instructions and FAQ.
# Don't generate build_id links to prevent conflicts when installing multiple
# versions of VS Code alongside each other (e.g. `code` and `code-insiders`)
%define _build_id_links none
%install
mkdir -p %{buildroot}/usr/share/@@NAME@@
mkdir -p %{buildroot}/usr/share/applications

View file

@ -13,7 +13,7 @@
}
}
.codicon-sync.codicon-modifier-spin, .codicon-loading.codicon-modifier-spin{
.codicon-sync.codicon-modifier-spin, .codicon-loading.codicon-modifier-spin .codicon-gear.codicon-modifier-spin {
/* Use steps to throttle FPS to reduce CPU usage */
animation: codicon-spin 1.5s steps(30) infinite;
}

View file

@ -225,13 +225,16 @@ export class IconLabel extends Disposable {
let mouseX: number | undefined;
let isHovering = false;
let tokenSource: CancellationTokenSource;
let hoverDisposable: IDisposable | undefined;
function mouseOver(this: HTMLElement, e: MouseEvent): any {
if (isHovering) {
return;
}
tokenSource = new CancellationTokenSource();
function mouseLeaveOrDown(this: HTMLElement, e: MouseEvent): any {
if ((<any>e).fromElement === htmlElement) {
if ((e.type === dom.EventType.MOUSE_DOWN) || (<any>e).fromElement === htmlElement) {
hoverDisposable?.dispose();
hoverDisposable = undefined;
isHovering = false;
hoverOptions = undefined;
tokenSource.dispose(true);
@ -260,7 +263,7 @@ export class IconLabel extends Disposable {
target,
anchorPosition: AnchorPosition.BELOW
};
const hoverDisposable = IconLabel.adjustXAndShowCustomHover(hoverOptions, mouseX, hoverDelegate, isHovering);
hoverDisposable = IconLabel.adjustXAndShowCustomHover(hoverOptions, mouseX, hoverDelegate, isHovering);
const resolvedTooltip = (await tooltip(tokenSource.token)) ?? (!isString(markdownTooltip) ? markdownTooltip.markdownNotSupportedFallback : undefined);
if (resolvedTooltip) {
@ -270,9 +273,10 @@ export class IconLabel extends Disposable {
anchorPosition: AnchorPosition.BELOW
};
// awaiting the tooltip could take a while. Make sure we're still hovering.
IconLabel.adjustXAndShowCustomHover(hoverOptions, mouseX, hoverDelegate, isHovering);
hoverDisposable = IconLabel.adjustXAndShowCustomHover(hoverOptions, mouseX, hoverDelegate, isHovering);
} else if (hoverDisposable) {
hoverDisposable.dispose();
hoverDisposable = undefined;
}
}

View file

@ -60,8 +60,7 @@
height: var(--sash-size);
}
.monaco-sash:not(.disabled).orthogonal-start::before,
.monaco-sash:not(.disabled).orthogonal-end::after {
.monaco-sash:not(.disabled) > .orthogonal-drag-handle {
content: " ";
height: calc(var(--sash-size) * 2);
width: calc(var(--sash-size) * 2);
@ -71,30 +70,34 @@
position: absolute;
}
.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled).orthogonal-start::before,
.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled).orthogonal-end::after {
.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)
> .orthogonal-drag-handle.start,
.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)
> .orthogonal-drag-handle.end {
cursor: nwse-resize;
}
.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled).orthogonal-end::after,
.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled).orthogonal-start::before {
.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)
> .orthogonal-drag-handle.end,
.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)
> .orthogonal-drag-handle.start {
cursor: nesw-resize;
}
.monaco-sash.orthogonal-start.vertical::before {
left: -calc(var(--sash-size) / 2);
.monaco-sash.vertical > .orthogonal-drag-handle.start {
left: calc(var(--sash-size) / -2);
top: calc(var(--sash-size) * -1);
}
.monaco-sash.orthogonal-end.vertical::after {
left: -calc(var(--sash-size) / 2);
.monaco-sash.vertical > .orthogonal-drag-handle.end {
left: calc(var(--sash-size) / -2);
bottom: calc(var(--sash-size) * -1);
}
.monaco-sash.orthogonal-start.horizontal::before {
top: -calc(var(--sash-size) / 2);
.monaco-sash.horizontal > .orthogonal-drag-handle.start {
top: calc(var(--sash-size) / -2);
left: calc(var(--sash-size) * -1);
}
.monaco-sash.orthogonal-end.horizontal::after {
top: -calc(var(--sash-size) / 2);
.monaco-sash.horizontal > .orthogonal-drag-handle.end {
top: calc(var(--sash-size) / -2);
right: calc(var(--sash-size) * -1);
}
@ -113,7 +116,6 @@
background: rgba(0, 255, 255, 0.2);
}
.monaco-sash.debug:not(.disabled).orthogonal-start::before,
.monaco-sash.debug:not(.disabled).orthogonal-end::after {
.monaco-sash.debug:not(.disabled) > .orthogonal-drag-handle {
background: red;
}

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./sash';
import { IDisposable, dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { IDisposable, dispose, Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { isMacintosh } from 'vs/base/common/platform';
import * as types from 'vs/base/common/types';
import { EventType, GestureEvent, Gesture } from 'vs/base/browser/touch';
@ -13,7 +13,8 @@ import { Event, Emitter } from 'vs/base/common/event';
import { getElementsByTagName, EventHelper, createStyleSheet, addDisposableListener, append, $ } from 'vs/base/browser/dom';
import { domEvent } from 'vs/base/browser/event';
const DEBUG = false;
let DEBUG = false;
// DEBUG = Boolean("true"); // done "weirdly" so that a lint warning prevents you from pushing this
export interface ISashLayoutProvider { }
@ -121,15 +122,29 @@ export class Sash extends Disposable {
private readonly orthogonalStartSashDisposables = this._register(new DisposableStore());
private _orthogonalStartSash: Sash | undefined;
private readonly orthogonalStartDragHandleDisposables = this._register(new DisposableStore());
private _orthogonalStartDragHandle: HTMLElement | undefined;
get orthogonalStartSash(): Sash | undefined { return this._orthogonalStartSash; }
set orthogonalStartSash(sash: Sash | undefined) {
this.orthogonalStartDragHandleDisposables.clear();
this.orthogonalStartSashDisposables.clear();
if (sash) {
this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange, this));
this.onOrthogonalStartSashEnablementChange(sash.state);
} else {
this.onOrthogonalStartSashEnablementChange(SashState.Disabled);
const onChange = (state: SashState) => {
this.orthogonalStartDragHandleDisposables.clear();
if (state !== SashState.Disabled) {
this._orthogonalStartDragHandle = append(this.el, $('.orthogonal-drag-handle.start'));
this.orthogonalStartDragHandleDisposables.add(toDisposable(() => this._orthogonalStartDragHandle!.remove()));
domEvent(this._orthogonalStartDragHandle, 'mouseenter', false)
(() => sash.el.classList.add('hover'), undefined, this.orthogonalStartDragHandleDisposables);
domEvent(this._orthogonalStartDragHandle, 'mouseleave', false)
(() => sash.el.classList.remove('hover'), undefined, this.orthogonalStartDragHandleDisposables);
}
};
this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange(onChange, this));
onChange(sash.state);
}
this._orthogonalStartSash = sash;
@ -137,15 +152,29 @@ export class Sash extends Disposable {
private readonly orthogonalEndSashDisposables = this._register(new DisposableStore());
private _orthogonalEndSash: Sash | undefined;
private readonly orthogonalEndDragHandleDisposables = this._register(new DisposableStore());
private _orthogonalEndDragHandle: HTMLElement | undefined;
get orthogonalEndSash(): Sash | undefined { return this._orthogonalEndSash; }
set orthogonalEndSash(sash: Sash | undefined) {
this.orthogonalEndDragHandleDisposables.clear();
this.orthogonalEndSashDisposables.clear();
if (sash) {
this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange, this));
this.onOrthogonalEndSashEnablementChange(sash.state);
} else {
this.onOrthogonalEndSashEnablementChange(SashState.Disabled);
const onChange = (state: SashState) => {
this.orthogonalEndDragHandleDisposables.clear();
if (state !== SashState.Disabled) {
this._orthogonalEndDragHandle = append(this.el, $('.orthogonal-drag-handle.end'));
this.orthogonalEndDragHandleDisposables.add(toDisposable(() => this._orthogonalEndDragHandle!.remove()));
domEvent(this._orthogonalEndDragHandle, 'mouseenter', false)
(() => sash.el.classList.add('hover'), undefined, this.orthogonalEndDragHandleDisposables);
domEvent(this._orthogonalEndDragHandle, 'mouseleave', false)
(() => sash.el.classList.remove('hover'), undefined, this.orthogonalEndDragHandleDisposables);
}
};
this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange(onChange, this));
onChange(sash.state);
}
this._orthogonalEndSash = sash;
@ -359,7 +388,7 @@ export class Sash extends Disposable {
}
}));
listeners.push(addDisposableListener(this.el, EventType.End, (event: GestureEvent) => {
listeners.push(addDisposableListener(this.el, EventType.End, () => {
this._onDidEnd.fire();
dispose(listeners);
}));
@ -407,27 +436,13 @@ export class Sash extends Disposable {
return this.hidden;
}
private onOrthogonalStartSashEnablementChange(state: SashState): void {
this.el.classList.toggle('orthogonal-start', state !== SashState.Disabled);
}
private onOrthogonalEndSashEnablementChange(state: SashState): void {
this.el.classList.toggle('orthogonal-end', state !== SashState.Disabled);
}
private getOrthogonalSash(e: MouseEvent): Sash | undefined {
if (this.orientation === Orientation.VERTICAL) {
if (e.offsetY <= this.size) {
return this.orthogonalStartSash;
} else if (e.offsetY >= this.el.clientHeight - this.size) {
return this.orthogonalEndSash;
}
} else {
if (e.offsetX <= this.size) {
return this.orthogonalStartSash;
} else if (e.offsetX >= this.el.clientWidth - this.size) {
return this.orthogonalEndSash;
}
if (!e.target || !(e.target instanceof HTMLElement)) {
return undefined;
}
if (e.target.classList.contains('orthogonal-drag-handle')) {
return e.target.classList.contains('start') ? this.orthogonalStartSash : this.orthogonalEndSash;
}
return undefined;

View file

@ -432,7 +432,7 @@ export class PaneView extends Disposable {
private dnd: IPaneDndController | undefined;
private dndContext: IDndContext = { draggable: null };
private el: HTMLElement;
readonly element: HTMLElement;
private paneItems: IPaneItem[] = [];
private orthogonalSize: number = 0;
private size: number = 0;
@ -450,8 +450,8 @@ export class PaneView extends Disposable {
this.dnd = options.dnd;
this.orientation = options.orientation ?? Orientation.VERTICAL;
this.el = append(container, $('.monaco-pane-view'));
this.splitview = this._register(new SplitView(this.el, { orientation: this.orientation }));
this.element = append(container, $('.monaco-pane-view'));
this.splitview = this._register(new SplitView(this.element, { orientation: this.orientation }));
this.onDidSashChange = this.splitview.onDidSashChange;
}
@ -534,9 +534,9 @@ export class PaneView extends Disposable {
const paneSizes = this.paneItems.map(pane => this.getPaneSize(pane.pane));
this.splitview.dispose();
clearNode(this.el);
clearNode(this.element);
this.splitview = this._register(new SplitView(this.el, { orientation: this.orientation }));
this.splitview = this._register(new SplitView(this.element, { orientation: this.orientation }));
const newOrthogonalSize = this.orientation === Orientation.VERTICAL ? width : height;
const newSize = this.orientation === Orientation.HORIZONTAL ? width : height;
@ -560,11 +560,11 @@ export class PaneView extends Disposable {
window.clearTimeout(this.animationTimer);
}
this.el.classList.add('animated');
this.element.classList.add('animated');
this.animationTimer = window.setTimeout(() => {
this.animationTimer = undefined;
this.el.classList.remove('animated');
this.element.classList.remove('animated');
}, 200);
}

View file

@ -205,25 +205,6 @@ export class ActionRunner extends Disposable implements IActionRunner {
}
}
export class RadioGroup extends Disposable {
constructor(readonly actions: Action[]) {
super();
for (const action of actions) {
this._register(action.onDidChange(e => {
if (e.checked && action.checked) {
for (const candidate of actions) {
if (candidate !== action) {
candidate.checked = false;
}
}
}
}));
}
}
}
export class Separator extends Action {
static readonly ID = 'vs.actions.separator';
@ -235,17 +216,6 @@ export class Separator extends Action {
}
}
export class ActionWithMenuAction extends Action {
get actions(): IAction[] {
return this._actions;
}
constructor(id: string, private _actions: IAction[], label?: string, cssClass?: string, enabled?: boolean, actionCallback?: (event?: any) => Promise<any>) {
super(id, label, cssClass, enabled, actionCallback);
}
}
export class SubmenuAction implements IAction {
readonly id: string;

View file

@ -275,6 +275,8 @@ class WorkspaceProvider implements IWorkspaceProvider {
static QUERY_PARAM_PAYLOAD = 'payload';
readonly trusted = undefined;
constructor(
public readonly workspace: IWorkspace,
public readonly payload: object

View file

@ -30,7 +30,7 @@ import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
import { ipcRenderer } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import { ILogService, ILoggerService, MultiplexLogService, ConsoleLogger } from 'vs/platform/log/common/log';
import { LoggerChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
import { LogLevelChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
import { LocalizationsService } from 'vs/platform/localizations/node/localizations';
import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
import { combinedDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
@ -42,7 +42,8 @@ import { StorageDataCleaner } from 'vs/code/electron-browser/sharedProcess/contr
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
import { IMainProcessService, MessagePortMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog';
import { DiagnosticsService, IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
import { DiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
import { IDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics';
import { FileService } from 'vs/platform/files/common/fileService';
import { IFileService } from 'vs/platform/files/common/files';
import { DiskFileSystemProvider } from 'vs/platform/files/node/diskFileSystemProvider';
@ -78,6 +79,7 @@ import { LocalizationsUpdater } from 'vs/code/electron-browser/sharedProcess/con
import { DeprecatedExtensionsCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/deprecatedExtensionsCleaner';
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { join } from 'vs/base/common/path';
class SharedProcessMain extends Disposable {
@ -142,13 +144,13 @@ class SharedProcessMain extends Disposable {
// Log
const mainRouter = new StaticRouter(ctx => ctx === 'main');
const loggerClient = new LoggerChannelClient(this.server.getChannel('logger', mainRouter)); // we only use this for log levels
const logLevelClient = new LogLevelChannelClient(this.server.getChannel('logLevel', mainRouter)); // we only use this for log levels
const multiplexLogger = this._register(new MultiplexLogService([
this._register(new ConsoleLogger(this.configuration.logLevel)),
this._register(new SpdLogLogger('sharedprocess', environmentService.logsPath, this.configuration.logLevel))
this._register(new SpdLogLogger('sharedprocess', join(environmentService.logsPath, 'sharedprocess.log'), true, this.configuration.logLevel))
]));
const logService = this._register(new FollowerLogService(loggerClient, multiplexLogger));
const logService = this._register(new FollowerLogService(logLevelClient, multiplexLogger));
services.set(ILogService, logService);
// Main Process

View file

@ -5,6 +5,7 @@
import { app, ipcMain, systemPreferences, contentTracing, protocol, BrowserWindow, dialog, session } from 'electron';
import { release } from 'os';
import { statSync } from 'fs';
import { IProcessEnvironment, isWindows, isMacintosh, isLinux, isLinuxSnap } from 'vs/base/common/platform';
import { WindowsMainService } from 'vs/platform/windows/electron-main/windowsMainService';
import { IWindowOpenable } from 'vs/platform/windows/common/windows';
@ -21,7 +22,7 @@ import { LaunchMainService, ILaunchMainService } from 'vs/platform/launch/electr
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ILogService } from 'vs/platform/log/common/log';
import { ILoggerService, ILogService } from 'vs/platform/log/common/log';
import { IStateService } from 'vs/platform/state/node/state';
import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@ -45,7 +46,7 @@ import { Win32UpdateService } from 'vs/platform/update/electron-main/updateServi
import { LinuxUpdateService } from 'vs/platform/update/electron-main/updateService.linux';
import { DarwinUpdateService } from 'vs/platform/update/electron-main/updateService.darwin';
import { IssueMainService, IIssueMainService } from 'vs/platform/issue/electron-main/issueMainService';
import { LoggerChannel } from 'vs/platform/log/common/logIpc';
import { LoggerChannel, LogLevelChannel } from 'vs/platform/log/common/logIpc';
import { setUnexpectedErrorHandler, onUnexpectedError } from 'vs/base/common/errors';
import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlListener';
import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver';
@ -64,8 +65,7 @@ import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
import { WorkspacesHistoryMainService, IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService';
import { NativeURLService } from 'vs/platform/url/common/urlService';
import { WorkspacesManagementMainService, IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService';
import { statSync } from 'fs';
import { IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
import { IDiagnosticsService } from 'vs/platform/diagnostics/common/diagnostics';
import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
import { ElectronExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/electron-main/extensionHostDebugIpc';
import { INativeHostMainService, NativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService';
@ -660,9 +660,12 @@ export class CodeApplication extends Disposable {
electronIpcServer.registerChannel('storage', storageChannel);
sharedProcessClient.then(client => client.registerChannel('storage', storageChannel));
const loggerChannel = new LoggerChannel(accessor.get(ILogService));
const logLevelChannel = new LogLevelChannel(accessor.get(ILogService));
electronIpcServer.registerChannel('logLevel', logLevelChannel);
sharedProcessClient.then(client => client.registerChannel('logLevel', logLevelChannel));
const loggerChannel = new LoggerChannel(accessor.get(ILoggerService),);
electronIpcServer.registerChannel('logger', loggerChannel);
sharedProcessClient.then(client => client.registerChannel('logger', loggerChannel));
const windowsMainService = this.windowsMainService = accessor.get(IWindowsMainService);
fileProtocolHandler.injectWindowsMainService(windowsMainService);

View file

@ -20,7 +20,7 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { ILogService, ConsoleMainLogger, MultiplexLogService, getLogLevel } from 'vs/platform/log/common/log';
import { ILogService, ConsoleMainLogger, MultiplexLogService, getLogLevel, ILoggerService } from 'vs/platform/log/common/log';
import { StateService } from 'vs/platform/state/node/stateService';
import { IStateService } from 'vs/platform/state/node/state';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
@ -49,11 +49,12 @@ import { IProductService } from 'vs/platform/product/common/productService';
import { IPathWithLineAndColumn, isValidBasename, parseLineAndColumnAware, sanitizeFilePath } from 'vs/base/common/extpath';
import { isNumber } from 'vs/base/common/types';
import { rtrim, trim } from 'vs/base/common/strings';
import { basename, resolve } from 'vs/base/common/path';
import { basename, join, resolve } from 'vs/base/common/path';
import { coalesce, distinct } from 'vs/base/common/arrays';
import { EnvironmentMainService, IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { LoggerService } from 'vs/platform/log/node/loggerService';
class ExpectedError extends Error {
readonly isExpected = true;
@ -133,7 +134,7 @@ class CodeMain {
const mainIpcServer = await this.doStartup(args, logService, environmentService, lifecycleMainService, instantiationService, true);
bufferLogService.logger = new SpdLogLogger('main', environmentService.logsPath, bufferLogService.getLevel());
bufferLogService.logger = new SpdLogLogger('main', join(environmentService.logsPath, 'main.log'), true, bufferLogService.getLevel());
once(lifecycleMainService.onWillShutdown)(() => {
fileService.dispose();
(configurationService as ConfigurationService).dispose();
@ -163,6 +164,8 @@ class CodeMain {
const diskFileSystemProvider = new DiskFileSystemProvider(logService);
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
services.set(ILoggerService, new LoggerService(logService, fileService));
services.set(IConfigurationService, new ConfigurationService(environmentService.settingsResource, fileService));
services.set(ILifecycleMainService, new SyncDescriptor(LifecycleMainService));
services.set(IStateService, new SyncDescriptor(StateService));

View file

@ -168,7 +168,6 @@ export class SharedProcess extends Disposable implements ISharedProcess {
nodeCachedDataDir: this.environmentService.nodeCachedDataDir,
backupWorkspacesPath: this.environmentService.backupWorkspacesPath,
userEnv: this.userEnv,
sharedIPCHandle: this.environmentService.sharedIPCHandle,
args: this.environmentService.args,
logLevel: this.logService.getLevel()
};

View file

@ -105,7 +105,7 @@ class CliMain extends Disposable {
// Log
const logLevel = getLogLevel(environmentService);
const loggers: ILogger[] = [];
loggers.push(new SpdLogLogger('cli', environmentService.logsPath, logLevel));
loggers.push(new SpdLogLogger('cli', join(environmentService.logsPath, 'cli.log'), true, logLevel));
if (logLevel === LogLevel.Trace) {
loggers.push(new ConsoleLogger(logLevel));
}

View file

@ -1659,9 +1659,17 @@ export interface CodeLensProvider {
resolveCodeLens?(model: model.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
}
export enum InlineHintKind {
Other = 0,
Type = 1,
Parameter = 2,
}
export interface InlineHint {
text: string;
range: IRange;
kind: InlineHintKind;
description?: string | IMarkdownString;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;

View file

@ -58,11 +58,12 @@ export const ModesRegistry = new EditorModesRegistry();
Registry.add(Extensions.ModesRegistry, ModesRegistry);
export const PLAINTEXT_MODE_ID = 'plaintext';
export const PLAINTEXT_EXTENSION = '.txt';
export const PLAINTEXT_LANGUAGE_IDENTIFIER = new LanguageIdentifier(PLAINTEXT_MODE_ID, LanguageId.PlainText);
ModesRegistry.registerLanguage({
id: PLAINTEXT_MODE_ID,
extensions: ['.txt'],
extensions: [PLAINTEXT_EXTENSION],
aliases: [nls.localize('plainText.alias', "Plain Text"), 'text'],
mimetypes: ['text/plain']
});

View file

@ -351,6 +351,12 @@ export enum IndentAction {
Outdent = 3
}
export enum InlineHintKind {
Other = 0,
Type = 1,
Parameter = 2
}
/**
* Virtual Key Codes, the value does not hold any inherent meaning.
* Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx

View file

@ -108,7 +108,7 @@ export class CodeLensContribution implements IEditorContribution {
newStyle += `.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${fontFamilyVar})}`;
}
this._styleElement.textContent = newStyle;
this._editor.getDomNode()?.style.setProperty(fontFamilyVar, fontFamily ?? 'inherit');
this._editor.getContainerDomNode().style.setProperty(fontFamilyVar, fontFamily ?? 'inherit');
//
this._editor.changeViewZones(accessor => {

View file

@ -624,6 +624,7 @@ export function createMonacoLanguagesAPI(): typeof monaco.languages {
IndentAction: standaloneEnums.IndentAction,
CompletionTriggerKind: standaloneEnums.CompletionTriggerKind,
SignatureHelpTriggerKind: standaloneEnums.SignatureHelpTriggerKind,
InlineHintKind: standaloneEnums.InlineHintKind,
// classes
FoldingRangeKind: modes.FoldingRangeKind,

7
src/vs/monaco.d.ts vendored
View file

@ -6410,9 +6410,16 @@ declare namespace monaco.languages {
resolveCodeLens?(model: editor.ITextModel, codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
}
export enum InlineHintKind {
Other = 0,
Type = 1,
Parameter = 2
}
export interface InlineHint {
text: string;
range: IRange;
kind: InlineHintKind;
description?: string | IMarkdownString;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;

View file

@ -6,7 +6,7 @@
import 'vs/css!./menuEntryActionViewItem';
import { asCSSUrl, ModifierKeyEmitter } from 'vs/base/browser/dom';
import { domEvent } from 'vs/base/browser/event';
import { IAction, Separator } from 'vs/base/common/actions';
import { IAction, Separator, SubmenuAction } from 'vs/base/common/actions';
import { IDisposable, toDisposable, MutableDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { localize } from 'vs/nls';
import { ICommandAction, IMenu, IMenuActionOptions, MenuItemAction, SubmenuItemAction, Icon } from 'vs/platform/actions/common/actions';
@ -27,10 +27,10 @@ export function createAndFillInContextMenuActions(menu: IMenu, options: IMenuAct
return asDisposable(groups);
}
export function createAndFillInActionBarActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[]; }, isPrimaryGroup?: (group: string) => boolean, primaryMaxCount?: number): IDisposable {
export function createAndFillInActionBarActions(menu: IMenu, options: IMenuActionOptions | undefined, target: IAction[] | { primary: IAction[]; secondary: IAction[]; }, isPrimaryGroup?: (group: string) => boolean, primaryMaxCount?: number, shouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean): IDisposable {
const groups = menu.getActions(options);
// Action bars handle alternative actions on their own so the alternative actions should be ignored
fillInActions(groups, target, false, isPrimaryGroup, primaryMaxCount);
fillInActions(groups, target, false, isPrimaryGroup, primaryMaxCount, shouldInlineSubmenu);
return asDisposable(groups);
}
@ -44,7 +44,14 @@ function asDisposable(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemActio
return disposables;
}
function fillInActions(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemAction | SubmenuItemAction>]>, target: IAction[] | { primary: IAction[]; secondary: IAction[]; }, useAlternativeActions: boolean, isPrimaryGroup: (group: string) => boolean = group => group === 'navigation', primaryMaxCount: number = Number.MAX_SAFE_INTEGER): void {
function fillInActions(
groups: ReadonlyArray<[string, ReadonlyArray<MenuItemAction | SubmenuItemAction>]>, target: IAction[] | { primary: IAction[]; secondary: IAction[]; },
useAlternativeActions: boolean,
isPrimaryGroup: (group: string) => boolean = group => group === 'navigation',
primaryMaxCount: number = Number.MAX_SAFE_INTEGER,
shouldInlineSubmenu: (action: SubmenuAction, group: string, groupSize: number) => boolean = () => false
): void {
let primaryBucket: IAction[];
let secondaryBucket: IAction[];
@ -56,18 +63,40 @@ function fillInActions(groups: ReadonlyArray<[string, ReadonlyArray<MenuItemActi
secondaryBucket = target.secondary;
}
for (let [group, actions] of groups) {
if (useAlternativeActions) {
actions = actions.map(a => (a instanceof MenuItemAction) && !!a.alt ? a.alt : a);
const submenuInfo = new Set<{ group: string, action: SubmenuAction, index: number }>();
for (const [group, actions] of groups) {
let target: IAction[];
if (isPrimaryGroup(group)) {
target = primaryBucket;
} else {
target = secondaryBucket;
if (target.length > 0) {
target.push(new Separator());
}
}
if (isPrimaryGroup(group)) {
primaryBucket.unshift(...actions);
} else {
if (secondaryBucket.length > 0) {
secondaryBucket.push(new Separator());
for (let action of actions) {
if (useAlternativeActions) {
action = action instanceof MenuItemAction && action.alt ? action.alt : action;
}
secondaryBucket.push(...actions);
const newLen = target.push(action);
// keep submenu info for later inlining
if (action instanceof SubmenuAction) {
submenuInfo.add({ group, action, index: newLen - 1 });
}
}
}
// ask the outside if submenu should be inlined or not. only ask when
// there would be enough space
for (const { group, action, index } of submenuInfo) {
const target = isPrimaryGroup(group) ? primaryBucket : secondaryBucket;
const submenuActions = action.actions;
if (target.length + submenuActions.length - 1 <= primaryMaxCount && shouldInlineSubmenu(action, group, target.length)) {
target.splice(index, 1, ...submenuActions);
}
}

View file

@ -89,6 +89,7 @@ export class MenuId {
static readonly EditorContext = new MenuId('EditorContext');
static readonly EditorContextPeek = new MenuId('EditorContextPeek');
static readonly EditorTitle = new MenuId('EditorTitle');
static readonly EditorTitleRun = new MenuId('EditorTitleRun');
static readonly EditorTitleContext = new MenuId('EditorTitleContext');
static readonly EmptyEditorGroupContext = new MenuId('EmptyEditorGroupContext');
static readonly ExplorerContext = new MenuId('ExplorerContext');
@ -175,7 +176,7 @@ export interface IMenuService {
readonly _serviceBrand: undefined;
createMenu(id: MenuId, contextKeyService: IContextKeyService): IMenu;
createMenu(id: MenuId, contextKeyService: IContextKeyService, emitEventsForSubmenuChanges?: boolean): IMenu;
}
export type ICommandsMap = Map<string, ICommandAction>;

View file

@ -20,8 +20,14 @@ export class MenuService implements IMenuService {
//
}
createMenu(id: MenuId, contextKeyService: IContextKeyService): IMenu {
return new Menu(id, this._commandService, contextKeyService, this);
/**
* Create a new menu for the given menu identifier. A menu sends events when it's entries
* have changed (placement, enablement, checked-state). By default it does send events for
* sub menu entries. That is more expensive and must be explicitly enabled with the
* `emitEventsForSubmenuChanges` flag.
*/
createMenu(id: MenuId, contextKeyService: IContextKeyService, emitEventsForSubmenuChanges: boolean = false): IMenu {
return new Menu(id, emitEventsForSubmenuChanges, this._commandService, contextKeyService, this);
}
}
@ -40,6 +46,7 @@ class Menu implements IMenu {
constructor(
private readonly _id: MenuId,
private readonly _fireEventsForSubmenuChanges: boolean,
@ICommandService private readonly _commandService: ICommandService,
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
@IMenuService private readonly _menuService: IMenuService
@ -93,23 +100,33 @@ class Menu implements IMenu {
group![1].push(item);
// keep keys for eventing
Menu._fillInKbExprKeys(item.when, this._contextKeys);
if (isIMenuItem(item)) {
// keep precondition keys for event if applicable
if (item.command.precondition) {
Menu._fillInKbExprKeys(item.command.precondition, this._contextKeys);
}
// keep toggled keys for event if applicable
if (item.command.toggled) {
const toggledExpression: ContextKeyExpression = (item.command.toggled as { condition: ContextKeyExpression }).condition || item.command.toggled;
Menu._fillInKbExprKeys(toggledExpression, this._contextKeys);
}
}
this._collectContextKeys(item);
}
this._onDidChange.fire(this);
}
private _collectContextKeys(item: IMenuItem | ISubmenuItem): void {
Menu._fillInKbExprKeys(item.when, this._contextKeys);
if (isIMenuItem(item)) {
// keep precondition keys for event if applicable
if (item.command.precondition) {
Menu._fillInKbExprKeys(item.command.precondition, this._contextKeys);
}
// keep toggled keys for event if applicable
if (item.command.toggled) {
const toggledExpression: ContextKeyExpression = (item.command.toggled as { condition: ContextKeyExpression }).condition || item.command.toggled;
Menu._fillInKbExprKeys(toggledExpression, this._contextKeys);
}
} else if (this._fireEventsForSubmenuChanges) {
// recursively collect context keys from submenus so that this
// menu fires events when context key changes affect submenus
MenuRegistry.getMenuItems(item.submenu).forEach(this._collectContextKeys, this);
}
}
getActions(options?: IMenuActionOptions): [string, Array<MenuItemAction | SubmenuItemAction>][] {
const result: [string, Array<MenuItemAction | SubmenuItemAction>][] = [];
for (let group of this._menuGroups) {

View file

@ -7,6 +7,20 @@ import { UriComponents } from 'vs/base/common/uri';
import { ProcessItem } from 'vs/base/common/processes';
import { IWorkspace } from 'vs/platform/workspace/common/workspace';
import { IStringDictionary } from 'vs/base/common/collections';
import { IMainProcessInfo } from 'vs/platform/launch/common/launch';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
export const ID = 'diagnosticsService';
export const IDiagnosticsService = createDecorator<IDiagnosticsService>(ID);
export interface IDiagnosticsService {
readonly _serviceBrand: undefined;
getPerformanceInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<PerformanceInfo>;
getSystemInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<SystemInfo>;
getDiagnostics(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<string>;
reportWorkspaceStats(workspace: IWorkspaceInformation): Promise<void>;
}
export interface IMachineInfo {
os: string;

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as osLib from 'os';
import { virtualMachineHint } from 'vs/base/node/id';
import { IMachineInfo, WorkspaceStats, WorkspaceStatItem, PerformanceInfo, SystemInfo, IRemoteDiagnosticInfo, IRemoteDiagnosticError, isRemoteDiagnosticError, IWorkspaceInformation } from 'vs/platform/diagnostics/common/diagnostics';
import { IDiagnosticsService, IMachineInfo, WorkspaceStats, WorkspaceStatItem, PerformanceInfo, SystemInfo, IRemoteDiagnosticInfo, IRemoteDiagnosticError, isRemoteDiagnosticError, IWorkspaceInformation } from 'vs/platform/diagnostics/common/diagnostics';
import { exists, readFile } from 'fs';
import { join, basename } from 'vs/base/common/path';
import { parse, ParseError, getNodeType } from 'vs/base/common/json';
@ -13,26 +13,13 @@ import product from 'vs/platform/product/common/product';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { URI } from 'vs/base/common/uri';
import { ProcessItem } from 'vs/base/common/processes';
import { IMainProcessInfo } from 'vs/platform/launch/node/launch';
import { IMainProcessInfo } from 'vs/platform/launch/common/launch';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Iterable } from 'vs/base/common/iterator';
import { Schemas } from 'vs/base/common/network';
import { ByteSize } from 'vs/platform/files/common/files';
import { IDirent, readdir } from 'vs/base/node/pfs';
export const ID = 'diagnosticsService';
export const IDiagnosticsService = createDecorator<IDiagnosticsService>(ID);
export interface IDiagnosticsService {
readonly _serviceBrand: undefined;
getPerformanceInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<PerformanceInfo>;
getSystemInfo(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<SystemInfo>;
getDiagnostics(mainProcessInfo: IMainProcessInfo, remoteInfo: (IRemoteDiagnosticInfo | IRemoteDiagnosticError)[]): Promise<string>;
reportWorkspaceStats(workspace: IWorkspaceInformation): Promise<void>;
}
export interface VersionInfo {
vscodeVersion: string;
os: string;

View file

@ -115,9 +115,6 @@ export interface INativeEnvironmentService extends IEnvironmentService {
machineSettingsResource: URI;
installSourcePath: string;
// --- IPC Handles
sharedIPCHandle: string;
// --- Extensions
extensionsPath: string;
extensionsDownloadPath: string;

View file

@ -14,7 +14,6 @@ import product from 'vs/platform/product/common/product';
import { toLocalISOString } from 'vs/base/common/date';
import { FileAccess } from 'vs/base/common/network';
import { URI } from 'vs/base/common/uri';
import { createStaticIPCHandle } from 'vs/base/parts/ipc/node/ipc.net';
export class NativeEnvironmentService implements INativeEnvironmentService {
@ -188,9 +187,6 @@ export class NativeEnvironmentService implements INativeEnvironmentService {
get verbose(): boolean { return !!this._args.verbose; }
get logLevel(): string | undefined { return this._args.log; }
@memoize
get sharedIPCHandle(): string { return createStaticIPCHandle(this.userDataPath, 'shared', product.version); }
@memoize
get serviceMachineIdResource(): URI { return resources.joinPath(URI.file(this.userDataPath), 'machineid'); }

View file

@ -10,8 +10,7 @@ import { parseArgs, OPTIONS } from 'vs/platform/environment/node/argv';
import { ICommonIssueService, IssueReporterData, IssueReporterFeatures, ProcessExplorerData } from 'vs/platform/issue/common/issue';
import { BrowserWindow, ipcMain, screen, IpcMainEvent, Display } from 'electron';
import { ILaunchMainService } from 'vs/platform/launch/electron-main/launchMainService';
import { PerformanceInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
import { IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsService';
import { IDiagnosticsService, PerformanceInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
import { IEnvironmentMainService } from 'vs/platform/environment/electron-main/environmentMainService';
import { isMacintosh, IProcessEnvironment } from 'vs/base/common/platform';
import { ILogService } from 'vs/platform/log/common/log';

View file

@ -17,7 +17,7 @@ import { URI } from 'vs/base/common/uri';
import { BrowserWindow, ipcMain, Event as IpcEvent, app } from 'electron';
import { coalesce } from 'vs/base/common/arrays';
import { IDiagnosticInfoOptions, IDiagnosticInfo, IRemoteDiagnosticInfo, IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics';
import { IMainProcessInfo, IWindowInfo } from 'vs/platform/launch/node/launch';
import { IMainProcessInfo, IWindowInfo } from 'vs/platform/launch/common/launch';
import { isLaunchedFromCli } from 'vs/platform/environment/node/argvHelper';
import { CancellationToken } from 'vs/base/common/cancellation';
import { isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';

View file

@ -174,7 +174,7 @@ export class FileLoggerService extends Disposable implements ILoggerService {
this._register(logService.onDidChangeLogLevel(level => this.loggers.forEach(logger => logger.setLevel(level))));
}
getLogger(resource: URI): ILogger {
createLogger(resource: URI): ILogger {
let logger = this.loggers.get(resource.toString());
if (!logger) {
logger = new BufferLogService(this.logService.getLevel());

View file

@ -8,7 +8,6 @@ import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import { isWindows } from 'vs/base/common/platform';
import { Event, Emitter } from 'vs/base/common/event';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { LoggerChannelClient } from 'vs/platform/log/common/logIpc';
import { URI } from 'vs/base/common/uri';
import { toErrorMessage } from 'vs/base/common/errorMessage';
@ -53,10 +52,36 @@ export interface ILogService extends ILogger {
readonly _serviceBrand: undefined;
}
export interface ILoggerOptions {
/**
* Name of the logger.
*/
name?: string;
/**
* Do not create rotating files if max size exceeds.
*/
donotRotate?: boolean;
/**
* Do not use formatters.
*/
donotUseFormatters?: boolean;
/**
* If set, logger logs the message always.
*/
always?: boolean;
}
export interface ILoggerService {
readonly _serviceBrand: undefined;
getLogger(file: URI): ILogger;
/**
* Creates a logger
*/
createLogger(file: URI, options?: ILoggerOptions): ILogger;
}
export abstract class AbstractLogger extends Disposable {
@ -78,6 +103,83 @@ export abstract class AbstractLogger extends Disposable {
}
export abstract class AbstractMessageLogger extends AbstractLogger implements ILogger {
protected abstract log(level: LogLevel, message: string): void;
constructor(private readonly logAlways?: boolean) {
super();
}
private checkLogLevel(level: LogLevel): boolean {
return this.logAlways || this.getLevel() <= level;
}
trace(message: string, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Trace)) {
this.log(LogLevel.Trace, this.format([message, ...args]));
}
}
debug(message: string, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Debug)) {
this.log(LogLevel.Debug, this.format([message, ...args]));
}
}
info(message: string, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Info)) {
this.log(LogLevel.Info, this.format([message, ...args]));
}
}
warn(message: string, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Warning)) {
this.log(LogLevel.Warning, this.format([message, ...args]));
}
}
error(message: string | Error, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Error)) {
if (message instanceof Error) {
const array = Array.prototype.slice.call(arguments) as any[];
array[0] = message.stack;
this.log(LogLevel.Error, this.format(array));
} else {
this.log(LogLevel.Error, this.format([message, ...args]));
}
}
}
critical(message: string | Error, ...args: any[]): void {
if (this.checkLogLevel(LogLevel.Critical)) {
this.log(LogLevel.Critical, this.format([message, ...args]));
}
}
flush(): void { }
private format(args: any): string {
let result = '';
for (let i = 0; i < args.length; i++) {
let a = args[i];
if (typeof a === 'object') {
try {
a = JSON.stringify(a);
} catch (e) { }
}
result += (i > 0 ? ' ' : '') + a;
}
return result;
}
}
export class ConsoleMainLogger extends AbstractLogger implements ILogger {
private useColors: boolean;
@ -270,13 +372,6 @@ export class AdapterLogger extends AbstractLogger implements ILogger {
}
}
export class ConsoleLogInMainService extends AdapterLogger implements ILogger {
constructor(client: LoggerChannelClient, logLevel: LogLevel = DEFAULT_LOG_LEVEL) {
super({ log: (type, args) => client.consoleLog(type, args) }, logLevel);
}
}
export class MultiplexLogService extends AbstractLogger implements ILogService {
declare readonly _serviceBrand: undefined;

View file

@ -4,10 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
import { LogLevel, ILogService, LogService } from 'vs/platform/log/common/log';
import { LogLevel, ILogService, LogService, ILoggerService, ILogger, AbstractMessageLogger, ILoggerOptions } from 'vs/platform/log/common/log';
import { Event } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
export class LoggerChannel implements IServerChannel {
export class LogLevelChannel implements IServerChannel {
onDidChangeLogLevel: Event<LogLevel>;
@ -23,35 +24,83 @@ export class LoggerChannel implements IServerChannel {
throw new Error(`Event not found: ${event}`);
}
call(_: unknown, command: string, arg?: any): Promise<any> {
async call(_: unknown, command: string, arg?: any): Promise<any> {
switch (command) {
case 'setLevel': this.service.setLevel(arg); return Promise.resolve();
case 'consoleLog': this.consoleLog(arg[0], arg[1]); return Promise.resolve();
case 'setLevel': return this.service.setLevel(arg);
}
throw new Error(`Call not found: ${command}`);
}
private consoleLog(severity: string, args: string[]): void {
let consoleFn = console.log;
}
switch (severity) {
case 'error':
consoleFn = console.error;
break;
case 'warn':
consoleFn = console.warn;
break;
case 'info':
consoleFn = console.info;
break;
export class LoggerChannel implements IServerChannel {
private consoleLogger: ILogger | undefined;
private readonly loggers = new Map<string, ILogger>();
constructor(private readonly loggerService: ILoggerService) { }
listen(_: unknown, event: string): Event<any> {
throw new Error(`Event not found: ${event}`);
}
async call(_: unknown, command: string, arg?: any): Promise<any> {
switch (command) {
case 'createConsoleLogger': return this.createConsoleLogger();
case 'createLogger': this.createLogger(URI.revive(arg[0]), arg[1]); return;
case 'log': return this.log(URI.revive(arg[0]), arg[1]);
}
consoleFn.call(console, ...args);
throw new Error(`Call not found: ${command}`);
}
private createConsoleLogger(): void {
this.consoleLogger = new class extends AbstractMessageLogger {
protected log(level: LogLevel, message: string) {
let consoleFn = console.log;
switch (level) {
case LogLevel.Error:
consoleFn = console.error;
break;
case LogLevel.Warning:
consoleFn = console.warn;
break;
case LogLevel.Info:
consoleFn = console.info;
break;
}
consoleFn.call(console, message);
}
}();
}
private createLogger(file: URI, options: ILoggerOptions): void {
this.loggers.set(file.toString(), this.loggerService.createLogger(file, options));
}
private log(file: URI | undefined, messages: [LogLevel, string][]): void {
const logger = file ? this.loggers.get(file.toString()) : this.consoleLogger;
if (!logger) {
throw new Error('Create the logger before logging');
}
for (const [level, message] of messages) {
switch (level) {
case LogLevel.Trace: logger.trace(message); break;
case LogLevel.Debug: logger.debug(message); break;
case LogLevel.Info: logger.info(message); break;
case LogLevel.Warning: logger.warn(message); break;
case LogLevel.Error: logger.error(message); break;
case LogLevel.Critical: logger.critical(message); break;
default: throw new Error('Invalid log level');
}
}
}
}
export class LoggerChannelClient {
export class LogLevelChannelClient {
constructor(private channel: IChannel) { }
@ -60,22 +109,19 @@ export class LoggerChannelClient {
}
setLevel(level: LogLevel): void {
LoggerChannelClient.setLevel(this.channel, level);
LogLevelChannelClient.setLevel(this.channel, level);
}
public static setLevel(channel: IChannel, level: LogLevel): Promise<void> {
return channel.call('setLevel', level);
}
consoleLog(severity: string, args: string[]): void {
this.channel.call('consoleLog', [severity, args]);
}
}
export class FollowerLogService extends LogService implements ILogService {
declare readonly _serviceBrand: undefined;
constructor(private parent: LoggerChannelClient, logService: ILogService) {
constructor(private parent: LogLevelChannelClient, logService: ILogService) {
super(logService);
this._register(parent.onDidChangeLogLevel(level => logService.setLevel(level)));
}

View file

@ -3,45 +3,54 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ILogService, ILoggerService, ILogger } from 'vs/platform/log/common/log';
import { ILogService, ILoggerService, ILogger, ILoggerOptions, LogLevel } from 'vs/platform/log/common/log';
import { Disposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { basename, extname, dirname } from 'vs/base/common/resources';
import { basename } from 'vs/base/common/resources';
import { Schemas } from 'vs/base/common/network';
import { FileLogger } from 'vs/platform/log/common/fileLog';
import { SpdLogLogger } from 'vs/platform/log/node/spdlogLog';
import { IFileService } from 'vs/platform/files/common/files';
import { generateUuid } from 'vs/base/common/uuid';
export class LoggerService extends Disposable implements ILoggerService {
declare readonly _serviceBrand: undefined;
private readonly loggers = new Map<string, ILogger>();
private readonly logLevelChangeableLoggers: ILogger[] = [];
constructor(
@ILogService private logService: ILogService,
@IFileService private fileService: IFileService
) {
super();
this._register(logService.onDidChangeLogLevel(level => this.loggers.forEach(logger => logger.setLevel(level))));
this._register(logService.onDidChangeLogLevel(level => this.logLevelChangeableLoggers.forEach(logger => logger.setLevel(level))));
}
getLogger(resource: URI): ILogger {
createLogger(resource: URI, options?: ILoggerOptions): ILogger {
let logger = this.loggers.get(resource.toString());
if (!logger) {
if (resource.scheme === Schemas.file) {
const baseName = basename(resource);
const ext = extname(resource);
logger = new SpdLogLogger(baseName.substring(0, baseName.length - ext.length), dirname(resource).fsPath, this.logService.getLevel());
logger = new SpdLogLogger(options?.name || generateUuid(), resource.fsPath, !options?.donotRotate, this.logService.getLevel());
if (options?.donotUseFormatters) {
(<SpdLogLogger>logger).clearFormatters();
}
} else {
logger = new FileLogger(basename(resource), resource, this.logService.getLevel(), this.fileService);
logger = new FileLogger(options?.name ?? basename(resource), resource, this.logService.getLevel(), this.fileService);
}
this.loggers.set(resource.toString(), logger);
if (options?.always) {
logger.setLevel(LogLevel.Trace);
} else {
this.logLevelChangeableLoggers.push(logger);
}
}
return logger;
}
dispose(): void {
this.logLevelChangeableLoggers.splice(0, this.logLevelChangeableLoggers.length);
this.loggers.forEach(logger => logger.dispose());
this.loggers.clear();
super.dispose();

View file

@ -3,18 +3,16 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'vs/base/common/path';
import { LogLevel, AbstractLogger, ILogger } from 'vs/platform/log/common/log';
import { LogLevel, ILogger, AbstractMessageLogger } from 'vs/platform/log/common/log';
import * as spdlog from 'spdlog';
import { ByteSize } from 'vs/platform/files/common/files';
async function createSpdLogLogger(processName: string, logsFolder: string): Promise<spdlog.RotatingLogger | null> {
async function createSpdLogLogger(name: string, logfilePath: string, filesize: number, filecount: number): Promise<spdlog.RotatingLogger | null> {
// Do not crash if spdlog cannot be loaded
try {
const _spdlog = await import('spdlog');
_spdlog.setAsyncMode(8192, 500);
const logfilePath = path.join(logsFolder, `${processName}.log`);
return _spdlog.createRotatingLoggerAsync(processName, logfilePath, 5 * ByteSize.MB, 6);
return _spdlog.createRotatingLoggerAsync(name, logfilePath, filesize, filecount);
} catch (e) {
console.error(e);
}
@ -43,16 +41,21 @@ function log(logger: spdlog.RotatingLogger, level: LogLevel, message: string): v
}
}
export class SpdLogLogger extends AbstractLogger implements ILogger {
export class SpdLogLogger extends AbstractMessageLogger implements ILogger {
private buffer: ILog[] = [];
private _loggerCreationPromise: Promise<void> | undefined = undefined;
private readonly _loggerCreationPromise: Promise<void>;
private _logger: spdlog.RotatingLogger | undefined;
constructor(private readonly name: string, private readonly logsFolder: string, level: LogLevel) {
constructor(
private readonly name: string,
private readonly filepath: string,
private readonly rotating: boolean,
level: LogLevel
) {
super();
this.setLevel(level);
this._createSpdLogLogger();
this._loggerCreationPromise = this._createSpdLogLogger();
this._register(this.onDidChangeLogLevel(level => {
if (this._logger) {
this._logger.setLevel(level);
@ -61,23 +64,22 @@ export class SpdLogLogger extends AbstractLogger implements ILogger {
}
private _createSpdLogLogger(): Promise<void> {
if (!this._loggerCreationPromise) {
this._loggerCreationPromise = createSpdLogLogger(this.name, this.logsFolder)
.then(logger => {
if (logger) {
this._logger = logger;
this._logger.setLevel(this.getLevel());
for (const { level, message } of this.buffer) {
log(this._logger, level, message);
}
this.buffer = [];
const filecount = this.rotating ? 6 : 1;
const filesize = (30 / filecount) * ByteSize.MB;
return createSpdLogLogger(this.name, this.filepath, filesize, filecount)
.then(logger => {
if (logger) {
this._logger = logger;
this._logger.setLevel(this.getLevel());
for (const { level, message } of this.buffer) {
log(this._logger, level, message);
}
});
}
return this._loggerCreationPromise;
this.buffer = [];
}
});
}
private _log(level: LogLevel, message: string): void {
protected log(level: LogLevel, message: string): void {
if (this._logger) {
log(this._logger, level, message);
} else if (this.getLevel() <= level) {
@ -85,53 +87,18 @@ export class SpdLogLogger extends AbstractLogger implements ILogger {
}
}
trace(message: string, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Trace) {
this._log(LogLevel.Trace, this.format([message, ...args]));
}
}
debug(message: string, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Debug) {
this._log(LogLevel.Debug, this.format([message, ...args]));
}
}
info(message: string, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Info) {
this._log(LogLevel.Info, this.format([message, ...args]));
}
}
warn(message: string, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Warning) {
this._log(LogLevel.Warning, this.format([message, ...args]));
}
}
error(message: string | Error, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Error) {
if (message instanceof Error) {
const array = Array.prototype.slice.call(arguments) as any[];
array[0] = message.stack;
this._log(LogLevel.Error, this.format(array));
} else {
this._log(LogLevel.Error, this.format([message, ...args]));
}
}
}
critical(message: string | Error, ...args: any[]): void {
if (this.getLevel() <= LogLevel.Critical) {
this._log(LogLevel.Critical, this.format([message, ...args]));
clearFormatters(): void {
if (this._logger) {
this._logger.clearFormatters();
} else {
this._loggerCreationPromise.then(() => this.clearFormatters());
}
}
flush(): void {
if (this._logger) {
this._logger.flush();
} else if (this._loggerCreationPromise) {
} else {
this._loggerCreationPromise.then(() => this.flush());
}
}
@ -139,10 +106,9 @@ export class SpdLogLogger extends AbstractLogger implements ILogger {
dispose(): void {
if (this._logger) {
this.disposeLogger();
} else if (this._loggerCreationPromise) {
} else {
this._loggerCreationPromise.then(() => this.disposeLogger());
}
this._loggerCreationPromise = undefined;
}
private disposeLogger(): void {
@ -151,22 +117,4 @@ export class SpdLogLogger extends AbstractLogger implements ILogger {
this._logger = undefined;
}
}
private format(args: any): string {
let result = '';
for (let i = 0; i < args.length; i++) {
let a = args[i];
if (typeof a === 'object') {
try {
a = JSON.stringify(a);
} catch (e) { }
}
result += (i > 0 ? ' ' : '') + a;
}
return result;
}
}

Some files were not shown because too many files have changed in this diff Show more