@redocly/openapi-language-server 0.7.8 → 0.7.9

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.
Files changed (2) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -88,4 +88,4 @@ Scorecard level: ${e.scorecardLevel}`:""}function kl(e,t){e.forEach(n=>{let r;sw
88
88
 
89
89
  *${i}*
90
90
  `}function Ly(e){if(!e)return"";let t=e.nodePath.map(a=>String(a)),n=e.type,r=n?.name;if(!n||!r)return"";let i=n?.properties,o=e?.endPath?i?.[e.endPath]:n;return typeof o=="function"?"":[Iy({nodePath:t,propertyTypeName:e.endPath?e.endPath:r,typeName:e.endPath?r:void 0,documentationLink:o?.documentationLink}),o?.description??""].join(`
91
- `)}async function Uy(e){try{let t=e.textDocument.uri;if(!Ti(t)&&!Dr(t))return null;let n=e.position;if(!_S(n,t))return null;let r=await jl(t,n);if(!r)return null;let i=Ly(r);return i?{contents:{kind:Fy.MarkupKind.Markdown,value:i},metadata:{nodePath:r.nodePath,endPath:r.endPath,typeName:r.type?.name,descriptionVersion:r.descriptionVersion}}:null}catch(t){return console.error("Error in hover handler:",t),null}}function _S(e,t){let n=de.documents.get(t);if(!n)return!0;let i=n.getText({start:{line:e.line,character:0},end:{line:e.line+1,character:0}}).trimEnd().indexOf(":");return i===-1||e.character<=i}var CS=(t=>(t[t.FILE_TYPE_NOT_SUPPORTED=0]="FILE_TYPE_NOT_SUPPORTED",t))(CS||{});var Wy=class{async onCompletion(t){let{uri:n}=t.textDocument;return Dr(n)?[]:jy(n,t.position)}async onCompletionResolve(t){return t}async onHover(t){return Uy(t)}async validateOpenAPI(t){return El(t)}async onDidChangeWatchedFiles(t){let n=t.changes.find(async i=>await gn(i.uri));if(n)return await Si(n.uri),ti();if(t.changes.find(i=>fn({uri:i.uri})))return ti()}async onDidConfigChange(t){return await Si(t),ti()}async onDidChangeConfiguration(){return ti()}async onDefinition(t){let{uri:n}=t.textDocument;return Dr(n)?[]:await My(t)||[]}};export{CS as ContextErrorCodes,Wy as OpenapiLanguageServer,wl as bundleOpenAPI,pT as getBundles,qn as getConfigData,jl as getContextData,Qe as getDocumentByURI,WT as getSpecVersion,gn as isConfigFile,fn as isEntityFile,Pr as isHttpPath,GP as isIgnoreFile,Ti as isYamlFile,de as languageServerConfig,Si as loadOpenAPIConfig,Fe as parseUri,Tl as removeCirculars,ti as revalidateAllDocuments,We as uriToAbsFSPath};
91
+ `)}async function Uy(e){try{let t=e.textDocument.uri;if(!Ti(t)&&!Dr(t))return null;let n=e.position;if(!_S(n,t))return null;let r=await jl(t,n);if(!r)return null;let i=Ly(r);return i?{contents:{kind:Fy.MarkupKind.Markdown,value:i},metadata:{nodePath:r.nodePath,endPath:r.endPath,typeName:r.type?.name,descriptionVersion:r.descriptionVersion}}:null}catch(t){return console.error("Error in hover handler:",t),null}}function _S(e,t){let n=de.documents.get(t);if(!n)return!0;let r=n.getText({start:{line:e.line,character:0},end:{line:e.line+1,character:0}}).trimEnd(),i=r.indexOf(":");if(i===-1)return!1;let o=r.match(/^\s*/)?.[0].length??0,s=r.substring(o,i).trimEnd(),a=o+s.length;return e.character>=o&&e.character<a}var CS=(t=>(t[t.FILE_TYPE_NOT_SUPPORTED=0]="FILE_TYPE_NOT_SUPPORTED",t))(CS||{});var Wy=class{async onCompletion(t){let{uri:n}=t.textDocument;return Dr(n)?[]:jy(n,t.position)}async onCompletionResolve(t){return t}async onHover(t){return Uy(t)}async validateOpenAPI(t){return El(t)}async onDidChangeWatchedFiles(t){let n=t.changes.find(async i=>await gn(i.uri));if(n)return await Si(n.uri),ti();if(t.changes.find(i=>fn({uri:i.uri})))return ti()}async onDidConfigChange(t){return await Si(t),ti()}async onDidChangeConfiguration(){return ti()}async onDefinition(t){let{uri:n}=t.textDocument;return Dr(n)?[]:await My(t)||[]}};export{CS as ContextErrorCodes,Wy as OpenapiLanguageServer,wl as bundleOpenAPI,pT as getBundles,qn as getConfigData,jl as getContextData,Qe as getDocumentByURI,WT as getSpecVersion,gn as isConfigFile,fn as isEntityFile,Pr as isHttpPath,GP as isIgnoreFile,Ti as isYamlFile,de as languageServerConfig,Si as loadOpenAPIConfig,Fe as parseUri,Tl as removeCirculars,ti as revalidateAllDocuments,We as uriToAbsFSPath};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/openapi-language-server",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "Redocly OpenAPI language server",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",