Move TikZ commands to language.json

This commit is contained in:
Patrick Förster 2019-06-23 13:18:48 +02:00
parent 167a9622cd
commit 9746abc1ce
14 changed files with 659 additions and 654 deletions

View file

@ -1,11 +1,11 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use crate::syntax::SyntaxTree;
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::sync::Arc;
use crate::data::language::language_data;
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct LatexCitationCompletionProvider;

View file

@ -1,11 +1,11 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::borrow::Cow;
use std::sync::Arc;
use crate::data::language::language_data;
#[derive(Debug, PartialEq, Clone)]
pub struct LatexColorCompletionProvider;

View file

@ -1,11 +1,11 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::borrow::Cow;
use std::sync::Arc;
use crate::data::language::language_data;
#[derive(Debug, PartialEq, Clone)]
pub struct LatexColorModelCompletionProvider {

View file

@ -1,9 +1,9 @@
use crate::data::language::language_data;
use crate::feature::FeatureRequest;
use crate::syntax::latex::*;
use crate::syntax::SyntaxTree;
use lsp_types::{CompletionItem, CompletionParams};
use std::sync::Arc;
use crate::data::language::language_data;
pub async fn command<E, F>(
request: &FeatureRequest<CompletionParams>,

View file

@ -1,6 +1,6 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::{LatexIncludeKind, language_data};
use crate::data::language::{language_data, LatexIncludeKind};
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};

View file

@ -1,14 +1,14 @@
use crate::completion::factory;
use crate::completion::latex::combinators;
use crate::completion::latex::combinators::ArgumentLocation;
use crate::data::language::{LatexLabelKind, language_data};
use crate::data::language::{language_data, LatexLabelKind};
use crate::feature::{FeatureProvider, FeatureRequest};
use crate::syntax::latex::LatexLabel;
use crate::syntax::SyntaxTree;
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::borrow::Cow;
use std::sync::Arc;
use crate::syntax::latex::LatexLabel;
pub struct LatexLabelCompletionProvider;

View file

@ -1,11 +1,11 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::borrow::Cow;
use std::sync::Arc;
use crate::data::language::language_data;
pub struct LatexPgfLibraryCompletionProvider {
items: Vec<Arc<CompletionItem>>,
@ -13,7 +13,8 @@ pub struct LatexPgfLibraryCompletionProvider {
impl LatexPgfLibraryCompletionProvider {
pub fn new() -> Self {
let items = language_data().pgf_libraries
let items = language_data()
.pgf_libraries
.iter()
.map(Cow::from)
.map(factory::create_pgf_library)

View file

@ -1,6 +1,7 @@
use crate::completion::factory;
use crate::completion::factory::LatexComponentId;
use crate::completion::latex::combinators;
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
@ -14,9 +15,10 @@ pub struct LatexTikzCommandCompletionProvider {
impl LatexTikzCommandCompletionProvider {
pub fn new() -> Self {
let id = LatexComponentId::User(vec![Cow::from("tikz.sty")]);
let items = COMMANDS
let items = language_data()
.tikz_commands
.iter()
.map(|name| Cow::from(*name))
.map(Cow::from)
.map(|name| factory::create_command(name, &id))
.map(Arc::new)
.collect();
@ -45,638 +47,3 @@ impl FeatureProvider for LatexTikzCommandCompletionProvider {
.await
}
}
const COMMANDS: &[&str] = &[
"afterdecoration",
"anchor",
"anchorborder",
"arrow",
"arrowreversed",
"attribute",
"beginpgfgraphicnamed",
"behindbackgroundpath",
"behindforegroundpath",
"backgroundpath",
"beforebackgroundpath",
"beforedecoration",
"beforeforegroundpath",
"breakforeach",
"clip",
"calendar",
"chainin",
"colorcurrentmixin",
"coordinate",
"datavisualization",
"decoration",
"deferredanchor",
"draw",
"endpgfgraphicnamed",
"fill",
"filldraw",
"foreach",
"foregroundpath",
"graph",
"inheritanchor",
"inheritanchorborder",
"inheritbackgroundpath",
"inheritbeforebackgroundpath",
"inheritbeforeforegroundpath",
"inheritbehindbackgroundpath",
"inheritbehindforegroundpath",
"inheritforegroundpath",
"inheritsavedanchors",
"ifdate",
"ifpgfallowupsidedowattime",
"ifpgfgdgraphdrawingscopeactive",
"ifpgfmathmathunitsdeclared",
"ifpgfmathunitsdeclared",
"ifpgfrememberpicturepositiononpage",
"ifpgfresetnontranslationsattime",
"ifpgfslopedattime",
"jobname",
"matrix",
"method",
"n",
"node",
"nodepart",
"nodeparts",
"pattern",
"p",
"path",
"pgfactualjobname",
"pgfaliasimage",
"pgfalternateextension",
"pgfapproximatenonlineartransformation",
"pgfapproximatenonlineartranslation",
"pgfarrowsaddtolateoptions",
"pgfarrowsaddtolengthscalelist",
"pgfarrowsaddtooptions",
"pgfarrowsaddtowidthscalelist",
"pgfarrowshullpoint",
"pgfarrowslengthdependent",
"pgfarrowslinewidthdependent",
"pgfarrowssave",
"pgfarrowssavethe",
"pgfarrowssetbackend",
"pgfarrowssetlineend",
"pgfarrowssettipend",
"pgfarrowssetvisualbackend",
"pgfarrowssetvisualtipend",
"pgfarrowsthreeparameters",
"pgfarrowsupperhullpoint",
"pgfcalendar",
"pgfcalendardatetojulian",
"pgfcalendarifdate",
"pgfcalendarjuliantodate",
"pgfcalendarjuliantoweekday",
"pgfcalendarmonthname",
"pgfcalendarmonthshortname",
"pgfcalendarshorthand",
"pgfcalendarsuggestedname",
"pgfcalendarweekdayname",
"pgfcalendarweekdayshortname",
"pgfcoordinate",
"pgfcurvilineardistancetotime",
"pgfdata",
"pgfdeclarearrow",
"pgfdeclaredataformat",
"pgfdeclaredecoration",
"pgfdeclarefading",
"pgfdeclarefunctionalshading",
"pgfdeclarehorizontalshading",
"pgfdeclareimage",
"pgfdeclarelayer",
"pgfdeclarelindenmayersystem",
"pgfdeclaremask",
"pgfdeclaremetadecorate",
"pgfdeclarepatternformonly",
"pgfdeclarepatterninherentlycolored",
"pgfdeclareplothandler",
"pgfdeclareplotmark",
"pgfdeclareradialshading",
"pgfdeclareshape",
"pgfdeclareverticalshading",
"pgfdecorateaftercode",
"pgfdecoratebeforecode",
"pgfdecoratecurrentpath",
"pgfdecoratedangle",
"pgfdecoratedcompleteddistance",
"pgfdecoratedinputsegmentcompleteddistance",
"pgfdecoratedinputsegmentlength",
"pgfdecoratedinputsegmentremainingdistance",
"pgfdecoratedpath",
"pgfdecoratedpathlength",
"pgfdecoratedremainingdistance",
"pgfdecorateexistingpath",
"pgfdecoratepath",
"pgfdecorationpath",
"pgfdvdeclarestylesheet",
"pgferror",
"pgfextra",
"pgfextractx",
"pgfextracty",
"pgfgdaddspecificationhook",
"pgfgdbegineventgroup",
"pgfgdbeginlayout",
"pgfgdbeginscope",
"pgfgdedge",
"pgfgdendeventgroup",
"pgfgdendlayout",
"pgfgdendscope",
"pgfgdevent",
"pgfgdeventgroup",
"pgfgdsetedgecallback",
"pgfgdsetlatenodeoption",
"pgfgdsetrequestcallback",
"pgfgdsubgraphnode",
"pgfgetlastxy",
"pgfgettransform",
"pgfgettransformentries",
"pgfhorizontaltransformationadjustment",
"pgfimage",
"pgfintersectionofpaths",
"pgfintersectionsolutions",
"pgfintersectionsortbyfirstpath",
"pgfintersectionsortbysecondpath",
"pgfkeys",
"pgfkeysactivatefamilies",
"pgfkeysactivatefamiliesandfilteroptions",
"pgfkeysactivatefamily",
"pgfkeysactivatesinglefamilyandfilteroptions",
"pgfkeysalso",
"pgfkeysalsofiltered",
"pgfkeysalsofilteredfrom",
"pgfkeysalsofrom",
"pgfkeysdeactivatefamily",
"pgfkeysdef",
"pgfkeysdefargs",
"pgfkeysdefnargs",
"pgfkeysedef",
"pgfkeysedefargs",
"pgfkeysedefnargs",
"pgfkeysevalkeyfilterwith",
"pgfkeysfiltered",
"pgfkeysgetfamily",
"pgfkeysgetvalue",
"pgfkeysifdefined",
"pgfkeysiffamilydefined",
"pgfkeysinstallkeyfilter",
"pgfkeysinstallkeyfilterhandler",
"pgfkeysisfamilyactive",
"pgfkeyslet",
"pgfkeyssavekeyfilterstateto",
"pgfkeyssetfamily",
"pgfkeyssetvalue",
"pgfkeysvalueof",
"pgflibraryfpuifactive",
"pgflindenmayersystem",
"pgflinewidth",
"pgflowlevel",
"pgflowlevelobj",
"pgflowlevelsynccm",
"pgflsystemcurrentleftangle",
"pgflsystemcurrentrightangle",
"pgflsystemcurrentstep",
"pgflsystemdrawforward",
"pgflsystemmoveforward",
"pgflsystemrandomizeleftangle",
"pgflsystemrandomizerightangle",
"pgflsystemrandomizestep",
"pgflsystemrestorestate",
"pgflsystemsavestate",
"pgflsystemturnleft",
"pgflsystemturnright",
"pgfmathabs",
"pgfmathacos",
"pgfmathadd",
"pgfmathaddtocount",
"pgfmathaddtocounter",
"pgfmathaddtolength",
"pgfmathand",
"pgfmathanglebetweenlines",
"pgfmathanglebetweenpoints",
"pgfmathapproxequalto",
"pgfmatharray",
"pgfmathasin",
"pgfmathatan",
"pgfmathatantwo",
"pgfmathbasetoBase",
"pgfmathbasetobase",
"pgfmathbasetodec",
"pgfmathbin",
"pgfmathceil",
"pgfmathcos",
"pgfmathcosec",
"pgfmathcosh",
"pgfmathcot",
"pgfmathdeclarefunction",
"pgfmathdeclarerandomlist",
"pgfmathdectoBase",
"pgfmathdectobase",
"pgfmathdeg",
"pgfmathdepth",
"pgfmathdiv",
"pgfmathdivide",
"pgfmathe",
"pgfmathequal",
"pgfmathexp",
"pgfmathfactorial",
"pgfmathfalse",
"pgfmathfloat",
"pgfmathfloatabserror",
"pgfmathfloatcreate",
"pgfmathfloatgetexponent",
"pgfmathfloatgetflags",
"pgfmathfloatgetflagstomacro",
"pgfmathfloatgetmantissa",
"pgfmathfloatgetmantissatok",
"pgfmathfloatifapproxequalrel",
"pgfmathfloatifflags",
"pgfmathfloatint",
"pgfmathfloatlessthan",
"pgfmathfloatmultiplyfixed",
"pgfmathfloatparsenumber",
"pgfmathfloatqparsenumber",
"pgfmathfloatrelerror",
"pgfmathfloatround",
"pgfmathfloatroundzerofill",
"pgfmathfloatsetextprecision",
"pgfmathfloatshift",
"pgfmathfloattoextentedprecision",
"pgfmathfloattofixed",
"pgfmathfloattoint",
"pgfmathfloattomacro",
"pgfmathfloattoregisters",
"pgfmathfloattoregisterstok",
"pgfmathfloattosci",
"pgfmathfloatvalueof",
"pgfmathfloor",
"pgfmathfrac",
"pgfmathgcd",
"pgfmathgeneratepseudorandomnumber",
"pgfmathgreater",
"pgfmathheight",
"pgfmathHex",
"pgfmathhex",
"pgfmathifisint",
"pgfmathifthenelse",
"pgfmathint",
"pgfmathiseven",
"pgfmathisodd",
"pgfmathisprime",
"pgfmathless",
"pgfmathln",
"pgfmathlog",
"pgfmathlogten",
"pgfmathlogtwo",
"pgfmathmax",
"pgfmathmin",
"pgfmathMod",
"pgfmathmod",
"pgfmathmultiply",
"pgfmathneg",
"pgfmathnot",
"pgfmathnotequal",
"pgfmathnotgreater",
"pgfmathnotless",
"pgfmathoct",
"pgfmathor",
"pgfmathparse",
"pgfmathpi",
"pgfmathpostparse",
"pgfmathpow",
"pgfmathprintnumber",
"pgfmathprintnumberto",
"pgfmathqparse",
"pgfmathrad",
"pgfmathrand",
"pgfmathrandom",
"pgfmathrandominteger",
"pgfmathrandomitem",
"pgfmathreal",
"pgfmathreciprocal",
"pgfmathredeclarefunction",
"pgfmathrnd",
"pgfmathround",
"pgfmathroundto",
"pgfmathroundtozerofill",
"pgfmathscalar",
"pgfmathsec",
"pgfmathsetbasenumberlength",
"pgfmathsetcount",
"pgfmathsetcounter",
"pgfmathsetlength",
"pgfmathsetlengthmacro",
"pgfmathsetmacro",
"pgfmathsetseed",
"pgfmathsign",
"pgfmathsin",
"pgfmathsinh",
"pgfmathsqrt",
"pgfmathsubtract",
"pgfmathtan",
"pgfmathtanh",
"pgfmathtodigitlist",
"pgfmathtrue",
"pgfmathtruncatemacro",
"pgfmathveclen",
"pgfmathwidth",
"pgfmatrix",
"pgfmatrixbegincode",
"pgfmatrixcurrentcolumn",
"pgfmatrixcurrentrow",
"pgfmatrixemptycode",
"pgfmatrixendcode",
"pgfmatrixendrow",
"pgfmatrixnextcell",
"pgfmetadecoratedcompleteddistance",
"pgfmetadecoratedinputsegmentcompleteddistance",
"pgfmetadecoratedinputsegmentremainingdistance",
"pgfmetadecoratedpathlength",
"pgfmetadecoratedremainingdistance",
"pgfmultipartnode",
"pgfnode",
"pgfnodealias",
"pgfnodepostsetupcode",
"pgfnoderename",
"pgfooclass",
"pgfoogc",
"pgfooget",
"pgfoolet",
"pgfoonew",
"pgfooobj",
"pgfooset",
"pgfoosuper",
"pgfoothis",
"pgfoovalueof",
"pgfpagescurrentpagewillbelogicalpage",
"pgfpagesdeclarelayout",
"pgfpageslogicalpageoptions",
"pgfpagesphysicalpageoptions",
"pgfpagesshipoutlogicalpage",
"pgfpagesuselayout",
"pgfparserdef",
"pgfparserparse",
"pgfparserswitch",
"pgfpatharc",
"pgfpatharcaxes",
"pgfpatharcto",
"pgfpatharctomaxstepsize",
"pgfpatharctoprecomputed",
"pgfpathcircle",
"pgfpathclose",
"pgfpathcosine",
"pgfpathcurvebetweentime",
"pgfpathcurvebetweentimecontinue",
"pgfpathcurveto",
"pgfpathellipse",
"pgfpathgrid",
"pgfpathlineto",
"pgfpathmoveto",
"pgfpathparabola",
"pgfpathqcircle",
"pgfpathqcurveto",
"pgfpathqlineto",
"pgfpathqmoveto",
"pgfpathquadraticcurveto",
"pgfpathrectangle",
"pgfpathrectanglecorners",
"pgfpathsine",
"pgfpathsvg",
"pgfplotbarwidth",
"pgfplotfunction",
"pgfplotgnuplot",
"pgfplothandlerclosedcurve",
"pgfplothandlerconstantlineto",
"pgfplothandlerconstantlinetomarkmid",
"pgfplothandlerconstantlinetomarkright",
"pgfplothandlercurveto",
"pgfplothandlerdiscard",
"pgfplothandlergapcycle",
"pgfplothandlergaplineto",
"pgfplothandlerjumpmarkleft",
"pgfplothandlerjumpmarkmid",
"pgfplothandlerjumpmarkright",
"pgfplothandlerlineto",
"pgfplothandlermark",
"pgfplothandlermarklisted",
"pgfplothandlerpolarcomb",
"pgfplothandlerpolygon",
"pgfplothandlerrecord",
"pgfplothandlerxbar",
"pgfplothandlerxbarinterval",
"pgfplothandlerxcomb",
"pgfplothandlerybar",
"pgfplothandlerybarinterval",
"pgfplothandlerycomb",
"pgfplotmarksize",
"pgfplotstreamend",
"pgfplotstreamnewdataset",
"pgfplotstreampoint",
"pgfplotstreampointoutlier",
"pgfplotstreampointundefined",
"pgfplotstreamspecial",
"pgfplotstreamstart",
"pgfplotxyfile",
"pgfplotxyzfile",
"pgfplotxzerolevelstreamconstant",
"pgfplotyzerolevelstreamconstant",
"pgfpoint",
"pgfpointadd",
"pgfpointanchor",
"pgfpointarcaxesattime",
"pgfpointborderellipse",
"pgfpointborderrectangle",
"pgfpointcurveattime",
"pgfpointcurvilinearbezierorthogonal",
"pgfpointcurvilinearbezierpolar",
"pgfpointcylindrical",
"pgfpointdecoratedinputsegmentlast",
"pgfpointdecoratedpathfirst",
"pgfpointdecoratedpathlast",
"pgfpointdecorationpathlast",
"pgfpointdiff",
"pgfpointintersectionofcircles",
"pgfpointintersectionoflines",
"pgfpointintersectionsolution",
"pgfpointlineatdistance",
"pgfpointlineattime",
"pgfpointmetadecoratedpathfirst",
"pgfpointmetadecoratedpathlast",
"pgfpointnormalised",
"pgfpointorigin",
"pgfpointpolar",
"pgfpointpolarxy",
"pgfpointscale",
"pgfpointshapeborder",
"pgfpointspherical",
"pgfpointtransformednonlinear",
"pgfpointxy",
"pgfpointxyz",
"pgfpositionnodelater",
"pgfpositionnodelaterbox",
"pgfpositionnodelatermaxx",
"pgfpositionnodelatermaxy",
"pgfpositionnodelaterminx",
"pgfpositionnodelaterminy",
"pgfpositionnodelatername",
"pgfpositionnodelaterpath",
"pgfpositionnodenow",
"pgfprofileend",
"pgfprofileifisrunning",
"pgfprofilenew",
"pgfprofilenewforcommand",
"pgfprofilenewforcommandpattern",
"pgfprofilenewforenvironment",
"pgfprofilepostprocess",
"pgfprofilesetrel",
"pgfprofileshowinvocationsexpandedfor",
"pgfprofileshowinvocationsfor",
"pgfprofilestart",
"pgfqbox",
"pgfqboxsynced",
"pgfqkeys",
"pgfqkeysactivatefamiliesandfilteroptions",
"pgfqkeysactivatesinglefamilyandfilteroptions",
"pgfqkeysalso",
"pgfqkeysfiltered",
"pgfqpoint",
"pgfqpointscale",
"pgfqpointxy",
"pgfqpointxyz",
"pgfrealjobname",
"pgfresetboundingbox",
"pgfsetadditionalshadetransform",
"pgfsetarrows",
"pgfsetarrowsend",
"pgfsetarrowsstart",
"pgfsetbaseline",
"pgfsetbaselinepointlater",
"pgfsetbaselinepointnow",
"pgfsetbeveljoin",
"pgfsetblendmode",
"pgfsetbuttcap",
"pgfsetcolor",
"pgfsetcornersarced",
"pgfsetcurvilinearbeziercurve",
"pgfsetdash",
"pgfsetdecorationsegmenttransformation",
"pgfseteorule",
"pgfsetfading",
"pgfsetfadingforcurrentpath",
"pgfsetfadingforcurrentpathstroked",
"pgfsetfillcolor",
"pgfsetfillopacity",
"pgfsetfillpattern",
"pgfsetinnerlinewidth",
"pgfsetinnerstrokecolor",
"pgfsetlayers",
"pgfsetlinetofirstplotpoint",
"pgfsetlinewidth",
"pgfsetmatrixcolumnsep",
"pgfsetmatrixrowsep",
"pgfsetmiterjoin",
"pgfsetmiterlimit",
"pgfsetmovetofirstplotpoint",
"pgfsetnonzerorule",
"pgfsetplotmarkphase",
"pgfsetplotmarkrepeat",
"pgfsetplotmarksize",
"pgfsetplottension",
"pgfsetrectcap",
"pgfsetroundcap",
"pgfsetroundjoin",
"pgfsetshortenend",
"pgfsetshortenstart",
"pgfsetstrokecolor",
"pgfsetstrokeopacity",
"pgfsettransform",
"pgfsettransformentries",
"pgfsettransformnonlinearflatness",
"pgfsetxvec",
"pgfsetyvec",
"pgfsetzvec",
"pgfshadecolortorgb",
"pgfshadepath",
"pgfsysdriver",
"pgftext",
"pgftransformarcaxesattime",
"pgftransformarrow",
"pgftransformationadjustments",
"pgftransformcm",
"pgftransformcurveattime",
"pgftransforminvert",
"pgftransformlineattime",
"pgftransformnonlinear",
"pgftransformreset",
"pgftransformresetnontranslations",
"pgftransformrotate",
"pgftransformscale",
"pgftransformshift",
"pgftransformtriangle",
"pgftransformxscale",
"pgftransformxshift",
"pgftransformxslant",
"pgftransformyscale",
"pgftransformyshift",
"pgftransformyslant",
"pgfuseimage",
"pgfusepath",
"pgfusepathqclip",
"pgfusepathqfill",
"pgfusepathqfillstroke",
"pgfusepathqstroke",
"pgfuseplotmark",
"pgfuseshading",
"pgfverticaltransformationadjustment",
"pgfwarning",
"pic",
"rule",
"savedanchor",
"saveddimen",
"savedmacro",
"scoped",
"shade",
"shadedraw",
"spy",
"state",
"symbol",
"tikz",
"tikzaliascoordinatesystem",
"tikzappendtofigurename",
"tikzdeclarecoordinatesystem",
"tikzdvdeclarestylesheetcolorseries",
"tikzexternaldisable",
"tikzexternalenable",
"tikzexternalfiledependsonfile",
"tikzexternalize",
"tikzexternalrealjob",
"tikzfading",
"tikzgraphforeachcolorednode",
"tikzgraphnodefullname",
"tikzgraphnodename",
"tikzgraphnodepath",
"tikzgraphnodetext",
"tikzgraphpreparecolor",
"tikzgraphsset",
"tikzifexternalizing",
"tikzifexternalizingnext",
"tikzinputsegmentfirst",
"tikzinputsegmentlast",
"tikzinputsegmentsupporta",
"tikzinputsegmentsupportb",
"tikzlastnode",
"tikzmath",
"tikzpicturedependsonfile",
"tikzset",
"tikzsetexternalprefix",
"tikzsetfigurename",
"tikzsetnextfilename",
"useasboundingbox",
"usegdlibrary",
"usepgflibrary",
"usetikzlibrary",
"value",
"x",
"y",
];

View file

@ -1,11 +1,11 @@
use crate::completion::factory;
use crate::completion::latex::combinators::{self, ArgumentLocation};
use crate::data::language::language_data;
use crate::feature::{FeatureProvider, FeatureRequest};
use futures_boxed::boxed;
use lsp_types::{CompletionItem, CompletionParams};
use std::borrow::Cow;
use std::sync::Arc;
use crate::data::language::{language_data};
pub struct LatexTikzLibraryCompletionProvider {
items: Vec<Arc<CompletionItem>>,
@ -13,7 +13,8 @@ pub struct LatexTikzLibraryCompletionProvider {
impl LatexTikzLibraryCompletionProvider {
pub fn new() -> Self {
let items = language_data().tikz_libraries
let items = language_data()
.tikz_libraries
.iter()
.map(Cow::from)
.map(factory::create_tikz_library)

View file

@ -1542,5 +1542,639 @@
"topaths",
"trees",
"turtle"
],
"tikzCommands": [
"afterdecoration",
"anchor",
"anchorborder",
"arrow",
"arrowreversed",
"attribute",
"beginpgfgraphicnamed",
"behindbackgroundpath",
"behindforegroundpath",
"backgroundpath",
"beforebackgroundpath",
"beforedecoration",
"beforeforegroundpath",
"breakforeach",
"clip",
"calendar",
"chainin",
"colorcurrentmixin",
"coordinate",
"datavisualization",
"decoration",
"deferredanchor",
"draw",
"endpgfgraphicnamed",
"fill",
"filldraw",
"foreach",
"foregroundpath",
"graph",
"inheritanchor",
"inheritanchorborder",
"inheritbackgroundpath",
"inheritbeforebackgroundpath",
"inheritbeforeforegroundpath",
"inheritbehindbackgroundpath",
"inheritbehindforegroundpath",
"inheritforegroundpath",
"inheritsavedanchors",
"ifdate",
"ifpgfallowupsidedowattime",
"ifpgfgdgraphdrawingscopeactive",
"ifpgfmathmathunitsdeclared",
"ifpgfmathunitsdeclared",
"ifpgfrememberpicturepositiononpage",
"ifpgfresetnontranslationsattime",
"ifpgfslopedattime",
"jobname",
"matrix",
"method",
"n",
"node",
"nodepart",
"nodeparts",
"pattern",
"p",
"path",
"pgfactualjobname",
"pgfaliasimage",
"pgfalternateextension",
"pgfapproximatenonlineartransformation",
"pgfapproximatenonlineartranslation",
"pgfarrowsaddtolateoptions",
"pgfarrowsaddtolengthscalelist",
"pgfarrowsaddtooptions",
"pgfarrowsaddtowidthscalelist",
"pgfarrowshullpoint",
"pgfarrowslengthdependent",
"pgfarrowslinewidthdependent",
"pgfarrowssave",
"pgfarrowssavethe",
"pgfarrowssetbackend",
"pgfarrowssetlineend",
"pgfarrowssettipend",
"pgfarrowssetvisualbackend",
"pgfarrowssetvisualtipend",
"pgfarrowsthreeparameters",
"pgfarrowsupperhullpoint",
"pgfcalendar",
"pgfcalendardatetojulian",
"pgfcalendarifdate",
"pgfcalendarjuliantodate",
"pgfcalendarjuliantoweekday",
"pgfcalendarmonthname",
"pgfcalendarmonthshortname",
"pgfcalendarshorthand",
"pgfcalendarsuggestedname",
"pgfcalendarweekdayname",
"pgfcalendarweekdayshortname",
"pgfcoordinate",
"pgfcurvilineardistancetotime",
"pgfdata",
"pgfdeclarearrow",
"pgfdeclaredataformat",
"pgfdeclaredecoration",
"pgfdeclarefading",
"pgfdeclarefunctionalshading",
"pgfdeclarehorizontalshading",
"pgfdeclareimage",
"pgfdeclarelayer",
"pgfdeclarelindenmayersystem",
"pgfdeclaremask",
"pgfdeclaremetadecorate",
"pgfdeclarepatternformonly",
"pgfdeclarepatterninherentlycolored",
"pgfdeclareplothandler",
"pgfdeclareplotmark",
"pgfdeclareradialshading",
"pgfdeclareshape",
"pgfdeclareverticalshading",
"pgfdecorateaftercode",
"pgfdecoratebeforecode",
"pgfdecoratecurrentpath",
"pgfdecoratedangle",
"pgfdecoratedcompleteddistance",
"pgfdecoratedinputsegmentcompleteddistance",
"pgfdecoratedinputsegmentlength",
"pgfdecoratedinputsegmentremainingdistance",
"pgfdecoratedpath",
"pgfdecoratedpathlength",
"pgfdecoratedremainingdistance",
"pgfdecorateexistingpath",
"pgfdecoratepath",
"pgfdecorationpath",
"pgfdvdeclarestylesheet",
"pgferror",
"pgfextra",
"pgfextractx",
"pgfextracty",
"pgfgdaddspecificationhook",
"pgfgdbegineventgroup",
"pgfgdbeginlayout",
"pgfgdbeginscope",
"pgfgdedge",
"pgfgdendeventgroup",
"pgfgdendlayout",
"pgfgdendscope",
"pgfgdevent",
"pgfgdeventgroup",
"pgfgdsetedgecallback",
"pgfgdsetlatenodeoption",
"pgfgdsetrequestcallback",
"pgfgdsubgraphnode",
"pgfgetlastxy",
"pgfgettransform",
"pgfgettransformentries",
"pgfhorizontaltransformationadjustment",
"pgfimage",
"pgfintersectionofpaths",
"pgfintersectionsolutions",
"pgfintersectionsortbyfirstpath",
"pgfintersectionsortbysecondpath",
"pgfkeys",
"pgfkeysactivatefamilies",
"pgfkeysactivatefamiliesandfilteroptions",
"pgfkeysactivatefamily",
"pgfkeysactivatesinglefamilyandfilteroptions",
"pgfkeysalso",
"pgfkeysalsofiltered",
"pgfkeysalsofilteredfrom",
"pgfkeysalsofrom",
"pgfkeysdeactivatefamily",
"pgfkeysdef",
"pgfkeysdefargs",
"pgfkeysdefnargs",
"pgfkeysedef",
"pgfkeysedefargs",
"pgfkeysedefnargs",
"pgfkeysevalkeyfilterwith",
"pgfkeysfiltered",
"pgfkeysgetfamily",
"pgfkeysgetvalue",
"pgfkeysifdefined",
"pgfkeysiffamilydefined",
"pgfkeysinstallkeyfilter",
"pgfkeysinstallkeyfilterhandler",
"pgfkeysisfamilyactive",
"pgfkeyslet",
"pgfkeyssavekeyfilterstateto",
"pgfkeyssetfamily",
"pgfkeyssetvalue",
"pgfkeysvalueof",
"pgflibraryfpuifactive",
"pgflindenmayersystem",
"pgflinewidth",
"pgflowlevel",
"pgflowlevelobj",
"pgflowlevelsynccm",
"pgflsystemcurrentleftangle",
"pgflsystemcurrentrightangle",
"pgflsystemcurrentstep",
"pgflsystemdrawforward",
"pgflsystemmoveforward",
"pgflsystemrandomizeleftangle",
"pgflsystemrandomizerightangle",
"pgflsystemrandomizestep",
"pgflsystemrestorestate",
"pgflsystemsavestate",
"pgflsystemturnleft",
"pgflsystemturnright",
"pgfmathabs",
"pgfmathacos",
"pgfmathadd",
"pgfmathaddtocount",
"pgfmathaddtocounter",
"pgfmathaddtolength",
"pgfmathand",
"pgfmathanglebetweenlines",
"pgfmathanglebetweenpoints",
"pgfmathapproxequalto",
"pgfmatharray",
"pgfmathasin",
"pgfmathatan",
"pgfmathatantwo",
"pgfmathbasetoBase",
"pgfmathbasetobase",
"pgfmathbasetodec",
"pgfmathbin",
"pgfmathceil",
"pgfmathcos",
"pgfmathcosec",
"pgfmathcosh",
"pgfmathcot",
"pgfmathdeclarefunction",
"pgfmathdeclarerandomlist",
"pgfmathdectoBase",
"pgfmathdectobase",
"pgfmathdeg",
"pgfmathdepth",
"pgfmathdiv",
"pgfmathdivide",
"pgfmathe",
"pgfmathequal",
"pgfmathexp",
"pgfmathfactorial",
"pgfmathfalse",
"pgfmathfloat",
"pgfmathfloatabserror",
"pgfmathfloatcreate",
"pgfmathfloatgetexponent",
"pgfmathfloatgetflags",
"pgfmathfloatgetflagstomacro",
"pgfmathfloatgetmantissa",
"pgfmathfloatgetmantissatok",
"pgfmathfloatifapproxequalrel",
"pgfmathfloatifflags",
"pgfmathfloatint",
"pgfmathfloatlessthan",
"pgfmathfloatmultiplyfixed",
"pgfmathfloatparsenumber",
"pgfmathfloatqparsenumber",
"pgfmathfloatrelerror",
"pgfmathfloatround",
"pgfmathfloatroundzerofill",
"pgfmathfloatsetextprecision",
"pgfmathfloatshift",
"pgfmathfloattoextentedprecision",
"pgfmathfloattofixed",
"pgfmathfloattoint",
"pgfmathfloattomacro",
"pgfmathfloattoregisters",
"pgfmathfloattoregisterstok",
"pgfmathfloattosci",
"pgfmathfloatvalueof",
"pgfmathfloor",
"pgfmathfrac",
"pgfmathgcd",
"pgfmathgeneratepseudorandomnumber",
"pgfmathgreater",
"pgfmathheight",
"pgfmathHex",
"pgfmathhex",
"pgfmathifisint",
"pgfmathifthenelse",
"pgfmathint",
"pgfmathiseven",
"pgfmathisodd",
"pgfmathisprime",
"pgfmathless",
"pgfmathln",
"pgfmathlog",
"pgfmathlogten",
"pgfmathlogtwo",
"pgfmathmax",
"pgfmathmin",
"pgfmathMod",
"pgfmathmod",
"pgfmathmultiply",
"pgfmathneg",
"pgfmathnot",
"pgfmathnotequal",
"pgfmathnotgreater",
"pgfmathnotless",
"pgfmathoct",
"pgfmathor",
"pgfmathparse",
"pgfmathpi",
"pgfmathpostparse",
"pgfmathpow",
"pgfmathprintnumber",
"pgfmathprintnumberto",
"pgfmathqparse",
"pgfmathrad",
"pgfmathrand",
"pgfmathrandom",
"pgfmathrandominteger",
"pgfmathrandomitem",
"pgfmathreal",
"pgfmathreciprocal",
"pgfmathredeclarefunction",
"pgfmathrnd",
"pgfmathround",
"pgfmathroundto",
"pgfmathroundtozerofill",
"pgfmathscalar",
"pgfmathsec",
"pgfmathsetbasenumberlength",
"pgfmathsetcount",
"pgfmathsetcounter",
"pgfmathsetlength",
"pgfmathsetlengthmacro",
"pgfmathsetmacro",
"pgfmathsetseed",
"pgfmathsign",
"pgfmathsin",
"pgfmathsinh",
"pgfmathsqrt",
"pgfmathsubtract",
"pgfmathtan",
"pgfmathtanh",
"pgfmathtodigitlist",
"pgfmathtrue",
"pgfmathtruncatemacro",
"pgfmathveclen",
"pgfmathwidth",
"pgfmatrix",
"pgfmatrixbegincode",
"pgfmatrixcurrentcolumn",
"pgfmatrixcurrentrow",
"pgfmatrixemptycode",
"pgfmatrixendcode",
"pgfmatrixendrow",
"pgfmatrixnextcell",
"pgfmetadecoratedcompleteddistance",
"pgfmetadecoratedinputsegmentcompleteddistance",
"pgfmetadecoratedinputsegmentremainingdistance",
"pgfmetadecoratedpathlength",
"pgfmetadecoratedremainingdistance",
"pgfmultipartnode",
"pgfnode",
"pgfnodealias",
"pgfnodepostsetupcode",
"pgfnoderename",
"pgfooclass",
"pgfoogc",
"pgfooget",
"pgfoolet",
"pgfoonew",
"pgfooobj",
"pgfooset",
"pgfoosuper",
"pgfoothis",
"pgfoovalueof",
"pgfpagescurrentpagewillbelogicalpage",
"pgfpagesdeclarelayout",
"pgfpageslogicalpageoptions",
"pgfpagesphysicalpageoptions",
"pgfpagesshipoutlogicalpage",
"pgfpagesuselayout",
"pgfparserdef",
"pgfparserparse",
"pgfparserswitch",
"pgfpatharc",
"pgfpatharcaxes",
"pgfpatharcto",
"pgfpatharctomaxstepsize",
"pgfpatharctoprecomputed",
"pgfpathcircle",
"pgfpathclose",
"pgfpathcosine",
"pgfpathcurvebetweentime",
"pgfpathcurvebetweentimecontinue",
"pgfpathcurveto",
"pgfpathellipse",
"pgfpathgrid",
"pgfpathlineto",
"pgfpathmoveto",
"pgfpathparabola",
"pgfpathqcircle",
"pgfpathqcurveto",
"pgfpathqlineto",
"pgfpathqmoveto",
"pgfpathquadraticcurveto",
"pgfpathrectangle",
"pgfpathrectanglecorners",
"pgfpathsine",
"pgfpathsvg",
"pgfplotbarwidth",
"pgfplotfunction",
"pgfplotgnuplot",
"pgfplothandlerclosedcurve",
"pgfplothandlerconstantlineto",
"pgfplothandlerconstantlinetomarkmid",
"pgfplothandlerconstantlinetomarkright",
"pgfplothandlercurveto",
"pgfplothandlerdiscard",
"pgfplothandlergapcycle",
"pgfplothandlergaplineto",
"pgfplothandlerjumpmarkleft",
"pgfplothandlerjumpmarkmid",
"pgfplothandlerjumpmarkright",
"pgfplothandlerlineto",
"pgfplothandlermark",
"pgfplothandlermarklisted",
"pgfplothandlerpolarcomb",
"pgfplothandlerpolygon",
"pgfplothandlerrecord",
"pgfplothandlerxbar",
"pgfplothandlerxbarinterval",
"pgfplothandlerxcomb",
"pgfplothandlerybar",
"pgfplothandlerybarinterval",
"pgfplothandlerycomb",
"pgfplotmarksize",
"pgfplotstreamend",
"pgfplotstreamnewdataset",
"pgfplotstreampoint",
"pgfplotstreampointoutlier",
"pgfplotstreampointundefined",
"pgfplotstreamspecial",
"pgfplotstreamstart",
"pgfplotxyfile",
"pgfplotxyzfile",
"pgfplotxzerolevelstreamconstant",
"pgfplotyzerolevelstreamconstant",
"pgfpoint",
"pgfpointadd",
"pgfpointanchor",
"pgfpointarcaxesattime",
"pgfpointborderellipse",
"pgfpointborderrectangle",
"pgfpointcurveattime",
"pgfpointcurvilinearbezierorthogonal",
"pgfpointcurvilinearbezierpolar",
"pgfpointcylindrical",
"pgfpointdecoratedinputsegmentlast",
"pgfpointdecoratedpathfirst",
"pgfpointdecoratedpathlast",
"pgfpointdecorationpathlast",
"pgfpointdiff",
"pgfpointintersectionofcircles",
"pgfpointintersectionoflines",
"pgfpointintersectionsolution",
"pgfpointlineatdistance",
"pgfpointlineattime",
"pgfpointmetadecoratedpathfirst",
"pgfpointmetadecoratedpathlast",
"pgfpointnormalised",
"pgfpointorigin",
"pgfpointpolar",
"pgfpointpolarxy",
"pgfpointscale",
"pgfpointshapeborder",
"pgfpointspherical",
"pgfpointtransformednonlinear",
"pgfpointxy",
"pgfpointxyz",
"pgfpositionnodelater",
"pgfpositionnodelaterbox",
"pgfpositionnodelatermaxx",
"pgfpositionnodelatermaxy",
"pgfpositionnodelaterminx",
"pgfpositionnodelaterminy",
"pgfpositionnodelatername",
"pgfpositionnodelaterpath",
"pgfpositionnodenow",
"pgfprofileend",
"pgfprofileifisrunning",
"pgfprofilenew",
"pgfprofilenewforcommand",
"pgfprofilenewforcommandpattern",
"pgfprofilenewforenvironment",
"pgfprofilepostprocess",
"pgfprofilesetrel",
"pgfprofileshowinvocationsexpandedfor",
"pgfprofileshowinvocationsfor",
"pgfprofilestart",
"pgfqbox",
"pgfqboxsynced",
"pgfqkeys",
"pgfqkeysactivatefamiliesandfilteroptions",
"pgfqkeysactivatesinglefamilyandfilteroptions",
"pgfqkeysalso",
"pgfqkeysfiltered",
"pgfqpoint",
"pgfqpointscale",
"pgfqpointxy",
"pgfqpointxyz",
"pgfrealjobname",
"pgfresetboundingbox",
"pgfsetadditionalshadetransform",
"pgfsetarrows",
"pgfsetarrowsend",
"pgfsetarrowsstart",
"pgfsetbaseline",
"pgfsetbaselinepointlater",
"pgfsetbaselinepointnow",
"pgfsetbeveljoin",
"pgfsetblendmode",
"pgfsetbuttcap",
"pgfsetcolor",
"pgfsetcornersarced",
"pgfsetcurvilinearbeziercurve",
"pgfsetdash",
"pgfsetdecorationsegmenttransformation",
"pgfseteorule",
"pgfsetfading",
"pgfsetfadingforcurrentpath",
"pgfsetfadingforcurrentpathstroked",
"pgfsetfillcolor",
"pgfsetfillopacity",
"pgfsetfillpattern",
"pgfsetinnerlinewidth",
"pgfsetinnerstrokecolor",
"pgfsetlayers",
"pgfsetlinetofirstplotpoint",
"pgfsetlinewidth",
"pgfsetmatrixcolumnsep",
"pgfsetmatrixrowsep",
"pgfsetmiterjoin",
"pgfsetmiterlimit",
"pgfsetmovetofirstplotpoint",
"pgfsetnonzerorule",
"pgfsetplotmarkphase",
"pgfsetplotmarkrepeat",
"pgfsetplotmarksize",
"pgfsetplottension",
"pgfsetrectcap",
"pgfsetroundcap",
"pgfsetroundjoin",
"pgfsetshortenend",
"pgfsetshortenstart",
"pgfsetstrokecolor",
"pgfsetstrokeopacity",
"pgfsettransform",
"pgfsettransformentries",
"pgfsettransformnonlinearflatness",
"pgfsetxvec",
"pgfsetyvec",
"pgfsetzvec",
"pgfshadecolortorgb",
"pgfshadepath",
"pgfsysdriver",
"pgftext",
"pgftransformarcaxesattime",
"pgftransformarrow",
"pgftransformationadjustments",
"pgftransformcm",
"pgftransformcurveattime",
"pgftransforminvert",
"pgftransformlineattime",
"pgftransformnonlinear",
"pgftransformreset",
"pgftransformresetnontranslations",
"pgftransformrotate",
"pgftransformscale",
"pgftransformshift",
"pgftransformtriangle",
"pgftransformxscale",
"pgftransformxshift",
"pgftransformxslant",
"pgftransformyscale",
"pgftransformyshift",
"pgftransformyslant",
"pgfuseimage",
"pgfusepath",
"pgfusepathqclip",
"pgfusepathqfill",
"pgfusepathqfillstroke",
"pgfusepathqstroke",
"pgfuseplotmark",
"pgfuseshading",
"pgfverticaltransformationadjustment",
"pgfwarning",
"pic",
"rule",
"savedanchor",
"saveddimen",
"savedmacro",
"scoped",
"shade",
"shadedraw",
"spy",
"state",
"symbol",
"tikz",
"tikzaliascoordinatesystem",
"tikzappendtofigurename",
"tikzdeclarecoordinatesystem",
"tikzdvdeclarestylesheetcolorseries",
"tikzexternaldisable",
"tikzexternalenable",
"tikzexternalfiledependsonfile",
"tikzexternalize",
"tikzexternalrealjob",
"tikzfading",
"tikzgraphforeachcolorednode",
"tikzgraphnodefullname",
"tikzgraphnodename",
"tikzgraphnodepath",
"tikzgraphnodetext",
"tikzgraphpreparecolor",
"tikzgraphsset",
"tikzifexternalizing",
"tikzifexternalizingnext",
"tikzinputsegmentfirst",
"tikzinputsegmentlast",
"tikzinputsegmentsupporta",
"tikzinputsegmentsupportb",
"tikzlastnode",
"tikzmath",
"tikzpicturedependsonfile",
"tikzset",
"tikzsetexternalprefix",
"tikzsetfigurename",
"tikzsetnextfilename",
"useasboundingbox",
"usegdlibrary",
"usepgflibrary",
"usetikzlibrary",
"value",
"x",
"y"
]
}

View file

@ -134,6 +134,7 @@ pub struct LanguageData {
pub fields: Vec<BibtexField>,
pub pgf_libraries: Vec<String>,
pub tikz_libraries: Vec<String>,
pub tikz_commands: Vec<String>,
}
impl LanguageData {

View file

@ -16,10 +16,7 @@ async fn set_options<'a>(scenario: &'a Scenario, executable: &'a str, on_save: b
options.latex_build = Some(build_options);
}
async fn run(
executable: &'static str,
name: &'static str,
) -> (Scenario, BuildResult) {
async fn run(executable: &'static str, name: &'static str) -> (Scenario, BuildResult) {
let scenario = Scenario::new("build").await;
scenario.open(name).await;
set_options(&scenario, executable, false).await;

View file

@ -11,7 +11,9 @@ async fn test_lint_latex() {
scenario.open("foo.tex").await;
{
let mut options = scenario.client.options.lock().await;
options.latex_lint = Some(LatexLintOptions { on_save: Some(true) });
options.latex_lint = Some(LatexLintOptions {
on_save: Some(true),
});
}
let identifier = TextDocumentIdentifier::new(scenario.uri("foo.tex"));
scenario.server.did_save(DidSaveTextDocumentParams {

View file

@ -40,7 +40,9 @@ async fn test_bibtex_entry_infinite_line_length() {
let (scenario, edits) = run(
"bibtex/infinite_line_length",
"foo.bib",
Some(BibtexFormattingOptions { line_length: Some(0) }),
Some(BibtexFormattingOptions {
line_length: Some(0),
}),
)
.await;
assert_eq!(edits.len(), 1);