Fix variables in LSP
This commit is contained in:
parent
ef041fcb5f
commit
379a7c7c59
4 changed files with 9 additions and 6 deletions
|
@ -52,7 +52,7 @@ impl Variable for BaseVariable {
|
|||
fn parse<'a>(&self, state: &ParserState, _location: Token, document: &'a dyn Document<'a>) {
|
||||
let source = Rc::new(VirtualSource::new(
|
||||
self.location().clone(),
|
||||
self.name().to_string(),
|
||||
format!(":VAR:{}", self.name()),
|
||||
self.to_string(),
|
||||
));
|
||||
|
||||
|
|
|
@ -66,9 +66,8 @@ impl Element for Toc {
|
|||
}
|
||||
}
|
||||
|
||||
if sections.is_empty()
|
||||
{
|
||||
return Ok("".into())
|
||||
if sections.is_empty() {
|
||||
return Ok("".into());
|
||||
}
|
||||
|
||||
match compiler.target() {
|
||||
|
|
|
@ -45,7 +45,9 @@ impl<'a> Hints<'a> {
|
|||
lsp: &'a Option<RefCell<LSPData>>,
|
||||
original_source: Rc<dyn Source>,
|
||||
) -> Option<Self> {
|
||||
if source.name().starts_with(":LUA:") && source.downcast_ref::<VirtualSource>().is_some() {
|
||||
if (source.name().starts_with(":LUA:") || source.name().starts_with(":VAR:"))
|
||||
&& source.downcast_ref::<VirtualSource>().is_some()
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
|
@ -320,7 +320,9 @@ impl<'a> Semantics<'a> {
|
|||
lsp: &'a Option<RefCell<LSPData>>,
|
||||
original_source: Rc<dyn Source>,
|
||||
) -> Option<(Self, Ref<'a, Tokens>)> {
|
||||
if source.name().starts_with(":LUA:") && source.downcast_ref::<VirtualSource>().is_some() {
|
||||
if (source.name().starts_with(":LUA:") || source.name().starts_with(":VAR:"))
|
||||
&& source.downcast_ref::<VirtualSource>().is_some()
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue