nvarner / typst-lsp

A brand-new language server for Typst, plus a VS Code extension
MIT License
1.15k stars 78 forks source link

LSP crash #237

Closed gtiders closed 10 months ago

gtiders commented 11 months ago

LSP does not seem to be able to run in multiple workspaces at the same time, and opening multiple workspaces causes LSP to crash

nvarner commented 11 months ago

Can you provide the information requested in the bug report issue template? Without more to work with, I can't reproduce the error, debug it, or fix it.

cristobaltapia commented 11 months ago

(deleted my comment, as it has to do with #232 )

KagaJiankui commented 11 months ago

Same problem on my machine(Windows 11 23H2 on x86_64 PC). When the document contains an undefined symbol, the language server crashes.

KagaJiankui commented 11 months ago

Log of the last crash among five crashes(within 1 second!) under verbose:

[Trace - 23:01:28] Received request 'client/registerCapability - (0)'.
Params: {
    "registrations": [
        {
            "id": "semantic_tokens",
            "method": "textDocument/semanticTokens",
            "registerOptions": {
                "full": {
                    "delta": true
                },
                "legend": {
                    "tokenModifiers": [
                        "strong",
                        "emph",
                        "math"
                    ],
                    "tokenTypes": [
                        "comment",
                        "string",
                        "keyword",
                        "operator",
                        "number",
                        "function",
                        "decorator",
                        "bool",
                        "punct",
                        "escape",
                        "link",
                        "raw",
                        "label",
                        "ref",
                        "heading",
                        "marker",
                        "term",
                        "delim",
                        "pol",
                        "error",
                        "text"
                    ]
                }
            }
        }
    ]
}

[Trace - 23:01:28] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
No result returned.

[Trace - 23:01:28] Sending request 'textDocument/completion - (1)'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/%E6%96%87/Falken%28typst%29/test.typ"
    },
    "position": {
        "line": 50,
        "character": 5
    },
    "context": {
        "triggerKind": 1
    }
}

[Trace - 23:01:28] Received request 'client/registerCapability - (1)'.
Params: {
    "registrations": [
        {
            "id": "config",
            "method": "workspace/didChangeConfiguration"
        }
    ]
}

[Trace - 23:01:28] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
No result returned.

[Trace - 23:01:28] Received request 'client/registerCapability - (2)'.
Params: {
    "registrations": [
        {
            "id": "watch_typst_files",
            "method": "workspace/didChangeWatchedFiles",
            "registerOptions": {
                "watchers": [
                    {
                        "globPattern": "**/*"
                    }
                ]
            }
        }
    ]
}

[Trace - 23:01:28] Sending response 'client/registerCapability - (2)'. Processing request took 0ms
No result returned.

[Trace - 23:01:28] Received response 'textDocument/completion - (1)' in 2ms.
Result: [
    {
        "detail": "Aligns content horizontally and vertically.",
        "insertText": "align(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "align"
    },
    {
        "detail": "Converts a value to an array.",
        "insertText": "array(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "array"
    },
    {
        "detail": "Ensures that a condition is fulfilled.",
        "insertText": "assert(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "assert"
    },
    {
        "detail": "A bibliography / reference listing.",
        "insertText": "bibliography(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "bibliography"
    },
    {
        "detail": "A block-level container.",
        "insertText": "block(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "block"
    },
    {
        "detail": "An inline-level container that sizes content.",
        "insertText": "box(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "box"
    },
    {
        "detail": "Converts a value to bytes.",
        "insertText": "bytes(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "bytes"
    },
    {
        "detail": "<module calc>",
        "insertTextFormat": 2,
        "kind": 21,
        "label": "calc"
    },
    {
        "detail": "A circle with optional content.",
        "insertText": "circle(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "circle"
    },
    {
        "detail": "Cite a work from the bibliography.",
        "insertText": "cite(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "cite"
    },
    {
        "detail": "Creates a CMYK color.",
        "insertText": "cmyk(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "cmyk"
    },
    {
        "detail": "Forces a column break.",
        "insertText": "colbreak(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "colbreak"
    },
    {
        "detail": "<module color>",
        "insertTextFormat": 2,
        "kind": 21,
        "label": "color"
    },
    {
        "detail": "Separates a region into multiple equally sized columns.",
        "insertText": "columns(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "columns"
    },
    {
        "detail": "Counts through pages, elements, and more.",
        "insertText": "counter(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "counter"
    },
    {
        "detail": "Reads structured data from a CSV file.",
        "insertText": "csv(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "csv"
    },
    {
        "detail": "Creates a new datetime.",
        "insertText": "datetime(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "datetime"
    },
    {
        "detail": "The root element of a document and its metadata.",
        "insertText": "document(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "document"
    },
    {
        "detail": "An ellipse with optional content.",
        "insertText": "ellipse(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "ellipse"
    },
    {
        "detail": "<module emoji>",
        "insertTextFormat": 2,
        "kind": 21,
        "label": "emoji"
    },
    {
        "detail": "Emphasizes content by setting it in italics.",
        "insertText": "emph(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "emph"
    },
    {
        "detail": "A numbered list.",
        "insertText": "enum(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "enum"
    },
    {
        "detail": "Evaluates a string as Typst code.",
        "insertText": "eval(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "eval"
    },
    {
        "detail": "A figure with an optional caption.",
        "insertText": "figure(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "figure"
    },
    {
        "detail": "Converts a value to a float.",
        "insertText": "float(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "float"
    },
    {
        "detail": "A footnote.",
        "insertText": "footnote(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "footnote"
    },
    {
        "detail": "Arranges content in a grid.",
        "insertText": "grid(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "grid"
    },
    {
        "detail": "Inserts horizontal spacing into a paragraph.",
        "insertText": "h(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "h"
    },
    {
        "detail": "A section heading.",
        "insertText": "heading(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "heading"
    },
    {
        "detail": "Hides content without affecting layout.",
        "insertText": "hide(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "hide"
    },
    {
        "detail": "A raster or vector graphic.",
        "insertText": "image(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "image"
    },
    {
        "detail": "Converts a value to an integer.",
        "insertText": "int(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "int"
    },
    {
        "detail": "Reads structured data from a JSON file.",
        "insertText": "json(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "json"
    },
    {
        "detail": "Creates a label from a string.",
        "insertText": "label(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "label"
    },
    {
        "detail": "Provides access to the current outer container's (or page's, if none) size\n(width and height).",
        "insertText": "layout(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "layout"
    },
    {
        "detail": "A line from one point to another.",
        "insertText": "line(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "line"
    },
    {
        "detail": "Inserts a line break.",
        "insertText": "linebreak(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "linebreak"
    },
    {
        "detail": "Links to a URL or a location in the document.",
        "insertText": "link(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "link"
    },
    {
        "detail": "A bullet list.",
        "insertText": "list(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "list"
    },
    {
        "detail": "Provides access to the location of content.",
        "insertText": "locate(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "locate"
    },
    {
        "detail": "Creates blind text.",
        "insertText": "lorem(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "lorem"
    },
    {
        "detail": "Converts text or content to lowercase.",
        "insertText": "lower(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "lower"
    },
    {
        "detail": "Creates a grayscale color.",
        "insertText": "luma(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "luma"
    },
    {
        "detail": "<module math>",
        "insertTextFormat": 2,
        "kind": 21,
        "label": "math"
    },
    {
        "detail": "Measures the layouted size of content.",
        "insertText": "measure(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "measure"
    },
    {
        "detail": "Exposes a value to the query system without producing visible content.",
        "insertText": "metadata(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "metadata"
    },
    {
        "detail": "Moves content without affecting layout.",
        "insertText": "move(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "move"
    },
    {
        "detail": "Applies a numbering to a sequence of numbers.",
        "insertText": "numbering(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "numbering"
    },
    {
        "detail": "A table of contents, figures, or other elements.",
        "insertText": "outline(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "outline"
    },
    {
        "detail": "Adds a line over text.",
        "insertText": "overline(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "overline"
    },
    {
        "detail": "Adds spacing around content.",
        "insertText": "pad(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "pad"
    },
    {
        "detail": "Layouts its child onto one or multiple pages.",
        "insertText": "page(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "page"
    },
    {
        "detail": "A manual page break.",
        "insertText": "pagebreak(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "pagebreak"
    },
    {
        "detail": "Fails with an error.",
        "insertText": "panic(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "panic"
    },
    {
        "detail": "Arranges text, spacing and inline-level elements into a paragraph.",
        "insertText": "par(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "par"
    },
    {
        "detail": "A paragraph break.",
        "insertText": "parbreak(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "parbreak"
    },
    {
        "detail": "A path through a list of points, connected by Bezier curves.",
        "insertText": "path(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "path"
    },
    {
        "detail": "Places content at an absolute position.",
        "insertText": "place(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "place"
    },
    {
        "detail": "A closed polygon.",
        "insertText": "polygon(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "polygon"
    },
    {
        "detail": "Finds elements in the document.",
        "insertText": "query(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "query"
    },
    {
        "detail": "Creates an array consisting of consecutive integers.",
        "insertText": "range(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "range"
    },
    {
        "detail": "Raw text with optional syntax highlighting.",
        "insertText": "raw(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "raw"
    },
    {
        "detail": "Reads plain text or data from a file.",
        "insertText": "read(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "read"
    },
    {
        "detail": "A rectangle with optional content.",
        "insertText": "rect(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "rect"
    },
    {
        "detail": "A reference to a label or bibliography.",
        "insertText": "ref(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "ref"
    },
    {
        "detail": "Creates a regular expression from a string.",
        "insertText": "regex(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "regex"
    },
    {
        "detail": "Repeats content to the available space.",
        "insertText": "repeat(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "repeat"
    },
    {
        "detail": "Returns the string representation of a value.",
        "insertText": "repr(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "repr"
    },
    {
        "detail": "Creates an RGB(A) color.",
        "insertText": "rgb(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "rgb"
    },
    {
        "detail": "Rotates content without affecting layout.",
        "insertText": "rotate(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "rotate"
    },
    {
        "detail": "Scales content without affecting layout.",
        "insertText": "scale(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "scale"
    },
    {
        "detail": "Turns a value into a selector.",
        "insertText": "selector(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "selector"
    },
    {
        "detail": "Displays text in small capitals.",
        "insertText": "smallcaps(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "smallcaps"
    },
    {
        "detail": "A language-aware quote that reacts to its context.",
        "insertText": "smartquote(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "smartquote"
    },
    {
        "detail": "A square with optional content.",
        "insertText": "square(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "square"
    },
    {
        "detail": "Arranges content and spacing horizontally or vertically.",
        "insertText": "stack(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "stack"
    },
    {
        "detail": "Manages stateful parts of your document.",
        "insertText": "state(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "state"
    },
    {
        "detail": "Converts a value to a string.",
        "insertText": "str(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "str"
    },
    {
        "detail": "Strikes through text.",
        "insertText": "strike(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "strike"
    },
    {
        "detail": "Strongly emphasizes content by increasing the font weight.",
        "insertText": "strong(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "strong"
    },
    {
        "detail": "Provides access to active styles.",
        "insertText": "style(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "style"
    },
    {
        "detail": "Renders text in subscript.",
        "insertText": "sub(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "sub"
    },
    {
        "detail": "Renders text in superscript.",
        "insertText": "super(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "super"
    },
    {
        "detail": "<module sym>",
        "insertTextFormat": 2,
        "kind": 21,
        "label": "sym"
    },
    {
        "detail": "Creates a custom symbol with modifiers.",
        "insertText": "symbol(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "symbol"
    },
    {
        "detail": "A table of items.",
        "insertText": "table(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "table"
    },
    {
        "detail": "A list of terms and their descriptions.",
        "insertText": "terms(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "terms"
    },
    {
        "detail": "Customizes the look and layout of text in a variety of ways.",
        "insertText": "text(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "text"
    },
    {
        "detail": "Reads structured data from a TOML file.",
        "insertText": "toml(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "toml"
    },
    {
        "detail": "Determines the type of a value.",
        "insertText": "type(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "type"
    },
    {
        "detail": "Underlines text.",
        "insertText": "underline(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "underline"
    },
    {
        "detail": "Converts text or content to uppercase.",
        "insertText": "upper(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "upper"
    },
    {
        "detail": "Inserts vertical spacing into a flow of blocks.",
        "insertText": "v(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "v"
    },
    {
        "detail": "Reads structured data from an XML file.",
        "insertText": "xml(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "xml"
    },
    {
        "detail": "Reads structured data from a YAML file.",
        "insertText": "yaml(${1:})",
        "insertTextFormat": 2,
        "kind": 3,
        "label": "yaml"
    },
    {
        "insertTextFormat": 2,
        "kind": 21,
        "label": "booktab"
    },
    {
        "insertTextFormat": 2,
        "kind": 21,
        "label": "emp_block"
    },
    {
        "insertTextFormat": 2,
        "kind": 21,
        "label": "header_size_increment"
    },
    {
        "insertTextFormat": 2,
        "kind": 21,
        "label": "text_base_size"
    },
    {
        "insertTextFormat": 2,
        "kind": 21,
        "label": "text_h1_size"
    },
    {
        "detail": "Evaluates a function.",
        "insertText": "${1:function}(${2:arguments})[${3:body}]",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "function call"
    },
    {
        "detail": "Inserts a nested code block.",
        "insertText": "{ ${1:} }",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "code block"
    },
    {
        "detail": "Switches into markup mode.",
        "insertText": "[${1:content}]",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "content block"
    },
    {
        "detail": "Sets style properties on an element.",
        "insertText": "set ${1:}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "set rule"
    },
    {
        "detail": "Redefines the look of an element.",
        "insertText": "show ${1:}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "show rule"
    },
    {
        "detail": "Transforms everything that follows.",
        "insertText": "show: ${1:}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "show rule (everything)"
    },
    {
        "detail": "Saves a value in a variable.",
        "insertText": "let ${1:name} = ${2:value}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "let binding"
    },
    {
        "detail": "Defines a function.",
        "insertText": "let ${1:name}(${2:params}) = ${3:output}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "let binding (function)"
    },
    {
        "detail": "Computes or inserts something conditionally.",
        "insertText": "if ${1:1 < 2} {\n\t${2:}\n}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "if conditional"
    },
    {
        "detail": "Computes or inserts different things based on a condition.",
        "insertText": "if ${1:1 < 2} {\n\t${2:}\n} else {\n\t${3:}\n}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "if-else conditional"
    },
    {
        "detail": "Computes or inserts something while a condition is met.",
        "insertText": "while ${1:1 < 2} {\n\t${2:}\n}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "while loop"
    },
    {
        "detail": "Computes or inserts something for each value in a collection.",
        "insertText": "for ${1:value} in ${2:(1, 2, 3)} {\n\t${3:}\n}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "for loop"
    },
    {
        "detail": "Computes or inserts something for each key and value in a collection.",
        "insertText": "for (${1:key}, ${2:value}) in ${3:(a: 1, b: 2)} {\n\t${4:}\n}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "for loop (with key)"
    },
    {
        "detail": "Exits early from a loop.",
        "insertText": "break",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "break"
    },
    {
        "detail": "Continues with the next iteration of a loop.",
        "insertText": "continue",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "continue"
    },
    {
        "detail": "Returns early from a function.",
        "insertText": "return ${1:output}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "return"
    },
    {
        "detail": "Imports variables from another file.",
        "insertText": "import \"${1:file}.typ\": ${2:items}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "import (file)"
    },
    {
        "detail": "Imports variables from another file.",
        "insertText": "import \"@${1:}\": ${2:items}",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "import (package)"
    },
    {
        "detail": "Includes content from another file.",
        "insertText": "include \"${1:file}.typ\"",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "include (file)"
    },
    {
        "detail": "Includes content from another file.",
        "insertText": "include \"@${1:}\"",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "include (package)"
    },
    {
        "detail": "Creates a sequence of values.",
        "insertText": "(${1:1, 2, 3})",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "array literal"
    },
    {
        "detail": "Creates a mapping from names to value.",
        "insertText": "(${1:a: 1, b: 2})",
        "insertTextFormat": 2,
        "kind": 15,
        "label": "dictionary literal"
    }
]

[Trace - 23:01:28] Sending request 'textDocument/documentSymbol - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/%E6%96%87/Falken%28typst%29/test.typ"
    }
}

thread 'main' panicked at 'span should be in source since we got it using the span', src\lsp_typst_boundary.rs:240:14
stack backtrace:
[Trace - 23:01:28] Received notification 'window/logMessage'.
Params: {
    "message": "src\\server\\lsp.rs:185 { message = server initialized; }",
    "type": 3
}

[Info  - 23:01:28] src\server\lsp.rs:185 { message = server initialized; }
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 23:01:28] Connection to server got closed. Server will restart.
true
[Trace - 23:01:28] Sending request 'initialize - (0)'.
Params: {
    "processId": 23788,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.81.1"
    },
    "locale": "zh-cn",
    "rootPath": "d:\\文",
    "rootUri": "file:///d%3A/%E6%96%87",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": true
                }
            },
            "configuration": true,
            "didChangeWatchedFiles": {
                "dynamicRegistration": true,
                "relativePatternSupport": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "resolveSupport": {
                    "properties": [
                        "location.range"
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "workspaceFolders": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            },
            "inlineValue": {
                "refreshSupport": true
            },
            "inlayHint": {
                "refreshSupport": true
            },
            "diagnostics": {
                "refreshSupport": true
            }
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "insertReplaceSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    },
                    "labelDetailsSupport": true
                },
                "insertTextMode": 2,
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                },
                "completionList": {
                    "itemDefaults": [
                        "commitCharacters",
                        "editRange",
                        "insertTextFormat",
                        "insertTextMode"
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    },
                    "activeParameterSupport": true
                },
                "contextSupport": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
                "honorsChangeAnnotations": false
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "prepareSupportDefaultBehavior": 1,
                "honorsChangeAnnotations": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true,
                "foldingRangeKind": {
                    "valueSet": [
                        "comment",
                        "imports",
                        "region"
                    ]
                },
                "foldingRange": {
                    "collapsedText": false
                }
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator",
                    "decorator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false,
                "serverCancelSupport": true,
                "augmentsSyntaxTokens": true
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            },
            "typeHierarchy": {
                "dynamicRegistration": true
            },
            "inlineValue": {
                "dynamicRegistration": true
            },
            "inlayHint": {
                "dynamicRegistration": true,
                "resolveSupport": {
                    "properties": [
                        "tooltip",
                        "textEdits",
                        "label.tooltip",
                        "label.location",
                        "label.command"
                    ]
                }
            },
            "diagnostic": {
                "dynamicRegistration": true,
                "relatedDocumentSupport": false
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "staleRequestSupport": {
                "cancel": true,
                "retryOnContentModified": [
                    "textDocument/semanticTokens/full",
                    "textDocument/semanticTokens/range",
                    "textDocument/semanticTokens/full/delta"
                ]
            },
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            },
            "positionEncodings": [
                "utf-16"
            ]
        },
        "notebookDocument": {
            "synchronization": {
                "dynamicRegistration": true,
                "executionSummarySupport": true
            }
        }
    },
    "initializationOptions": {
        "exportPdf": "onSave",
        "rootPath": null,
        "semanticTokens": "enable",
        "serverPath": null,
        "trace": {
            "server": "verbose"
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///d%3A/%E6%96%87",
            "name": "文"
        },
        {
            "uri": "file:///d%3A/%E6%96%87/Falken%28typst%29",
            "name": "Falken(typst)"
        },
        {
            "uri": "file:///d%3A/%E6%96%87/pachina",
            "name": "pachina"
        },
        {
            "uri": "file:///d%3A/%E6%96%87/purple_cabbage",
            "name": "purple_cabbage"
        },
        {
            "uri": "file:///d%3A/%E6%96%87/zuikaku",
            "name": "zuikaku"
        },
        {
            "uri": "file:///d%3A/%E6%96%87/matlab_test",
            "name": "matlab_test"
        }
    ]
}

[Trace - 23:01:28] Received response 'initialize - (0)' in 240ms.
Result: {
    "capabilities": {
        "completionProvider": {
            "triggerCharacters": [
                "#",
                ".",
                "@"
            ]
        },
        "documentSymbolProvider": true,
        "executeCommandProvider": {
            "commands": [
                "typst-lsp.doPdfExport",
                "typst-lsp.doClearCache"
            ]
        },
        "hoverProvider": true,
        "selectionRangeProvider": true,
        "signatureHelpProvider": {
            "triggerCharacters": [
                "(",
                ","
            ]
        },
        "textDocumentSync": {
            "change": 2,
            "openClose": true,
            "save": true
        },
        "workspace": {
            "workspaceFolders": {
                "changeNotifications": true,
                "supported": true
            }
        },
        "workspaceSymbolProvider": true
    }
}

[Trace - 23:01:28] Sending notification 'initialized'.
Params: {}

[Trace - 23:01:28] Received notification 'window/logMessage'.
Params: {
    "message": "src\\workspace\\package\\external\\manager.rs:48 { message = got user external package directory; user = LocalProvider { root: \"C:\\\\Users\\\\Falke\\\\AppData\\\\Roaming\\\\typst/packages/\" }; }",
    "type": 3
}

[Info  - 23:01:28] src\workspace\package\external\manager.rs:48 { message = got user external package directory; user = LocalProvider { root: "C:\\Users\\Falke\\AppData\\Roaming\\typst/packages/" }; }
[Trace - 23:01:28] Received notification 'window/logMessage'.
Params: {
    "message": "src\\workspace\\package\\external\\manager.rs:58 { message = got external package cache; cache = LocalProvider { root: \"C:\\\\Users\\\\Falke\\\\AppData\\\\Local\\\\typst/packages/\" }; }",
    "type": 3
}

[Info  - 23:01:28] src\workspace\package\external\manager.rs:58 { message = got external package cache; cache = LocalProvider { root: "C:\\Users\\Falke\\AppData\\Local\\typst/packages/" }; }
[Trace - 23:01:28] Received notification 'window/logMessage'.
Params: {
    "message": "src\\workspace\\package\\manager.rs:42 { message = initialized package manager; current = {Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87/pachina\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87/pachina\" }, Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87/purple_cabbage\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87/purple_cabbage\" }, Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87/zuikaku\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87/zuikaku\" }, Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87/matlab_test\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87/matlab_test\" }, Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87/Falken%28typst%29\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87/Falken%28typst%29\" }, Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/d%3A/%E6%96%87\", query: None, fragment: None }: Package { root: \"file:///d%3A/%E6%96%87\" }}; external = ExternalPackageManager { providers: [LocalProvider { root: \"C:\\\\Users\\\\Falke\\\\AppData\\\\Roaming\\\\typst/packages/\" }, LocalProvider { root: \"C:\\\\Users\\\\Falke\\\\AppData\\\\Local\\\\typst/packages/\" }], cache: Some(LocalProvider { root: \"C:\\\\Users\\\\Falke\\\\AppData\\\\Local\\\\typst/packages/\" }), repo: Some(RemoteRepoProvider { base_url: Url { scheme: \"https\", cannot_be_a_base: false, username: \"\", password: None, host: Some(Domain(\"packages.typst.org\")), port: None, path: \"/\", query: None, fragment: None }, client: Client { accepts: Accepts, proxies: [Proxy(System({}), None)], referer: true, default_headers: {\"accept\": \"*/*\"}, timeout: 30s } }) }; }",
    "type": 3
}

[Info  - 23:01:28] src\workspace\package\manager.rs:42 { message = initialized package manager; current = {Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87/pachina", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87/pachina" }, Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87/purple_cabbage", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87/purple_cabbage" }, Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87/zuikaku", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87/zuikaku" }, Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87/matlab_test", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87/matlab_test" }, Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87/Falken%28typst%29", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87/Falken%28typst%29" }, Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/d%3A/%E6%96%87", query: None, fragment: None }: Package { root: "file:///d%3A/%E6%96%87" }}; external = ExternalPackageManager { providers: [LocalProvider { root: "C:\\Users\\Falke\\AppData\\Roaming\\typst/packages/" }, LocalProvider { root: "C:\\Users\\Falke\\AppData\\Local\\typst/packages/" }], cache: Some(LocalProvider { root: "C:\\Users\\Falke\\AppData\\Local\\typst/packages/" }), repo: Some(RemoteRepoProvider { base_url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("packages.typst.org")), port: None, path: "/", query: None, fragment: None }, client: Client { accepts: Accepts, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*"}, timeout: 30s } }) }; }
[Trace - 23:01:28] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///d%3A/%E6%96%87/Falken%28typst%29/test.typ",
        "languageId": "typst",
        "version": 10,
        "text": "#let text_base_size=10pt\r\n#let text_h1_size=20pt\r\n#let header_size_increment=3pt\r\n#set page(\r\n  paper: \"a4\",\r\n  header: align(right)[\r\n    Multi-purpose Combat Chassis [FALKEN]\r\n  ],\r\n  numbering: \"1\",\r\n  margin: (x:20mm, y:12.7mm)\r\n)\r\n#set par(justify: true)\r\n#set text(\r\n  font: \"LXGW WenKai\",\r\n  size: text_base_size,\r\n)\r\n#let emp_block(body,fill:luma(230),stroke:orange) = {\r\n  block(\r\n    width:100%,\r\n    fill: fill,\r\n    inset: 8pt,\r\n    radius: 0pt,\r\n    stroke: (left:(stroke+3pt),right:(luma(200)+3pt)),\r\n    body,\r\n  )\r\n}\r\n\r\n#let booktab() = {\r\n  block(\r\n    width: 100%,\r\n    [\r\n      #line(length: 100%,stroke: 3pt+luma(140))\r\n      #move(line(length: 100%), dx: 0pt, dy: -9pt)\r\n    ]\r\n  )\r\n  v(0pt, weak: true)\r\n}\r\n\r\n#show heading: it => block[\r\n  #let heading_size=text_h1_size - (it.level - 1) * header_size_increment\r\n  #set text(size: heading_size, font: \"HarmonyOS Sans SC\")\r\n  #if it.body.text.contains(\".\") [\r\n    #text(font: \"LXGW WenKai\", it.body)\r\n  ] else [\r\n    #emph(it.body)\r\n  ]\r\n]\r\n\r\n= test\r\n\r\n- [#s]"
    }
}
nvarner commented 10 months ago

@KagaJiankui thanks for such detailed logs! This looks like the same issue as #241. That issue has more conversation on this, so I'll close this in favor of it.