@codingame/monaco-vscode-npm-default-extension 36.2.7 → 37.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { registerExtension } from '@codingame/monaco-vscode-api/extensions';
|
|
2
2
|
|
|
3
|
-
var manifest = {name:"npm",publisher:"vscode",displayName:"%displayName%",description:"%description%",version:"
|
|
3
|
+
var manifest = {name:"npm",publisher:"vscode",displayName:"%displayName%",description:"%description%",version:"10.0.0","private":true,license:"MIT",engines:{vscode:"0.10.x"},icon:"images/npm_icon.png",categories:["Other"],enabledApiProposals:["terminalQuickFixProvider"],main:undefined,browser:"./dist/browser/npmBrowserMain",activationEvents:["onTaskType:npm","onLanguage:json","workspaceContains:package.json"],capabilities:{virtualWorkspaces:{supported:"limited",description:"%virtualWorkspaces%"},untrustedWorkspaces:{supported:"limited",description:"%workspaceTrust%"}},contributes:{languages:[{id:"ignore",extensions:[".npmignore"]},{id:"properties",extensions:[".npmrc"]}],views:{explorer:[{id:"npm",name:"%view.name%",when:"npm:showScriptExplorer",icon:"$(json)",visibility:"hidden",contextualTitle:"%view.name%"}]},commands:[{command:"npm.runScript",title:"%command.run%",icon:"$(run)"},{command:"npm.debugScript",title:"%command.debug%",icon:"$(debug)"},{command:"npm.openScript",title:"%command.openScript%"},{command:"npm.runInstall",title:"%command.runInstall%"},{command:"npm.refresh",title:"%command.refresh%",icon:"$(refresh)"},{command:"npm.runSelectedScript",title:"%command.runSelectedScript%"},{command:"npm.runScriptFromFolder",title:"%command.runScriptFromFolder%"},{command:"npm.packageManager",title:"%command.packageManager%"}],menus:{commandPalette:[{command:"npm.refresh",when:"false"},{command:"npm.runScript",when:"false"},{command:"npm.debugScript",when:"false"},{command:"npm.openScript",when:"false"},{command:"npm.runInstall",when:"false"},{command:"npm.runSelectedScript",when:"false"},{command:"npm.runScriptFromFolder",when:"false"},{command:"npm.packageManager",when:"false"}],"editor/context":[{command:"npm.runSelectedScript",when:"resourceFilename == 'package.json' && resourceScheme == file",group:"navigation@+1"}],"view/title":[{command:"npm.refresh",when:"view == npm",group:"navigation"}],"view/item/context":[{command:"npm.openScript",when:"view == npm && viewItem == packageJSON",group:"navigation@1"},{command:"npm.runInstall",when:"view == npm && viewItem == packageJSON",group:"navigation@2"},{command:"npm.openScript",when:"view == npm && viewItem == script",group:"navigation@1"},{command:"npm.runScript",when:"view == npm && viewItem == script",group:"navigation@2"},{command:"npm.runScript",when:"view == npm && viewItem == script",group:"inline"},{command:"npm.debugScript",when:"view == npm && viewItem == script",group:"inline"},{command:"npm.debugScript",when:"view == npm && viewItem == script",group:"navigation@3"}],"explorer/context":[{when:"config.npm.enableRunFromFolder && explorerViewletVisible && explorerResourceIsFolder && resourceScheme == file",command:"npm.runScriptFromFolder",group:"2_workspace"}]},configuration:{id:"npm",type:"object",title:"Npm",properties:{"npm.autoDetect":{type:"string","enum":["off","on"],"default":"on",scope:"resource",description:"%config.npm.autoDetect%"},"npm.runSilent":{type:"boolean","default":false,scope:"resource",markdownDescription:"%config.npm.runSilent%"},"npm.packageManager":{scope:"resource",type:"string","enum":["auto","npm","yarn","pnpm","bun"],enumDescriptions:["%config.npm.packageManager.auto%","%config.npm.packageManager.npm%","%config.npm.packageManager.yarn%","%config.npm.packageManager.pnpm%","%config.npm.packageManager.bun%"],"default":"auto",description:"%config.npm.packageManager%"},"npm.scriptRunner":{scope:"resource",type:"string","enum":["auto","npm","yarn","pnpm","bun","node","vp"],enumDescriptions:["%config.npm.scriptRunner.auto%","%config.npm.scriptRunner.npm%","%config.npm.scriptRunner.yarn%","%config.npm.scriptRunner.pnpm%","%config.npm.scriptRunner.bun%","%config.npm.scriptRunner.node%","%config.npm.scriptRunner.vp%"],"default":"auto",description:"%config.npm.scriptRunner%"},"npm.exclude":{type:["string","array"],items:{type:"string"},description:"%config.npm.exclude%",scope:"resource"},"npm.enableRunFromFolder":{type:"boolean","default":false,scope:"resource",description:"%config.npm.enableRunFromFolder%"},"npm.scriptExplorerAction":{type:"string","enum":["open","run"],markdownDescription:"%config.npm.scriptExplorerAction%",scope:"window","default":"open"},"npm.scriptExplorerExclude":{type:"array",items:{type:"string"},markdownDescription:"%config.npm.scriptExplorerExclude%",scope:"resource","default":[]},"npm.fetchOnlinePackageInfo":{type:"boolean",description:"%config.npm.fetchOnlinePackageInfo%","default":true,scope:"window",tags:["usesOnlineServices"]},"npm.scriptHover":{type:"boolean",markdownDescription:"%config.npm.scriptHover%","default":true,scope:"window"}}},jsonValidation:[{fileMatch:"package.json",url:"https://www.schemastore.org/package"},{fileMatch:"bower.json",url:"https://www.schemastore.org/bower"}],taskDefinitions:[{type:"npm",required:["script"],properties:{script:{type:"string",description:"%taskdef.script%"},path:{type:"string",description:"%taskdef.path%"}},when:"shellExecutionSupported"}],terminalQuickFixes:[{id:"ms-vscode.npm-command",commandLineMatcher:"npm",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:8,lineMatcher:"Did you mean (?:this|one of these)\\?((?:\\n.+?npm .+ #.+)+)",offset:2}}]},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
|
|
4
4
|
|
|
5
5
|
const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, {"system":true,"readmePath":"README.md"});
|
|
6
|
-
registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), {"mimeType":"text/markdown","size":
|
|
7
|
-
registerFileUrl('dist/browser/npmBrowserMain', new URL('./resources/npmBrowserMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
8
|
-
registerFileUrl('dist/browser/npmBrowserMain.js', new URL('./resources/npmBrowserMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":
|
|
9
|
-
registerFileUrl('dist/browser/npmBrowserMain.js.map', new URL('./resources/npmBrowserMain.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
6
|
+
registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), {"mimeType":"text/markdown","size":2758});
|
|
7
|
+
registerFileUrl('dist/browser/npmBrowserMain', new URL('./resources/npmBrowserMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":28659});
|
|
8
|
+
registerFileUrl('dist/browser/npmBrowserMain.js', new URL('./resources/npmBrowserMain.js', import.meta.url).toString(), {"mimeType":"text/javascript","size":28659});
|
|
9
|
+
registerFileUrl('dist/browser/npmBrowserMain.js.map', new URL('./resources/npmBrowserMain.js.map', import.meta.url).toString(), {"mimeType":"application/json","size":167575});
|
|
10
10
|
registerFileUrl('images/code.svg', new URL('./resources/code.svg', import.meta.url).toString(), {"mimeType":"image/svg+xml","size":434});
|
|
11
11
|
registerFileUrl('images/npm_icon.png', new URL('./resources/npm_icon.png', import.meta.url).toString(), {"mimeType":"image/png","size":523});
|
|
12
|
-
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
13
|
-
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), {"mimeType":"application/json","size":
|
|
12
|
+
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), {"mimeType":"application/json","size":5620});
|
|
13
|
+
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), {"mimeType":"application/json","size":2843});
|
|
14
14
|
|
|
15
15
|
export { whenReady };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-npm-default-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@codingame/monaco-vscode-api": "
|
|
21
|
+
"@codingame/monaco-vscode-api": "37.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/resources/README.md
CHANGED
|
@@ -15,7 +15,7 @@ For more information about auto detection of Tasks, see the [documentation](http
|
|
|
15
15
|
|
|
16
16
|
### Script Explorer
|
|
17
17
|
|
|
18
|
-
The Npm Script Explorer shows the npm scripts found in your workspace.
|
|
18
|
+
The Npm Script Explorer shows the npm scripts found in your workspace. A script can be opened, run, or debug from the explorer.
|
|
19
19
|
|
|
20
20
|
### Run Scripts from the Editor
|
|
21
21
|
|
|
@@ -37,7 +37,6 @@ The extension fetches data from <https://registry.npmjs.org> and <https://regist
|
|
|
37
37
|
- `npm.packageManager` - The package manager used to install dependencies: `auto`, `npm`, `yarn`, `pnpm` or `bun`. The default is `auto`, which detects your package manager based on files in your workspace.
|
|
38
38
|
- `npm.scriptRunner` - The script runner used to run the scripts: `auto`, `npm`, `yarn`, `pnpm`, `bun` or `node`. The default is `auto`, which detects your script runner based on files in your workspace.
|
|
39
39
|
- `npm.exclude` - Glob patterns for folders that should be excluded from automatic script detection. The pattern is matched against the **absolute path** of the package.json. For example, to exclude all test folders use '**/test/**'.
|
|
40
|
-
- `npm.enableScriptExplorer` - Enable an explorer view for npm scripts.
|
|
41
40
|
- `npm.scriptExplorerAction` - The default click action: `open` or `run`, the default is `open`.
|
|
42
41
|
- `npm.enableRunFromFolder` - Enable running npm scripts from the context menu of folders in Explorer, the default is `false`.
|
|
43
42
|
- `npm.scriptCodeLens.enable` - Enable/disable the code lenses to run a script, the default is `false`.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`;break;case 114:p+="\r";break;case 116:p+=" ";break;case 117:let w=y(4,!0);w>=0?p+=String.fromCharCode(w):u=4;break;default:u=5}k=n;continue}if(d>=0&&d<=31)if(U(d)){p+=e.substring(k,n),u=2;break}else u=6;n++}return p}function
|
|
3
|
-
`),l++,a=n,s=14;switch(p){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,i=N(),s=10;case 47:let k=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<t&&!U(e.charCodeAt(n));)n++;return i=e.substring(k,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let d=t-1,A=!1;for(;n<d;){let w=e.charCodeAt(n);if(w===42&&e.charCodeAt(n+1)===47){n+=2,A=!0;break}n++,U(w)&&(w===13&&e.charCodeAt(n)===10&&n++,l++,a=n)}return A||(n++,u=1),i=e.substring(k,n),s=13}return i+=String.fromCharCode(p),n++,s=16;case 45:if(i+=String.fromCharCode(p),n++,n===t||!E(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=b(),s=11;default:for(;n<t&&q(p);)n++,p=e.charCodeAt(n);if(o!==n){switch(i=e.substring(o,n),i){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return i+=String.fromCharCode(p),n++,s=16}}function q(p){if(z(p)||U(p))return!1;switch(p){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function _(){let p;do p=x();while(p>=12&&p<=15);return p}return{setPosition:O,getPosition:()=>n,scan:r?_:x,getToken:()=>s,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>f,getTokenStartCharacter:()=>o-c,getTokenError:()=>u}}function z(e){return e===32||e===9}function U(e){return e===10||e===13}function E(e){return e>=48&&e<=57}var ie;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ie||(ie={}));v();v();var X;(function(e){e.DEFAULT={allowTrailingComma:!1}})(X||(X={}));function oe(e,r){let t=[],n=new Object,i,o={value:{},offset:0,length:0,type:"object",parent:void 0},s=!1;function l(f,a,c,u){o.value=f,o.offset=a,o.length=c,o.type=u,o.colonOffset=void 0,i=o}try{se(e,{onObjectBegin:(f,a)=>{if(r<=f)throw n;i=void 0,s=r>f,t.push("")},onObjectProperty:(f,a,c)=>{if(r<a||(l(f,a,c,"property"),t[t.length-1]=f,r<=a+c))throw n},onObjectEnd:(f,a)=>{if(r<=f)throw n;i=void 0,t.pop()},onArrayBegin:(f,a)=>{if(r<=f)throw n;i=void 0,t.push(0)},onArrayEnd:(f,a)=>{if(r<=f)throw n;i=void 0,t.pop()},onLiteralValue:(f,a,c)=>{if(r<a||(l(f,a,c,je(f)),r<=a+c))throw n},onSeparator:(f,a,c)=>{if(r<=a)throw n;if(f===":"&&i&&i.type==="property")i.colonOffset=a,s=!1,i=void 0;else if(f===","){let u=t[t.length-1];typeof u=="number"?t[t.length-1]=u+1:(s=!0,t[t.length-1]=""),i=void 0}}})}catch(f){if(f!==n)throw f}return{path:t,previousNode:i,isAtPropertyKey:s,matches:f=>{let a=0;for(let c=0;a<f.length&&c<t.length;c++)if(f[a]===t[c]||f[a]==="*")a++;else if(f[a]!=="**")return!1;return a===f.length}}}function se(e,r,t=X.DEFAULT){let n=D(e,!1),i=[];function o(h){return h?()=>h(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(h){return h?()=>h(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(h){return h?T=>h(T,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function f(h){return h?T=>h(T,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}let a=s(r.onObjectBegin),c=f(r.onObjectProperty),u=o(r.onObjectEnd),y=s(r.onArrayBegin),O=o(r.onArrayEnd),b=f(r.onLiteralValue),N=l(r.onSeparator),x=o(r.onComment),q=l(r.onError),_=t&&t.disallowComments,p=t&&t.allowTrailingComma;function k(){for(;;){let h=n.scan();switch(n.getTokenError()){case 4:d(14);break;case 5:d(15);break;case 3:d(13);break;case 1:_||d(11);break;case 2:d(12);break;case 6:d(16);break}switch(h){case 12:case 13:_?d(10):x();break;case 16:d(1);break;case 15:case 14:break;default:return h}}}function d(h,T=[],C=[]){if(q(h),T.length+C.length>0){let B=n.getToken();for(;B!==17;){if(T.indexOf(B)!==-1){k();break}else if(C.indexOf(B)!==-1)break;B=k()}}}function A(h){let T=n.getTokenValue();return h?b(T):(c(T),i.push(T)),k(),!0}function w(){switch(n.getToken()){case 11:let h=n.getTokenValue(),T=Number(h);isNaN(T)&&(d(2),T=0),b(T);break;case 7:b(null);break;case 8:b(!0);break;case 9:b(!1);break;default:return!1}return k(),!0}function ke(){return n.getToken()!==10?(d(3,[],[2,5]),!1):(A(!1),n.getToken()===6?(N(":"),k(),$()||d(4,[],[2,5])):d(5,[],[2,5]),i.pop(),!0)}function ve(){a(),k();let h=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(h||d(4,[],[]),N(","),k(),n.getToken()===2&&p)break}else h&&d(6,[],[]);ke()||d(4,[],[2,5]),h=!0}return u(),n.getToken()!==2?d(7,[2],[]):k(),!0}function ye(){y(),k();let h=!0,T=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(T||d(4,[],[]),N(","),k(),n.getToken()===4&&p)break}else T&&d(6,[],[]);h?(i.push(0),h=!1):i[i.length-1]++,$()||d(4,[],[4,5]),T=!0}return O(),h||i.pop(),n.getToken()!==4?d(8,[4],[]):k(),!0}function $(){switch(n.getToken()){case 3:return ye();case 1:return ve();case 10:return A(!0);default:return w()}}return k(),n.getToken()===17?t.allowEmptyContent?!0:(d(4,[],[]),!1):$()?(n.getToken()!==17&&d(9,[],[]),!0):(d(4,[],[]),!1)}function je(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}var fe=D,M;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(M||(M={}));var L;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(L||(L={}));var Q=oe;var le;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(le||(le={}));v();var m=require("vscode"),de=H(ue());v();var g=require("vscode"),G=60,Y=G*60,V=Y*24,ge=V*7,pe=V*30,me=V*365;function Z(e,r,t,n){typeof e!="number"&&(e=e.getTime());let i=Math.round((new Date().getTime()-e)/1e3);if(i<-30)return g.l10n.t("in {0}",Z(new Date().getTime()+i*1e3,!1));if(!n&&i<30)return g.l10n.t("now");let o;return i<G?(o=i,r?o===1?t?g.l10n.t("{0} second ago",o):g.l10n.t("{0} sec ago",o):t?g.l10n.t("{0} seconds ago",o):g.l10n.t("{0} secs ago",o):o===1?t?g.l10n.t("{0} second",o):g.l10n.t("{0} sec",o):t?g.l10n.t("{0} seconds",o):g.l10n.t("{0} secs",o)):i<Y?(o=Math.floor(i/G),r?o===1?t?g.l10n.t("{0} minute ago",o):g.l10n.t("{0} min ago",o):t?g.l10n.t("{0} minutes ago",o):g.l10n.t("{0} mins ago",o):o===1?t?g.l10n.t("{0} minute",o):g.l10n.t("{0} min",o):t?g.l10n.t("{0} minutes",o):g.l10n.t("{0} mins",o)):i<V?(o=Math.floor(i/Y),r?o===1?t?g.l10n.t("{0} hour ago",o):g.l10n.t("{0} hr ago",o):t?g.l10n.t("{0} hours ago",o):g.l10n.t("{0} hrs ago",o):o===1?t?g.l10n.t("{0} hour",o):g.l10n.t("{0} hr",o):t?g.l10n.t("{0} hours",o):g.l10n.t("{0} hrs",o)):i<ge?(o=Math.floor(i/V),r?o===1?g.l10n.t("{0} day ago",o):g.l10n.t("{0} days ago",o):o===1?g.l10n.t("{0} day",o):g.l10n.t("{0} days",o)):i<pe?(o=Math.floor(i/ge),r?o===1?t?g.l10n.t("{0} week ago",o):g.l10n.t("{0} wk ago",o):t?g.l10n.t("{0} weeks ago",o):g.l10n.t("{0} wks ago",o):o===1?t?g.l10n.t("{0} week",o):g.l10n.t("{0} wk",o):t?g.l10n.t("{0} weeks",o):g.l10n.t("{0} wks",o)):i<me?(o=Math.floor(i/pe),r?o===1?t?g.l10n.t("{0} month ago",o):g.l10n.t("{0} mo ago",o):t?g.l10n.t("{0} months ago",o):g.l10n.t("{0} mos ago",o):o===1?t?g.l10n.t("{0} month",o):g.l10n.t("{0} mo",o):t?g.l10n.t("{0} months",o):g.l10n.t("{0} mos",o)):(o=Math.floor(i/me),r?o===1?t?g.l10n.t("{0} year ago",o):g.l10n.t("{0} yr ago",o):t?g.l10n.t("{0} years ago",o):g.l10n.t("{0} yrs ago",o):o===1?t?g.l10n.t("{0} year",o):g.l10n.t("{0} yr",o):t?g.l10n.t("{0} years",o):g.l10n.t("{0} yrs",o))}var Me=40,F="Visual Studio Code",J=class{constructor(r,t){this.xhr=r;this.npmCommandPath=t}xhr;npmCommandPath;mostDependedOn=["lodash","async","underscore","request","commander","express","debug","chalk","colors","q","coffee-script","mkdirp","optimist","through2","yeoman-generator","moment","bluebird","glob","gulp-util","minimist","cheerio","pug","redis","node-uuid","socket","io","uglify-js","winston","through","fs-extra","handlebars","body-parser","rimraf","mime","semver","mongodb","jquery","grunt","connect","yosay","underscore","string","xml2js","ejs","mongoose","marked","extend","mocha","superagent","js-yaml","xtend","shelljs","gulp","yargs","browserify","minimatch","react","less","prompt","inquirer","ws","event-stream","inherits","mysql","esprima","jsdom","stylus","when","readable-stream","aws-sdk","concat-stream","chai","Thenable","wrench"];knownScopes=["@types","@angular","@babel","@nuxtjs","@vue","@bazel"];getDocumentSelector(){return[{language:"json",scheme:"*",pattern:"**/package.json"}]}collectDefaultSuggestions(r,t){let n={name:"${1:name}",description:"${2:description}",authors:"${3:author}",version:"${4:1.0.0}",main:"${5:pathToMain}",dependencies:{}},i=new m.CompletionItem(m.l10n.t("Default package.json"));return i.kind=m.CompletionItemKind.Module,i.insertText=new m.SnippetString(JSON.stringify(n,null," ")),t.add(i),Promise.resolve(null)}isEnabled(){return this.npmCommandPath||this.onlineEnabled()}onlineEnabled(){return!!m.workspace.getConfiguration("npm").get("fetchOnlinePackageInfo")}collectPropertySuggestions(r,t,n,i,o,s){if(!this.isEnabled())return null;if(t.matches(["dependencies"])||t.matches(["devDependencies"])||t.matches(["optionalDependencies"])||t.matches(["peerDependencies"])){let l;if(n.length>0){if(n[0]==="@"){if(n.indexOf("/")!==-1)return this.collectScopedPackages(n,i,o,s);for(let f of this.knownScopes){let a=new m.CompletionItem(f);a.kind=m.CompletionItemKind.Property,a.insertText=new m.SnippetString().appendText(`"${f}/`).appendTabstop().appendText('"'),a.filterText=JSON.stringify(f),a.documentation="",a.command={title:"",command:"editor.action.triggerSuggest"},s.add(a)}s.setAsIncomplete()}return l=`https://registry.npmjs.org/-/v1/search?size=${Me}&text=${encodeURIComponent(n)}`,this.xhr({url:l,headers:{agent:F}}).then(f=>{if(f.status===200){try{let a=JSON.parse(f.responseText);if(a&&a.objects&&Array.isArray(a.objects)){let c=a.objects;for(let u of c)this.processPackage(u.package,i,o,s)}}catch{}s.setAsIncomplete()}else return s.error(m.l10n.t("Request to the NPM repository failed: {0}",f.responseText)),0},f=>(s.error(m.l10n.t("Request to the NPM repository failed: {0}",f.responseText)),0))}else return this.mostDependedOn.forEach(f=>{let a=new m.SnippetString().appendText(JSON.stringify(f));i&&(a.appendText(': "').appendTabstop().appendText('"'),o||a.appendText(","));let c=new m.CompletionItem(f);c.kind=m.CompletionItemKind.Property,c.insertText=a,c.filterText=JSON.stringify(f),c.documentation="",s.add(c)}),this.collectScopedPackages(n,i,o,s),s.setAsIncomplete(),Promise.resolve(null)}return null}collectScopedPackages(r,t,n,i){let o=r.split("/");if(o.length===2&&o[0].length>1){let s=o[0].substr(1),l=o[1];l.length<4&&(l="");let f=`https://registry.npmjs.com/-/v1/search?text=scope:${s}%20${l}&size=250`;return this.xhr({url:f,headers:{agent:F}}).then(a=>{if(a.status===200){try{let c=JSON.parse(a.responseText);if(c&&Array.isArray(c.objects)){let u=c.objects;for(let y of u)this.processPackage(y.package,t,n,i)}}catch{}i.setAsIncomplete()}else i.error(m.l10n.t("Request to the NPM repository failed: {0}",a.responseText));return null})}return Promise.resolve(null)}async collectValueSuggestions(r,t,n){if(!this.isEnabled())return null;if(t.matches(["dependencies","*"])||t.matches(["devDependencies","*"])||t.matches(["optionalDependencies","*"])||t.matches(["peerDependencies","*"])){let i=t.path[t.path.length-1];if(typeof i=="string"){let o=await this.fetchPackageInfo(i,r);if(o&&o.version){let s=JSON.stringify(o.version),l=new m.CompletionItem(s);l.kind=m.CompletionItemKind.Property,l.insertText=s,l.documentation=m.l10n.t("The currently latest version of the package"),n.add(l),s=JSON.stringify("^"+o.version),l=new m.CompletionItem(s),l.kind=m.CompletionItemKind.Property,l.insertText=s,l.documentation=m.l10n.t("Matches the most recent major version (1.x.x)"),n.add(l),s=JSON.stringify("~"+o.version),l=new m.CompletionItem(s),l.kind=m.CompletionItemKind.Property,l.insertText=s,l.documentation=m.l10n.t("Matches the most recent minor version (1.2.x)"),n.add(l)}}}return null}getDocumentation(r,t,n,i,o){let s=new m.MarkdownString;return r&&s.appendText(r),t&&(s.appendText(`
|
|
1
|
+
"use strict";var Te=Object.create;var R=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty;var Ne=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(n){throw t=[n],n}};var ee=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}},Pe=(e,r)=>{for(var t in r)R(e,t,{get:r[t],enumerable:!0})},ne=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Oe(r))!Ie.call(e,i)&&i!==t&&R(e,i,{get:()=>r[i],enumerable:!(n=Ae(r,i))||n.enumerable});return e};var H=(e,r,t)=>(t=e!=null?Te(Se(e)):{},ne(r||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)),xe=e=>ne(R({},"__esModule",{value:!0}),e);var S,v=Ne(()=>{S={}});var re=ee(te=>{"use strict";v();(()=>{"use strict";var e={};(()=>{var n=e;Object.defineProperty(n,"__esModule",{value:!0}),n.getErrorStatusDescription=n.xhr=n.configure=void 0,n.configure=(i,o)=>{},n.xhr=async i=>{let o=new Headers;if(i.headers)for(let u in i.headers){let y=i.headers[u];Array.isArray(y)?y.forEach((O=>o.set(u,O))):o.set(u,y)}i.user&&i.password&&o.set("Authorization","Basic "+btoa(i.user+":"+i.password));let s={method:i.type,redirect:i.followRedirects>0?"follow":"manual",mode:"cors",headers:o};if(i.data&&(s.body=i.data),i.token){let u=new AbortController;i.token.isCancellationRequested&&u.abort(),i.token.onCancellationRequested((()=>{u.abort()})),s.signal=u.signal}let f=new Request(i.url,s),l=await fetch(f),a={};l.headers.forEach(((u,y)=>{a[y]=u}));let c=await l.arrayBuffer();return new class{constructor(){this.status=l.status,this.headers=a}get responseText(){return new TextDecoder().decode(c)}get body(){return new Uint8Array(c)}}},n.getErrorStatusDescription=function(i){return String(i)}})();var r=te;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})()});var ue=ee((mn,ce)=>{"use strict";v();function P(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function ae(e,r){for(var t="",n=0,i=-1,o=0,s,f=0;f<=e.length;++f){if(f<e.length)s=e.charCodeAt(f);else{if(s===47)break;s=47}if(s===47){if(!(i===f-1||o===1))if(i!==f-1&&o===2){if(t.length<2||n!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){var l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=f,o=0;continue}}else if(t.length===2||t.length===1){t="",n=0,i=f,o=0;continue}}r&&(t.length>0?t+="/..":t="..",n=2)}else t.length>0?t+="/"+e.slice(i+1,f):t=e.slice(i+1,f),n=f-i-1;i=f,o=0}else s===46&&o!==-1?++o:o=-1}return t}function Me(e,r){var t=r.dir||r.root,n=r.base||(r.name||"")+(r.ext||"");return t?t===r.root?t+n:t+e+n:n}var j={resolve:function(){for(var r="",t=!1,n,i=arguments.length-1;i>=-1&&!t;i--){var o;i>=0?o=arguments[i]:(n===void 0&&(n=process.cwd()),o=n),P(o),o.length!==0&&(r=o+"/"+r,t=o.charCodeAt(0)===47)}return r=ae(r,!t),t?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(r){if(P(r),r.length===0)return".";var t=r.charCodeAt(0)===47,n=r.charCodeAt(r.length-1)===47;return r=ae(r,!t),r.length===0&&!t&&(r="."),r.length>0&&n&&(r+="/"),t?"/"+r:r},isAbsolute:function(r){return P(r),r.length>0&&r.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var r,t=0;t<arguments.length;++t){var n=arguments[t];P(n),n.length>0&&(r===void 0?r=n:r+="/"+n)}return r===void 0?".":j.normalize(r)},relative:function(r,t){if(P(r),P(t),r===t||(r=j.resolve(r),t=j.resolve(t),r===t))return"";for(var n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var i=r.length,o=i-n,s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var f=t.length,l=f-s,a=o<l?o:l,c=-1,u=0;u<=a;++u){if(u===a){if(l>a){if(t.charCodeAt(s+u)===47)return t.slice(s+u+1);if(u===0)return t.slice(s+u)}else o>a&&(r.charCodeAt(n+u)===47?c=u:u===0&&(c=0));break}var y=r.charCodeAt(n+u),O=t.charCodeAt(s+u);if(y!==O)break;y===47&&(c=u)}var b="";for(u=n+c+1;u<=i;++u)(u===i||r.charCodeAt(u)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+t.slice(s+c):(s+=c,t.charCodeAt(s)===47&&++s,t.slice(s))},_makeLong:function(r){return r},dirname:function(r){if(P(r),r.length===0)return".";for(var t=r.charCodeAt(0),n=t===47,i=-1,o=!0,s=r.length-1;s>=1;--s)if(t=r.charCodeAt(s),t===47){if(!o){i=s;break}}else o=!1;return i===-1?n?"/":".":n&&i===1?"//":r.slice(0,i)},basename:function(r,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');P(r);var n=0,i=-1,o=!0,s;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";var f=t.length-1,l=-1;for(s=r.length-1;s>=0;--s){var a=r.charCodeAt(s);if(a===47){if(!o){n=s+1;break}}else l===-1&&(o=!1,l=s+1),f>=0&&(a===t.charCodeAt(f)?--f===-1&&(i=s):(f=-1,i=l))}return n===i?i=l:i===-1&&(i=r.length),r.slice(n,i)}else{for(s=r.length-1;s>=0;--s)if(r.charCodeAt(s)===47){if(!o){n=s+1;break}}else i===-1&&(o=!1,i=s+1);return i===-1?"":r.slice(n,i)}},extname:function(r){P(r);for(var t=-1,n=0,i=-1,o=!0,s=0,f=r.length-1;f>=0;--f){var l=r.charCodeAt(f);if(l===47){if(!o){n=f+1;break}continue}i===-1&&(o=!1,i=f+1),l===46?t===-1?t=f:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||i===-1||s===0||s===1&&t===i-1&&t===n+1?"":r.slice(t,i)},format:function(r){if(r===null||typeof r!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof r);return Me("/",r)},parse:function(r){P(r);var t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;var n=r.charCodeAt(0),i=n===47,o;i?(t.root="/",o=1):o=0;for(var s=-1,f=0,l=-1,a=!0,c=r.length-1,u=0;c>=o;--c){if(n=r.charCodeAt(c),n===47){if(!a){f=c+1;break}continue}l===-1&&(a=!1,l=c+1),n===46?s===-1?s=c:u!==1&&(u=1):s!==-1&&(u=-1)}return s===-1||l===-1||u===0||u===1&&s===l-1&&s===f+1?l!==-1&&(f===0&&i?t.base=t.name=r.slice(1,l):t.base=t.name=r.slice(f,l)):(f===0&&i?(t.name=r.slice(1,s),t.base=r.slice(1,l)):(t.name=r.slice(f,s),t.base=r.slice(f,l)),t.ext=r.slice(s,l)),f>0?t.dir=r.slice(0,f-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};j.posix=j;ce.exports=j});var He={};Pe(He,{activate:()=>qe,deactivate:()=>$e});module.exports=xe(He);v();var ke=H(re());v();v();v();v();function V(e,r=!1){let t=e.length,n=0,i="",o=0,s=16,f=0,l=0,a=0,c=0,u=0;function y(p,k){let d=0,A=0;for(;d<p||!k;){let w=e.charCodeAt(n);if(w>=48&&w<=57)A=A*16+w-48;else if(w>=65&&w<=70)A=A*16+w-65+10;else if(w>=97&&w<=102)A=A*16+w-97+10;else break;n++,d++}return d<p&&(A=-1),A}function O(p){n=p,i="",o=0,s=16,u=0}function b(){let p=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&E(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&E(e.charCodeAt(n)))for(n++;n<e.length&&E(e.charCodeAt(n));)n++;else return u=3,e.substring(p,n);let k=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&E(e.charCodeAt(n))){for(n++;n<e.length&&E(e.charCodeAt(n));)n++;k=n}else u=3;return e.substring(p,k)}function N(){let p="",k=n;for(;;){if(n>=t){p+=e.substring(k,n),u=2;break}let d=e.charCodeAt(n);if(d===34){p+=e.substring(k,n),n++;break}if(d===92){if(p+=e.substring(k,n),n++,n>=t){u=2;break}switch(e.charCodeAt(n++)){case 34:p+='"';break;case 92:p+="\\";break;case 47:p+="/";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+=`
|
|
2
|
+
`;break;case 114:p+="\r";break;case 116:p+=" ";break;case 117:let w=y(4,!0);w>=0?p+=String.fromCharCode(w):u=4;break;default:u=5}k=n;continue}if(d>=0&&d<=31)if(U(d)){p+=e.substring(k,n),u=2;break}else u=6;n++}return p}function L(){if(i="",u=0,o=n,l=f,c=a,n>=t)return o=t,s=17;let p=e.charCodeAt(n);if(z(p)){do n++,i+=String.fromCharCode(p),p=e.charCodeAt(n);while(z(p));return s=15}if(U(p))return n++,i+=String.fromCharCode(p),p===13&&e.charCodeAt(n)===10&&(n++,i+=`
|
|
3
|
+
`),f++,a=n,s=14;switch(p){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,i=N(),s=10;case 47:let k=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<t&&!U(e.charCodeAt(n));)n++;return i=e.substring(k,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let d=t-1,A=!1;for(;n<d;){let w=e.charCodeAt(n);if(w===42&&e.charCodeAt(n+1)===47){n+=2,A=!0;break}n++,U(w)&&(w===13&&e.charCodeAt(n)===10&&n++,f++,a=n)}return A||(n++,u=1),i=e.substring(k,n),s=13}return i+=String.fromCharCode(p),n++,s=16;case 45:if(i+=String.fromCharCode(p),n++,n===t||!E(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=b(),s=11;default:for(;n<t&&q(p);)n++,p=e.charCodeAt(n);if(o!==n){switch(i=e.substring(o,n),i){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return i+=String.fromCharCode(p),n++,s=16}}function q(p){if(z(p)||U(p))return!1;switch(p){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function _(){let p;do p=L();while(p>=12&&p<=15);return p}return{setPosition:O,getPosition:()=>n,scan:r?_:L,getToken:()=>s,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>l,getTokenStartCharacter:()=>o-c,getTokenError:()=>u}}function z(e){return e===32||e===9}function U(e){return e===10||e===13}function E(e){return e>=48&&e<=57}var ie;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ie||(ie={}));v();v();var X;(function(e){e.DEFAULT={allowTrailingComma:!1}})(X||(X={}));function oe(e,r){let t=[],n=new Object,i,o={value:{},offset:0,length:0,type:"object",parent:void 0},s=!1;function f(l,a,c,u){o.value=l,o.offset=a,o.length=c,o.type=u,o.colonOffset=void 0,i=o}try{se(e,{onObjectBegin:(l,a)=>{if(r<=l)throw n;i=void 0,s=r>l,t.push("")},onObjectProperty:(l,a,c)=>{if(r<a||(f(l,a,c,"property"),t[t.length-1]=l,r<=a+c))throw n},onObjectEnd:(l,a)=>{if(r<=l)throw n;i=void 0,t.pop()},onArrayBegin:(l,a)=>{if(r<=l)throw n;i=void 0,t.push(0)},onArrayEnd:(l,a)=>{if(r<=l)throw n;i=void 0,t.pop()},onLiteralValue:(l,a,c)=>{if(r<a||(f(l,a,c,Ue(l)),r<=a+c))throw n},onSeparator:(l,a,c)=>{if(r<=a)throw n;if(l===":"&&i&&i.type==="property")i.colonOffset=a,s=!1,i=void 0;else if(l===","){let u=t[t.length-1];typeof u=="number"?t[t.length-1]=u+1:(s=!0,t[t.length-1]=""),i=void 0}}})}catch(l){if(l!==n)throw l}return{path:t,previousNode:i,isAtPropertyKey:s,matches:l=>{let a=0;for(let c=0;a<l.length&&c<t.length;c++)if(l[a]===t[c]||l[a]==="*")a++;else if(l[a]!=="**")return!1;return a===l.length}}}function se(e,r,t=X.DEFAULT){let n=V(e,!1),i=[];function o(h){return h?()=>h(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(h){return h?()=>h(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}function f(h){return h?T=>h(T,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(h){return h?T=>h(T,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>i.slice()):()=>!0}let a=s(r.onObjectBegin),c=l(r.onObjectProperty),u=o(r.onObjectEnd),y=s(r.onArrayBegin),O=o(r.onArrayEnd),b=l(r.onLiteralValue),N=f(r.onSeparator),L=o(r.onComment),q=f(r.onError),_=t&&t.disallowComments,p=t&&t.allowTrailingComma;function k(){for(;;){let h=n.scan();switch(n.getTokenError()){case 4:d(14);break;case 5:d(15);break;case 3:d(13);break;case 1:_||d(11);break;case 2:d(12);break;case 6:d(16);break}switch(h){case 12:case 13:_?d(10):L();break;case 16:d(1);break;case 15:case 14:break;default:return h}}}function d(h,T=[],C=[]){if(q(h),T.length+C.length>0){let B=n.getToken();for(;B!==17;){if(T.indexOf(B)!==-1){k();break}else if(C.indexOf(B)!==-1)break;B=k()}}}function A(h){let T=n.getTokenValue();return h?b(T):(c(T),i.push(T)),k(),!0}function w(){switch(n.getToken()){case 11:let h=n.getTokenValue(),T=Number(h);isNaN(T)&&(d(2),T=0),b(T);break;case 7:b(null);break;case 8:b(!0);break;case 9:b(!1);break;default:return!1}return k(),!0}function ve(){return n.getToken()!==10?(d(3,[],[2,5]),!1):(A(!1),n.getToken()===6?(N(":"),k(),$()||d(4,[],[2,5])):d(5,[],[2,5]),i.pop(),!0)}function ye(){a(),k();let h=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(h||d(4,[],[]),N(","),k(),n.getToken()===2&&p)break}else h&&d(6,[],[]);ve()||d(4,[],[2,5]),h=!0}return u(),n.getToken()!==2?d(7,[2],[]):k(),!0}function we(){y(),k();let h=!0,T=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(T||d(4,[],[]),N(","),k(),n.getToken()===4&&p)break}else T&&d(6,[],[]);h?(i.push(0),h=!1):i[i.length-1]++,$()||d(4,[],[4,5]),T=!0}return O(),h||i.pop(),n.getToken()!==4?d(8,[4],[]):k(),!0}function $(){switch(n.getToken()){case 3:return we();case 1:return ye();case 10:return A(!0);default:return w()}}return k(),n.getToken()===17?t.allowEmptyContent?!0:(d(4,[],[]),!1):$()?(n.getToken()!==17&&d(9,[],[]),!0):(d(4,[],[]),!1)}function Ue(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}var fe=V,M;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(M||(M={}));var x;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(x||(x={}));var Q=oe;var le;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(le||(le={}));v();var m=require("vscode"),he=H(ue());v();var g=require("vscode"),G=60,Y=G*60,D=Y*24,ge=D*7,pe=D*30,me=D*365;function Z(e,r,t,n){typeof e!="number"&&(e=e.getTime());let i=Math.round((new Date().getTime()-e)/1e3);if(i<-30)return g.l10n.t("in {0}",Z(new Date().getTime()+i*1e3,!1));if(!n&&i<30)return g.l10n.t("now");let o;return i<G?(o=i,r?o===1?t?g.l10n.t("{0} second ago",o):g.l10n.t("{0} sec ago",o):t?g.l10n.t("{0} seconds ago",o):g.l10n.t("{0} secs ago",o):o===1?t?g.l10n.t("{0} second",o):g.l10n.t("{0} sec",o):t?g.l10n.t("{0} seconds",o):g.l10n.t("{0} secs",o)):i<Y?(o=Math.floor(i/G),r?o===1?t?g.l10n.t("{0} minute ago",o):g.l10n.t("{0} min ago",o):t?g.l10n.t("{0} minutes ago",o):g.l10n.t("{0} mins ago",o):o===1?t?g.l10n.t("{0} minute",o):g.l10n.t("{0} min",o):t?g.l10n.t("{0} minutes",o):g.l10n.t("{0} mins",o)):i<D?(o=Math.floor(i/Y),r?o===1?t?g.l10n.t("{0} hour ago",o):g.l10n.t("{0} hr ago",o):t?g.l10n.t("{0} hours ago",o):g.l10n.t("{0} hrs ago",o):o===1?t?g.l10n.t("{0} hour",o):g.l10n.t("{0} hr",o):t?g.l10n.t("{0} hours",o):g.l10n.t("{0} hrs",o)):i<ge?(o=Math.floor(i/D),r?o===1?g.l10n.t("{0} day ago",o):g.l10n.t("{0} days ago",o):o===1?g.l10n.t("{0} day",o):g.l10n.t("{0} days",o)):i<pe?(o=Math.floor(i/ge),r?o===1?t?g.l10n.t("{0} week ago",o):g.l10n.t("{0} wk ago",o):t?g.l10n.t("{0} weeks ago",o):g.l10n.t("{0} wks ago",o):o===1?t?g.l10n.t("{0} week",o):g.l10n.t("{0} wk",o):t?g.l10n.t("{0} weeks",o):g.l10n.t("{0} wks",o)):i<me?(o=Math.floor(i/pe),r?o===1?t?g.l10n.t("{0} month ago",o):g.l10n.t("{0} mo ago",o):t?g.l10n.t("{0} months ago",o):g.l10n.t("{0} mos ago",o):o===1?t?g.l10n.t("{0} month",o):g.l10n.t("{0} mo",o):t?g.l10n.t("{0} months",o):g.l10n.t("{0} mos",o)):(o=Math.floor(i/me),r?o===1?t?g.l10n.t("{0} year ago",o):g.l10n.t("{0} yr ago",o):t?g.l10n.t("{0} years ago",o):g.l10n.t("{0} yrs ago",o):o===1?t?g.l10n.t("{0} year",o):g.l10n.t("{0} yr",o):t?g.l10n.t("{0} years",o):g.l10n.t("{0} yrs",o))}v();function de(e){try{let r=JSON.parse(e),t=Array.isArray(r)?r[0]:r,n=t["dist-tags.latest"]||t.version;return{description:t.description??"",version:n,time:n?t.time?.[n]:void 0,homepage:t.homepage}}catch{return}}var Je=40,F="Visual Studio Code",J=class{constructor(r,t){this.xhr=r;this.npmCommandPath=t}xhr;npmCommandPath;mostDependedOn=["lodash","async","underscore","request","commander","express","debug","chalk","colors","q","coffee-script","mkdirp","optimist","through2","yeoman-generator","moment","bluebird","glob","gulp-util","minimist","cheerio","pug","redis","node-uuid","socket","io","uglify-js","winston","through","fs-extra","handlebars","body-parser","rimraf","mime","semver","mongodb","jquery","grunt","connect","yosay","underscore","string","xml2js","ejs","mongoose","marked","extend","mocha","superagent","js-yaml","xtend","shelljs","gulp","yargs","browserify","minimatch","react","less","prompt","inquirer","ws","event-stream","inherits","mysql","esprima","jsdom","stylus","when","readable-stream","aws-sdk","concat-stream","chai","Thenable","wrench"];knownScopes=["@types","@angular","@babel","@nuxtjs","@vue","@bazel"];getDocumentSelector(){return[{language:"json",scheme:"*",pattern:"**/package.json"}]}collectDefaultSuggestions(r,t){let n={name:"${1:name}",description:"${2:description}",authors:"${3:author}",version:"${4:1.0.0}",main:"${5:pathToMain}",dependencies:{}},i=new m.CompletionItem(m.l10n.t("Default package.json"));return i.kind=m.CompletionItemKind.Module,i.insertText=new m.SnippetString(JSON.stringify(n,null," ")),t.add(i),Promise.resolve(null)}isEnabled(){return this.npmCommandPath||this.onlineEnabled()}onlineEnabled(){return!!m.workspace.getConfiguration("npm").get("fetchOnlinePackageInfo")}collectPropertySuggestions(r,t,n,i,o,s){if(!this.isEnabled())return null;if(t.matches(["dependencies"])||t.matches(["devDependencies"])||t.matches(["optionalDependencies"])||t.matches(["peerDependencies"])||t.matches(["catalog"])){let f;if(n.length>0){if(n[0]==="@"){if(n.indexOf("/")!==-1)return this.collectScopedPackages(n,i,o,s);for(let l of this.knownScopes){let a=new m.CompletionItem(l);a.kind=m.CompletionItemKind.Property,a.insertText=new m.SnippetString().appendText(`"${l}/`).appendTabstop().appendText('"'),a.filterText=JSON.stringify(l),a.documentation="",a.command={title:"",command:"editor.action.triggerSuggest"},s.add(a)}s.setAsIncomplete()}return f=`https://registry.npmjs.org/-/v1/search?size=${Je}&text=${encodeURIComponent(n)}`,this.xhr({url:f,headers:{agent:F}}).then(l=>{if(l.status===200){try{let a=JSON.parse(l.responseText);if(a&&a.objects&&Array.isArray(a.objects)){let c=a.objects;for(let u of c)this.processPackage(u.package,i,o,s)}}catch{}s.setAsIncomplete()}else return s.error(m.l10n.t("Request to the NPM repository failed: {0}",l.responseText)),0},l=>(s.error(m.l10n.t("Request to the NPM repository failed: {0}",l.responseText)),0))}else return this.mostDependedOn.forEach(l=>{let a=new m.SnippetString().appendText(JSON.stringify(l));i&&(a.appendText(': "').appendTabstop().appendText('"'),o||a.appendText(","));let c=new m.CompletionItem(l);c.kind=m.CompletionItemKind.Property,c.insertText=a,c.filterText=JSON.stringify(l),c.documentation="",s.add(c)}),this.collectScopedPackages(n,i,o,s),s.setAsIncomplete(),Promise.resolve(null)}return null}collectScopedPackages(r,t,n,i){let o=r.split("/");if(o.length===2&&o[0].length>1){let s=o[0].substr(1),f=o[1];f.length<4&&(f="");let l=`https://registry.npmjs.com/-/v1/search?text=scope:${s}%20${f}&size=250`;return this.xhr({url:l,headers:{agent:F}}).then(a=>{if(a.status===200){try{let c=JSON.parse(a.responseText);if(c&&Array.isArray(c.objects)){let u=c.objects;for(let y of u)this.processPackage(y.package,t,n,i)}}catch{}i.setAsIncomplete()}else i.error(m.l10n.t("Request to the NPM repository failed: {0}",a.responseText));return null})}return Promise.resolve(null)}async collectValueSuggestions(r,t,n){if(!this.isEnabled())return null;if(t.matches(["dependencies","*"])||t.matches(["devDependencies","*"])||t.matches(["optionalDependencies","*"])||t.matches(["peerDependencies","*"])||t.matches(["catalog","*"])){let i=t.path[t.path.length-1];if(typeof i=="string"){let o=await this.fetchPackageInfo(i,r);if(o&&o.version){let s=JSON.stringify(o.version),f=new m.CompletionItem(s);f.kind=m.CompletionItemKind.Property,f.insertText=s,f.documentation=m.l10n.t("The currently latest version of the package"),n.add(f),s=JSON.stringify("^"+o.version),f=new m.CompletionItem(s),f.kind=m.CompletionItemKind.Property,f.insertText=s,f.documentation=m.l10n.t("Matches the most recent major version (1.x.x)"),n.add(f),s=JSON.stringify("~"+o.version),f=new m.CompletionItem(s),f.kind=m.CompletionItemKind.Property,f.insertText=s,f.documentation=m.l10n.t("Matches the most recent minor version (1.2.x)"),n.add(f)}}}return null}getDocumentation(r,t,n,i,o){let s=new m.MarkdownString;return r&&s.appendText(r),t&&(s.appendText(`
|
|
4
4
|
|
|
5
5
|
`),s.appendText(n?m.l10n.t("Latest version: {0} published {1}",t,Z(Date.parse(n),!0,!0)):m.l10n.t("Latest version: {0}",t))),o&&(s.appendText(`
|
|
6
6
|
|
|
7
7
|
`),s.appendText(m.l10n.t("Installed version: {0}",o))),i&&(s.appendText(`
|
|
8
8
|
|
|
9
|
-
`),s.appendText(i)),s}resolveSuggestion(r,t){if(t.kind===m.CompletionItemKind.Property&&!t.documentation){let n=t.label;return typeof n!="string"&&(n=n.label),this.fetchPackageInfo(n,r).then(i=>i?(t.documentation=this.getDocumentation(i.description,i.version,i.time,i.homepage,i.installedVersion),t):null)}return null}isValidNPMName(r){if(!r||r.length>214||r.match(/^[-_.\s]/))return!1;let t=r.match(/^(?:@([^/~\s)('!*]+?)[/])?([^/~)('!*\s]+?)$/);if(t){let n=t[1];if(n&&encodeURIComponent(n)!==n)return!1;let i=t[2];return encodeURIComponent(i)===i}return!1}async fetchPackageInfo(r,t){if(!this.isValidNPMName(r))return;let n,i;return this.npmCommandPath&&([n,i]=await Promise.all([this.npmView(this.npmCommandPath,r,t),this.npmListInstalledVersion(this.npmCommandPath,r,t)])),!n&&this.onlineEnabled()&&(n=await this.npmjsView(r)),i&&(n=n??{description:""},n.installedVersion=i),n}async runNpmCommand(r,t,n){let i=await import("child_process");return new Promise((o,s)=>{let
|
|
10
|
-
\r\v":{[,`.indexOf(i.charAt(n))===-1;)n--;return i.substring(n+1,t.character)}isLast(r,t){r.setPosition(t);let n=r.scan();return n===
|
|
9
|
+
`),s.appendText(i)),s}resolveSuggestion(r,t){if(t.kind===m.CompletionItemKind.Property&&!t.documentation){let n=t.label;return typeof n!="string"&&(n=n.label),this.fetchPackageInfo(n,r).then(i=>i?(t.documentation=this.getDocumentation(i.description,i.version,i.time,i.homepage,i.installedVersion),t):null)}return null}isValidNPMName(r){if(!r||r.length>214||r.match(/^[-_.\s]/))return!1;let t=r.match(/^(?:@([^/~\s)('!*]+?)[/])?([^/~)('!*\s]+?)$/);if(t){let n=t[1];if(n&&encodeURIComponent(n)!==n)return!1;let i=t[2];return encodeURIComponent(i)===i}return!1}async fetchPackageInfo(r,t){if(!this.isValidNPMName(r))return;let n,i;return this.npmCommandPath&&([n,i]=await Promise.all([this.npmView(this.npmCommandPath,r,t),this.npmListInstalledVersion(this.npmCommandPath,r,t)])),!n&&this.onlineEnabled()&&(n=await this.npmjsView(r)),i&&(n=n??{description:""},n.installedVersion=i),n}async runNpmCommand(r,t,n){let i=await import("child_process");return new Promise((o,s)=>{let f=n&&n.scheme==="file"?(0,he.dirname)(n.fsPath):void 0,l={...S,COREPACK_ENABLE_AUTO_PIN:"0",COREPACK_ENABLE_PROJECT_SPEC:"0"},a={cwd:f,env:l},c=r;i.execFile(c,t,a,(u,y)=>{o(u?void 0:y.toString())})})}async npmView(r,t,n){let i=["view","--json","--",t,"description","dist-tags.latest","homepage","version","time"],o=await this.runNpmCommand(r,i,n);return o?de(o):void 0}async npmjsView(r){let t="https://registry.npmjs.org/"+encodeURIComponent(r);try{let n=await this.xhr({url:t,headers:{agent:F}}),i=JSON.parse(n.responseText),o=i["dist-tags"]?.latest||Object.keys(i.versions).pop()||"";return{description:i.description||"",version:o,time:i.time?.[o],homepage:i.homepage||""}}catch{}}async npmListInstalledVersion(r,t,n){let i=["ls","--json","--depth=0","--",t],o=await this.runNpmCommand(r,i,n);if(o)try{let f=JSON.parse(o)?.dependencies?.[t]?.version;return typeof f=="string"?f:void 0}catch{}}getInfoContribution(r,t){if(!this.isEnabled())return null;if(t.matches(["dependencies","*"])||t.matches(["devDependencies","*"])||t.matches(["optionalDependencies","*"])||t.matches(["peerDependencies","*"])||t.matches(["catalog","*"])){let n=t.path[t.path.length-1];if(typeof n=="string")return this.fetchPackageInfo(n,r).then(i=>i?[this.getDocumentation(i.description,i.version,i.time,i.homepage,i.installedVersion)]:null)}return null}processPackage(r,t,n,i){if(r&&r.name){let o=r.name,s=new m.SnippetString().appendText(JSON.stringify(o));t&&(s.appendText(': "'),r.version?s.appendVariable("version",r.version):s.appendTabstop(),s.appendText('"'),n||s.appendText(","));let f=new m.CompletionItem(o);f.kind=m.CompletionItemKind.Property,f.insertText=s,f.filterText=JSON.stringify(o),f.documentation=this.getDocumentation(r.description,r.version,void 0,r?.links?.homepage,void 0),i.add(f)}}};var I=require("vscode");function be(e,r){let t=[new J(e,r)],n=[];return t.forEach(i=>{let o=i.getDocumentSelector();n.push(I.languages.registerCompletionItemProvider(o,new W(i),'"',":")),n.push(I.languages.registerHoverProvider(o,new K(i)))}),I.Disposable.from(...n)}var K=class{constructor(r){this.jsonContribution=r}jsonContribution;provideHover(r,t,n){let i=r.offsetAt(t),o=Q(r.getText(),i);if(!o.previousNode)return null;let s=o.previousNode;if(s&&s.offset<=i&&i<=s.offset+s.length){let f=this.jsonContribution.getInfoContribution(r.uri,o);if(f)return f.then(l=>{let a=new I.Range(r.positionAt(s.offset),r.positionAt(s.offset+s.length));return{contents:l||[],range:a}})}return null}},W=class{constructor(r){this.jsonContribution=r}jsonContribution;lastResource;resolveCompletionItem(r,t){if(this.jsonContribution.resolveSuggestion){let n=this.jsonContribution.resolveSuggestion(this.lastResource,r);if(n)return n}return Promise.resolve(r)}provideCompletionItems(r,t,n){this.lastResource=r.uri;let i=this.getCurrentWord(r,t),o,s=[],f=!1,l=r.offsetAt(t),a=Q(r.getText(),l),c=a.previousNode;c&&c.offset<=l&&l<=c.offset+c.length&&(c.type==="property"||c.type==="string"||c.type==="number"||c.type==="boolean"||c.type==="null")?o=new I.Range(r.positionAt(c.offset),r.positionAt(c.offset+c.length)):o=new I.Range(r.positionAt(l-i.length),t);let u={},y={add:b=>{let N=typeof b.label=="string"?b.label:b.label.label;u[N]||(u[N]=!0,b.range={replacing:o,inserting:new I.Range(o.start,o.start)},s.push(b))},setAsIncomplete:()=>f=!0,error:b=>console.error(b),log:b=>console.log(b)},O=null;if(a.isAtPropertyKey){let b=fe(r.getText(),!0),N=!a.previousNode||!this.hasColonAfter(b,a.previousNode.offset+a.previousNode.length),L=this.isLast(b,r.offsetAt(t));O=this.jsonContribution.collectPropertySuggestions(r.uri,a,i,N,L,y)}else a.path.length===0?O=this.jsonContribution.collectDefaultSuggestions(r.uri,y):O=this.jsonContribution.collectValueSuggestions(r.uri,a,y);return O?O.then(()=>s.length>0||f?new I.CompletionList(s,f):null):null}getCurrentWord(r,t){let n=t.character-1,i=r.lineAt(t.line).text;for(;n>=0&&`
|
|
10
|
+
\r\v":{[,`.indexOf(i.charAt(n))===-1;)n--;return i.substring(n+1,t.character)}isLast(r,t){r.setPosition(t);let n=r.scan();return n===x.StringLiteral&&r.getTokenError()===M.UnexpectedEndOfString&&(n=r.scan()),n===x.CloseBraceToken||n===x.EOF}hasColonAfter(r,t){return r.setPosition(t),r.scan()===x.ColonToken}};async function qe(e){e.subscriptions.push(be(ke.xhr,void 0))}function $e(){}
|
|
11
11
|
//# sourceMappingURL=npmBrowserMain.js.map
|