mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
"git": {
|
||||
"name": "mmims/language-batchfile",
|
||||
"repositoryUrl": "https://github.com/mmims/language-batchfile",
|
||||
"commitHash": "4b67596631b4ecd2c89c2ec1b2e08a6623438903"
|
||||
"commitHash": "95ea8c699f7a8296b15767069868532d52631c46"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.7.4"
|
||||
"version": "0.7.5"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/mmims/language-batchfile/commit/4b67596631b4ecd2c89c2ec1b2e08a6623438903",
|
||||
"version": "https://github.com/mmims/language-batchfile/commit/95ea8c699f7a8296b15767069868532d52631c46",
|
||||
"name": "Batch File",
|
||||
"scopeName": "source.batchfile",
|
||||
"patterns": [
|
||||
@@ -46,7 +46,7 @@
|
||||
"commands": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
||||
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|scp|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|ssh|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
||||
"name": "keyword.command.batchfile"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -96,6 +96,6 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.25"
|
||||
"@types/node": "^10.12.21"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ const fadedDecoration = vscode.window.createTextEditorDecorationType({
|
||||
let pendingLaunchJsonDecoration: NodeJS.Timer;
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
//keybindings.json command-suggestions
|
||||
context.subscriptions.push(registerKeybindingsCompletions());
|
||||
|
||||
//settings.json suggestions
|
||||
context.subscriptions.push(registerSettingsCompletions());
|
||||
|
||||
@@ -94,23 +91,6 @@ function autoFixSettingsJSON(willSaveEvent: vscode.TextDocumentWillSaveEvent): v
|
||||
vscode.workspace.applyEdit(edit));
|
||||
}
|
||||
|
||||
function registerKeybindingsCompletions(): vscode.Disposable {
|
||||
const commands = vscode.commands.getCommands(true);
|
||||
|
||||
return vscode.languages.registerCompletionItemProvider({ pattern: '**/keybindings.json' }, {
|
||||
|
||||
provideCompletionItems(document, position, _token) {
|
||||
const location = getLocation(document.getText(), document.offsetAt(position));
|
||||
if (location.path[1] === 'command') {
|
||||
|
||||
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
|
||||
return commands.then(ids => ids.map(id => newSimpleCompletionItem(JSON.stringify(id), range)));
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function registerSettingsCompletions(): vscode.Disposable {
|
||||
return vscode.languages.registerCompletionItemProvider({ language: 'jsonc', pattern: '**/settings.json' }, {
|
||||
provideCompletionItems(document, position, token) {
|
||||
@@ -207,16 +187,6 @@ function provideInstalledExtensionProposals(extensionsContent: IExtensionsConten
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function newSimpleCompletionItem(label: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem {
|
||||
const item = new vscode.CompletionItem(label);
|
||||
item.kind = vscode.CompletionItemKind.Value;
|
||||
item.detail = description;
|
||||
item.insertText = insertText || label;
|
||||
item.range = range;
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
function updateLaunchJsonDecorations(editor: vscode.TextEditor | undefined): void {
|
||||
if (!editor || path.basename(editor.document.fileName) !== 'launch.json') {
|
||||
return;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
jsonc-parser@2.0.2:
|
||||
version "2.0.2"
|
||||
|
||||
@@ -1,49 +1,54 @@
|
||||
{
|
||||
"name": "dacpac",
|
||||
"displayName": "SQL Server Dacpac",
|
||||
"description": "SQL Server Dacpac for Azure Data Studio.",
|
||||
"version": "0.1.0",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"engines": {
|
||||
"vscode": "^1.25.0",
|
||||
"sqlops": "*"
|
||||
},
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||
"icon": "images/sqlserver.png",
|
||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"main": "./out/main",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||
},
|
||||
"extensionDependencies": [
|
||||
"Microsoft.mssql"
|
||||
],
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "dacFx.start",
|
||||
"title": "Data-tier Application wizard",
|
||||
"category": "Data-tier Application"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"objectExplorer/item/context": [
|
||||
{
|
||||
"command": "dacFx.start",
|
||||
"when": "connectionProvider == MSSQL && nodeType && nodeType == Database",
|
||||
"group": "export"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"htmlparser2": "^3.10.1",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
"name": "dacpac",
|
||||
"displayName": "SQL Server Dacpac",
|
||||
"description": "SQL Server Dacpac for Azure Data Studio.",
|
||||
"version": "0.1.0",
|
||||
"publisher": "Microsoft",
|
||||
"preview": true,
|
||||
"engines": {
|
||||
"vscode": "^1.25.0",
|
||||
"sqlops": "*"
|
||||
},
|
||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/LICENSE.txt",
|
||||
"icon": "images/sqlserver.png",
|
||||
"aiKey": "AIF-5574968e-856d-40d2-af67-c89a14e76412",
|
||||
"activationEvents": [
|
||||
"*"
|
||||
],
|
||||
"main": "./out/main",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Microsoft/azuredatastudio.git"
|
||||
},
|
||||
"extensionDependencies": [
|
||||
"Microsoft.mssql"
|
||||
],
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "dacFx.start",
|
||||
"title": "Data-tier Application wizard",
|
||||
"category": "Data-tier Application"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"objectExplorer/item/context": [
|
||||
{
|
||||
"command": "dacFx.start",
|
||||
"when": "connectionProvider == MSSQL && nodeType && nodeType == Database",
|
||||
"group": "export"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"htmlparser2": "^3.10.1",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"__metadata": {
|
||||
"id": "33",
|
||||
"publisherDisplayName": "Microsoft",
|
||||
"publisherId": "Microsoft"
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/markdown-it": "0.0.2",
|
||||
"@types/node": "^8.10.25"
|
||||
"@types/node": "^10.12.21"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660"
|
||||
integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA=
|
||||
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
"@types/node@^6.0.46":
|
||||
version "6.0.78"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470"
|
||||
integrity sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "textmate/git.tmbundle",
|
||||
"repositoryUrl": "https://github.com/textmate/git.tmbundle",
|
||||
"commitHash": "93897a78c6e52bef13dadc0d4091d203c5facb40"
|
||||
"commitHash": "3f6ad2138200db14b57a090ecb2d2e733275ca3e"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
@@ -63,4 +63,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -320,6 +320,16 @@
|
||||
"title": "%command.pushWithTagsForce%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
"command": "git.addRemote",
|
||||
"title": "%command.addRemote%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
"command": "git.removeRemote",
|
||||
"title": "%command.removeRemote%",
|
||||
"category": "Git"
|
||||
},
|
||||
{
|
||||
"command": "git.sync",
|
||||
"title": "%command.sync%",
|
||||
@@ -570,6 +580,14 @@
|
||||
"command": "git.pushWithTagsForce",
|
||||
"when": "config.git.enabled && config.git.allowForcePush && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.addRemote",
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.removeRemote",
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.sync",
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
@@ -1150,6 +1168,7 @@
|
||||
"%config.postCommitCommand.sync%"
|
||||
],
|
||||
"markdownDescription": "%config.postCommitCommand%",
|
||||
"scope": "resource",
|
||||
"default": "none"
|
||||
},
|
||||
"git.showInlineOpenFileAction": {
|
||||
@@ -1182,7 +1201,7 @@
|
||||
"number",
|
||||
"null"
|
||||
],
|
||||
"default": null,
|
||||
"default": 50,
|
||||
"description": "%config.inputValidationSubjectLength%"
|
||||
},
|
||||
"git.detectSubmodules": {
|
||||
@@ -1425,7 +1444,7 @@
|
||||
"@types/byline": "4.2.31",
|
||||
"@types/file-type": "^5.2.1",
|
||||
"@types/mocha": "2.2.43",
|
||||
"@types/node": "^8.10.25",
|
||||
"@types/node": "^10.12.21",
|
||||
"@types/which": "^1.0.28",
|
||||
"mocha": "^3.2.0"
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
"command.pushToForce": "Push to... (Force)",
|
||||
"command.pushWithTags": "Push With Tags",
|
||||
"command.pushWithTagsForce": "Push With Tags (Force)",
|
||||
"command.addRemote": "Add Remote",
|
||||
"command.removeRemote": "Remove Remote",
|
||||
"command.sync": "Sync",
|
||||
"command.syncRebase": "Sync (Rebase)",
|
||||
"command.publish": "Publish Branch",
|
||||
|
||||
@@ -65,7 +65,7 @@ export class Askpass implements Disposable {
|
||||
return ipcHandlePath;
|
||||
}
|
||||
|
||||
private onRequest(req: http.ServerRequest, res: http.ServerResponse): void {
|
||||
private onRequest(req: http.IncomingMessage, res: http.ServerResponse): void {
|
||||
const chunks: string[] = [];
|
||||
req.setEncoding('utf8');
|
||||
req.on('data', (d: string) => chunks.push(d));
|
||||
|
||||
@@ -649,14 +649,16 @@ export class CommandCenter {
|
||||
|
||||
if (!(resource instanceof Resource)) {
|
||||
// can happen when called from a keybinding
|
||||
console.log('WHAT');
|
||||
resource = this.getSCMResource();
|
||||
}
|
||||
|
||||
if (resource) {
|
||||
const resources = ([resource, ...resourceStates] as Resource[])
|
||||
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED);
|
||||
|
||||
uris = resources.map(r => r.resourceUri);
|
||||
uris = ([resource, ...resourceStates] as Resource[])
|
||||
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED)
|
||||
.map(r => r.resourceUri);
|
||||
} else if (window.activeTextEditor) {
|
||||
uris = [window.activeTextEditor.document.uri];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,6 +667,7 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
const activeTextEditor = window.activeTextEditor;
|
||||
|
||||
for (const uri of uris) {
|
||||
const opts: TextDocumentShowOptions = {
|
||||
preserveFocus,
|
||||
@@ -1458,8 +1461,7 @@ export class CommandCenter {
|
||||
name.trim().replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, branchWhitespaceChar)
|
||||
: name;
|
||||
|
||||
const rawBranchName = await window.showInputBox({
|
||||
value: defaultName,
|
||||
const rawBranchName = defaultName || await window.showInputBox({
|
||||
placeHolder: localize('branch name', "Branch name"),
|
||||
prompt: localize('provide branch name', "Please provide a branch name"),
|
||||
ignoreFocusOut: true,
|
||||
@@ -1480,7 +1482,7 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
const picks = [new HEADItem(repository), ...createCheckoutItems(repository)];
|
||||
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create a new branch from');
|
||||
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create the \'{0}\' branch from', branchName);
|
||||
const target = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!target) {
|
||||
@@ -1801,6 +1803,72 @@ export class CommandCenter {
|
||||
await this._push(repository, { pushType: PushType.PushTo, forcePush: true });
|
||||
}
|
||||
|
||||
@command('git.addRemote', { repository: true })
|
||||
async addRemote(repository: Repository): Promise<void> {
|
||||
const remotes = repository.remotes;
|
||||
|
||||
const sanitize = (name: string) => {
|
||||
name = name.trim();
|
||||
return name && name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, '-');
|
||||
};
|
||||
|
||||
const resultName = await window.showInputBox({
|
||||
placeHolder: localize('remote name', "Remote name"),
|
||||
prompt: localize('provide remote name', "Please provide a remote name"),
|
||||
ignoreFocusOut: true,
|
||||
validateInput: (name: string) => {
|
||||
if (sanitize(name)) {
|
||||
return null;
|
||||
}
|
||||
return localize('remote name format invalid', "Remote name format invalid");
|
||||
}
|
||||
});
|
||||
|
||||
const name = sanitize(resultName || '');
|
||||
|
||||
if (!name) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (remotes.find(r => r.name === name)) {
|
||||
window.showErrorMessage(localize('remote already exists', "Remote '{0}' already exists.", name));
|
||||
return;
|
||||
}
|
||||
|
||||
const url = await window.showInputBox({
|
||||
placeHolder: localize('remote url', "Remote URL"),
|
||||
prompt: localize('provide remote URL', "Enter URL for remote \"{0}\"", name),
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
await repository.addRemote(name, url);
|
||||
}
|
||||
|
||||
@command('git.removeRemote', { repository: true })
|
||||
async removeRemote(repository: Repository): Promise<void> {
|
||||
const remotes = repository.remotes;
|
||||
|
||||
if (remotes.length === 0) {
|
||||
window.showErrorMessage(localize('no remotes added', "Your repository has no remotes."));
|
||||
return;
|
||||
}
|
||||
|
||||
const picks = remotes.map(r => r.name);
|
||||
const placeHolder = localize('remove remote', "Pick a remote to remove");
|
||||
|
||||
const remoteName = await window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!remoteName) {
|
||||
return;
|
||||
}
|
||||
|
||||
await repository.removeRemote(remoteName);
|
||||
}
|
||||
|
||||
private async _sync(repository: Repository, rebase: boolean): Promise<void> {
|
||||
const HEAD = repository.HEAD;
|
||||
|
||||
@@ -2118,6 +2186,7 @@ export class CommandCenter {
|
||||
uri = uri ? uri : (window.activeTextEditor && window.activeTextEditor.document.uri);
|
||||
|
||||
this.outputChannel.appendLine(`git.getSCMResource.uri ${uri && uri.toString()}`);
|
||||
|
||||
for (const r of this.model.repositories.map(r => r.root)) {
|
||||
this.outputChannel.appendLine(`repo root ${r}`);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ class GitIgnoreDecorationProvider implements DecorationProvider {
|
||||
private disposables: Disposable[] = [];
|
||||
|
||||
constructor(private model: Model) {
|
||||
//todo@joh -> events when the ignore status actually changes, not only when the file changes
|
||||
this.onDidChangeDecorations = fireEvent(anyEvent<any>(
|
||||
filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore')),
|
||||
model.onDidOpenRepository,
|
||||
@@ -119,7 +118,7 @@ class GitDecorationProvider implements DecorationProvider {
|
||||
|
||||
const uris = new Set([...this.decorations.keys()].concat([...newDecorations.keys()]));
|
||||
this.decorations = newDecorations;
|
||||
this._onDidChangeDecorations.fire([...uris.values()].map(Uri.parse));
|
||||
this._onDidChangeDecorations.fire([...uris.values()].map(value => Uri.parse(value, true)));
|
||||
}
|
||||
|
||||
private collectDecorationData(group: GitResourceGroup, bucket: Map<string, DecorationData>): void {
|
||||
|
||||
@@ -349,7 +349,7 @@ export class Git {
|
||||
await mkdirp(parentPath);
|
||||
|
||||
try {
|
||||
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
|
||||
await this.exec(parentPath, ['clone', url.includes(' ') ? encodeURI(url) : url, folderPath], { cancellationToken });
|
||||
} catch (err) {
|
||||
if (err.stderr) {
|
||||
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
|
||||
@@ -1201,7 +1201,7 @@ export class Repository {
|
||||
}
|
||||
|
||||
async branch(name: string, checkout: boolean, ref?: string): Promise<void> {
|
||||
const args = checkout ? ['checkout', '-q', '-b', name] : ['branch', '-q', name];
|
||||
const args = checkout ? ['checkout', '-q', '-b', name, '--no-track'] : ['branch', '-q', name];
|
||||
|
||||
if (ref) {
|
||||
args.push(ref);
|
||||
@@ -1456,14 +1456,14 @@ export class Repository {
|
||||
|
||||
async createStash(message?: string, includeUntracked?: boolean): Promise<void> {
|
||||
try {
|
||||
const args = ['stash', 'save'];
|
||||
const args = ['stash', 'push'];
|
||||
|
||||
if (includeUntracked) {
|
||||
args.push('-u');
|
||||
}
|
||||
|
||||
if (message) {
|
||||
args.push('--', message);
|
||||
args.push('-m', message);
|
||||
}
|
||||
|
||||
await this.run(args);
|
||||
|
||||
@@ -206,7 +206,7 @@ export class Resource implements SourceControlResourceState {
|
||||
case Status.INDEX_ADDED:
|
||||
case Status.INTENT_TO_ADD:
|
||||
return new ThemeColor('gitDecoration.addedResourceForeground');
|
||||
case Status.INDEX_RENAMED: // todo@joh - special color?
|
||||
case Status.INDEX_RENAMED:
|
||||
case Status.UNTRACKED:
|
||||
return new ThemeColor('gitDecoration.untrackedResourceForeground');
|
||||
case Status.IGNORED:
|
||||
@@ -673,20 +673,6 @@ export class Repository implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const subjectThreshold =
|
||||
|
||||
|
||||
// Math.max(config.get<number>('inputValidationLength') || 50, config.get<number>('subjectValidationLength') || 50, 0) || 50;
|
||||
|
||||
if (line.length <= threshold) {
|
||||
if (setting !== 'always') {
|
||||
return;
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
||||
integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
"@types/which@^1.0.28":
|
||||
version "1.0.28"
|
||||
|
||||
@@ -13,5 +13,6 @@ server/build/**
|
||||
server/yarn.lock
|
||||
server/.npmignore
|
||||
yarn.lock
|
||||
CONTRIBUTING.md
|
||||
server/extension.webpack.config.js
|
||||
extension.webpack.config.js
|
||||
39
extensions/json-language-features/CONTRIBUTING.md
Normal file
39
extensions/json-language-features/CONTRIBUTING.md
Normal file
@@ -0,0 +1,39 @@
|
||||
## Setup
|
||||
|
||||
- Clone [Microsoft/vscode](https://github.com/microsoft/vscode)
|
||||
- Run `yarn` at `/`, this will install
|
||||
- Dependencies for `/extension/json-language-features/`
|
||||
- Dependencies for `/extension/json-language-features/server/`
|
||||
- devDependencies such as `gulp`
|
||||
- Open `/extensions/json-language-features/` as the workspace in VS Code
|
||||
- Run the [`Launch Extension`](https://github.com/Microsoft/vscode/blob/master/extensions/json-language-features/.vscode/launch.json) debug target in the Debug View. This will:
|
||||
- Launch the `preLaunchTask` task to compile the extension
|
||||
- Launch a new VS Code instance with the `json-language-features` extension loaded
|
||||
- You should see a notification saying the development version of `json-language-features` overwrites the bundled version of `json-language-features`
|
||||
- Open a `.json` file to activate the extension. The extension will start the JSON language server process.
|
||||
- Add `"json.trace.server": "verbose"` to the settings to observe the communication between client and server.
|
||||
- Debug the language server process by using `Attach to Node Process` command in the VS Code window opened on `json-language-features`
|
||||
- Run `Reload Window` command in the launched instance to reload the extension
|
||||
|
||||
|
||||
### Contribute to vscode-json-languageservice
|
||||
|
||||
[Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice) is the library that implements the language smarts for JSON.
|
||||
The JSON language server forwards most the of requests to the service library.
|
||||
If you want to fix JSON issues or make improvements, you should make changes at [Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice).
|
||||
|
||||
However, within this extension, you can run a development version of `vscode-json-languageservice` to debug code or test language features interactively:
|
||||
|
||||
#### Linking `vscode-json-languageservice` in `json-language-features/server/`
|
||||
|
||||
- Clone [Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice)
|
||||
- Run `yarn` in `vscode-json-languageservice`
|
||||
- Run `yarn link` in `vscode-json-languageservice`. This will compile and link `vscode-json-languageservice`
|
||||
- In `json-language-features/server/`, run `npm link vscode-json-languageservice`
|
||||
|
||||
#### Testing the development version of `vscode-json-languageservice`
|
||||
|
||||
- Open both `vscode-json-languageservice` and this extension in a single workspace with [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature
|
||||
- Run `yarn watch` at `json-languagefeatures/server/` to recompile this extension with the linked version of `vscode-json-languageservice`
|
||||
- Make some changes in `vscode-json-languageservice`
|
||||
- Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-json-languageservice`. You can interactively test the language features.
|
||||
@@ -6,9 +6,11 @@
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange, Range, SelectionRangeKind } from 'vscode';
|
||||
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature } from 'vscode-languageclient';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
|
||||
@@ -93,6 +95,9 @@ export function activate(context: ExtensionContext) {
|
||||
let clientOptions: LanguageClientOptions = {
|
||||
// Register the server for json documents
|
||||
documentSelector,
|
||||
initializationOptions: {
|
||||
handledSchemaProtocols: ['file'] // language server only loads file-URI. Fetching schemas with other protocols ('http'...) are made on the client.
|
||||
},
|
||||
synchronize: {
|
||||
// Synchronize the setting section 'json' to the server
|
||||
configurationSection: ['json', 'http'],
|
||||
@@ -138,11 +143,20 @@ export function activate(context: ExtensionContext) {
|
||||
// handle content request
|
||||
client.onRequest(VSCodeContentRequest.type, (uriPath: string) => {
|
||||
let uri = Uri.parse(uriPath);
|
||||
return workspace.openTextDocument(uri).then(doc => {
|
||||
return doc.getText();
|
||||
}, error => {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
if (uri.scheme !== 'http' && uri.scheme !== 'https') {
|
||||
return workspace.openTextDocument(uri).then(doc => {
|
||||
return doc.getText();
|
||||
}, error => {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
} else {
|
||||
const headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||
return xhr({ url: uriPath, followRedirects: 5, headers }).then(response => {
|
||||
return response.responseText;
|
||||
}, (error: XHRResponse) => {
|
||||
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
let handleContentChange = (uri: Uri) => {
|
||||
@@ -200,15 +214,17 @@ export function activate(context: ExtensionContext) {
|
||||
|
||||
documentSelector.forEach(selector => {
|
||||
toDispose.push(languages.registerSelectionRangeProvider(selector, {
|
||||
async provideSelectionRanges(document: TextDocument, position: Position): Promise<SelectionRange[]> {
|
||||
async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise<SelectionRange[]> {
|
||||
const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document);
|
||||
const rawRanges = await client.sendRequest<Range[]>('$/textDocument/selectionRange', { textDocument, position });
|
||||
if (Array.isArray(rawRanges)) {
|
||||
return rawRanges.map(r => {
|
||||
return {
|
||||
range: client.protocol2CodeConverter.asRange(r),
|
||||
kind: SelectionRangeKind.Declaration
|
||||
};
|
||||
const rawResult = await client.sendRequest<SelectionRange[][]>('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) });
|
||||
if (Array.isArray(rawResult)) {
|
||||
return rawResult.map(rawSelectionRanges => {
|
||||
return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => {
|
||||
return {
|
||||
range: client.protocol2CodeConverter.asRange(selectionRange.range),
|
||||
parent,
|
||||
};
|
||||
}, undefined)!;
|
||||
});
|
||||
}
|
||||
return [];
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
const path = require('path');
|
||||
var webpack = require('webpack');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: path.join(__dirname, 'client'),
|
||||
@@ -18,5 +19,9 @@ module.exports = withDefaults({
|
||||
output: {
|
||||
filename: 'jsonMain.js',
|
||||
path: path.join(__dirname, 'client', 'dist')
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
@@ -102,10 +102,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-extension-telemetry": "0.1.1",
|
||||
"vscode-languageclient": "^5.1.0",
|
||||
"vscode-nls": "^4.0.0"
|
||||
"vscode-languageclient": "^5.2.1",
|
||||
"vscode-nls": "^4.0.0",
|
||||
"request-light": "^0.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.25"
|
||||
"@types/node": "^10.12.21"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ module.exports = withDefaults({
|
||||
path: path.join(__dirname, 'dist')
|
||||
},
|
||||
plugins: [
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/[/\\]vscode-languageserver[/\\]lib[/\\]files\.js/,
|
||||
require.resolve('./build/filesFillIn')
|
||||
),
|
||||
new webpack.IgnorePlugin(/vertx/)
|
||||
],
|
||||
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
|
||||
]
|
||||
});
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
},
|
||||
"main": "./out/jsonServerMain",
|
||||
"dependencies": {
|
||||
"jsonc-parser": "^2.0.2",
|
||||
"jsonc-parser": "^2.0.3",
|
||||
"request-light": "^0.2.4",
|
||||
"vscode-json-languageservice": "^3.3.0-next.0",
|
||||
"vscode-languageserver": "^5.1.0",
|
||||
"vscode-json-languageservice": "^3.3.0-next.6",
|
||||
"vscode-languageserver": "^5.3.0-next.2",
|
||||
"vscode-nls": "^4.0.0",
|
||||
"vscode-uri": "^1.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "2.2.33",
|
||||
"@types/node": "^8.10.25"
|
||||
"@types/node": "^10.12.21"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run clean && npm run test",
|
||||
|
||||
@@ -13,7 +13,6 @@ import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDes
|
||||
import * as fs from 'fs';
|
||||
import URI from 'vscode-uri';
|
||||
import * as URL from 'url';
|
||||
import { startsWith } from './utils/strings';
|
||||
import { formatError, runSafe, runSafeAsync } from './utils/runner';
|
||||
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
|
||||
import { getLanguageModelCache } from './languageModelCache';
|
||||
@@ -57,46 +56,51 @@ const workspaceContext = {
|
||||
return URL.resolve(resource, relativePath);
|
||||
}
|
||||
};
|
||||
function getSchemaRequestService(handledSchemas: { [schema: string]: boolean }) {
|
||||
|
||||
const schemaRequestService = (uri: string): Thenable<string> => {
|
||||
if (startsWith(uri, 'file://')) {
|
||||
const fsPath = URI.parse(uri).fsPath;
|
||||
return new Promise<string>((c, e) => {
|
||||
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
||||
err ? e(err.message || err.toString()) : c(result.toString());
|
||||
});
|
||||
});
|
||||
} else if (startsWith(uri, 'vscode://')) {
|
||||
return (uri: string): Thenable<string> => {
|
||||
const protocol = uri.substr(0, uri.indexOf(':'));
|
||||
|
||||
if (!handledSchemas || handledSchemas[protocol]) {
|
||||
if (protocol === 'file') {
|
||||
const fsPath = URI.parse(uri).fsPath;
|
||||
return new Promise<string>((c, e) => {
|
||||
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
||||
err ? e(err.message || err.toString()) : c(result.toString());
|
||||
});
|
||||
});
|
||||
} else if (protocol === 'http' || protocol === 'https') {
|
||||
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
||||
/* __GDPR__
|
||||
"json.schema" : {
|
||||
"schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
connection.telemetry.logEvent({
|
||||
key: 'json.schema',
|
||||
value: {
|
||||
schemaURL: uri
|
||||
}
|
||||
});
|
||||
}
|
||||
const headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||
return xhr({ url: uri, followRedirects: 5, headers }).then(response => {
|
||||
return response.responseText;
|
||||
}, (error: XHRResponse) => {
|
||||
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
return connection.sendRequest(VSCodeContentRequest.type, uri).then(responseText => {
|
||||
return responseText;
|
||||
}, error => {
|
||||
return Promise.reject(error.message);
|
||||
});
|
||||
}
|
||||
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
||||
/* __GDPR__
|
||||
"json.schema" : {
|
||||
"schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
connection.telemetry.logEvent({
|
||||
key: 'json.schema',
|
||||
value: {
|
||||
schemaURL: uri
|
||||
}
|
||||
});
|
||||
}
|
||||
const headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||
return xhr({ url: uri, followRedirects: 5, headers }).then(response => {
|
||||
return response.responseText;
|
||||
}, (error: XHRResponse) => {
|
||||
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// create the JSON language service
|
||||
let languageService = getLanguageService({
|
||||
schemaRequestService,
|
||||
workspaceContext,
|
||||
contributions: [],
|
||||
});
|
||||
@@ -117,8 +121,10 @@ let hierarchicalDocumentSymbolSupport = false;
|
||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||
|
||||
const handledProtocols = params.initializationOptions && params.initializationOptions['handledSchemaProtocols'];
|
||||
|
||||
languageService = getLanguageService({
|
||||
schemaRequestService,
|
||||
schemaRequestService: getSchemaRequestService(handledProtocols),
|
||||
workspaceContext,
|
||||
contributions: [],
|
||||
clientCapabilities: params.capabilities
|
||||
@@ -427,12 +433,12 @@ connection.onFoldingRanges((params, token) => {
|
||||
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
|
||||
});
|
||||
|
||||
connection.onRequest('$/textDocument/selectionRange', async (params, token) => {
|
||||
connection.onRequest('$/textDocument/selectionRanges', async (params, token) => {
|
||||
return runSafe(() => {
|
||||
const document = documents.get(params.textDocument.uri);
|
||||
if (document) {
|
||||
const jsonDocument = getJSONDocument(document);
|
||||
return languageService.getSelectionRanges(document, params.position, jsonDocument);
|
||||
return languageService.getSelectionRanges(document, params.positions, jsonDocument);
|
||||
}
|
||||
return [];
|
||||
}, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token);
|
||||
|
||||
@@ -3,20 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function startsWith(haystack: string, needle: string): boolean {
|
||||
if (haystack.length < needle.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < needle.length; i++) {
|
||||
if (haystack[i] !== needle[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if haystack ends with needle.
|
||||
*/
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def"
|
||||
integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8=
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
agent-base@4, agent-base@^4.1.0:
|
||||
version "4.1.2"
|
||||
@@ -54,10 +54,10 @@ https-proxy-agent@^2.2.1:
|
||||
agent-base "^4.1.0"
|
||||
debug "^3.1.0"
|
||||
|
||||
jsonc-parser@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d"
|
||||
integrity sha512-TSU435K5tEKh3g7bam1AFf+uZrISheoDsLlpmAo6wWZYqjsnd09lHYK1Qo+moK4Ikifev1Gdpa69g4NELKnCrQ==
|
||||
jsonc-parser@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.3.tgz#6d4199ccab7f21ff5d2a4225050c54e981fb21a2"
|
||||
integrity sha512-WJi9y9ABL01C8CxTKxRRQkkSpY/x2bo4Gy0WuiZGrInxQqgxQpvkBCLNcDYcHOSdhx4ODgbFcgAvfL49C+PHgQ==
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
@@ -73,13 +73,13 @@ request-light@^0.2.4:
|
||||
https-proxy-agent "^2.2.1"
|
||||
vscode-nls "^4.0.0"
|
||||
|
||||
vscode-json-languageservice@^3.3.0-next.0:
|
||||
version "3.3.0-next.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.0-next.0.tgz#c17db95d0eacc24f80d3b3f120ab5e03943769a0"
|
||||
integrity sha512-YZXL3yHzbr0/Ar5dGdeM/f5Y0l41z/Y4QSQTdL3Hl3ScuY76IPcDEnf7iuk9yx+QoPfEHFCBDv5Rg6XVcMl8Tg==
|
||||
vscode-json-languageservice@^3.3.0-next.6:
|
||||
version "3.3.0-next.6"
|
||||
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.0-next.6.tgz#711f121b44ba443a89f3fb01a01c611f2547079f"
|
||||
integrity sha512-i1tyLiodWc7y6lR9C4cat+OUSptj8Duk1Ybm1FaMzhNfOTFttSiwrBw1otNb+QwI65VEj7EAEBQHRLeQOWznMw==
|
||||
dependencies:
|
||||
jsonc-parser "^2.0.2"
|
||||
vscode-languageserver-types "^3.13.0"
|
||||
jsonc-parser "^2.0.3"
|
||||
vscode-languageserver-types "^3.14.0"
|
||||
vscode-nls "^4.0.0"
|
||||
vscode-uri "^1.0.6"
|
||||
|
||||
@@ -88,25 +88,25 @@ vscode-jsonrpc@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||
|
||||
vscode-languageserver-protocol@3.13.0:
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz#710d8e42119bb3affb1416e1e104bd6b4d503595"
|
||||
integrity sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==
|
||||
vscode-languageserver-protocol@3.15.0-next.1:
|
||||
version "3.15.0-next.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.1.tgz#1e45e224d7eef8c79b4bed75b9dcb1930d2ab8ed"
|
||||
integrity sha512-LXF0d9s3vxFBxVQ4aKl/XghdEMAncGt3dh4urIYa9Is43g3MfIQL9fC44YZtP+XXOrI2rpZU8lRNN01U1V6CDg==
|
||||
dependencies:
|
||||
vscode-jsonrpc "^4.0.0"
|
||||
vscode-languageserver-types "3.13.0"
|
||||
vscode-languageserver-types "3.14.0"
|
||||
|
||||
vscode-languageserver-types@3.13.0, vscode-languageserver-types@^3.13.0:
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz#b704b024cef059f7b326611c99b9c8753c0a18b4"
|
||||
integrity sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==
|
||||
vscode-languageserver-types@3.14.0, vscode-languageserver-types@^3.14.0:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||
|
||||
vscode-languageserver@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.1.0.tgz#012a28f154cc7a848c443d217894942e4c3eeb39"
|
||||
integrity sha512-CIsrgx2Y5VHS317g/HwkSTWYBIQmy0DwEyZPmB2pEpVOhYFwVsYpbiJwHIIyLQsQtmRaO4eA2xM8KPjNSdXpBw==
|
||||
vscode-languageserver@^5.3.0-next.2:
|
||||
version "5.3.0-next.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.3.0-next.2.tgz#31ce4c34d68b517b400ca9e211e43f8d868b8dcc"
|
||||
integrity sha512-n5onRw9naMrRHp2jnOn+ZwN1n+tTfzftWLPonjp1FWf/iCZWIlnw2TyF/Hn+SDGhLoVtoghmxhwEQaxEAfLHvw==
|
||||
dependencies:
|
||||
vscode-languageserver-protocol "3.13.0"
|
||||
vscode-languageserver-protocol "3.15.0-next.1"
|
||||
vscode-uri "^1.0.6"
|
||||
|
||||
vscode-nls@^4.0.0:
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
agent-base@4, agent-base@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
||||
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
|
||||
dependencies:
|
||||
es6-promisify "^5.0.0"
|
||||
|
||||
applicationinsights@1.0.8:
|
||||
version "1.0.8"
|
||||
@@ -16,6 +23,20 @@ applicationinsights@1.0.8:
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
debug@3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^3.1.0:
|
||||
version "3.2.6"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||
dependencies:
|
||||
ms "^2.1.1"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
@@ -28,6 +49,53 @@ diagnostic-channel@0.2.0:
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
es6-promise@^4.0.3:
|
||||
version "4.2.6"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
||||
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
|
||||
|
||||
es6-promisify@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
||||
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
|
||||
dependencies:
|
||||
es6-promise "^4.0.3"
|
||||
|
||||
http-proxy-agent@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
|
||||
integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==
|
||||
dependencies:
|
||||
agent-base "4"
|
||||
debug "3.1.0"
|
||||
|
||||
https-proxy-agent@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
||||
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
|
||||
dependencies:
|
||||
agent-base "^4.1.0"
|
||||
debug "^3.1.0"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
|
||||
request-light@^0.2.4:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.2.4.tgz#3cea29c126682e6bcadf7915353322eeba01a755"
|
||||
integrity sha512-pM9Fq5jRnSb+82V7M97rp8FE9/YNeP2L9eckB4Szd7lyeclSIx02aIpPO/6e4m6Dy31+FBN/zkFMTd2HkNO3ow==
|
||||
dependencies:
|
||||
http-proxy-agent "^2.1.0"
|
||||
https-proxy-agent "^2.2.1"
|
||||
vscode-nls "^4.0.0"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
@@ -50,26 +118,26 @@ vscode-jsonrpc@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||
|
||||
vscode-languageclient@^5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-5.1.0.tgz#650ab0dc9fd0daaade058a8471aaff5bc3f9580e"
|
||||
integrity sha512-Z95Kps8UqD4o17HE3uCkZuvenOsxHVH46dKmaGVpGixEFZigPaVuVxLM/JWeIY9aRenoC0ZD9CK1O7L4jpffKg==
|
||||
vscode-languageclient@^5.2.1:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz#7cfc83a294c409f58cfa2b910a8cfeaad0397193"
|
||||
integrity sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==
|
||||
dependencies:
|
||||
semver "^5.5.0"
|
||||
vscode-languageserver-protocol "3.13.0"
|
||||
vscode-languageserver-protocol "3.14.1"
|
||||
|
||||
vscode-languageserver-protocol@3.13.0:
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz#710d8e42119bb3affb1416e1e104bd6b4d503595"
|
||||
integrity sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==
|
||||
vscode-languageserver-protocol@3.14.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f"
|
||||
integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==
|
||||
dependencies:
|
||||
vscode-jsonrpc "^4.0.0"
|
||||
vscode-languageserver-types "3.13.0"
|
||||
vscode-languageserver-types "3.14.0"
|
||||
|
||||
vscode-languageserver-types@3.13.0:
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz#b704b024cef059f7b326611c99b9c8753c0a18b4"
|
||||
integrity sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==
|
||||
vscode-languageserver-types@3.14.0:
|
||||
version "3.14.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||
|
||||
vscode-nls@^4.0.0:
|
||||
version "4.0.0"
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,13 @@
|
||||
".jshintrc",
|
||||
".jscsrc",
|
||||
".eslintrc",
|
||||
".swcrc",
|
||||
".webmanifest",
|
||||
".js.map",
|
||||
".css.map"
|
||||
],
|
||||
"filenames": [
|
||||
"composer.lock",
|
||||
".watchmanconfig",
|
||||
".ember-cli"
|
||||
],
|
||||
@@ -70,4 +72,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,5 @@
|
||||
{
|
||||
"registrations": [
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"name": "chriskempson/tomorrow-theme",
|
||||
"repositoryUrl": "https://github.com/chriskempson/tomorrow-theme",
|
||||
"commitHash": "0e0d35ac303f99b8aa182091ebeaee81cf2183a0"
|
||||
}
|
||||
},
|
||||
"licenseDetail": [
|
||||
"Copyright (C) 2013 Chris Kempson",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,",
|
||||
"and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
||||
],
|
||||
"license": "MIT",
|
||||
"version": "0.0.0"
|
||||
},
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
@@ -52,4 +29,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -160,6 +160,14 @@
|
||||
"command": "markdown.preview.toggleLock",
|
||||
"when": "markdownPreviewFocus"
|
||||
},
|
||||
{
|
||||
"command": "markdown.preview.refresh",
|
||||
"when": "editorLangId == markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown.preview.refresh",
|
||||
"when": "markdownPreviewFocus"
|
||||
},
|
||||
{
|
||||
"command": "notebook.showPreview",
|
||||
"when": "false"
|
||||
@@ -315,12 +323,12 @@
|
||||
"@types/highlight.js": "9.12.3",
|
||||
"@types/lodash.throttle": "^4.1.3",
|
||||
"@types/markdown-it": "0.0.2",
|
||||
"@types/node": "^8.10.25",
|
||||
"@types/node": "^10.12.21",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"mocha-junit-reporter": "^1.17.0",
|
||||
"mocha-multi-reporters": "^1.1.7",
|
||||
"ts-loader": "^4.0.1",
|
||||
"typescript": "^2.7.2",
|
||||
"typescript": "^3.3.1",
|
||||
"vscode": "^1.1.10",
|
||||
"webpack": "^4.1.0",
|
||||
"webpack-cli": "^2.0.10"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function onceDocumentLoaded(f: () => void) {
|
||||
if (document.readyState === 'loading' || document.readyState === 'uninitialized') {
|
||||
if (document.readyState === 'loading' || document.readyState as string === 'uninitialized') {
|
||||
document.addEventListener('DOMContentLoaded', f);
|
||||
} else {
|
||||
f();
|
||||
|
||||
@@ -19,7 +19,7 @@ const settings = getSettings();
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
// Set VS Code state
|
||||
const state = getData('data-state');
|
||||
let state = getData('data-state');
|
||||
vscode.setState(state);
|
||||
|
||||
const messaging = createPosterForVsCode(vscode);
|
||||
@@ -152,6 +152,8 @@ if (settings.scrollEditorWithPreview) {
|
||||
const line = getEditorLineNumberForPageOffset(window.scrollY);
|
||||
if (typeof line === 'number' && !isNaN(line)) {
|
||||
messaging.postMessage('revealLine', { line });
|
||||
state.line = line;
|
||||
vscode.setState(state);
|
||||
}
|
||||
}
|
||||
}, 50));
|
||||
|
||||
@@ -24,13 +24,13 @@ const getCodeLineElements = (() => {
|
||||
let elements: CodeLineElement[];
|
||||
return () => {
|
||||
if (!elements) {
|
||||
elements = ([{ element: document.body, line: 0 }]).concat(Array.prototype.map.call(
|
||||
document.getElementsByClassName('code-line'),
|
||||
(element: any) => {
|
||||
const line = +element.getAttribute('data-line');
|
||||
return { element, line };
|
||||
})
|
||||
.filter((x: any) => !isNaN(x.line)));
|
||||
elements = [{ element: document.body, line: 0 }];
|
||||
for (const element of document.getElementsByClassName('code-line')) {
|
||||
const line = +element.getAttribute('data-line')!;
|
||||
if (!isNaN(line)) {
|
||||
elements.push({ element: element as HTMLElement, line });
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"jsx": "react",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"strictBindCallApply": true,
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ import MarkdownWorkspaceSymbolProvider from './features/workspaceSymbolProvider'
|
||||
import { Logger } from './logger';
|
||||
import { MarkdownEngine } from './markdownEngine';
|
||||
import { getMarkdownExtensionContributions } from './markdownExtensions';
|
||||
import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from './security';
|
||||
import { loadDefaultTelemetryReporter } from './telemetryReporter';
|
||||
import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector, ContentSecurityPolicyArbiter } from './security';
|
||||
import { loadDefaultTelemetryReporter, TelemetryReporter } from './telemetryReporter';
|
||||
import { githubSlugifier } from './slugify';
|
||||
|
||||
|
||||
@@ -25,33 +25,55 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context.subscriptions.push(telemetryReporter);
|
||||
|
||||
const contributions = getMarkdownExtensionContributions(context);
|
||||
context.subscriptions.push(contributions);
|
||||
|
||||
const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState);
|
||||
const engine = new MarkdownEngine(contributions, githubSlugifier);
|
||||
const logger = new Logger();
|
||||
|
||||
const selector: vscode.DocumentSelector = [
|
||||
{ language: 'markdown', scheme: 'file' },
|
||||
{ language: 'markdown', scheme: 'untitled' }
|
||||
];
|
||||
|
||||
const contentProvider = new MarkdownContentProvider(engine, context, cspArbiter, contributions, logger);
|
||||
const symbolProvider = new MDDocumentSymbolProvider(engine);
|
||||
const previewManager = new MarkdownPreviewManager(contentProvider, logger, contributions);
|
||||
context.subscriptions.push(previewManager);
|
||||
|
||||
context.subscriptions.push(vscode.languages.setLanguageConfiguration('markdown', {
|
||||
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'),
|
||||
}));
|
||||
context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider));
|
||||
context.subscriptions.push(vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()));
|
||||
context.subscriptions.push(vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)));
|
||||
context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider)));
|
||||
context.subscriptions.push(registerMarkdownLanguageFeatures(symbolProvider, engine));
|
||||
context.subscriptions.push(registerMarkdownCommands(previewManager, telemetryReporter, cspArbiter, engine));
|
||||
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
|
||||
logger.updateConfiguration();
|
||||
previewManager.updateConfiguration();
|
||||
}));
|
||||
}
|
||||
|
||||
function registerMarkdownLanguageFeatures(
|
||||
symbolProvider: MDDocumentSymbolProvider,
|
||||
engine: MarkdownEngine
|
||||
): vscode.Disposable {
|
||||
const selector: vscode.DocumentSelector = [
|
||||
{ language: 'markdown', scheme: 'file' },
|
||||
{ language: 'markdown', scheme: 'untitled' }
|
||||
];
|
||||
|
||||
return vscode.Disposable.from(
|
||||
vscode.languages.setLanguageConfiguration('markdown', {
|
||||
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'),
|
||||
}),
|
||||
vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider),
|
||||
vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()),
|
||||
vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)),
|
||||
vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider))
|
||||
);
|
||||
}
|
||||
|
||||
function registerMarkdownCommands(
|
||||
previewManager: MarkdownPreviewManager,
|
||||
telemetryReporter: TelemetryReporter,
|
||||
cspArbiter: ContentSecurityPolicyArbiter,
|
||||
engine: MarkdownEngine
|
||||
): vscode.Disposable {
|
||||
const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager);
|
||||
|
||||
const commandManager = new CommandManager();
|
||||
context.subscriptions.push(commandManager);
|
||||
commandManager.register(new commands.ShowPreviewCommand(previewManager, telemetryReporter));
|
||||
commandManager.register(new commands.ShowPreviewToSideCommand(previewManager, telemetryReporter));
|
||||
commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager, telemetryReporter));
|
||||
@@ -63,9 +85,5 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
commandManager.register(new commands.ToggleLockCommand(previewManager));
|
||||
// {{SQL CARBON EDIT}}
|
||||
commandManager.register(new commands.ShowNotebookPreview(engine));
|
||||
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
|
||||
logger.updateConfiguration();
|
||||
previewManager.updateConfiguration();
|
||||
}));
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ import * as path from 'path';
|
||||
|
||||
import { Logger } from '../logger';
|
||||
import { MarkdownContentProvider } from './previewContentProvider';
|
||||
import { disposeAll } from '../util/dispose';
|
||||
import { Disposable } from '../util/dispose';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import { getVisibleLine, MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
||||
import { MarkdownPreviewConfigurationManager } from './previewConfig';
|
||||
import { MarkdownContributions } from '../markdownExtensions';
|
||||
import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions';
|
||||
import { isMarkdownFile } from '../util/file';
|
||||
import { resolveLinkToMarkdownFile } from '../commands/openDocumentLink';
|
||||
const localize = nls.loadMessageBundle();
|
||||
@@ -60,7 +60,7 @@ interface PreviewStyleLoadErrorMessage extends WebviewMessage {
|
||||
};
|
||||
}
|
||||
|
||||
export class MarkdownPreview {
|
||||
export class MarkdownPreview extends Disposable {
|
||||
|
||||
public static viewType = 'markdown.preview';
|
||||
|
||||
@@ -70,7 +70,6 @@ export class MarkdownPreview {
|
||||
private readonly editor: vscode.WebviewPanel;
|
||||
private throttleTimer: any;
|
||||
private line: number | undefined = undefined;
|
||||
private readonly disposables: vscode.Disposable[] = [];
|
||||
private firstUpdate = true;
|
||||
private currentVersion?: { resource: vscode.Uri, version: number };
|
||||
private forceUpdate = false;
|
||||
@@ -85,7 +84,7 @@ export class MarkdownPreview {
|
||||
previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||
logger: Logger,
|
||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||
contributions: MarkdownContributions,
|
||||
contributionProvider: MarkdownContributionProvider,
|
||||
): Promise<MarkdownPreview> {
|
||||
const resource = vscode.Uri.parse(state.resource);
|
||||
const locked = state.locked;
|
||||
@@ -99,9 +98,9 @@ export class MarkdownPreview {
|
||||
previewConfigurations,
|
||||
logger,
|
||||
topmostLineMonitor,
|
||||
contributions);
|
||||
contributionProvider);
|
||||
|
||||
preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributions);
|
||||
preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions);
|
||||
|
||||
if (!isNaN(line)) {
|
||||
preview.line = line;
|
||||
@@ -118,14 +117,14 @@ export class MarkdownPreview {
|
||||
previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||
logger: Logger,
|
||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||
contributions: MarkdownContributions
|
||||
contributionProvider: MarkdownContributionProvider
|
||||
): MarkdownPreview {
|
||||
const webview = vscode.window.createWebviewPanel(
|
||||
MarkdownPreview.viewType,
|
||||
MarkdownPreview.getPreviewTitle(resource, locked),
|
||||
previewColumn, {
|
||||
enableFindWidget: true,
|
||||
...MarkdownPreview.getWebviewOptions(resource, contributions)
|
||||
...MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions)
|
||||
});
|
||||
|
||||
return new MarkdownPreview(
|
||||
@@ -136,7 +135,7 @@ export class MarkdownPreview {
|
||||
previewConfigurations,
|
||||
logger,
|
||||
topmostLineMonitor,
|
||||
contributions);
|
||||
contributionProvider);
|
||||
}
|
||||
|
||||
private constructor(
|
||||
@@ -147,19 +146,24 @@ export class MarkdownPreview {
|
||||
private readonly _previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||
private readonly _logger: Logger,
|
||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||
private readonly _contributions: MarkdownContributions,
|
||||
private readonly _contributionProvider: MarkdownContributionProvider,
|
||||
) {
|
||||
super();
|
||||
this._resource = resource;
|
||||
this._locked = locked;
|
||||
this.editor = webview;
|
||||
|
||||
this.editor.onDidDispose(() => {
|
||||
this.dispose();
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
this.editor.onDidChangeViewState(e => {
|
||||
this._onDidChangeViewStateEmitter.fire(e);
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
_contributionProvider.onContributionsChanged(() => {
|
||||
setImmediate(() => this.refresh());
|
||||
}, null, this._disposables);
|
||||
|
||||
this.editor.webview.onDidReceiveMessage((e: CacheImageSizesMessage | RevealLineMessage | DidClickMessage | ClickLinkMessage | ShowPreviewSecuritySelectorMessage | PreviewStyleLoadErrorMessage) => {
|
||||
if (e.source !== this._resource.toString()) {
|
||||
@@ -191,19 +195,19 @@ export class MarkdownPreview {
|
||||
vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'markdown.styles': {0}", e.body.unloadedStyles.join(', ')));
|
||||
break;
|
||||
}
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
vscode.workspace.onDidChangeTextDocument(event => {
|
||||
if (this.isPreviewOf(event.document.uri)) {
|
||||
this.refresh();
|
||||
}
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
topmostLineMonitor.onDidChangeTopmostLine(event => {
|
||||
if (this.isPreviewOf(event.resource)) {
|
||||
this.updateForView(event.resource, event.line);
|
||||
}
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
vscode.window.onDidChangeTextEditorSelection(event => {
|
||||
if (this.isPreviewOf(event.textEditor.document.uri)) {
|
||||
@@ -213,13 +217,13 @@ export class MarkdownPreview {
|
||||
source: this.resource.toString()
|
||||
});
|
||||
}
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
|
||||
vscode.window.onDidChangeActiveTextEditor(editor => {
|
||||
if (editor && isMarkdownFile(editor.document) && !this._locked) {
|
||||
this.update(editor.document.uri);
|
||||
}
|
||||
}, null, this.disposables);
|
||||
}, null, this._disposables);
|
||||
}
|
||||
|
||||
private readonly _onDisposeEmitter = new vscode.EventEmitter<void>();
|
||||
@@ -242,18 +246,17 @@ export class MarkdownPreview {
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
super.dispose();
|
||||
if (this._disposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._disposed = true;
|
||||
this._onDisposeEmitter.fire();
|
||||
|
||||
this._onDisposeEmitter.dispose();
|
||||
|
||||
this._onDidChangeViewStateEmitter.dispose();
|
||||
this.editor.dispose();
|
||||
|
||||
disposeAll(this.disposables);
|
||||
}
|
||||
|
||||
public update(resource: vscode.Uri) {
|
||||
@@ -328,7 +331,7 @@ export class MarkdownPreview {
|
||||
}
|
||||
|
||||
private get iconPath() {
|
||||
const root = path.join(this._contributions.extensionPath, 'media');
|
||||
const root = path.join(this._contributionProvider.extensionPath, 'media');
|
||||
return {
|
||||
light: vscode.Uri.file(path.join(root, 'Preview.svg')),
|
||||
dark: vscode.Uri.file(path.join(root, 'Preview_inverse.svg'))
|
||||
@@ -392,7 +395,7 @@ export class MarkdownPreview {
|
||||
if (this._resource === resource) {
|
||||
this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
|
||||
this.editor.iconPath = this.iconPath;
|
||||
this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributions);
|
||||
this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributionProvider.contributions);
|
||||
this.editor.webview.html = content;
|
||||
}
|
||||
}
|
||||
@@ -410,7 +413,7 @@ export class MarkdownPreview {
|
||||
private static getLocalResourceRoots(
|
||||
resource: vscode.Uri,
|
||||
contributions: MarkdownContributions
|
||||
): vscode.Uri[] {
|
||||
): ReadonlyArray<vscode.Uri> {
|
||||
const baseRoots = contributions.previewResourceRoots;
|
||||
|
||||
const folder = vscode.workspace.getWorkspaceFolder(resource);
|
||||
|
||||
@@ -13,7 +13,7 @@ const localize = nls.loadMessageBundle();
|
||||
import { Logger } from '../logger';
|
||||
import { ContentSecurityPolicyArbiter, MarkdownPreviewSecurityLevel } from '../security';
|
||||
import { MarkdownPreviewConfigurationManager, MarkdownPreviewConfiguration } from './previewConfig';
|
||||
import { MarkdownContributions } from '../markdownExtensions';
|
||||
import { MarkdownContributionProvider } from '../markdownExtensions';
|
||||
|
||||
/**
|
||||
* Strings used inside the markdown preview.
|
||||
@@ -40,7 +40,7 @@ export class MarkdownContentProvider {
|
||||
private readonly engine: MarkdownEngine,
|
||||
private readonly context: vscode.ExtensionContext,
|
||||
private readonly cspArbiter: ContentSecurityPolicyArbiter,
|
||||
private readonly contributions: MarkdownContributions,
|
||||
private readonly contributionProvider: MarkdownContributionProvider,
|
||||
private readonly logger: Logger
|
||||
) { }
|
||||
|
||||
@@ -163,7 +163,7 @@ export class MarkdownContentProvider {
|
||||
}
|
||||
|
||||
private getStyles(resource: vscode.Uri, nonce: string, config: MarkdownPreviewConfiguration, state?: any): string {
|
||||
const baseStyles = this.contributions.previewStyles
|
||||
const baseStyles = this.contributionProvider.contributions.previewStyles
|
||||
.map(resource => `<link rel="stylesheet" type="text/css" href="${resource.toString()}">`)
|
||||
.join('\n');
|
||||
|
||||
@@ -174,7 +174,7 @@ export class MarkdownContentProvider {
|
||||
}
|
||||
|
||||
private getScripts(nonce: string): string {
|
||||
return this.contributions.previewScripts
|
||||
return this.contributionProvider.contributions.previewScripts
|
||||
.map(resource => `<script async src="${resource.toString()}" nonce="${nonce}" charset="UTF-8"></script>`)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { Logger } from '../logger';
|
||||
import { MarkdownContributions } from '../markdownExtensions';
|
||||
import { MarkdownContributionProvider } from '../markdownExtensions';
|
||||
import { disposeAll } from '../util/dispose';
|
||||
import { MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
||||
import { MarkdownPreview, PreviewSettings } from './preview';
|
||||
@@ -25,7 +25,7 @@ export class MarkdownPreviewManager implements vscode.WebviewPanelSerializer {
|
||||
public constructor(
|
||||
private readonly _contentProvider: MarkdownContentProvider,
|
||||
private readonly _logger: Logger,
|
||||
private readonly _contributions: MarkdownContributions
|
||||
private readonly _contributions: MarkdownContributionProvider
|
||||
) {
|
||||
this._disposables.push(vscode.window.registerWebviewPanelSerializer(MarkdownPreview.viewType, this));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { disposeAll } from '../util/dispose';
|
||||
import { Disposable } from '../util/dispose';
|
||||
import { isMarkdownFile } from '../util/file';
|
||||
import { Lazy, lazy } from '../util/lazy';
|
||||
import MDDocumentSymbolProvider from './documentSymbolProvider';
|
||||
@@ -18,25 +18,13 @@ export interface WorkspaceMarkdownDocumentProvider {
|
||||
readonly onDidDeleteMarkdownDocument: vscode.Event<vscode.Uri>;
|
||||
}
|
||||
|
||||
class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocumentProvider {
|
||||
class VSCodeWorkspaceMarkdownDocumentProvider extends Disposable implements WorkspaceMarkdownDocumentProvider {
|
||||
|
||||
private readonly _onDidChangeMarkdownDocumentEmitter = new vscode.EventEmitter<SkinnyTextDocument>();
|
||||
private readonly _onDidCreateMarkdownDocumentEmitter = new vscode.EventEmitter<SkinnyTextDocument>();
|
||||
private readonly _onDidDeleteMarkdownDocumentEmitter = new vscode.EventEmitter<vscode.Uri>();
|
||||
private readonly _onDidChangeMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<SkinnyTextDocument>());
|
||||
private readonly _onDidCreateMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<SkinnyTextDocument>());
|
||||
private readonly _onDidDeleteMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<vscode.Uri>());
|
||||
|
||||
private _watcher: vscode.FileSystemWatcher | undefined;
|
||||
private _disposables: vscode.Disposable[] = [];
|
||||
|
||||
public dispose() {
|
||||
this._onDidChangeMarkdownDocumentEmitter.dispose();
|
||||
this._onDidDeleteMarkdownDocumentEmitter.dispose();
|
||||
|
||||
if (this._watcher) {
|
||||
this._watcher.dispose();
|
||||
}
|
||||
|
||||
disposeAll(this._disposables);
|
||||
}
|
||||
|
||||
async getAllMarkdownDocuments() {
|
||||
const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**');
|
||||
@@ -64,7 +52,7 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume
|
||||
return;
|
||||
}
|
||||
|
||||
this._watcher = vscode.workspace.createFileSystemWatcher('**/*.md');
|
||||
this._watcher = this._register(vscode.workspace.createFileSystemWatcher('**/*.md'));
|
||||
|
||||
this._watcher.onDidChange(async resource => {
|
||||
const document = await this.getMarkdownDocument(resource);
|
||||
@@ -98,15 +86,16 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume
|
||||
}
|
||||
|
||||
|
||||
export default class MarkdownWorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
|
||||
export default class MarkdownWorkspaceSymbolProvider extends Disposable implements vscode.WorkspaceSymbolProvider {
|
||||
private _symbolCache = new Map<string, Lazy<Thenable<vscode.SymbolInformation[]>>>();
|
||||
private _symbolCachePopulated: boolean = false;
|
||||
private _disposables: vscode.Disposable[] = [];
|
||||
|
||||
public constructor(
|
||||
private _symbolProvider: MDDocumentSymbolProvider,
|
||||
private _workspaceMarkdownDocumentProvider: WorkspaceMarkdownDocumentProvider = new VSCodeWorkspaceMarkdownDocumentProvider()
|
||||
) { }
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public async provideWorkspaceSymbols(query: string): Promise<vscode.SymbolInformation[]> {
|
||||
if (!this._symbolCachePopulated) {
|
||||
@@ -130,10 +119,6 @@ export default class MarkdownWorkspaceSymbolProvider implements vscode.Workspace
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
disposeAll(this._disposables);
|
||||
}
|
||||
|
||||
private getSymbols(document: SkinnyTextDocument): Lazy<Thenable<vscode.SymbolInformation[]>> {
|
||||
return lazy(async () => {
|
||||
return this._symbolProvider.provideDocumentSymbolInformation(document);
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as crypto from 'crypto';
|
||||
import { MarkdownIt, Token } from 'markdown-it';
|
||||
import * as path from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import { MarkdownContributions } from './markdownExtensions';
|
||||
import { MarkdownContributionProvider as MarkdownContributionProvider } from './markdownExtensions';
|
||||
import { Slugifier } from './slugify';
|
||||
import { SkinnyTextDocument } from './tableOfContentsProvider';
|
||||
import { getUriForLinkWithKnownExternalScheme } from './util/links';
|
||||
@@ -57,16 +57,21 @@ export class MarkdownEngine {
|
||||
private _tokenCache = new TokenCache();
|
||||
|
||||
public constructor(
|
||||
private readonly extensionPreviewResourceProvider: MarkdownContributions,
|
||||
private readonly contributionProvider: MarkdownContributionProvider,
|
||||
private readonly slugifier: Slugifier,
|
||||
) { }
|
||||
) {
|
||||
contributionProvider.onContributionsChanged(() => {
|
||||
// Markdown plugin contributions may have changed
|
||||
this.md = undefined;
|
||||
});
|
||||
}
|
||||
|
||||
private async getEngine(config: MarkdownItConfig): Promise<MarkdownIt> {
|
||||
if (!this.md) {
|
||||
this.md = import('markdown-it').then(async markdownIt => {
|
||||
let md: MarkdownIt = markdownIt(await getMarkdownOptions(() => md));
|
||||
|
||||
for (const plugin of this.extensionPreviewResourceProvider.markdownItPlugins) {
|
||||
for (const plugin of this.contributionProvider.contributions.markdownItPlugins.values()) {
|
||||
try {
|
||||
md = (await plugin)(md);
|
||||
} catch {
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import { Disposable } from './util/dispose';
|
||||
import * as arrays from './util/arrays';
|
||||
|
||||
const resolveExtensionResource = (extension: vscode.Extension<any>, resourcePath: string): vscode.Uri => {
|
||||
return vscode.Uri.file(path.join(extension.extensionPath, resourcePath))
|
||||
.with({ scheme: 'vscode-resource' });
|
||||
};
|
||||
|
||||
const resolveExtensionResources = (extension: vscode.Extension<any>, resourcePaths: any): vscode.Uri[] => {
|
||||
const resolveExtensionResources = (extension: vscode.Extension<any>, resourcePaths: unknown): vscode.Uri[] => {
|
||||
const result: vscode.Uri[] = [];
|
||||
if (Array.isArray(resourcePaths)) {
|
||||
for (const resource of resourcePaths) {
|
||||
@@ -26,96 +28,135 @@ const resolveExtensionResources = (extension: vscode.Extension<any>, resourcePat
|
||||
};
|
||||
|
||||
export interface MarkdownContributions {
|
||||
readonly extensionPath: string;
|
||||
readonly previewScripts: vscode.Uri[];
|
||||
readonly previewStyles: vscode.Uri[];
|
||||
readonly markdownItPlugins: Thenable<(md: any) => any>[];
|
||||
readonly previewResourceRoots: vscode.Uri[];
|
||||
readonly previewScripts: ReadonlyArray<vscode.Uri>;
|
||||
readonly previewStyles: ReadonlyArray<vscode.Uri>;
|
||||
readonly previewResourceRoots: ReadonlyArray<vscode.Uri>;
|
||||
readonly markdownItPlugins: Map<string, Thenable<(md: any) => any>>;
|
||||
}
|
||||
|
||||
class MarkdownExtensionContributions implements MarkdownContributions {
|
||||
private readonly _scripts: vscode.Uri[] = [];
|
||||
private readonly _styles: vscode.Uri[] = [];
|
||||
private readonly _previewResourceRoots: vscode.Uri[] = [];
|
||||
private readonly _plugins: Thenable<(md: any) => any>[] = [];
|
||||
export namespace MarkdownContributions {
|
||||
export const Empty: MarkdownContributions = {
|
||||
previewScripts: [],
|
||||
previewStyles: [],
|
||||
previewResourceRoots: [],
|
||||
markdownItPlugins: new Map()
|
||||
};
|
||||
|
||||
private _loaded = false;
|
||||
|
||||
public constructor(
|
||||
public readonly extensionPath: string,
|
||||
) { }
|
||||
|
||||
public get previewScripts(): vscode.Uri[] {
|
||||
this.ensureLoaded();
|
||||
return this._scripts;
|
||||
export function merge(a: MarkdownContributions, b: MarkdownContributions): MarkdownContributions {
|
||||
return {
|
||||
previewScripts: [...a.previewScripts, ...b.previewScripts],
|
||||
previewStyles: [...a.previewStyles, ...b.previewStyles],
|
||||
previewResourceRoots: [...a.previewResourceRoots, ...b.previewResourceRoots],
|
||||
markdownItPlugins: new Map([...a.markdownItPlugins.entries(), ...b.markdownItPlugins.entries()]),
|
||||
};
|
||||
}
|
||||
|
||||
public get previewStyles(): vscode.Uri[] {
|
||||
this.ensureLoaded();
|
||||
return this._styles;
|
||||
function uriEqual(a: vscode.Uri, b: vscode.Uri): boolean {
|
||||
return a.toString() === b.toString();
|
||||
}
|
||||
|
||||
public get previewResourceRoots(): vscode.Uri[] {
|
||||
this.ensureLoaded();
|
||||
return this._previewResourceRoots;
|
||||
export function equal(a: MarkdownContributions, b: MarkdownContributions): boolean {
|
||||
return arrays.equals(a.previewScripts, b.previewScripts, uriEqual)
|
||||
&& arrays.equals(a.previewStyles, b.previewStyles, uriEqual)
|
||||
&& arrays.equals(a.previewResourceRoots, b.previewResourceRoots, uriEqual)
|
||||
&& arrays.equals(Array.from(a.markdownItPlugins.keys()), Array.from(b.markdownItPlugins.keys()));
|
||||
}
|
||||
|
||||
public get markdownItPlugins(): Thenable<(md: any) => any>[] {
|
||||
this.ensureLoaded();
|
||||
return this._plugins;
|
||||
}
|
||||
|
||||
private ensureLoaded() {
|
||||
if (this._loaded) {
|
||||
return;
|
||||
export function fromExtension(
|
||||
extension: vscode.Extension<any>
|
||||
): MarkdownContributions {
|
||||
const contributions = extension.packageJSON && extension.packageJSON.contributes;
|
||||
if (!contributions) {
|
||||
return MarkdownContributions.Empty;
|
||||
}
|
||||
|
||||
this._loaded = true;
|
||||
for (const extension of vscode.extensions.all) {
|
||||
const contributes = extension.packageJSON && extension.packageJSON.contributes;
|
||||
if (!contributes) {
|
||||
continue;
|
||||
}
|
||||
const previewStyles = getContributedStyles(contributions, extension);
|
||||
const previewScripts = getContributedScripts(contributions, extension);
|
||||
const previewResourceRoots = previewStyles.length || previewScripts.length ? [vscode.Uri.file(extension.extensionPath)] : [];
|
||||
const markdownItPlugins = getContributedMarkdownItPlugins(contributions, extension);
|
||||
|
||||
this.tryLoadPreviewStyles(contributes, extension);
|
||||
this.tryLoadPreviewScripts(contributes, extension);
|
||||
this.tryLoadMarkdownItPlugins(contributes, extension);
|
||||
|
||||
if (contributes['markdown.previewScripts'] || contributes['markdown.previewStyles']) {
|
||||
this._previewResourceRoots.push(vscode.Uri.file(extension.extensionPath));
|
||||
}
|
||||
}
|
||||
return {
|
||||
previewScripts,
|
||||
previewStyles,
|
||||
previewResourceRoots,
|
||||
markdownItPlugins
|
||||
};
|
||||
}
|
||||
|
||||
private tryLoadMarkdownItPlugins(
|
||||
function getContributedMarkdownItPlugins(
|
||||
contributes: any,
|
||||
extension: vscode.Extension<any>
|
||||
) {
|
||||
): Map<string, Thenable<(md: any) => any>> {
|
||||
const map = new Map<string, Thenable<(md: any) => any>>();
|
||||
if (contributes['markdown.markdownItPlugins']) {
|
||||
this._plugins.push(extension.activate().then(() => {
|
||||
map.set(extension.id, extension.activate().then(() => {
|
||||
if (extension.exports && extension.exports.extendMarkdownIt) {
|
||||
return (md: any) => extension.exports.extendMarkdownIt(md);
|
||||
}
|
||||
return (md: any) => md;
|
||||
}));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private tryLoadPreviewScripts(
|
||||
function getContributedScripts(
|
||||
contributes: any,
|
||||
extension: vscode.Extension<any>
|
||||
) {
|
||||
this._scripts.push(...resolveExtensionResources(extension, contributes['markdown.previewScripts']));
|
||||
return resolveExtensionResources(extension, contributes['markdown.previewScripts']);
|
||||
}
|
||||
|
||||
private tryLoadPreviewStyles(
|
||||
function getContributedStyles(
|
||||
contributes: any,
|
||||
extension: vscode.Extension<any>
|
||||
) {
|
||||
this._styles.push(...resolveExtensionResources(extension, contributes['markdown.previewStyles']));
|
||||
return resolveExtensionResources(extension, contributes['markdown.previewStyles']);
|
||||
}
|
||||
}
|
||||
|
||||
export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownContributions {
|
||||
return new MarkdownExtensionContributions(context.extensionPath);
|
||||
export interface MarkdownContributionProvider {
|
||||
readonly extensionPath: string;
|
||||
readonly contributions: MarkdownContributions;
|
||||
readonly onContributionsChanged: vscode.Event<this>;
|
||||
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
class VSCodeExtensionMarkdownContributionProvider extends Disposable implements MarkdownContributionProvider {
|
||||
private _contributions?: MarkdownContributions;
|
||||
|
||||
public constructor(
|
||||
public readonly extensionPath: string,
|
||||
) {
|
||||
super();
|
||||
|
||||
vscode.extensions.onDidChange(() => {
|
||||
const currentContributions = this.getCurrentContributions();
|
||||
const existingContributions = this._contributions || MarkdownContributions.Empty;
|
||||
if (!MarkdownContributions.equal(existingContributions, currentContributions)) {
|
||||
this._contributions = currentContributions;
|
||||
this._onContributionsChanged.fire(this);
|
||||
}
|
||||
}, undefined, this._disposables);
|
||||
}
|
||||
|
||||
private readonly _onContributionsChanged = this._register(new vscode.EventEmitter<this>());
|
||||
public readonly onContributionsChanged = this._onContributionsChanged.event;
|
||||
|
||||
public get contributions(): MarkdownContributions {
|
||||
if (!this._contributions) {
|
||||
this._contributions = this.getCurrentContributions();
|
||||
}
|
||||
return this._contributions;
|
||||
}
|
||||
|
||||
private getCurrentContributions(): MarkdownContributions {
|
||||
return vscode.extensions.all
|
||||
.map(MarkdownContributions.fromExtension)
|
||||
.reduce(MarkdownContributions.merge, MarkdownContributions.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownContributionProvider {
|
||||
return new VSCodeExtensionMarkdownContributionProvider(context.extensionPath);
|
||||
}
|
||||
@@ -5,15 +5,14 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { MarkdownEngine } from '../markdownEngine';
|
||||
import { MarkdownContributions } from '../markdownExtensions';
|
||||
import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions';
|
||||
import { githubSlugifier } from '../slugify';
|
||||
import { Disposable } from '../util/dispose';
|
||||
|
||||
const emptyContributions = new class implements MarkdownContributions {
|
||||
const emptyContributions = new class extends Disposable implements MarkdownContributionProvider {
|
||||
readonly extensionPath = '';
|
||||
readonly previewScripts: vscode.Uri[] = [];
|
||||
readonly previewStyles: vscode.Uri[] = [];
|
||||
readonly previewResourceRoots: vscode.Uri[] = [];
|
||||
readonly markdownItPlugins: Promise<(md: any) => any>[] = [];
|
||||
readonly contributions = MarkdownContributions.Empty;
|
||||
readonly onContributionsChanged = this._register(new vscode.EventEmitter<this>()).event;
|
||||
};
|
||||
|
||||
export function createNewMarkdownEngine(): MarkdownEngine {
|
||||
|
||||
@@ -38,7 +38,7 @@ suite('markdown.WorkspaceSymbolProvider', () => {
|
||||
const fileNameCount = 10;
|
||||
const files: vscode.TextDocument[] = [];
|
||||
for (let i = 0; i < fileNameCount; ++i) {
|
||||
const testFileName = vscode.Uri.parse(`test${i}.md`);
|
||||
const testFileName = vscode.Uri.file(`test${i}.md`);
|
||||
files.push(new InMemoryDocument(testFileName, `# common\nabc\n## header${i}`));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,4 +2,17 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
module.exports = {};
|
||||
|
||||
export function equals<T>(one: ReadonlyArray<T>, other: ReadonlyArray<T>, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {
|
||||
if (one.length !== other.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0, len = one.length; i < len; i++) {
|
||||
if (!itemEquals(one[i], other[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -14,3 +14,29 @@ export function disposeAll(disposables: vscode.Disposable[]) {
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class Disposable {
|
||||
private _isDisposed = false;
|
||||
|
||||
protected _disposables: vscode.Disposable[] = [];
|
||||
|
||||
public dispose(): any {
|
||||
if (this._isDisposed) {
|
||||
return;
|
||||
}
|
||||
this._isDisposed = true;
|
||||
disposeAll(this._disposables);
|
||||
}
|
||||
|
||||
protected _register<T extends vscode.Disposable>(value: T): T {
|
||||
if (this._isDisposed) {
|
||||
value.dispose();
|
||||
} else {
|
||||
this._disposables.push(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
protected get isDisposed() {
|
||||
return this._isDisposed;
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660"
|
||||
integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA=
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
@@ -6010,10 +6010,10 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@^2.7.2:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
||||
integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==
|
||||
typescript@^3.3.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b"
|
||||
integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA==
|
||||
|
||||
uc.micro@^1.0.1:
|
||||
version "1.0.3"
|
||||
|
||||
2
extensions/mssql/.gitignore
vendored
2
extensions/mssql/.gitignore
vendored
@@ -1 +1 @@
|
||||
sqltoolsservice
|
||||
sqltoolsservice
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"dataprotocol-client": "github:Microsoft/sqlops-dataprotocolclient#0.2.16",
|
||||
"error-ex": "^1.3.2",
|
||||
"figures": "^2.0.0",
|
||||
"find-remove": "1.2.1",
|
||||
"opener": "^1.4.3",
|
||||
"request": "^2.88.0",
|
||||
"request-promise": "^4.2.2",
|
||||
|
||||
@@ -60,6 +60,11 @@ aws4@^1.8.0:
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
|
||||
base64-js@^1.0.2:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
|
||||
@@ -85,6 +90,14 @@ bluebird@^3.5.0:
|
||||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7"
|
||||
integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
buffer-alloc-unsafe@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
|
||||
@@ -153,6 +166,11 @@ commander@~2.8.1:
|
||||
dependencies:
|
||||
graceful-readlink ">= 1.0.0"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
|
||||
core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
@@ -375,6 +393,19 @@ file-type@^6.1.0:
|
||||
resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919"
|
||||
integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==
|
||||
|
||||
find-remove@1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/find-remove/-/find-remove-1.2.1.tgz#afd93400d23890e018ea197591e9d850d3d049a2"
|
||||
integrity sha512-zcspBi9mWAyM9YTcVJLkI/x6rbjSDqHijjPa0vTwEmVZnYSmvYMtixDkUnSnuv2xAAkc9fblpkCg91paBIJaLw==
|
||||
dependencies:
|
||||
fmerge "1.2.0"
|
||||
rimraf "2.6.2"
|
||||
|
||||
fmerge@1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/fmerge/-/fmerge-1.2.0.tgz#36e99d2ae255e3ee1af666b4df780553671cf692"
|
||||
integrity sha1-NumdKuJV4+4a9ma033gFU2cc9pI=
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
@@ -394,6 +425,11 @@ fs-constants@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
|
||||
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
|
||||
|
||||
get-stream@^2.2.0:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de"
|
||||
@@ -414,6 +450,18 @@ getpass@^0.1.1:
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
glob@^7.0.5:
|
||||
version "7.1.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
|
||||
integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
graceful-fs@^4.1.10:
|
||||
version "4.1.15"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
|
||||
@@ -467,7 +515,15 @@ ieee754@^1.1.4:
|
||||
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b"
|
||||
integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==
|
||||
|
||||
inherits@~2.0.3:
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@~2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||
@@ -574,6 +630,13 @@ mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
dependencies:
|
||||
mime-db "~1.38.0"
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
@@ -613,7 +676,7 @@ object-assign@^4.0.1:
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
|
||||
|
||||
once@^1.4.0:
|
||||
once@^1.3.0, once@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
|
||||
@@ -635,6 +698,11 @@ p-finally@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
|
||||
integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
|
||||
path-key@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
|
||||
@@ -758,6 +826,13 @@ request@^2.88.0:
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
rimraf@2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
|
||||
integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.0.1",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "3.3.1"
|
||||
"typescript": "3.4.0-rc"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "python",
|
||||
"extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi", ".snakefile", ".smk", ".pyi"],
|
||||
"extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi", ".snakefile", ".smk", ".pyi", ".ipy"],
|
||||
"aliases": [ "Python", "py" ],
|
||||
"firstLine": "^#!\\s*/.*\\bpython[0-9.-]*\\b",
|
||||
"configuration": "./language-configuration.json"
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"target": "es2018",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"es2015.promise"
|
||||
],
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"noImplicitAny": true,
|
||||
|
||||
@@ -51,8 +51,6 @@ module.exports = function withDefaults(/**@type WebpackConfig*/extConfig) {
|
||||
},
|
||||
externals: {
|
||||
'vscode': 'commonjs vscode', // ignored because it doesn't exist
|
||||
|
||||
// "vscode-extension-telemetry": 'commonjs vscode-extension-telemetry', // commonly used
|
||||
},
|
||||
output: {
|
||||
// all output goes into `dist`.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "Microsoft/vscode-mssql",
|
||||
"repositoryUrl": "https://github.com/Microsoft/vscode-mssql",
|
||||
"commitHash": "3aa44d04b04d219ad5fa8f411ca9dd32294a7a06"
|
||||
"commitHash": "cd754662e5607c62ecdc51d2a2dc844546a0bbb6"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/Microsoft/vscode-mssql/commit/3aa44d04b04d219ad5fa8f411ca9dd32294a7a06",
|
||||
"version": "https://github.com/Microsoft/vscode-mssql/commit/cd754662e5607c62ecdc51d2a2dc844546a0bbb6",
|
||||
"name": "SQL",
|
||||
"scopeName": "source.sql",
|
||||
"patterns": [
|
||||
@@ -516,4 +516,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"postinstall": "node ./node_modules/vscode/bin/install"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^8.10.25",
|
||||
"@types/node": "^10.12.21",
|
||||
"mocha-junit-reporter": "^1.17.0",
|
||||
"mocha-multi-reporters": "^1.1.7",
|
||||
"vscode": "1.1.5"
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@^8.10.25":
|
||||
version "8.10.25"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
||||
"@types/node@^10.12.21":
|
||||
version "10.12.21"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||
|
||||
ajv@^5.1.0:
|
||||
version "5.3.0"
|
||||
|
||||
@@ -34,4 +34,4 @@
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
typescript@3.3.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b"
|
||||
integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA==
|
||||
typescript@3.4.0-rc:
|
||||
version "3.4.0-rc"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.0-rc.tgz#bc4026c3c517a30fa514b896f2684c6ba92caadb"
|
||||
integrity sha512-wtm2GwuV0Yy2zvmpFaMDtWHnRbzfERi9FLpL+K+JqGkHoclgEQ6TmD1AMxMIjs80NWRIq0Xp1veQyuZbGsUYsg==
|
||||
|
||||
Reference in New Issue
Block a user