2
0

tsprotocol.go 272 KB

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