Add actual Lua code body for LuaDirectives to parent nodes for
completion events
This commit is contained in:
+4
-1
@@ -863,9 +863,12 @@ export class Client {
|
||||
if (currentNode) {
|
||||
let node: SyntaxNode | null = currentNode;
|
||||
do {
|
||||
if (node.name === "FencedCode" || node.name === "FrontMatter") {
|
||||
if (["FencedCode", "FrontMatter"].includes(node.name)) {
|
||||
const body = editorState.sliceDoc(node.from + 3, node.to - 3);
|
||||
parentNodes.push(`${node.name}:${body}`);
|
||||
} else if (node.name === "LuaDirective") {
|
||||
const body = editorState.sliceDoc(node.from + 2, node.to - 1);
|
||||
parentNodes.push(`${node.name}:${body}`);
|
||||
} else {
|
||||
parentNodes.push(node.name);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,9 @@ function keyBindingForQuote(
|
||||
// Figure out the context, if in some sort of code/comment fragment don't be smart
|
||||
let node = syntaxTree(target.state).resolveInner(cursorPos);
|
||||
while (node) {
|
||||
if (straightQuoteContexts.includes(node.type.name)) {
|
||||
if (
|
||||
straightQuoteContexts.find((sqc) => sqc.startsWith(node.type.name))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (node.parent) {
|
||||
|
||||
Reference in New Issue
Block a user