@codingame/monaco-vscode-markdown-language-features-default-extension 1.85.1 → 1.85.3
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 +34 -1
- package/package.json +4 -4
- package/resources/CHANGELOG.md +7 -0
- package/resources/README.md +7 -0
- package/resources/README2.md +131 -0
- package/resources/extension.js +2 -0
- package/resources/extension.js.map +1 -0
- package/resources/icon.png +0 -0
- package/resources/index.js +1 -0
- package/resources/index2.js +172 -0
- package/resources/package.json +1 -0
- package/resources/package.nls.json +1 -0
- package/resources/package.schema.json +1 -0
- package/resources/package2.json +1 -0
- package/resources/pipeline.yml +34 -0
- package/resources/previewMessaging.d.ts.txt +80 -0
- package/resources/workerMain.js +3 -0
- package/resources/workerMain.js.LICENSE.txt +1 -0
- package/resources/workerMain.js.map +1 -0
- package/extension.js +0 -118978
- package/extension.js.map +0 -1
- package/index2.js +0 -20
- package/package.nls.json +0 -75
- package/package.schema.json +0 -32
- package/workerMain.js +0 -26719
- package/workerMain.js.map +0 -1
- /package/{highlight.css → resources/highlight.css} +0 -0
- /package/{markdown.css → resources/markdown.css} +0 -0
- /package/{pre.js → resources/pre.js} +0 -0
- /package/{preview-dark.svg → resources/preview-dark.svg} +0 -0
- /package/{preview-light.svg → resources/preview-light.svg} +0 -0
package/index.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Me=Be((Lt,Ne)=>{var xe="Expected a function",Ae=NaN,Qe="[object Symbol]",Ze=/^\s+|\s+$/g,et=/^[-+]0x[0-9a-f]+$/i,tt=/^0b[01]+$/i,nt=/^0o[0-7]+$/i,rt=parseInt,it=typeof global=="object"&&global&&global.Object===Object&&global,at=typeof self=="object"&&self&&self.Object===Object&&self,ot=it||at||Function("return this")(),st=Object.prototype,lt=st.toString,ct=Math.max,ut=Math.min,ue=function(){return ot.Date.now()};function dt(e,t,n){var r,i,a,s,u,m,d=0,p=!1,b=!1,T=!0;if(typeof e!="function")throw new TypeError(xe);t=Le(t)||0,te(n)&&(p=!!n.leading,b="maxWait"in n,a=b?ct(Le(n.maxWait)||0,t):a,T="trailing"in n?!!n.trailing:T);function E(v){var A=r,_=i;return r=i=void 0,d=v,s=e.apply(_,A),s}function N(v){return d=v,u=setTimeout(L,t),p?E(v):s}function g(v){var A=v-m,_=v-d,h=t-A;return b?ut(h,a-_):h}function S(v){var A=v-m,_=v-d;return m===void 0||A>=t||A<0||b&&_>=a}function L(){var v=ue();if(S(v))return U(v);u=setTimeout(L,g(v))}function U(v){return u=void 0,T&&r?E(v):(r=i=void 0,s)}function R(){u!==void 0&&clearTimeout(u),d=0,r=m=i=u=void 0}function Y(){return u===void 0?s:U(ue())}function I(){var v=ue(),A=S(v);if(r=arguments,i=this,m=v,A){if(u===void 0)return N(m);if(b)return u=setTimeout(L,t),E(m)}return u===void 0&&(u=setTimeout(L,t)),s}return I.cancel=R,I.flush=Y,I}function ft(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(xe);return te(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),dt(e,t,{leading:r,maxWait:t,trailing:i})}function te(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function mt(e){return!!e&&typeof e=="object"}function gt(e){return typeof e=="symbol"||mt(e)&<.call(e)==Qe}function Le(e){if(typeof e=="number")return e;if(gt(e))return Ae;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ze,"");var n=tt.test(e);return n||nt.test(e)?rt(e.slice(2),n?2:8):et.test(e)?Ae:+e}Ne.exports=ft});var pe="code-line",F=class{constructor(t,n,r){this.element=t;this.line=n;this.codeElement=r;this._detailParentElements=Array.from(Re(t,"DETAILS"))}get isVisible(){return!this._detailParentElements.some(t=>!t.open)}},ae=(()=>{let e,t=-1;return n=>{if(!e||n!==t){t=n,e=[new F(document.body,-1)];for(let r of document.getElementsByClassName(pe)){if(!(r instanceof HTMLElement))continue;let i=+r.getAttribute("data-line");isNaN(i)||(r.tagName==="CODE"&&r.parentElement&&r.parentElement.tagName==="PRE"?e.push(new F(r.parentElement,i,r)):r.tagName==="UL"||r.tagName==="OL"||e.push(new F(r,i)))}}return e}})();function oe(e,t){let n=Math.floor(e),r=ae(t),i=r[0]||null;for(let a of r){if(a.line===n)return{previous:a,next:void 0};if(a.line>n)return{previous:i,next:a};i=a}return{previous:i}}function He(e,t){let n=ae(t).filter(m=>m.isVisible),r=e-window.scrollY,i=-1,a=n.length-1;for(;i+1<a;){let m=Math.floor((i+a)/2),d=W(n[m]);d.top+d.height>=r?a=m:i=m}let s=n[a],u=W(s);return a>=1&&u.top>r?{previous:n[i],next:s}:a>1&&a<n.length&&u.top+u.height>r?{previous:s,next:n[a+1]}:{previous:s}}function W({element:e}){let t=e.getBoundingClientRect(),n=e.querySelector(`.${pe}`);if(n){let r=n.getBoundingClientRect(),i=Math.max(1,r.top-t.top);return{top:t.top,height:i}}return t}function K(e,t,n){if(!n.settings?.scrollPreviewWithEditor)return;if(e<=0){window.scroll(window.scrollX,0);return}let{previous:r,next:i}=oe(e,t);if(!r)return;let a=0,s=W(r),u=s.top;if(i&&i.line!==r.line){let m=(e-r.line)/(i.line-r.line),d=u+s.height,p=i.element.getBoundingClientRect().top-d;a=d+m*p}else{let m=e-Math.floor(e);a=u+s.height*m}a=Math.abs(a)<1?Math.sign(a):a,window.scroll(window.scrollX,Math.max(1,window.scrollY+a))}function se(e,t){let{previous:n,next:r}=He(e,t);if(n){if(n.line<0)return 0;let i=W(n),a=e-window.scrollY-i.top;if(r){let s=a/(W(r).top-i.top);return n.line+s*(r.line-n.line)}else{let s=a/i.height;return n.line+s}}return null}function ve(e,t){return ae(t).find(n=>n.element.id===e)}function*Re(e,t){for(let n=e.parentElement;n;n=n.parentElement)n.tagName===t&&(yield n)}var J=class{onDidChangeTextEditorSelection(t,n){let{previous:r}=oe(t,n);this._update(r&&(r.codeElement||r.element))}_update(t){this._unmarkActiveElement(this._current),this._markActiveElement(t),this._current=t}_unmarkActiveElement(t){t&&t.classList.toggle("code-active-line",!1)}_markActiveElement(t){t&&t.classList.toggle("code-active-line",!0)}};function he(e){document.readyState==="loading"||document.readyState==="uninitialized"?document.addEventListener("DOMContentLoaded",e):e()}var be=(e,t)=>({postMessage(n,r){e.postMessage({type:n,source:t.settings.source,...r})}});function le(e){let t=document.getElementById("vscode-markdown-preview-data");if(t){let n=t.getAttribute(e);if(n)return JSON.parse(n)}throw new Error(`Could not load data for ${e}`)}var Q=class{constructor(){this._settings=le("data-settings")}get settings(){return this._settings}updateSettings(t){this._settings=t}};var ye=11;function ke(e,t){var n=t.attributes,r,i,a,s,u;if(!(t.nodeType===ye||e.nodeType===ye)){for(var m=n.length-1;m>=0;m--)r=n[m],i=r.name,a=r.namespaceURI,s=r.value,a?(i=r.localName||i,u=e.getAttributeNS(a,i),u!==s&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,s))):(u=e.getAttribute(i),u!==s&&e.setAttribute(i,s));for(var d=e.attributes,p=d.length-1;p>=0;p--)r=d[p],i=r.name,a=r.namespaceURI,a?(i=r.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Z,Ue="http://www.w3.org/1999/xhtml",w=typeof document>"u"?void 0:document,Fe=!!w&&"content"in w.createElement("template"),We=!!w&&w.createRange&&"createContextualFragment"in w.createRange();function Ve(e){var t=w.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function je(e){Z||(Z=w.createRange(),Z.selectNode(w.body));var t=Z.createContextualFragment(e);return t.childNodes[0]}function qe(e){var t=w.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Xe(e){return e=e.trim(),Fe?Ve(e):We?je(e):qe(e)}function ee(e,t){var n=e.nodeName,r=t.nodeName,i,a;return n===r?!0:(i=n.charCodeAt(0),a=r.charCodeAt(0),i<=90&&a>=97?n===r.toUpperCase():a<=90&&i>=97?r===n.toUpperCase():!1)}function Ye(e,t){return!t||t===Ue?w.createElement(e):w.createElementNS(t,e)}function ze(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function ce(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Te={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}ce(e,t,"selected")},INPUT:function(e,t){ce(e,t,"checked"),ce(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n=-1,r=0,i=e.firstChild,a,s;i;)if(s=i.nodeName&&i.nodeName.toUpperCase(),s==="OPTGROUP")a=i,i=a.firstChild;else{if(s==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=n}}},V=1,Ge=11,we=3,Ee=8;function B(){}function $e(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Ke(e){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"||n.nodeName==="BODY"){var a=r;r=w.createElement("html"),r.innerHTML=a}else r=Xe(r);var s=i.getNodeKey||$e,u=i.onBeforeNodeAdded||B,m=i.onNodeAdded||B,d=i.onBeforeElUpdated||B,p=i.onElUpdated||B,b=i.onBeforeNodeDiscarded||B,T=i.onNodeDiscarded||B,E=i.onBeforeElChildrenUpdated||B,N=i.childrenOnly===!0,g=Object.create(null),S=[];function L(c){S.push(c)}function U(c,l){if(c.nodeType===V)for(var o=c.firstChild;o;){var f=void 0;l&&(f=s(o))?L(f):(T(o),o.firstChild&&U(o,l)),o=o.nextSibling}}function R(c,l,o){b(c)!==!1&&(l&&l.removeChild(c),T(c),U(c,o))}function Y(c){if(c.nodeType===V||c.nodeType===Ge)for(var l=c.firstChild;l;){var o=s(l);o&&(g[o]=l),Y(l),l=l.nextSibling}}Y(n);function I(c){m(c);for(var l=c.firstChild;l;){var o=l.nextSibling,f=s(l);if(f){var x=g[f];x&&ee(l,x)?(l.parentNode.replaceChild(x,l),A(x,l)):I(l)}else I(l);l=o}}function v(c,l,o){for(;l;){var f=l.nextSibling;(o=s(l))?L(o):R(l,c,!0),l=f}}function A(c,l,o){var f=s(l);f&&delete g[f],!(!o&&(d(c,l)===!1||(e(c,l),p(c),E(c,l)===!1)))&&(c.nodeName!=="TEXTAREA"?_(c,l):Te.TEXTAREA(c,l))}function _(c,l){var o=l.firstChild,f=c.firstChild,x,P,k,G,O;e:for(;o;){for(G=o.nextSibling,x=s(o);f;){if(k=f.nextSibling,o.isSameNode&&o.isSameNode(f)){o=G,f=k;continue e}P=s(f);var $=f.nodeType,D=void 0;if($===o.nodeType&&($===V?(x?x!==P&&((O=g[x])?k===O?D=!1:(c.insertBefore(O,f),P?L(P):R(f,c,!0),f=O):D=!1):P&&(D=!1),D=D!==!1&&ee(f,o),D&&A(f,o)):($===we||$==Ee)&&(D=!0,f.nodeValue!==o.nodeValue&&(f.nodeValue=o.nodeValue))),D){o=G,f=k;continue e}P?L(P):R(f,c,!0),f=k}if(x&&(O=g[x])&&ee(O,o))c.appendChild(O),A(O,o);else{var ie=u(o);ie!==!1&&(ie&&(o=ie),o.actualize&&(o=o.actualize(c.ownerDocument||w)),c.appendChild(o),I(o))}o=G,f=k}v(c,f,P);var ge=Te[c.nodeName];ge&&ge(c,l)}var h=n,z=h.nodeType,me=r.nodeType;if(!N){if(z===V)me===V?ee(n,r)||(T(n),h=ze(n,Ye(r.nodeName,r.namespaceURI))):h=r;else if(z===we||z===Ee){if(me===z)return h.nodeValue!==r.nodeValue&&(h.nodeValue=r.nodeValue),h;h=r}}if(h===r)T(n);else{if(r.isSameNode&&r.isSameNode(h))return;if(A(h,r,N),S)for(var ne=0,_e=S.length;ne<_e;ne++){var re=g[S[ne]];re&&R(re,re.parentNode,!1)}}return!N&&h!==n&&n.parentNode&&(h.actualize&&(h=h.actualize(n.ownerDocument||w)),n.parentNode.replaceChild(h,n)),h}}var Je=Ke(ke),Se=Je;var Ce=Me(),H=0,Pe=new J,y=new Q,M=0,j=y.settings.source,q=acquireVsCodeApi(),de=q.getState()??{},C={...de,...le("data-state")};typeof de.scrollProgress<"u"&&de?.resource!==C.resource&&(C.scrollProgress=0);q.setState(C);var X=be(q,y);window.cspAlerter.setPoster(X);window.styleLoadingMonitor.setPoster(X);function fe(e){let t=document.getElementsByTagName("img");if(t.length>0){let n=Array.from(t,r=>r.complete?Promise.resolve():new Promise(i=>{r.addEventListener("load",()=>i()),r.addEventListener("error",()=>i())}));Promise.all(n).then(()=>setTimeout(e,0))}else setTimeout(e,0)}he(()=>{let e=C.scrollProgress;if(Oe(),typeof e=="number"&&!y.settings.fragment){fe(()=>{H+=1;let t=Math.max(1,e*document.body.clientHeight);window.scrollTo(0,t)});return}y.settings.scrollPreviewWithEditor&&fe(()=>{if(y.settings.fragment){let t;try{t=encodeURIComponent(y.settings.fragment)}catch{t=y.settings.fragment}C.fragment=void 0,q.setState(C);let n=ve(t,M);n&&(H+=1,K(n.line,M,y))}else isNaN(y.settings.line)||(H+=1,K(y.settings.line,M,y))}),typeof y.settings.selectedLine=="number"&&Pe.onDidChangeTextEditorSelection(y.settings.selectedLine,M)});var pt=(()=>{let e=Ce(t=>{H+=1,fe(()=>K(t,M,y))},50);return t=>{isNaN(t)||(C.line=t,e(t))}})();window.addEventListener("resize",()=>{H+=1,Ie()},!0);function Oe(){let e=document.getElementsByTagName("img"),t=0;for(let n of e)n.id="image-"+t,t+=1,n.setAttribute("data-vscode-context",JSON.stringify({webviewSection:"image",id:n.id,preventDefaultContextMenuItems:!0,resource:j}))}async function De(e,t=5){if(!document.hasFocus()&&t>0){setTimeout(()=>{De(e,t-1)},20);return}try{await navigator.clipboard.write([new ClipboardItem({"image/png":new Promise(n=>{let r=document.createElement("canvas");r!==null&&(r.width=e.naturalWidth,r.height=e.naturalHeight,r.getContext("2d")?.drawImage(e,0,0)),r.toBlob(i=>{i&&n(i),r.remove()},"image/png")})})])}catch(n){console.error(n)}}window.addEventListener("message",async e=>{let t=e.data;switch(t.type){case"copyImage":{let n=document.getElementById(t.id);n instanceof HTMLImageElement&&De(n);return}case"onDidChangeTextEditorSelection":t.source===j&&Pe.onDidChangeTextEditorSelection(t.line,M);return;case"updateView":t.source===j&&pt(t.line);return;case"updateContent":{let n=document.querySelector(".markdown-body"),i=new DOMParser().parseFromString(t.content,"text/html");for(let a of Array.from(i.querySelectorAll("meta")))a.hasAttribute("http-equiv")&&a.remove();if(t.source!==j)n.replaceWith(i.querySelector(".markdown-body")),j=t.source;else{let a=["open"],s=(d,p)=>{if(d.isEqualNode(p))return!0;if(d.tagName!==p.tagName||d.textContent!==p.textContent)return!1;let b=[...d.attributes].filter(g=>!a.includes(g.name)),T=[...p.attributes].filter(g=>!a.includes(g.name));if(b.length!==T.length)return!1;for(let g=0;g<b.length;++g){let S=b[g],L=T[g];if(S.name!==L.name||S.value!==L.value&&S.name!=="data-line")return!1}let E=Array.from(d.children),N=Array.from(p.children);return E.length===N.length&&E.every((g,S)=>s(g,N[S]))},u=i.querySelector(".markdown-body"),m=u.querySelectorAll("link");for(let d of m)d.remove();u.prepend(...m),Se(n,u,{childrenOnly:!0,onBeforeElUpdated:(d,p)=>{if(s(d,p)){let b=d.querySelectorAll("[data-line]"),T=p.querySelectorAll("[data-line]");b.length!==T.length&&console.log("unexpected line number change");for(let E=0;E<b.length;++E){let N=b[E],g=T[E];g&&N.setAttribute("data-line",g.getAttribute("data-line"))}return!1}return d.tagName==="DETAILS"&&p.tagName==="DETAILS"&&d.hasAttribute("open")&&p.setAttribute("open",""),!0}})}++M,window.dispatchEvent(new CustomEvent("vscode.markdown.updateContent")),Oe();break}}},!1);document.addEventListener("dblclick",e=>{if(!y.settings.doubleClickToSwitchToEditor)return;for(let r=e.target;r;r=r.parentNode)if(r.tagName==="A")return;let t=e.pageY,n=se(t,M);typeof n=="number"&&!isNaN(n)&&X.postMessage("didClick",{line:Math.floor(n)})});var vt=["http:","https:","mailto:","vscode:","vscode-insiders:"];document.addEventListener("click",e=>{if(!e)return;let t=e.target;for(;t;){if(t.tagName&&t.tagName==="A"&&t.href){if(t.getAttribute("href").startsWith("#"))return;let n=t.getAttribute("data-href");if(!n){if(vt.some(r=>t.href.startsWith(r)))return;n=t.getAttribute("href")}if(!/^[a-z\-]+:/i.test(n)){X.postMessage("openLink",{href:n}),e.preventDefault(),e.stopPropagation();return}return}t=t.parentNode}},!0);window.addEventListener("scroll",Ce(()=>{if(Ie(),H>0)H-=1;else{let e=se(window.scrollY,M);typeof e=="number"&&!isNaN(e)&&X.postMessage("revealLine",{line:e})}},50));function Ie(){C.scrollProgress=window.scrollY/document.body.clientHeight,q.setState(C)}
|
|
1
|
+
import { registerExtension } from 'vscode/extensions';
|
|
2
|
+
|
|
3
|
+
var manifest = {name:"markdown-language-features",displayName:"%displayName%",description:"%description%",version:"1.0.0",icon:"icon.png",publisher:"vscode",license:"MIT",aiKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",engines:{vscode:"^1.70.0"},main:undefined,browser:"./dist/browser/extension",categories:["Programming Languages"],enabledApiProposals:["documentPaste","dropMetadata"],activationEvents:["onLanguage:markdown","onCommand:markdown.api.render","onCommand:markdown.api.reloadPlugins","onWebviewPanel:markdown.preview"],capabilities:{virtualWorkspaces:true,untrustedWorkspaces:{supported:"limited",description:"%workspaceTrust%",restrictedConfigurations:["markdown.styles"]}},contributes:{notebookRenderer:[{id:"vscode.markdown-it-renderer",displayName:"Markdown it renderer",entrypoint:"./notebook-out/index.js",mimeTypes:["text/markdown","text/latex","text/x-css","text/x-html","text/x-json","text/x-typescript","text/x-abap","text/x-apex","text/x-azcli","text/x-bat","text/x-cameligo","text/x-clojure","text/x-coffee","text/x-cpp","text/x-csharp","text/x-csp","text/x-css","text/x-dart","text/x-dockerfile","text/x-ecl","text/x-fsharp","text/x-go","text/x-graphql","text/x-handlebars","text/x-hcl","text/x-html","text/x-ini","text/x-java","text/x-javascript","text/x-julia","text/x-kotlin","text/x-less","text/x-lexon","text/x-lua","text/x-m3","text/x-markdown","text/x-mips","text/x-msdax","text/x-mysql","text/x-objective-c/objective","text/x-pascal","text/x-pascaligo","text/x-perl","text/x-pgsql","text/x-php","text/x-postiats","text/x-powerquery","text/x-powershell","text/x-pug","text/x-python","text/x-r","text/x-razor","text/x-redis","text/x-redshift","text/x-restructuredtext","text/x-ruby","text/x-rust","text/x-sb","text/x-scala","text/x-scheme","text/x-scss","text/x-shell","text/x-solidity","text/x-sophia","text/x-sql","text/x-st","text/x-swift","text/x-systemverilog","text/x-tcl","text/x-twig","text/x-typescript","text/x-vb","text/x-xml","text/x-yaml","application/json"]}],commands:[{command:"_markdown.copyImage",title:"%markdown.copyImage.title%",category:"Markdown"},{command:"markdown.showPreview",title:"%markdown.preview.title%",category:"Markdown",icon:{light:"./media/preview-light.svg",dark:"./media/preview-dark.svg"}},{command:"markdown.showPreviewToSide",title:"%markdown.previewSide.title%",category:"Markdown",icon:"$(open-preview)"},{command:"markdown.showLockedPreviewToSide",title:"%markdown.showLockedPreviewToSide.title%",category:"Markdown",icon:"$(open-preview)"},{command:"markdown.showSource",title:"%markdown.showSource.title%",category:"Markdown",icon:"$(go-to-file)"},{command:"markdown.showPreviewSecuritySelector",title:"%markdown.showPreviewSecuritySelector.title%",category:"Markdown"},{command:"markdown.preview.refresh",title:"%markdown.preview.refresh.title%",category:"Markdown"},{command:"markdown.preview.toggleLock",title:"%markdown.preview.toggleLock.title%",category:"Markdown"},{command:"markdown.findAllFileReferences",title:"%markdown.findAllFileReferences%",category:"Markdown"},{command:"markdown.editor.insertLinkFromWorkspace",title:"%markdown.editor.insertLinkFromWorkspace%",category:"Markdown",enablement:"editorLangId == markdown && !activeEditorIsReadonly"},{command:"markdown.editor.insertImageFromWorkspace",title:"%markdown.editor.insertImageFromWorkspace%",category:"Markdown",enablement:"editorLangId == markdown && !activeEditorIsReadonly"}],menus:{"webview/context":[{command:"_markdown.copyImage",when:"webviewId == 'markdown.preview' && webviewSection == 'image'"}],"editor/title":[{command:"markdown.showPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused && !hasCustomMarkdownPreview",alt:"markdown.showPreview",group:"navigation"},{command:"markdown.showSource",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"navigation"},{command:"markdown.preview.refresh",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"},{command:"markdown.preview.toggleLock",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"},{command:"markdown.showPreviewSecuritySelector",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"1_markdown"}],"explorer/context":[{command:"markdown.showPreview",when:"resourceLangId == markdown && !hasCustomMarkdownPreview",group:"navigation"},{command:"markdown.findAllFileReferences",when:"resourceLangId == markdown",group:"4_search"}],"editor/title/context":[{command:"markdown.showPreview",when:"resourceLangId == markdown && !hasCustomMarkdownPreview",group:"1_open"},{command:"markdown.findAllFileReferences",when:"resourceLangId == markdown"}],commandPalette:[{command:"_markdown.copyImage",when:"false"},{command:"markdown.showPreview",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showLockedPreviewToSide",when:"editorLangId == markdown && !notebookEditorFocused",group:"navigation"},{command:"markdown.showSource",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'",group:"navigation"},{command:"markdown.showPreviewSecuritySelector",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.showPreviewSecuritySelector",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.preview.toggleLock",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.preview.refresh",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.preview.refresh",when:"activeWebviewPanelId == 'markdown.preview' || activeCustomEditorId == 'vscode.markdown.preview.editor'"},{command:"markdown.findAllFileReferences",when:"editorLangId == markdown"}]},keybindings:[{command:"markdown.showPreview",key:"shift+ctrl+v",mac:"shift+cmd+v",when:"editorLangId == markdown && !notebookEditorFocused"},{command:"markdown.showPreviewToSide",key:"ctrl+k v",mac:"cmd+k v",when:"editorLangId == markdown && !notebookEditorFocused"}],configuration:{type:"object",title:"Markdown",order:20,properties:{"markdown.styles":{type:"array",items:{type:"string"},"default":[],description:"%markdown.styles.dec%",scope:"resource"},"markdown.preview.breaks":{type:"boolean","default":false,markdownDescription:"%markdown.preview.breaks.desc%",scope:"resource"},"markdown.preview.linkify":{type:"boolean","default":true,description:"%markdown.preview.linkify%",scope:"resource"},"markdown.preview.typographer":{type:"boolean","default":false,description:"%markdown.preview.typographer%",scope:"resource"},"markdown.preview.fontFamily":{type:"string","default":"-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif",description:"%markdown.preview.fontFamily.desc%",scope:"resource"},"markdown.preview.fontSize":{type:"number","default":14,description:"%markdown.preview.fontSize.desc%",scope:"resource"},"markdown.preview.lineHeight":{type:"number","default":1.6,description:"%markdown.preview.lineHeight.desc%",scope:"resource"},"markdown.preview.scrollPreviewWithEditor":{type:"boolean","default":true,description:"%markdown.preview.scrollPreviewWithEditor.desc%",scope:"resource"},"markdown.preview.markEditorSelection":{type:"boolean","default":true,description:"%markdown.preview.markEditorSelection.desc%",scope:"resource"},"markdown.preview.scrollEditorWithPreview":{type:"boolean","default":true,description:"%markdown.preview.scrollEditorWithPreview.desc%",scope:"resource"},"markdown.preview.doubleClickToSwitchToEditor":{type:"boolean","default":true,description:"%markdown.preview.doubleClickToSwitchToEditor.desc%",scope:"resource"},"markdown.preview.openMarkdownLinks":{type:"string","default":"inPreview",description:"%configuration.markdown.preview.openMarkdownLinks.description%",scope:"resource","enum":["inPreview","inEditor"],enumDescriptions:["%configuration.markdown.preview.openMarkdownLinks.inPreview%","%configuration.markdown.preview.openMarkdownLinks.inEditor%"]},"markdown.links.openLocation":{type:"string","default":"currentGroup",description:"%configuration.markdown.links.openLocation.description%",scope:"resource","enum":["currentGroup","beside"],enumDescriptions:["%configuration.markdown.links.openLocation.currentGroup%","%configuration.markdown.links.openLocation.beside%"]},"markdown.suggest.paths.enabled":{type:"boolean","default":true,description:"%configuration.markdown.suggest.paths.enabled.description%",scope:"resource"},"markdown.suggest.paths.includeWorkspaceHeaderCompletions":{type:"string","default":"onDoubleHash",scope:"resource",markdownDescription:"%configuration.markdown.suggest.paths.includeWorkspaceHeaderCompletions%","enum":["never","onDoubleHash","onSingleOrDoubleHash"],markdownEnumDescriptions:["%configuration.markdown.suggest.paths.includeWorkspaceHeaderCompletions.never%","%configuration.markdown.suggest.paths.includeWorkspaceHeaderCompletions.onDoubleHash%","%configuration.markdown.suggest.paths.includeWorkspaceHeaderCompletions.onSingleOrDoubleHash%"]},"markdown.trace.extension":{type:"string","enum":["off","verbose"],"default":"off",description:"%markdown.trace.extension.desc%",scope:"window"},"markdown.trace.server":{type:"string",scope:"window","enum":["off","messages","verbose"],"default":"off",description:"%markdown.trace.server.desc%"},"markdown.server.log":{type:"string",scope:"window","enum":["off","debug","trace"],"default":"off",description:"%markdown.server.log.desc%"},"markdown.editor.drop.enabled":{type:"boolean","default":true,markdownDescription:"%configuration.markdown.editor.drop.enabled%",scope:"resource"},"markdown.editor.drop.copyIntoWorkspace":{type:"string",markdownDescription:"%configuration.markdown.editor.drop.copyIntoWorkspace%","default":"mediaFiles","enum":["mediaFiles","never"],markdownEnumDescriptions:["%configuration.copyIntoWorkspace.mediaFiles%","%configuration.copyIntoWorkspace.never%"]},"markdown.editor.filePaste.enabled":{type:"boolean",scope:"resource",markdownDescription:"%configuration.markdown.editor.filePaste.enabled%","default":true},"markdown.editor.filePaste.copyIntoWorkspace":{type:"string",markdownDescription:"%configuration.markdown.editor.filePaste.copyIntoWorkspace%","default":"mediaFiles","enum":["mediaFiles","never"],markdownEnumDescriptions:["%configuration.copyIntoWorkspace.mediaFiles%","%configuration.copyIntoWorkspace.never%"]},"markdown.editor.pasteUrlAsFormattedLink.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.editor.pasteUrlAsFormattedLink.enabled%","default":"never","enum":["always","smart","never"],markdownEnumDescriptions:["%configuration.pasteUrlAsFormattedLink.always%","%configuration.pasteUrlAsFormattedLink.smart%","%configuration.pasteUrlAsFormattedLink.never%"]},"markdown.validate.enabled":{type:"boolean",scope:"resource",description:"%configuration.markdown.validate.enabled.description%","default":false},"markdown.validate.referenceLinks.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.referenceLinks.enabled.description%","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fragmentLinks.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.fragmentLinks.enabled.description%","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fileLinks.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.fileLinks.enabled.description%","default":"warning","enum":["ignore","warning","error"]},"markdown.validate.fileLinks.markdownFragmentLinks":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.fileLinks.markdownFragmentLinks.description%","default":"inherit","enum":["inherit","ignore","warning","error"]},"markdown.validate.ignoredLinks":{type:"array",scope:"resource",markdownDescription:"%configuration.markdown.validate.ignoredLinks.description%",items:{type:"string"}},"markdown.validate.unusedLinkDefinitions.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.unusedLinkDefinitions.description%","default":"hint","enum":["ignore","hint","warning","error"]},"markdown.validate.duplicateLinkDefinitions.enabled":{type:"string",scope:"resource",markdownDescription:"%configuration.markdown.validate.duplicateLinkDefinitions.description%","default":"warning","enum":["ignore","warning","error"]},"markdown.updateLinksOnFileMove.enabled":{type:"string","enum":["prompt","always","never"],markdownEnumDescriptions:["%configuration.markdown.updateLinksOnFileMove.enabled.prompt%","%configuration.markdown.updateLinksOnFileMove.enabled.always%","%configuration.markdown.updateLinksOnFileMove.enabled.never%"],"default":"never",markdownDescription:"%configuration.markdown.updateLinksOnFileMove.enabled%",scope:"window"},"markdown.updateLinksOnFileMove.include":{type:"array",markdownDescription:"%configuration.markdown.updateLinksOnFileMove.include%",scope:"window",items:{type:"string",description:"%configuration.markdown.updateLinksOnFileMove.include.property%"},"default":["**/*.{md,mkd,mdwn,mdown,markdown,markdn,mdtxt,mdtext,workbook}","**/*.{jpg,jpe,jpeg,png,bmp,gif,ico,webp,avif,tiff,svg,mp4}"]},"markdown.updateLinksOnFileMove.enableForDirectories":{type:"boolean","default":true,description:"%configuration.markdown.updateLinksOnFileMove.enableForDirectories%",scope:"window"},"markdown.occurrencesHighlight.enabled":{type:"boolean","default":false,description:"%configuration.markdown.occurrencesHighlight.enabled%",scope:"resource"},"markdown.copyFiles.destination":{type:"object",markdownDescription:"%configuration.markdown.copyFiles.destination%",additionalProperties:{type:"string"}},"markdown.copyFiles.overwriteBehavior":{type:"string",markdownDescription:"%configuration.markdown.copyFiles.overwriteBehavior%","default":"nameIncrementally","enum":["nameIncrementally","overwrite"],markdownEnumDescriptions:["%configuration.markdown.copyFiles.overwriteBehavior.nameIncrementally%","%configuration.markdown.copyFiles.overwriteBehavior.overwrite%"]},"markdown.preferredMdPathExtensionStyle":{type:"string","default":"auto",markdownDescription:"%configuration.markdown.preferredMdPathExtensionStyle%","enum":["auto","includeExtension","removeExtension"],markdownEnumDescriptions:["%configuration.markdown.preferredMdPathExtensionStyle.auto%","%configuration.markdown.preferredMdPathExtensionStyle.includeExtension%","%configuration.markdown.preferredMdPathExtensionStyle.removeExtension%"]}}},configurationDefaults:{"[markdown]":{"editor.wordWrap":"on","editor.quickSuggestions":{comments:"off",strings:"off",other:"off"}}},jsonValidation:[{fileMatch:"package.json",url:"./schemas/package.schema.json"}],"markdown.previewStyles":["./media/markdown.css","./media/highlight.css"],"markdown.previewScripts":["./media/index.js"],customEditors:[{viewType:"vscode.markdown.preview.editor",displayName:"Markdown Preview",priority:"option",selector:[{filenamePattern:"*.md"}]}]},repository:{type:"git",url:"https://github.com/microsoft/vscode.git"}};
|
|
4
|
+
|
|
5
|
+
const { registerFileUrl, whenReady } = registerExtension(manifest);
|
|
6
|
+
registerFileUrl('README.md', new URL('./resources/README.md', import.meta.url).toString(), 'text/markdown');
|
|
7
|
+
registerFileUrl('icon.png', new URL('./resources/icon.png', import.meta.url).toString(), 'image/png');
|
|
8
|
+
registerFileUrl('package.json', new URL('./resources/package.json', import.meta.url).toString(), 'application/json');
|
|
9
|
+
registerFileUrl('package.nls.json', new URL('./resources/package.nls.json', import.meta.url).toString(), 'application/json');
|
|
10
|
+
registerFileUrl('media/highlight.css', new URL('./resources/highlight.css', import.meta.url).toString(), 'text/css');
|
|
11
|
+
registerFileUrl('media/index.js', new URL('./resources/index.js', import.meta.url).toString(), 'application/javascript');
|
|
12
|
+
registerFileUrl('media/index', new URL('./resources/index.js', import.meta.url).toString(), 'application/javascript');
|
|
13
|
+
registerFileUrl('media/markdown.css', new URL('./resources/markdown.css', import.meta.url).toString(), 'text/css');
|
|
14
|
+
registerFileUrl('media/pre.js', new URL('./resources/pre.js', import.meta.url).toString(), 'application/javascript');
|
|
15
|
+
registerFileUrl('media/pre', new URL('./resources/pre.js', import.meta.url).toString(), 'application/javascript');
|
|
16
|
+
registerFileUrl('media/preview-dark.svg', new URL('./resources/preview-dark.svg', import.meta.url).toString(), 'image/svg+xml');
|
|
17
|
+
registerFileUrl('media/preview-light.svg', new URL('./resources/preview-light.svg', import.meta.url).toString(), 'image/svg+xml');
|
|
18
|
+
registerFileUrl('notebook-out/index.js', new URL('./resources/index2.js', import.meta.url).toString(), 'application/javascript');
|
|
19
|
+
registerFileUrl('notebook-out/index', new URL('./resources/index2.js', import.meta.url).toString(), 'application/javascript');
|
|
20
|
+
registerFileUrl('schemas/package.schema.json', new URL('./resources/package.schema.json', import.meta.url).toString(), 'application/json');
|
|
21
|
+
registerFileUrl('server/CHANGELOG.md', new URL('./resources/CHANGELOG.md', import.meta.url).toString(), 'text/markdown');
|
|
22
|
+
registerFileUrl('server/README.md', new URL('./resources/README2.md', import.meta.url).toString(), 'text/markdown');
|
|
23
|
+
registerFileUrl('server/package.json', new URL('./resources/package2.json', import.meta.url).toString(), 'application/json');
|
|
24
|
+
registerFileUrl('types/previewMessaging.d.ts', new URL('./resources/previewMessaging.d.ts.txt', import.meta.url).toString(), 'video/mp2t');
|
|
25
|
+
registerFileUrl('dist/browser/extension.js', new URL('./resources/extension.js', import.meta.url).toString(), 'application/javascript');
|
|
26
|
+
registerFileUrl('dist/browser/extension', new URL('./resources/extension.js', import.meta.url).toString(), 'application/javascript');
|
|
27
|
+
registerFileUrl('dist/browser/extension.js.map', new URL('./resources/extension.js.map', import.meta.url).toString(), 'application/json');
|
|
28
|
+
registerFileUrl('server/build/pipeline.yml', new URL('./resources/pipeline.yml', import.meta.url).toString(), 'text/yaml');
|
|
29
|
+
registerFileUrl('server/dist/browser/workerMain.js', new URL('./resources/workerMain.js', import.meta.url).toString(), 'application/javascript');
|
|
30
|
+
registerFileUrl('server/dist/browser/workerMain', new URL('./resources/workerMain.js', import.meta.url).toString(), 'application/javascript');
|
|
31
|
+
registerFileUrl('server/dist/browser/workerMain.js.LICENSE.txt', new URL('./resources/workerMain.js.LICENSE.txt', import.meta.url).toString(), 'text/plain');
|
|
32
|
+
registerFileUrl('server/dist/browser/workerMain.js.map', new URL('./resources/workerMain.js.map', import.meta.url).toString(), 'application/json');
|
|
33
|
+
|
|
34
|
+
export { whenReady };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-markdown-language-features-default-extension",
|
|
3
|
-
"version": "1.85.
|
|
3
|
+
"version": "1.85.3",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"private": false,
|
|
16
16
|
"description": "Default VSCode extension designed to be used with @codingame/monaco-vscode-api",
|
|
17
|
-
"main": "
|
|
18
|
-
"module": "
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.85.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
# 0.4.0-alpha.3 — June 2, 2023
|
|
4
|
+
- Pick up [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) 0.4.0-alpha.3. See [CHANGELOG](https://github.com/microsoft/vscode-markdown-languageservice/blob/main/CHANGELOG.md#040-alpha3--may-30-2023) for details.
|
|
5
|
+
|
|
6
|
+
## 0.3.0 - March 28, 2023
|
|
7
|
+
- Pick up [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) 0.3.0. See [CHANGELOG](https://github.com/microsoft/vscode-markdown-languageservice/blob/main/CHANGELOG.md#030--march-16-2023) for details.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Language Features for Markdown files
|
|
2
|
+
|
|
3
|
+
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
See [Markdown in Visual Studio Code](https://code.visualstudio.com/docs/languages/markdown) to learn about the features of this extension.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Markdown Language Server
|
|
2
|
+
|
|
3
|
+
> **❗ Import** This is still in development. While the language server is being used by VS Code, it has not yet been tested with other clients.
|
|
4
|
+
|
|
5
|
+
The Markdown language server powers VS Code's built-in markdown support, providing tools for writing and browsing Markdown files. It runs as a separate executable and implements the [language server protocol](https://microsoft.github.io/language-server-protocol/overview).
|
|
6
|
+
|
|
7
|
+
This server uses the [Markdown Language Service](https://github.com/microsoft/vscode-markdown-languageservice) to implement almost all of the language features. You can use that library if you need a library for working with Markdown instead of a full language server.
|
|
8
|
+
|
|
9
|
+
## Server capabilities
|
|
10
|
+
|
|
11
|
+
- [Completions](https://microsoft.github.io/language-server-protocol/specification#textDocument_completion) for Markdown links.
|
|
12
|
+
|
|
13
|
+
- [Folding](https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange) of Markdown regions, block elements, and header sections.
|
|
14
|
+
|
|
15
|
+
- [Smart selection](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_selectionRange) for inline elements, block elements, and header sections.
|
|
16
|
+
|
|
17
|
+
- [Document Symbols](https://microsoft.github.io/language-server-protocol/specification#textDocument_documentSymbol) for quick navigation to headers in a document.
|
|
18
|
+
|
|
19
|
+
- [Workspace Symbols](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_symbol) for quick navigation to headers in the workspace
|
|
20
|
+
|
|
21
|
+
- [Document links](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentLink) for making Markdown links in a document clickable.
|
|
22
|
+
|
|
23
|
+
- [Find all references](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_references) to headers and links across all Markdown files in the workspace.
|
|
24
|
+
|
|
25
|
+
- [Go to definition](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_definition) from links to headers or link definitions.
|
|
26
|
+
|
|
27
|
+
- [Rename](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_rename) of headers and links across all Markdown files in the workspace.
|
|
28
|
+
|
|
29
|
+
- Find all references to a file. Uses a custom `markdown/getReferencesToFileInWorkspace` message.
|
|
30
|
+
|
|
31
|
+
- [Code Actions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction)
|
|
32
|
+
|
|
33
|
+
- Organize link definitions source action.
|
|
34
|
+
- Extract link to definition refactoring.
|
|
35
|
+
|
|
36
|
+
- Updating links when a file is moved / renamed. Uses a custom `markdown/getEditForFileRenames` message.
|
|
37
|
+
|
|
38
|
+
- [Pull diagnostics (validation)](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics) for links.
|
|
39
|
+
|
|
40
|
+
## Client requirements
|
|
41
|
+
|
|
42
|
+
### Initialization options
|
|
43
|
+
|
|
44
|
+
The client can send the following initialization options to the server:
|
|
45
|
+
|
|
46
|
+
- `markdownFileExtensions` Array file extensions that should be considered as Markdown. These should not include the leading `.`. For example: `['md', 'mdown', 'markdown']`.
|
|
47
|
+
|
|
48
|
+
### Settings
|
|
49
|
+
|
|
50
|
+
Clients may send a `workspace/didChangeConfiguration` notification to notify the server of settings changes.
|
|
51
|
+
The server supports the following settings:
|
|
52
|
+
|
|
53
|
+
- `markdown`
|
|
54
|
+
- `suggest`
|
|
55
|
+
- `paths`
|
|
56
|
+
- `enabled` — Enable/disable path suggestions.
|
|
57
|
+
|
|
58
|
+
- `occurrencesHighlight`
|
|
59
|
+
- `enabled` — Enable/disable highlighting of link occurrences.
|
|
60
|
+
|
|
61
|
+
- `validate`
|
|
62
|
+
- `enabled` — Enable/disable all validation.
|
|
63
|
+
- `referenceLinks`
|
|
64
|
+
- `enabled` — Enable/disable validation of reference links: `[text][ref]`
|
|
65
|
+
- `fragmentLinks`
|
|
66
|
+
- `enabled` — Enable/disable validation of links to fragments in the current files: `[text](#head)`
|
|
67
|
+
- `fileLinks`
|
|
68
|
+
- `enabled` — Enable/disable validation of links to file in the workspace.
|
|
69
|
+
- `markdownFragmentLinks` — Enable/disable validation of links to headers in other Markdown files. Use `inherit` to inherit the `fragmentLinks` setting.
|
|
70
|
+
- `ignoredLinks` — Array of glob patterns for files that should not be validated.
|
|
71
|
+
- `unusedLinkDefinitions`
|
|
72
|
+
- `enabled` — Enable/disable validation of unused link definitions.
|
|
73
|
+
- `duplicateLinkDefinitions`
|
|
74
|
+
- `enabled` — Enable/disable validation of duplicated link definitions.
|
|
75
|
+
|
|
76
|
+
### Custom requests
|
|
77
|
+
|
|
78
|
+
To support all of the features of the language server, the client needs to implement a few custom request types. The definitions of these request types can be found in [`protocol.ts`](./src/protocol.ts)
|
|
79
|
+
|
|
80
|
+
#### `markdown/parse`
|
|
81
|
+
|
|
82
|
+
Get the tokens for a Markdown file. Clients are expected to use [Markdown-it](https://github.com/markdown-it/markdown-it) for this.
|
|
83
|
+
|
|
84
|
+
We require that clients bring their own version of Markdown-it so that they can customize/extend Markdown-it.
|
|
85
|
+
|
|
86
|
+
#### `markdown/fs/readFile`
|
|
87
|
+
|
|
88
|
+
Read the contents of a file in the workspace.
|
|
89
|
+
|
|
90
|
+
#### `markdown/fs/readDirectory`
|
|
91
|
+
|
|
92
|
+
Read the contents of a directory in the workspace.
|
|
93
|
+
|
|
94
|
+
#### `markdown/fs/stat`
|
|
95
|
+
|
|
96
|
+
Check if a given file/directory exists in the workspace.
|
|
97
|
+
|
|
98
|
+
#### `markdown/fs/watcher/create`
|
|
99
|
+
|
|
100
|
+
Create a file watcher. This is needed for diagnostics support.
|
|
101
|
+
|
|
102
|
+
#### `markdown/fs/watcher/delete`
|
|
103
|
+
|
|
104
|
+
Delete a previously created file watcher.
|
|
105
|
+
|
|
106
|
+
#### `markdown/findMarkdownFilesInWorkspace`
|
|
107
|
+
|
|
108
|
+
Get a list of all markdown files in the workspace.
|
|
109
|
+
|
|
110
|
+
## Contribute
|
|
111
|
+
|
|
112
|
+
The source code of the Markdown language server can be found in the [VSCode repository](https://github.com/microsoft/vscode) at [extensions/markdown-language-features/server](https://github.com/microsoft/vscode/tree/master/extensions/markdown-language-features/server).
|
|
113
|
+
|
|
114
|
+
File issues and pull requests in the [VSCode GitHub Issues](https://github.com/microsoft/vscode/issues). See the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute) on how to build and run from source.
|
|
115
|
+
|
|
116
|
+
Most of the functionality of the server is located in libraries:
|
|
117
|
+
|
|
118
|
+
- [vscode-markdown-languageservice](https://github.com/microsoft/vscode-markdown-languageservice) contains the implementation of all features as a reusable library.
|
|
119
|
+
- [vscode-languageserver-node](https://github.com/microsoft/vscode-languageserver-node) contains the implementation of language server for NodeJS.
|
|
120
|
+
|
|
121
|
+
Help on any of these projects is very welcome.
|
|
122
|
+
|
|
123
|
+
## Code of Conduct
|
|
124
|
+
|
|
125
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
130
|
+
|
|
131
|
+
Licensed under the [MIT](https://github.com/microsoft/vscode/blob/master/LICENSE.txt) License.
|