@@ -121,11 +128,25 @@ export class PackageJSONContribution implements IJSONWorkerContribution {
if(obj&&obj.version){
letversion=obj.version;
letname=JSON.stringify(version);
result.add({kind:CompletionItemKind.Class,label:name,insertText:name,documentation:localize('json.npm.latestversion','The currently latest version of the package')});
letproposal=newCompletionItem(name);
proposal.kind=CompletionItemKind.Property;
proposal.insertText=name;
proposal.documentation=localize('json.npm.latestversion','The currently latest version of the package');
result.add(proposal);
name=JSON.stringify('^'+version);
result.add({kind:CompletionItemKind.Class,label:name,insertText:name,documentation:localize('json.npm.majorversion','Matches the most recent major version (1.x.x)')});
proposal=newCompletionItem(name);
proposal.kind=CompletionItemKind.Property;
proposal.insertText=name;
proposal.documentation=localize('json.npm.majorversion','Matches the most recent major version (1.x.x)');
result.add(proposal);
name=JSON.stringify('~'+version);
result.add({kind:CompletionItemKind.Class,label:name,insertText:name,documentation:localize('json.npm.minorversion','Matches the most recent minor version (1.2.x)')});
proposal=newCompletionItem(name);
proposal.kind=CompletionItemKind.Property;
proposal.insertText=name;
proposal.documentation=localize('json.npm.minorversion','Matches the most recent minor version (1.2.x)');
result.add(proposal);
}
}catch(e){
// ignore
...
...
@@ -138,33 +159,59 @@ export class PackageJSONContribution implements IJSONWorkerContribution {
@@ -362,7 +362,7 @@ export class JSONSchemaService implements IJSONSchemaService {
leterrors=jsonErrors.length?[localize('json.schema.invalidFormat','Unable to parse content from \'{0}\': {1}.',toDisplayString(url),jsonErrors[0])]:[];
returnnewUnresolvedSchema(schemaContent,errors);
},
(error:IXHRResponse)=>{
(error:XHRResponse)=>{
leterrorMessage=localize('json.schema.unabletoload','Unable to load schema from \'{0}\': {1}',toDisplayString(url),error.responseText||getErrorStatusDescription(error.status)||error.toString());
case400:returnlocalize('status.400','Bad request. The request cannot be fulfilled due to bad syntax.');
case401:returnlocalize('status.401','Unauthorized. The server is refusing to respond.');
case403:returnlocalize('status.403','Forbidden. The server is refusing to respond.');
case404:returnlocalize('status.404','Not Found. The requested location could not be found.');
case405:returnlocalize('status.405','Method not allowed. A request was made using a request method not supported by that location.');
case406:returnlocalize('status.406','Not Acceptable. The server can only generate a response that is not accepted by the client.');
case407:returnlocalize('status.407','Proxy Authentication Required. The client must first authenticate itself with the proxy.');
case408:returnlocalize('status.408','Request Timeout. The server timed out waiting for the request.');
case409:returnlocalize('status.409','Conflict. The request could not be completed because of a conflict in the request.');
case410:returnlocalize('status.410','Gone. The requested page is no longer available.');
case411:returnlocalize('status.411','Length Required. The "Content-Length" is not defined.');
case412:returnlocalize('status.412','Precondition Failed. The precondition given in the request evaluated to false by the server.');
case413:returnlocalize('status.413','Request Entity Too Large. The server will not accept the request, because the request entity is too large.');
case414:returnlocalize('status.414','Request-URI Too Long. The server will not accept the request, because the URL is too long.');
case415:returnlocalize('status.415','Unsupported Media Type. The server will not accept the request, because the media type is not supported.');
case500:returnlocalize('status.500','Internal Server Error.');
case501:returnlocalize('status.501','Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request.');
case503:returnlocalize('status.503','Service Unavailable. The server is currently unavailable (overloaded or down).');
default:returnlocalize('status.416','HTTP status code {0}',status);