tsprotocol.go 272 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907
  1. // Copyright 2023 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated for LSP. DO NOT EDIT.
  5. package protocol
  6. // Code generated from protocol/metaModel.json at ref release/protocol/3.17.6-next.9 (hash c94395b5da53729e6dff931293b051009ccaaaa4).
  7. // https://github.com/microsoft/vscode-languageserver-node/blob/release/protocol/3.17.6-next.9/protocol/metaModel.json
  8. // LSP metaData.version = 3.17.0.
  9. import "encoding/json"
  10. // created for And
  11. type And_RegOpt_textDocument_colorPresentation struct {
  12. WorkDoneProgressOptions
  13. TextDocumentRegistrationOptions
  14. }
  15. // A special text edit with an additional change annotation.
  16. //
  17. // @since 3.16.0.
  18. //
  19. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#annotatedTextEdit
  20. type AnnotatedTextEdit struct {
  21. // The actual identifier of the change annotation
  22. AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
  23. TextEdit
  24. }
  25. // The parameters passed via an apply workspace edit request.
  26. //
  27. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#applyWorkspaceEditParams
  28. type ApplyWorkspaceEditParams struct {
  29. // An optional label of the workspace edit. This label is
  30. // presented in the user interface for example on an undo
  31. // stack to undo the workspace edit.
  32. Label string `json:"label,omitempty"`
  33. // The edits to apply.
  34. Edit WorkspaceEdit `json:"edit"`
  35. // Additional data about the edit.
  36. //
  37. // @since 3.18.0
  38. // @proposed
  39. Metadata *WorkspaceEditMetadata `json:"metadata,omitempty"`
  40. }
  41. // The result returned from the apply workspace edit request.
  42. //
  43. // @since 3.17 renamed from ApplyWorkspaceEditResponse
  44. //
  45. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#applyWorkspaceEditResult
  46. type ApplyWorkspaceEditResult struct {
  47. // Indicates whether the edit was applied or not.
  48. Applied bool `json:"applied"`
  49. // An optional textual description for why the edit was not applied.
  50. // This may be used by the server for diagnostic logging or to provide
  51. // a suitable error for a request that triggered the edit.
  52. FailureReason string `json:"failureReason,omitempty"`
  53. // Depending on the client's failure handling strategy `failedChange` might
  54. // contain the index of the change that failed. This property is only available
  55. // if the client signals a `failureHandlingStrategy` in its client capabilities.
  56. FailedChange uint32 `json:"failedChange,omitempty"`
  57. }
  58. // A base for all symbol information.
  59. //
  60. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#baseSymbolInformation
  61. type BaseSymbolInformation struct {
  62. // The name of this symbol.
  63. Name string `json:"name"`
  64. // The kind of this symbol.
  65. Kind SymbolKind `json:"kind"`
  66. // Tags for this symbol.
  67. //
  68. // @since 3.16.0
  69. Tags []SymbolTag `json:"tags,omitempty"`
  70. // The name of the symbol containing this symbol. This information is for
  71. // user interface purposes (e.g. to render a qualifier in the user interface
  72. // if necessary). It can't be used to re-infer a hierarchy for the document
  73. // symbols.
  74. ContainerName string `json:"containerName,omitempty"`
  75. }
  76. // @since 3.16.0
  77. //
  78. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyClientCapabilities
  79. type CallHierarchyClientCapabilities struct {
  80. // Whether implementation supports dynamic registration. If this is set to `true`
  81. // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  82. // return value for the corresponding server capability as well.
  83. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  84. }
  85. // Represents an incoming call, e.g. a caller of a method or constructor.
  86. //
  87. // @since 3.16.0
  88. //
  89. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyIncomingCall
  90. type CallHierarchyIncomingCall struct {
  91. // The item that makes the call.
  92. From CallHierarchyItem `json:"from"`
  93. // The ranges at which the calls appear. This is relative to the caller
  94. // denoted by {@link CallHierarchyIncomingCall.from `this.from`}.
  95. FromRanges []Range `json:"fromRanges"`
  96. }
  97. // The parameter of a `callHierarchy/incomingCalls` request.
  98. //
  99. // @since 3.16.0
  100. //
  101. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyIncomingCallsParams
  102. type CallHierarchyIncomingCallsParams struct {
  103. Item CallHierarchyItem `json:"item"`
  104. WorkDoneProgressParams
  105. PartialResultParams
  106. }
  107. // Represents programming constructs like functions or constructors in the context
  108. // of call hierarchy.
  109. //
  110. // @since 3.16.0
  111. //
  112. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyItem
  113. type CallHierarchyItem struct {
  114. // The name of this item.
  115. Name string `json:"name"`
  116. // The kind of this item.
  117. Kind SymbolKind `json:"kind"`
  118. // Tags for this item.
  119. Tags []SymbolTag `json:"tags,omitempty"`
  120. // More detail for this item, e.g. the signature of a function.
  121. Detail string `json:"detail,omitempty"`
  122. // The resource identifier of this item.
  123. URI DocumentUri `json:"uri"`
  124. // The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
  125. Range Range `json:"range"`
  126. // The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.
  127. // Must be contained by the {@link CallHierarchyItem.range `range`}.
  128. SelectionRange Range `json:"selectionRange"`
  129. // A data entry field that is preserved between a call hierarchy prepare and
  130. // incoming calls or outgoing calls requests.
  131. Data interface{} `json:"data,omitempty"`
  132. }
  133. // Call hierarchy options used during static registration.
  134. //
  135. // @since 3.16.0
  136. //
  137. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyOptions
  138. type CallHierarchyOptions struct {
  139. WorkDoneProgressOptions
  140. }
  141. // Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.
  142. //
  143. // @since 3.16.0
  144. //
  145. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyOutgoingCall
  146. type CallHierarchyOutgoingCall struct {
  147. // The item that is called.
  148. To CallHierarchyItem `json:"to"`
  149. // The range at which this item is called. This is the range relative to the caller, e.g the item
  150. // passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`}
  151. // and not {@link CallHierarchyOutgoingCall.to `this.to`}.
  152. FromRanges []Range `json:"fromRanges"`
  153. }
  154. // The parameter of a `callHierarchy/outgoingCalls` request.
  155. //
  156. // @since 3.16.0
  157. //
  158. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyOutgoingCallsParams
  159. type CallHierarchyOutgoingCallsParams struct {
  160. Item CallHierarchyItem `json:"item"`
  161. WorkDoneProgressParams
  162. PartialResultParams
  163. }
  164. // The parameter of a `textDocument/prepareCallHierarchy` request.
  165. //
  166. // @since 3.16.0
  167. //
  168. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyPrepareParams
  169. type CallHierarchyPrepareParams struct {
  170. TextDocumentPositionParams
  171. WorkDoneProgressParams
  172. }
  173. // Call hierarchy options used during static or dynamic registration.
  174. //
  175. // @since 3.16.0
  176. //
  177. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#callHierarchyRegistrationOptions
  178. type CallHierarchyRegistrationOptions struct {
  179. TextDocumentRegistrationOptions
  180. CallHierarchyOptions
  181. StaticRegistrationOptions
  182. }
  183. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#cancelParams
  184. type CancelParams struct {
  185. // The request id to cancel.
  186. ID interface{} `json:"id"`
  187. }
  188. // Additional information that describes document changes.
  189. //
  190. // @since 3.16.0
  191. //
  192. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#changeAnnotation
  193. type ChangeAnnotation struct {
  194. // A human-readable string describing the actual change. The string
  195. // is rendered prominent in the user interface.
  196. Label string `json:"label"`
  197. // A flag which indicates that user confirmation is needed
  198. // before applying the change.
  199. NeedsConfirmation bool `json:"needsConfirmation,omitempty"`
  200. // A human-readable string which is rendered less prominent in
  201. // the user interface.
  202. Description string `json:"description,omitempty"`
  203. }
  204. // An identifier to refer to a change annotation stored with a workspace edit.
  205. //
  206. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#changeAnnotationIdentifier
  207. type ChangeAnnotationIdentifier = string // (alias)
  208. // @since 3.18.0
  209. //
  210. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#changeAnnotationsSupportOptions
  211. type ChangeAnnotationsSupportOptions struct {
  212. // Whether the client groups edits with equal labels into tree nodes,
  213. // for instance all edits labelled with "Changes in Strings" would
  214. // be a tree node.
  215. GroupsOnLabel bool `json:"groupsOnLabel,omitempty"`
  216. }
  217. // Defines the capabilities provided by the client.
  218. //
  219. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCapabilities
  220. type ClientCapabilities struct {
  221. // Workspace specific client capabilities.
  222. Workspace WorkspaceClientCapabilities `json:"workspace,omitempty"`
  223. // Text document specific client capabilities.
  224. TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"`
  225. // Capabilities specific to the notebook document support.
  226. //
  227. // @since 3.17.0
  228. NotebookDocument *NotebookDocumentClientCapabilities `json:"notebookDocument,omitempty"`
  229. // Window specific client capabilities.
  230. Window WindowClientCapabilities `json:"window,omitempty"`
  231. // General client capabilities.
  232. //
  233. // @since 3.16.0
  234. General *GeneralClientCapabilities `json:"general,omitempty"`
  235. // Experimental client capabilities.
  236. Experimental interface{} `json:"experimental,omitempty"`
  237. }
  238. // @since 3.18.0
  239. //
  240. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCodeActionKindOptions
  241. type ClientCodeActionKindOptions struct {
  242. // The code action kind values the client supports. When this
  243. // property exists the client also guarantees that it will
  244. // handle values outside its set gracefully and falls back
  245. // to a default value when unknown.
  246. ValueSet []CodeActionKind `json:"valueSet"`
  247. }
  248. // @since 3.18.0
  249. //
  250. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCodeActionLiteralOptions
  251. type ClientCodeActionLiteralOptions struct {
  252. // The code action kind is support with the following value
  253. // set.
  254. CodeActionKind ClientCodeActionKindOptions `json:"codeActionKind"`
  255. }
  256. // @since 3.18.0
  257. //
  258. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCodeActionResolveOptions
  259. type ClientCodeActionResolveOptions struct {
  260. // The properties that a client can resolve lazily.
  261. Properties []string `json:"properties"`
  262. }
  263. // @since 3.18.0
  264. //
  265. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCodeLensResolveOptions
  266. type ClientCodeLensResolveOptions struct {
  267. // The properties that a client can resolve lazily.
  268. Properties []string `json:"properties"`
  269. }
  270. // @since 3.18.0
  271. //
  272. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCompletionItemInsertTextModeOptions
  273. type ClientCompletionItemInsertTextModeOptions struct {
  274. ValueSet []InsertTextMode `json:"valueSet"`
  275. }
  276. // @since 3.18.0
  277. //
  278. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCompletionItemOptions
  279. type ClientCompletionItemOptions struct {
  280. // Client supports snippets as insert text.
  281. //
  282. // A snippet can define tab stops and placeholders with `$1`, `$2`
  283. // and `${3:foo}`. `$0` defines the final tab stop, it defaults to
  284. // the end of the snippet. Placeholders with equal identifiers are linked,
  285. // that is typing in one will update others too.
  286. SnippetSupport bool `json:"snippetSupport,omitempty"`
  287. // Client supports commit characters on a completion item.
  288. CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`
  289. // Client supports the following content formats for the documentation
  290. // property. The order describes the preferred format of the client.
  291. DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
  292. // Client supports the deprecated property on a completion item.
  293. DeprecatedSupport bool `json:"deprecatedSupport,omitempty"`
  294. // Client supports the preselect property on a completion item.
  295. PreselectSupport bool `json:"preselectSupport,omitempty"`
  296. // Client supports the tag property on a completion item. Clients supporting
  297. // tags have to handle unknown tags gracefully. Clients especially need to
  298. // preserve unknown tags when sending a completion item back to the server in
  299. // a resolve call.
  300. //
  301. // @since 3.15.0
  302. TagSupport *CompletionItemTagOptions `json:"tagSupport,omitempty"`
  303. // Client support insert replace edit to control different behavior if a
  304. // completion item is inserted in the text or should replace text.
  305. //
  306. // @since 3.16.0
  307. InsertReplaceSupport bool `json:"insertReplaceSupport,omitempty"`
  308. // Indicates which properties a client can resolve lazily on a completion
  309. // item. Before version 3.16.0 only the predefined properties `documentation`
  310. // and `details` could be resolved lazily.
  311. //
  312. // @since 3.16.0
  313. ResolveSupport *ClientCompletionItemResolveOptions `json:"resolveSupport,omitempty"`
  314. // The client supports the `insertTextMode` property on
  315. // a completion item to override the whitespace handling mode
  316. // as defined by the client (see `insertTextMode`).
  317. //
  318. // @since 3.16.0
  319. InsertTextModeSupport *ClientCompletionItemInsertTextModeOptions `json:"insertTextModeSupport,omitempty"`
  320. // The client has support for completion item label
  321. // details (see also `CompletionItemLabelDetails`).
  322. //
  323. // @since 3.17.0
  324. LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
  325. }
  326. // @since 3.18.0
  327. //
  328. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCompletionItemOptionsKind
  329. type ClientCompletionItemOptionsKind struct {
  330. // The completion item kind values the client supports. When this
  331. // property exists the client also guarantees that it will
  332. // handle values outside its set gracefully and falls back
  333. // to a default value when unknown.
  334. //
  335. // If this property is not present the client only supports
  336. // the completion items kinds from `Text` to `Reference` as defined in
  337. // the initial version of the protocol.
  338. ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
  339. }
  340. // @since 3.18.0
  341. //
  342. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientCompletionItemResolveOptions
  343. type ClientCompletionItemResolveOptions struct {
  344. // The properties that a client can resolve lazily.
  345. Properties []string `json:"properties"`
  346. }
  347. // @since 3.18.0
  348. //
  349. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientDiagnosticsTagOptions
  350. type ClientDiagnosticsTagOptions struct {
  351. // The tags supported by the client.
  352. ValueSet []DiagnosticTag `json:"valueSet"`
  353. }
  354. // @since 3.18.0
  355. //
  356. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientFoldingRangeKindOptions
  357. type ClientFoldingRangeKindOptions struct {
  358. // The folding range kind values the client supports. When this
  359. // property exists the client also guarantees that it will
  360. // handle values outside its set gracefully and falls back
  361. // to a default value when unknown.
  362. ValueSet []FoldingRangeKind `json:"valueSet,omitempty"`
  363. }
  364. // @since 3.18.0
  365. //
  366. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientFoldingRangeOptions
  367. type ClientFoldingRangeOptions struct {
  368. // If set, the client signals that it supports setting collapsedText on
  369. // folding ranges to display custom labels instead of the default text.
  370. //
  371. // @since 3.17.0
  372. CollapsedText bool `json:"collapsedText,omitempty"`
  373. }
  374. // Information about the client
  375. //
  376. // @since 3.15.0
  377. // @since 3.18.0 ClientInfo type name added.
  378. //
  379. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientInfo
  380. type ClientInfo struct {
  381. // The name of the client as defined by the client.
  382. Name string `json:"name"`
  383. // The client's version as defined by the client.
  384. Version string `json:"version,omitempty"`
  385. }
  386. // @since 3.18.0
  387. //
  388. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientInlayHintResolveOptions
  389. type ClientInlayHintResolveOptions struct {
  390. // The properties that a client can resolve lazily.
  391. Properties []string `json:"properties"`
  392. }
  393. // @since 3.18.0
  394. //
  395. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSemanticTokensRequestFullDelta
  396. type ClientSemanticTokensRequestFullDelta struct {
  397. // The client will send the `textDocument/semanticTokens/full/delta` request if
  398. // the server provides a corresponding handler.
  399. Delta bool `json:"delta,omitempty"`
  400. }
  401. // @since 3.18.0
  402. //
  403. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSemanticTokensRequestOptions
  404. type ClientSemanticTokensRequestOptions struct {
  405. // The client will send the `textDocument/semanticTokens/range` request if
  406. // the server provides a corresponding handler.
  407. Range *Or_ClientSemanticTokensRequestOptions_range `json:"range,omitempty"`
  408. // The client will send the `textDocument/semanticTokens/full` request if
  409. // the server provides a corresponding handler.
  410. Full *Or_ClientSemanticTokensRequestOptions_full `json:"full,omitempty"`
  411. }
  412. // @since 3.18.0
  413. //
  414. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientShowMessageActionItemOptions
  415. type ClientShowMessageActionItemOptions struct {
  416. // Whether the client supports additional attributes which
  417. // are preserved and send back to the server in the
  418. // request's response.
  419. AdditionalPropertiesSupport bool `json:"additionalPropertiesSupport,omitempty"`
  420. }
  421. // @since 3.18.0
  422. //
  423. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSignatureInformationOptions
  424. type ClientSignatureInformationOptions struct {
  425. // Client supports the following content formats for the documentation
  426. // property. The order describes the preferred format of the client.
  427. DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
  428. // Client capabilities specific to parameter information.
  429. ParameterInformation *ClientSignatureParameterInformationOptions `json:"parameterInformation,omitempty"`
  430. // The client supports the `activeParameter` property on `SignatureInformation`
  431. // literal.
  432. //
  433. // @since 3.16.0
  434. ActiveParameterSupport bool `json:"activeParameterSupport,omitempty"`
  435. // The client supports the `activeParameter` property on
  436. // `SignatureHelp`/`SignatureInformation` being set to `null` to
  437. // indicate that no parameter should be active.
  438. //
  439. // @since 3.18.0
  440. // @proposed
  441. NoActiveParameterSupport bool `json:"noActiveParameterSupport,omitempty"`
  442. }
  443. // @since 3.18.0
  444. //
  445. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSignatureParameterInformationOptions
  446. type ClientSignatureParameterInformationOptions struct {
  447. // The client supports processing label offsets instead of a
  448. // simple label string.
  449. //
  450. // @since 3.14.0
  451. LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
  452. }
  453. // @since 3.18.0
  454. //
  455. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSymbolKindOptions
  456. type ClientSymbolKindOptions struct {
  457. // The symbol kind values the client supports. When this
  458. // property exists the client also guarantees that it will
  459. // handle values outside its set gracefully and falls back
  460. // to a default value when unknown.
  461. //
  462. // If this property is not present the client only supports
  463. // the symbol kinds from `File` to `Array` as defined in
  464. // the initial version of the protocol.
  465. ValueSet []SymbolKind `json:"valueSet,omitempty"`
  466. }
  467. // @since 3.18.0
  468. //
  469. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSymbolResolveOptions
  470. type ClientSymbolResolveOptions struct {
  471. // The properties that a client can resolve lazily. Usually
  472. // `location.range`
  473. Properties []string `json:"properties"`
  474. }
  475. // @since 3.18.0
  476. //
  477. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#clientSymbolTagOptions
  478. type ClientSymbolTagOptions struct {
  479. // The tags supported by the client.
  480. ValueSet []SymbolTag `json:"valueSet"`
  481. }
  482. // A code action represents a change that can be performed in code, e.g. to fix a problem or
  483. // to refactor code.
  484. //
  485. // A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
  486. //
  487. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeAction
  488. type CodeAction struct {
  489. // A short, human-readable, title for this code action.
  490. Title string `json:"title"`
  491. // The kind of the code action.
  492. //
  493. // Used to filter code actions.
  494. Kind CodeActionKind `json:"kind,omitempty"`
  495. // The diagnostics that this code action resolves.
  496. Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
  497. // Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
  498. // by keybindings.
  499. //
  500. // A quick fix should be marked preferred if it properly addresses the underlying error.
  501. // A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
  502. //
  503. // @since 3.15.0
  504. IsPreferred bool `json:"isPreferred,omitempty"`
  505. // Marks that the code action cannot currently be applied.
  506. //
  507. // Clients should follow the following guidelines regarding disabled code actions:
  508. //
  509. // - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
  510. // code action menus.
  511. //
  512. // - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type
  513. // of code action, such as refactorings.
  514. //
  515. // - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)
  516. // that auto applies a code action and only disabled code actions are returned, the client should show the user an
  517. // error message with `reason` in the editor.
  518. //
  519. // @since 3.16.0
  520. Disabled *CodeActionDisabled `json:"disabled,omitempty"`
  521. // The workspace edit this code action performs.
  522. Edit *WorkspaceEdit `json:"edit,omitempty"`
  523. // A command this code action executes. If a code action
  524. // provides an edit and a command, first the edit is
  525. // executed and then the command.
  526. Command *Command `json:"command,omitempty"`
  527. // A data entry field that is preserved on a code action between
  528. // a `textDocument/codeAction` and a `codeAction/resolve` request.
  529. //
  530. // @since 3.16.0
  531. Data *json.RawMessage `json:"data,omitempty"`
  532. }
  533. // The Client Capabilities of a {@link CodeActionRequest}.
  534. //
  535. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionClientCapabilities
  536. type CodeActionClientCapabilities struct {
  537. // Whether code action supports dynamic registration.
  538. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  539. // The client support code action literals of type `CodeAction` as a valid
  540. // response of the `textDocument/codeAction` request. If the property is not
  541. // set the request can only return `Command` literals.
  542. //
  543. // @since 3.8.0
  544. CodeActionLiteralSupport ClientCodeActionLiteralOptions `json:"codeActionLiteralSupport,omitempty"`
  545. // Whether code action supports the `isPreferred` property.
  546. //
  547. // @since 3.15.0
  548. IsPreferredSupport bool `json:"isPreferredSupport,omitempty"`
  549. // Whether code action supports the `disabled` property.
  550. //
  551. // @since 3.16.0
  552. DisabledSupport bool `json:"disabledSupport,omitempty"`
  553. // Whether code action supports the `data` property which is
  554. // preserved between a `textDocument/codeAction` and a
  555. // `codeAction/resolve` request.
  556. //
  557. // @since 3.16.0
  558. DataSupport bool `json:"dataSupport,omitempty"`
  559. // Whether the client supports resolving additional code action
  560. // properties via a separate `codeAction/resolve` request.
  561. //
  562. // @since 3.16.0
  563. ResolveSupport *ClientCodeActionResolveOptions `json:"resolveSupport,omitempty"`
  564. // Whether the client honors the change annotations in
  565. // text edits and resource operations returned via the
  566. // `CodeAction#edit` property by for example presenting
  567. // the workspace edit in the user interface and asking
  568. // for confirmation.
  569. //
  570. // @since 3.16.0
  571. HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitempty"`
  572. // Whether the client supports documentation for a class of
  573. // code actions.
  574. //
  575. // @since 3.18.0
  576. // @proposed
  577. DocumentationSupport bool `json:"documentationSupport,omitempty"`
  578. }
  579. // Contains additional diagnostic information about the context in which
  580. // a {@link CodeActionProvider.provideCodeActions code action} is run.
  581. //
  582. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionContext
  583. type CodeActionContext struct {
  584. // An array of diagnostics known on the client side overlapping the range provided to the
  585. // `textDocument/codeAction` request. They are provided so that the server knows which
  586. // errors are currently presented to the user for the given range. There is no guarantee
  587. // that these accurately reflect the error state of the resource. The primary parameter
  588. // to compute code actions is the provided range.
  589. Diagnostics []Diagnostic `json:"diagnostics"`
  590. // Requested kind of actions to return.
  591. //
  592. // Actions not of this kind are filtered out by the client before being shown. So servers
  593. // can omit computing them.
  594. Only []CodeActionKind `json:"only,omitempty"`
  595. // The reason why code actions were requested.
  596. //
  597. // @since 3.17.0
  598. TriggerKind *CodeActionTriggerKind `json:"triggerKind,omitempty"`
  599. }
  600. // Captures why the code action is currently disabled.
  601. //
  602. // @since 3.18.0
  603. //
  604. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionDisabled
  605. type CodeActionDisabled struct {
  606. // Human readable description of why the code action is currently disabled.
  607. //
  608. // This is displayed in the code actions UI.
  609. Reason string `json:"reason"`
  610. }
  611. // A set of predefined code action kinds
  612. type CodeActionKind string
  613. // Documentation for a class of code actions.
  614. //
  615. // @since 3.18.0
  616. // @proposed
  617. //
  618. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionKindDocumentation
  619. type CodeActionKindDocumentation struct {
  620. // The kind of the code action being documented.
  621. //
  622. // If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any
  623. // refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the
  624. // documentation will only be shown when extract refactoring code actions are returned.
  625. Kind CodeActionKind `json:"kind"`
  626. // Command that is ued to display the documentation to the user.
  627. //
  628. // The title of this documentation code action is taken from {@linkcode Command.title}
  629. Command Command `json:"command"`
  630. }
  631. // Provider options for a {@link CodeActionRequest}.
  632. //
  633. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionOptions
  634. type CodeActionOptions struct {
  635. // CodeActionKinds that this server may return.
  636. //
  637. // The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
  638. // may list out every specific kind they provide.
  639. CodeActionKinds []CodeActionKind `json:"codeActionKinds,omitempty"`
  640. // Static documentation for a class of code actions.
  641. //
  642. // Documentation from the provider should be shown in the code actions menu if either:
  643. //
  644. //
  645. // - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that
  646. // most closely matches the requested code action kind. For example, if a provider has documentation for
  647. // both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
  648. // the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`.
  649. //
  650. //
  651. // - Any code actions of `kind` are returned by the provider.
  652. //
  653. // At most one documentation entry should be shown per provider.
  654. //
  655. // @since 3.18.0
  656. // @proposed
  657. Documentation []CodeActionKindDocumentation `json:"documentation,omitempty"`
  658. // The server provides support to resolve additional
  659. // information for a code action.
  660. //
  661. // @since 3.16.0
  662. ResolveProvider bool `json:"resolveProvider,omitempty"`
  663. WorkDoneProgressOptions
  664. }
  665. // The parameters of a {@link CodeActionRequest}.
  666. //
  667. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionParams
  668. type CodeActionParams struct {
  669. // The document in which the command was invoked.
  670. TextDocument TextDocumentIdentifier `json:"textDocument"`
  671. // The range for which the command was invoked.
  672. Range Range `json:"range"`
  673. // Context carrying additional information.
  674. Context CodeActionContext `json:"context"`
  675. WorkDoneProgressParams
  676. PartialResultParams
  677. }
  678. // Registration options for a {@link CodeActionRequest}.
  679. //
  680. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeActionRegistrationOptions
  681. type CodeActionRegistrationOptions struct {
  682. TextDocumentRegistrationOptions
  683. CodeActionOptions
  684. }
  685. // The reason why code actions were requested.
  686. //
  687. // @since 3.17.0
  688. type CodeActionTriggerKind uint32
  689. // Structure to capture a description for an error code.
  690. //
  691. // @since 3.16.0
  692. //
  693. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeDescription
  694. type CodeDescription struct {
  695. // An URI to open with more information about the diagnostic error.
  696. Href URI `json:"href"`
  697. }
  698. // A code lens represents a {@link Command command} that should be shown along with
  699. // source text, like the number of references, a way to run tests, etc.
  700. //
  701. // A code lens is _unresolved_ when no command is associated to it. For performance
  702. // reasons the creation of a code lens and resolving should be done in two stages.
  703. //
  704. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLens
  705. type CodeLens struct {
  706. // The range in which this code lens is valid. Should only span a single line.
  707. Range Range `json:"range"`
  708. // The command this code lens represents.
  709. Command *Command `json:"command,omitempty"`
  710. // A data entry field that is preserved on a code lens item between
  711. // a {@link CodeLensRequest} and a {@link CodeLensResolveRequest}
  712. Data interface{} `json:"data,omitempty"`
  713. }
  714. // The client capabilities of a {@link CodeLensRequest}.
  715. //
  716. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLensClientCapabilities
  717. type CodeLensClientCapabilities struct {
  718. // Whether code lens supports dynamic registration.
  719. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  720. // Whether the client supports resolving additional code lens
  721. // properties via a separate `codeLens/resolve` request.
  722. //
  723. // @since 3.18.0
  724. ResolveSupport *ClientCodeLensResolveOptions `json:"resolveSupport,omitempty"`
  725. }
  726. // Code Lens provider options of a {@link CodeLensRequest}.
  727. //
  728. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLensOptions
  729. type CodeLensOptions struct {
  730. // Code lens has a resolve provider as well.
  731. ResolveProvider bool `json:"resolveProvider,omitempty"`
  732. WorkDoneProgressOptions
  733. }
  734. // The parameters of a {@link CodeLensRequest}.
  735. //
  736. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLensParams
  737. type CodeLensParams struct {
  738. // The document to request code lens for.
  739. TextDocument TextDocumentIdentifier `json:"textDocument"`
  740. WorkDoneProgressParams
  741. PartialResultParams
  742. }
  743. // Registration options for a {@link CodeLensRequest}.
  744. //
  745. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLensRegistrationOptions
  746. type CodeLensRegistrationOptions struct {
  747. TextDocumentRegistrationOptions
  748. CodeLensOptions
  749. }
  750. // @since 3.16.0
  751. //
  752. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#codeLensWorkspaceClientCapabilities
  753. type CodeLensWorkspaceClientCapabilities struct {
  754. // Whether the client implementation supports a refresh request sent from the
  755. // server to the client.
  756. //
  757. // Note that this event is global and will force the client to refresh all
  758. // code lenses currently shown. It should be used with absolute care and is
  759. // useful for situation where a server for example detect a project wide
  760. // change that requires such a calculation.
  761. RefreshSupport bool `json:"refreshSupport,omitempty"`
  762. }
  763. // Represents a color in RGBA space.
  764. //
  765. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#color
  766. type Color struct {
  767. // The red component of this color in the range [0-1].
  768. Red float64 `json:"red"`
  769. // The green component of this color in the range [0-1].
  770. Green float64 `json:"green"`
  771. // The blue component of this color in the range [0-1].
  772. Blue float64 `json:"blue"`
  773. // The alpha component of this color in the range [0-1].
  774. Alpha float64 `json:"alpha"`
  775. }
  776. // Represents a color range from a document.
  777. //
  778. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#colorInformation
  779. type ColorInformation struct {
  780. // The range in the document where this color appears.
  781. Range Range `json:"range"`
  782. // The actual color value for this color range.
  783. Color Color `json:"color"`
  784. }
  785. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#colorPresentation
  786. type ColorPresentation struct {
  787. // The label of this color presentation. It will be shown on the color
  788. // picker header. By default this is also the text that is inserted when selecting
  789. // this color presentation.
  790. Label string `json:"label"`
  791. // An {@link TextEdit edit} which is applied to a document when selecting
  792. // this presentation for the color. When `falsy` the {@link ColorPresentation.label label}
  793. // is used.
  794. TextEdit *TextEdit `json:"textEdit,omitempty"`
  795. // An optional array of additional {@link TextEdit text edits} that are applied when
  796. // selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves.
  797. AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
  798. }
  799. // Parameters for a {@link ColorPresentationRequest}.
  800. //
  801. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#colorPresentationParams
  802. type ColorPresentationParams struct {
  803. // The text document.
  804. TextDocument TextDocumentIdentifier `json:"textDocument"`
  805. // The color to request presentations for.
  806. Color Color `json:"color"`
  807. // The range where the color would be inserted. Serves as a context.
  808. Range Range `json:"range"`
  809. WorkDoneProgressParams
  810. PartialResultParams
  811. }
  812. // Represents a reference to a command. Provides a title which
  813. // will be used to represent a command in the UI and, optionally,
  814. // an array of arguments which will be passed to the command handler
  815. // function when invoked.
  816. //
  817. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#command
  818. type Command struct {
  819. // Title of the command, like `save`.
  820. Title string `json:"title"`
  821. // An optional tooltip.
  822. //
  823. // @since 3.18.0
  824. // @proposed
  825. Tooltip string `json:"tooltip,omitempty"`
  826. // The identifier of the actual command handler.
  827. Command string `json:"command"`
  828. // Arguments that the command handler should be
  829. // invoked with.
  830. Arguments []json.RawMessage `json:"arguments,omitempty"`
  831. }
  832. // Completion client capabilities
  833. //
  834. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionClientCapabilities
  835. type CompletionClientCapabilities struct {
  836. // Whether completion supports dynamic registration.
  837. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  838. // The client supports the following `CompletionItem` specific
  839. // capabilities.
  840. CompletionItem ClientCompletionItemOptions `json:"completionItem,omitempty"`
  841. CompletionItemKind *ClientCompletionItemOptionsKind `json:"completionItemKind,omitempty"`
  842. // Defines how the client handles whitespace and indentation
  843. // when accepting a completion item that uses multi line
  844. // text in either `insertText` or `textEdit`.
  845. //
  846. // @since 3.17.0
  847. InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`
  848. // The client supports to send additional context information for a
  849. // `textDocument/completion` request.
  850. ContextSupport bool `json:"contextSupport,omitempty"`
  851. // The client supports the following `CompletionList` specific
  852. // capabilities.
  853. //
  854. // @since 3.17.0
  855. CompletionList *CompletionListCapabilities `json:"completionList,omitempty"`
  856. }
  857. // Contains additional information about the context in which a completion request is triggered.
  858. //
  859. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionContext
  860. type CompletionContext struct {
  861. // How the completion was triggered.
  862. TriggerKind CompletionTriggerKind `json:"triggerKind"`
  863. // The trigger character (a single character) that has trigger code complete.
  864. // Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
  865. TriggerCharacter string `json:"triggerCharacter,omitempty"`
  866. }
  867. // A completion item represents a text snippet that is
  868. // proposed to complete text that is being typed.
  869. //
  870. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionItem
  871. type CompletionItem struct {
  872. // The label of this completion item.
  873. //
  874. // The label property is also by default the text that
  875. // is inserted when selecting this completion.
  876. //
  877. // If label details are provided the label itself should
  878. // be an unqualified name of the completion item.
  879. Label string `json:"label"`
  880. // Additional details for the label
  881. //
  882. // @since 3.17.0
  883. LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitempty"`
  884. // The kind of this completion item. Based of the kind
  885. // an icon is chosen by the editor.
  886. Kind CompletionItemKind `json:"kind,omitempty"`
  887. // Tags for this completion item.
  888. //
  889. // @since 3.15.0
  890. Tags []CompletionItemTag `json:"tags,omitempty"`
  891. // A human-readable string with additional information
  892. // about this item, like type or symbol information.
  893. Detail string `json:"detail,omitempty"`
  894. // A human-readable string that represents a doc-comment.
  895. Documentation *Or_CompletionItem_documentation `json:"documentation,omitempty"`
  896. // Indicates if this item is deprecated.
  897. // @deprecated Use `tags` instead.
  898. Deprecated bool `json:"deprecated,omitempty"`
  899. // Select this item when showing.
  900. //
  901. // *Note* that only one completion item can be selected and that the
  902. // tool / client decides which item that is. The rule is that the *first*
  903. // item of those that match best is selected.
  904. Preselect bool `json:"preselect,omitempty"`
  905. // A string that should be used when comparing this item
  906. // with other items. When `falsy` the {@link CompletionItem.label label}
  907. // is used.
  908. SortText string `json:"sortText,omitempty"`
  909. // A string that should be used when filtering a set of
  910. // completion items. When `falsy` the {@link CompletionItem.label label}
  911. // is used.
  912. FilterText string `json:"filterText,omitempty"`
  913. // A string that should be inserted into a document when selecting
  914. // this completion. When `falsy` the {@link CompletionItem.label label}
  915. // is used.
  916. //
  917. // The `insertText` is subject to interpretation by the client side.
  918. // Some tools might not take the string literally. For example
  919. // VS Code when code complete is requested in this example
  920. // `con<cursor position>` and a completion item with an `insertText` of
  921. // `console` is provided it will only insert `sole`. Therefore it is
  922. // recommended to use `textEdit` instead since it avoids additional client
  923. // side interpretation.
  924. InsertText string `json:"insertText,omitempty"`
  925. // The format of the insert text. The format applies to both the
  926. // `insertText` property and the `newText` property of a provided
  927. // `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
  928. //
  929. // Please note that the insertTextFormat doesn't apply to
  930. // `additionalTextEdits`.
  931. InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitempty"`
  932. // How whitespace and indentation is handled during completion
  933. // item insertion. If not provided the clients default value depends on
  934. // the `textDocument.completion.insertTextMode` client capability.
  935. //
  936. // @since 3.16.0
  937. InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
  938. // An {@link TextEdit edit} which is applied to a document when selecting
  939. // this completion. When an edit is provided the value of
  940. // {@link CompletionItem.insertText insertText} is ignored.
  941. //
  942. // Most editors support two different operations when accepting a completion
  943. // item. One is to insert a completion text and the other is to replace an
  944. // existing text with a completion text. Since this can usually not be
  945. // predetermined by a server it can report both ranges. Clients need to
  946. // signal support for `InsertReplaceEdits` via the
  947. // `textDocument.completion.insertReplaceSupport` client capability
  948. // property.
  949. //
  950. // *Note 1:* The text edit's range as well as both ranges from an insert
  951. // replace edit must be a [single line] and they must contain the position
  952. // at which completion has been requested.
  953. // *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
  954. // must be a prefix of the edit's replace range, that means it must be
  955. // contained and starting at the same position.
  956. //
  957. // @since 3.16.0 additional type `InsertReplaceEdit`
  958. TextEdit *Or_CompletionItem_textEdit `json:"textEdit,omitempty"`
  959. // The edit text used if the completion item is part of a CompletionList and
  960. // CompletionList defines an item default for the text edit range.
  961. //
  962. // Clients will only honor this property if they opt into completion list
  963. // item defaults using the capability `completionList.itemDefaults`.
  964. //
  965. // If not provided and a list's default range is provided the label
  966. // property is used as a text.
  967. //
  968. // @since 3.17.0
  969. TextEditText string `json:"textEditText,omitempty"`
  970. // An optional array of additional {@link TextEdit text edits} that are applied when
  971. // selecting this completion. Edits must not overlap (including the same insert position)
  972. // with the main {@link CompletionItem.textEdit edit} nor with themselves.
  973. //
  974. // Additional text edits should be used to change text unrelated to the current cursor position
  975. // (for example adding an import statement at the top of the file if the completion item will
  976. // insert an unqualified type).
  977. AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
  978. // An optional set of characters that when pressed while this completion is active will accept it first and
  979. // then type that character. *Note* that all commit characters should have `length=1` and that superfluous
  980. // characters will be ignored.
  981. CommitCharacters []string `json:"commitCharacters,omitempty"`
  982. // An optional {@link Command command} that is executed *after* inserting this completion. *Note* that
  983. // additional modifications to the current document should be described with the
  984. // {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.
  985. Command *Command `json:"command,omitempty"`
  986. // A data entry field that is preserved on a completion item between a
  987. // {@link CompletionRequest} and a {@link CompletionResolveRequest}.
  988. Data interface{} `json:"data,omitempty"`
  989. }
  990. // In many cases the items of an actual completion result share the same
  991. // value for properties like `commitCharacters` or the range of a text
  992. // edit. A completion list can therefore define item defaults which will
  993. // be used if a completion item itself doesn't specify the value.
  994. //
  995. // If a completion list specifies a default value and a completion item
  996. // also specifies a corresponding value the one from the item is used.
  997. //
  998. // Servers are only allowed to return default values if the client
  999. // signals support for this via the `completionList.itemDefaults`
  1000. // capability.
  1001. //
  1002. // @since 3.17.0
  1003. //
  1004. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionItemDefaults
  1005. type CompletionItemDefaults struct {
  1006. // A default commit character set.
  1007. //
  1008. // @since 3.17.0
  1009. CommitCharacters []string `json:"commitCharacters,omitempty"`
  1010. // A default edit range.
  1011. //
  1012. // @since 3.17.0
  1013. EditRange *Or_CompletionItemDefaults_editRange `json:"editRange,omitempty"`
  1014. // A default insert text format.
  1015. //
  1016. // @since 3.17.0
  1017. InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitempty"`
  1018. // A default insert text mode.
  1019. //
  1020. // @since 3.17.0
  1021. InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
  1022. // A default data value.
  1023. //
  1024. // @since 3.17.0
  1025. Data interface{} `json:"data,omitempty"`
  1026. }
  1027. // The kind of a completion entry.
  1028. type CompletionItemKind uint32
  1029. // Additional details for a completion item label.
  1030. //
  1031. // @since 3.17.0
  1032. //
  1033. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionItemLabelDetails
  1034. type CompletionItemLabelDetails struct {
  1035. // An optional string which is rendered less prominently directly after {@link CompletionItem.label label},
  1036. // without any spacing. Should be used for function signatures and type annotations.
  1037. Detail string `json:"detail,omitempty"`
  1038. // An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used
  1039. // for fully qualified names and file paths.
  1040. Description string `json:"description,omitempty"`
  1041. }
  1042. // Completion item tags are extra annotations that tweak the rendering of a completion
  1043. // item.
  1044. //
  1045. // @since 3.15.0
  1046. type CompletionItemTag uint32
  1047. // @since 3.18.0
  1048. //
  1049. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionItemTagOptions
  1050. type CompletionItemTagOptions struct {
  1051. // The tags supported by the client.
  1052. ValueSet []CompletionItemTag `json:"valueSet"`
  1053. }
  1054. // Represents a collection of {@link CompletionItem completion items} to be presented
  1055. // in the editor.
  1056. //
  1057. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionList
  1058. type CompletionList struct {
  1059. // This list it not complete. Further typing results in recomputing this list.
  1060. //
  1061. // Recomputed lists have all their items replaced (not appended) in the
  1062. // incomplete completion sessions.
  1063. IsIncomplete bool `json:"isIncomplete"`
  1064. // In many cases the items of an actual completion result share the same
  1065. // value for properties like `commitCharacters` or the range of a text
  1066. // edit. A completion list can therefore define item defaults which will
  1067. // be used if a completion item itself doesn't specify the value.
  1068. //
  1069. // If a completion list specifies a default value and a completion item
  1070. // also specifies a corresponding value the one from the item is used.
  1071. //
  1072. // Servers are only allowed to return default values if the client
  1073. // signals support for this via the `completionList.itemDefaults`
  1074. // capability.
  1075. //
  1076. // @since 3.17.0
  1077. ItemDefaults *CompletionItemDefaults `json:"itemDefaults,omitempty"`
  1078. // The completion items.
  1079. Items []CompletionItem `json:"items"`
  1080. }
  1081. // The client supports the following `CompletionList` specific
  1082. // capabilities.
  1083. //
  1084. // @since 3.17.0
  1085. //
  1086. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionListCapabilities
  1087. type CompletionListCapabilities struct {
  1088. // The client supports the following itemDefaults on
  1089. // a completion list.
  1090. //
  1091. // The value lists the supported property names of the
  1092. // `CompletionList.itemDefaults` object. If omitted
  1093. // no properties are supported.
  1094. //
  1095. // @since 3.17.0
  1096. ItemDefaults []string `json:"itemDefaults,omitempty"`
  1097. }
  1098. // Completion options.
  1099. //
  1100. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionOptions
  1101. type CompletionOptions struct {
  1102. // Most tools trigger completion request automatically without explicitly requesting
  1103. // it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
  1104. // starts to type an identifier. For example if the user types `c` in a JavaScript file
  1105. // code complete will automatically pop up present `console` besides others as a
  1106. // completion item. Characters that make up identifiers don't need to be listed here.
  1107. //
  1108. // If code complete should automatically be trigger on characters not being valid inside
  1109. // an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
  1110. TriggerCharacters []string `json:"triggerCharacters,omitempty"`
  1111. // The list of all possible characters that commit a completion. This field can be used
  1112. // if clients don't support individual commit characters per completion item. See
  1113. // `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`
  1114. //
  1115. // If a server provides both `allCommitCharacters` and commit characters on an individual
  1116. // completion item the ones on the completion item win.
  1117. //
  1118. // @since 3.2.0
  1119. AllCommitCharacters []string `json:"allCommitCharacters,omitempty"`
  1120. // The server provides support to resolve additional
  1121. // information for a completion item.
  1122. ResolveProvider bool `json:"resolveProvider,omitempty"`
  1123. // The server supports the following `CompletionItem` specific
  1124. // capabilities.
  1125. //
  1126. // @since 3.17.0
  1127. CompletionItem *ServerCompletionItemOptions `json:"completionItem,omitempty"`
  1128. WorkDoneProgressOptions
  1129. }
  1130. // Completion parameters
  1131. //
  1132. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionParams
  1133. type CompletionParams struct {
  1134. // The completion context. This is only available it the client specifies
  1135. // to send this using the client capability `textDocument.completion.contextSupport === true`
  1136. Context CompletionContext `json:"context,omitempty"`
  1137. TextDocumentPositionParams
  1138. WorkDoneProgressParams
  1139. PartialResultParams
  1140. }
  1141. // Registration options for a {@link CompletionRequest}.
  1142. //
  1143. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#completionRegistrationOptions
  1144. type CompletionRegistrationOptions struct {
  1145. TextDocumentRegistrationOptions
  1146. CompletionOptions
  1147. }
  1148. // How a completion was triggered
  1149. type CompletionTriggerKind uint32
  1150. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#configurationItem
  1151. type ConfigurationItem struct {
  1152. // The scope to get the configuration section for.
  1153. ScopeURI *URI `json:"scopeUri,omitempty"`
  1154. // The configuration section asked for.
  1155. Section string `json:"section,omitempty"`
  1156. }
  1157. // The parameters of a configuration request.
  1158. //
  1159. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#configurationParams
  1160. type ConfigurationParams struct {
  1161. Items []ConfigurationItem `json:"items"`
  1162. }
  1163. // Create file operation.
  1164. //
  1165. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#createFile
  1166. type CreateFile struct {
  1167. // A create
  1168. Kind string `json:"kind"`
  1169. // The resource to create.
  1170. URI DocumentUri `json:"uri"`
  1171. // Additional options
  1172. Options *CreateFileOptions `json:"options,omitempty"`
  1173. ResourceOperation
  1174. }
  1175. // Options to create a file.
  1176. //
  1177. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#createFileOptions
  1178. type CreateFileOptions struct {
  1179. // Overwrite existing file. Overwrite wins over `ignoreIfExists`
  1180. Overwrite bool `json:"overwrite,omitempty"`
  1181. // Ignore if exists.
  1182. IgnoreIfExists bool `json:"ignoreIfExists,omitempty"`
  1183. }
  1184. // The parameters sent in notifications/requests for user-initiated creation of
  1185. // files.
  1186. //
  1187. // @since 3.16.0
  1188. //
  1189. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#createFilesParams
  1190. type CreateFilesParams struct {
  1191. // An array of all files/folders created in this operation.
  1192. Files []FileCreate `json:"files"`
  1193. }
  1194. // The declaration of a symbol representation as one or many {@link Location locations}.
  1195. //
  1196. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declaration
  1197. type Declaration = Or_Declaration // (alias)
  1198. // @since 3.14.0
  1199. //
  1200. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declarationClientCapabilities
  1201. type DeclarationClientCapabilities struct {
  1202. // Whether declaration supports dynamic registration. If this is set to `true`
  1203. // the client supports the new `DeclarationRegistrationOptions` return value
  1204. // for the corresponding server capability as well.
  1205. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1206. // The client supports additional metadata in the form of declaration links.
  1207. LinkSupport bool `json:"linkSupport,omitempty"`
  1208. }
  1209. // Information about where a symbol is declared.
  1210. //
  1211. // Provides additional metadata over normal {@link Location location} declarations, including the range of
  1212. // the declaring symbol.
  1213. //
  1214. // Servers should prefer returning `DeclarationLink` over `Declaration` if supported
  1215. // by the client.
  1216. //
  1217. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declarationLink
  1218. type DeclarationLink = LocationLink // (alias)
  1219. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declarationOptions
  1220. type DeclarationOptions struct {
  1221. WorkDoneProgressOptions
  1222. }
  1223. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declarationParams
  1224. type DeclarationParams struct {
  1225. TextDocumentPositionParams
  1226. WorkDoneProgressParams
  1227. PartialResultParams
  1228. }
  1229. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#declarationRegistrationOptions
  1230. type DeclarationRegistrationOptions struct {
  1231. DeclarationOptions
  1232. TextDocumentRegistrationOptions
  1233. StaticRegistrationOptions
  1234. }
  1235. // The definition of a symbol represented as one or many {@link Location locations}.
  1236. // For most programming languages there is only one location at which a symbol is
  1237. // defined.
  1238. //
  1239. // Servers should prefer returning `DefinitionLink` over `Definition` if supported
  1240. // by the client.
  1241. //
  1242. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definition
  1243. type Definition = Or_Definition // (alias)
  1244. // Client Capabilities for a {@link DefinitionRequest}.
  1245. //
  1246. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definitionClientCapabilities
  1247. type DefinitionClientCapabilities struct {
  1248. // Whether definition supports dynamic registration.
  1249. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1250. // The client supports additional metadata in the form of definition links.
  1251. //
  1252. // @since 3.14.0
  1253. LinkSupport bool `json:"linkSupport,omitempty"`
  1254. }
  1255. // Information about where a symbol is defined.
  1256. //
  1257. // Provides additional metadata over normal {@link Location location} definitions, including the range of
  1258. // the defining symbol
  1259. //
  1260. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definitionLink
  1261. type DefinitionLink = LocationLink // (alias)
  1262. // Server Capabilities for a {@link DefinitionRequest}.
  1263. //
  1264. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definitionOptions
  1265. type DefinitionOptions struct {
  1266. WorkDoneProgressOptions
  1267. }
  1268. // Parameters for a {@link DefinitionRequest}.
  1269. //
  1270. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definitionParams
  1271. type DefinitionParams struct {
  1272. TextDocumentPositionParams
  1273. WorkDoneProgressParams
  1274. PartialResultParams
  1275. }
  1276. // Registration options for a {@link DefinitionRequest}.
  1277. //
  1278. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#definitionRegistrationOptions
  1279. type DefinitionRegistrationOptions struct {
  1280. TextDocumentRegistrationOptions
  1281. DefinitionOptions
  1282. }
  1283. // Delete file operation
  1284. //
  1285. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#deleteFile
  1286. type DeleteFile struct {
  1287. // A delete
  1288. Kind string `json:"kind"`
  1289. // The file to delete.
  1290. URI DocumentUri `json:"uri"`
  1291. // Delete options.
  1292. Options *DeleteFileOptions `json:"options,omitempty"`
  1293. ResourceOperation
  1294. }
  1295. // Delete file options
  1296. //
  1297. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#deleteFileOptions
  1298. type DeleteFileOptions struct {
  1299. // Delete the content recursively if a folder is denoted.
  1300. Recursive bool `json:"recursive,omitempty"`
  1301. // Ignore the operation if the file doesn't exist.
  1302. IgnoreIfNotExists bool `json:"ignoreIfNotExists,omitempty"`
  1303. }
  1304. // The parameters sent in notifications/requests for user-initiated deletes of
  1305. // files.
  1306. //
  1307. // @since 3.16.0
  1308. //
  1309. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#deleteFilesParams
  1310. type DeleteFilesParams struct {
  1311. // An array of all files/folders deleted in this operation.
  1312. Files []FileDelete `json:"files"`
  1313. }
  1314. // Represents a diagnostic, such as a compiler error or warning. Diagnostic objects
  1315. // are only valid in the scope of a resource.
  1316. //
  1317. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnostic
  1318. type Diagnostic struct {
  1319. // The range at which the message applies
  1320. Range Range `json:"range"`
  1321. // The diagnostic's severity. To avoid interpretation mismatches when a
  1322. // server is used with different clients it is highly recommended that servers
  1323. // always provide a severity value.
  1324. Severity DiagnosticSeverity `json:"severity,omitempty"`
  1325. // The diagnostic's code, which usually appear in the user interface.
  1326. Code interface{} `json:"code,omitempty"`
  1327. // An optional property to describe the error code.
  1328. // Requires the code field (above) to be present/not null.
  1329. //
  1330. // @since 3.16.0
  1331. CodeDescription *CodeDescription `json:"codeDescription,omitempty"`
  1332. // A human-readable string describing the source of this
  1333. // diagnostic, e.g. 'typescript' or 'super lint'. It usually
  1334. // appears in the user interface.
  1335. Source string `json:"source,omitempty"`
  1336. // The diagnostic's message. It usually appears in the user interface
  1337. Message string `json:"message"`
  1338. // Additional metadata about the diagnostic.
  1339. //
  1340. // @since 3.15.0
  1341. Tags []DiagnosticTag `json:"tags,omitempty"`
  1342. // An array of related diagnostic information, e.g. when symbol-names within
  1343. // a scope collide all definitions can be marked via this property.
  1344. RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"`
  1345. // A data entry field that is preserved between a `textDocument/publishDiagnostics`
  1346. // notification and `textDocument/codeAction` request.
  1347. //
  1348. // @since 3.16.0
  1349. Data *json.RawMessage `json:"data,omitempty"`
  1350. }
  1351. // Client capabilities specific to diagnostic pull requests.
  1352. //
  1353. // @since 3.17.0
  1354. //
  1355. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticClientCapabilities
  1356. type DiagnosticClientCapabilities struct {
  1357. // Whether implementation supports dynamic registration. If this is set to `true`
  1358. // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  1359. // return value for the corresponding server capability as well.
  1360. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1361. // Whether the clients supports related documents for document diagnostic pulls.
  1362. RelatedDocumentSupport bool `json:"relatedDocumentSupport,omitempty"`
  1363. DiagnosticsCapabilities
  1364. }
  1365. // Diagnostic options.
  1366. //
  1367. // @since 3.17.0
  1368. //
  1369. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticOptions
  1370. type DiagnosticOptions struct {
  1371. // An optional identifier under which the diagnostics are
  1372. // managed by the client.
  1373. Identifier string `json:"identifier,omitempty"`
  1374. // Whether the language has inter file dependencies meaning that
  1375. // editing code in one file can result in a different diagnostic
  1376. // set in another file. Inter file dependencies are common for
  1377. // most programming languages and typically uncommon for linters.
  1378. InterFileDependencies bool `json:"interFileDependencies"`
  1379. // The server provides support for workspace diagnostics as well.
  1380. WorkspaceDiagnostics bool `json:"workspaceDiagnostics"`
  1381. WorkDoneProgressOptions
  1382. }
  1383. // Diagnostic registration options.
  1384. //
  1385. // @since 3.17.0
  1386. //
  1387. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticRegistrationOptions
  1388. type DiagnosticRegistrationOptions struct {
  1389. TextDocumentRegistrationOptions
  1390. DiagnosticOptions
  1391. StaticRegistrationOptions
  1392. }
  1393. // Represents a related message and source code location for a diagnostic. This should be
  1394. // used to point to code locations that cause or related to a diagnostics, e.g when duplicating
  1395. // a symbol in a scope.
  1396. //
  1397. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticRelatedInformation
  1398. type DiagnosticRelatedInformation struct {
  1399. // The location of this related diagnostic information.
  1400. Location Location `json:"location"`
  1401. // The message of this related diagnostic information.
  1402. Message string `json:"message"`
  1403. }
  1404. // Cancellation data returned from a diagnostic request.
  1405. //
  1406. // @since 3.17.0
  1407. //
  1408. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticServerCancellationData
  1409. type DiagnosticServerCancellationData struct {
  1410. RetriggerRequest bool `json:"retriggerRequest"`
  1411. }
  1412. // The diagnostic's severity.
  1413. type DiagnosticSeverity uint32
  1414. // The diagnostic tags.
  1415. //
  1416. // @since 3.15.0
  1417. type DiagnosticTag uint32
  1418. // Workspace client capabilities specific to diagnostic pull requests.
  1419. //
  1420. // @since 3.17.0
  1421. //
  1422. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticWorkspaceClientCapabilities
  1423. type DiagnosticWorkspaceClientCapabilities struct {
  1424. // Whether the client implementation supports a refresh request sent from
  1425. // the server to the client.
  1426. //
  1427. // Note that this event is global and will force the client to refresh all
  1428. // pulled diagnostics currently shown. It should be used with absolute care and
  1429. // is useful for situation where a server for example detects a project wide
  1430. // change that requires such a calculation.
  1431. RefreshSupport bool `json:"refreshSupport,omitempty"`
  1432. }
  1433. // General diagnostics capabilities for pull and push model.
  1434. //
  1435. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#diagnosticsCapabilities
  1436. type DiagnosticsCapabilities struct {
  1437. // Whether the clients accepts diagnostics with related information.
  1438. RelatedInformation bool `json:"relatedInformation,omitempty"`
  1439. // Client supports the tag property to provide meta data about a diagnostic.
  1440. // Clients supporting tags have to handle unknown tags gracefully.
  1441. //
  1442. // @since 3.15.0
  1443. TagSupport *ClientDiagnosticsTagOptions `json:"tagSupport,omitempty"`
  1444. // Client supports a codeDescription property
  1445. //
  1446. // @since 3.16.0
  1447. CodeDescriptionSupport bool `json:"codeDescriptionSupport,omitempty"`
  1448. // Whether code action supports the `data` property which is
  1449. // preserved between a `textDocument/publishDiagnostics` and
  1450. // `textDocument/codeAction` request.
  1451. //
  1452. // @since 3.16.0
  1453. DataSupport bool `json:"dataSupport,omitempty"`
  1454. }
  1455. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeConfigurationClientCapabilities
  1456. type DidChangeConfigurationClientCapabilities struct {
  1457. // Did change configuration notification supports dynamic registration.
  1458. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1459. }
  1460. // The parameters of a change configuration notification.
  1461. //
  1462. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeConfigurationParams
  1463. type DidChangeConfigurationParams struct {
  1464. // The actual changed settings
  1465. Settings interface{} `json:"settings"`
  1466. }
  1467. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeConfigurationRegistrationOptions
  1468. type DidChangeConfigurationRegistrationOptions struct {
  1469. Section *Or_DidChangeConfigurationRegistrationOptions_section `json:"section,omitempty"`
  1470. }
  1471. // The params sent in a change notebook document notification.
  1472. //
  1473. // @since 3.17.0
  1474. //
  1475. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeNotebookDocumentParams
  1476. type DidChangeNotebookDocumentParams struct {
  1477. // The notebook document that did change. The version number points
  1478. // to the version after all provided changes have been applied. If
  1479. // only the text document content of a cell changes the notebook version
  1480. // doesn't necessarily have to change.
  1481. NotebookDocument VersionedNotebookDocumentIdentifier `json:"notebookDocument"`
  1482. // The actual changes to the notebook document.
  1483. //
  1484. // The changes describe single state changes to the notebook document.
  1485. // So if there are two changes c1 (at array index 0) and c2 (at array
  1486. // index 1) for a notebook in state S then c1 moves the notebook from
  1487. // S to S' and c2 from S' to S''. So c1 is computed on the state S and
  1488. // c2 is computed on the state S'.
  1489. //
  1490. // To mirror the content of a notebook using change events use the following approach:
  1491. //
  1492. // - start with the same initial content
  1493. // - apply the 'notebookDocument/didChange' notifications in the order you receive them.
  1494. // - apply the `NotebookChangeEvent`s in a single notification in the order
  1495. // you receive them.
  1496. Change NotebookDocumentChangeEvent `json:"change"`
  1497. }
  1498. // The change text document notification's parameters.
  1499. //
  1500. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeTextDocumentParams
  1501. type DidChangeTextDocumentParams struct {
  1502. // The document that did change. The version number points
  1503. // to the version after all provided content changes have
  1504. // been applied.
  1505. TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
  1506. // The actual content changes. The content changes describe single state changes
  1507. // to the document. So if there are two content changes c1 (at array index 0) and
  1508. // c2 (at array index 1) for a document in state S then c1 moves the document from
  1509. // S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed
  1510. // on the state S'.
  1511. //
  1512. // To mirror the content of a document using change events use the following approach:
  1513. //
  1514. // - start with the same initial content
  1515. // - apply the 'textDocument/didChange' notifications in the order you receive them.
  1516. // - apply the `TextDocumentContentChangeEvent`s in a single notification in the order
  1517. // you receive them.
  1518. ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"`
  1519. }
  1520. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeWatchedFilesClientCapabilities
  1521. type DidChangeWatchedFilesClientCapabilities struct {
  1522. // Did change watched files notification supports dynamic registration. Please note
  1523. // that the current protocol doesn't support static configuration for file changes
  1524. // from the server side.
  1525. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1526. // Whether the client has support for {@link RelativePattern relative pattern}
  1527. // or not.
  1528. //
  1529. // @since 3.17.0
  1530. RelativePatternSupport bool `json:"relativePatternSupport,omitempty"`
  1531. }
  1532. // The watched files change notification's parameters.
  1533. //
  1534. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeWatchedFilesParams
  1535. type DidChangeWatchedFilesParams struct {
  1536. // The actual file events.
  1537. Changes []FileEvent `json:"changes"`
  1538. }
  1539. // Describe options to be used when registered for text document change events.
  1540. //
  1541. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeWatchedFilesRegistrationOptions
  1542. type DidChangeWatchedFilesRegistrationOptions struct {
  1543. // The watchers to register.
  1544. Watchers []FileSystemWatcher `json:"watchers"`
  1545. }
  1546. // The parameters of a `workspace/didChangeWorkspaceFolders` notification.
  1547. //
  1548. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didChangeWorkspaceFoldersParams
  1549. type DidChangeWorkspaceFoldersParams struct {
  1550. // The actual workspace folder change event.
  1551. Event WorkspaceFoldersChangeEvent `json:"event"`
  1552. }
  1553. // The params sent in a close notebook document notification.
  1554. //
  1555. // @since 3.17.0
  1556. //
  1557. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didCloseNotebookDocumentParams
  1558. type DidCloseNotebookDocumentParams struct {
  1559. // The notebook document that got closed.
  1560. NotebookDocument NotebookDocumentIdentifier `json:"notebookDocument"`
  1561. // The text documents that represent the content
  1562. // of a notebook cell that got closed.
  1563. CellTextDocuments []TextDocumentIdentifier `json:"cellTextDocuments"`
  1564. }
  1565. // The parameters sent in a close text document notification
  1566. //
  1567. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didCloseTextDocumentParams
  1568. type DidCloseTextDocumentParams struct {
  1569. // The document that was closed.
  1570. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1571. }
  1572. // The params sent in an open notebook document notification.
  1573. //
  1574. // @since 3.17.0
  1575. //
  1576. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didOpenNotebookDocumentParams
  1577. type DidOpenNotebookDocumentParams struct {
  1578. // The notebook document that got opened.
  1579. NotebookDocument NotebookDocument `json:"notebookDocument"`
  1580. // The text documents that represent the content
  1581. // of a notebook cell.
  1582. CellTextDocuments []TextDocumentItem `json:"cellTextDocuments"`
  1583. }
  1584. // The parameters sent in an open text document notification
  1585. //
  1586. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didOpenTextDocumentParams
  1587. type DidOpenTextDocumentParams struct {
  1588. // The document that was opened.
  1589. TextDocument TextDocumentItem `json:"textDocument"`
  1590. }
  1591. // The params sent in a save notebook document notification.
  1592. //
  1593. // @since 3.17.0
  1594. //
  1595. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didSaveNotebookDocumentParams
  1596. type DidSaveNotebookDocumentParams struct {
  1597. // The notebook document that got saved.
  1598. NotebookDocument NotebookDocumentIdentifier `json:"notebookDocument"`
  1599. }
  1600. // The parameters sent in a save text document notification
  1601. //
  1602. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#didSaveTextDocumentParams
  1603. type DidSaveTextDocumentParams struct {
  1604. // The document that was saved.
  1605. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1606. // Optional the content when saved. Depends on the includeText value
  1607. // when the save notification was requested.
  1608. Text *string `json:"text,omitempty"`
  1609. }
  1610. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentColorClientCapabilities
  1611. type DocumentColorClientCapabilities struct {
  1612. // Whether implementation supports dynamic registration. If this is set to `true`
  1613. // the client supports the new `DocumentColorRegistrationOptions` return value
  1614. // for the corresponding server capability as well.
  1615. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1616. }
  1617. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentColorOptions
  1618. type DocumentColorOptions struct {
  1619. WorkDoneProgressOptions
  1620. }
  1621. // Parameters for a {@link DocumentColorRequest}.
  1622. //
  1623. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentColorParams
  1624. type DocumentColorParams struct {
  1625. // The text document.
  1626. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1627. WorkDoneProgressParams
  1628. PartialResultParams
  1629. }
  1630. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentColorRegistrationOptions
  1631. type DocumentColorRegistrationOptions struct {
  1632. TextDocumentRegistrationOptions
  1633. DocumentColorOptions
  1634. StaticRegistrationOptions
  1635. }
  1636. // Parameters of the document diagnostic request.
  1637. //
  1638. // @since 3.17.0
  1639. //
  1640. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentDiagnosticParams
  1641. type DocumentDiagnosticParams struct {
  1642. // The text document.
  1643. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1644. // The additional identifier provided during registration.
  1645. Identifier string `json:"identifier,omitempty"`
  1646. // The result id of a previous response if provided.
  1647. PreviousResultID string `json:"previousResultId,omitempty"`
  1648. WorkDoneProgressParams
  1649. PartialResultParams
  1650. }
  1651. // The result of a document diagnostic pull request. A report can
  1652. // either be a full report containing all diagnostics for the
  1653. // requested document or an unchanged report indicating that nothing
  1654. // has changed in terms of diagnostics in comparison to the last
  1655. // pull request.
  1656. //
  1657. // @since 3.17.0
  1658. //
  1659. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentDiagnosticReport
  1660. type DocumentDiagnosticReport = Or_DocumentDiagnosticReport // (alias)
  1661. // The document diagnostic report kinds.
  1662. //
  1663. // @since 3.17.0
  1664. type DocumentDiagnosticReportKind string
  1665. // A partial result for a document diagnostic report.
  1666. //
  1667. // @since 3.17.0
  1668. //
  1669. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentDiagnosticReportPartialResult
  1670. type DocumentDiagnosticReportPartialResult struct {
  1671. RelatedDocuments map[DocumentUri]interface{} `json:"relatedDocuments"`
  1672. }
  1673. // A document filter describes a top level text document or
  1674. // a notebook cell document.
  1675. //
  1676. // @since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.
  1677. //
  1678. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentFilter
  1679. type DocumentFilter = Or_DocumentFilter // (alias)
  1680. // Client capabilities of a {@link DocumentFormattingRequest}.
  1681. //
  1682. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentFormattingClientCapabilities
  1683. type DocumentFormattingClientCapabilities struct {
  1684. // Whether formatting supports dynamic registration.
  1685. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1686. }
  1687. // Provider options for a {@link DocumentFormattingRequest}.
  1688. //
  1689. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentFormattingOptions
  1690. type DocumentFormattingOptions struct {
  1691. WorkDoneProgressOptions
  1692. }
  1693. // The parameters of a {@link DocumentFormattingRequest}.
  1694. //
  1695. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentFormattingParams
  1696. type DocumentFormattingParams struct {
  1697. // The document to format.
  1698. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1699. // The format options.
  1700. Options FormattingOptions `json:"options"`
  1701. WorkDoneProgressParams
  1702. }
  1703. // Registration options for a {@link DocumentFormattingRequest}.
  1704. //
  1705. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentFormattingRegistrationOptions
  1706. type DocumentFormattingRegistrationOptions struct {
  1707. TextDocumentRegistrationOptions
  1708. DocumentFormattingOptions
  1709. }
  1710. // A document highlight is a range inside a text document which deserves
  1711. // special attention. Usually a document highlight is visualized by changing
  1712. // the background color of its range.
  1713. //
  1714. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentHighlight
  1715. type DocumentHighlight struct {
  1716. // The range this highlight applies to.
  1717. Range Range `json:"range"`
  1718. // The highlight kind, default is {@link DocumentHighlightKind.Text text}.
  1719. Kind DocumentHighlightKind `json:"kind,omitempty"`
  1720. }
  1721. // Client Capabilities for a {@link DocumentHighlightRequest}.
  1722. //
  1723. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentHighlightClientCapabilities
  1724. type DocumentHighlightClientCapabilities struct {
  1725. // Whether document highlight supports dynamic registration.
  1726. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1727. }
  1728. // A document highlight kind.
  1729. type DocumentHighlightKind uint32
  1730. // Provider options for a {@link DocumentHighlightRequest}.
  1731. //
  1732. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentHighlightOptions
  1733. type DocumentHighlightOptions struct {
  1734. WorkDoneProgressOptions
  1735. }
  1736. // Parameters for a {@link DocumentHighlightRequest}.
  1737. //
  1738. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentHighlightParams
  1739. type DocumentHighlightParams struct {
  1740. TextDocumentPositionParams
  1741. WorkDoneProgressParams
  1742. PartialResultParams
  1743. }
  1744. // Registration options for a {@link DocumentHighlightRequest}.
  1745. //
  1746. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentHighlightRegistrationOptions
  1747. type DocumentHighlightRegistrationOptions struct {
  1748. TextDocumentRegistrationOptions
  1749. DocumentHighlightOptions
  1750. }
  1751. // A document link is a range in a text document that links to an internal or external resource, like another
  1752. // text document or a web site.
  1753. //
  1754. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentLink
  1755. type DocumentLink struct {
  1756. // The range this link applies to.
  1757. Range Range `json:"range"`
  1758. // The uri this link points to. If missing a resolve request is sent later.
  1759. Target *URI `json:"target,omitempty"`
  1760. // The tooltip text when you hover over this link.
  1761. //
  1762. // If a tooltip is provided, is will be displayed in a string that includes instructions on how to
  1763. // trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
  1764. // user settings, and localization.
  1765. //
  1766. // @since 3.15.0
  1767. Tooltip string `json:"tooltip,omitempty"`
  1768. // A data entry field that is preserved on a document link between a
  1769. // DocumentLinkRequest and a DocumentLinkResolveRequest.
  1770. Data interface{} `json:"data,omitempty"`
  1771. }
  1772. // The client capabilities of a {@link DocumentLinkRequest}.
  1773. //
  1774. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentLinkClientCapabilities
  1775. type DocumentLinkClientCapabilities struct {
  1776. // Whether document link supports dynamic registration.
  1777. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1778. // Whether the client supports the `tooltip` property on `DocumentLink`.
  1779. //
  1780. // @since 3.15.0
  1781. TooltipSupport bool `json:"tooltipSupport,omitempty"`
  1782. }
  1783. // Provider options for a {@link DocumentLinkRequest}.
  1784. //
  1785. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentLinkOptions
  1786. type DocumentLinkOptions struct {
  1787. // Document links have a resolve provider as well.
  1788. ResolveProvider bool `json:"resolveProvider,omitempty"`
  1789. WorkDoneProgressOptions
  1790. }
  1791. // The parameters of a {@link DocumentLinkRequest}.
  1792. //
  1793. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentLinkParams
  1794. type DocumentLinkParams struct {
  1795. // The document to provide document links for.
  1796. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1797. WorkDoneProgressParams
  1798. PartialResultParams
  1799. }
  1800. // Registration options for a {@link DocumentLinkRequest}.
  1801. //
  1802. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentLinkRegistrationOptions
  1803. type DocumentLinkRegistrationOptions struct {
  1804. TextDocumentRegistrationOptions
  1805. DocumentLinkOptions
  1806. }
  1807. // Client capabilities of a {@link DocumentOnTypeFormattingRequest}.
  1808. //
  1809. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentOnTypeFormattingClientCapabilities
  1810. type DocumentOnTypeFormattingClientCapabilities struct {
  1811. // Whether on type formatting supports dynamic registration.
  1812. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1813. }
  1814. // Provider options for a {@link DocumentOnTypeFormattingRequest}.
  1815. //
  1816. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentOnTypeFormattingOptions
  1817. type DocumentOnTypeFormattingOptions struct {
  1818. // A character on which formatting should be triggered, like `{`.
  1819. FirstTriggerCharacter string `json:"firstTriggerCharacter"`
  1820. // More trigger characters.
  1821. MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"`
  1822. }
  1823. // The parameters of a {@link DocumentOnTypeFormattingRequest}.
  1824. //
  1825. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentOnTypeFormattingParams
  1826. type DocumentOnTypeFormattingParams struct {
  1827. // The document to format.
  1828. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1829. // The position around which the on type formatting should happen.
  1830. // This is not necessarily the exact position where the character denoted
  1831. // by the property `ch` got typed.
  1832. Position Position `json:"position"`
  1833. // The character that has been typed that triggered the formatting
  1834. // on type request. That is not necessarily the last character that
  1835. // got inserted into the document since the client could auto insert
  1836. // characters as well (e.g. like automatic brace completion).
  1837. Ch string `json:"ch"`
  1838. // The formatting options.
  1839. Options FormattingOptions `json:"options"`
  1840. }
  1841. // Registration options for a {@link DocumentOnTypeFormattingRequest}.
  1842. //
  1843. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentOnTypeFormattingRegistrationOptions
  1844. type DocumentOnTypeFormattingRegistrationOptions struct {
  1845. TextDocumentRegistrationOptions
  1846. DocumentOnTypeFormattingOptions
  1847. }
  1848. // Client capabilities of a {@link DocumentRangeFormattingRequest}.
  1849. //
  1850. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentRangeFormattingClientCapabilities
  1851. type DocumentRangeFormattingClientCapabilities struct {
  1852. // Whether range formatting supports dynamic registration.
  1853. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1854. // Whether the client supports formatting multiple ranges at once.
  1855. //
  1856. // @since 3.18.0
  1857. // @proposed
  1858. RangesSupport bool `json:"rangesSupport,omitempty"`
  1859. }
  1860. // Provider options for a {@link DocumentRangeFormattingRequest}.
  1861. //
  1862. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentRangeFormattingOptions
  1863. type DocumentRangeFormattingOptions struct {
  1864. // Whether the server supports formatting multiple ranges at once.
  1865. //
  1866. // @since 3.18.0
  1867. // @proposed
  1868. RangesSupport bool `json:"rangesSupport,omitempty"`
  1869. WorkDoneProgressOptions
  1870. }
  1871. // The parameters of a {@link DocumentRangeFormattingRequest}.
  1872. //
  1873. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentRangeFormattingParams
  1874. type DocumentRangeFormattingParams struct {
  1875. // The document to format.
  1876. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1877. // The range to format
  1878. Range Range `json:"range"`
  1879. // The format options
  1880. Options FormattingOptions `json:"options"`
  1881. WorkDoneProgressParams
  1882. }
  1883. // Registration options for a {@link DocumentRangeFormattingRequest}.
  1884. //
  1885. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentRangeFormattingRegistrationOptions
  1886. type DocumentRangeFormattingRegistrationOptions struct {
  1887. TextDocumentRegistrationOptions
  1888. DocumentRangeFormattingOptions
  1889. }
  1890. // The parameters of a {@link DocumentRangesFormattingRequest}.
  1891. //
  1892. // @since 3.18.0
  1893. // @proposed
  1894. //
  1895. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentRangesFormattingParams
  1896. type DocumentRangesFormattingParams struct {
  1897. // The document to format.
  1898. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1899. // The ranges to format
  1900. Ranges []Range `json:"ranges"`
  1901. // The format options
  1902. Options FormattingOptions `json:"options"`
  1903. WorkDoneProgressParams
  1904. }
  1905. // A document selector is the combination of one or many document filters.
  1906. //
  1907. // @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
  1908. //
  1909. // The use of a string as a document filter is deprecated @since 3.16.0.
  1910. //
  1911. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSelector
  1912. type DocumentSelector = []DocumentFilter // (alias)
  1913. // Represents programming constructs like variables, classes, interfaces etc.
  1914. // that appear in a document. Document symbols can be hierarchical and they
  1915. // have two ranges: one that encloses its definition and one that points to
  1916. // its most interesting range, e.g. the range of an identifier.
  1917. //
  1918. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSymbol
  1919. type DocumentSymbol struct {
  1920. // The name of this symbol. Will be displayed in the user interface and therefore must not be
  1921. // an empty string or a string only consisting of white spaces.
  1922. Name string `json:"name"`
  1923. // More detail for this symbol, e.g the signature of a function.
  1924. Detail string `json:"detail,omitempty"`
  1925. // The kind of this symbol.
  1926. Kind SymbolKind `json:"kind"`
  1927. // Tags for this document symbol.
  1928. //
  1929. // @since 3.16.0
  1930. Tags []SymbolTag `json:"tags,omitempty"`
  1931. // Indicates if this symbol is deprecated.
  1932. //
  1933. // @deprecated Use tags instead
  1934. Deprecated bool `json:"deprecated,omitempty"`
  1935. // The range enclosing this symbol not including leading/trailing whitespace but everything else
  1936. // like comments. This information is typically used to determine if the clients cursor is
  1937. // inside the symbol to reveal in the symbol in the UI.
  1938. Range Range `json:"range"`
  1939. // The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
  1940. // Must be contained by the `range`.
  1941. SelectionRange Range `json:"selectionRange"`
  1942. // Children of this symbol, e.g. properties of a class.
  1943. Children []DocumentSymbol `json:"children,omitempty"`
  1944. }
  1945. // Client Capabilities for a {@link DocumentSymbolRequest}.
  1946. //
  1947. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSymbolClientCapabilities
  1948. type DocumentSymbolClientCapabilities struct {
  1949. // Whether document symbol supports dynamic registration.
  1950. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  1951. // Specific capabilities for the `SymbolKind` in the
  1952. // `textDocument/documentSymbol` request.
  1953. SymbolKind *ClientSymbolKindOptions `json:"symbolKind,omitempty"`
  1954. // The client supports hierarchical document symbols.
  1955. HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
  1956. // The client supports tags on `SymbolInformation`. Tags are supported on
  1957. // `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.
  1958. // Clients supporting tags have to handle unknown tags gracefully.
  1959. //
  1960. // @since 3.16.0
  1961. TagSupport *ClientSymbolTagOptions `json:"tagSupport,omitempty"`
  1962. // The client supports an additional label presented in the UI when
  1963. // registering a document symbol provider.
  1964. //
  1965. // @since 3.16.0
  1966. LabelSupport bool `json:"labelSupport,omitempty"`
  1967. }
  1968. // Provider options for a {@link DocumentSymbolRequest}.
  1969. //
  1970. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSymbolOptions
  1971. type DocumentSymbolOptions struct {
  1972. // A human-readable string that is shown when multiple outlines trees
  1973. // are shown for the same document.
  1974. //
  1975. // @since 3.16.0
  1976. Label string `json:"label,omitempty"`
  1977. WorkDoneProgressOptions
  1978. }
  1979. // Parameters for a {@link DocumentSymbolRequest}.
  1980. //
  1981. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSymbolParams
  1982. type DocumentSymbolParams struct {
  1983. // The text document.
  1984. TextDocument TextDocumentIdentifier `json:"textDocument"`
  1985. WorkDoneProgressParams
  1986. PartialResultParams
  1987. }
  1988. // Registration options for a {@link DocumentSymbolRequest}.
  1989. //
  1990. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#documentSymbolRegistrationOptions
  1991. type DocumentSymbolRegistrationOptions struct {
  1992. TextDocumentRegistrationOptions
  1993. DocumentSymbolOptions
  1994. }
  1995. // Edit range variant that includes ranges for insert and replace operations.
  1996. //
  1997. // @since 3.18.0
  1998. //
  1999. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#editRangeWithInsertReplace
  2000. type EditRangeWithInsertReplace struct {
  2001. Insert Range `json:"insert"`
  2002. Replace Range `json:"replace"`
  2003. }
  2004. // Predefined error codes.
  2005. type ErrorCodes int32
  2006. // The client capabilities of a {@link ExecuteCommandRequest}.
  2007. //
  2008. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#executeCommandClientCapabilities
  2009. type ExecuteCommandClientCapabilities struct {
  2010. // Execute command supports dynamic registration.
  2011. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2012. }
  2013. // The server capabilities of a {@link ExecuteCommandRequest}.
  2014. //
  2015. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#executeCommandOptions
  2016. type ExecuteCommandOptions struct {
  2017. // The commands to be executed on the server
  2018. Commands []string `json:"commands"`
  2019. WorkDoneProgressOptions
  2020. }
  2021. // The parameters of a {@link ExecuteCommandRequest}.
  2022. //
  2023. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#executeCommandParams
  2024. type ExecuteCommandParams struct {
  2025. // The identifier of the actual command handler.
  2026. Command string `json:"command"`
  2027. // Arguments that the command should be invoked with.
  2028. Arguments []json.RawMessage `json:"arguments,omitempty"`
  2029. WorkDoneProgressParams
  2030. }
  2031. // Registration options for a {@link ExecuteCommandRequest}.
  2032. //
  2033. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#executeCommandRegistrationOptions
  2034. type ExecuteCommandRegistrationOptions struct {
  2035. ExecuteCommandOptions
  2036. }
  2037. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#executionSummary
  2038. type ExecutionSummary struct {
  2039. // A strict monotonically increasing value
  2040. // indicating the execution order of a cell
  2041. // inside a notebook.
  2042. ExecutionOrder uint32 `json:"executionOrder"`
  2043. // Whether the execution was successful or
  2044. // not if known by the client.
  2045. Success bool `json:"success,omitempty"`
  2046. }
  2047. type FailureHandlingKind string
  2048. // The file event type
  2049. type FileChangeType uint32
  2050. // Represents information on a file/folder create.
  2051. //
  2052. // @since 3.16.0
  2053. //
  2054. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileCreate
  2055. type FileCreate struct {
  2056. // A file:// URI for the location of the file/folder being created.
  2057. URI string `json:"uri"`
  2058. }
  2059. // Represents information on a file/folder delete.
  2060. //
  2061. // @since 3.16.0
  2062. //
  2063. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileDelete
  2064. type FileDelete struct {
  2065. // A file:// URI for the location of the file/folder being deleted.
  2066. URI string `json:"uri"`
  2067. }
  2068. // An event describing a file change.
  2069. //
  2070. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileEvent
  2071. type FileEvent struct {
  2072. // The file's uri.
  2073. URI DocumentUri `json:"uri"`
  2074. // The change type.
  2075. Type FileChangeType `json:"type"`
  2076. }
  2077. // Capabilities relating to events from file operations by the user in the client.
  2078. //
  2079. // These events do not come from the file system, they come from user operations
  2080. // like renaming a file in the UI.
  2081. //
  2082. // @since 3.16.0
  2083. //
  2084. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationClientCapabilities
  2085. type FileOperationClientCapabilities struct {
  2086. // Whether the client supports dynamic registration for file requests/notifications.
  2087. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2088. // The client has support for sending didCreateFiles notifications.
  2089. DidCreate bool `json:"didCreate,omitempty"`
  2090. // The client has support for sending willCreateFiles requests.
  2091. WillCreate bool `json:"willCreate,omitempty"`
  2092. // The client has support for sending didRenameFiles notifications.
  2093. DidRename bool `json:"didRename,omitempty"`
  2094. // The client has support for sending willRenameFiles requests.
  2095. WillRename bool `json:"willRename,omitempty"`
  2096. // The client has support for sending didDeleteFiles notifications.
  2097. DidDelete bool `json:"didDelete,omitempty"`
  2098. // The client has support for sending willDeleteFiles requests.
  2099. WillDelete bool `json:"willDelete,omitempty"`
  2100. }
  2101. // A filter to describe in which file operation requests or notifications
  2102. // the server is interested in receiving.
  2103. //
  2104. // @since 3.16.0
  2105. //
  2106. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationFilter
  2107. type FileOperationFilter struct {
  2108. // A Uri scheme like `file` or `untitled`.
  2109. Scheme string `json:"scheme,omitempty"`
  2110. // The actual file operation pattern.
  2111. Pattern FileOperationPattern `json:"pattern"`
  2112. }
  2113. // Options for notifications/requests for user operations on files.
  2114. //
  2115. // @since 3.16.0
  2116. //
  2117. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationOptions
  2118. type FileOperationOptions struct {
  2119. // The server is interested in receiving didCreateFiles notifications.
  2120. DidCreate *FileOperationRegistrationOptions `json:"didCreate,omitempty"`
  2121. // The server is interested in receiving willCreateFiles requests.
  2122. WillCreate *FileOperationRegistrationOptions `json:"willCreate,omitempty"`
  2123. // The server is interested in receiving didRenameFiles notifications.
  2124. DidRename *FileOperationRegistrationOptions `json:"didRename,omitempty"`
  2125. // The server is interested in receiving willRenameFiles requests.
  2126. WillRename *FileOperationRegistrationOptions `json:"willRename,omitempty"`
  2127. // The server is interested in receiving didDeleteFiles file notifications.
  2128. DidDelete *FileOperationRegistrationOptions `json:"didDelete,omitempty"`
  2129. // The server is interested in receiving willDeleteFiles file requests.
  2130. WillDelete *FileOperationRegistrationOptions `json:"willDelete,omitempty"`
  2131. }
  2132. // A pattern to describe in which file operation requests or notifications
  2133. // the server is interested in receiving.
  2134. //
  2135. // @since 3.16.0
  2136. //
  2137. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationPattern
  2138. type FileOperationPattern struct {
  2139. // The glob pattern to match. Glob patterns can have the following syntax:
  2140. //
  2141. // - `*` to match one or more characters in a path segment
  2142. // - `?` to match on one character in a path segment
  2143. // - `**` to match any number of path segments, including none
  2144. // - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
  2145. // - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
  2146. // - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
  2147. Glob string `json:"glob"`
  2148. // Whether to match files or folders with this pattern.
  2149. //
  2150. // Matches both if undefined.
  2151. Matches *FileOperationPatternKind `json:"matches,omitempty"`
  2152. // Additional options used during matching.
  2153. Options *FileOperationPatternOptions `json:"options,omitempty"`
  2154. }
  2155. // A pattern kind describing if a glob pattern matches a file a folder or
  2156. // both.
  2157. //
  2158. // @since 3.16.0
  2159. type FileOperationPatternKind string
  2160. // Matching options for the file operation pattern.
  2161. //
  2162. // @since 3.16.0
  2163. //
  2164. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationPatternOptions
  2165. type FileOperationPatternOptions struct {
  2166. // The pattern should be matched ignoring casing.
  2167. IgnoreCase bool `json:"ignoreCase,omitempty"`
  2168. }
  2169. // The options to register for file operations.
  2170. //
  2171. // @since 3.16.0
  2172. //
  2173. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileOperationRegistrationOptions
  2174. type FileOperationRegistrationOptions struct {
  2175. // The actual filters.
  2176. Filters []FileOperationFilter `json:"filters"`
  2177. }
  2178. // Represents information on a file/folder rename.
  2179. //
  2180. // @since 3.16.0
  2181. //
  2182. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileRename
  2183. type FileRename struct {
  2184. // A file:// URI for the original location of the file/folder being renamed.
  2185. OldURI string `json:"oldUri"`
  2186. // A file:// URI for the new location of the file/folder being renamed.
  2187. NewURI string `json:"newUri"`
  2188. }
  2189. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fileSystemWatcher
  2190. type FileSystemWatcher struct {
  2191. // The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail.
  2192. //
  2193. // @since 3.17.0 support for relative patterns.
  2194. GlobPattern GlobPattern `json:"globPattern"`
  2195. // The kind of events of interest. If omitted it defaults
  2196. // to WatchKind.Create | WatchKind.Change | WatchKind.Delete
  2197. // which is 7.
  2198. Kind *WatchKind `json:"kind,omitempty"`
  2199. }
  2200. // Represents a folding range. To be valid, start and end line must be bigger than zero and smaller
  2201. // than the number of lines in the document. Clients are free to ignore invalid ranges.
  2202. //
  2203. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRange
  2204. type FoldingRange struct {
  2205. // The zero-based start line of the range to fold. The folded area starts after the line's last character.
  2206. // To be valid, the end must be zero or larger and smaller than the number of lines in the document.
  2207. StartLine uint32 `json:"startLine"`
  2208. // The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
  2209. StartCharacter uint32 `json:"startCharacter,omitempty"`
  2210. // The zero-based end line of the range to fold. The folded area ends with the line's last character.
  2211. // To be valid, the end must be zero or larger and smaller than the number of lines in the document.
  2212. EndLine uint32 `json:"endLine"`
  2213. // The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
  2214. EndCharacter uint32 `json:"endCharacter,omitempty"`
  2215. // Describes the kind of the folding range such as 'comment' or 'region'. The kind
  2216. // is used to categorize folding ranges and used by commands like 'Fold all comments'.
  2217. // See {@link FoldingRangeKind} for an enumeration of standardized kinds.
  2218. Kind string `json:"kind,omitempty"`
  2219. // The text that the client should show when the specified range is
  2220. // collapsed. If not defined or not supported by the client, a default
  2221. // will be chosen by the client.
  2222. //
  2223. // @since 3.17.0
  2224. CollapsedText string `json:"collapsedText,omitempty"`
  2225. }
  2226. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRangeClientCapabilities
  2227. type FoldingRangeClientCapabilities struct {
  2228. // Whether implementation supports dynamic registration for folding range
  2229. // providers. If this is set to `true` the client supports the new
  2230. // `FoldingRangeRegistrationOptions` return value for the corresponding
  2231. // server capability as well.
  2232. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2233. // The maximum number of folding ranges that the client prefers to receive
  2234. // per document. The value serves as a hint, servers are free to follow the
  2235. // limit.
  2236. RangeLimit uint32 `json:"rangeLimit,omitempty"`
  2237. // If set, the client signals that it only supports folding complete lines.
  2238. // If set, client will ignore specified `startCharacter` and `endCharacter`
  2239. // properties in a FoldingRange.
  2240. LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"`
  2241. // Specific options for the folding range kind.
  2242. //
  2243. // @since 3.17.0
  2244. FoldingRangeKind *ClientFoldingRangeKindOptions `json:"foldingRangeKind,omitempty"`
  2245. // Specific options for the folding range.
  2246. //
  2247. // @since 3.17.0
  2248. FoldingRange *ClientFoldingRangeOptions `json:"foldingRange,omitempty"`
  2249. }
  2250. // A set of predefined range kinds.
  2251. type FoldingRangeKind string
  2252. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRangeOptions
  2253. type FoldingRangeOptions struct {
  2254. WorkDoneProgressOptions
  2255. }
  2256. // Parameters for a {@link FoldingRangeRequest}.
  2257. //
  2258. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRangeParams
  2259. type FoldingRangeParams struct {
  2260. // The text document.
  2261. TextDocument TextDocumentIdentifier `json:"textDocument"`
  2262. WorkDoneProgressParams
  2263. PartialResultParams
  2264. }
  2265. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRangeRegistrationOptions
  2266. type FoldingRangeRegistrationOptions struct {
  2267. TextDocumentRegistrationOptions
  2268. FoldingRangeOptions
  2269. StaticRegistrationOptions
  2270. }
  2271. // Client workspace capabilities specific to folding ranges
  2272. //
  2273. // @since 3.18.0
  2274. // @proposed
  2275. //
  2276. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#foldingRangeWorkspaceClientCapabilities
  2277. type FoldingRangeWorkspaceClientCapabilities struct {
  2278. // Whether the client implementation supports a refresh request sent from the
  2279. // server to the client.
  2280. //
  2281. // Note that this event is global and will force the client to refresh all
  2282. // folding ranges currently shown. It should be used with absolute care and is
  2283. // useful for situation where a server for example detects a project wide
  2284. // change that requires such a calculation.
  2285. //
  2286. // @since 3.18.0
  2287. // @proposed
  2288. RefreshSupport bool `json:"refreshSupport,omitempty"`
  2289. }
  2290. // Value-object describing what options formatting should use.
  2291. //
  2292. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#formattingOptions
  2293. type FormattingOptions struct {
  2294. // Size of a tab in spaces.
  2295. TabSize uint32 `json:"tabSize"`
  2296. // Prefer spaces over tabs.
  2297. InsertSpaces bool `json:"insertSpaces"`
  2298. // Trim trailing whitespace on a line.
  2299. //
  2300. // @since 3.15.0
  2301. TrimTrailingWhitespace bool `json:"trimTrailingWhitespace,omitempty"`
  2302. // Insert a newline character at the end of the file if one does not exist.
  2303. //
  2304. // @since 3.15.0
  2305. InsertFinalNewline bool `json:"insertFinalNewline,omitempty"`
  2306. // Trim all newlines after the final newline at the end of the file.
  2307. //
  2308. // @since 3.15.0
  2309. TrimFinalNewlines bool `json:"trimFinalNewlines,omitempty"`
  2310. }
  2311. // A diagnostic report with a full set of problems.
  2312. //
  2313. // @since 3.17.0
  2314. //
  2315. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#fullDocumentDiagnosticReport
  2316. type FullDocumentDiagnosticReport struct {
  2317. // A full document diagnostic report.
  2318. Kind string `json:"kind"`
  2319. // An optional result id. If provided it will
  2320. // be sent on the next diagnostic request for the
  2321. // same document.
  2322. ResultID string `json:"resultId,omitempty"`
  2323. // The actual items.
  2324. Items []Diagnostic `json:"items"`
  2325. }
  2326. // General client capabilities.
  2327. //
  2328. // @since 3.16.0
  2329. //
  2330. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#generalClientCapabilities
  2331. type GeneralClientCapabilities struct {
  2332. // Client capability that signals how the client
  2333. // handles stale requests (e.g. a request
  2334. // for which the client will not process the response
  2335. // anymore since the information is outdated).
  2336. //
  2337. // @since 3.17.0
  2338. StaleRequestSupport *StaleRequestSupportOptions `json:"staleRequestSupport,omitempty"`
  2339. // Client capabilities specific to regular expressions.
  2340. //
  2341. // @since 3.16.0
  2342. RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitempty"`
  2343. // Client capabilities specific to the client's markdown parser.
  2344. //
  2345. // @since 3.16.0
  2346. Markdown *MarkdownClientCapabilities `json:"markdown,omitempty"`
  2347. // The position encodings supported by the client. Client and server
  2348. // have to agree on the same position encoding to ensure that offsets
  2349. // (e.g. character position in a line) are interpreted the same on both
  2350. // sides.
  2351. //
  2352. // To keep the protocol backwards compatible the following applies: if
  2353. // the value 'utf-16' is missing from the array of position encodings
  2354. // servers can assume that the client supports UTF-16. UTF-16 is
  2355. // therefore a mandatory encoding.
  2356. //
  2357. // If omitted it defaults to ['utf-16'].
  2358. //
  2359. // Implementation considerations: since the conversion from one encoding
  2360. // into another requires the content of the file / line the conversion
  2361. // is best done where the file is read which is usually on the server
  2362. // side.
  2363. //
  2364. // @since 3.17.0
  2365. PositionEncodings []PositionEncodingKind `json:"positionEncodings,omitempty"`
  2366. }
  2367. // The glob pattern. Either a string pattern or a relative pattern.
  2368. //
  2369. // @since 3.17.0
  2370. //
  2371. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#globPattern
  2372. type GlobPattern = Or_GlobPattern // (alias)
  2373. // The result of a hover request.
  2374. //
  2375. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#hover
  2376. type Hover struct {
  2377. // The hover's content
  2378. Contents MarkupContent `json:"contents"`
  2379. // An optional range inside the text document that is used to
  2380. // visualize the hover, e.g. by changing the background color.
  2381. Range Range `json:"range,omitempty"`
  2382. }
  2383. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#hoverClientCapabilities
  2384. type HoverClientCapabilities struct {
  2385. // Whether hover supports dynamic registration.
  2386. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2387. // Client supports the following content formats for the content
  2388. // property. The order describes the preferred format of the client.
  2389. ContentFormat []MarkupKind `json:"contentFormat,omitempty"`
  2390. }
  2391. // Hover options.
  2392. //
  2393. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#hoverOptions
  2394. type HoverOptions struct {
  2395. WorkDoneProgressOptions
  2396. }
  2397. // Parameters for a {@link HoverRequest}.
  2398. //
  2399. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#hoverParams
  2400. type HoverParams struct {
  2401. TextDocumentPositionParams
  2402. WorkDoneProgressParams
  2403. }
  2404. // Registration options for a {@link HoverRequest}.
  2405. //
  2406. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#hoverRegistrationOptions
  2407. type HoverRegistrationOptions struct {
  2408. TextDocumentRegistrationOptions
  2409. HoverOptions
  2410. }
  2411. // @since 3.6.0
  2412. //
  2413. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#implementationClientCapabilities
  2414. type ImplementationClientCapabilities struct {
  2415. // Whether implementation supports dynamic registration. If this is set to `true`
  2416. // the client supports the new `ImplementationRegistrationOptions` return value
  2417. // for the corresponding server capability as well.
  2418. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2419. // The client supports additional metadata in the form of definition links.
  2420. //
  2421. // @since 3.14.0
  2422. LinkSupport bool `json:"linkSupport,omitempty"`
  2423. }
  2424. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#implementationOptions
  2425. type ImplementationOptions struct {
  2426. WorkDoneProgressOptions
  2427. }
  2428. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#implementationParams
  2429. type ImplementationParams struct {
  2430. TextDocumentPositionParams
  2431. WorkDoneProgressParams
  2432. PartialResultParams
  2433. }
  2434. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#implementationRegistrationOptions
  2435. type ImplementationRegistrationOptions struct {
  2436. TextDocumentRegistrationOptions
  2437. ImplementationOptions
  2438. StaticRegistrationOptions
  2439. }
  2440. // The data type of the ResponseError if the
  2441. // initialize request fails.
  2442. //
  2443. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#initializeError
  2444. type InitializeError struct {
  2445. // Indicates whether the client execute the following retry logic:
  2446. // (1) show the message provided by the ResponseError to the user
  2447. // (2) user selects retry or cancel
  2448. // (3) if user selected retry the initialize method is sent again.
  2449. Retry bool `json:"retry"`
  2450. }
  2451. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#initializeParams
  2452. type InitializeParams struct {
  2453. XInitializeParams
  2454. WorkspaceFoldersInitializeParams
  2455. }
  2456. // The result returned from an initialize request.
  2457. //
  2458. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#initializeResult
  2459. type InitializeResult struct {
  2460. // The capabilities the language server provides.
  2461. Capabilities ServerCapabilities `json:"capabilities"`
  2462. // Information about the server.
  2463. //
  2464. // @since 3.15.0
  2465. ServerInfo *ServerInfo `json:"serverInfo,omitempty"`
  2466. }
  2467. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#initializedParams
  2468. type InitializedParams struct {
  2469. }
  2470. // Inlay hint information.
  2471. //
  2472. // @since 3.17.0
  2473. //
  2474. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHint
  2475. type InlayHint struct {
  2476. // The position of this hint.
  2477. //
  2478. // If multiple hints have the same position, they will be shown in the order
  2479. // they appear in the response.
  2480. Position Position `json:"position"`
  2481. // The label of this hint. A human readable string or an array of
  2482. // InlayHintLabelPart label parts.
  2483. //
  2484. // *Note* that neither the string nor the label part can be empty.
  2485. Label []InlayHintLabelPart `json:"label"`
  2486. // The kind of this hint. Can be omitted in which case the client
  2487. // should fall back to a reasonable default.
  2488. Kind InlayHintKind `json:"kind,omitempty"`
  2489. // Optional text edits that are performed when accepting this inlay hint.
  2490. //
  2491. // *Note* that edits are expected to change the document so that the inlay
  2492. // hint (or its nearest variant) is now part of the document and the inlay
  2493. // hint itself is now obsolete.
  2494. TextEdits []TextEdit `json:"textEdits,omitempty"`
  2495. // The tooltip text when you hover over this item.
  2496. Tooltip *Or_InlayHint_tooltip `json:"tooltip,omitempty"`
  2497. // Render padding before the hint.
  2498. //
  2499. // Note: Padding should use the editor's background color, not the
  2500. // background color of the hint itself. That means padding can be used
  2501. // to visually align/separate an inlay hint.
  2502. PaddingLeft bool `json:"paddingLeft,omitempty"`
  2503. // Render padding after the hint.
  2504. //
  2505. // Note: Padding should use the editor's background color, not the
  2506. // background color of the hint itself. That means padding can be used
  2507. // to visually align/separate an inlay hint.
  2508. PaddingRight bool `json:"paddingRight,omitempty"`
  2509. // A data entry field that is preserved on an inlay hint between
  2510. // a `textDocument/inlayHint` and a `inlayHint/resolve` request.
  2511. Data interface{} `json:"data,omitempty"`
  2512. }
  2513. // Inlay hint client capabilities.
  2514. //
  2515. // @since 3.17.0
  2516. //
  2517. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintClientCapabilities
  2518. type InlayHintClientCapabilities struct {
  2519. // Whether inlay hints support dynamic registration.
  2520. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2521. // Indicates which properties a client can resolve lazily on an inlay
  2522. // hint.
  2523. ResolveSupport *ClientInlayHintResolveOptions `json:"resolveSupport,omitempty"`
  2524. }
  2525. // Inlay hint kinds.
  2526. //
  2527. // @since 3.17.0
  2528. type InlayHintKind uint32
  2529. // An inlay hint label part allows for interactive and composite labels
  2530. // of inlay hints.
  2531. //
  2532. // @since 3.17.0
  2533. //
  2534. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintLabelPart
  2535. type InlayHintLabelPart struct {
  2536. // The value of this label part.
  2537. Value string `json:"value"`
  2538. // The tooltip text when you hover over this label part. Depending on
  2539. // the client capability `inlayHint.resolveSupport` clients might resolve
  2540. // this property late using the resolve request.
  2541. Tooltip *Or_InlayHintLabelPart_tooltip `json:"tooltip,omitempty"`
  2542. // An optional source code location that represents this
  2543. // label part.
  2544. //
  2545. // The editor will use this location for the hover and for code navigation
  2546. // features: This part will become a clickable link that resolves to the
  2547. // definition of the symbol at the given location (not necessarily the
  2548. // location itself), it shows the hover that shows at the given location,
  2549. // and it shows a context menu with further code navigation commands.
  2550. //
  2551. // Depending on the client capability `inlayHint.resolveSupport` clients
  2552. // might resolve this property late using the resolve request.
  2553. Location *Location `json:"location,omitempty"`
  2554. // An optional command for this label part.
  2555. //
  2556. // Depending on the client capability `inlayHint.resolveSupport` clients
  2557. // might resolve this property late using the resolve request.
  2558. Command *Command `json:"command,omitempty"`
  2559. }
  2560. // Inlay hint options used during static registration.
  2561. //
  2562. // @since 3.17.0
  2563. //
  2564. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintOptions
  2565. type InlayHintOptions struct {
  2566. // The server provides support to resolve additional
  2567. // information for an inlay hint item.
  2568. ResolveProvider bool `json:"resolveProvider,omitempty"`
  2569. WorkDoneProgressOptions
  2570. }
  2571. // A parameter literal used in inlay hint requests.
  2572. //
  2573. // @since 3.17.0
  2574. //
  2575. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintParams
  2576. type InlayHintParams struct {
  2577. // The text document.
  2578. TextDocument TextDocumentIdentifier `json:"textDocument"`
  2579. // The document range for which inlay hints should be computed.
  2580. Range Range `json:"range"`
  2581. WorkDoneProgressParams
  2582. }
  2583. // Inlay hint options used during static or dynamic registration.
  2584. //
  2585. // @since 3.17.0
  2586. //
  2587. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintRegistrationOptions
  2588. type InlayHintRegistrationOptions struct {
  2589. InlayHintOptions
  2590. TextDocumentRegistrationOptions
  2591. StaticRegistrationOptions
  2592. }
  2593. // Client workspace capabilities specific to inlay hints.
  2594. //
  2595. // @since 3.17.0
  2596. //
  2597. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlayHintWorkspaceClientCapabilities
  2598. type InlayHintWorkspaceClientCapabilities struct {
  2599. // Whether the client implementation supports a refresh request sent from
  2600. // the server to the client.
  2601. //
  2602. // Note that this event is global and will force the client to refresh all
  2603. // inlay hints currently shown. It should be used with absolute care and
  2604. // is useful for situation where a server for example detects a project wide
  2605. // change that requires such a calculation.
  2606. RefreshSupport bool `json:"refreshSupport,omitempty"`
  2607. }
  2608. // Client capabilities specific to inline completions.
  2609. //
  2610. // @since 3.18.0
  2611. // @proposed
  2612. //
  2613. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionClientCapabilities
  2614. type InlineCompletionClientCapabilities struct {
  2615. // Whether implementation supports dynamic registration for inline completion providers.
  2616. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2617. }
  2618. // Provides information about the context in which an inline completion was requested.
  2619. //
  2620. // @since 3.18.0
  2621. // @proposed
  2622. //
  2623. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionContext
  2624. type InlineCompletionContext struct {
  2625. // Describes how the inline completion was triggered.
  2626. TriggerKind InlineCompletionTriggerKind `json:"triggerKind"`
  2627. // Provides information about the currently selected item in the autocomplete widget if it is visible.
  2628. SelectedCompletionInfo *SelectedCompletionInfo `json:"selectedCompletionInfo,omitempty"`
  2629. }
  2630. // An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
  2631. //
  2632. // @since 3.18.0
  2633. // @proposed
  2634. //
  2635. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionItem
  2636. type InlineCompletionItem struct {
  2637. // The text to replace the range with. Must be set.
  2638. InsertText Or_InlineCompletionItem_insertText `json:"insertText"`
  2639. // A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used.
  2640. FilterText string `json:"filterText,omitempty"`
  2641. // The range to replace. Must begin and end on the same line.
  2642. Range *Range `json:"range,omitempty"`
  2643. // An optional {@link Command} that is executed *after* inserting this completion.
  2644. Command *Command `json:"command,omitempty"`
  2645. }
  2646. // Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.
  2647. //
  2648. // @since 3.18.0
  2649. // @proposed
  2650. //
  2651. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionList
  2652. type InlineCompletionList struct {
  2653. // The inline completion items
  2654. Items []InlineCompletionItem `json:"items"`
  2655. }
  2656. // Inline completion options used during static registration.
  2657. //
  2658. // @since 3.18.0
  2659. // @proposed
  2660. //
  2661. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionOptions
  2662. type InlineCompletionOptions struct {
  2663. WorkDoneProgressOptions
  2664. }
  2665. // A parameter literal used in inline completion requests.
  2666. //
  2667. // @since 3.18.0
  2668. // @proposed
  2669. //
  2670. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionParams
  2671. type InlineCompletionParams struct {
  2672. // Additional information about the context in which inline completions were
  2673. // requested.
  2674. Context InlineCompletionContext `json:"context"`
  2675. TextDocumentPositionParams
  2676. WorkDoneProgressParams
  2677. }
  2678. // Inline completion options used during static or dynamic registration.
  2679. //
  2680. // @since 3.18.0
  2681. // @proposed
  2682. //
  2683. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineCompletionRegistrationOptions
  2684. type InlineCompletionRegistrationOptions struct {
  2685. InlineCompletionOptions
  2686. TextDocumentRegistrationOptions
  2687. StaticRegistrationOptions
  2688. }
  2689. // Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
  2690. //
  2691. // @since 3.18.0
  2692. // @proposed
  2693. type InlineCompletionTriggerKind uint32
  2694. // Inline value information can be provided by different means:
  2695. //
  2696. // - directly as a text value (class InlineValueText).
  2697. // - as a name to use for a variable lookup (class InlineValueVariableLookup)
  2698. // - as an evaluatable expression (class InlineValueEvaluatableExpression)
  2699. //
  2700. // The InlineValue types combines all inline value types into one type.
  2701. //
  2702. // @since 3.17.0
  2703. //
  2704. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValue
  2705. type InlineValue = Or_InlineValue // (alias)
  2706. // Client capabilities specific to inline values.
  2707. //
  2708. // @since 3.17.0
  2709. //
  2710. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueClientCapabilities
  2711. type InlineValueClientCapabilities struct {
  2712. // Whether implementation supports dynamic registration for inline value providers.
  2713. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2714. }
  2715. // @since 3.17.0
  2716. //
  2717. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueContext
  2718. type InlineValueContext struct {
  2719. // The stack frame (as a DAP Id) where the execution has stopped.
  2720. FrameID int32 `json:"frameId"`
  2721. // The document range where execution has stopped.
  2722. // Typically the end position of the range denotes the line where the inline values are shown.
  2723. StoppedLocation Range `json:"stoppedLocation"`
  2724. }
  2725. // Provide an inline value through an expression evaluation.
  2726. // If only a range is specified, the expression will be extracted from the underlying document.
  2727. // An optional expression can be used to override the extracted expression.
  2728. //
  2729. // @since 3.17.0
  2730. //
  2731. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueEvaluatableExpression
  2732. type InlineValueEvaluatableExpression struct {
  2733. // The document range for which the inline value applies.
  2734. // The range is used to extract the evaluatable expression from the underlying document.
  2735. Range Range `json:"range"`
  2736. // If specified the expression overrides the extracted expression.
  2737. Expression string `json:"expression,omitempty"`
  2738. }
  2739. // Inline value options used during static registration.
  2740. //
  2741. // @since 3.17.0
  2742. //
  2743. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueOptions
  2744. type InlineValueOptions struct {
  2745. WorkDoneProgressOptions
  2746. }
  2747. // A parameter literal used in inline value requests.
  2748. //
  2749. // @since 3.17.0
  2750. //
  2751. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueParams
  2752. type InlineValueParams struct {
  2753. // The text document.
  2754. TextDocument TextDocumentIdentifier `json:"textDocument"`
  2755. // The document range for which inline values should be computed.
  2756. Range Range `json:"range"`
  2757. // Additional information about the context in which inline values were
  2758. // requested.
  2759. Context InlineValueContext `json:"context"`
  2760. WorkDoneProgressParams
  2761. }
  2762. // Inline value options used during static or dynamic registration.
  2763. //
  2764. // @since 3.17.0
  2765. //
  2766. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueRegistrationOptions
  2767. type InlineValueRegistrationOptions struct {
  2768. InlineValueOptions
  2769. TextDocumentRegistrationOptions
  2770. StaticRegistrationOptions
  2771. }
  2772. // Provide inline value as text.
  2773. //
  2774. // @since 3.17.0
  2775. //
  2776. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueText
  2777. type InlineValueText struct {
  2778. // The document range for which the inline value applies.
  2779. Range Range `json:"range"`
  2780. // The text of the inline value.
  2781. Text string `json:"text"`
  2782. }
  2783. // Provide inline value through a variable lookup.
  2784. // If only a range is specified, the variable name will be extracted from the underlying document.
  2785. // An optional variable name can be used to override the extracted name.
  2786. //
  2787. // @since 3.17.0
  2788. //
  2789. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueVariableLookup
  2790. type InlineValueVariableLookup struct {
  2791. // The document range for which the inline value applies.
  2792. // The range is used to extract the variable name from the underlying document.
  2793. Range Range `json:"range"`
  2794. // If specified the name of the variable to look up.
  2795. VariableName string `json:"variableName,omitempty"`
  2796. // How to perform the lookup.
  2797. CaseSensitiveLookup bool `json:"caseSensitiveLookup"`
  2798. }
  2799. // Client workspace capabilities specific to inline values.
  2800. //
  2801. // @since 3.17.0
  2802. //
  2803. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#inlineValueWorkspaceClientCapabilities
  2804. type InlineValueWorkspaceClientCapabilities struct {
  2805. // Whether the client implementation supports a refresh request sent from the
  2806. // server to the client.
  2807. //
  2808. // Note that this event is global and will force the client to refresh all
  2809. // inline values currently shown. It should be used with absolute care and is
  2810. // useful for situation where a server for example detects a project wide
  2811. // change that requires such a calculation.
  2812. RefreshSupport bool `json:"refreshSupport,omitempty"`
  2813. }
  2814. // A special text edit to provide an insert and a replace operation.
  2815. //
  2816. // @since 3.16.0
  2817. //
  2818. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#insertReplaceEdit
  2819. type InsertReplaceEdit struct {
  2820. // The string to be inserted.
  2821. NewText string `json:"newText"`
  2822. // The range if the insert is requested
  2823. Insert Range `json:"insert"`
  2824. // The range if the replace is requested.
  2825. Replace Range `json:"replace"`
  2826. }
  2827. // Defines whether the insert text in a completion item should be interpreted as
  2828. // plain text or a snippet.
  2829. type InsertTextFormat uint32
  2830. // How whitespace and indentation is handled during completion
  2831. // item insertion.
  2832. //
  2833. // @since 3.16.0
  2834. type InsertTextMode uint32
  2835. type LSPAny = interface{}
  2836. // LSP arrays.
  2837. // @since 3.17.0
  2838. //
  2839. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#lSPArray
  2840. type LSPArray = []interface{} // (alias)
  2841. type LSPErrorCodes int32
  2842. // LSP object definition.
  2843. // @since 3.17.0
  2844. //
  2845. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#lSPObject
  2846. type LSPObject = map[string]LSPAny // (alias)
  2847. // Predefined Language kinds
  2848. // @since 3.18.0
  2849. // @proposed
  2850. type LanguageKind string
  2851. // Client capabilities for the linked editing range request.
  2852. //
  2853. // @since 3.16.0
  2854. //
  2855. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#linkedEditingRangeClientCapabilities
  2856. type LinkedEditingRangeClientCapabilities struct {
  2857. // Whether implementation supports dynamic registration. If this is set to `true`
  2858. // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  2859. // return value for the corresponding server capability as well.
  2860. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  2861. }
  2862. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#linkedEditingRangeOptions
  2863. type LinkedEditingRangeOptions struct {
  2864. WorkDoneProgressOptions
  2865. }
  2866. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#linkedEditingRangeParams
  2867. type LinkedEditingRangeParams struct {
  2868. TextDocumentPositionParams
  2869. WorkDoneProgressParams
  2870. }
  2871. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#linkedEditingRangeRegistrationOptions
  2872. type LinkedEditingRangeRegistrationOptions struct {
  2873. TextDocumentRegistrationOptions
  2874. LinkedEditingRangeOptions
  2875. StaticRegistrationOptions
  2876. }
  2877. // The result of a linked editing range request.
  2878. //
  2879. // @since 3.16.0
  2880. //
  2881. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#linkedEditingRanges
  2882. type LinkedEditingRanges struct {
  2883. // A list of ranges that can be edited together. The ranges must have
  2884. // identical length and contain identical text content. The ranges cannot overlap.
  2885. Ranges []Range `json:"ranges"`
  2886. // An optional word pattern (regular expression) that describes valid contents for
  2887. // the given ranges. If no pattern is provided, the client configuration's word
  2888. // pattern will be used.
  2889. WordPattern string `json:"wordPattern,omitempty"`
  2890. }
  2891. // created for Literal (Lit_ClientSemanticTokensRequestOptions_range_Item1)
  2892. type Lit_ClientSemanticTokensRequestOptions_range_Item1 struct {
  2893. }
  2894. // created for Literal (Lit_SemanticTokensOptions_range_Item1)
  2895. type Lit_SemanticTokensOptions_range_Item1 struct {
  2896. }
  2897. // Represents a location inside a resource, such as a line
  2898. // inside a text file.
  2899. //
  2900. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#location
  2901. type Location struct {
  2902. URI DocumentUri `json:"uri"`
  2903. Range Range `json:"range"`
  2904. }
  2905. // Represents the connection of two locations. Provides additional metadata over normal {@link Location locations},
  2906. // including an origin range.
  2907. //
  2908. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#locationLink
  2909. type LocationLink struct {
  2910. // Span of the origin of this link.
  2911. //
  2912. // Used as the underlined span for mouse interaction. Defaults to the word range at
  2913. // the definition position.
  2914. OriginSelectionRange *Range `json:"originSelectionRange,omitempty"`
  2915. // The target resource identifier of this link.
  2916. TargetURI DocumentUri `json:"targetUri"`
  2917. // The full target range of this link. If the target for example is a symbol then target range is the
  2918. // range enclosing this symbol not including leading/trailing whitespace but everything else
  2919. // like comments. This information is typically used to highlight the range in the editor.
  2920. TargetRange Range `json:"targetRange"`
  2921. // The range that should be selected and revealed when this link is being followed, e.g the name of a function.
  2922. // Must be contained by the `targetRange`. See also `DocumentSymbol#range`
  2923. TargetSelectionRange Range `json:"targetSelectionRange"`
  2924. }
  2925. // Location with only uri and does not include range.
  2926. //
  2927. // @since 3.18.0
  2928. //
  2929. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#locationUriOnly
  2930. type LocationUriOnly struct {
  2931. URI DocumentUri `json:"uri"`
  2932. }
  2933. // The log message parameters.
  2934. //
  2935. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#logMessageParams
  2936. type LogMessageParams struct {
  2937. // The message type. See {@link MessageType}
  2938. Type MessageType `json:"type"`
  2939. // The actual message.
  2940. Message string `json:"message"`
  2941. }
  2942. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#logTraceParams
  2943. type LogTraceParams struct {
  2944. Message string `json:"message"`
  2945. Verbose string `json:"verbose,omitempty"`
  2946. }
  2947. // Client capabilities specific to the used markdown parser.
  2948. //
  2949. // @since 3.16.0
  2950. //
  2951. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#markdownClientCapabilities
  2952. type MarkdownClientCapabilities struct {
  2953. // The name of the parser.
  2954. Parser string `json:"parser"`
  2955. // The version of the parser.
  2956. Version string `json:"version,omitempty"`
  2957. // A list of HTML tags that the client allows / supports in
  2958. // Markdown.
  2959. //
  2960. // @since 3.17.0
  2961. AllowedTags []string `json:"allowedTags,omitempty"`
  2962. }
  2963. // MarkedString can be used to render human readable text. It is either a markdown string
  2964. // or a code-block that provides a language and a code snippet. The language identifier
  2965. // is semantically equal to the optional language identifier in fenced code blocks in GitHub
  2966. // issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
  2967. //
  2968. // The pair of a language and a value is an equivalent to markdown:
  2969. // ```${language}
  2970. // ${value}
  2971. // ```
  2972. //
  2973. // Note that markdown strings will be sanitized - that means html will be escaped.
  2974. // @deprecated use MarkupContent instead.
  2975. //
  2976. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#markedString
  2977. type MarkedString = Or_MarkedString // (alias)
  2978. // @since 3.18.0
  2979. // @deprecated use MarkupContent instead.
  2980. //
  2981. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#markedStringWithLanguage
  2982. type MarkedStringWithLanguage struct {
  2983. Language string `json:"language"`
  2984. Value string `json:"value"`
  2985. }
  2986. // A `MarkupContent` literal represents a string value which content is interpreted base on its
  2987. // kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
  2988. //
  2989. // If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
  2990. // See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
  2991. //
  2992. // Here is an example how such a string can be constructed using JavaScript / TypeScript:
  2993. // ```ts
  2994. //
  2995. // let markdown: MarkdownContent = {
  2996. // kind: MarkupKind.Markdown,
  2997. // value: [
  2998. // '# Header',
  2999. // 'Some text',
  3000. // '```typescript',
  3001. // 'someCode();',
  3002. // '```'
  3003. // ].join('\n')
  3004. // };
  3005. //
  3006. // ```
  3007. //
  3008. // *Please Note* that clients might sanitize the return markdown. A client could decide to
  3009. // remove HTML from the markdown to avoid script execution.
  3010. //
  3011. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#markupContent
  3012. type MarkupContent struct {
  3013. // The type of the Markup
  3014. Kind MarkupKind `json:"kind"`
  3015. // The content itself
  3016. Value string `json:"value"`
  3017. }
  3018. // Describes the content type that a client supports in various
  3019. // result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
  3020. //
  3021. // Please note that `MarkupKinds` must not start with a `$`. This kinds
  3022. // are reserved for internal usage.
  3023. type MarkupKind string
  3024. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#messageActionItem
  3025. type MessageActionItem struct {
  3026. // A short title like 'Retry', 'Open Log' etc.
  3027. Title string `json:"title"`
  3028. }
  3029. // The message type
  3030. type MessageType uint32
  3031. // Moniker definition to match LSIF 0.5 moniker definition.
  3032. //
  3033. // @since 3.16.0
  3034. //
  3035. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#moniker
  3036. type Moniker struct {
  3037. // The scheme of the moniker. For example tsc or .Net
  3038. Scheme string `json:"scheme"`
  3039. // The identifier of the moniker. The value is opaque in LSIF however
  3040. // schema owners are allowed to define the structure if they want.
  3041. Identifier string `json:"identifier"`
  3042. // The scope in which the moniker is unique
  3043. Unique UniquenessLevel `json:"unique"`
  3044. // The moniker kind if known.
  3045. Kind *MonikerKind `json:"kind,omitempty"`
  3046. }
  3047. // Client capabilities specific to the moniker request.
  3048. //
  3049. // @since 3.16.0
  3050. //
  3051. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#monikerClientCapabilities
  3052. type MonikerClientCapabilities struct {
  3053. // Whether moniker supports dynamic registration. If this is set to `true`
  3054. // the client supports the new `MonikerRegistrationOptions` return value
  3055. // for the corresponding server capability as well.
  3056. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  3057. }
  3058. // The moniker kind.
  3059. //
  3060. // @since 3.16.0
  3061. type MonikerKind string
  3062. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#monikerOptions
  3063. type MonikerOptions struct {
  3064. WorkDoneProgressOptions
  3065. }
  3066. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#monikerParams
  3067. type MonikerParams struct {
  3068. TextDocumentPositionParams
  3069. WorkDoneProgressParams
  3070. PartialResultParams
  3071. }
  3072. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#monikerRegistrationOptions
  3073. type MonikerRegistrationOptions struct {
  3074. TextDocumentRegistrationOptions
  3075. MonikerOptions
  3076. }
  3077. // A notebook cell.
  3078. //
  3079. // A cell's document URI must be unique across ALL notebook
  3080. // cells and can therefore be used to uniquely identify a
  3081. // notebook cell or the cell's text document.
  3082. //
  3083. // @since 3.17.0
  3084. //
  3085. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookCell
  3086. type NotebookCell struct {
  3087. // The cell's kind
  3088. Kind NotebookCellKind `json:"kind"`
  3089. // The URI of the cell's text document
  3090. // content.
  3091. Document DocumentUri `json:"document"`
  3092. // Additional metadata stored with the cell.
  3093. //
  3094. // Note: should always be an object literal (e.g. LSPObject)
  3095. Metadata *LSPObject `json:"metadata,omitempty"`
  3096. // Additional execution summary information
  3097. // if supported by the client.
  3098. ExecutionSummary *ExecutionSummary `json:"executionSummary,omitempty"`
  3099. }
  3100. // A change describing how to move a `NotebookCell`
  3101. // array from state S to S'.
  3102. //
  3103. // @since 3.17.0
  3104. //
  3105. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookCellArrayChange
  3106. type NotebookCellArrayChange struct {
  3107. // The start oftest of the cell that changed.
  3108. Start uint32 `json:"start"`
  3109. // The deleted cells
  3110. DeleteCount uint32 `json:"deleteCount"`
  3111. // The new cells, if any
  3112. Cells []NotebookCell `json:"cells,omitempty"`
  3113. }
  3114. // A notebook cell kind.
  3115. //
  3116. // @since 3.17.0
  3117. type NotebookCellKind uint32
  3118. // @since 3.18.0
  3119. //
  3120. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookCellLanguage
  3121. type NotebookCellLanguage struct {
  3122. Language string `json:"language"`
  3123. }
  3124. // A notebook cell text document filter denotes a cell text
  3125. // document by different properties.
  3126. //
  3127. // @since 3.17.0
  3128. //
  3129. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookCellTextDocumentFilter
  3130. type NotebookCellTextDocumentFilter struct {
  3131. // A filter that matches against the notebook
  3132. // containing the notebook cell. If a string
  3133. // value is provided it matches against the
  3134. // notebook type. '*' matches every notebook.
  3135. Notebook Or_NotebookCellTextDocumentFilter_notebook `json:"notebook"`
  3136. // A language id like `python`.
  3137. //
  3138. // Will be matched against the language id of the
  3139. // notebook cell document. '*' matches every language.
  3140. Language string `json:"language,omitempty"`
  3141. }
  3142. // A notebook document.
  3143. //
  3144. // @since 3.17.0
  3145. //
  3146. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocument
  3147. type NotebookDocument struct {
  3148. // The notebook document's uri.
  3149. URI URI `json:"uri"`
  3150. // The type of the notebook.
  3151. NotebookType string `json:"notebookType"`
  3152. // The version number of this document (it will increase after each
  3153. // change, including undo/redo).
  3154. Version int32 `json:"version"`
  3155. // Additional metadata stored with the notebook
  3156. // document.
  3157. //
  3158. // Note: should always be an object literal (e.g. LSPObject)
  3159. Metadata *LSPObject `json:"metadata,omitempty"`
  3160. // The cells of a notebook.
  3161. Cells []NotebookCell `json:"cells"`
  3162. }
  3163. // Structural changes to cells in a notebook document.
  3164. //
  3165. // @since 3.18.0
  3166. //
  3167. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentCellChangeStructure
  3168. type NotebookDocumentCellChangeStructure struct {
  3169. // The change to the cell array.
  3170. Array NotebookCellArrayChange `json:"array"`
  3171. // Additional opened cell text documents.
  3172. DidOpen []TextDocumentItem `json:"didOpen,omitempty"`
  3173. // Additional closed cell text documents.
  3174. DidClose []TextDocumentIdentifier `json:"didClose,omitempty"`
  3175. }
  3176. // Cell changes to a notebook document.
  3177. //
  3178. // @since 3.18.0
  3179. //
  3180. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentCellChanges
  3181. type NotebookDocumentCellChanges struct {
  3182. // Changes to the cell structure to add or
  3183. // remove cells.
  3184. Structure *NotebookDocumentCellChangeStructure `json:"structure,omitempty"`
  3185. // Changes to notebook cells properties like its
  3186. // kind, execution summary or metadata.
  3187. Data []NotebookCell `json:"data,omitempty"`
  3188. // Changes to the text content of notebook cells.
  3189. TextContent []NotebookDocumentCellContentChanges `json:"textContent,omitempty"`
  3190. }
  3191. // Content changes to a cell in a notebook document.
  3192. //
  3193. // @since 3.18.0
  3194. //
  3195. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentCellContentChanges
  3196. type NotebookDocumentCellContentChanges struct {
  3197. Document VersionedTextDocumentIdentifier `json:"document"`
  3198. Changes []TextDocumentContentChangeEvent `json:"changes"`
  3199. }
  3200. // A change event for a notebook document.
  3201. //
  3202. // @since 3.17.0
  3203. //
  3204. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentChangeEvent
  3205. type NotebookDocumentChangeEvent struct {
  3206. // The changed meta data if any.
  3207. //
  3208. // Note: should always be an object literal (e.g. LSPObject)
  3209. Metadata *LSPObject `json:"metadata,omitempty"`
  3210. // Changes to cells
  3211. Cells *NotebookDocumentCellChanges `json:"cells,omitempty"`
  3212. }
  3213. // Capabilities specific to the notebook document support.
  3214. //
  3215. // @since 3.17.0
  3216. //
  3217. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentClientCapabilities
  3218. type NotebookDocumentClientCapabilities struct {
  3219. // Capabilities specific to notebook document synchronization
  3220. //
  3221. // @since 3.17.0
  3222. Synchronization NotebookDocumentSyncClientCapabilities `json:"synchronization"`
  3223. }
  3224. // A notebook document filter denotes a notebook document by
  3225. // different properties. The properties will be match
  3226. // against the notebook's URI (same as with documents)
  3227. //
  3228. // @since 3.17.0
  3229. //
  3230. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilter
  3231. type NotebookDocumentFilter = Or_NotebookDocumentFilter // (alias)
  3232. // A notebook document filter where `notebookType` is required field.
  3233. //
  3234. // @since 3.18.0
  3235. //
  3236. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilterNotebookType
  3237. type NotebookDocumentFilterNotebookType struct {
  3238. // The type of the enclosing notebook.
  3239. NotebookType string `json:"notebookType"`
  3240. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  3241. Scheme string `json:"scheme,omitempty"`
  3242. // A glob pattern.
  3243. Pattern *GlobPattern `json:"pattern,omitempty"`
  3244. }
  3245. // A notebook document filter where `pattern` is required field.
  3246. //
  3247. // @since 3.18.0
  3248. //
  3249. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilterPattern
  3250. type NotebookDocumentFilterPattern struct {
  3251. // The type of the enclosing notebook.
  3252. NotebookType string `json:"notebookType,omitempty"`
  3253. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  3254. Scheme string `json:"scheme,omitempty"`
  3255. // A glob pattern.
  3256. Pattern GlobPattern `json:"pattern"`
  3257. }
  3258. // A notebook document filter where `scheme` is required field.
  3259. //
  3260. // @since 3.18.0
  3261. //
  3262. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilterScheme
  3263. type NotebookDocumentFilterScheme struct {
  3264. // The type of the enclosing notebook.
  3265. NotebookType string `json:"notebookType,omitempty"`
  3266. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  3267. Scheme string `json:"scheme"`
  3268. // A glob pattern.
  3269. Pattern *GlobPattern `json:"pattern,omitempty"`
  3270. }
  3271. // @since 3.18.0
  3272. //
  3273. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilterWithCells
  3274. type NotebookDocumentFilterWithCells struct {
  3275. // The notebook to be synced If a string
  3276. // value is provided it matches against the
  3277. // notebook type. '*' matches every notebook.
  3278. Notebook *Or_NotebookDocumentFilterWithCells_notebook `json:"notebook,omitempty"`
  3279. // The cells of the matching notebook to be synced.
  3280. Cells []NotebookCellLanguage `json:"cells"`
  3281. }
  3282. // @since 3.18.0
  3283. //
  3284. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentFilterWithNotebook
  3285. type NotebookDocumentFilterWithNotebook struct {
  3286. // The notebook to be synced If a string
  3287. // value is provided it matches against the
  3288. // notebook type. '*' matches every notebook.
  3289. Notebook Or_NotebookDocumentFilterWithNotebook_notebook `json:"notebook"`
  3290. // The cells of the matching notebook to be synced.
  3291. Cells []NotebookCellLanguage `json:"cells,omitempty"`
  3292. }
  3293. // A literal to identify a notebook document in the client.
  3294. //
  3295. // @since 3.17.0
  3296. //
  3297. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentIdentifier
  3298. type NotebookDocumentIdentifier struct {
  3299. // The notebook document's uri.
  3300. URI URI `json:"uri"`
  3301. }
  3302. // Notebook specific client capabilities.
  3303. //
  3304. // @since 3.17.0
  3305. //
  3306. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentSyncClientCapabilities
  3307. type NotebookDocumentSyncClientCapabilities struct {
  3308. // Whether implementation supports dynamic registration. If this is
  3309. // set to `true` the client supports the new
  3310. // `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  3311. // return value for the corresponding server capability as well.
  3312. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  3313. // The client supports sending execution summary data per cell.
  3314. ExecutionSummarySupport bool `json:"executionSummarySupport,omitempty"`
  3315. }
  3316. // Options specific to a notebook plus its cells
  3317. // to be synced to the server.
  3318. //
  3319. // If a selector provides a notebook document
  3320. // filter but no cell selector all cells of a
  3321. // matching notebook document will be synced.
  3322. //
  3323. // If a selector provides no notebook document
  3324. // filter but only a cell selector all notebook
  3325. // document that contain at least one matching
  3326. // cell will be synced.
  3327. //
  3328. // @since 3.17.0
  3329. //
  3330. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentSyncOptions
  3331. type NotebookDocumentSyncOptions struct {
  3332. // The notebooks to be synced
  3333. NotebookSelector []Or_NotebookDocumentSyncOptions_notebookSelector_Elem `json:"notebookSelector"`
  3334. // Whether save notification should be forwarded to
  3335. // the server. Will only be honored if mode === `notebook`.
  3336. Save bool `json:"save,omitempty"`
  3337. }
  3338. // Registration options specific to a notebook.
  3339. //
  3340. // @since 3.17.0
  3341. //
  3342. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#notebookDocumentSyncRegistrationOptions
  3343. type NotebookDocumentSyncRegistrationOptions struct {
  3344. NotebookDocumentSyncOptions
  3345. StaticRegistrationOptions
  3346. }
  3347. // A text document identifier to optionally denote a specific version of a text document.
  3348. //
  3349. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#optionalVersionedTextDocumentIdentifier
  3350. type OptionalVersionedTextDocumentIdentifier struct {
  3351. // The version number of this document. If a versioned text document identifier
  3352. // is sent from the server to the client and the file is not open in the editor
  3353. // (the server has not received an open notification before) the server can send
  3354. // `null` to indicate that the version is unknown and the content on disk is the
  3355. // truth (as specified with document content ownership).
  3356. Version int32 `json:"version"`
  3357. TextDocumentIdentifier
  3358. }
  3359. // created for Or [int32 string]
  3360. type Or_CancelParams_id struct {
  3361. Value interface{} `json:"value"`
  3362. }
  3363. // created for Or [ClientSemanticTokensRequestFullDelta bool]
  3364. type Or_ClientSemanticTokensRequestOptions_full struct {
  3365. Value interface{} `json:"value"`
  3366. }
  3367. // created for Or [Lit_ClientSemanticTokensRequestOptions_range_Item1 bool]
  3368. type Or_ClientSemanticTokensRequestOptions_range struct {
  3369. Value interface{} `json:"value"`
  3370. }
  3371. // created for Or [EditRangeWithInsertReplace Range]
  3372. type Or_CompletionItemDefaults_editRange struct {
  3373. Value interface{} `json:"value"`
  3374. }
  3375. // created for Or [MarkupContent string]
  3376. type Or_CompletionItem_documentation struct {
  3377. Value interface{} `json:"value"`
  3378. }
  3379. // created for Or [InsertReplaceEdit TextEdit]
  3380. type Or_CompletionItem_textEdit struct {
  3381. Value interface{} `json:"value"`
  3382. }
  3383. // created for Or [Location []Location]
  3384. type Or_Declaration struct {
  3385. Value interface{} `json:"value"`
  3386. }
  3387. // created for Or [Location []Location]
  3388. type Or_Definition struct {
  3389. Value interface{} `json:"value"`
  3390. }
  3391. // created for Or [int32 string]
  3392. type Or_Diagnostic_code struct {
  3393. Value interface{} `json:"value"`
  3394. }
  3395. // created for Or [[]string string]
  3396. type Or_DidChangeConfigurationRegistrationOptions_section struct {
  3397. Value interface{} `json:"value"`
  3398. }
  3399. // created for Or [RelatedFullDocumentDiagnosticReport RelatedUnchangedDocumentDiagnosticReport]
  3400. type Or_DocumentDiagnosticReport struct {
  3401. Value interface{} `json:"value"`
  3402. }
  3403. // created for Or [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]
  3404. type Or_DocumentDiagnosticReportPartialResult_relatedDocuments_Value struct {
  3405. Value interface{} `json:"value"`
  3406. }
  3407. // created for Or [NotebookCellTextDocumentFilter TextDocumentFilter]
  3408. type Or_DocumentFilter struct {
  3409. Value interface{} `json:"value"`
  3410. }
  3411. // created for Or [Pattern RelativePattern]
  3412. type Or_GlobPattern struct {
  3413. Value interface{} `json:"value"`
  3414. }
  3415. // created for Or [MarkedString MarkupContent []MarkedString]
  3416. type Or_Hover_contents struct {
  3417. Value interface{} `json:"value"`
  3418. }
  3419. // created for Or [MarkupContent string]
  3420. type Or_InlayHintLabelPart_tooltip struct {
  3421. Value interface{} `json:"value"`
  3422. }
  3423. // created for Or [[]InlayHintLabelPart string]
  3424. type Or_InlayHint_label struct {
  3425. Value interface{} `json:"value"`
  3426. }
  3427. // created for Or [MarkupContent string]
  3428. type Or_InlayHint_tooltip struct {
  3429. Value interface{} `json:"value"`
  3430. }
  3431. // created for Or [StringValue string]
  3432. type Or_InlineCompletionItem_insertText struct {
  3433. Value interface{} `json:"value"`
  3434. }
  3435. // created for Or [InlineValueEvaluatableExpression InlineValueText InlineValueVariableLookup]
  3436. type Or_InlineValue struct {
  3437. Value interface{} `json:"value"`
  3438. }
  3439. // created for Or [LSPArray LSPObject bool float64 int32 string uint32]
  3440. type Or_LSPAny struct {
  3441. Value interface{} `json:"value"`
  3442. }
  3443. // created for Or [MarkedStringWithLanguage string]
  3444. type Or_MarkedString struct {
  3445. Value interface{} `json:"value"`
  3446. }
  3447. // created for Or [NotebookDocumentFilter string]
  3448. type Or_NotebookCellTextDocumentFilter_notebook struct {
  3449. Value interface{} `json:"value"`
  3450. }
  3451. // created for Or [NotebookDocumentFilterNotebookType NotebookDocumentFilterPattern NotebookDocumentFilterScheme]
  3452. type Or_NotebookDocumentFilter struct {
  3453. Value interface{} `json:"value"`
  3454. }
  3455. // created for Or [NotebookDocumentFilter string]
  3456. type Or_NotebookDocumentFilterWithCells_notebook struct {
  3457. Value interface{} `json:"value"`
  3458. }
  3459. // created for Or [NotebookDocumentFilter string]
  3460. type Or_NotebookDocumentFilterWithNotebook_notebook struct {
  3461. Value interface{} `json:"value"`
  3462. }
  3463. // created for Or [NotebookDocumentFilterWithCells NotebookDocumentFilterWithNotebook]
  3464. type Or_NotebookDocumentSyncOptions_notebookSelector_Elem struct {
  3465. Value interface{} `json:"value"`
  3466. }
  3467. // created for Or [MarkupContent string]
  3468. type Or_ParameterInformation_documentation struct {
  3469. Value interface{} `json:"value"`
  3470. }
  3471. // created for Or [Tuple_ParameterInformation_label_Item1 string]
  3472. type Or_ParameterInformation_label struct {
  3473. Value interface{} `json:"value"`
  3474. }
  3475. // created for Or [PrepareRenameDefaultBehavior PrepareRenamePlaceholder Range]
  3476. type Or_PrepareRenameResult struct {
  3477. Value interface{} `json:"value"`
  3478. }
  3479. // created for Or [int32 string]
  3480. type Or_ProgressToken struct {
  3481. Value interface{} `json:"value"`
  3482. }
  3483. // created for Or [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]
  3484. type Or_RelatedFullDocumentDiagnosticReport_relatedDocuments_Value struct {
  3485. Value interface{} `json:"value"`
  3486. }
  3487. // created for Or [FullDocumentDiagnosticReport UnchangedDocumentDiagnosticReport]
  3488. type Or_RelatedUnchangedDocumentDiagnosticReport_relatedDocuments_Value struct {
  3489. Value interface{} `json:"value"`
  3490. }
  3491. // created for Or [URI WorkspaceFolder]
  3492. type Or_RelativePattern_baseUri struct {
  3493. Value interface{} `json:"value"`
  3494. }
  3495. // created for Or [CodeAction Command]
  3496. type Or_Result_textDocument_codeAction_Item0_Elem struct {
  3497. Value interface{} `json:"value"`
  3498. }
  3499. // created for Or [CompletionList []CompletionItem]
  3500. type Or_Result_textDocument_completion struct {
  3501. Value interface{} `json:"value"`
  3502. }
  3503. // created for Or [Declaration []DeclarationLink]
  3504. type Or_Result_textDocument_declaration struct {
  3505. Value interface{} `json:"value"`
  3506. }
  3507. // created for Or [Definition []DefinitionLink]
  3508. type Or_Result_textDocument_definition struct {
  3509. Value interface{} `json:"value"`
  3510. }
  3511. // created for Or [[]DocumentSymbol []SymbolInformation]
  3512. type Or_Result_textDocument_documentSymbol struct {
  3513. Value interface{} `json:"value"`
  3514. }
  3515. // created for Or [Definition []DefinitionLink]
  3516. type Or_Result_textDocument_implementation struct {
  3517. Value interface{} `json:"value"`
  3518. }
  3519. // created for Or [InlineCompletionList []InlineCompletionItem]
  3520. type Or_Result_textDocument_inlineCompletion struct {
  3521. Value interface{} `json:"value"`
  3522. }
  3523. // created for Or [SemanticTokens SemanticTokensDelta]
  3524. type Or_Result_textDocument_semanticTokens_full_delta struct {
  3525. Value interface{} `json:"value"`
  3526. }
  3527. // created for Or [Definition []DefinitionLink]
  3528. type Or_Result_textDocument_typeDefinition struct {
  3529. Value interface{} `json:"value"`
  3530. }
  3531. // created for Or [[]SymbolInformation []WorkspaceSymbol]
  3532. type Or_Result_workspace_symbol struct {
  3533. Value interface{} `json:"value"`
  3534. }
  3535. // created for Or [SemanticTokensFullDelta bool]
  3536. type Or_SemanticTokensOptions_full struct {
  3537. Value interface{} `json:"value"`
  3538. }
  3539. // created for Or [Lit_SemanticTokensOptions_range_Item1 bool]
  3540. type Or_SemanticTokensOptions_range struct {
  3541. Value interface{} `json:"value"`
  3542. }
  3543. // created for Or [CallHierarchyOptions CallHierarchyRegistrationOptions bool]
  3544. type Or_ServerCapabilities_callHierarchyProvider struct {
  3545. Value interface{} `json:"value"`
  3546. }
  3547. // created for Or [CodeActionOptions bool]
  3548. type Or_ServerCapabilities_codeActionProvider struct {
  3549. Value interface{} `json:"value"`
  3550. }
  3551. // created for Or [DocumentColorOptions DocumentColorRegistrationOptions bool]
  3552. type Or_ServerCapabilities_colorProvider struct {
  3553. Value interface{} `json:"value"`
  3554. }
  3555. // created for Or [DeclarationOptions DeclarationRegistrationOptions bool]
  3556. type Or_ServerCapabilities_declarationProvider struct {
  3557. Value interface{} `json:"value"`
  3558. }
  3559. // created for Or [DefinitionOptions bool]
  3560. type Or_ServerCapabilities_definitionProvider struct {
  3561. Value interface{} `json:"value"`
  3562. }
  3563. // created for Or [DiagnosticOptions DiagnosticRegistrationOptions]
  3564. type Or_ServerCapabilities_diagnosticProvider struct {
  3565. Value interface{} `json:"value"`
  3566. }
  3567. // created for Or [DocumentFormattingOptions bool]
  3568. type Or_ServerCapabilities_documentFormattingProvider struct {
  3569. Value interface{} `json:"value"`
  3570. }
  3571. // created for Or [DocumentHighlightOptions bool]
  3572. type Or_ServerCapabilities_documentHighlightProvider struct {
  3573. Value interface{} `json:"value"`
  3574. }
  3575. // created for Or [DocumentRangeFormattingOptions bool]
  3576. type Or_ServerCapabilities_documentRangeFormattingProvider struct {
  3577. Value interface{} `json:"value"`
  3578. }
  3579. // created for Or [DocumentSymbolOptions bool]
  3580. type Or_ServerCapabilities_documentSymbolProvider struct {
  3581. Value interface{} `json:"value"`
  3582. }
  3583. // created for Or [FoldingRangeOptions FoldingRangeRegistrationOptions bool]
  3584. type Or_ServerCapabilities_foldingRangeProvider struct {
  3585. Value interface{} `json:"value"`
  3586. }
  3587. // created for Or [HoverOptions bool]
  3588. type Or_ServerCapabilities_hoverProvider struct {
  3589. Value interface{} `json:"value"`
  3590. }
  3591. // created for Or [ImplementationOptions ImplementationRegistrationOptions bool]
  3592. type Or_ServerCapabilities_implementationProvider struct {
  3593. Value interface{} `json:"value"`
  3594. }
  3595. // created for Or [InlayHintOptions InlayHintRegistrationOptions bool]
  3596. type Or_ServerCapabilities_inlayHintProvider struct {
  3597. Value interface{} `json:"value"`
  3598. }
  3599. // created for Or [InlineCompletionOptions bool]
  3600. type Or_ServerCapabilities_inlineCompletionProvider struct {
  3601. Value interface{} `json:"value"`
  3602. }
  3603. // created for Or [InlineValueOptions InlineValueRegistrationOptions bool]
  3604. type Or_ServerCapabilities_inlineValueProvider struct {
  3605. Value interface{} `json:"value"`
  3606. }
  3607. // created for Or [LinkedEditingRangeOptions LinkedEditingRangeRegistrationOptions bool]
  3608. type Or_ServerCapabilities_linkedEditingRangeProvider struct {
  3609. Value interface{} `json:"value"`
  3610. }
  3611. // created for Or [MonikerOptions MonikerRegistrationOptions bool]
  3612. type Or_ServerCapabilities_monikerProvider struct {
  3613. Value interface{} `json:"value"`
  3614. }
  3615. // created for Or [NotebookDocumentSyncOptions NotebookDocumentSyncRegistrationOptions]
  3616. type Or_ServerCapabilities_notebookDocumentSync struct {
  3617. Value interface{} `json:"value"`
  3618. }
  3619. // created for Or [ReferenceOptions bool]
  3620. type Or_ServerCapabilities_referencesProvider struct {
  3621. Value interface{} `json:"value"`
  3622. }
  3623. // created for Or [RenameOptions bool]
  3624. type Or_ServerCapabilities_renameProvider struct {
  3625. Value interface{} `json:"value"`
  3626. }
  3627. // created for Or [SelectionRangeOptions SelectionRangeRegistrationOptions bool]
  3628. type Or_ServerCapabilities_selectionRangeProvider struct {
  3629. Value interface{} `json:"value"`
  3630. }
  3631. // created for Or [SemanticTokensOptions SemanticTokensRegistrationOptions]
  3632. type Or_ServerCapabilities_semanticTokensProvider struct {
  3633. Value interface{} `json:"value"`
  3634. }
  3635. // created for Or [TextDocumentSyncKind TextDocumentSyncOptions]
  3636. type Or_ServerCapabilities_textDocumentSync struct {
  3637. Value interface{} `json:"value"`
  3638. }
  3639. // created for Or [TypeDefinitionOptions TypeDefinitionRegistrationOptions bool]
  3640. type Or_ServerCapabilities_typeDefinitionProvider struct {
  3641. Value interface{} `json:"value"`
  3642. }
  3643. // created for Or [TypeHierarchyOptions TypeHierarchyRegistrationOptions bool]
  3644. type Or_ServerCapabilities_typeHierarchyProvider struct {
  3645. Value interface{} `json:"value"`
  3646. }
  3647. // created for Or [WorkspaceSymbolOptions bool]
  3648. type Or_ServerCapabilities_workspaceSymbolProvider struct {
  3649. Value interface{} `json:"value"`
  3650. }
  3651. // created for Or [MarkupContent string]
  3652. type Or_SignatureInformation_documentation struct {
  3653. Value interface{} `json:"value"`
  3654. }
  3655. // created for Or [TextDocumentContentChangePartial TextDocumentContentChangeWholeDocument]
  3656. type Or_TextDocumentContentChangeEvent struct {
  3657. Value interface{} `json:"value"`
  3658. }
  3659. // created for Or [AnnotatedTextEdit SnippetTextEdit TextEdit]
  3660. type Or_TextDocumentEdit_edits_Elem struct {
  3661. Value interface{} `json:"value"`
  3662. }
  3663. // created for Or [TextDocumentFilterLanguage TextDocumentFilterPattern TextDocumentFilterScheme]
  3664. type Or_TextDocumentFilter struct {
  3665. Value interface{} `json:"value"`
  3666. }
  3667. // created for Or [SaveOptions bool]
  3668. type Or_TextDocumentSyncOptions_save struct {
  3669. Value interface{} `json:"value"`
  3670. }
  3671. // created for Or [WorkspaceFullDocumentDiagnosticReport WorkspaceUnchangedDocumentDiagnosticReport]
  3672. type Or_WorkspaceDocumentDiagnosticReport struct {
  3673. Value interface{} `json:"value"`
  3674. }
  3675. // created for Or [CreateFile DeleteFile RenameFile TextDocumentEdit]
  3676. type Or_WorkspaceEdit_documentChanges_Elem struct {
  3677. Value interface{} `json:"value"`
  3678. }
  3679. // created for Or [bool string]
  3680. type Or_WorkspaceFoldersServerCapabilities_changeNotifications struct {
  3681. Value interface{} `json:"value"`
  3682. }
  3683. // created for Or [TextDocumentContentOptions TextDocumentContentRegistrationOptions]
  3684. type Or_WorkspaceOptions_textDocumentContent struct {
  3685. Value interface{} `json:"value"`
  3686. }
  3687. // created for Or [Location LocationUriOnly]
  3688. type Or_WorkspaceSymbol_location struct {
  3689. Value interface{} `json:"value"`
  3690. }
  3691. // The parameters of a configuration request.
  3692. //
  3693. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#configurationParams
  3694. type ParamConfiguration struct {
  3695. Items []ConfigurationItem `json:"items"`
  3696. }
  3697. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#initializeParams
  3698. type ParamInitialize struct {
  3699. XInitializeParams
  3700. WorkspaceFoldersInitializeParams
  3701. }
  3702. // Represents a parameter of a callable-signature. A parameter can
  3703. // have a label and a doc-comment.
  3704. //
  3705. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#parameterInformation
  3706. type ParameterInformation struct {
  3707. // The label of this parameter information.
  3708. //
  3709. // Either a string or an inclusive start and exclusive end offsets within its containing
  3710. // signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
  3711. // string representation as `Position` and `Range` does.
  3712. //
  3713. // To avoid ambiguities a server should use the [start, end] offset value instead of using
  3714. // a substring. Whether a client support this is controlled via `labelOffsetSupport` client
  3715. // capability.
  3716. //
  3717. // *Note*: a label of type string should be a substring of its containing signature label.
  3718. // Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
  3719. Label Or_ParameterInformation_label `json:"label"`
  3720. // The human-readable doc-comment of this parameter. Will be shown
  3721. // in the UI but can be omitted.
  3722. Documentation *Or_ParameterInformation_documentation `json:"documentation,omitempty"`
  3723. }
  3724. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#partialResultParams
  3725. type PartialResultParams struct {
  3726. // An optional token that a server can use to report partial results (e.g. streaming) to
  3727. // the client.
  3728. PartialResultToken *ProgressToken `json:"partialResultToken,omitempty"`
  3729. }
  3730. // The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
  3731. //
  3732. // - `*` to match one or more characters in a path segment
  3733. // - `?` to match on one character in a path segment
  3734. // - `**` to match any number of path segments, including none
  3735. // - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
  3736. // - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
  3737. // - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
  3738. //
  3739. // @since 3.17.0
  3740. //
  3741. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#pattern
  3742. type Pattern = string // (alias)
  3743. // Position in a text document expressed as zero-based line and character
  3744. // offset. Prior to 3.17 the offsets were always based on a UTF-16 string
  3745. // representation. So a string of the form `a𐐀b` the character offset of the
  3746. // character `a` is 0, the character offset of `𐐀` is 1 and the character
  3747. // offset of b is 3 since `𐐀` is represented using two code units in UTF-16.
  3748. // Since 3.17 clients and servers can agree on a different string encoding
  3749. // representation (e.g. UTF-8). The client announces it's supported encoding
  3750. // via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).
  3751. // The value is an array of position encodings the client supports, with
  3752. // decreasing preference (e.g. the encoding at index `0` is the most preferred
  3753. // one). To stay backwards compatible the only mandatory encoding is UTF-16
  3754. // represented via the string `utf-16`. The server can pick one of the
  3755. // encodings offered by the client and signals that encoding back to the
  3756. // client via the initialize result's property
  3757. // [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value
  3758. // `utf-16` is missing from the client's capability `general.positionEncodings`
  3759. // servers can safely assume that the client supports UTF-16. If the server
  3760. // omits the position encoding in its initialize result the encoding defaults
  3761. // to the string value `utf-16`. Implementation considerations: since the
  3762. // conversion from one encoding into another requires the content of the
  3763. // file / line the conversion is best done where the file is read which is
  3764. // usually on the server side.
  3765. //
  3766. // Positions are line end character agnostic. So you can not specify a position
  3767. // that denotes `\r|\n` or `\n|` where `|` represents the character offset.
  3768. //
  3769. // @since 3.17.0 - support for negotiated position encoding.
  3770. //
  3771. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#position
  3772. type Position struct {
  3773. // Line position in a document (zero-based).
  3774. //
  3775. // If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.
  3776. // If a line number is negative, it defaults to 0.
  3777. Line uint32 `json:"line"`
  3778. // Character offset on a line in a document (zero-based).
  3779. //
  3780. // The meaning of this offset is determined by the negotiated
  3781. // `PositionEncodingKind`.
  3782. //
  3783. // If the character value is greater than the line length it defaults back to the
  3784. // line length.
  3785. Character uint32 `json:"character"`
  3786. }
  3787. // A set of predefined position encoding kinds.
  3788. //
  3789. // @since 3.17.0
  3790. type PositionEncodingKind string
  3791. // @since 3.18.0
  3792. //
  3793. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#prepareRenameDefaultBehavior
  3794. type PrepareRenameDefaultBehavior struct {
  3795. DefaultBehavior bool `json:"defaultBehavior"`
  3796. }
  3797. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#prepareRenameParams
  3798. type PrepareRenameParams struct {
  3799. TextDocumentPositionParams
  3800. WorkDoneProgressParams
  3801. }
  3802. // @since 3.18.0
  3803. //
  3804. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#prepareRenamePlaceholder
  3805. type PrepareRenamePlaceholder struct {
  3806. Range Range `json:"range"`
  3807. Placeholder string `json:"placeholder"`
  3808. }
  3809. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#prepareRenameResult
  3810. type PrepareRenameResult = Or_PrepareRenameResult // (alias)
  3811. type PrepareSupportDefaultBehavior uint32
  3812. // A previous result id in a workspace pull request.
  3813. //
  3814. // @since 3.17.0
  3815. //
  3816. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#previousResultId
  3817. type PreviousResultID struct {
  3818. // The URI for which the client knowns a
  3819. // result id.
  3820. URI DocumentUri `json:"uri"`
  3821. // The value of the previous result id.
  3822. Value string `json:"value"`
  3823. }
  3824. // A previous result id in a workspace pull request.
  3825. //
  3826. // @since 3.17.0
  3827. //
  3828. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#previousResultId
  3829. type PreviousResultId struct {
  3830. // The URI for which the client knowns a
  3831. // result id.
  3832. URI DocumentUri `json:"uri"`
  3833. // The value of the previous result id.
  3834. Value string `json:"value"`
  3835. }
  3836. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#progressParams
  3837. type ProgressParams struct {
  3838. // The progress token provided by the client or server.
  3839. Token ProgressToken `json:"token"`
  3840. // The progress data.
  3841. Value interface{} `json:"value"`
  3842. }
  3843. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#progressToken
  3844. type ProgressToken = Or_ProgressToken // (alias)
  3845. // The publish diagnostic client capabilities.
  3846. //
  3847. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#publishDiagnosticsClientCapabilities
  3848. type PublishDiagnosticsClientCapabilities struct {
  3849. // Whether the client interprets the version property of the
  3850. // `textDocument/publishDiagnostics` notification's parameter.
  3851. //
  3852. // @since 3.15.0
  3853. VersionSupport bool `json:"versionSupport,omitempty"`
  3854. DiagnosticsCapabilities
  3855. }
  3856. // The publish diagnostic notification's parameters.
  3857. //
  3858. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#publishDiagnosticsParams
  3859. type PublishDiagnosticsParams struct {
  3860. // The URI for which diagnostic information is reported.
  3861. URI DocumentUri `json:"uri"`
  3862. // Optional the version number of the document the diagnostics are published for.
  3863. //
  3864. // @since 3.15.0
  3865. Version int32 `json:"version,omitempty"`
  3866. // An array of diagnostic information items.
  3867. Diagnostics []Diagnostic `json:"diagnostics"`
  3868. }
  3869. // A range in a text document expressed as (zero-based) start and end positions.
  3870. //
  3871. // If you want to specify a range that contains a line including the line ending
  3872. // character(s) then use an end position denoting the start of the next line.
  3873. // For example:
  3874. // ```ts
  3875. //
  3876. // {
  3877. // start: { line: 5, character: 23 }
  3878. // end : { line 6, character : 0 }
  3879. // }
  3880. //
  3881. // ```
  3882. //
  3883. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#range
  3884. type Range struct {
  3885. // The range's start position.
  3886. Start Position `json:"start"`
  3887. // The range's end position.
  3888. End Position `json:"end"`
  3889. }
  3890. // Client Capabilities for a {@link ReferencesRequest}.
  3891. //
  3892. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#referenceClientCapabilities
  3893. type ReferenceClientCapabilities struct {
  3894. // Whether references supports dynamic registration.
  3895. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  3896. }
  3897. // Value-object that contains additional information when
  3898. // requesting references.
  3899. //
  3900. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#referenceContext
  3901. type ReferenceContext struct {
  3902. // Include the declaration of the current symbol.
  3903. IncludeDeclaration bool `json:"includeDeclaration"`
  3904. }
  3905. // Reference options.
  3906. //
  3907. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#referenceOptions
  3908. type ReferenceOptions struct {
  3909. WorkDoneProgressOptions
  3910. }
  3911. // Parameters for a {@link ReferencesRequest}.
  3912. //
  3913. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#referenceParams
  3914. type ReferenceParams struct {
  3915. Context ReferenceContext `json:"context"`
  3916. TextDocumentPositionParams
  3917. WorkDoneProgressParams
  3918. PartialResultParams
  3919. }
  3920. // Registration options for a {@link ReferencesRequest}.
  3921. //
  3922. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#referenceRegistrationOptions
  3923. type ReferenceRegistrationOptions struct {
  3924. TextDocumentRegistrationOptions
  3925. ReferenceOptions
  3926. }
  3927. // General parameters to register for a notification or to register a provider.
  3928. //
  3929. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#registration
  3930. type Registration struct {
  3931. // The id used to register the request. The id can be used to deregister
  3932. // the request again.
  3933. ID string `json:"id"`
  3934. // The method / capability to register for.
  3935. Method string `json:"method"`
  3936. // Options necessary for the registration.
  3937. RegisterOptions interface{} `json:"registerOptions,omitempty"`
  3938. }
  3939. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#registrationParams
  3940. type RegistrationParams struct {
  3941. Registrations []Registration `json:"registrations"`
  3942. }
  3943. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#regularExpressionEngineKind
  3944. type RegularExpressionEngineKind = string // (alias)
  3945. // Client capabilities specific to regular expressions.
  3946. //
  3947. // @since 3.16.0
  3948. //
  3949. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#regularExpressionsClientCapabilities
  3950. type RegularExpressionsClientCapabilities struct {
  3951. // The engine's name.
  3952. Engine RegularExpressionEngineKind `json:"engine"`
  3953. // The engine's version.
  3954. Version string `json:"version,omitempty"`
  3955. }
  3956. // A full diagnostic report with a set of related documents.
  3957. //
  3958. // @since 3.17.0
  3959. //
  3960. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#relatedFullDocumentDiagnosticReport
  3961. type RelatedFullDocumentDiagnosticReport struct {
  3962. // Diagnostics of related documents. This information is useful
  3963. // in programming languages where code in a file A can generate
  3964. // diagnostics in a file B which A depends on. An example of
  3965. // such a language is C/C++ where marco definitions in a file
  3966. // a.cpp and result in errors in a header file b.hpp.
  3967. //
  3968. // @since 3.17.0
  3969. RelatedDocuments map[DocumentUri]interface{} `json:"relatedDocuments,omitempty"`
  3970. FullDocumentDiagnosticReport
  3971. }
  3972. // An unchanged diagnostic report with a set of related documents.
  3973. //
  3974. // @since 3.17.0
  3975. //
  3976. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#relatedUnchangedDocumentDiagnosticReport
  3977. type RelatedUnchangedDocumentDiagnosticReport struct {
  3978. // Diagnostics of related documents. This information is useful
  3979. // in programming languages where code in a file A can generate
  3980. // diagnostics in a file B which A depends on. An example of
  3981. // such a language is C/C++ where marco definitions in a file
  3982. // a.cpp and result in errors in a header file b.hpp.
  3983. //
  3984. // @since 3.17.0
  3985. RelatedDocuments map[DocumentUri]interface{} `json:"relatedDocuments,omitempty"`
  3986. UnchangedDocumentDiagnosticReport
  3987. }
  3988. // A relative pattern is a helper to construct glob patterns that are matched
  3989. // relatively to a base URI. The common value for a `baseUri` is a workspace
  3990. // folder root, but it can be another absolute URI as well.
  3991. //
  3992. // @since 3.17.0
  3993. //
  3994. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#relativePattern
  3995. type RelativePattern struct {
  3996. // A workspace folder or a base URI to which this pattern will be matched
  3997. // against relatively.
  3998. BaseURI Or_RelativePattern_baseUri `json:"baseUri"`
  3999. // The actual glob pattern;
  4000. Pattern Pattern `json:"pattern"`
  4001. }
  4002. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameClientCapabilities
  4003. type RenameClientCapabilities struct {
  4004. // Whether rename supports dynamic registration.
  4005. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  4006. // Client supports testing for validity of rename operations
  4007. // before execution.
  4008. //
  4009. // @since 3.12.0
  4010. PrepareSupport bool `json:"prepareSupport,omitempty"`
  4011. // Client supports the default behavior result.
  4012. //
  4013. // The value indicates the default behavior used by the
  4014. // client.
  4015. //
  4016. // @since 3.16.0
  4017. PrepareSupportDefaultBehavior *PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitempty"`
  4018. // Whether the client honors the change annotations in
  4019. // text edits and resource operations returned via the
  4020. // rename request's workspace edit by for example presenting
  4021. // the workspace edit in the user interface and asking
  4022. // for confirmation.
  4023. //
  4024. // @since 3.16.0
  4025. HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitempty"`
  4026. }
  4027. // Rename file operation
  4028. //
  4029. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameFile
  4030. type RenameFile struct {
  4031. // A rename
  4032. Kind string `json:"kind"`
  4033. // The old (existing) location.
  4034. OldURI DocumentUri `json:"oldUri"`
  4035. // The new location.
  4036. NewURI DocumentUri `json:"newUri"`
  4037. // Rename options.
  4038. Options *RenameFileOptions `json:"options,omitempty"`
  4039. ResourceOperation
  4040. }
  4041. // Rename file options
  4042. //
  4043. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameFileOptions
  4044. type RenameFileOptions struct {
  4045. // Overwrite target if existing. Overwrite wins over `ignoreIfExists`
  4046. Overwrite bool `json:"overwrite,omitempty"`
  4047. // Ignores if target exists.
  4048. IgnoreIfExists bool `json:"ignoreIfExists,omitempty"`
  4049. }
  4050. // The parameters sent in notifications/requests for user-initiated renames of
  4051. // files.
  4052. //
  4053. // @since 3.16.0
  4054. //
  4055. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameFilesParams
  4056. type RenameFilesParams struct {
  4057. // An array of all files/folders renamed in this operation. When a folder is renamed, only
  4058. // the folder will be included, and not its children.
  4059. Files []FileRename `json:"files"`
  4060. }
  4061. // Provider options for a {@link RenameRequest}.
  4062. //
  4063. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameOptions
  4064. type RenameOptions struct {
  4065. // Renames should be checked and tested before being executed.
  4066. //
  4067. // @since version 3.12.0
  4068. PrepareProvider bool `json:"prepareProvider,omitempty"`
  4069. WorkDoneProgressOptions
  4070. }
  4071. // The parameters of a {@link RenameRequest}.
  4072. //
  4073. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameParams
  4074. type RenameParams struct {
  4075. // The document to rename.
  4076. TextDocument TextDocumentIdentifier `json:"textDocument"`
  4077. // The position at which this request was sent.
  4078. Position Position `json:"position"`
  4079. // The new name of the symbol. If the given name is not valid the
  4080. // request must return a {@link ResponseError} with an
  4081. // appropriate message set.
  4082. NewName string `json:"newName"`
  4083. WorkDoneProgressParams
  4084. }
  4085. // Registration options for a {@link RenameRequest}.
  4086. //
  4087. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#renameRegistrationOptions
  4088. type RenameRegistrationOptions struct {
  4089. TextDocumentRegistrationOptions
  4090. RenameOptions
  4091. }
  4092. // A generic resource operation.
  4093. //
  4094. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#resourceOperation
  4095. type ResourceOperation struct {
  4096. // The resource operation kind.
  4097. Kind string `json:"kind"`
  4098. // An optional annotation identifier describing the operation.
  4099. //
  4100. // @since 3.16.0
  4101. AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
  4102. }
  4103. type ResourceOperationKind string
  4104. // Save options.
  4105. //
  4106. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#saveOptions
  4107. type SaveOptions struct {
  4108. // The client is supposed to include the content on save.
  4109. IncludeText bool `json:"includeText,omitempty"`
  4110. }
  4111. // Describes the currently selected completion item.
  4112. //
  4113. // @since 3.18.0
  4114. // @proposed
  4115. //
  4116. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectedCompletionInfo
  4117. type SelectedCompletionInfo struct {
  4118. // The range that will be replaced if this completion item is accepted.
  4119. Range Range `json:"range"`
  4120. // The text the range will be replaced with if this completion is accepted.
  4121. Text string `json:"text"`
  4122. }
  4123. // A selection range represents a part of a selection hierarchy. A selection range
  4124. // may have a parent selection range that contains it.
  4125. //
  4126. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectionRange
  4127. type SelectionRange struct {
  4128. // The {@link Range range} of this selection range.
  4129. Range Range `json:"range"`
  4130. // The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
  4131. Parent *SelectionRange `json:"parent,omitempty"`
  4132. }
  4133. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectionRangeClientCapabilities
  4134. type SelectionRangeClientCapabilities struct {
  4135. // Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
  4136. // the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
  4137. // capability as well.
  4138. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  4139. }
  4140. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectionRangeOptions
  4141. type SelectionRangeOptions struct {
  4142. WorkDoneProgressOptions
  4143. }
  4144. // A parameter literal used in selection range requests.
  4145. //
  4146. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectionRangeParams
  4147. type SelectionRangeParams struct {
  4148. // The text document.
  4149. TextDocument TextDocumentIdentifier `json:"textDocument"`
  4150. // The positions inside the text document.
  4151. Positions []Position `json:"positions"`
  4152. WorkDoneProgressParams
  4153. PartialResultParams
  4154. }
  4155. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#selectionRangeRegistrationOptions
  4156. type SelectionRangeRegistrationOptions struct {
  4157. SelectionRangeOptions
  4158. TextDocumentRegistrationOptions
  4159. StaticRegistrationOptions
  4160. }
  4161. // A set of predefined token modifiers. This set is not fixed
  4162. // an clients can specify additional token types via the
  4163. // corresponding client capabilities.
  4164. //
  4165. // @since 3.16.0
  4166. type SemanticTokenModifiers string
  4167. // A set of predefined token types. This set is not fixed
  4168. // an clients can specify additional token types via the
  4169. // corresponding client capabilities.
  4170. //
  4171. // @since 3.16.0
  4172. type SemanticTokenTypes string
  4173. // @since 3.16.0
  4174. //
  4175. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokens
  4176. type SemanticTokens struct {
  4177. // An optional result id. If provided and clients support delta updating
  4178. // the client will include the result id in the next semantic token request.
  4179. // A server can then instead of computing all semantic tokens again simply
  4180. // send a delta.
  4181. ResultID string `json:"resultId,omitempty"`
  4182. // The actual tokens.
  4183. Data []uint32 `json:"data"`
  4184. }
  4185. // @since 3.16.0
  4186. //
  4187. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensClientCapabilities
  4188. type SemanticTokensClientCapabilities struct {
  4189. // Whether implementation supports dynamic registration. If this is set to `true`
  4190. // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  4191. // return value for the corresponding server capability as well.
  4192. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  4193. // Which requests the client supports and might send to the server
  4194. // depending on the server's capability. Please note that clients might not
  4195. // show semantic tokens or degrade some of the user experience if a range
  4196. // or full request is advertised by the client but not provided by the
  4197. // server. If for example the client capability `requests.full` and
  4198. // `request.range` are both set to true but the server only provides a
  4199. // range provider the client might not render a minimap correctly or might
  4200. // even decide to not show any semantic tokens at all.
  4201. Requests ClientSemanticTokensRequestOptions `json:"requests"`
  4202. // The token types that the client supports.
  4203. TokenTypes []string `json:"tokenTypes"`
  4204. // The token modifiers that the client supports.
  4205. TokenModifiers []string `json:"tokenModifiers"`
  4206. // The token formats the clients supports.
  4207. Formats []TokenFormat `json:"formats"`
  4208. // Whether the client supports tokens that can overlap each other.
  4209. OverlappingTokenSupport bool `json:"overlappingTokenSupport,omitempty"`
  4210. // Whether the client supports tokens that can span multiple lines.
  4211. MultilineTokenSupport bool `json:"multilineTokenSupport,omitempty"`
  4212. // Whether the client allows the server to actively cancel a
  4213. // semantic token request, e.g. supports returning
  4214. // LSPErrorCodes.ServerCancelled. If a server does the client
  4215. // needs to retrigger the request.
  4216. //
  4217. // @since 3.17.0
  4218. ServerCancelSupport bool `json:"serverCancelSupport,omitempty"`
  4219. // Whether the client uses semantic tokens to augment existing
  4220. // syntax tokens. If set to `true` client side created syntax
  4221. // tokens and semantic tokens are both used for colorization. If
  4222. // set to `false` the client only uses the returned semantic tokens
  4223. // for colorization.
  4224. //
  4225. // If the value is `undefined` then the client behavior is not
  4226. // specified.
  4227. //
  4228. // @since 3.17.0
  4229. AugmentsSyntaxTokens bool `json:"augmentsSyntaxTokens,omitempty"`
  4230. }
  4231. // @since 3.16.0
  4232. //
  4233. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensDelta
  4234. type SemanticTokensDelta struct {
  4235. ResultID string `json:"resultId,omitempty"`
  4236. // The semantic token edits to transform a previous result into a new result.
  4237. Edits []SemanticTokensEdit `json:"edits"`
  4238. }
  4239. // @since 3.16.0
  4240. //
  4241. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensDeltaParams
  4242. type SemanticTokensDeltaParams struct {
  4243. // The text document.
  4244. TextDocument TextDocumentIdentifier `json:"textDocument"`
  4245. // The result id of a previous response. The result Id can either point to a full response
  4246. // or a delta response depending on what was received last.
  4247. PreviousResultID string `json:"previousResultId"`
  4248. WorkDoneProgressParams
  4249. PartialResultParams
  4250. }
  4251. // @since 3.16.0
  4252. //
  4253. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensDeltaPartialResult
  4254. type SemanticTokensDeltaPartialResult struct {
  4255. Edits []SemanticTokensEdit `json:"edits"`
  4256. }
  4257. // @since 3.16.0
  4258. //
  4259. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensEdit
  4260. type SemanticTokensEdit struct {
  4261. // The start offset of the edit.
  4262. Start uint32 `json:"start"`
  4263. // The count of elements to remove.
  4264. DeleteCount uint32 `json:"deleteCount"`
  4265. // The elements to insert.
  4266. Data []uint32 `json:"data,omitempty"`
  4267. }
  4268. // Semantic tokens options to support deltas for full documents
  4269. //
  4270. // @since 3.18.0
  4271. //
  4272. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensFullDelta
  4273. type SemanticTokensFullDelta struct {
  4274. // The server supports deltas for full documents.
  4275. Delta bool `json:"delta,omitempty"`
  4276. }
  4277. // @since 3.16.0
  4278. //
  4279. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensLegend
  4280. type SemanticTokensLegend struct {
  4281. // The token types a server uses.
  4282. TokenTypes []string `json:"tokenTypes"`
  4283. // The token modifiers a server uses.
  4284. TokenModifiers []string `json:"tokenModifiers"`
  4285. }
  4286. // @since 3.16.0
  4287. //
  4288. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensOptions
  4289. type SemanticTokensOptions struct {
  4290. // The legend used by the server
  4291. Legend SemanticTokensLegend `json:"legend"`
  4292. // Server supports providing semantic tokens for a specific range
  4293. // of a document.
  4294. Range *Or_SemanticTokensOptions_range `json:"range,omitempty"`
  4295. // Server supports providing semantic tokens for a full document.
  4296. Full *Or_SemanticTokensOptions_full `json:"full,omitempty"`
  4297. WorkDoneProgressOptions
  4298. }
  4299. // @since 3.16.0
  4300. //
  4301. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensParams
  4302. type SemanticTokensParams struct {
  4303. // The text document.
  4304. TextDocument TextDocumentIdentifier `json:"textDocument"`
  4305. WorkDoneProgressParams
  4306. PartialResultParams
  4307. }
  4308. // @since 3.16.0
  4309. //
  4310. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensPartialResult
  4311. type SemanticTokensPartialResult struct {
  4312. Data []uint32 `json:"data"`
  4313. }
  4314. // @since 3.16.0
  4315. //
  4316. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensRangeParams
  4317. type SemanticTokensRangeParams struct {
  4318. // The text document.
  4319. TextDocument TextDocumentIdentifier `json:"textDocument"`
  4320. // The range the semantic tokens are requested for.
  4321. Range Range `json:"range"`
  4322. WorkDoneProgressParams
  4323. PartialResultParams
  4324. }
  4325. // @since 3.16.0
  4326. //
  4327. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensRegistrationOptions
  4328. type SemanticTokensRegistrationOptions struct {
  4329. TextDocumentRegistrationOptions
  4330. SemanticTokensOptions
  4331. StaticRegistrationOptions
  4332. }
  4333. // @since 3.16.0
  4334. //
  4335. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#semanticTokensWorkspaceClientCapabilities
  4336. type SemanticTokensWorkspaceClientCapabilities struct {
  4337. // Whether the client implementation supports a refresh request sent from
  4338. // the server to the client.
  4339. //
  4340. // Note that this event is global and will force the client to refresh all
  4341. // semantic tokens currently shown. It should be used with absolute care
  4342. // and is useful for situation where a server for example detects a project
  4343. // wide change that requires such a calculation.
  4344. RefreshSupport bool `json:"refreshSupport,omitempty"`
  4345. }
  4346. // Defines the capabilities provided by a language
  4347. // server.
  4348. //
  4349. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#serverCapabilities
  4350. type ServerCapabilities struct {
  4351. // The position encoding the server picked from the encodings offered
  4352. // by the client via the client capability `general.positionEncodings`.
  4353. //
  4354. // If the client didn't provide any position encodings the only valid
  4355. // value that a server can return is 'utf-16'.
  4356. //
  4357. // If omitted it defaults to 'utf-16'.
  4358. //
  4359. // @since 3.17.0
  4360. PositionEncoding *PositionEncodingKind `json:"positionEncoding,omitempty"`
  4361. // Defines how text documents are synced. Is either a detailed structure
  4362. // defining each notification or for backwards compatibility the
  4363. // TextDocumentSyncKind number.
  4364. TextDocumentSync interface{} `json:"textDocumentSync,omitempty"`
  4365. // Defines how notebook documents are synced.
  4366. //
  4367. // @since 3.17.0
  4368. NotebookDocumentSync *Or_ServerCapabilities_notebookDocumentSync `json:"notebookDocumentSync,omitempty"`
  4369. // The server provides completion support.
  4370. CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
  4371. // The server provides hover support.
  4372. HoverProvider *Or_ServerCapabilities_hoverProvider `json:"hoverProvider,omitempty"`
  4373. // The server provides signature help support.
  4374. SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
  4375. // The server provides Goto Declaration support.
  4376. DeclarationProvider *Or_ServerCapabilities_declarationProvider `json:"declarationProvider,omitempty"`
  4377. // The server provides goto definition support.
  4378. DefinitionProvider *Or_ServerCapabilities_definitionProvider `json:"definitionProvider,omitempty"`
  4379. // The server provides Goto Type Definition support.
  4380. TypeDefinitionProvider *Or_ServerCapabilities_typeDefinitionProvider `json:"typeDefinitionProvider,omitempty"`
  4381. // The server provides Goto Implementation support.
  4382. ImplementationProvider *Or_ServerCapabilities_implementationProvider `json:"implementationProvider,omitempty"`
  4383. // The server provides find references support.
  4384. ReferencesProvider *Or_ServerCapabilities_referencesProvider `json:"referencesProvider,omitempty"`
  4385. // The server provides document highlight support.
  4386. DocumentHighlightProvider *Or_ServerCapabilities_documentHighlightProvider `json:"documentHighlightProvider,omitempty"`
  4387. // The server provides document symbol support.
  4388. DocumentSymbolProvider *Or_ServerCapabilities_documentSymbolProvider `json:"documentSymbolProvider,omitempty"`
  4389. // The server provides code actions. CodeActionOptions may only be
  4390. // specified if the client states that it supports
  4391. // `codeActionLiteralSupport` in its initial `initialize` request.
  4392. CodeActionProvider interface{} `json:"codeActionProvider,omitempty"`
  4393. // The server provides code lens.
  4394. CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"`
  4395. // The server provides document link support.
  4396. DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"`
  4397. // The server provides color provider support.
  4398. ColorProvider *Or_ServerCapabilities_colorProvider `json:"colorProvider,omitempty"`
  4399. // The server provides workspace symbol support.
  4400. WorkspaceSymbolProvider *Or_ServerCapabilities_workspaceSymbolProvider `json:"workspaceSymbolProvider,omitempty"`
  4401. // The server provides document formatting.
  4402. DocumentFormattingProvider *Or_ServerCapabilities_documentFormattingProvider `json:"documentFormattingProvider,omitempty"`
  4403. // The server provides document range formatting.
  4404. DocumentRangeFormattingProvider *Or_ServerCapabilities_documentRangeFormattingProvider `json:"documentRangeFormattingProvider,omitempty"`
  4405. // The server provides document formatting on typing.
  4406. DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`
  4407. // The server provides rename support. RenameOptions may only be
  4408. // specified if the client states that it supports
  4409. // `prepareSupport` in its initial `initialize` request.
  4410. RenameProvider interface{} `json:"renameProvider,omitempty"`
  4411. // The server provides folding provider support.
  4412. FoldingRangeProvider *Or_ServerCapabilities_foldingRangeProvider `json:"foldingRangeProvider,omitempty"`
  4413. // The server provides selection range support.
  4414. SelectionRangeProvider *Or_ServerCapabilities_selectionRangeProvider `json:"selectionRangeProvider,omitempty"`
  4415. // The server provides execute command support.
  4416. ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`
  4417. // The server provides call hierarchy support.
  4418. //
  4419. // @since 3.16.0
  4420. CallHierarchyProvider *Or_ServerCapabilities_callHierarchyProvider `json:"callHierarchyProvider,omitempty"`
  4421. // The server provides linked editing range support.
  4422. //
  4423. // @since 3.16.0
  4424. LinkedEditingRangeProvider *Or_ServerCapabilities_linkedEditingRangeProvider `json:"linkedEditingRangeProvider,omitempty"`
  4425. // The server provides semantic tokens support.
  4426. //
  4427. // @since 3.16.0
  4428. SemanticTokensProvider interface{} `json:"semanticTokensProvider,omitempty"`
  4429. // The server provides moniker support.
  4430. //
  4431. // @since 3.16.0
  4432. MonikerProvider *Or_ServerCapabilities_monikerProvider `json:"monikerProvider,omitempty"`
  4433. // The server provides type hierarchy support.
  4434. //
  4435. // @since 3.17.0
  4436. TypeHierarchyProvider *Or_ServerCapabilities_typeHierarchyProvider `json:"typeHierarchyProvider,omitempty"`
  4437. // The server provides inline values.
  4438. //
  4439. // @since 3.17.0
  4440. InlineValueProvider *Or_ServerCapabilities_inlineValueProvider `json:"inlineValueProvider,omitempty"`
  4441. // The server provides inlay hints.
  4442. //
  4443. // @since 3.17.0
  4444. InlayHintProvider interface{} `json:"inlayHintProvider,omitempty"`
  4445. // The server has support for pull model diagnostics.
  4446. //
  4447. // @since 3.17.0
  4448. DiagnosticProvider *Or_ServerCapabilities_diagnosticProvider `json:"diagnosticProvider,omitempty"`
  4449. // Inline completion options used during static registration.
  4450. //
  4451. // @since 3.18.0
  4452. // @proposed
  4453. InlineCompletionProvider *Or_ServerCapabilities_inlineCompletionProvider `json:"inlineCompletionProvider,omitempty"`
  4454. // Workspace specific server capabilities.
  4455. Workspace *WorkspaceOptions `json:"workspace,omitempty"`
  4456. // Experimental server capabilities.
  4457. Experimental interface{} `json:"experimental,omitempty"`
  4458. }
  4459. // @since 3.18.0
  4460. //
  4461. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#serverCompletionItemOptions
  4462. type ServerCompletionItemOptions struct {
  4463. // The server has support for completion item label
  4464. // details (see also `CompletionItemLabelDetails`) when
  4465. // receiving a completion item in a resolve call.
  4466. //
  4467. // @since 3.17.0
  4468. LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
  4469. }
  4470. // Information about the server
  4471. //
  4472. // @since 3.15.0
  4473. // @since 3.18.0 ServerInfo type name added.
  4474. //
  4475. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#serverInfo
  4476. type ServerInfo struct {
  4477. // The name of the server as defined by the server.
  4478. Name string `json:"name"`
  4479. // The server's version as defined by the server.
  4480. Version string `json:"version,omitempty"`
  4481. }
  4482. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#setTraceParams
  4483. type SetTraceParams struct {
  4484. Value TraceValue `json:"value"`
  4485. }
  4486. // Client capabilities for the showDocument request.
  4487. //
  4488. // @since 3.16.0
  4489. //
  4490. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showDocumentClientCapabilities
  4491. type ShowDocumentClientCapabilities struct {
  4492. // The client has support for the showDocument
  4493. // request.
  4494. Support bool `json:"support"`
  4495. }
  4496. // Params to show a resource in the UI.
  4497. //
  4498. // @since 3.16.0
  4499. //
  4500. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showDocumentParams
  4501. type ShowDocumentParams struct {
  4502. // The uri to show.
  4503. URI URI `json:"uri"`
  4504. // Indicates to show the resource in an external program.
  4505. // To show, for example, `https://code.visualstudio.com/`
  4506. // in the default WEB browser set `external` to `true`.
  4507. External bool `json:"external,omitempty"`
  4508. // An optional property to indicate whether the editor
  4509. // showing the document should take focus or not.
  4510. // Clients might ignore this property if an external
  4511. // program is started.
  4512. TakeFocus bool `json:"takeFocus,omitempty"`
  4513. // An optional selection range if the document is a text
  4514. // document. Clients might ignore the property if an
  4515. // external program is started or the file is not a text
  4516. // file.
  4517. Selection *Range `json:"selection,omitempty"`
  4518. }
  4519. // The result of a showDocument request.
  4520. //
  4521. // @since 3.16.0
  4522. //
  4523. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showDocumentResult
  4524. type ShowDocumentResult struct {
  4525. // A boolean indicating if the show was successful.
  4526. Success bool `json:"success"`
  4527. }
  4528. // The parameters of a notification message.
  4529. //
  4530. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showMessageParams
  4531. type ShowMessageParams struct {
  4532. // The message type. See {@link MessageType}
  4533. Type MessageType `json:"type"`
  4534. // The actual message.
  4535. Message string `json:"message"`
  4536. }
  4537. // Show message request client capabilities
  4538. //
  4539. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showMessageRequestClientCapabilities
  4540. type ShowMessageRequestClientCapabilities struct {
  4541. // Capabilities specific to the `MessageActionItem` type.
  4542. MessageActionItem *ClientShowMessageActionItemOptions `json:"messageActionItem,omitempty"`
  4543. }
  4544. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#showMessageRequestParams
  4545. type ShowMessageRequestParams struct {
  4546. // The message type. See {@link MessageType}
  4547. Type MessageType `json:"type"`
  4548. // The actual message.
  4549. Message string `json:"message"`
  4550. // The message action items to present.
  4551. Actions []MessageActionItem `json:"actions,omitempty"`
  4552. }
  4553. // Signature help represents the signature of something
  4554. // callable. There can be multiple signature but only one
  4555. // active and only one active parameter.
  4556. //
  4557. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelp
  4558. type SignatureHelp struct {
  4559. // One or more signatures.
  4560. Signatures []SignatureInformation `json:"signatures"`
  4561. // The active signature. If omitted or the value lies outside the
  4562. // range of `signatures` the value defaults to zero or is ignored if
  4563. // the `SignatureHelp` has no signatures.
  4564. //
  4565. // Whenever possible implementors should make an active decision about
  4566. // the active signature and shouldn't rely on a default value.
  4567. //
  4568. // In future version of the protocol this property might become
  4569. // mandatory to better express this.
  4570. ActiveSignature uint32 `json:"activeSignature,omitempty"`
  4571. // The active parameter of the active signature.
  4572. //
  4573. // If `null`, no parameter of the signature is active (for example a named
  4574. // argument that does not match any declared parameters). This is only valid
  4575. // if the client specifies the client capability
  4576. // `textDocument.signatureHelp.noActiveParameterSupport === true`
  4577. //
  4578. // If omitted or the value lies outside the range of
  4579. // `signatures[activeSignature].parameters` defaults to 0 if the active
  4580. // signature has parameters.
  4581. //
  4582. // If the active signature has no parameters it is ignored.
  4583. //
  4584. // In future version of the protocol this property might become
  4585. // mandatory (but still nullable) to better express the active parameter if
  4586. // the active signature does have any.
  4587. ActiveParameter uint32 `json:"activeParameter,omitempty"`
  4588. }
  4589. // Client Capabilities for a {@link SignatureHelpRequest}.
  4590. //
  4591. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelpClientCapabilities
  4592. type SignatureHelpClientCapabilities struct {
  4593. // Whether signature help supports dynamic registration.
  4594. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  4595. // The client supports the following `SignatureInformation`
  4596. // specific properties.
  4597. SignatureInformation *ClientSignatureInformationOptions `json:"signatureInformation,omitempty"`
  4598. // The client supports to send additional context information for a
  4599. // `textDocument/signatureHelp` request. A client that opts into
  4600. // contextSupport will also support the `retriggerCharacters` on
  4601. // `SignatureHelpOptions`.
  4602. //
  4603. // @since 3.15.0
  4604. ContextSupport bool `json:"contextSupport,omitempty"`
  4605. }
  4606. // Additional information about the context in which a signature help request was triggered.
  4607. //
  4608. // @since 3.15.0
  4609. //
  4610. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelpContext
  4611. type SignatureHelpContext struct {
  4612. // Action that caused signature help to be triggered.
  4613. TriggerKind SignatureHelpTriggerKind `json:"triggerKind"`
  4614. // Character that caused signature help to be triggered.
  4615. //
  4616. // This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`
  4617. TriggerCharacter string `json:"triggerCharacter,omitempty"`
  4618. // `true` if signature help was already showing when it was triggered.
  4619. //
  4620. // Retriggers occurs when the signature help is already active and can be caused by actions such as
  4621. // typing a trigger character, a cursor move, or document content changes.
  4622. IsRetrigger bool `json:"isRetrigger"`
  4623. // The currently active `SignatureHelp`.
  4624. //
  4625. // The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on
  4626. // the user navigating through available signatures.
  4627. ActiveSignatureHelp *SignatureHelp `json:"activeSignatureHelp,omitempty"`
  4628. }
  4629. // Server Capabilities for a {@link SignatureHelpRequest}.
  4630. //
  4631. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelpOptions
  4632. type SignatureHelpOptions struct {
  4633. // List of characters that trigger signature help automatically.
  4634. TriggerCharacters []string `json:"triggerCharacters,omitempty"`
  4635. // List of characters that re-trigger signature help.
  4636. //
  4637. // These trigger characters are only active when signature help is already showing. All trigger characters
  4638. // are also counted as re-trigger characters.
  4639. //
  4640. // @since 3.15.0
  4641. RetriggerCharacters []string `json:"retriggerCharacters,omitempty"`
  4642. WorkDoneProgressOptions
  4643. }
  4644. // Parameters for a {@link SignatureHelpRequest}.
  4645. //
  4646. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelpParams
  4647. type SignatureHelpParams struct {
  4648. // The signature help context. This is only available if the client specifies
  4649. // to send this using the client capability `textDocument.signatureHelp.contextSupport === true`
  4650. //
  4651. // @since 3.15.0
  4652. Context *SignatureHelpContext `json:"context,omitempty"`
  4653. TextDocumentPositionParams
  4654. WorkDoneProgressParams
  4655. }
  4656. // Registration options for a {@link SignatureHelpRequest}.
  4657. //
  4658. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureHelpRegistrationOptions
  4659. type SignatureHelpRegistrationOptions struct {
  4660. TextDocumentRegistrationOptions
  4661. SignatureHelpOptions
  4662. }
  4663. // How a signature help was triggered.
  4664. //
  4665. // @since 3.15.0
  4666. type SignatureHelpTriggerKind uint32
  4667. // Represents the signature of something callable. A signature
  4668. // can have a label, like a function-name, a doc-comment, and
  4669. // a set of parameters.
  4670. //
  4671. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#signatureInformation
  4672. type SignatureInformation struct {
  4673. // The label of this signature. Will be shown in
  4674. // the UI.
  4675. Label string `json:"label"`
  4676. // The human-readable doc-comment of this signature. Will be shown
  4677. // in the UI but can be omitted.
  4678. Documentation *Or_SignatureInformation_documentation `json:"documentation,omitempty"`
  4679. // The parameters of this signature.
  4680. Parameters []ParameterInformation `json:"parameters,omitempty"`
  4681. // The index of the active parameter.
  4682. //
  4683. // If `null`, no parameter of the signature is active (for example a named
  4684. // argument that does not match any declared parameters). This is only valid
  4685. // if the client specifies the client capability
  4686. // `textDocument.signatureHelp.noActiveParameterSupport === true`
  4687. //
  4688. // If provided (or `null`), this is used in place of
  4689. // `SignatureHelp.activeParameter`.
  4690. //
  4691. // @since 3.16.0
  4692. ActiveParameter uint32 `json:"activeParameter,omitempty"`
  4693. }
  4694. // An interactive text edit.
  4695. //
  4696. // @since 3.18.0
  4697. // @proposed
  4698. //
  4699. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#snippetTextEdit
  4700. type SnippetTextEdit struct {
  4701. // The range of the text document to be manipulated.
  4702. Range Range `json:"range"`
  4703. // The snippet to be inserted.
  4704. Snippet StringValue `json:"snippet"`
  4705. // The actual identifier of the snippet edit.
  4706. AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
  4707. }
  4708. // @since 3.18.0
  4709. //
  4710. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#staleRequestSupportOptions
  4711. type StaleRequestSupportOptions struct {
  4712. // The client will actively cancel the request.
  4713. Cancel bool `json:"cancel"`
  4714. // The list of requests for which the client
  4715. // will retry the request if it receives a
  4716. // response with error code `ContentModified`
  4717. RetryOnContentModified []string `json:"retryOnContentModified"`
  4718. }
  4719. // Static registration options to be returned in the initialize
  4720. // request.
  4721. //
  4722. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#staticRegistrationOptions
  4723. type StaticRegistrationOptions struct {
  4724. // The id used to register the request. The id can be used to deregister
  4725. // the request again. See also Registration#id.
  4726. ID string `json:"id,omitempty"`
  4727. }
  4728. // A string value used as a snippet is a template which allows to insert text
  4729. // and to control the editor cursor when insertion happens.
  4730. //
  4731. // A snippet can define tab stops and placeholders with `$1`, `$2`
  4732. // and `${3:foo}`. `$0` defines the final tab stop, it defaults to
  4733. // the end of the snippet. Variables are defined with `$name` and
  4734. // `${name:default value}`.
  4735. //
  4736. // @since 3.18.0
  4737. // @proposed
  4738. //
  4739. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#stringValue
  4740. type StringValue struct {
  4741. // The kind of string value.
  4742. Kind string `json:"kind"`
  4743. // The snippet string.
  4744. Value string `json:"value"`
  4745. }
  4746. // Represents information about programming constructs like variables, classes,
  4747. // interfaces etc.
  4748. //
  4749. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#symbolInformation
  4750. type SymbolInformation struct {
  4751. // extends BaseSymbolInformation
  4752. // Indicates if this symbol is deprecated.
  4753. //
  4754. // @deprecated Use tags instead
  4755. Deprecated bool `json:"deprecated,omitempty"`
  4756. // The location of this symbol. The location's range is used by a tool
  4757. // to reveal the location in the editor. If the symbol is selected in the
  4758. // tool the range's start information is used to position the cursor. So
  4759. // the range usually spans more than the actual symbol's name and does
  4760. // normally include things like visibility modifiers.
  4761. //
  4762. // The range doesn't have to denote a node range in the sense of an abstract
  4763. // syntax tree. It can therefore not be used to re-construct a hierarchy of
  4764. // the symbols.
  4765. Location Location `json:"location"`
  4766. // The name of this symbol.
  4767. Name string `json:"name"`
  4768. // The kind of this symbol.
  4769. Kind SymbolKind `json:"kind"`
  4770. // Tags for this symbol.
  4771. //
  4772. // @since 3.16.0
  4773. Tags []SymbolTag `json:"tags,omitempty"`
  4774. // The name of the symbol containing this symbol. This information is for
  4775. // user interface purposes (e.g. to render a qualifier in the user interface
  4776. // if necessary). It can't be used to re-infer a hierarchy for the document
  4777. // symbols.
  4778. ContainerName string `json:"containerName,omitempty"`
  4779. }
  4780. // A symbol kind.
  4781. type SymbolKind uint32
  4782. // Symbol tags are extra annotations that tweak the rendering of a symbol.
  4783. //
  4784. // @since 3.16
  4785. type SymbolTag uint32
  4786. // Describe options to be used when registered for text document change events.
  4787. //
  4788. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentChangeRegistrationOptions
  4789. type TextDocumentChangeRegistrationOptions struct {
  4790. // How documents are synced to the server.
  4791. SyncKind TextDocumentSyncKind `json:"syncKind"`
  4792. TextDocumentRegistrationOptions
  4793. }
  4794. // Text document specific client capabilities.
  4795. //
  4796. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentClientCapabilities
  4797. type TextDocumentClientCapabilities struct {
  4798. // Defines which synchronization capabilities the client supports.
  4799. Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`
  4800. // Capabilities specific to the `textDocument/completion` request.
  4801. Completion CompletionClientCapabilities `json:"completion,omitempty"`
  4802. // Capabilities specific to the `textDocument/hover` request.
  4803. Hover *HoverClientCapabilities `json:"hover,omitempty"`
  4804. // Capabilities specific to the `textDocument/signatureHelp` request.
  4805. SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"`
  4806. // Capabilities specific to the `textDocument/declaration` request.
  4807. //
  4808. // @since 3.14.0
  4809. Declaration *DeclarationClientCapabilities `json:"declaration,omitempty"`
  4810. // Capabilities specific to the `textDocument/definition` request.
  4811. Definition *DefinitionClientCapabilities `json:"definition,omitempty"`
  4812. // Capabilities specific to the `textDocument/typeDefinition` request.
  4813. //
  4814. // @since 3.6.0
  4815. TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"`
  4816. // Capabilities specific to the `textDocument/implementation` request.
  4817. //
  4818. // @since 3.6.0
  4819. Implementation *ImplementationClientCapabilities `json:"implementation,omitempty"`
  4820. // Capabilities specific to the `textDocument/references` request.
  4821. References *ReferenceClientCapabilities `json:"references,omitempty"`
  4822. // Capabilities specific to the `textDocument/documentHighlight` request.
  4823. DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"`
  4824. // Capabilities specific to the `textDocument/documentSymbol` request.
  4825. DocumentSymbol DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"`
  4826. // Capabilities specific to the `textDocument/codeAction` request.
  4827. CodeAction CodeActionClientCapabilities `json:"codeAction,omitempty"`
  4828. // Capabilities specific to the `textDocument/codeLens` request.
  4829. CodeLens *CodeLensClientCapabilities `json:"codeLens,omitempty"`
  4830. // Capabilities specific to the `textDocument/documentLink` request.
  4831. DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitempty"`
  4832. // Capabilities specific to the `textDocument/documentColor` and the
  4833. // `textDocument/colorPresentation` request.
  4834. //
  4835. // @since 3.6.0
  4836. ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitempty"`
  4837. // Capabilities specific to the `textDocument/formatting` request.
  4838. Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitempty"`
  4839. // Capabilities specific to the `textDocument/rangeFormatting` request.
  4840. RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"`
  4841. // Capabilities specific to the `textDocument/onTypeFormatting` request.
  4842. OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"`
  4843. // Capabilities specific to the `textDocument/rename` request.
  4844. Rename *RenameClientCapabilities `json:"rename,omitempty"`
  4845. // Capabilities specific to the `textDocument/foldingRange` request.
  4846. //
  4847. // @since 3.10.0
  4848. FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`
  4849. // Capabilities specific to the `textDocument/selectionRange` request.
  4850. //
  4851. // @since 3.15.0
  4852. SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`
  4853. // Capabilities specific to the `textDocument/publishDiagnostics` notification.
  4854. PublishDiagnostics PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`
  4855. // Capabilities specific to the various call hierarchy requests.
  4856. //
  4857. // @since 3.16.0
  4858. CallHierarchy *CallHierarchyClientCapabilities `json:"callHierarchy,omitempty"`
  4859. // Capabilities specific to the various semantic token request.
  4860. //
  4861. // @since 3.16.0
  4862. SemanticTokens SemanticTokensClientCapabilities `json:"semanticTokens,omitempty"`
  4863. // Capabilities specific to the `textDocument/linkedEditingRange` request.
  4864. //
  4865. // @since 3.16.0
  4866. LinkedEditingRange *LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitempty"`
  4867. // Client capabilities specific to the `textDocument/moniker` request.
  4868. //
  4869. // @since 3.16.0
  4870. Moniker *MonikerClientCapabilities `json:"moniker,omitempty"`
  4871. // Capabilities specific to the various type hierarchy requests.
  4872. //
  4873. // @since 3.17.0
  4874. TypeHierarchy *TypeHierarchyClientCapabilities `json:"typeHierarchy,omitempty"`
  4875. // Capabilities specific to the `textDocument/inlineValue` request.
  4876. //
  4877. // @since 3.17.0
  4878. InlineValue *InlineValueClientCapabilities `json:"inlineValue,omitempty"`
  4879. // Capabilities specific to the `textDocument/inlayHint` request.
  4880. //
  4881. // @since 3.17.0
  4882. InlayHint *InlayHintClientCapabilities `json:"inlayHint,omitempty"`
  4883. // Capabilities specific to the diagnostic pull model.
  4884. //
  4885. // @since 3.17.0
  4886. Diagnostic *DiagnosticClientCapabilities `json:"diagnostic,omitempty"`
  4887. // Client capabilities specific to inline completions.
  4888. //
  4889. // @since 3.18.0
  4890. // @proposed
  4891. InlineCompletion *InlineCompletionClientCapabilities `json:"inlineCompletion,omitempty"`
  4892. }
  4893. // An event describing a change to a text document. If only a text is provided
  4894. // it is considered to be the full content of the document.
  4895. //
  4896. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentChangeEvent
  4897. type TextDocumentContentChangeEvent = Or_TextDocumentContentChangeEvent // (alias)
  4898. // @since 3.18.0
  4899. //
  4900. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentChangePartial
  4901. type TextDocumentContentChangePartial struct {
  4902. // The range of the document that changed.
  4903. Range *Range `json:"range,omitempty"`
  4904. // The optional length of the range that got replaced.
  4905. //
  4906. // @deprecated use range instead.
  4907. RangeLength uint32 `json:"rangeLength,omitempty"`
  4908. // The new text for the provided range.
  4909. Text string `json:"text"`
  4910. }
  4911. // @since 3.18.0
  4912. //
  4913. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentChangeWholeDocument
  4914. type TextDocumentContentChangeWholeDocument struct {
  4915. // The new text of the whole document.
  4916. Text string `json:"text"`
  4917. }
  4918. // Client capabilities for a text document content provider.
  4919. //
  4920. // @since 3.18.0
  4921. // @proposed
  4922. //
  4923. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentClientCapabilities
  4924. type TextDocumentContentClientCapabilities struct {
  4925. // Text document content provider supports dynamic registration.
  4926. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  4927. }
  4928. // Text document content provider options.
  4929. //
  4930. // @since 3.18.0
  4931. // @proposed
  4932. //
  4933. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentOptions
  4934. type TextDocumentContentOptions struct {
  4935. // The scheme for which the server provides content.
  4936. Scheme string `json:"scheme"`
  4937. }
  4938. // Parameters for the `workspace/textDocumentContent` request.
  4939. //
  4940. // @since 3.18.0
  4941. // @proposed
  4942. //
  4943. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentParams
  4944. type TextDocumentContentParams struct {
  4945. // The uri of the text document.
  4946. URI DocumentUri `json:"uri"`
  4947. }
  4948. // Parameters for the `workspace/textDocumentContent/refresh` request.
  4949. //
  4950. // @since 3.18.0
  4951. // @proposed
  4952. //
  4953. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentRefreshParams
  4954. type TextDocumentContentRefreshParams struct {
  4955. // The uri of the text document to refresh.
  4956. URI DocumentUri `json:"uri"`
  4957. }
  4958. // Text document content provider registration options.
  4959. //
  4960. // @since 3.18.0
  4961. // @proposed
  4962. //
  4963. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentContentRegistrationOptions
  4964. type TextDocumentContentRegistrationOptions struct {
  4965. TextDocumentContentOptions
  4966. StaticRegistrationOptions
  4967. }
  4968. // Describes textual changes on a text document. A TextDocumentEdit describes all changes
  4969. // on a document version Si and after they are applied move the document to version Si+1.
  4970. // So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any
  4971. // kind of ordering. However the edits must be non overlapping.
  4972. //
  4973. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentEdit
  4974. type TextDocumentEdit struct {
  4975. // The text document to change.
  4976. TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument"`
  4977. // The edits to be applied.
  4978. //
  4979. // @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a
  4980. // client capability.
  4981. //
  4982. // @since 3.18.0 - support for SnippetTextEdit. This is guarded using a
  4983. // client capability.
  4984. Edits []Or_TextDocumentEdit_edits_Elem `json:"edits"`
  4985. }
  4986. // A document filter denotes a document by different properties like
  4987. // the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of
  4988. // its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.
  4989. //
  4990. // Glob patterns can have the following syntax:
  4991. //
  4992. // - `*` to match one or more characters in a path segment
  4993. // - `?` to match on one character in a path segment
  4994. // - `**` to match any number of path segments, including none
  4995. // - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
  4996. // - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
  4997. // - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
  4998. //
  4999. // @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
  5000. // @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
  5001. //
  5002. // @since 3.17.0
  5003. //
  5004. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentFilter
  5005. type TextDocumentFilter = Or_TextDocumentFilter // (alias)
  5006. // A document filter where `language` is required field.
  5007. //
  5008. // @since 3.18.0
  5009. //
  5010. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentFilterLanguage
  5011. type TextDocumentFilterLanguage struct {
  5012. // A language id, like `typescript`.
  5013. Language string `json:"language"`
  5014. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  5015. Scheme string `json:"scheme,omitempty"`
  5016. // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples.
  5017. //
  5018. // @since 3.18.0 - support for relative patterns.
  5019. Pattern *GlobPattern `json:"pattern,omitempty"`
  5020. }
  5021. // A document filter where `pattern` is required field.
  5022. //
  5023. // @since 3.18.0
  5024. //
  5025. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentFilterPattern
  5026. type TextDocumentFilterPattern struct {
  5027. // A language id, like `typescript`.
  5028. Language string `json:"language,omitempty"`
  5029. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  5030. Scheme string `json:"scheme,omitempty"`
  5031. // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples.
  5032. //
  5033. // @since 3.18.0 - support for relative patterns.
  5034. Pattern GlobPattern `json:"pattern"`
  5035. }
  5036. // A document filter where `scheme` is required field.
  5037. //
  5038. // @since 3.18.0
  5039. //
  5040. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentFilterScheme
  5041. type TextDocumentFilterScheme struct {
  5042. // A language id, like `typescript`.
  5043. Language string `json:"language,omitempty"`
  5044. // A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
  5045. Scheme string `json:"scheme"`
  5046. // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples.
  5047. //
  5048. // @since 3.18.0 - support for relative patterns.
  5049. Pattern *GlobPattern `json:"pattern,omitempty"`
  5050. }
  5051. // A literal to identify a text document in the client.
  5052. //
  5053. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentIdentifier
  5054. type TextDocumentIdentifier struct {
  5055. // The text document's uri.
  5056. URI DocumentUri `json:"uri"`
  5057. }
  5058. // An item to transfer a text document from the client to the
  5059. // server.
  5060. //
  5061. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentItem
  5062. type TextDocumentItem struct {
  5063. // The text document's uri.
  5064. URI DocumentUri `json:"uri"`
  5065. // The text document's language identifier.
  5066. LanguageID LanguageKind `json:"languageId"`
  5067. // The version number of this document (it will increase after each
  5068. // change, including undo/redo).
  5069. Version int32 `json:"version"`
  5070. // The content of the opened text document.
  5071. Text string `json:"text"`
  5072. }
  5073. // A parameter literal used in requests to pass a text document and a position inside that
  5074. // document.
  5075. //
  5076. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentPositionParams
  5077. type TextDocumentPositionParams struct {
  5078. // The text document.
  5079. TextDocument TextDocumentIdentifier `json:"textDocument"`
  5080. // The position inside the text document.
  5081. Position Position `json:"position"`
  5082. }
  5083. // General text document registration options.
  5084. //
  5085. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentRegistrationOptions
  5086. type TextDocumentRegistrationOptions struct {
  5087. // A document selector to identify the scope of the registration. If set to null
  5088. // the document selector provided on the client side will be used.
  5089. DocumentSelector DocumentSelector `json:"documentSelector"`
  5090. }
  5091. // Represents reasons why a text document is saved.
  5092. type TextDocumentSaveReason uint32
  5093. // Save registration options.
  5094. //
  5095. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentSaveRegistrationOptions
  5096. type TextDocumentSaveRegistrationOptions struct {
  5097. TextDocumentRegistrationOptions
  5098. SaveOptions
  5099. }
  5100. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentSyncClientCapabilities
  5101. type TextDocumentSyncClientCapabilities struct {
  5102. // Whether text document synchronization supports dynamic registration.
  5103. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  5104. // The client supports sending will save notifications.
  5105. WillSave bool `json:"willSave,omitempty"`
  5106. // The client supports sending a will save request and
  5107. // waits for a response providing text edits which will
  5108. // be applied to the document before it is saved.
  5109. WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
  5110. // The client supports did save notifications.
  5111. DidSave bool `json:"didSave,omitempty"`
  5112. }
  5113. // Defines how the host (editor) should sync
  5114. // document changes to the language server.
  5115. type TextDocumentSyncKind uint32
  5116. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textDocumentSyncOptions
  5117. type TextDocumentSyncOptions struct {
  5118. // Open and close notifications are sent to the server. If omitted open close notification should not
  5119. // be sent.
  5120. OpenClose bool `json:"openClose,omitempty"`
  5121. // Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
  5122. // and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
  5123. Change TextDocumentSyncKind `json:"change,omitempty"`
  5124. // If present will save notifications are sent to the server. If omitted the notification should not be
  5125. // sent.
  5126. WillSave bool `json:"willSave,omitempty"`
  5127. // If present will save wait until requests are sent to the server. If omitted the request should not be
  5128. // sent.
  5129. WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"`
  5130. // If present save notifications are sent to the server. If omitted the notification should not be
  5131. // sent.
  5132. Save *SaveOptions `json:"save,omitempty"`
  5133. }
  5134. // A text edit applicable to a text document.
  5135. //
  5136. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#textEdit
  5137. type TextEdit struct {
  5138. // The range of the text document to be manipulated. To insert
  5139. // text into a document create a range where start === end.
  5140. Range Range `json:"range"`
  5141. // The string to be inserted. For delete operations use an
  5142. // empty string.
  5143. NewText string `json:"newText"`
  5144. }
  5145. type TokenFormat string
  5146. type TraceValue string
  5147. // created for Tuple
  5148. type Tuple_ParameterInformation_label_Item1 struct {
  5149. Fld0 uint32 `json:"fld0"`
  5150. Fld1 uint32 `json:"fld1"`
  5151. }
  5152. // Since 3.6.0
  5153. //
  5154. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeDefinitionClientCapabilities
  5155. type TypeDefinitionClientCapabilities struct {
  5156. // Whether implementation supports dynamic registration. If this is set to `true`
  5157. // the client supports the new `TypeDefinitionRegistrationOptions` return value
  5158. // for the corresponding server capability as well.
  5159. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  5160. // The client supports additional metadata in the form of definition links.
  5161. //
  5162. // Since 3.14.0
  5163. LinkSupport bool `json:"linkSupport,omitempty"`
  5164. }
  5165. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeDefinitionOptions
  5166. type TypeDefinitionOptions struct {
  5167. WorkDoneProgressOptions
  5168. }
  5169. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeDefinitionParams
  5170. type TypeDefinitionParams struct {
  5171. TextDocumentPositionParams
  5172. WorkDoneProgressParams
  5173. PartialResultParams
  5174. }
  5175. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeDefinitionRegistrationOptions
  5176. type TypeDefinitionRegistrationOptions struct {
  5177. TextDocumentRegistrationOptions
  5178. TypeDefinitionOptions
  5179. StaticRegistrationOptions
  5180. }
  5181. // @since 3.17.0
  5182. //
  5183. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchyClientCapabilities
  5184. type TypeHierarchyClientCapabilities struct {
  5185. // Whether implementation supports dynamic registration. If this is set to `true`
  5186. // the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
  5187. // return value for the corresponding server capability as well.
  5188. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  5189. }
  5190. // @since 3.17.0
  5191. //
  5192. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchyItem
  5193. type TypeHierarchyItem struct {
  5194. // The name of this item.
  5195. Name string `json:"name"`
  5196. // The kind of this item.
  5197. Kind SymbolKind `json:"kind"`
  5198. // Tags for this item.
  5199. Tags []SymbolTag `json:"tags,omitempty"`
  5200. // More detail for this item, e.g. the signature of a function.
  5201. Detail string `json:"detail,omitempty"`
  5202. // The resource identifier of this item.
  5203. URI DocumentUri `json:"uri"`
  5204. // The range enclosing this symbol not including leading/trailing whitespace
  5205. // but everything else, e.g. comments and code.
  5206. Range Range `json:"range"`
  5207. // The range that should be selected and revealed when this symbol is being
  5208. // picked, e.g. the name of a function. Must be contained by the
  5209. // {@link TypeHierarchyItem.range `range`}.
  5210. SelectionRange Range `json:"selectionRange"`
  5211. // A data entry field that is preserved between a type hierarchy prepare and
  5212. // supertypes or subtypes requests. It could also be used to identify the
  5213. // type hierarchy in the server, helping improve the performance on
  5214. // resolving supertypes and subtypes.
  5215. Data interface{} `json:"data,omitempty"`
  5216. }
  5217. // Type hierarchy options used during static registration.
  5218. //
  5219. // @since 3.17.0
  5220. //
  5221. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchyOptions
  5222. type TypeHierarchyOptions struct {
  5223. WorkDoneProgressOptions
  5224. }
  5225. // The parameter of a `textDocument/prepareTypeHierarchy` request.
  5226. //
  5227. // @since 3.17.0
  5228. //
  5229. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchyPrepareParams
  5230. type TypeHierarchyPrepareParams struct {
  5231. TextDocumentPositionParams
  5232. WorkDoneProgressParams
  5233. }
  5234. // Type hierarchy options used during static or dynamic registration.
  5235. //
  5236. // @since 3.17.0
  5237. //
  5238. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchyRegistrationOptions
  5239. type TypeHierarchyRegistrationOptions struct {
  5240. TextDocumentRegistrationOptions
  5241. TypeHierarchyOptions
  5242. StaticRegistrationOptions
  5243. }
  5244. // The parameter of a `typeHierarchy/subtypes` request.
  5245. //
  5246. // @since 3.17.0
  5247. //
  5248. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchySubtypesParams
  5249. type TypeHierarchySubtypesParams struct {
  5250. Item TypeHierarchyItem `json:"item"`
  5251. WorkDoneProgressParams
  5252. PartialResultParams
  5253. }
  5254. // The parameter of a `typeHierarchy/supertypes` request.
  5255. //
  5256. // @since 3.17.0
  5257. //
  5258. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#typeHierarchySupertypesParams
  5259. type TypeHierarchySupertypesParams struct {
  5260. Item TypeHierarchyItem `json:"item"`
  5261. WorkDoneProgressParams
  5262. PartialResultParams
  5263. }
  5264. // A diagnostic report indicating that the last returned
  5265. // report is still accurate.
  5266. //
  5267. // @since 3.17.0
  5268. //
  5269. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#unchangedDocumentDiagnosticReport
  5270. type UnchangedDocumentDiagnosticReport struct {
  5271. // A document diagnostic report indicating
  5272. // no changes to the last result. A server can
  5273. // only return `unchanged` if result ids are
  5274. // provided.
  5275. Kind string `json:"kind"`
  5276. // A result id which will be sent on the next
  5277. // diagnostic request for the same document.
  5278. ResultID string `json:"resultId"`
  5279. }
  5280. // Moniker uniqueness level to define scope of the moniker.
  5281. //
  5282. // @since 3.16.0
  5283. type UniquenessLevel string
  5284. // General parameters to unregister a request or notification.
  5285. //
  5286. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#unregistration
  5287. type Unregistration struct {
  5288. // The id used to unregister the request or notification. Usually an id
  5289. // provided during the register request.
  5290. ID string `json:"id"`
  5291. // The method to unregister for.
  5292. Method string `json:"method"`
  5293. }
  5294. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#unregistrationParams
  5295. type UnregistrationParams struct {
  5296. Unregisterations []Unregistration `json:"unregisterations"`
  5297. }
  5298. // A versioned notebook document identifier.
  5299. //
  5300. // @since 3.17.0
  5301. //
  5302. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#versionedNotebookDocumentIdentifier
  5303. type VersionedNotebookDocumentIdentifier struct {
  5304. // The version number of this notebook document.
  5305. Version int32 `json:"version"`
  5306. // The notebook document's uri.
  5307. URI URI `json:"uri"`
  5308. }
  5309. // A text document identifier to denote a specific version of a text document.
  5310. //
  5311. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#versionedTextDocumentIdentifier
  5312. type VersionedTextDocumentIdentifier struct {
  5313. // The version number of this document.
  5314. Version int32 `json:"version"`
  5315. TextDocumentIdentifier
  5316. }
  5317. type WatchKind = uint32 // The parameters sent in a will save text document notification.
  5318. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#willSaveTextDocumentParams
  5319. type WillSaveTextDocumentParams struct {
  5320. // The document that will be saved.
  5321. TextDocument TextDocumentIdentifier `json:"textDocument"`
  5322. // The 'TextDocumentSaveReason'.
  5323. Reason TextDocumentSaveReason `json:"reason"`
  5324. }
  5325. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#windowClientCapabilities
  5326. type WindowClientCapabilities struct {
  5327. // It indicates whether the client supports server initiated
  5328. // progress using the `window/workDoneProgress/create` request.
  5329. //
  5330. // The capability also controls Whether client supports handling
  5331. // of progress notifications. If set servers are allowed to report a
  5332. // `workDoneProgress` property in the request specific server
  5333. // capabilities.
  5334. //
  5335. // @since 3.15.0
  5336. WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
  5337. // Capabilities specific to the showMessage request.
  5338. //
  5339. // @since 3.16.0
  5340. ShowMessage *ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
  5341. // Capabilities specific to the showDocument request.
  5342. //
  5343. // @since 3.16.0
  5344. ShowDocument *ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
  5345. }
  5346. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressBegin
  5347. type WorkDoneProgressBegin struct {
  5348. Kind string `json:"kind"`
  5349. // Mandatory title of the progress operation. Used to briefly inform about
  5350. // the kind of operation being performed.
  5351. //
  5352. // Examples: "Indexing" or "Linking dependencies".
  5353. Title string `json:"title"`
  5354. // Controls if a cancel button should show to allow the user to cancel the
  5355. // long running operation. Clients that don't support cancellation are allowed
  5356. // to ignore the setting.
  5357. Cancellable bool `json:"cancellable,omitempty"`
  5358. // Optional, more detailed associated progress message. Contains
  5359. // complementary information to the `title`.
  5360. //
  5361. // Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
  5362. // If unset, the previous progress message (if any) is still valid.
  5363. Message string `json:"message,omitempty"`
  5364. // Optional progress percentage to display (value 100 is considered 100%).
  5365. // If not provided infinite progress is assumed and clients are allowed
  5366. // to ignore the `percentage` value in subsequent in report notifications.
  5367. //
  5368. // The value should be steadily rising. Clients are free to ignore values
  5369. // that are not following this rule. The value range is [0, 100].
  5370. Percentage uint32 `json:"percentage,omitempty"`
  5371. }
  5372. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressCancelParams
  5373. type WorkDoneProgressCancelParams struct {
  5374. // The token to be used to report progress.
  5375. Token ProgressToken `json:"token"`
  5376. }
  5377. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressCreateParams
  5378. type WorkDoneProgressCreateParams struct {
  5379. // The token to be used to report progress.
  5380. Token ProgressToken `json:"token"`
  5381. }
  5382. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressEnd
  5383. type WorkDoneProgressEnd struct {
  5384. Kind string `json:"kind"`
  5385. // Optional, a final message indicating to for example indicate the outcome
  5386. // of the operation.
  5387. Message string `json:"message,omitempty"`
  5388. }
  5389. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressOptions
  5390. type WorkDoneProgressOptions struct {
  5391. WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
  5392. }
  5393. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressParams
  5394. type WorkDoneProgressParams struct {
  5395. // An optional token that a server can use to report work done progress.
  5396. WorkDoneToken ProgressToken `json:"workDoneToken,omitempty"`
  5397. }
  5398. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workDoneProgressReport
  5399. type WorkDoneProgressReport struct {
  5400. Kind string `json:"kind"`
  5401. // Controls enablement state of a cancel button.
  5402. //
  5403. // Clients that don't support cancellation or don't support controlling the button's
  5404. // enablement state are allowed to ignore the property.
  5405. Cancellable bool `json:"cancellable,omitempty"`
  5406. // Optional, more detailed associated progress message. Contains
  5407. // complementary information to the `title`.
  5408. //
  5409. // Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
  5410. // If unset, the previous progress message (if any) is still valid.
  5411. Message string `json:"message,omitempty"`
  5412. // Optional progress percentage to display (value 100 is considered 100%).
  5413. // If not provided infinite progress is assumed and clients are allowed
  5414. // to ignore the `percentage` value in subsequent in report notifications.
  5415. //
  5416. // The value should be steadily rising. Clients are free to ignore values
  5417. // that are not following this rule. The value range is [0, 100]
  5418. Percentage uint32 `json:"percentage,omitempty"`
  5419. }
  5420. // Workspace specific client capabilities.
  5421. //
  5422. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceClientCapabilities
  5423. type WorkspaceClientCapabilities struct {
  5424. // The client supports applying batch edits
  5425. // to the workspace by supporting the request
  5426. // 'workspace/applyEdit'
  5427. ApplyEdit bool `json:"applyEdit,omitempty"`
  5428. // Capabilities specific to `WorkspaceEdit`s.
  5429. WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
  5430. // Capabilities specific to the `workspace/didChangeConfiguration` notification.
  5431. DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
  5432. // Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
  5433. DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
  5434. // Capabilities specific to the `workspace/symbol` request.
  5435. Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
  5436. // Capabilities specific to the `workspace/executeCommand` request.
  5437. ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
  5438. // The client has support for workspace folders.
  5439. //
  5440. // @since 3.6.0
  5441. WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
  5442. // The client supports `workspace/configuration` requests.
  5443. //
  5444. // @since 3.6.0
  5445. Configuration bool `json:"configuration,omitempty"`
  5446. // Capabilities specific to the semantic token requests scoped to the
  5447. // workspace.
  5448. //
  5449. // @since 3.16.0.
  5450. SemanticTokens *SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
  5451. // Capabilities specific to the code lens requests scoped to the
  5452. // workspace.
  5453. //
  5454. // @since 3.16.0.
  5455. CodeLens *CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
  5456. // The client has support for file notifications/requests for user operations on files.
  5457. //
  5458. // Since 3.16.0
  5459. FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitempty"`
  5460. // Capabilities specific to the inline values requests scoped to the
  5461. // workspace.
  5462. //
  5463. // @since 3.17.0.
  5464. InlineValue *InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
  5465. // Capabilities specific to the inlay hint requests scoped to the
  5466. // workspace.
  5467. //
  5468. // @since 3.17.0.
  5469. InlayHint *InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
  5470. // Capabilities specific to the diagnostic requests scoped to the
  5471. // workspace.
  5472. //
  5473. // @since 3.17.0.
  5474. Diagnostics *DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitempty"`
  5475. // Capabilities specific to the folding range requests scoped to the workspace.
  5476. //
  5477. // @since 3.18.0
  5478. // @proposed
  5479. FoldingRange *FoldingRangeWorkspaceClientCapabilities `json:"foldingRange,omitempty"`
  5480. // Capabilities specific to the `workspace/textDocumentContent` request.
  5481. //
  5482. // @since 3.18.0
  5483. // @proposed
  5484. TextDocumentContent *TextDocumentContentClientCapabilities `json:"textDocumentContent,omitempty"`
  5485. }
  5486. // Parameters of the workspace diagnostic request.
  5487. //
  5488. // @since 3.17.0
  5489. //
  5490. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceDiagnosticParams
  5491. type WorkspaceDiagnosticParams struct {
  5492. // The additional identifier provided during registration.
  5493. Identifier string `json:"identifier,omitempty"`
  5494. // The currently known diagnostic reports with their
  5495. // previous result ids.
  5496. PreviousResultIds []PreviousResultId `json:"previousResultIds"`
  5497. WorkDoneProgressParams
  5498. PartialResultParams
  5499. }
  5500. // A workspace diagnostic report.
  5501. //
  5502. // @since 3.17.0
  5503. //
  5504. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceDiagnosticReport
  5505. type WorkspaceDiagnosticReport struct {
  5506. Items []WorkspaceDocumentDiagnosticReport `json:"items"`
  5507. }
  5508. // A partial result for a workspace diagnostic report.
  5509. //
  5510. // @since 3.17.0
  5511. //
  5512. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceDiagnosticReportPartialResult
  5513. type WorkspaceDiagnosticReportPartialResult struct {
  5514. Items []WorkspaceDocumentDiagnosticReport `json:"items"`
  5515. }
  5516. // A workspace diagnostic document report.
  5517. //
  5518. // @since 3.17.0
  5519. //
  5520. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceDocumentDiagnosticReport
  5521. type WorkspaceDocumentDiagnosticReport = Or_WorkspaceDocumentDiagnosticReport // (alias)
  5522. // A workspace edit represents changes to many resources managed in the workspace. The edit
  5523. // should either provide `changes` or `documentChanges`. If documentChanges are present
  5524. // they are preferred over `changes` if the client can handle versioned document edits.
  5525. //
  5526. // Since version 3.13.0 a workspace edit can contain resource operations as well. If resource
  5527. // operations are present clients need to execute the operations in the order in which they
  5528. // are provided. So a workspace edit for example can consist of the following two changes:
  5529. // (1) a create file a.txt and (2) a text document edit which insert text into file a.txt.
  5530. //
  5531. // An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will
  5532. // cause failure of the operation. How the client recovers from the failure is described by
  5533. // the client capability: `workspace.workspaceEdit.failureHandling`
  5534. //
  5535. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceEdit
  5536. type WorkspaceEdit struct {
  5537. // Holds changes to existing resources.
  5538. Changes map[DocumentUri][]TextEdit `json:"changes,omitempty"`
  5539. // Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
  5540. // are either an array of `TextDocumentEdit`s to express changes to n different text documents
  5541. // where each text document edit addresses a specific version of a text document. Or it can contain
  5542. // above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
  5543. //
  5544. // Whether a client supports versioned document edits is expressed via
  5545. // `workspace.workspaceEdit.documentChanges` client capability.
  5546. //
  5547. // If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
  5548. // only plain `TextEdit`s using the `changes` property are supported.
  5549. DocumentChanges []DocumentChange `json:"documentChanges,omitempty"`
  5550. // A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and
  5551. // delete file / folder operations.
  5552. //
  5553. // Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.
  5554. //
  5555. // @since 3.16.0
  5556. ChangeAnnotations map[ChangeAnnotationIdentifier]ChangeAnnotation `json:"changeAnnotations,omitempty"`
  5557. }
  5558. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceEditClientCapabilities
  5559. type WorkspaceEditClientCapabilities struct {
  5560. // The client supports versioned document changes in `WorkspaceEdit`s
  5561. DocumentChanges bool `json:"documentChanges,omitempty"`
  5562. // The resource operations the client supports. Clients should at least
  5563. // support 'create', 'rename' and 'delete' files and folders.
  5564. //
  5565. // @since 3.13.0
  5566. ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"`
  5567. // The failure handling strategy of a client if applying the workspace edit
  5568. // fails.
  5569. //
  5570. // @since 3.13.0
  5571. FailureHandling *FailureHandlingKind `json:"failureHandling,omitempty"`
  5572. // Whether the client normalizes line endings to the client specific
  5573. // setting.
  5574. // If set to `true` the client will normalize line ending characters
  5575. // in a workspace edit to the client-specified new line
  5576. // character.
  5577. //
  5578. // @since 3.16.0
  5579. NormalizesLineEndings bool `json:"normalizesLineEndings,omitempty"`
  5580. // Whether the client in general supports change annotations on text edits,
  5581. // create file, rename file and delete file changes.
  5582. //
  5583. // @since 3.16.0
  5584. ChangeAnnotationSupport *ChangeAnnotationsSupportOptions `json:"changeAnnotationSupport,omitempty"`
  5585. // Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s.
  5586. //
  5587. // @since 3.18.0
  5588. // @proposed
  5589. MetadataSupport bool `json:"metadataSupport,omitempty"`
  5590. // Whether the client supports snippets as text edits.
  5591. //
  5592. // @since 3.18.0
  5593. // @proposed
  5594. SnippetEditSupport bool `json:"snippetEditSupport,omitempty"`
  5595. }
  5596. // Additional data about a workspace edit.
  5597. //
  5598. // @since 3.18.0
  5599. // @proposed
  5600. //
  5601. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceEditMetadata
  5602. type WorkspaceEditMetadata struct {
  5603. // Signal to the editor that this edit is a refactoring.
  5604. IsRefactoring bool `json:"isRefactoring,omitempty"`
  5605. }
  5606. // A workspace folder inside a client.
  5607. //
  5608. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceFolder
  5609. type WorkspaceFolder struct {
  5610. // The associated URI for this workspace folder.
  5611. URI URI `json:"uri"`
  5612. // The name of the workspace folder. Used to refer to this
  5613. // workspace folder in the user interface.
  5614. Name string `json:"name"`
  5615. }
  5616. // The workspace folder change event.
  5617. //
  5618. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceFoldersChangeEvent
  5619. type WorkspaceFoldersChangeEvent struct {
  5620. // The array of added workspace folders
  5621. Added []WorkspaceFolder `json:"added"`
  5622. // The array of the removed workspace folders
  5623. Removed []WorkspaceFolder `json:"removed"`
  5624. }
  5625. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceFoldersInitializeParams
  5626. type WorkspaceFoldersInitializeParams struct {
  5627. // The workspace folders configured in the client when the server starts.
  5628. //
  5629. // This property is only available if the client supports workspace folders.
  5630. // It can be `null` if the client supports workspace folders but none are
  5631. // configured.
  5632. //
  5633. // @since 3.6.0
  5634. WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders,omitempty"`
  5635. }
  5636. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceFoldersServerCapabilities
  5637. type WorkspaceFoldersServerCapabilities struct {
  5638. // The server has support for workspace folders
  5639. Supported bool `json:"supported,omitempty"`
  5640. // Whether the server wants to receive workspace folder
  5641. // change notifications.
  5642. //
  5643. // If a string is provided the string is treated as an ID
  5644. // under which the notification is registered on the client
  5645. // side. The ID can be used to unregister for these events
  5646. // using the `client/unregisterCapability` request.
  5647. ChangeNotifications *Or_WorkspaceFoldersServerCapabilities_changeNotifications `json:"changeNotifications,omitempty"`
  5648. }
  5649. // A full document diagnostic report for a workspace diagnostic result.
  5650. //
  5651. // @since 3.17.0
  5652. //
  5653. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceFullDocumentDiagnosticReport
  5654. type WorkspaceFullDocumentDiagnosticReport struct {
  5655. // The URI for which diagnostic information is reported.
  5656. URI DocumentUri `json:"uri"`
  5657. // The version number for which the diagnostics are reported.
  5658. // If the document is not marked as open `null` can be provided.
  5659. Version int32 `json:"version"`
  5660. FullDocumentDiagnosticReport
  5661. }
  5662. // Defines workspace specific capabilities of the server.
  5663. //
  5664. // @since 3.18.0
  5665. //
  5666. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceOptions
  5667. type WorkspaceOptions struct {
  5668. // The server supports workspace folder.
  5669. //
  5670. // @since 3.6.0
  5671. WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitempty"`
  5672. // The server is interested in notifications/requests for operations on files.
  5673. //
  5674. // @since 3.16.0
  5675. FileOperations *FileOperationOptions `json:"fileOperations,omitempty"`
  5676. // The server supports the `workspace/textDocumentContent` request.
  5677. //
  5678. // @since 3.18.0
  5679. // @proposed
  5680. TextDocumentContent *Or_WorkspaceOptions_textDocumentContent `json:"textDocumentContent,omitempty"`
  5681. }
  5682. // A special workspace symbol that supports locations without a range.
  5683. //
  5684. // See also SymbolInformation.
  5685. //
  5686. // @since 3.17.0
  5687. //
  5688. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceSymbol
  5689. type WorkspaceSymbol struct {
  5690. // The location of the symbol. Whether a server is allowed to
  5691. // return a location without a range depends on the client
  5692. // capability `workspace.symbol.resolveSupport`.
  5693. //
  5694. // See SymbolInformation#location for more details.
  5695. Location Or_WorkspaceSymbol_location `json:"location"`
  5696. // A data entry field that is preserved on a workspace symbol between a
  5697. // workspace symbol request and a workspace symbol resolve request.
  5698. Data interface{} `json:"data,omitempty"`
  5699. BaseSymbolInformation
  5700. }
  5701. // Client capabilities for a {@link WorkspaceSymbolRequest}.
  5702. //
  5703. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceSymbolClientCapabilities
  5704. type WorkspaceSymbolClientCapabilities struct {
  5705. // Symbol request supports dynamic registration.
  5706. DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
  5707. // Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
  5708. SymbolKind *ClientSymbolKindOptions `json:"symbolKind,omitempty"`
  5709. // The client supports tags on `SymbolInformation`.
  5710. // Clients supporting tags have to handle unknown tags gracefully.
  5711. //
  5712. // @since 3.16.0
  5713. TagSupport *ClientSymbolTagOptions `json:"tagSupport,omitempty"`
  5714. // The client support partial workspace symbols. The client will send the
  5715. // request `workspaceSymbol/resolve` to the server to resolve additional
  5716. // properties.
  5717. //
  5718. // @since 3.17.0
  5719. ResolveSupport *ClientSymbolResolveOptions `json:"resolveSupport,omitempty"`
  5720. }
  5721. // Server capabilities for a {@link WorkspaceSymbolRequest}.
  5722. //
  5723. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceSymbolOptions
  5724. type WorkspaceSymbolOptions struct {
  5725. // The server provides support to resolve additional
  5726. // information for a workspace symbol.
  5727. //
  5728. // @since 3.17.0
  5729. ResolveProvider bool `json:"resolveProvider,omitempty"`
  5730. WorkDoneProgressOptions
  5731. }
  5732. // The parameters of a {@link WorkspaceSymbolRequest}.
  5733. //
  5734. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceSymbolParams
  5735. type WorkspaceSymbolParams struct {
  5736. // A query string to filter symbols by. Clients may send an empty
  5737. // string here to request all symbols.
  5738. //
  5739. // The `query`-parameter should be interpreted in a *relaxed way* as editors
  5740. // will apply their own highlighting and scoring on the results. A good rule
  5741. // of thumb is to match case-insensitive and to simply check that the
  5742. // characters of *query* appear in their order in a candidate symbol.
  5743. // Servers shouldn't use prefix, substring, or similar strict matching.
  5744. Query string `json:"query"`
  5745. WorkDoneProgressParams
  5746. PartialResultParams
  5747. }
  5748. // Registration options for a {@link WorkspaceSymbolRequest}.
  5749. //
  5750. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceSymbolRegistrationOptions
  5751. type WorkspaceSymbolRegistrationOptions struct {
  5752. WorkspaceSymbolOptions
  5753. }
  5754. // An unchanged document diagnostic report for a workspace diagnostic result.
  5755. //
  5756. // @since 3.17.0
  5757. //
  5758. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#workspaceUnchangedDocumentDiagnosticReport
  5759. type WorkspaceUnchangedDocumentDiagnosticReport struct {
  5760. // The URI for which diagnostic information is reported.
  5761. URI DocumentUri `json:"uri"`
  5762. // The version number for which the diagnostics are reported.
  5763. // If the document is not marked as open `null` can be provided.
  5764. Version int32 `json:"version"`
  5765. UnchangedDocumentDiagnosticReport
  5766. }
  5767. // The initialize parameters
  5768. //
  5769. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#_InitializeParams
  5770. type XInitializeParams struct {
  5771. // The process Id of the parent process that started
  5772. // the server.
  5773. //
  5774. // Is `null` if the process has not been started by another process.
  5775. // If the parent process is not alive then the server should exit.
  5776. ProcessID int32 `json:"processId"`
  5777. // Information about the client
  5778. //
  5779. // @since 3.15.0
  5780. ClientInfo *ClientInfo `json:"clientInfo,omitempty"`
  5781. // The locale the client is currently showing the user interface
  5782. // in. This must not necessarily be the locale of the operating
  5783. // system.
  5784. //
  5785. // Uses IETF language tags as the value's syntax
  5786. // (See https://en.wikipedia.org/wiki/IETF_language_tag)
  5787. //
  5788. // @since 3.16.0
  5789. Locale string `json:"locale,omitempty"`
  5790. // The rootPath of the workspace. Is null
  5791. // if no folder is open.
  5792. //
  5793. // @deprecated in favour of rootUri.
  5794. RootPath string `json:"rootPath,omitempty"`
  5795. // The rootUri of the workspace. Is null if no
  5796. // folder is open. If both `rootPath` and `rootUri` are set
  5797. // `rootUri` wins.
  5798. //
  5799. // @deprecated in favour of workspaceFolders.
  5800. RootURI DocumentUri `json:"rootUri"`
  5801. // The capabilities provided by the client (editor or tool)
  5802. Capabilities ClientCapabilities `json:"capabilities"`
  5803. // User provided initialization options.
  5804. InitializationOptions interface{} `json:"initializationOptions,omitempty"`
  5805. // The initial trace setting. If omitted trace is disabled ('off').
  5806. Trace *TraceValue `json:"trace,omitempty"`
  5807. WorkDoneProgressParams
  5808. }
  5809. // The initialize parameters
  5810. //
  5811. // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification#_InitializeParams
  5812. type _InitializeParams struct {
  5813. // The process Id of the parent process that started
  5814. // the server.
  5815. //
  5816. // Is `null` if the process has not been started by another process.
  5817. // If the parent process is not alive then the server should exit.
  5818. ProcessID int32 `json:"processId"`
  5819. // Information about the client
  5820. //
  5821. // @since 3.15.0
  5822. ClientInfo *ClientInfo `json:"clientInfo,omitempty"`
  5823. // The locale the client is currently showing the user interface
  5824. // in. This must not necessarily be the locale of the operating
  5825. // system.
  5826. //
  5827. // Uses IETF language tags as the value's syntax
  5828. // (See https://en.wikipedia.org/wiki/IETF_language_tag)
  5829. //
  5830. // @since 3.16.0
  5831. Locale string `json:"locale,omitempty"`
  5832. // The rootPath of the workspace. Is null
  5833. // if no folder is open.
  5834. //
  5835. // @deprecated in favour of rootUri.
  5836. RootPath string `json:"rootPath,omitempty"`
  5837. // The rootUri of the workspace. Is null if no
  5838. // folder is open. If both `rootPath` and `rootUri` are set
  5839. // `rootUri` wins.
  5840. //
  5841. // @deprecated in favour of workspaceFolders.
  5842. RootURI DocumentUri `json:"rootUri"`
  5843. // The capabilities provided by the client (editor or tool)
  5844. Capabilities ClientCapabilities `json:"capabilities"`
  5845. // User provided initialization options.
  5846. InitializationOptions interface{} `json:"initializationOptions,omitempty"`
  5847. // The initial trace setting. If omitted trace is disabled ('off').
  5848. Trace *TraceValue `json:"trace,omitempty"`
  5849. WorkDoneProgressParams
  5850. }
  5851. const (
  5852. // A set of predefined code action kinds
  5853. // Empty kind.
  5854. Empty CodeActionKind = ""
  5855. // Base kind for quickfix actions: 'quickfix'
  5856. QuickFix CodeActionKind = "quickfix"
  5857. // Base kind for refactoring actions: 'refactor'
  5858. Refactor CodeActionKind = "refactor"
  5859. // Base kind for refactoring extraction actions: 'refactor.extract'
  5860. //
  5861. // Example extract actions:
  5862. //
  5863. //
  5864. // - Extract method
  5865. // - Extract function
  5866. // - Extract variable
  5867. // - Extract interface from class
  5868. // - ...
  5869. RefactorExtract CodeActionKind = "refactor.extract"
  5870. // Base kind for refactoring inline actions: 'refactor.inline'
  5871. //
  5872. // Example inline actions:
  5873. //
  5874. //
  5875. // - Inline function
  5876. // - Inline variable
  5877. // - Inline constant
  5878. // - ...
  5879. RefactorInline CodeActionKind = "refactor.inline"
  5880. // Base kind for refactoring move actions: `refactor.move`
  5881. //
  5882. // Example move actions:
  5883. //
  5884. //
  5885. // - Move a function to a new file
  5886. // - Move a property between classes
  5887. // - Move method to base class
  5888. // - ...
  5889. //
  5890. // @since 3.18.0
  5891. // @proposed
  5892. RefactorMove CodeActionKind = "refactor.move"
  5893. // Base kind for refactoring rewrite actions: 'refactor.rewrite'
  5894. //
  5895. // Example rewrite actions:
  5896. //
  5897. //
  5898. // - Convert JavaScript function to class
  5899. // - Add or remove parameter
  5900. // - Encapsulate field
  5901. // - Make method static
  5902. // - Move method to base class
  5903. // - ...
  5904. RefactorRewrite CodeActionKind = "refactor.rewrite"
  5905. // Base kind for source actions: `source`
  5906. //
  5907. // Source code actions apply to the entire file.
  5908. Source CodeActionKind = "source"
  5909. // Base kind for an organize imports source action: `source.organizeImports`
  5910. SourceOrganizeImports CodeActionKind = "source.organizeImports"
  5911. // Base kind for auto-fix source actions: `source.fixAll`.
  5912. //
  5913. // Fix all actions automatically fix errors that have a clear fix that do not require user input.
  5914. // They should not suppress errors or perform unsafe fixes such as generating new types or classes.
  5915. //
  5916. // @since 3.15.0
  5917. SourceFixAll CodeActionKind = "source.fixAll"
  5918. // Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using
  5919. // this should always begin with `notebook.`
  5920. //
  5921. // @since 3.18.0
  5922. Notebook CodeActionKind = "notebook"
  5923. // The reason why code actions were requested.
  5924. //
  5925. // @since 3.17.0
  5926. // Code actions were explicitly requested by the user or by an extension.
  5927. CodeActionInvoked CodeActionTriggerKind = 1
  5928. // Code actions were requested automatically.
  5929. //
  5930. // This typically happens when current selection in a file changes, but can
  5931. // also be triggered when file content changes.
  5932. CodeActionAutomatic CodeActionTriggerKind = 2
  5933. // The kind of a completion entry.
  5934. TextCompletion CompletionItemKind = 1
  5935. MethodCompletion CompletionItemKind = 2
  5936. FunctionCompletion CompletionItemKind = 3
  5937. ConstructorCompletion CompletionItemKind = 4
  5938. FieldCompletion CompletionItemKind = 5
  5939. VariableCompletion CompletionItemKind = 6
  5940. ClassCompletion CompletionItemKind = 7
  5941. InterfaceCompletion CompletionItemKind = 8
  5942. ModuleCompletion CompletionItemKind = 9
  5943. PropertyCompletion CompletionItemKind = 10
  5944. UnitCompletion CompletionItemKind = 11
  5945. ValueCompletion CompletionItemKind = 12
  5946. EnumCompletion CompletionItemKind = 13
  5947. KeywordCompletion CompletionItemKind = 14
  5948. SnippetCompletion CompletionItemKind = 15
  5949. ColorCompletion CompletionItemKind = 16
  5950. FileCompletion CompletionItemKind = 17
  5951. ReferenceCompletion CompletionItemKind = 18
  5952. FolderCompletion CompletionItemKind = 19
  5953. EnumMemberCompletion CompletionItemKind = 20
  5954. ConstantCompletion CompletionItemKind = 21
  5955. StructCompletion CompletionItemKind = 22
  5956. EventCompletion CompletionItemKind = 23
  5957. OperatorCompletion CompletionItemKind = 24
  5958. TypeParameterCompletion CompletionItemKind = 25
  5959. // Completion item tags are extra annotations that tweak the rendering of a completion
  5960. // item.
  5961. //
  5962. // @since 3.15.0
  5963. // Render a completion as obsolete, usually using a strike-out.
  5964. ComplDeprecated CompletionItemTag = 1
  5965. // How a completion was triggered
  5966. // Completion was triggered by typing an identifier (24x7 code
  5967. // complete), manual invocation (e.g Ctrl+Space) or via API.
  5968. Invoked CompletionTriggerKind = 1
  5969. // Completion was triggered by a trigger character specified by
  5970. // the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
  5971. TriggerCharacter CompletionTriggerKind = 2
  5972. // Completion was re-triggered as current completion list is incomplete
  5973. TriggerForIncompleteCompletions CompletionTriggerKind = 3
  5974. // The diagnostic's severity.
  5975. // Reports an error.
  5976. SeverityError DiagnosticSeverity = 1
  5977. // Reports a warning.
  5978. SeverityWarning DiagnosticSeverity = 2
  5979. // Reports an information.
  5980. SeverityInformation DiagnosticSeverity = 3
  5981. // Reports a hint.
  5982. SeverityHint DiagnosticSeverity = 4
  5983. // The diagnostic tags.
  5984. //
  5985. // @since 3.15.0
  5986. // Unused or unnecessary code.
  5987. //
  5988. // Clients are allowed to render diagnostics with this tag faded out instead of having
  5989. // an error squiggle.
  5990. Unnecessary DiagnosticTag = 1
  5991. // Deprecated or obsolete code.
  5992. //
  5993. // Clients are allowed to rendered diagnostics with this tag strike through.
  5994. Deprecated DiagnosticTag = 2
  5995. // The document diagnostic report kinds.
  5996. //
  5997. // @since 3.17.0
  5998. // A diagnostic report with a full
  5999. // set of problems.
  6000. DiagnosticFull DocumentDiagnosticReportKind = "full"
  6001. // A report indicating that the last
  6002. // returned report is still accurate.
  6003. DiagnosticUnchanged DocumentDiagnosticReportKind = "unchanged"
  6004. // A document highlight kind.
  6005. // A textual occurrence.
  6006. Text DocumentHighlightKind = 1
  6007. // Read-access of a symbol, like reading a variable.
  6008. Read DocumentHighlightKind = 2
  6009. // Write-access of a symbol, like writing to a variable.
  6010. Write DocumentHighlightKind = 3
  6011. // Predefined error codes.
  6012. ParseError ErrorCodes = -32700
  6013. InvalidRequest ErrorCodes = -32600
  6014. MethodNotFound ErrorCodes = -32601
  6015. InvalidParams ErrorCodes = -32602
  6016. InternalError ErrorCodes = -32603
  6017. // Error code indicating that a server received a notification or
  6018. // request before the server has received the `initialize` request.
  6019. ServerNotInitialized ErrorCodes = -32002
  6020. UnknownErrorCode ErrorCodes = -32001
  6021. // Applying the workspace change is simply aborted if one of the changes provided
  6022. // fails. All operations executed before the failing operation stay executed.
  6023. Abort FailureHandlingKind = "abort"
  6024. // All operations are executed transactional. That means they either all
  6025. // succeed or no changes at all are applied to the workspace.
  6026. Transactional FailureHandlingKind = "transactional"
  6027. // If the workspace edit contains only textual file changes they are executed transactional.
  6028. // If resource changes (create, rename or delete file) are part of the change the failure
  6029. // handling strategy is abort.
  6030. TextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"
  6031. // The client tries to undo the operations already executed. But there is no
  6032. // guarantee that this is succeeding.
  6033. Undo FailureHandlingKind = "undo"
  6034. // The file event type
  6035. // The file got created.
  6036. Created FileChangeType = 1
  6037. // The file got changed.
  6038. Changed FileChangeType = 2
  6039. // The file got deleted.
  6040. Deleted FileChangeType = 3
  6041. // A pattern kind describing if a glob pattern matches a file a folder or
  6042. // both.
  6043. //
  6044. // @since 3.16.0
  6045. // The pattern matches a file only.
  6046. FilePattern FileOperationPatternKind = "file"
  6047. // The pattern matches a folder only.
  6048. FolderPattern FileOperationPatternKind = "folder"
  6049. // A set of predefined range kinds.
  6050. // Folding range for a comment
  6051. Comment FoldingRangeKind = "comment"
  6052. // Folding range for an import or include
  6053. Imports FoldingRangeKind = "imports"
  6054. // Folding range for a region (e.g. `#region`)
  6055. Region FoldingRangeKind = "region"
  6056. // Inlay hint kinds.
  6057. //
  6058. // @since 3.17.0
  6059. // An inlay hint that for a type annotation.
  6060. Type InlayHintKind = 1
  6061. // An inlay hint that is for a parameter.
  6062. Parameter InlayHintKind = 2
  6063. // Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
  6064. //
  6065. // @since 3.18.0
  6066. // @proposed
  6067. // Completion was triggered explicitly by a user gesture.
  6068. InlineInvoked InlineCompletionTriggerKind = 1
  6069. // Completion was triggered automatically while editing.
  6070. InlineAutomatic InlineCompletionTriggerKind = 2
  6071. // Defines whether the insert text in a completion item should be interpreted as
  6072. // plain text or a snippet.
  6073. // The primary text to be inserted is treated as a plain string.
  6074. PlainTextTextFormat InsertTextFormat = 1
  6075. // The primary text to be inserted is treated as a snippet.
  6076. //
  6077. // A snippet can define tab stops and placeholders with `$1`, `$2`
  6078. // and `${3:foo}`. `$0` defines the final tab stop, it defaults to
  6079. // the end of the snippet. Placeholders with equal identifiers are linked,
  6080. // that is typing in one will update others too.
  6081. //
  6082. // See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
  6083. SnippetTextFormat InsertTextFormat = 2
  6084. // How whitespace and indentation is handled during completion
  6085. // item insertion.
  6086. //
  6087. // @since 3.16.0
  6088. // The insertion or replace strings is taken as it is. If the
  6089. // value is multi line the lines below the cursor will be
  6090. // inserted using the indentation defined in the string value.
  6091. // The client will not apply any kind of adjustments to the
  6092. // string.
  6093. AsIs InsertTextMode = 1
  6094. // The editor adjusts leading whitespace of new lines so that
  6095. // they match the indentation up to the cursor of the line for
  6096. // which the item is accepted.
  6097. //
  6098. // Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
  6099. // multi line completion item is indented using 2 tabs and all
  6100. // following lines inserted will be indented using 2 tabs as well.
  6101. AdjustIndentation InsertTextMode = 2
  6102. // A request failed but it was syntactically correct, e.g the
  6103. // method name was known and the parameters were valid. The error
  6104. // message should contain human readable information about why
  6105. // the request failed.
  6106. //
  6107. // @since 3.17.0
  6108. RequestFailed LSPErrorCodes = -32803
  6109. // The server cancelled the request. This error code should
  6110. // only be used for requests that explicitly support being
  6111. // server cancellable.
  6112. //
  6113. // @since 3.17.0
  6114. ServerCancelled LSPErrorCodes = -32802
  6115. // The server detected that the content of a document got
  6116. // modified outside normal conditions. A server should
  6117. // NOT send this error code if it detects a content change
  6118. // in it unprocessed messages. The result even computed
  6119. // on an older state might still be useful for the client.
  6120. //
  6121. // If a client decides that a result is not of any use anymore
  6122. // the client should cancel the request.
  6123. ContentModified LSPErrorCodes = -32801
  6124. // The client has canceled a request and a server has detected
  6125. // the cancel.
  6126. RequestCancelled LSPErrorCodes = -32800
  6127. // Predefined Language kinds
  6128. // @since 3.18.0
  6129. // @proposed
  6130. LangABAP LanguageKind = "abap"
  6131. LangWindowsBat LanguageKind = "bat"
  6132. LangBibTeX LanguageKind = "bibtex"
  6133. LangClojure LanguageKind = "clojure"
  6134. LangCoffeescript LanguageKind = "coffeescript"
  6135. LangC LanguageKind = "c"
  6136. LangCPP LanguageKind = "cpp"
  6137. LangCSharp LanguageKind = "csharp"
  6138. LangCSS LanguageKind = "css"
  6139. // @since 3.18.0
  6140. // @proposed
  6141. LangD LanguageKind = "d"
  6142. // @since 3.18.0
  6143. // @proposed
  6144. LangDelphi LanguageKind = "pascal"
  6145. LangDiff LanguageKind = "diff"
  6146. LangDart LanguageKind = "dart"
  6147. LangDockerfile LanguageKind = "dockerfile"
  6148. LangElixir LanguageKind = "elixir"
  6149. LangErlang LanguageKind = "erlang"
  6150. LangFSharp LanguageKind = "fsharp"
  6151. LangGitCommit LanguageKind = "git-commit"
  6152. LangGitRebase LanguageKind = "rebase"
  6153. LangGo LanguageKind = "go"
  6154. LangGroovy LanguageKind = "groovy"
  6155. LangHandlebars LanguageKind = "handlebars"
  6156. LangHaskell LanguageKind = "haskell"
  6157. LangHTML LanguageKind = "html"
  6158. LangIni LanguageKind = "ini"
  6159. LangJava LanguageKind = "java"
  6160. LangJavaScript LanguageKind = "javascript"
  6161. LangJavaScriptReact LanguageKind = "javascriptreact"
  6162. LangJSON LanguageKind = "json"
  6163. LangLaTeX LanguageKind = "latex"
  6164. LangLess LanguageKind = "less"
  6165. LangLua LanguageKind = "lua"
  6166. LangMakefile LanguageKind = "makefile"
  6167. LangMarkdown LanguageKind = "markdown"
  6168. LangObjectiveC LanguageKind = "objective-c"
  6169. LangObjectiveCPP LanguageKind = "objective-cpp"
  6170. // @since 3.18.0
  6171. // @proposed
  6172. LangPascal LanguageKind = "pascal"
  6173. LangPerl LanguageKind = "perl"
  6174. LangPerl6 LanguageKind = "perl6"
  6175. LangPHP LanguageKind = "php"
  6176. LangPowershell LanguageKind = "powershell"
  6177. LangPug LanguageKind = "jade"
  6178. LangPython LanguageKind = "python"
  6179. LangR LanguageKind = "r"
  6180. LangRazor LanguageKind = "razor"
  6181. LangRuby LanguageKind = "ruby"
  6182. LangRust LanguageKind = "rust"
  6183. LangSCSS LanguageKind = "scss"
  6184. LangSASS LanguageKind = "sass"
  6185. LangScala LanguageKind = "scala"
  6186. LangShaderLab LanguageKind = "shaderlab"
  6187. LangShellScript LanguageKind = "shellscript"
  6188. LangSQL LanguageKind = "sql"
  6189. LangSwift LanguageKind = "swift"
  6190. LangTypeScript LanguageKind = "typescript"
  6191. LangTypeScriptReact LanguageKind = "typescriptreact"
  6192. LangTeX LanguageKind = "tex"
  6193. LangVisualBasic LanguageKind = "vb"
  6194. LangXML LanguageKind = "xml"
  6195. LangXSL LanguageKind = "xsl"
  6196. LangYAML LanguageKind = "yaml"
  6197. // Describes the content type that a client supports in various
  6198. // result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
  6199. //
  6200. // Please note that `MarkupKinds` must not start with a `$`. This kinds
  6201. // are reserved for internal usage.
  6202. // Plain text is supported as a content format
  6203. PlainText MarkupKind = "plaintext"
  6204. // Markdown is supported as a content format
  6205. Markdown MarkupKind = "markdown"
  6206. // The message type
  6207. // An error message.
  6208. Error MessageType = 1
  6209. // A warning message.
  6210. Warning MessageType = 2
  6211. // An information message.
  6212. Info MessageType = 3
  6213. // A log message.
  6214. Log MessageType = 4
  6215. // A debug message.
  6216. //
  6217. // @since 3.18.0
  6218. // @proposed
  6219. Debug MessageType = 5
  6220. // The moniker kind.
  6221. //
  6222. // @since 3.16.0
  6223. // The moniker represent a symbol that is imported into a project
  6224. Import MonikerKind = "import"
  6225. // The moniker represents a symbol that is exported from a project
  6226. Export MonikerKind = "export"
  6227. // The moniker represents a symbol that is local to a project (e.g. a local
  6228. // variable of a function, a class not visible outside the project, ...)
  6229. Local MonikerKind = "local"
  6230. // A notebook cell kind.
  6231. //
  6232. // @since 3.17.0
  6233. // A markup-cell is formatted source that is used for display.
  6234. Markup NotebookCellKind = 1
  6235. // A code-cell is source code.
  6236. Code NotebookCellKind = 2
  6237. // A set of predefined position encoding kinds.
  6238. //
  6239. // @since 3.17.0
  6240. // Character offsets count UTF-8 code units (e.g. bytes).
  6241. UTF8 PositionEncodingKind = "utf-8"
  6242. // Character offsets count UTF-16 code units.
  6243. //
  6244. // This is the default and must always be supported
  6245. // by servers
  6246. UTF16 PositionEncodingKind = "utf-16"
  6247. // Character offsets count UTF-32 code units.
  6248. //
  6249. // Implementation note: these are the same as Unicode codepoints,
  6250. // so this `PositionEncodingKind` may also be used for an
  6251. // encoding-agnostic representation of character offsets.
  6252. UTF32 PositionEncodingKind = "utf-32"
  6253. // The client's default behavior is to select the identifier
  6254. // according the to language's syntax rule.
  6255. Identifier PrepareSupportDefaultBehavior = 1
  6256. // Supports creating new files and folders.
  6257. Create ResourceOperationKind = "create"
  6258. // Supports renaming existing files and folders.
  6259. Rename ResourceOperationKind = "rename"
  6260. // Supports deleting existing files and folders.
  6261. Delete ResourceOperationKind = "delete"
  6262. // A set of predefined token modifiers. This set is not fixed
  6263. // an clients can specify additional token types via the
  6264. // corresponding client capabilities.
  6265. //
  6266. // @since 3.16.0
  6267. ModDeclaration SemanticTokenModifiers = "declaration"
  6268. ModDefinition SemanticTokenModifiers = "definition"
  6269. ModReadonly SemanticTokenModifiers = "readonly"
  6270. ModStatic SemanticTokenModifiers = "static"
  6271. ModDeprecated SemanticTokenModifiers = "deprecated"
  6272. ModAbstract SemanticTokenModifiers = "abstract"
  6273. ModAsync SemanticTokenModifiers = "async"
  6274. ModModification SemanticTokenModifiers = "modification"
  6275. ModDocumentation SemanticTokenModifiers = "documentation"
  6276. ModDefaultLibrary SemanticTokenModifiers = "defaultLibrary"
  6277. // A set of predefined token types. This set is not fixed
  6278. // an clients can specify additional token types via the
  6279. // corresponding client capabilities.
  6280. //
  6281. // @since 3.16.0
  6282. NamespaceType SemanticTokenTypes = "namespace"
  6283. // Represents a generic type. Acts as a fallback for types which can't be mapped to
  6284. // a specific type like class or enum.
  6285. TypeType SemanticTokenTypes = "type"
  6286. ClassType SemanticTokenTypes = "class"
  6287. EnumType SemanticTokenTypes = "enum"
  6288. InterfaceType SemanticTokenTypes = "interface"
  6289. StructType SemanticTokenTypes = "struct"
  6290. TypeParameterType SemanticTokenTypes = "typeParameter"
  6291. ParameterType SemanticTokenTypes = "parameter"
  6292. VariableType SemanticTokenTypes = "variable"
  6293. PropertyType SemanticTokenTypes = "property"
  6294. EnumMemberType SemanticTokenTypes = "enumMember"
  6295. EventType SemanticTokenTypes = "event"
  6296. FunctionType SemanticTokenTypes = "function"
  6297. MethodType SemanticTokenTypes = "method"
  6298. MacroType SemanticTokenTypes = "macro"
  6299. KeywordType SemanticTokenTypes = "keyword"
  6300. ModifierType SemanticTokenTypes = "modifier"
  6301. CommentType SemanticTokenTypes = "comment"
  6302. StringType SemanticTokenTypes = "string"
  6303. NumberType SemanticTokenTypes = "number"
  6304. RegexpType SemanticTokenTypes = "regexp"
  6305. OperatorType SemanticTokenTypes = "operator"
  6306. // @since 3.17.0
  6307. DecoratorType SemanticTokenTypes = "decorator"
  6308. // @since 3.18.0
  6309. LabelType SemanticTokenTypes = "label"
  6310. // How a signature help was triggered.
  6311. //
  6312. // @since 3.15.0
  6313. // Signature help was invoked manually by the user or by a command.
  6314. SigInvoked SignatureHelpTriggerKind = 1
  6315. // Signature help was triggered by a trigger character.
  6316. SigTriggerCharacter SignatureHelpTriggerKind = 2
  6317. // Signature help was triggered by the cursor moving or by the document content changing.
  6318. SigContentChange SignatureHelpTriggerKind = 3
  6319. // A symbol kind.
  6320. File SymbolKind = 1
  6321. Module SymbolKind = 2
  6322. Namespace SymbolKind = 3
  6323. Package SymbolKind = 4
  6324. Class SymbolKind = 5
  6325. Method SymbolKind = 6
  6326. Property SymbolKind = 7
  6327. Field SymbolKind = 8
  6328. Constructor SymbolKind = 9
  6329. Enum SymbolKind = 10
  6330. Interface SymbolKind = 11
  6331. Function SymbolKind = 12
  6332. Variable SymbolKind = 13
  6333. Constant SymbolKind = 14
  6334. String SymbolKind = 15
  6335. Number SymbolKind = 16
  6336. Boolean SymbolKind = 17
  6337. Array SymbolKind = 18
  6338. Object SymbolKind = 19
  6339. Key SymbolKind = 20
  6340. Null SymbolKind = 21
  6341. EnumMember SymbolKind = 22
  6342. Struct SymbolKind = 23
  6343. Event SymbolKind = 24
  6344. Operator SymbolKind = 25
  6345. TypeParameter SymbolKind = 26
  6346. // Symbol tags are extra annotations that tweak the rendering of a symbol.
  6347. //
  6348. // @since 3.16
  6349. // Render a symbol as obsolete, usually using a strike-out.
  6350. DeprecatedSymbol SymbolTag = 1
  6351. // Represents reasons why a text document is saved.
  6352. // Manually triggered, e.g. by the user pressing save, by starting debugging,
  6353. // or by an API call.
  6354. Manual TextDocumentSaveReason = 1
  6355. // Automatic after a delay.
  6356. AfterDelay TextDocumentSaveReason = 2
  6357. // When the editor lost focus.
  6358. FocusOut TextDocumentSaveReason = 3
  6359. // Defines how the host (editor) should sync
  6360. // document changes to the language server.
  6361. // Documents should not be synced at all.
  6362. None TextDocumentSyncKind = 0
  6363. // Documents are synced by always sending the full content
  6364. // of the document.
  6365. Full TextDocumentSyncKind = 1
  6366. // Documents are synced by sending the full content on open.
  6367. // After that only incremental updates to the document are
  6368. // send.
  6369. Incremental TextDocumentSyncKind = 2
  6370. Relative TokenFormat = "relative"
  6371. // Turn tracing off.
  6372. Off TraceValue = "off"
  6373. // Trace messages only.
  6374. Messages TraceValue = "messages"
  6375. // Verbose message tracing.
  6376. Verbose TraceValue = "verbose"
  6377. // Moniker uniqueness level to define scope of the moniker.
  6378. //
  6379. // @since 3.16.0
  6380. // The moniker is only unique inside a document
  6381. Document UniquenessLevel = "document"
  6382. // The moniker is unique inside a project for which a dump got created
  6383. Project UniquenessLevel = "project"
  6384. // The moniker is unique inside the group to which a project belongs
  6385. Group UniquenessLevel = "group"
  6386. // The moniker is unique inside the moniker scheme.
  6387. Scheme UniquenessLevel = "scheme"
  6388. // The moniker is globally unique
  6389. Global UniquenessLevel = "global"
  6390. // Interested in create events.
  6391. WatchCreate WatchKind = 1
  6392. // Interested in change events
  6393. WatchChange WatchKind = 2
  6394. // Interested in delete events
  6395. WatchDelete WatchKind = 4
  6396. )