@marko/language-server 0.12.9 → 0.12.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import { CompletionItem } from "vscode-languageserver";
2
+ import type { Node } from "../../../utils/parser";
3
+ import type { CompletionMeta } from ".";
4
+ export declare function AttrValue({ document, offset, node, parsed, code, }: CompletionMeta<Node.AttrValue>): Promise<void | CompletionItem[]>;
@@ -0,0 +1,3 @@
1
+ import type { Node } from "../../../utils/parser";
2
+ import type { CompletionMeta, CompletionResult } from ".";
3
+ export declare function Statement({ code, node, parsed, lookup, document, }: CompletionMeta<Node.Statement>): CompletionResult;
@@ -0,0 +1,8 @@
1
+ import type { TaglibLookup } from "@marko/babel-utils";
2
+ import { DocumentLink } from "vscode-languageserver";
3
+ import type { TextDocument } from "vscode-languageserver-textdocument";
4
+ import { type parse } from "../../../utils/parser";
5
+ /**
6
+ * Iterate over the Marko CST and extract all the file links in the document.
7
+ */
8
+ export declare function extractDocumentLinks(doc: TextDocument, parsed: ReturnType<typeof parse>, lookup: TaglibLookup): DocumentLink[];
@@ -0,0 +1,2 @@
1
+ import type { Plugin } from "../../types";
2
+ export declare const findDocumentLinks: Plugin["findDocumentLinks"];
@@ -0,0 +1,8 @@
1
+ import type { TagDefinition } from "@marko/babel-utils";
2
+ import { type CompletionItem, type Range } from "vscode-languageserver";
3
+ export default function getTagNameCompletion({ tag, range, showAutoComplete, importer, }: {
4
+ tag: TagDefinition;
5
+ range?: Range;
6
+ importer?: string;
7
+ showAutoComplete?: true;
8
+ }): CompletionItem;
@@ -0,0 +1,5 @@
1
+ import type { TextDocument } from "vscode-languageserver-textdocument";
2
+ import { type Node } from "../../../utils/parser";
3
+ export default function isDocumentLinkAttr(doc: TextDocument, tag: Node.ParentTag, attr: Node.AttrNode): attr is Node.AttrNamed & {
4
+ value: Node.AttrValue;
5
+ };
@@ -3,7 +3,7 @@ import { Node } from "../../utils/parser";
3
3
  /**
4
4
  * Iterate over the Marko CST and extract all the stylesheets.
5
5
  */
6
- export declare function extractStyleSheets(code: string, program: Node.Program, lookup: TaglibLookup | null | undefined): Record<string, {
6
+ export declare function extractStyleSheets(code: string, program: Node.Program, lookup: TaglibLookup): Record<string, {
7
7
  generated: string;
8
8
  sourceOffsetAt(generatedOffset: number): number | undefined;
9
9
  generatedOffsetAt(sourceOffset: number): number | undefined;
@@ -1,8 +1,9 @@
1
- import type { CancellationToken, CodeAction, CodeActionParams, ColorInformation, ColorPresentation, ColorPresentationParams, Command, CompletionItem, CompletionList, CompletionParams, DefinitionParams, Diagnostic, DocumentColorParams, DocumentFormattingParams, DocumentHighlight, DocumentHighlightParams, Hover, HoverParams, Location, LocationLink, ReferenceParams, RenameParams, TextEdit, WorkspaceEdit } from "vscode-languageserver";
1
+ import type { CancellationToken, CodeAction, CodeActionParams, ColorInformation, ColorPresentation, ColorPresentationParams, Command, CompletionItem, CompletionList, CompletionParams, DefinitionParams, Diagnostic, DocumentColorParams, DocumentFormattingParams, DocumentHighlight, DocumentHighlightParams, DocumentLink, DocumentLinkParams, Hover, HoverParams, InitializeParams, Location, LocationLink, ReferenceParams, RenameParams, TextEdit, WorkspaceEdit } from "vscode-languageserver";
2
2
  import type { TextDocument } from "vscode-languageserver-textdocument";
3
3
  export declare type Result<V> = Promise<V | void> | V | void;
4
4
  declare type Handler<P, R> = (doc: TextDocument, params: P extends null ? CancellationToken : P, token: P extends null ? never : CancellationToken) => Result<R>;
5
5
  export declare type Plugin = {
6
+ initialize: (params: InitializeParams) => Promise<void> | void;
6
7
  doComplete: Handler<CompletionParams, CompletionItem[] | CompletionList>;
7
8
  doValidate: (doc: TextDocument) => Result<Diagnostic[]>;
8
9
  doHover: Handler<HoverParams, Hover>;
@@ -10,6 +11,7 @@ export declare type Plugin = {
10
11
  doCodeActions: Handler<CodeActionParams, (Command | CodeAction)[]>;
11
12
  findDefinition: Handler<DefinitionParams, Location | LocationLink | (Location | LocationLink)[]>;
12
13
  findReferences: Handler<ReferenceParams, Location[]>;
14
+ findDocumentLinks: Handler<DocumentLinkParams, DocumentLink[]>;
13
15
  findDocumentHighlights: Handler<DocumentHighlightParams, DocumentHighlight[]>;
14
16
  findDocumentColors: Handler<DocumentColorParams, ColorInformation[]>;
15
17
  getColorPresentations: Handler<ColorPresentationParams, ColorPresentation[]>;
@@ -0,0 +1,9 @@
1
+ import { type FileStat, FileType } from "vscode-css-languageservice";
2
+ export { FileStat, FileType };
3
+ declare const _default: {
4
+ stat: typeof stat;
5
+ readDirectory: typeof readDirectory;
6
+ };
7
+ export default _default;
8
+ declare function stat(uri: string): Promise<FileStat>;
9
+ declare function readDirectory(uri: string): Promise<[string, FileType][]>;
@@ -0,0 +1 @@
1
+ export default function resolveUrl(to: string, base: string): string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/language-server",
3
3
  "description": "Marko Language Server",
4
- "version": "0.12.9",
4
+ "version": "0.12.12",
5
5
  "bin": {
6
6
  "marko-language-server": "./bin.js"
7
7
  },