[mod] release 0.5.2
This commit is contained in:
parent
cfc8ba3817
commit
47baf6f2b9
95
package.json
95
package.json
@ -2,7 +2,7 @@
|
|||||||
"name": "vscode-basex",
|
"name": "vscode-basex",
|
||||||
"displayName": "BaseX tools",
|
"displayName": "BaseX tools",
|
||||||
"description": "BaseX tools: XQuery, XML, XPath Tools for Visual Studio Code",
|
"description": "BaseX tools: XQuery, XML, XPath Tools for Visual Studio Code",
|
||||||
"version": "0.0.48",
|
"version": "0.0.52",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"publisher": "quodatum",
|
"publisher": "quodatum",
|
||||||
"author": "Andy Bunce (https://github.com/Quodatum)",
|
"author": "Andy Bunce (https://github.com/Quodatum)",
|
||||||
@ -12,13 +12,13 @@
|
|||||||
"theme": "light"
|
"theme": "light"
|
||||||
},
|
},
|
||||||
"icon": "resources/basex.png",
|
"icon": "resources/basex.png",
|
||||||
"homepage": "https://github.com/Quodatum/vscode-xml",
|
"homepage": "https://github.com/Quodatum/vscode-basex",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/Quodatum/vscode-xml.git"
|
"url": "git+https://github.com/Quodatum/vscode-basex.git"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Quodatum/vscode-xml/issues"
|
"url": "https://github.com/Quodatum/vscode-basex/issues"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.63.0"
|
"vscode": "^1.63.0"
|
||||||
@ -27,6 +27,7 @@
|
|||||||
"Formatters",
|
"Formatters",
|
||||||
"Programming Languages",
|
"Programming Languages",
|
||||||
"Linters",
|
"Linters",
|
||||||
|
"Snippets",
|
||||||
"Other"
|
"Other"
|
||||||
],
|
],
|
||||||
"activationEvents": [
|
"activationEvents": [
|
||||||
@ -70,16 +71,21 @@
|
|||||||
{
|
{
|
||||||
"command": "basexTools.minifyXml",
|
"command": "basexTools.minifyXml",
|
||||||
"title": "BaseX Tools: Minify XML"
|
"title": "BaseX Tools: Minify XML"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "basexTools.getAST",
|
||||||
|
"title": "BaseX Tools: AST"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"configuration": [
|
"configuration": [
|
||||||
{
|
{
|
||||||
"id": "xmltree",
|
"id": "xmltree",
|
||||||
"title": "XML tree view ",
|
"title": "XML tree view ",
|
||||||
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"basexTools.xmlTree.enableTreeView": {
|
"basexTools.xmlTree.enableTreeView": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": false,
|
||||||
"description": "Enables the XML Document view in the explorer for XML documents.",
|
"description": "Enables the XML Document view in the explorer for XML documents.",
|
||||||
"scope": "window"
|
"scope": "window"
|
||||||
},
|
},
|
||||||
@ -114,8 +120,44 @@
|
|||||||
"scope": "window"
|
"scope": "window"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},{
|
||||||
{
|
"id": "xquery",
|
||||||
|
"title": "XQuery ",
|
||||||
|
"properties":{
|
||||||
|
"basexTools.xquery.executionArguments": {
|
||||||
|
"type": "array",
|
||||||
|
"default": [
|
||||||
|
"-xquery",
|
||||||
|
"$(script)",
|
||||||
|
"-in",
|
||||||
|
"$(input)",
|
||||||
|
"-out",
|
||||||
|
"$(input).output.xml"
|
||||||
|
],
|
||||||
|
"description": "Arguments to be passed to the XQuery execution engine.",
|
||||||
|
"scope": "window"
|
||||||
|
},
|
||||||
|
"basexTools.xquery.executionEngine": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "",
|
||||||
|
"description": "The full path to the executable to run when executing XQuery scripts.",
|
||||||
|
"scope": "window"
|
||||||
|
},
|
||||||
|
"basexTools.xquery.executionInputLimit": {
|
||||||
|
"type": "integer",
|
||||||
|
"default": 100,
|
||||||
|
"description": "The maximum number of input files to enumerate when executing XQuery scripts.",
|
||||||
|
"scope": "window"
|
||||||
|
},
|
||||||
|
"basexTools.xquery.executionInputSearchPattern": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "**/*.xml",
|
||||||
|
"description": "The pattern used to search for input XML files when executing XQuery scripts.",
|
||||||
|
"scope": "window"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},{
|
||||||
"title": "BaseX Tools ",
|
"title": "BaseX Tools ",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -153,39 +195,8 @@
|
|||||||
"default": "v2",
|
"default": "v2",
|
||||||
"description": "Supported XML Formatters: classic",
|
"description": "Supported XML Formatters: classic",
|
||||||
"scope": "window"
|
"scope": "window"
|
||||||
},
|
|
||||||
"basexTools.xqueryExecutionArguments": {
|
|
||||||
"type": "array",
|
|
||||||
"default": [
|
|
||||||
"-xquery",
|
|
||||||
"$(script)",
|
|
||||||
"-in",
|
|
||||||
"$(input)",
|
|
||||||
"-out",
|
|
||||||
"$(input).output.xml"
|
|
||||||
],
|
|
||||||
"description": "Arguments to be passed to the XQuery execution engine.",
|
|
||||||
"scope": "window"
|
|
||||||
},
|
|
||||||
"basexTools.xqueryExecutionEngine": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "The full path to the executable to run when executing XQuery scripts.",
|
|
||||||
"scope": "window"
|
|
||||||
},
|
|
||||||
"basexTools.xqueryExecutionInputLimit": {
|
|
||||||
"type": "integer",
|
|
||||||
"default": 100,
|
|
||||||
"description": "The maximum number of input files to enumerate when executing XQuery scripts.",
|
|
||||||
"scope": "window"
|
|
||||||
},
|
|
||||||
"basexTools.xqueryExecutionInputSearchPattern": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "**/*.xml",
|
|
||||||
"description": "The pattern used to search for input XML files when executing XQuery scripts.",
|
|
||||||
"scope": "window"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grammars": [
|
"grammars": [
|
||||||
@ -195,6 +206,12 @@
|
|||||||
"scopeName": "source.xquery"
|
"scopeName": "source.xquery"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"snippets": [
|
||||||
|
{
|
||||||
|
"language": "xquery",
|
||||||
|
"path": "./snippets.jsonc"
|
||||||
|
}
|
||||||
|
],
|
||||||
"keybindings": [
|
"keybindings": [
|
||||||
{
|
{
|
||||||
"key": "ctrl+shift+alt+x",
|
"key": "ctrl+shift+alt+x",
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.8 KiB |
120
snippets.jsonc
Normal file
120
snippets.jsonc
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
"for": {
|
||||||
|
"prefix": "for",
|
||||||
|
"body": "for $${1:item} in ${2:expr}"
|
||||||
|
},
|
||||||
|
"return": {
|
||||||
|
"prefix": "ret",
|
||||||
|
"body": "return ${1:expr}"
|
||||||
|
},
|
||||||
|
"import": {
|
||||||
|
"prefix": "import",
|
||||||
|
"body": "import module namespace ${1:ns} = '${2:http://www.example.com/}';",
|
||||||
|
"description": "Import module"
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"prefix": "module",
|
||||||
|
"body": "module namespace ${1:ns} = '${2:http://www.example.com}';"
|
||||||
|
},
|
||||||
|
"every": {
|
||||||
|
"prefix": "every",
|
||||||
|
"body": "every $${1:varname} in ${2:expr} satisfies ${3:expr}"
|
||||||
|
},
|
||||||
|
"some": {
|
||||||
|
"prefix": "some",
|
||||||
|
"body": "some $${1:varname} in ${2:expr} satisfies ${3:expr}"
|
||||||
|
},
|
||||||
|
"function": {
|
||||||
|
"prefix": "df",
|
||||||
|
"body": [
|
||||||
|
"(:~ $${2:name} :)",
|
||||||
|
"declare function ${1:ns}:${2:name}(){",
|
||||||
|
"${3:expr}",
|
||||||
|
"};"
|
||||||
|
],
|
||||||
|
"description": "declare a function"
|
||||||
|
},
|
||||||
|
"declare variable": {
|
||||||
|
"prefix": "dv",
|
||||||
|
"body": [
|
||||||
|
"(:~ $${1:varname} :)",
|
||||||
|
"declare variable $${1:varname} := ${2:expr};",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"description": "declare variable"
|
||||||
|
},
|
||||||
|
"switch": {
|
||||||
|
"prefix": "sw",
|
||||||
|
"body": [
|
||||||
|
"switch(${1:foo})",
|
||||||
|
"case ${2:foo} return ${3:true}",
|
||||||
|
"default return ${4:false}"
|
||||||
|
],
|
||||||
|
"description": "switch statement"
|
||||||
|
},
|
||||||
|
"typeswitch": {
|
||||||
|
"prefix": "type",
|
||||||
|
"body": [
|
||||||
|
"typeswitch(${1:foo})",
|
||||||
|
"case ${2:foo} return ${3:true}",
|
||||||
|
"default return ${4:false}"
|
||||||
|
],
|
||||||
|
"description": "typeswitch statement"
|
||||||
|
},
|
||||||
|
"try": {
|
||||||
|
"prefix": "try",
|
||||||
|
"body": [
|
||||||
|
"try { ${1:expr} } ",
|
||||||
|
"catch ${2:*} { ${3:expr} }"
|
||||||
|
],
|
||||||
|
"description": "switch statement"
|
||||||
|
},
|
||||||
|
"tumbling": {
|
||||||
|
"prefix": "tumbling",
|
||||||
|
"body": [
|
||||||
|
"for tumbling window $${1:varname} in ${2:expr}",
|
||||||
|
"start at $${3:start} when ${4:expr}",
|
||||||
|
"end at $${5:end} when ${6:expr}",
|
||||||
|
"return ${7:expr}"
|
||||||
|
],
|
||||||
|
"description": "tumbling window"
|
||||||
|
},
|
||||||
|
"sliding": {
|
||||||
|
"prefix": "sliding",
|
||||||
|
"body": [
|
||||||
|
"for sliding window $${1:varname} in ${2:expr}",
|
||||||
|
"start at $${3:start} when ${4:expr}",
|
||||||
|
"end at $${5:end} when ${6:expr}",
|
||||||
|
"return ${7:expr}"
|
||||||
|
],
|
||||||
|
"description": "sliding window"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//snippet if
|
||||||
|
// if(${1:true}) then ${2:expr} else ${3:true}
|
||||||
|
|
||||||
|
// default return ${4:false}
|
||||||
|
|
||||||
|
|
||||||
|
//snippet let
|
||||||
|
// let $${1:varname} := ${2:expr}
|
||||||
|
//snippet group
|
||||||
|
// group by $${1:varname} := ${2:expr}
|
||||||
|
//snippet order
|
||||||
|
// order by ${1:expr} ${2:descending}
|
||||||
|
//snippet stable
|
||||||
|
// stable order by ${1:expr}
|
||||||
|
//snippet count
|
||||||
|
// count $${1:varname}
|
||||||
|
//snippet ordered
|
||||||
|
// ordered { ${1:expr} }
|
||||||
|
//snippet unordered
|
||||||
|
// unordered { ${1:expr} }
|
||||||
|
//snippet treat
|
||||||
|
// treat as ${1:expr}
|
||||||
|
//snippet castable
|
||||||
|
// castable as ${1:atomicType}
|
||||||
|
//snippet cast
|
||||||
|
// cast as ${1:atomicType}
|
||||||
|
|
@ -11,7 +11,7 @@ export class Configuration {
|
|||||||
return this._getForWindow<boolean>("xmlTree.enableViewMetadata");
|
return this._getForWindow<boolean>("xmlTree.enableViewMetadata");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get enableViewCursorSync(): boolean {
|
static get enableXmlTreeViewCursorSync(): boolean {
|
||||||
return this._getForWindow<boolean>("xmlTree.enableViewCursorSync");
|
return this._getForWindow<boolean>("xmlTree.enableViewCursorSync");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,19 +28,19 @@ export class Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get xqueryExecutionArguments(): string[] {
|
static get xqueryExecutionArguments(): string[] {
|
||||||
return this._getForWindow<string[]>("xqueryExecutionArguments");
|
return this._getForWindow<string[]>("xquery.executionArguments");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get xqueryExecutionEngine(): string {
|
static get xqueryExecutionEngine(): string {
|
||||||
return this._getForWindow<string>("xqueryExecutionEngine");
|
return this._getForWindow<string>("xquery.executionEngine");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get xqueryExecutionInputLimit(): number {
|
static get xqueryExecutionInputLimit(): number {
|
||||||
return this._getForWindow<number>("xqueryExecutionInputLimit");
|
return this._getForWindow<number>("xquery.executionInputLimit");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get xqueryExecutionInputSearchPattern(): string {
|
static get xqueryExecutionInputSearchPattern(): string {
|
||||||
return this._getForWindow<string>("xqueryExecutionInputSearchPattern");
|
return this._getForWindow<string>("xquery.executionInputSearchPattern");
|
||||||
}
|
}
|
||||||
|
|
||||||
static enforcePrettySelfClosingTagOnFormat(resource: Uri): boolean {
|
static enforcePrettySelfClosingTagOnFormat(resource: Uri): boolean {
|
||||||
|
@ -4,6 +4,7 @@ import { OutputChannel, window } from "vscode";
|
|||||||
const ver = require("@quodatum/xqlint").version;
|
const ver = require("@quodatum/xqlint").version;
|
||||||
|
|
||||||
const _channel:OutputChannel = window.createOutputChannel("BaseX");
|
const _channel:OutputChannel = window.createOutputChannel("BaseX");
|
||||||
|
|
||||||
function logdate(){
|
function logdate(){
|
||||||
return (new Date()).toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ");
|
return (new Date()).toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ");
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ export namespace commands {
|
|||||||
export const textToXml = "basexTools.textToXml";
|
export const textToXml = "basexTools.textToXml";
|
||||||
export const getCurrentXPath = "basexTools.getCurrentXPath";
|
export const getCurrentXPath = "basexTools.getCurrentXPath";
|
||||||
export const minifyXml = "basexTools.minifyXml";
|
export const minifyXml = "basexTools.minifyXml";
|
||||||
|
export const getAST = "basexTools.getAST";
|
||||||
}
|
}
|
||||||
|
|
||||||
export namespace contextKeys {
|
export namespace contextKeys {
|
||||||
|
@ -7,8 +7,8 @@ import { channel } from "./common/logger";
|
|||||||
import { createDocumentSelector, ExtensionState, Configuration } from "./common";
|
import { createDocumentSelector, ExtensionState, Configuration } from "./common";
|
||||||
import { XQueryCompletionItemProvider } from "./completion";
|
import { XQueryCompletionItemProvider } from "./completion";
|
||||||
import { XmlFormatterFactory, XmlFormattingEditProvider } from "./formatting";
|
import { XmlFormatterFactory, XmlFormattingEditProvider } from "./formatting";
|
||||||
import { formatAsXml, minifyXml, xmlToText, textToXml } from "./formatting/commands";
|
import { formatAsXml, minifyXml, xmlToText, textToXml } from "./formatting/commands";
|
||||||
import { XQueryLinter } from "./linting";
|
import { XQueryLinter,getAst } from "./linting";
|
||||||
import { XmlTreeDataProvider } from "./tree-view";
|
import { XmlTreeDataProvider } from "./tree-view";
|
||||||
import { evaluateXPath, getCurrentXPath } from "./xpath/commands";
|
import { evaluateXPath, getCurrentXPath } from "./xpath/commands";
|
||||||
import { executeXQuery } from "./xquery-execution/commands";
|
import { executeXQuery } from "./xquery-execution/commands";
|
||||||
@ -39,6 +39,7 @@ export function activate(context: ExtensionContext) {
|
|||||||
commands.registerTextEditorCommand(constants.commands.xmlToText, xmlToText),
|
commands.registerTextEditorCommand(constants.commands.xmlToText, xmlToText),
|
||||||
commands.registerTextEditorCommand(constants.commands.textToXml, textToXml),
|
commands.registerTextEditorCommand(constants.commands.textToXml, textToXml),
|
||||||
commands.registerTextEditorCommand(constants.commands.minifyXml, minifyXml),
|
commands.registerTextEditorCommand(constants.commands.minifyXml, minifyXml),
|
||||||
|
commands.registerTextEditorCommand(constants.commands.getAST, getAst),
|
||||||
|
|
||||||
languages.registerDocumentFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider),
|
languages.registerDocumentFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider),
|
||||||
languages.registerDocumentRangeFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider),
|
languages.registerDocumentRangeFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider),
|
||||||
|
@ -2,3 +2,4 @@ export * from "./formatAsXml";
|
|||||||
export * from "./minifyXml";
|
export * from "./minifyXml";
|
||||||
export * from "./xmlToText";
|
export * from "./xmlToText";
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export class XQueryFormatter implements DocumentFormattingEditProvider, Document
|
|||||||
|
|
||||||
provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, _options: FormattingOptions, _token: CancellationToken): ProviderResult<TextEdit[]> {
|
provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, _options: FormattingOptions, _token: CancellationToken): ProviderResult<TextEdit[]> {
|
||||||
const selected = document.getText(range);
|
const selected = document.getText(range);
|
||||||
const result = format(selected);
|
const result = format(selected, document);
|
||||||
return [TextEdit.replace(range, result)];
|
return [TextEdit.replace(range, result)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
src/linting/getAST.ts
Normal file
23
src/linting/getAST.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
import { Range, TextEditor, Selection } from "vscode";
|
||||||
|
import { channel } from "../common/logger";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const XQLint = require("@quodatum/xqlint").XQLint;
|
||||||
|
|
||||||
|
export function getAst(textEditor: TextEditor): void {
|
||||||
|
textEditor.edit(textEdit => {
|
||||||
|
const selections = textEditor.selections;
|
||||||
|
selections.forEach(selection => {
|
||||||
|
if (selection.isEmpty) {
|
||||||
|
selection = new Selection(
|
||||||
|
textEditor.document.positionAt(0),
|
||||||
|
textEditor.document.positionAt(textEditor.document.getText().length)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const text = textEditor.document.getText(new Range(selection.start, selection.end));
|
||||||
|
const linter = new XQLint(text);
|
||||||
|
const ast=linter.getAST();
|
||||||
|
channel.appendLine(ast);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
@ -1 +1,2 @@
|
|||||||
export * from "./xquery-linter";
|
export * from "./xquery-linter";
|
||||||
|
export * from "./getAST";
|
||||||
|
@ -1,44 +1,56 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
import { XQLint } from '@quodatum/xqlint';
|
import { XQLint } from '@quodatum/xqlint';
|
||||||
import * as vscode from 'vscode';
|
import {SymbolKind, DocumentSymbol, DocumentSymbolProvider,
|
||||||
|
Range, Position, TextDocument,CancellationToken} from 'vscode';
|
||||||
import { channel } from "../common/logger";
|
import { channel } from "../common/logger";
|
||||||
//
|
//
|
||||||
// This class handles Symbols
|
// This class handles Symbols
|
||||||
//
|
//
|
||||||
function makeSymbol(name: string, description: string, icon: vscode.SymbolKind, pos: any) {
|
function makeSymbol(name: string, description: string, icon: SymbolKind, pos: any) {
|
||||||
const spos = new vscode.Position(pos.sl, pos.sc);
|
const spos = new Position(pos.sl, pos.sc);
|
||||||
const epos = new vscode.Position(pos.el, pos.ec);
|
const epos = new Position(pos.el, pos.ec);
|
||||||
const fullrange = new vscode.Range(spos, epos);
|
const fullrange = new Range(spos, epos);
|
||||||
const selrange = new vscode.Range(spos, spos);
|
const selrange = new Range(spos, spos);
|
||||||
return new vscode.DocumentSymbol(name, description, icon, fullrange, selrange);
|
return new DocumentSymbol(name, description, icon, fullrange, selrange);
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Symbols implements vscode.DocumentSymbolProvider {
|
export class Symbols implements DocumentSymbolProvider {
|
||||||
|
|
||||||
provideDocumentSymbols = async (
|
provideDocumentSymbols = async (
|
||||||
document: vscode.TextDocument,
|
document: TextDocument,
|
||||||
token: vscode.CancellationToken
|
token: CancellationToken
|
||||||
): Promise<vscode.DocumentSymbol[]> => {
|
): Promise<DocumentSymbol[]> => {
|
||||||
|
|
||||||
channel.log("Symbols: " + document.uri);
|
channel.log("Symbols: " + document.uri);
|
||||||
const symbols: vscode.DocumentSymbol[] = [];
|
const symbols: DocumentSymbol[] = [];
|
||||||
const text = document.getText();
|
const text = document.getText();
|
||||||
const linter = new (XQLint as any)(text, { "styleCheck": false });
|
const linter = new (XQLint as any)(text, { "styleCheck": false });
|
||||||
|
|
||||||
const xqdoc = linter.getXQDoc();
|
const xqdoc = linter.getXQDoc();
|
||||||
channel.log("got xqdoc");
|
channel.log("got xqdoc");
|
||||||
|
const prolog=new Range(0,0,0,0)
|
||||||
|
symbols.push(makeSymbol(xqdoc.moduleNamespace || "Main", xqdoc.description, SymbolKind.Module, prolog))
|
||||||
|
|
||||||
|
let vars=makeSymbol("Variables", "", SymbolKind.Variable, prolog)
|
||||||
|
vars.children=[]
|
||||||
// type: type,
|
// type: type,
|
||||||
// pos: pos,
|
// pos: pos,
|
||||||
// qname: qname,
|
// qname: qname,
|
||||||
// annotations: {}
|
// annotations: {}
|
||||||
xqdoc.variables.forEach(v => {
|
xqdoc.variables.forEach(v => {
|
||||||
const name = v.name;
|
const name = v.name;
|
||||||
const info = makeSymbol(name, "var", vscode.SymbolKind.Variable, v.pos)
|
const info = makeSymbol(name, "", SymbolKind.Variable, v.pos)
|
||||||
symbols.push(info);
|
vars.children.push(info);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const funs=makeSymbol("Variables", "", SymbolKind.Function, prolog)
|
||||||
|
funs.children=[]
|
||||||
xqdoc.functions.forEach(v => {
|
xqdoc.functions.forEach(v => {
|
||||||
const name = v.name;
|
const name = v.name +"#" + v.params.length;
|
||||||
const info = makeSymbol(name, "Fu", vscode.SymbolKind.Function, v.pos)
|
const info = makeSymbol(name, "", SymbolKind.Function, v.pos)
|
||||||
symbols.push(info);
|
funs.children.push(info);
|
||||||
});
|
});
|
||||||
|
symbols.push(vars)
|
||||||
|
symbols.push(funs)
|
||||||
channel.log("Symbols done " + document.uri);
|
channel.log("Symbols done " + document.uri);
|
||||||
return symbols;
|
return symbols;
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const child_process = require("child_process");
|
import child_process = require("child_process");
|
||||||
|
|
||||||
export class ChildProcess {
|
export class ChildProcess {
|
||||||
static async spawn(executable: string, args: string[]): Promise<void> {
|
static async spawn(executable: string, args: string[]): Promise<void> {
|
||||||
|
Loading…
Reference in New Issue
Block a user